From 1c03a2b8f64689969605c2824335da1cf523499b Mon Sep 17 00:00:00 2001 From: jk13 Date: Fri, 12 Dec 2014 19:51:19 +0900 Subject: [PATCH] [SSM] Fix build script 1. Apply scons 2. Fix arduino makefile 3. Cleanup makefiles Change-Id: I9f9c1597df21be96b4d40cfdd277649349dd742e Signed-off-by: jk13 --- service/soft-sensor-manager/SConscript | 26 +++-- service/soft-sensor-manager/SampleApp/SConscript | 8 +- .../SampleApp/arduino/THSensorApp/build/Makefile | 115 ++++++++++++++------- .../SampleApp/linux/ClientApp/SConscript | 25 ----- .../SampleApp/linux/SSMTesterApp/SConscript | 36 +++++++ .../SampleApp/linux/THSensorApp/SConscript | 11 +- .../SampleApp/linux/THSensorApp1/SConscript | 11 +- .../tizen/SSMTesterApp/oic-sample/CMakeLists.txt | 2 +- service/soft-sensor-manager/build/arduino/Makefile | 14 ++- .../build/arduino/environment.mk | 26 ++--- .../build/arduino/local.properties | 3 +- .../soft-sensor-manager/build/linux/environment.mk | 3 +- 12 files changed, 172 insertions(+), 108 deletions(-) delete mode 100644 service/soft-sensor-manager/SampleApp/linux/ClientApp/SConscript create mode 100644 service/soft-sensor-manager/SampleApp/linux/SSMTesterApp/SConscript diff --git a/service/soft-sensor-manager/SConscript b/service/soft-sensor-manager/SConscript index aec6fcb..c7416e0 100644 --- a/service/soft-sensor-manager/SConscript +++ b/service/soft-sensor-manager/SConscript @@ -20,7 +20,7 @@ if target_os == 'arduino': # Build flags ###################################################################### if target_os not in ['windows', 'winrt']: - soft_sensor_manager_env.AppendUnique(CXXFLAGS = ['-std=c++0x', '-Wall']) + soft_sensor_manager_env.AppendUnique(CXXFLAGS = ['-std=c++0x', '-Wall', '-DLINUX']) if target_os != 'android': soft_sensor_manager_env.AppendUnique(CXXFLAGS = ['-pthread']) @@ -28,12 +28,20 @@ if target_os not in ['windows', 'winrt']: ## build SSM SDK ####################################################################### sdk_env = soft_sensor_manager_env.Clone() +sdk_env.AppendUnique(CPPPATH = ['SSMCore/include']) +sdk_env.AppendUnique(CPPPATH = ['SSMCore/src']) sdk_env.AppendUnique(CPPPATH = ['SDK/include']) -ssm_sdk = sdk_env.Object('SDK/src/SSMClient.cpp') -i_ssmsdk = sdk_env.Install(env.get('BUILD_DIR'), ) -Alias('libSSMSDKLibrary', i_ssmsdk) -env.AppendTarget('libSSMSDKLibrary') +ssm_sdk_cpp_src = [ + Glob('SDK/src/*.cpp') + ] + +env.AppendTarget('libSSMSDK') +libssmsdk = sdk_env.StaticLibrary( + target = 'libSSMSDK', + source = [ssm_sdk_cpp_src] + ) +sdk_env.InstallTarget(libssmsdk, 'libSSMCORE') ###################################################################### # build DiscomfortIndexSensor plugin @@ -56,10 +64,7 @@ DiscomfortIndexSensor_env.InstallTarget(DiscomfortIndexSensor, 'libDiscomfortInd # build SSM CORE ###################################################################### ssmcore_env = soft_sensor_manager_env.Clone() -MODEL_DIR = "\"\\\"" + env.get('BUILD_DIR') + "\\\"\"" -LOCATION = "\"\\\"" + env.get('BUILD_DIR') + "HighContextDictionary.xml" + "\\\"\"" -ssmcore_env.AppendUnique(CPPDEFINES = ['MODEL_DIRECTORY='+MODEL_DIR, 'HIGH_LOCATION='+LOCATION]) ssmcore_env.AppendUnique(CPPPATH = [ 'SSMCore/include/', 'SSMCore/src/', @@ -79,7 +84,6 @@ else : ssminterface_src = Glob(SSMINTERFACE_PATH + '*.cpp') ssm_core_cpp_src = [ - 'SSMCore/src/SSMResourceServerLauncher.cpp', Glob('SSMCore/src/Common/*.cpp'), Glob('SSMCore/src/QueryProcessor/*.cpp'), Glob('SSMCore/src/SensorProcessor/*.cpp'), @@ -91,7 +95,7 @@ ssm_core_c_src = [ ] libssmcore = ssmcore_env.StaticLibrary( - target = 'SSMCoreUbuntu', + target = 'SSMCore', source = [ssm_core_cpp_src, ssm_core_c_src] ) @@ -100,4 +104,4 @@ ssmcore_env.InstallTarget(libssmcore, 'libSSMCORE') ####################################################################### ## build SampleApp ####################################################################### -#SConscript('SampleApp/SConscript') +SConscript('SampleApp/SConscript') \ No newline at end of file diff --git a/service/soft-sensor-manager/SampleApp/SConscript b/service/soft-sensor-manager/SampleApp/SConscript index 925f281..545d993 100644 --- a/service/soft-sensor-manager/SampleApp/SConscript +++ b/service/soft-sensor-manager/SampleApp/SConscript @@ -5,8 +5,9 @@ Import('env') # Add third party libraries -SConscript(env.get('SRC_DIR') + '/service/third_party_libs.scons') -sample_env = env.Clone() +lib_env = env.Clone() +SConscript(env.get('SRC_DIR') + '/service/third_party_libs.scons', 'lib_env') +sample_env = lib_env.Clone() target_os = env.get('TARGET_OS') ###################################################################### @@ -18,7 +19,6 @@ target_os = env.get('TARGET_OS') ###################################################################### if target_os == 'linux' : # Build linux sample app - SConscript('linux/ClientApp/SConscript') + SConscript('linux/SSMTesterApp/SConscript') SConscript('linux/THSensorApp/SConscript') SConscript('linux/THSensorApp1/SConscript') - diff --git a/service/soft-sensor-manager/SampleApp/arduino/THSensorApp/build/Makefile b/service/soft-sensor-manager/SampleApp/arduino/THSensorApp/build/Makefile index df3988f..0d7011d 100644 --- a/service/soft-sensor-manager/SampleApp/arduino/THSensorApp/build/Makefile +++ b/service/soft-sensor-manager/SampleApp/arduino/THSensorApp/build/Makefile @@ -1,23 +1,39 @@ +# //****************************************************************** +# // +# // Copyright 2014 Intel Mobile Communications GmbH All Rights Reserved. +# // +# //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +# // +# // Licensed under the Apache License, Version 2.0 (the "License"); +# // you may not use this file except in compliance with the License. +# // You may obtain a copy of the License at +# // +# // http://www.apache.org/licenses/LICENSE-2.0 +# // +# // Unless required by applicable law or agreed to in writing, software +# // distributed under the License is distributed on an "AS IS" BASIS, +# // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# // See the License for the specific language governing permissions and +# // limitations under the License. +# // +# //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +# -include ../../../../build/arduino/environment.mk - ARDUINO_DIR = /usr/share/arduino -SRC_PATH=../src +BUILD := release +PLATFORM := arduinomega +ARDUINO_PORT := ttyACM0 + +SRC_PATH=../src # override with `make PLATFORM=arduinomega ARDUINOWIFI=1` to enable Arduino WiFi shield ARDUINOWIFI := 0 APP_NAME := thserver -BUILD := release -#BUILD := debug -PLATFORM := arduinomega -ARDUINO_PORT := /dev/ttyACM0 - -OBJ_DIR := ./bin - -TB_DIR = ${IOT_BASE}/csdk -BUILD_DIR = $(TB_DIR)/build/arduino +TB_DIR = ../../../../../../resource/csdk LOGGER_DIR = $(TB_DIR)/logger +OC_LOG_DIR = $(TB_DIR)/../oc_logger TBSTACK_DIR = $(TB_DIR)/stack TBSOCKET_DIR = $(TB_DIR)/ocsocket @@ -30,56 +46,81 @@ VPATH := $(SDIR_ARD_PLATFORM) OCSOCK_DIR = $(TB_DIR)/ocsocket LOGGER_DIR = $(TB_DIR)/logger STACK_DIR = $(TB_DIR)/stack -INC_DIRS = -I$(OCSOCK_DIR)/include/ -I$(LOGGER_DIR)/include -I$(STACK_DIR)/include +INC_DIRS = -I$(OCSOCK_DIR)/include/ -I$(OC_LOG_DIR)/include -I$(LOGGER_DIR)/include -I$(STACK_DIR)/include + +CC_FLAGS.debug := -O1 -g3 -Wall -c -fmessage-length=0 -pedantic -fpic +CC_FLAGS.release := -Os -Wall -c -fmessage-length=0 -fpic -CFLAGS := -Os -Wall -c -DTB_LOG +CFLAGS := $(CC_FLAGS.$(BUILD)) -DTB_LOG ifeq ($(ARDUINOWIFI),1) CFLAGS += -DARDUINOWIFI + ARDUINO_SHIELD_TYPE := "/wifi_shield" + TRANSPORT_OBJS = $(WIFI_COBJ) +else + ARDUINO_SHIELD_TYPE := "/ethernet_shield" + TRANSPORT_OBJS = $(ETH_CPPOBJ) $(ETH_UTIL_CPPOBJ) endif -#all: prep_dirs core.a $(APP_NAME).o $(APP_NAME).elf $(APP_NAME).hex -all: preclean prebuild precopy prep_dirs core.a $(APP_NAME).o $(APP_NAME).elf $(APP_NAME).hex +OUT_DIR := $(PLATFORM)$(ARDUINO_SHIELD_TYPE)/$(BUILD) -precopy: -# @cd $(TB_DIR) && mkdir -p ${BUILD} && cp -Rdp release/liboctbstack.a ${BUILD}/ +OBJ_DIR := $(OUT_DIR)/bin -preclean: - @cd $(BUILD_DIR) && make deepclean - -prebuild: - @cd $(BUILD_DIR) && make PLATFORM=arduinomega ARDUINOWIFI=0 +all: prep_dirs core.a $(APP_NAME).o $(APP_NAME).elf $(APP_NAME).hex core.a: $(PLATFORM_OBJS) - @cd $(OBJ_DIR) && $(AR) -x $(TB_DIR)/build/arduino/$(BUILD)/liboctbstack.a - $(AR) rcs $@ $^ $(OBJ_DIR)/*.o - $(RANLIB) $@ + @cd $(OBJ_DIR) && $(AR) -x ../../../../$(TB_DIR)/$(PLATFORM)$(ARDUINO_SHIELD_TYPE)/$(BUILD)/liboctbstack.a + $(AR) rcs $(OBJ_DIR)/$@ $(foreach obj, $^, $(OBJ_DIR)/$(obj)) $(OBJ_DIR)/*.o + @cd $(OBJ_DIR) && $(RANLIB) $@ prep_dirs: + -mkdir $(PLATFORM) + -mkdir $(PLATFORM)/$(ARDUINO_SHIELD_TYPE) + -mkdir $(OUT_DIR) -mkdir $(OBJ_DIR) %.o: %.c - $(CC) $(CFLAGS) $(CFLAGS_PLATFORM) $(INC_DIRS) $(INC_DIR_PLATFORM) $< -o $@ - + $(CC) $(CFLAGS) $(CFLAGS_PLATFORM) $(INC_DIRS) $(INC_DIR_PLATFORM) $< -o $(OBJ_DIR)/$@ %.o: %.cpp - $(CCPLUS) $(CFLAGS) $(CFLAGS_PLATFORM) $(INC_DIRS) $(INC_DIR_PLATFORM) $< -o $@ - + $(CXX) $(CFLAGS) $(CFLAGS_PLATFORM) $(INC_DIRS) $(INC_DIR_PLATFORM) $< -o $(OBJ_DIR)/$@ %.o: ${SRC_PATH}/%.cpp - $(CCPLUS) $(CFLAGS) $(CFLAGS_PLATFORM) $(INC_DIRS) $(INC_DIR_PLATFORM) $< -o $@ + $(CXX) $(CFLAGS) $(CFLAGS_PLATFORM) $(INC_DIRS) $(INC_DIR_PLATFORM) $< -o $(OBJ_DIR)/$@ $(APP_NAME).elf: $(APP_NAME).o core.a - $(CC) -Os -Wl,--gc-sections,--relax $(CFLAGS_PLATFORM) $^ -lm -o $@ +ifeq ($(PLATFORM),arduinomega) + $(CC) -Os -Wl,--gc-sections,--relax $(CFLAGS_PLATFORM) $(foreach obj, $^, $(OBJ_DIR)/$(obj)) -lm -o $(OBJ_DIR)/$@ +else ifeq ($(PLATFORM),arduinodue) + $(CXX) -Os -Wl,--gc-sections -mcpu=cortex-m3 -T/$(SDIR_ARD_CORE_3)/linker_scripts/gcc/flash.ld -Wl,-Map,$(APP_NAME).map -o $(OBJ_DIR)/$@ -lm -lgcc -mthumb -Wl,--cref -Wl,--check-sections -Wl,--gc-sections -Wl,--entry=Reset_Handler -Wl,--unresolved-symbols=report-all -Wl,--warn-common -Wl,--warn-section-align -Wl,--warn-unresolved-symbols -Wl,--start-group $(foreach obj, $(APP_NAME).o $(SYSCALLS_SAM3_OBJ) $(SPI_OBJ) $(TRANSPORT_OBJS) $(VARIANT_OBJ) core.a, $(OBJ_DIR)/$(obj)) $(SDIR_ARD_CORE_3)/libsam_sam3x8e_gcc_rel.a -Wl,--end-group +else + $(error Wrong value for PLATFORM !!) +endif $(APP_NAME).hex: $(APP_NAME).elf - $(AVR_OBJCOPY) -O ihex -j .eeprom --set-section-flags=.eeprom=alloc,load --no-change-warnings --change-section-lma .eeprom=0 $< $(APP_NAME).eep - $(AVR_OBJCOPY) -O ihex -R .eeprom $< $@ +ifeq ($(PLATFORM),arduinomega) + $(AVR_OBJCOPY) -O ihex -j .eeprom --set-section-flags=.eeprom=alloc,load --no-change-warnings --change-section-lma .eeprom=0 $(OBJ_DIR)/$< $(OBJ_DIR)/$(APP_NAME).eep + $(AVR_OBJCOPY) -O ihex -R .eeprom $(OBJ_DIR)/$< $(OUT_DIR)/$@ +else ifeq ($(PLATFORM),arduinodue) + $(ARDUINO_TOOLS_DIR)/arm-none-eabi-objcopy -O binary $(OBJ_DIR)/$< $(OUT_DIR)/$@ +else + $(error Wrong value for PLATFORM !!) +endif install: all - $(AVR_PROGRAMMER) -C$(ARDUINO_DIR)/hardware/tools/avrdude.conf -v -v -v -v -patmega2560 -cstk500v2 -P$(ARDUINO_PORT) -b115200 -D -Uflash:w:$(APP_NAME).hex:i +ifeq ($(PLATFORM),arduinomega) + $(AVR_PROGRAMMER) -C$(ARDUINO_DIR)/hardware/tools/avrdude.conf -v -v -v -v -patmega2560 -cstk500v2 -P/dev/$(ARDUINO_PORT) -b115200 -D -Uflash:w:$(OUT_DIR)/$(APP_NAME).hex:i +else ifeq ($(PLATFORM),arduinodue) + stty -F /dev/$(ARDUINO_PORT) speed 1200 cs8 -cstopb -parenb + $(ARDUINO_DIR)/hardware/tools/bossac -i -d --port=$(ARDUINO_PORT) -U false -e -w -v -b $(OUT_DIR)/$(APP_NAME).hex -R +else + $(error Wrong value for PLATFORM !!) +endif .PHONY: clean -clean: - @rm -f *.o *.d *.elf *.eep *.a *.hex *.bin *.map *- - @rm -rf $(OBJ_DIR) +clean: legacy_clean + rm -rf arduinomega + rm -rf arduinodue +legacy_clean: + @rm -rf bin + @rm -f *.o *.d *.elf *.eep *.a *.hex *.bin *.map *- diff --git a/service/soft-sensor-manager/SampleApp/linux/ClientApp/SConscript b/service/soft-sensor-manager/SampleApp/linux/ClientApp/SConscript deleted file mode 100644 index 8ef6e46..0000000 --- a/service/soft-sensor-manager/SampleApp/linux/ClientApp/SConscript +++ /dev/null @@ -1,25 +0,0 @@ -## -# linux sample app build script -## - -Import('env') - -# Add third party libraries -SConscript(env.get('SRC_DIR') + '/service/third_party_libs.scons') -linux_sample_env = env.Clone() - -###################################################################### -# Build flags -###################################################################### -linux_sample_env.AppendUnique(CPPPATH = ['include/']) -linux_sample_env.AppendUnique(CXXFLAGS = ['-std=c++0x', '-Wall', '-pthread']) -linux_sample_env.AppendUnique(CPPDEFINES = ['LINUX']) -linux_sample_env.AppendUnique(LIBPATH = [env.get('BUILD_DIR')]) -linux_sample_env.AppendUnique(LIBS = ['pthread']) - -###################################################################### -#build sampleapp -###################################################################### -clientapp = linux_sample_env.Program('ClientApp', 'src/SSMTestApp.cpp') -Alias("clientapp_sample", clientapp) -env.AppendTarget('clientapp_sample') diff --git a/service/soft-sensor-manager/SampleApp/linux/SSMTesterApp/SConscript b/service/soft-sensor-manager/SampleApp/linux/SSMTesterApp/SConscript new file mode 100644 index 0000000..f711552 --- /dev/null +++ b/service/soft-sensor-manager/SampleApp/linux/SSMTesterApp/SConscript @@ -0,0 +1,36 @@ +## +# linux sample app build script +## + +Import('env') + +# Add third party libraries +lib_env = env.Clone() +SConscript(env.get('SRC_DIR') + '/service/third_party_libs.scons', 'lib_env') +linux_sample_env = lib_env.Clone() + +###################################################################### +# Build flags +###################################################################### +linux_sample_env.AppendUnique(CPPPATH = ['include']) +linux_sample_env.AppendUnique(CPPPATH = ['../../../SSMCore/include']) +linux_sample_env.AppendUnique(CPPPATH = ['../../../SSMCore/src']) +linux_sample_env.AppendUnique(CPPPATH = ['../../../SDK/include']) +linux_sample_env.AppendUnique(CXXFLAGS = ['-std=c++0x', '-Wall', '-pthread']) +linux_sample_env.AppendUnique(CPPDEFINES = ['LINUX']) +linux_sample_env.AppendUnique(LIBPATH = [env.get('BUILD_DIR')]) +linux_sample_env.AppendUnique(LIBS = ['libSSMSDK']) +linux_sample_env.AppendUnique(LIBS = ['libSSMCORE']) +linux_sample_env.AppendUnique(LIBS = ['oc']) +linux_sample_env.AppendUnique(LIBS = ['octbstack']) +linux_sample_env.AppendUnique(LIBS = ['libcoap']) +linux_sample_env.AppendUnique(LIBS = ['liboc_logger']) +linux_sample_env.AppendUnique(LIBS = ['dl']) +linux_sample_env.AppendUnique(LIBS = ['pthread']) + +###################################################################### +#build sampleapp +###################################################################### +ssmtesterapp = linux_sample_env.Program('SSMTesterApp', 'src/SSMTestApp.cpp') +Alias("SSMTesterApp", ssmtesterapp) +env.AppendTarget('SSMTesterApp') diff --git a/service/soft-sensor-manager/SampleApp/linux/THSensorApp/SConscript b/service/soft-sensor-manager/SampleApp/linux/THSensorApp/SConscript index accd6ef..9ea870c 100644 --- a/service/soft-sensor-manager/SampleApp/linux/THSensorApp/SConscript +++ b/service/soft-sensor-manager/SampleApp/linux/THSensorApp/SConscript @@ -5,16 +5,21 @@ Import('env') # Add third party libraries -SConscript(env.get('SRC_DIR') + '/service/third_party_libs.scons') -linux_sample_env = env.Clone() +lib_env = env.Clone() +SConscript(env.get('SRC_DIR') + '/service/third_party_libs.scons', 'lib_env') +linux_sample_env = lib_env.Clone() ###################################################################### # Build flags ###################################################################### -linux_sample_env.AppendUnique(CPPPATH = ['include/']) +linux_sample_env.AppendUnique(CPPPATH = ['include']) linux_sample_env.AppendUnique(CXXFLAGS = ['-std=c++0x', '-Wall', '-pthread']) linux_sample_env.AppendUnique(CPPDEFINES = ['LINUX']) linux_sample_env.AppendUnique(LIBPATH = [env.get('BUILD_DIR')]) +linux_sample_env.AppendUnique(LIBS = ['oc']) +linux_sample_env.AppendUnique(LIBS = ['octbstack']) +linux_sample_env.AppendUnique(LIBS = ['libcoap']) +linux_sample_env.AppendUnique(LIBS = ['liboc_logger']) linux_sample_env.AppendUnique(LIBS = ['pthread']) ###################################################################### diff --git a/service/soft-sensor-manager/SampleApp/linux/THSensorApp1/SConscript b/service/soft-sensor-manager/SampleApp/linux/THSensorApp1/SConscript index 6b5a0bf..f6c65fa 100644 --- a/service/soft-sensor-manager/SampleApp/linux/THSensorApp1/SConscript +++ b/service/soft-sensor-manager/SampleApp/linux/THSensorApp1/SConscript @@ -5,16 +5,21 @@ Import('env') # Add third party libraries -SConscript(env.get('SRC_DIR') + '/service/third_party_libs.scons') -linux_sample_env = env.Clone() +lib_env = env.Clone() +SConscript(env.get('SRC_DIR') + '/service/third_party_libs.scons', 'lib_env') +linux_sample_env = lib_env.Clone() ###################################################################### # Build flags ###################################################################### -linux_sample_env.AppendUnique(CPPPATH = ['include/']) +linux_sample_env.AppendUnique(CPPPATH = ['include']) linux_sample_env.AppendUnique(CXXFLAGS = ['-std=c++0x', '-Wall', '-pthread']) linux_sample_env.AppendUnique(CPPDEFINES = ['LINUX']) linux_sample_env.AppendUnique(LIBPATH = [env.get('BUILD_DIR')]) +linux_sample_env.AppendUnique(LIBS = ['oc']) +linux_sample_env.AppendUnique(LIBS = ['octbstack']) +linux_sample_env.AppendUnique(LIBS = ['libcoap']) +linux_sample_env.AppendUnique(LIBS = ['liboc_logger']) linux_sample_env.AppendUnique(LIBS = ['pthread']) ###################################################################### diff --git a/service/soft-sensor-manager/SampleApp/tizen/SSMTesterApp/oic-sample/CMakeLists.txt b/service/soft-sensor-manager/SampleApp/tizen/SSMTesterApp/oic-sample/CMakeLists.txt index c0aae0a..982cff1 100644 --- a/service/soft-sensor-manager/SampleApp/tizen/SSMTesterApp/oic-sample/CMakeLists.txt +++ b/service/soft-sensor-manager/SampleApp/tizen/SSMTesterApp/oic-sample/CMakeLists.txt @@ -41,7 +41,7 @@ SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed") LINK_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/lib) ADD_EXECUTABLE(${TESTAPP} ${SRCS}) -TARGET_LINK_LIBRARIES(${TESTAPP} ${pkgs_LDFLAGS} ssmcore oc octbstack oc_logger oc_logger_core pthread dl) +TARGET_LINK_LIBRARIES(${TESTAPP} ${pkgs_LDFLAGS} ssmcore oc octbstack oc_logger pthread dl) INSTALL(TARGETS ${TESTAPP} DESTINATION ${BINDIR}) diff --git a/service/soft-sensor-manager/build/arduino/Makefile b/service/soft-sensor-manager/build/arduino/Makefile index 82dba85..1c3ae15 100644 --- a/service/soft-sensor-manager/build/arduino/Makefile +++ b/service/soft-sensor-manager/build/arduino/Makefile @@ -1,4 +1,7 @@ +IOTIVITY_DIR=${shell cd ../../../../ && pwd} +${shell echo "ROOT_DIR=${IOTIVITY_DIR}" > ./root_path.inc} +-include ./root_path.inc -include ./environment.mk MAKE=make @@ -24,13 +27,12 @@ pre_job: @echo "*********************************************************" @mkdir -p ${RST_NAME} @echo " " -# @cd ${IOT_BASE} && ${MAKE}; -# @cd ${CUR_DIR}; + build: @for subdir in ${MAKE_LIST} ; do \ echo ">>>>>>>>>>>> $${subdir}/Makefile run <<<<<<<<<<<<<" ; \ - ${MAKE} -C $${subdir} ; \ + cd $${subdir} && ${MAKE} ${OPTION} ; \ echo " " ; \ done @echo " " @@ -46,11 +48,7 @@ post_job: @echo " " clean: - -# @cd ${CUR_DIR}/../../../resource/ && make clean -# @cd ${CUR_DIR}/../../../resource/csdk && make deepclean -# @cd ${CUR_DIR}/9_Arduino_THSensorApp && make clean -# @cd ${CUR_DIR} + rm -rf ./${RST_NAME} @for subdir in ${MAKE_LIST} ; do \ echo ">>>>>>>>>>>> $${subdir}/Makefile clean run <<<<<<<<<<<<<<" ; \ diff --git a/service/soft-sensor-manager/build/arduino/environment.mk b/service/soft-sensor-manager/build/arduino/environment.mk index 7e16a38..2d8949e 100644 --- a/service/soft-sensor-manager/build/arduino/environment.mk +++ b/service/soft-sensor-manager/build/arduino/environment.mk @@ -1,23 +1,25 @@ -# root path of each PC. -ROOT_DIR=/home/choi/tmp/test/upload/Iotivity-Candidate -# service folder path. -FD_SSM=${ROOT_DIR}/service/SoftSensorManager +# ioc-resource folder path. +IOT_BASE=${ROOT_DIR}/resource +IOT_MAKE_PATH=${IOT_BASE} +IOT_RELEASE=${IOT_BASE}/release/obj +IOT_CSDK_LINUX_RELEASE=${IOT_BASE}/csdk/linux/release +IOT_CSDK_ARDUINOMEGA_RELEASE=${IOT_BASE}/csdk/arduinomega/release + +# oic-service folder path. +FD_SSM=${ROOT_DIR}/service/soft-sensor-manager FD_SAMPLEAPP=${FD_SSM}/SampleApp FD_BUILD=${FD_SSM}/build # outputs directory path. OUTPUTS_DIR=${FD_BUILD}/arduino/release -# ioc-resource folder path. -# IOT_BASE=${FD_SAMPLEAPP}/arduino/resource_a -IOT_BASE=${ROOT_DIR}/resource -IOT_MAKE_PATH=${IOT_BASE} -IOT_RELEASE=${IOT_BASE}/release/obj -IOT_CSDK_RELEASE=${IOT_BASE}/csdk/release - +#OPTION=PLATFORM=arduinomega ARDUINOWIFI=1 # SoftSensorManager makefile path +MAKE_00=${FD_SAMPLEAPP}/arduino MAKE_01=${FD_SAMPLEAPP}/arduino/THSensorApp/build +MAKE_03=${FD_SAMPLEAPP}/arduino/Trackee_Thing/build +MAKE_04=${FD_SAMPLEAPP}/arduino/Reference_Thing/build -MAKE_LIST=${MAKE_01} +MAKE_LIST=${MAKE_01} ${MAKE_03} ${MAKE_04} diff --git a/service/soft-sensor-manager/build/arduino/local.properties b/service/soft-sensor-manager/build/arduino/local.properties index 39184bd..e0b44b8 100644 --- a/service/soft-sensor-manager/build/arduino/local.properties +++ b/service/soft-sensor-manager/build/arduino/local.properties @@ -1,5 +1,4 @@ -#ARDUINO_DIR = /home/choi/devel/arduino-1.0.5 -ARDUINO_DIR = /home/choi/tmp/test/Arduino +ARDUINO_DIR = /usr/share/arduino #ARDUINO_TOOLS_DIR = $(ARDUINO_DIR)/hardware/tools/avr/bin CC=avr-g++ CCPLUS=avr-g++ diff --git a/service/soft-sensor-manager/build/linux/environment.mk b/service/soft-sensor-manager/build/linux/environment.mk index 6652271..d4def6d 100644 --- a/service/soft-sensor-manager/build/linux/environment.mk +++ b/service/soft-sensor-manager/build/linux/environment.mk @@ -35,5 +35,4 @@ MAKE_05=${FD_SOFTSENSOR}/DiscomfortIndexSensor/build/linux MAKE_06=${FD_SOFTSENSOR}/IndoorTrajectorySensor/build/linux -MAKE_LIST=${MAKE_01} ${MAKE_02} ${MAKE_05} ${MAKE_06} ${MAKE_03} -#MAKE_LIST=${MAKE_01} ${MAKE_02} ${MAKE_05} ${MAKE_03} +MAKE_LIST=${MAKE_01} ${MAKE_02} ${MAKE_03} ${MAKE_05} ${MAKE_06} \ No newline at end of file -- 2.7.4