2014-01-06 19:19:17 +00:00
|
|
|
##################################################
|
|
|
|
# Makefile for building lib and main test routine#
|
|
|
|
##################################################
|
2014-01-14 19:58:27 +00:00
|
|
|
#LOCATION=debian7
|
2014-01-14 21:43:59 +00:00
|
|
|
#LOCATION=debian6
|
|
|
|
LOCATION=osx10.8
|
2014-01-09 01:35:37 +00:00
|
|
|
|
2014-01-06 19:19:17 +00:00
|
|
|
SYSTEM = $(shell uname -s)
|
|
|
|
|
|
|
|
CXX = g++
|
|
|
|
CC = gcc
|
|
|
|
|
2014-01-09 01:35:37 +00:00
|
|
|
#PRODORDEV += -O2
|
|
|
|
PRODORDEV += -ggdb3
|
|
|
|
|
|
|
|
CXXFLAGS = $(PRODORDEV) -Wall -Wpointer-arith -Wcast-qual -D_REENTRANT -fPIC
|
|
|
|
CPPFLAGS = -fPIC -D_GNU_SOURCE
|
|
|
|
CXXFLAGS += -D_GNU_SOURCE -O0
|
|
|
|
|
2014-01-14 19:58:27 +00:00
|
|
|
ifeq ($(LOCATION),debian7)
|
|
|
|
XALAN_LIB_DIR = /usr/local/lib/
|
|
|
|
XALAN_LIB = xalan-c
|
|
|
|
XALAN_INC_DIR = /usr/local/include/xalanc
|
|
|
|
XERCES_LIB_DIR = /usr/local/lib/
|
|
|
|
XERCES_LIB = xerces-c
|
|
|
|
XERCES_INC_DIR = /usr/local/include/xercesc
|
2014-01-14 21:43:59 +00:00
|
|
|
endif
|
|
|
|
ifeq ($(LOCATION),debian6)
|
2014-01-09 01:35:37 +00:00
|
|
|
XALAN_LIB_DIR = /usr/lib/
|
|
|
|
XALAN_LIB = xalan-c
|
|
|
|
XALAN_INC_DIR = /usr/include/xalanc
|
|
|
|
XERCES_LIB_DIR = /usr/lib/
|
|
|
|
XERCES_LIB = xerces-c
|
2014-01-14 19:58:27 +00:00
|
|
|
XERCES_INC_DIR = /usr/include/xercesc
|
|
|
|
endif
|
2014-01-14 21:43:59 +00:00
|
|
|
ifeq ($(LOCATION),osx10.8)
|
|
|
|
XALAN_LIB_DIR = /opt/local/lib/
|
|
|
|
XALAN_LIB = xalan-c
|
|
|
|
XALAN_INC_DIR = /opt/local/include/
|
|
|
|
XERCES_LIB_DIR = /opt/local/lib/
|
|
|
|
XERCES_LIB = xerces-c
|
|
|
|
XERCES_INC_DIR = /opt/local/include/
|
|
|
|
endif
|
2014-01-06 19:19:17 +00:00
|
|
|
|
|
|
|
include xml-deps.mk
|
|
|
|
|
|
|
|
##### Set this to the location of the library to be produced
|
|
|
|
|
|
|
|
BUILD_LIB_DIR = lib
|
|
|
|
BUILD_OBJ_DIR = build
|
|
|
|
|
|
|
|
###### Include Paths
|
|
|
|
|
|
|
|
INCLUDE_DIR = -I . -I $(XERCES_INC_DIR) -I $(XALAN_INC_DIR)
|
|
|
|
|
|
|
|
build_obj_dir = $(BUILD_OBJ_DIR)
|
|
|
|
|
|
|
|
src_dirs_cpp = se se/secDNS common session xml
|
|
|
|
src_dirs_c = config
|
|
|
|
srcs_all = $(foreach dir,$(src_dirs_cpp),$(wildcard $(dir)/*.cpp))
|
|
|
|
srcs_all += $(foreach dir,$(src_dirs_c),$(wildcard $(dir)/*.c))
|
|
|
|
|
|
|
|
srcs = $(filter-out %Test.cpp,$(srcs_all))
|
|
|
|
objs = $(foreach file,$(srcs),$(build_obj_dir)/$(basename $(notdir $(file))).o)
|
|
|
|
test_srcs = $(filter %Test.cpp,$(srcs_all))
|
|
|
|
test_objs = $(foreach file,$(test_srcs),$(build_obj_dir)/$(basename $(notdir $(file))).o)
|
|
|
|
test_execs = $(subst .o,,$(test_objs))
|
|
|
|
|
|
|
|
calc_deps = \
|
|
|
|
$(CC) -MT '$(build_obj_dir)/$(basename $(notdir $@)).o $@' -MF $@ -MM $(CPPFLAGS) $(INCLUDE_DIR) $<
|
|
|
|
|
2014-01-09 01:35:37 +00:00
|
|
|
all: dirs $(objs) $(BUILD_LIB_DIR)/libACTK1_0.so
|
2014-01-06 19:19:17 +00:00
|
|
|
|
|
|
|
%.d: %.c
|
|
|
|
$(calc_deps)
|
|
|
|
%.d: %.cpp
|
|
|
|
$(calc_deps)
|
|
|
|
include $(foreach name,$(srcs_all),$(basename $(name)).d)
|
|
|
|
|
|
|
|
vpath %.cpp ./ \
|
|
|
|
./se\
|
|
|
|
./se/secDNS\
|
|
|
|
./xml\
|
|
|
|
./common\
|
|
|
|
./session\
|
|
|
|
|
|
|
|
vpath %.c ./config
|
|
|
|
|
|
|
|
vpath %.o ../build
|
|
|
|
|
|
|
|
####### Implicit rules
|
|
|
|
|
|
|
|
.SUFFIXES: .cpp .c
|
|
|
|
|
|
|
|
$(BUILD_OBJ_DIR)/%.o: %.cpp
|
|
|
|
$(CXX) $(CXXFLAGS) -c -o $@ $(INCLUDE_DIR) $<
|
|
|
|
|
|
|
|
$(BUILD_OBJ_DIR)/%.o: %.c
|
|
|
|
$(CC) $(CPPFLAGS) -c -o $@ $(INCLUDE_DIR) $<
|
|
|
|
|
|
|
|
|
2014-01-09 01:35:37 +00:00
|
|
|
LDFLAGS_TESTS = -L$(BUILD_LIB_DIR) -lACTK1_0 \
|
2014-01-09 02:50:51 +00:00
|
|
|
-L$(XALAN_LIB_DIR) -lxalan-c -lxalanMsg \
|
2014-01-06 19:19:17 +00:00
|
|
|
-L$(XERCES_LIB_DIR) -lxerces-c \
|
|
|
|
-lssl \
|
|
|
|
-lrt
|
|
|
|
|
|
|
|
$(BUILD_OBJ_DIR)/%: $(BUILD_OBJ_DIR)/%.o
|
|
|
|
$(CXX) $(LDFLAGS_TESTS) -o $@ $<
|
|
|
|
|
|
|
|
.PHONY: doc clean dclean
|
|
|
|
####### Build rules
|
|
|
|
|
2014-01-09 01:35:37 +00:00
|
|
|
#libAusreg_EPP_toolkit.a: $(OBJECTS)
|
2014-01-06 19:19:17 +00:00
|
|
|
# $(LIB_ARCHIVER) $(LIB_FLAGS) $(BUILD_LIB_DIR)/$@ $^
|
|
|
|
|
|
|
|
|
|
|
|
.PHONY: tests
|
|
|
|
tests: all $(test_execs)
|
|
|
|
|
|
|
|
|
|
|
|
.PHONY: dirs
|
|
|
|
dirs:
|
|
|
|
-mkdir -p $(BUILD_LIB_DIR)
|
|
|
|
-mkdir -p $(BUILD_OBJ_DIR)
|
|
|
|
|
2014-01-10 21:25:13 +00:00
|
|
|
libACTK1_0.so:
|
2014-01-09 01:35:37 +00:00
|
|
|
$(BUILD_LIB_DIR)/libACTK1_0.so: $(objs)
|
|
|
|
$(CXX) $(LDFLAGS) $(PRODORDEV) -shared $^ -o $@
|
2014-01-06 19:19:17 +00:00
|
|
|
|
|
|
|
doc:
|
|
|
|
doxygen etc/Doxyfile
|
|
|
|
|
|
|
|
clean:
|
2014-01-09 01:35:37 +00:00
|
|
|
$(RM) $(objs) $(BUILD_LIB_DIR)/libACTK1_0.so *~
|
2014-01-06 19:19:17 +00:00
|
|
|
$(RM) -r $(BUILD_OBJ_DIR)
|
|
|
|
$(RM) -r $(BUILD_LIB_DIR)
|
|
|
|
|
|
|
|
dclean:
|
|
|
|
$(MAKE) clean
|
|
|
|
$(RM) */*.d
|
|
|
|
|