Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Apr 6th, 2012  |  syntax: Make  |  size: 1.24 KB  |  views: 32  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. #==================================
  2. # Makefile for building: libsopp.a
  3. #==================================
  4.  
  5. # Definitions
  6. #------------
  7.  
  8. # C compiler
  9. CC            = gcc
  10. # C++ compiler
  11. CXX           = g++
  12. # Include file directory
  13. INCLUDES       = -I ./include -I ./jsoncpp/include
  14. # Object file directory
  15. OBJ_DIR       = ./obj
  16. # C++ flags
  17. CXXFLAGS      = -W -Wall -Wextra -Wno-unused -std=c++03 -march=native -O3
  18.  
  19.  
  20. # Macros
  21. #-------
  22.  
  23. # Tests for the obj directory
  24. TEST_OBJ      = test -d obj
  25. # Makes the obj directory
  26. MAKE_OBJ      = mkdir obj
  27. # Removes the obj directory
  28. REM_OBJ       = rm -rf obj
  29.  
  30. .phony: all clean json
  31.  
  32. all: json object_directory soAnswer.o soUser.o soComment.o soQuestion.o soSite.o soTime.o soUser.o fetch_url.o global.o key.o
  33.         ar -r libsopp.a jsoncpp/libjsoncpp.a obj/soAnswer.o obj/soComment.o obj/soQuestion.o obj/soSite.o obj/soTime.o obj/soUser.o obj/fetch_url.o obj/global.o obj/key.o
  34.  
  35. clean:
  36.         $(REM_OBJ)
  37.  
  38. %.o: src/%.cpp
  39.         $(CXX) $(CXXFLAGS) $(INCLUDES) -c -o obj/$@ $<
  40.  
  41. object_directory:
  42.         $(TEST_OBJ) || $(MAKE_OBJ)
  43.  
  44. json:
  45.         $(MAKE) -C jsoncpp
  46.  
  47. install:
  48.         sudo cp -r include/sopp --target-directory=/usr/include
  49.         cp libsopp.a /usr/lib/libsopp.a