Makefile 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. LIB_PATH = ../..
  2. include ../../Make.conf
  3. GIT_VERSION=$(shell git log . | head -n 4 | grep "commit" | cut -d " " -f 2 | cut -c 1-7)
  4. SVN_REVISION = $(shell test -d .svn && (svn info | grep "Last Changed Rev" | cut -d " " -f 4))
  5. ifeq "$(SVN_REVISION)a" "a"
  6. SVN_REVISION = "(unknown)"
  7. endif
  8. SRC_FOLDER := $(shell find ../../libs/common -maxdepth 1 -type d)
  9. VPATH = ../../libs/common ../../configcenter/ca_api/ $(basename $(patsubst ./%, %/, $(SRC_FOLDER)))
  10. ################compile#############
  11. target = libdtc.a container_api.pic.o version.pic.o somain.pic.o libdtc.so libdtc.pic.a
  12. # CLIENTAPI macro use for scope test only
  13. CFLAGS += -DCLIENTAPI
  14. CFLAGS += -D_GLIBCXX_USE_CXX11_ABI=0 -std=gnu++11
  15. CFLAGS += -pthread -I../../libs/common -I../../stat -I../../configcenter/ca_api/ $(LOG4CPLUS_INC) $(ZINC) $(YAML_CPP_INC)
  16. LIBS = ${Z_LIB} -ldl -lpthread $(LOG4CPLUS_LIB) $(CA_API_LIB) -L../../libs/common -lcommon $(YAML_CPP_LIB)
  17. filelist := dtcreq value dtcsvr dtcpool dtcwrap dtcwrapp dtcqossvr \
  18. poller timer_list key_list table_def log_client mem_check \
  19. md5 section decode encode field_api packet_base \
  20. packet_client task_base task_const socket_addr udppool compress buffer thread
  21. #filelist := dtcreq
  22. #lidttc.so: container_api.pic.o version.pic.o
  23. # for auto ln -sf
  24. libdtc_objs := $(patsubst %,%.o,$(filelist))
  25. libdtc.so: LDFLAGS += -Wl,--version-script,dtcapi.lst -e _so_start container_api.pic.o version.pic.o somain.pic.o
  26. libdtc_filename := libdtc-gcc-$(GCCVER)-r$(GIT_VERSION).so
  27. libdtc_soname := libdtc.so.1
  28. ###############install##############
  29. target_install = libdtc.a libdtc.pic.a libdtc.so dtcapi.h
  30. install_dir = ../../../bin
  31. %.a: install_dir = ../../../lib
  32. %.h: install_dir = ../../../include
  33. include ../../Make.rules