Guest User

Untitled

a guest
Aug 4th, 2010
135
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. INC_DIR       = ./include
  14. # Object file directory
  15. OBJ_DIR       = ./obj
  16.  
  17. # Phony declarations
  18. #-------------------
  19. .PHONY: install clean object_directory
  20.  
  21. # Macros
  22. #-------
  23.  
  24. # Tests for the lib directory
  25. TEST_LIB          = test -d /usr/lib/json
  26. # Make the lib directory
  27. MAKE_LIB          = mkdir /usr/lib/json
  28. # Tests for the obj directory
  29. TEST_OBJ          = test -d obj
  30. # Tests for the absence of the obj directory
  31. TEST_AGAINST_OBJ  = test ! -d obj
  32. # Tests for the absence of libjsoncpp.a
  33. TEST_AGAINST_A    = test ! -e libjsoncpp.a
  34. # Tests for the absence of libjsoncpp.so
  35. TEST_AGAINST_SO    = test ! -e libjsoncpp.so
  36. # Makes the obj directory
  37. MAKE_OBJ          = mkdir obj
  38. # Removes the obj directory
  39. REM_OBJ           = rm -r obj
  40.  
  41. all: object_directory json_reader.o json_writer.o json_value.o
  42.     ar -r libjsoncpp.a obj/json_reader.o obj/json_writer.o obj/json_value.o
  43.     g++ -o libjsoncpp.so -shared obj/json_reader.o obj/json_writer.o obj/json_value.o
  44.  
  45. json_reader.o: src/lib_json/json_reader.cpp
  46.     $(CXX) -I $(INC_DIR) -c -o obj/json_reader.o src/lib_json/json_reader.cpp -fPIC
  47.  
  48. json_writer.o: src/lib_json/json_writer.cpp
  49.     $(CXX) -I $(INC_DIR) -c -o obj/json_writer.o src/lib_json/json_writer.cpp -fPIC
  50.  
  51. json_value.o: src/lib_json/json_value.cpp
  52.     $(CXX) -I $(INC_DIR) -c -o obj/json_value.o src/lib_json/json_value.cpp -fPIC
  53.  
  54. object_directory:
  55.     $(TEST_OBJ) || $(MAKE_OBJ)
  56.  
  57. install:
  58.     mkdir -p $(DESTDIR)/usr/include
  59.     mkdir -p $(DESTDIR)/usr/lib
  60.     cp -r include/json --target-directory=$(DESTDIR)/usr/include
  61.     cp libjsoncpp.a $(DESTDIR)/usr/lib/libjsoncpp.a
  62.     cp libjsoncpp.so $(DESTDIR)/usr/lib/libjsoncpp.so
  63.  
  64. clean:
  65.     $(TEST_AGAINST_OBJ) || $(REM_OBJ)
  66.     $(TEST_AGAINST_A)   || rm libjsoncpp.a
  67.     $(TEST_AGAINST_SO)  || rm libjsoncpp.so
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×