Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Apr 6th, 2012  |  syntax: Make  |  size: 1.06 KB  |  views: 35  |  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: libjsoncpp.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
  14. # Object file directory
  15. OBJ_DIR       = ./obj
  16. # C++ flags
  17. CXXFLAGS      = -W -Wall -Wextra -Wno-unused -pedantic -std=c++03 -march=native -O3
  18.  
  19. # Macros
  20. #-------
  21.  
  22. # Tests for the obj directory
  23. TEST_OBJ      = test -d obj
  24. # Makes the obj directory
  25. MAKE_OBJ      = mkdir obj
  26. # Removes the obj directory
  27. REM_OBJ       = rm -rf obj
  28.  
  29. .phony: all clean
  30.  
  31. all: object_directory json_reader.o json_writer.o json_value.o
  32.         ar -r libjsoncpp.a obj/json_reader.o obj/json_writer.o obj/json_value.o
  33.  
  34. clean:
  35.         $(REM_OBJ)
  36.  
  37. %.o: src/lib_json/%.cpp
  38.         $(CXX) $(CXXFLAGS) $(INCLUDES) -c -o obj/$@ $<
  39.  
  40. object_directory:
  41.         $(TEST_OBJ) || $(MAKE_OBJ)
  42.  
  43. install:
  44.         sudo cp -r include/json --target-directory=/usr/include
  45.         cp libjsoncpp.a /usr/lib/libjsoncpp.a
clone this paste RAW Paste Data