From e9a6ae97aa9e636a43457da0f5be1da26d5b1456 Mon Sep 17 00:00:00 2001 From: Erich Keane Date: Tue, 3 Feb 2015 14:47:49 -0800 Subject: [PATCH] Removed Cereal from Build Except where necessary Only 3 file compilations (InProcClientWrapper.cpp, OCResourceRequest.cpp, and OCRepresentation.cpp) actually need the cereal include, so this fix removes it from everywhere else. This will result in faster compile times. Change-Id: I8f9c7b6c3991089189fe85fd8ebff6a9e1e2aa80 Signed-off-by: Erich Keane Reviewed-on: https://gerrit.iotivity.org/gerrit/300 Tested-by: jenkins-iotivity Reviewed-by: Ossama Othman Reviewed-by: Patrick Lankswert Reviewed-by: Sudarshan Prasad Reviewed-by: Uze Choi Tested-by: Uze Choi --- examples/OICMiddle/makefile | 11 ++++---- extra_options.scons | 2 -- resource/makefile | 10 +++---- resource/src/SConscript | 1 + .../plugins/mqtt-fan/build/linux/Makefile | 22 +++++++-------- .../plugins/mqtt-light/build/linux/Makefile | 22 +++++++-------- .../protocol-plugin/sample-app/linux/mqtt/Makefile | 18 ++++++------ .../sampleapp/linux/configuration/makefile | 1 - .../sampleapp/linux/groupaction/makefile | 2 -- .../sampleapp/linux/groupsyncaction/makefile | 1 - service/things-manager/sdk/build/linux/Makefile | 33 +++++++++++----------- 11 files changed, 55 insertions(+), 68 deletions(-) diff --git a/examples/OICMiddle/makefile b/examples/OICMiddle/makefile index 52c3772..7b39605 100644 --- a/examples/OICMiddle/makefile +++ b/examples/OICMiddle/makefile @@ -34,7 +34,7 @@ OBJS := OICMiddle.o \ WrapResource.o \ LineInput.o \ RestInput.o - + CXX_FLAGS.debug := -O0 -g3 -std=c++0x -Wall -pthread CXX_FLAGS.release := -O3 -std=c++0x -Wall -pthread @@ -46,7 +46,6 @@ CXX_INC += -I$(OIC_RES)/csdk/ocsocket/include CXX_INC += -I$(OIC_RES)/csdk/ocrandom/include CXX_INC += -I$(OIC_RES)/csdk/logger/include CXX_INC += -I$(OIC_RES)/csdk/libcoap -CXX_INC += -I$(OIC_RES)/../extlibs/cereal/include CXX_LIBS := -L${OIC_LIB} CXX_LIBS += -loc @@ -59,7 +58,7 @@ all: prep_dirs OICMiddle prep_dirs: -mkdir -p $(OUT_DIR) - + OICMiddle: $(OBJS) $(CXX) $(CXX_FLAGS.$(BUILD)) -o $(OUT_DIR)/$@ $(OBJS) $(CXX_LIBS) @@ -74,13 +73,13 @@ Server.o: Server.cpp Server.h OICMiddle.h WrapResource.o: WrapResource.cpp WrapResource.h OICMiddle.h $(CXX) -c $(CXX_FLAGS.$(BUILD)) WrapResource.cpp $(CXX_INC) - + LineInput.o: LineInput.cpp LineInput.h OICMiddle.h $(CXX) -c $(CXX_FLAGS.$(BUILD)) LineInput.cpp $(CXX_INC) - + RestInput.o: RestInput.cpp RestInput.h OICMiddle.h $(CXX) -c $(CXX_FLAGS.$(BUILD)) RestInput.cpp $(CXX_INC) - + clean: rm $(OBJS) rm -rf debug diff --git a/extra_options.scons b/extra_options.scons index dc2e48e..21739c5 100644 --- a/extra_options.scons +++ b/extra_options.scons @@ -31,5 +31,3 @@ if not os.path.exists(src_dir + '/extlibs/cereal'): ********************************************************************************* ''' Exit(1) -else: - env.AppendUnique(CPPPATH = [src_dir + '/extlibs/cereal/include']) diff --git a/resource/makefile b/resource/makefile index b86d0c5..7a83aef 100644 --- a/resource/makefile +++ b/resource/makefile @@ -38,7 +38,7 @@ OUT_DIR := $(ROOT_DIR)/$(BUILD) OBJ_DIR := $(OUT_DIR)/obj #TODO-CA Need to remove flag later -CXX_FLAGS.debug := -g3 -std=c++0x -Wall -pthread -O0 +CXX_FLAGS.debug := -g3 -std=c++0x -Wall -pthread -O0 CXX_FLAGS.release := -std=c++0x -Wall -pthread -O3 CXX_INC := -I./include/ @@ -49,7 +49,7 @@ CXX_INC += -I./csdk/ocsocket/include CXX_INC += -I./csdk/ocrandom/include CXX_INC += -I./csdk/logger/include CXX_INC += -I./csdk/libcoap -CXX_INC += -I$(CEREAL_DIR)/include + # Force metatargets to build: all.PHONY: applyDepPatches prep_dirs c_sdk oc_logger_target liboc.a examples @@ -98,7 +98,7 @@ OCPlatform.o: src/OCPlatform.cpp $(CXX) $(CXX_FLAGS.$(BUILD)) -o $(OBJ_DIR)/$@ -c src/OCPlatform.cpp $(CXX_INC) OCRepresentation.o: src/OCRepresentation.cpp - $(CXX) $(CXX_FLAGS.$(BUILD)) -o $(OBJ_DIR)/$@ -c src/OCRepresentation.cpp $(CXX_INC) + $(CXX) $(CXX_FLAGS.$(BUILD)) -o $(OBJ_DIR)/$@ -c src/OCRepresentation.cpp $(CXX_INC) -I$(CEREAL_DIR)/include OCResource.o: src/OCResource.cpp $(CXX) $(CXX_FLAGS.$(BUILD)) -o $(OBJ_DIR)/$@ -c src/OCResource.cpp $(CXX_INC) @@ -113,10 +113,10 @@ InProcServerWrapper.o: src/InProcServerWrapper.cpp $(CXX) $(CXX_FLAGS.$(BUILD)) -o $(OBJ_DIR)/$@ -c src/InProcServerWrapper.cpp $(CXX_INC) InProcClientWrapper.o: src/InProcClientWrapper.cpp - $(CXX) $(CXX_FLAGS.$(BUILD)) -o $(OBJ_DIR)/$@ -c src/InProcClientWrapper.cpp $(CXX_INC) + $(CXX) $(CXX_FLAGS.$(BUILD)) -o $(OBJ_DIR)/$@ -c src/InProcClientWrapper.cpp $(CXX_INC) -I$(CEREAL_DIR)/include OCResourceRequest.o: src/OCResourceRequest.cpp - $(CXX) $(CXX_FLAGS.$(BUILD)) -o $(OBJ_DIR)/$@ -c src/OCResourceRequest.cpp $(CXX_INC) + $(CXX) $(CXX_FLAGS.$(BUILD)) -o $(OBJ_DIR)/$@ -c src/OCResourceRequest.cpp $(CXX_INC) -I$(CEREAL_DIR)/include clean: clean_legacy -rm -rf release diff --git a/resource/src/SConscript b/resource/src/SConscript index 9077131..8f7a65d 100644 --- a/resource/src/SConscript +++ b/resource/src/SConscript @@ -49,5 +49,6 @@ oclib_src = [ 'OCResourceRequest.cpp' ] +oclib_env.AppendUnique(CPPPATH = [oclib_env.get('SRC_DIR') + '/extlibs/cereal/include']) oclib = oclib_env.SharedLibrary('oc', oclib_src) oclib_env.InstallTarget(oclib, 'liboc') diff --git a/service/protocol-plugin/plugins/mqtt-fan/build/linux/Makefile b/service/protocol-plugin/plugins/mqtt-fan/build/linux/Makefile index 248e35c..d40b1d1 100644 --- a/service/protocol-plugin/plugins/mqtt-fan/build/linux/Makefile +++ b/service/protocol-plugin/plugins/mqtt-fan/build/linux/Makefile @@ -8,24 +8,22 @@ LIB_DIR = ../../../../../../resource SRC_DIR = ../../src DEPEND_DIR:= $(LIB_DIR)/dependencies -CEREAL_DIR:= $(DEPEND_DIR)/cereal -CXX_INC := -I$(LIB_DIR)/include/ -CXX_INC += -I$(LIB_DIR)/oc_logger/include/ -CXX_INC += -I$(LIB_DIR)/csdk/stack/include/ -CXX_INC += -I$(LIB_DIR)/csdk/ocsocket/include/ -CXX_INC += -I$(LIB_DIR)/csdk/ocrandom/include/ +CXX_INC := -I$(LIB_DIR)/include/ +CXX_INC += -I$(LIB_DIR)/oc_logger/include/ +CXX_INC += -I$(LIB_DIR)/csdk/stack/include/ +CXX_INC += -I$(LIB_DIR)/csdk/ocsocket/include/ +CXX_INC += -I$(LIB_DIR)/csdk/ocrandom/include/ CXX_INC += -I$(LIB_DIR)/csdk/logger/include/ -CXX_INC += -I$(BOOST_DIR) -CXX_INC += -I../../lib +CXX_INC += -I$(BOOST_DIR) +CXX_INC += -I../../lib CXX_INC += -I../../../../lib/cpluff/libcpluff CXX_INC += -I../csdk/libcoap -CXX_INC += -I$(CEREAL_DIR)/include LIB_OC_LOGGER := $(LIB_DIR)/oc_logger/lib/oc_logger.a CXX_LIBS := ../../../../lib/cpluff/libcpluff/.libs/libcpluff.a -.PHONY: lib release_build ./release/fanserver_mqtt_plugin.so +.PHONY: lib release_build ./release/fanserver_mqtt_plugin.so all: .PHONY @@ -41,11 +39,11 @@ release_build: $(CXX) -shared -o ./release/fanserver_mqtt_plugin.so ./release/obj/fanserver_mqtt_plugin.o ./release/obj/fanserver.o $(CXX_LIBS) -L../../lib -L$(TOP_DIR)/out/linux/x86/release -lmosquitto -lssl -lrt -loc -loctbstack -loc_logger -lcoap ./release/obj/fanserver_mqtt_plugin.o: $(SRC_DIR)/fanserver_mqtt_plugin.cpp - $(CXX) $(CXX_INC) -fPIC -o ./release/obj/fanserver_mqtt_plugin.o -c $(SRC_DIR)/fanserver_mqtt_plugin.cpp + $(CXX) $(CXX_INC) -fPIC -o ./release/obj/fanserver_mqtt_plugin.o -c $(SRC_DIR)/fanserver_mqtt_plugin.cpp ./release/obj/fanserver.o: $(SRC_DIR)/fanserver.cpp $(CXX) $(CXX_FLAGS) -fPIC -o ./release/obj/fanserver.o -c $(SRC_DIR)/fanserver.cpp $(CXX_INC) - + clean: cd ../../lib && $(MAKE) clean rm -rf ./release/obj diff --git a/service/protocol-plugin/plugins/mqtt-light/build/linux/Makefile b/service/protocol-plugin/plugins/mqtt-light/build/linux/Makefile index 788b7cf..d7e7b4e 100644 --- a/service/protocol-plugin/plugins/mqtt-light/build/linux/Makefile +++ b/service/protocol-plugin/plugins/mqtt-light/build/linux/Makefile @@ -8,24 +8,22 @@ LIB_DIR = ../../../../../../resource SRC_DIR = ../../src DEPEND_DIR:= $(LIB_DIR)/dependencies -CEREAL_DIR:= $(DEPEND_DIR)/cereal -CXX_INC := -I$(LIB_DIR)/include/ -CXX_INC += -I$(LIB_DIR)/oc_logger/include/ -CXX_INC += -I$(LIB_DIR)/csdk/stack/include/ -CXX_INC += -I$(LIB_DIR)/csdk/ocsocket/include/ -CXX_INC += -I$(LIB_DIR)/csdk/ocrandom/include/ +CXX_INC := -I$(LIB_DIR)/include/ +CXX_INC += -I$(LIB_DIR)/oc_logger/include/ +CXX_INC += -I$(LIB_DIR)/csdk/stack/include/ +CXX_INC += -I$(LIB_DIR)/csdk/ocsocket/include/ +CXX_INC += -I$(LIB_DIR)/csdk/ocrandom/include/ CXX_INC += -I$(LIB_DIR)/csdk/logger/include/ -CXX_INC += -I$(BOOST_DIR) -CXX_INC += -I../../lib +CXX_INC += -I$(BOOST_DIR) +CXX_INC += -I../../lib CXX_INC += -I../../../../lib/cpluff/libcpluff CXX_INC += -I../csdk/libcoap -CXX_INC += -I$(CEREAL_DIR)/include LIB_OC_LOGGER := $(LIB_DIR)/oc_logger/lib/oc_logger.a CXX_LIBS := ../../../../lib/cpluff/libcpluff/.libs/libcpluff.a -.PHONY: lib release_build ./release/lightserver_mqtt_plugin.so +.PHONY: lib release_build ./release/lightserver_mqtt_plugin.so all: .PHONY @@ -41,11 +39,11 @@ release_build: $(CXX) -shared -o ./release/lightserver_mqtt_plugin.so ./release/obj/lightserver_mqtt_plugin.o ./release/obj/lightserver.o $(CXX_LIBS) -L../../lib -L$(TOP_DIR)/out/linux/x86/release -lmosquitto -lssl -lrt -loc -loctbstack -loc_logger -lcoap ./release/obj/lightserver_mqtt_plugin.o: $(SRC_DIR)/lightserver_mqtt_plugin.cpp - $(CXX) $(CXX_INC) -fPIC -o ./release/obj/lightserver_mqtt_plugin.o -c $(SRC_DIR)/lightserver_mqtt_plugin.cpp + $(CXX) $(CXX_INC) -fPIC -o ./release/obj/lightserver_mqtt_plugin.o -c $(SRC_DIR)/lightserver_mqtt_plugin.cpp ./release/obj/lightserver.o: $(SRC_DIR)/lightserver.cpp $(CXX) $(CXX_FLAGS) -fPIC -o ./release/obj/lightserver.o -c $(SRC_DIR)/lightserver.cpp $(CXX_INC) - + clean: cd ../../lib && $(MAKE) clean rm -rf ./release/obj diff --git a/service/protocol-plugin/sample-app/linux/mqtt/Makefile b/service/protocol-plugin/sample-app/linux/mqtt/Makefile index 131e83a..fbce338 100644 --- a/service/protocol-plugin/sample-app/linux/mqtt/Makefile +++ b/service/protocol-plugin/sample-app/linux/mqtt/Makefile @@ -6,20 +6,18 @@ TOP_DIR = ../../../../.. LIB_DIR = ../../../../../resource DEPEND_DIR:= $(LIB_DIR)/dependencies -CEREAL_DIR:= $(DEPEND_DIR)/cereal -CXX_INC := -I$(LIB_DIR)/include/ -CXX_INC += -I$(LIB_DIR)/oc_logger/include/ -CXX_INC += -I$(LIB_DIR)/csdk/stack/include/ -CXX_INC += -I$(LIB_DIR)/csdk/ocsocket/include/ -CXX_INC += -I$(LIB_DIR)/csdk/ocrandom/include/ +CXX_INC := -I$(LIB_DIR)/include/ +CXX_INC += -I$(LIB_DIR)/oc_logger/include/ +CXX_INC += -I$(LIB_DIR)/csdk/stack/include/ +CXX_INC += -I$(LIB_DIR)/csdk/ocsocket/include/ +CXX_INC += -I$(LIB_DIR)/csdk/ocrandom/include/ CXX_INC += -I$(LIB_DIR)/csdk/logger/include/ -CXX_INC += -I$(BOOST_DIR) +CXX_INC += -I$(BOOST_DIR) CXX_INC += -I../../lib CXX_INC += -I../../../lib/cpluff/libcpluff CXX_INC += -I../../../plugin-manager/src -CXX_INC += -I$(CEREAL_DIR)/include -CXX_INC += -I../../../lib/rapidxml +CXX_INC += -I../../../lib/rapidxml LIB_OC_LOGGER := $(LIB_DIR)/oc_logger/lib/oc_logger.a CXX_LIBS := ../../../build/linux/release/libppm.a ../../../lib/cpluff/libcpluff/.libs/libcpluff.a @@ -35,7 +33,7 @@ mqttclient: mqttclient.o mqttclient.o: mqttclient.cpp $(CXX) $(CXX_FLAGS) -c mqttclient.cpp $(CXX_INC) - + clean: rm -f *.o rm -f *.so diff --git a/service/things-manager/sampleapp/linux/configuration/makefile b/service/things-manager/sampleapp/linux/configuration/makefile index 37824a9..e0eb57c 100644 --- a/service/things-manager/sampleapp/linux/configuration/makefile +++ b/service/things-manager/sampleapp/linux/configuration/makefile @@ -19,7 +19,6 @@ CXX_INC += -I${IOT_BASE}/csdk/stack/include CXX_INC += -I${IOT_BASE}/csdk/ocsocket/include CXX_INC += -I${IOT_BASE}/csdk/ocrandom/include CXX_INC += -I${IOT_BASE}/csdk/logger/include -CXX_INC += -I${IOT_BASE}/dependencies/cereal/include CXX_LIB=-L"" diff --git a/service/things-manager/sampleapp/linux/groupaction/makefile b/service/things-manager/sampleapp/linux/groupaction/makefile index 6604c3c..bddcbe4 100644 --- a/service/things-manager/sampleapp/linux/groupaction/makefile +++ b/service/things-manager/sampleapp/linux/groupaction/makefile @@ -10,7 +10,6 @@ CXX=g++ CXX_FLAGS=-std=c++0x -Wall -pthread -DLINUX -ldl DEPEND_DIR:= ../../../../../resource/dependencies/ -CEREAL_DIR:= $(DEPEND_DIR)/cereal CXX_INC := -I../../ -I../../inc/ CXX_INC += -I${IOT_BASE}/include/ @@ -19,7 +18,6 @@ CXX_INC += -I${IOT_BASE}/csdk/stack/include CXX_INC += -I${IOT_BASE}/csdk/ocsocket/include CXX_INC += -I${IOT_BASE}/csdk/ocrandom/include CXX_INC += -I${IOT_BASE}/csdk/logger/include -CXX_INC += -I$(CEREAL_DIR)/include CXX_INC += -I../../../sdk/inc CXX_INC += -I../../../sdk/src diff --git a/service/things-manager/sampleapp/linux/groupsyncaction/makefile b/service/things-manager/sampleapp/linux/groupsyncaction/makefile index 0ee1e5c..b0b767c 100644 --- a/service/things-manager/sampleapp/linux/groupsyncaction/makefile +++ b/service/things-manager/sampleapp/linux/groupsyncaction/makefile @@ -19,7 +19,6 @@ CXX_INC += -I${IOT_BASE}/csdk/stack/include CXX_INC += -I${IOT_BASE}/csdk/ocsocket/include CXX_INC += -I${IOT_BASE}/csdk/ocrandom/include CXX_INC += -I${IOT_BASE}/csdk/logger/include -CXX_INC += -I${IOT_BASE}/dependencies/cereal/include CXX_LIB=-L"" diff --git a/service/things-manager/sdk/build/linux/Makefile b/service/things-manager/sdk/build/linux/Makefile index 0e5ec03..f00a51e 100644 --- a/service/things-manager/sdk/build/linux/Makefile +++ b/service/things-manager/sdk/build/linux/Makefile @@ -16,13 +16,12 @@ CXX_FLAGS=-std=c++0x -Wall -pthread -DLINUX -ldl CXX_INC := -I../../ -I../../inc/ -I../../src/ -CXX_INC += -I${IOT_BASE}/include/ +CXX_INC += -I${IOT_BASE}/include/ CXX_INC += -I${IOT_BASE}/oc_logger/include -CXX_INC += -I${IOT_BASE}/csdk/stack/include -CXX_INC += -I${IOT_BASE}/csdk/ocsocket/include -CXX_INC += -I${IOT_BASE}/csdk/ocrandom/include -CXX_INC += -I${IOT_BASE}/csdk/logger/include -CXX_INC += -I${IOT_BASE}/dependencies/cereal/include +CXX_INC += -I${IOT_BASE}/csdk/stack/include +CXX_INC += -I${IOT_BASE}/csdk/ocsocket/include +CXX_INC += -I${IOT_BASE}/csdk/ocrandom/include +CXX_INC += -I${IOT_BASE}/csdk/logger/include CXX_LIB=-L"" @@ -46,13 +45,13 @@ GAR=ar # Force metatargets to build: .PHONY: all clean -all: pre_job ${TARGET} post_job +all: pre_job ${TARGET} post_job pre_job: - @echo " " - @echo "Build Begin." @echo " " - + @echo "Build Begin." + @echo " " + ${TARGET}: ${CXX_OBJLIST} #$(CXX) $(LD_FLAGS) -o ./${RST_NAME}/$@ $^ ${LD_LIB} // shared object. @for sublib in ${LD_LIB} ; do \ @@ -66,17 +65,17 @@ ${TARGET}: ${CXX_OBJLIST} - -%.o : ../../src/%.cpp + +%.o : ../../src/%.cpp ${CXX} ${CXX_FLAGS} -c $< ${CXX_INC} -o ./${RST_NAME}/$@ - @echo " " - + @echo " " + post_job: - @echo " " + @echo " " @echo "Build Successful." - @echo " " + @echo " " clean: rm -f -v *.o ${TARGET} - + -- 2.7.4