# CC=gcc # Requirements: # 1) gsoap installation (bin lib and inludes) # 2) a host to hold the wsdl file (could be a local path) # make gen to generate gsoap bindings # make lib to create a client-side library # make client to build examples. #------------------------------------------------ $(info --------------------------------------------------------------------------------) ifdef MAUS_THIRD_PARTY $(info Running with defined MAUS_THIRD_PARTY=${MAUS_THIRD_PARTY} - (MAUS environment) ) LIBXML2=${MAUS_THIRD_PARTY}/third_party/install/ GSOAP=${MAUS_THIRD_PARTY}/third_party/install/ GTEST_INC=${MAUS_THIRD_PARTY}/third_party/install/include/gtest GTEST_LIB=${MAUS_THIRD_PARTY}/third_party/install/lib else $(info Running with custom settings...(NOT for MAUS !!!) ) GSOAP=/Users/martynia/Software/gsoap/gsoap-2.8.30/ LIBXML2=/opt/local GTEST_INC=/opt/local/include GTEST_LIB=/opt/local/lib endif CDBVERSION=1.0.4 $(info CDB API version is set to: ${CDBVERSION}) $(info libxml2 path is set to: ${LIBXML2}) $(info gaoap path is set to: ${GSOAP}) WSDL_HOST=http://cdb.mice.rl.ac.uk/cdb $(info Web Service description will be downloaded from: ${WSDL_HOST} if needed) $(info --------------------------------------------------------------------------------) # no changes should be required below this line. #================================================ GSOAP_BIN=$(GSOAP)/bin GSOAP_LIB=$(GSOAP)/lib GSOAP_INC=$(GSOAP)/include LIBXML2_LIB=$(LIBXML2)/lib LIBXML2_INC=$(LIBXML2)/include INCL=/opt/local/include WSDL2H=$(GSOAP_BIN)/wsdl2h SOAPCPP2=$(GSOAP_BIN)/soapcpp2 LIBCDB=libcdbc++.${CDBVERSION}.a SRC_FILES := $(wildcard src/*.cpp) $(wildcard src/*/*.cpp) INC_FILES := $(wildcard include/*.h) $(wildcard include/*/*.h) EXAMPLE_SRC_FILES :=$(wildcard examples/*.cpp) $(wildcard examples/*/*.cpp) $(wildcard examples/*/*/*.cpp) TEST_SRC_FILES := $(wildcard test/*.cpp) $(wildcard test/*/*.cpp) $(wildcard test/*/*/*.cpp) #SRC_FILES := $(filter-out %/soapClient.c, $(SRC_FILES)) #SRC_FILES := $(filter-out %/soapC.c, $(SRC_FILES)) obj_files = $(patsubst src/%,build/%,$(patsubst %.cpp,%.o,$(SRC_FILES))) exa_obj_files = $(patsubst examples/src/%,examples/build/%,$(patsubst %.cpp,%.o,$(EXAMPLE_SRC_FILES))) test_obj_files = $(patsubst test/src/%,test/build/%,$(patsubst %.cpp,%.o,$(TEST_SRC_FILES))) LDFLAGS = -L$(GSOAP_LIB) -L$(LIBXML2_LIB) -L/usr/lib/x86_64-linux-gnu/ -lxml2 DCFLAGS = -g -fPIC -Iinclude -I$(GSOAP_INC) -I$(LIBXML2_INC)/libxml2 -I/usr/include/libxml2 #-I$(INCL) CFLAGS = $(DCFLAGS) CXXFLAGS = $(DCFLAGS) # removed -Isrc/srvgen from TCFLAGS since srvgen contents is not yet final. #TCFLAGS = -g -Iinclude -I$(GTEST_INC) TCFLAGS = -g -Iinclude -I$(GSOAP_INC) -Iinclude/generated -I$(LIBXML2_INC)/libxml2 -I/usr/include/libxml2 -I$(GTEST_INC) TLDFLAGS = -L$(GTEST_LIB) -lgtest -L$(LIBXML2_LIB) -lxml2 all: pre get_cabling_for_run get_cabling_for_date get_calibration_for_run get_calibration_for_date pre: mkdir -p bin debug: override CFLAGS=$(DCFLAGS) debug: all get_cabling_for_run: examples/build/cabling/get_cabling_for_run.o lib/libcdbc++.${CDBVERSION}.a g++ -Llib $^ $(GSOAP_LIB)/libgsoap++.a $(LDFLAGS) -o bin/$@ get_cabling_for_date: examples/build/cabling/get_cabling_for_date.o lib/libcdbc++.${CDBVERSION}.a g++ -Llib $^ $(GSOAP_LIB)/libgsoap++.a $(LDFLAGS) -o bin/$@ get_calibration_for_run: examples/build/calibration/get_calibration_for_run.o lib/libcdbc++.${CDBVERSION}.a g++ -Llib $^ $(GSOAP_LIB)/libgsoap++.a $(LDFLAGS) -o bin/$@ get_calibration_for_date: examples/build/calibration/get_calibration_for_date.o lib/libcdbc++.${CDBVERSION}.a g++ -Llib $^ $(GSOAP_LIB)/libgsoap++.a $(LDFLAGS) -o bin/$@ examples/build/%.o: examples/src/%.cpp mkdir -p $(dir $@) g++ $(CFLAGS) --std=c++11 $< -c -o $@ build/%.o: src/%.cpp -mkdir -p $(dir $@) g++ $(CFLAGS) --std=c++11 $< -c -o $@ gen: -mkdir -p src/generated $(WSDL2H) -c++ -o src/mice.h $(WSDL_HOST)/cabling?wsdl $(WSDL_HOST)/calibration?wsdl $(SOAPCPP2) -C -x -c++ -L -dsrc/generated/ -i src/mice.h -mkdir -p include/generated cp src/generated/*.h include/generated/ mv src/generated/CablingImplPortBinding.nsmap include/generated/ mv src/generated/CalibrationImplPortBinding.nsmap include/generated/ #rm -f src/mice.h srvgen: src/mice.h -mkdir -p src/srvgen $(SOAPCPP2) -T -c++ -x -L -dsrc/srvgen/ -i src/mice.h lib: lib/libcdbc++.${CDBVERSION}.a lib/libcdbc++.${CDBVERSION}.a: $(obj_files) mkdir -p $(dir $@) ar rcs $@ $^ ln -s -f libcdbc++.${CDBVERSION}.a lib/libcdbc++.a test/build/%.o: test/src/%.cpp mkdir -p $(dir $@) g++ $(TCFLAGS) --std=c++11 $< -c -o $@ bin/test: $(test_obj_files) lib/libcdbc++.${CDBVERSION}.a g++ $^ -Llib -lcdbc++ $(TLDFLAGS) $(LDFLAGS) $(GSOAP_LIB)/libgsoap++.a -o $@ test: bin/test # # gsoap testserver, serves calibration only: # TEST_SRV=test_server/srvgen/ testserver: bin/testserver bin/testserver: $(TEST_SRV)/soapTester.cpp $(TEST_SRV)/soapC.cpp $(TEST_SRV)/soapCablingImplPortBindingService.cpp g++ $^ -I$(GSOAP_INC) $(GSOAP_LIB)/libgsoap++.a -o $@ .PHONY: all clean test clean: rm -rf build examples/build bin lib clobber: clean rm src/generated/* rm include/generated/* doc: $(SRC_FILES) doxygen Doxyfile tar: rm -rf examples/build tar cvzf dist/cdb.client.api-C++.v${CDBVERSION}.tgz --exclude=include/generated --exclude=src/generated Makefile Doxyfile src examples include release: clean all doc tar