summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksandar Bozhinovski <aleksandar.bozhinovski@seavus.com>2012-04-19 09:20:41 +0200
committerViktor Mladenovski <viktor.mladenovski@seavus.com>2012-05-25 14:45:37 +0200
commit78bf8bace61dbae9d7d314716dfd356ff639a416 (patch)
tree5ab27395bf17dfbfbc86e751192a81bc5a50e842
parentd9f6ac4b324136f8d94f240f8cdf4007751fb4c1 (diff)
Restructure Makefile
ST-Ericsson ID: 413195 ST-Ericsson FOSS-OUT ID: NA Change-Id: Ia091cf22d30561765361cb2ffd67bb5b780c3c69 Depends-On: Ia31e8916a73aeb353d737045bf737e9c6e8f3c34 Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/54106 Reviewed-by: QABUILD Reviewed-by: QATEST Tested-by: Aleksandar BOZHINOVSKI <aleksandar.bozhinovski@seavus.com> Reviewed-by: Zoran ANCEVSKI <zoran.ancevski@seavus.com> Reviewed-by: Viktor MLADENOVSKI <viktor.mladenovski@stericsson.com>
-rw-r--r--Android.mk2
-rw-r--r--Makefile3
-rw-r--r--lcmodule/Makefile141
-rw-r--r--source/LcmInterface.cpp6
4 files changed, 29 insertions, 123 deletions
diff --git a/Android.mk b/Android.mk
index 4afef56..a13e8aa 100644
--- a/Android.mk
+++ b/Android.mk
@@ -36,7 +36,7 @@ PRIVATE_LC_LCD_FLAGS := LCD_INSTALLDIR=$(PRIVATE_LC_LCD_INSTALLDIR) PATH=$(PATH)
PRIVATE_LC_LCM_FLAGS := LCM_PATH=$(PRIVATE_LC_LCM_DIR) LOADER_DIR=$(PRIVATE_LC_LOADERS_DIR) \
LCMLIB_INSTALLDIR=$(PRIVATE_LC_LCMLIB_INSTALLDIR) \
- LCMLDR_INSTALLDIR=$(PRIVATE_LC_LCM_INSTALLDIR) PATH=$(PATH)
+ PATH=$(PATH)
#LCM TARGETS
.PHONY: config-lcm
diff --git a/Makefile b/Makefile
index 7844165..5cc580e 100644
--- a/Makefile
+++ b/Makefile
@@ -317,7 +317,8 @@ $(AUTO_DIR_LIB)/error_codes_desc.cpp: $(LCD_CONFIG)lcdriver_error_codes.xml $(LC
@echo "Generating autogen $(AUTO_DIR_LIB)/error_codes_desc.cpp..."
@java -classpath $(XALAN_PATH)xalan.jar org.apache.xalan.xslt.Process -in $(LCD_CONFIG)lcdriver_error_codes.xml -xsl $(LCD_CONFIG)error_codes_desc_cpp.xsl -out $@ -PARAM errorCodesLcmXml $(LCM_ERR_DESC_PATH)
-$(AUTO_DIR_LIB)/LcdVersion.cpp: setup_folders
+$(AUTO_DIR_LIB)/LcdVersion.cpp: $(LCD_DIR)source/gen_version_files.sh | setup_folders
+ @echo "Generating autogen $(AUTO_DIR_LIB)/LcdVersion.cpp..."
bash $(LCD_DIR)source/gen_version_files.sh --lcd $(abspath $(AUTO_DIR_LIB)) $(abspath $(LCD_DIR))
#setting up needed folders
diff --git a/lcmodule/Makefile b/lcmodule/Makefile
index 63424c3..c418122 100644
--- a/lcmodule/Makefile
+++ b/lcmodule/Makefile
@@ -295,7 +295,7 @@ $(AUTO_DIR_LOADER)/custom_commands.h: $(LCM_CUST_CONFIG)/custom_commands.xml $(L
$(AUTO_DIR_LOADER)/custom_command_marshal.c: $(LCM_CUST_CONFIG)/custom_commands.xml $(LCM_CUST_CONFIG)/custom_command_marshal.xsl | setup_folders
java -classpath $(LCM_PATH)/tools/xalan-j_2_7_1/xalan.jar org.apache.xalan.xslt.Process -in $(LCM_CUST_CONFIG)/custom_commands.xml -xsl $(LCM_CUST_CONFIG)/custom_command_marshal.xsl -out $@
-$(LCM_AUTO_DIR)/lcm_version.c: setup_folders
+$(LCM_AUTO_DIR)/lcm_version.c: ${LCM_PATH}/../source/gen_version_files.sh | setup_folders
bash ${LCM_PATH}/../source/gen_version_files.sh --lcm $(abspath $(LCM_AUTO_DIR)) $(abspath $(LCM_PATH))
#setting up needed folders
@@ -305,12 +305,6 @@ $(BUILDFOLDER): | configfile
$(BUILDFOLDER)/.builddummy: | $(BUILDFOLDER)
@touch $@
-$(LCMLDR_INSTALLDIR): | configfile
- @mkdir -p $@ 2> /dev/null
-
-$(LCMLDR_INSTALLDIR)/.ldrinstalldummy: | $(LCMLDR_INSTALLDIR)
- @touch $@
-
$(LCMLIB_INSTALLDIR): | configfile
@mkdir -p $@ 2> /dev/null
@@ -337,7 +331,6 @@ $(LCM_AUTO_DIR)/.autodirdummy : | $(LCM_AUTO_DIR)
.PHONY: setup_folders
setup_folders: validatevariables
-setup_folders: $(BUILDFOLDER)/.builddummy $(LCMLDR_INSTALLDIR)/.ldrinstalldummy $(LCMLIB_INSTALLDIR)/.libinstalldummy
setup_folders: $(AUTO_DIR_LOADER)/.autodirldrdummy $(AUTO_DIR_LIB)/.autodirlibdummy $(LCM_AUTO_DIR)/.autodirdummy
@echo $< > /dev/null
@@ -353,7 +346,6 @@ validatevariables: configfile
$(if $(LCM_AUTO_DIR),, $(error "LCM_AUTO_DIR not set"))
$(if $(AUTO_DIR_LOADER),, $(error "AUTO_DIR_LOADER not set"))
$(if $(LCMLIB_INSTALLDIR),, $(error "LCMLIB_INSTALLDIR not set"))
- $(if $(LCMLDR_INSTALLDIR),, $(error "LCMLDR_INSTALLDIR not set"))
$(if $(LIB_x32),, $(error "LIB_x32 not set"))
$(if $(LIB_x64),, $(error "LIB_x64 not set"))
$(if $(LIB_x32_OBJ_DIR),, $(error "LIB_x32_OBJ_DIR not set"))
@@ -373,8 +365,6 @@ configfile: $(if $(wildcard $(config_file)),,config)
@echo $< > /dev/null
.PHONY: config
-config: LCMLIB_INSTALLDIR := /tmp/
-config: LCMLDR_INSTALLDIR := /tmp/
config: LIB_x32_OBJ_DIR := x32
config: LIB_x64_OBJ_DIR := x64
config: LOADER_DIR := ./
@@ -415,21 +405,33 @@ config:
@echo "AUTO_DIR_LOADER := \$$(LCM_AUTO_DIR)/loader" >> $(config_file)
@echo "LOADER_DIR := $(LOADER_DIR)" >> $(config_file)
@echo "LCMLIB_INSTALLDIR := $(LCMLIB_INSTALLDIR)" >> $(config_file)
- @echo "LCMLDR_INSTALLDIR := $(LCMLDR_INSTALLDIR)" >> $(config_file)
@echo "LIB_x32_OBJ_DIR := $(LIB_x32_OBJ_DIR)" >> $(config_file)
@echo "LIB_x64_OBJ_DIR := $(LIB_x64_OBJ_DIR)" >> $(config_file)
@echo CONFIG_DIR : $(CONFIG_DIR)
install:
- install -p -m 0555 ${AUTO_DIR_LOADER}/* ${LCMLDR_INSTALLDIR}
- install -p -m 0555 ${TRANSPORT_PATH}/source/*.c ${LCMLDR_INSTALLDIR}
- install -p -m 0555 ${NETWORK_PATH}/source/*.c ${LCMLDR_INSTALLDIR}
- install -p -m 0555 ${LCM_CNH_PATH}/source/*.c ${LCMLDR_INSTALLDIR}
- install -p -m 0555 ${TRANSPORT_PATH}/include/*.h ${LCMLDR_INSTALLDIR}
- install -p -m 0555 ${NETWORK_PATH}/include/*.h ${LCMLDR_INSTALLDIR}
- install -p -m 0555 ${LCM_CNH_PATH}/include/*.h ${LCMLDR_INSTALLDIR}
- install -p -m 0555 ${LCM_PATH}/source/serialization.c ${LCMLDR_INSTALLDIR}
+ $(MAKE) -C . start-install
+ifeq ($(USE_MINGW_X32),1)
+ $(MAKE) -C . start-install BUILD_WIN=1
+endif
+ifeq ($(USE_MINGW_X64),1)
+ $(MAKE) -C . start-install BUILD_WIN=2
+endif
+start-install: start-build
+ifeq ($(BUILD_WIN),)
+ install -p -m 0755 $(LIB_x32) ${LCMLIB_INSTALLDIR}
+ifeq ($(LBITS),64)
+ install -p -m 0755 $(LIB_x64) ${LCMLIB_INSTALLDIR}
+endif
+else
+ifeq ($(BUILD_WIN),1)
+ install -p -m 0755 $(LIB_x32) ${LCMLIB_INSTALLDIR}
+endif
+ifeq ($(BUILD_WIN),2)
+ install -p -m 0755 $(LIB_x64) ${LCMLIB_INSTALLDIR}
+endif
+endif
$(MAKE) -C . start-install
ifeq ($(USE_MINGW_X32),1)
$(MAKE) -C . start-install BUILD_WIN=1
@@ -480,106 +482,9 @@ endif
@rm -rf ${BUILDOUT},)
distclean: clean
- $(if ${LCMLDR_INSTALLDIR}, \
- @rm -f ${LCMLDR_INSTALLDIR}/a2_family.c \
- @rm -f ${LCMLDR_INSTALLDIR}/r_a2_family.h \
- @rm -f ${LCMLDR_INSTALLDIR}/t_a2_protocol.h \
- @rm -f ${LCMLDR_INSTALLDIR}/a2_header.c \
- @rm -f ${LCMLDR_INSTALLDIR}/r_a2_header.h \
- @rm -f ${LCMLDR_INSTALLDIR}/t_a2_transport.h \
- @rm -f ${LCMLDR_INSTALLDIR}/a2_network.c \
- @rm -f ${LCMLDR_INSTALLDIR}/r_a2_network.h \
- @rm -f ${LCMLDR_INSTALLDIR}/t_bulk_protocol.h \
- @rm -f ${LCMLDR_INSTALLDIR}/a2_protocol.c \
- @rm -f ${LCMLDR_INSTALLDIR}/r_a2_protocol.h \
- @rm -f ${LCMLDR_INSTALLDIR}/t_command_protocol.h \
- @rm -f ${LCMLDR_INSTALLDIR}/a2_transport.c \
- @rm -f ${LCMLDR_INSTALLDIR}/r_a2_transport.h \
- @rm -f ${LCMLDR_INSTALLDIR}/t_communication_service.h \
- @rm -f ${LCMLDR_INSTALLDIR}/audit.c \
- @rm -f ${LCMLDR_INSTALLDIR}/r_bulk_protocol.h \
- @rm -f ${LCMLDR_INSTALLDIR}/ti_family.c \
- @rm -f ${LCMLDR_INSTALLDIR}/audit.h \
- @rm -f ${LCMLDR_INSTALLDIR}/r_command_protocol.h \
- @rm -f ${LCMLDR_INSTALLDIR}/ti_header.c \
- @rm -f ${LCMLDR_INSTALLDIR}/bulk_protocol.c \
- @rm -f ${LCMLDR_INSTALLDIR}/r_communication_service.h \
- @rm -f ${LCMLDR_INSTALLDIR}/ti_network.c \
- @rm -f ${LCMLDR_INSTALLDIR}/command_ids.h \
- @rm -f ${LCMLDR_INSTALLDIR}/r_measurement_tool.h \
- @rm -f ${LCMLDR_INSTALLDIR}/ti_protocol.c \
- @rm -f ${LCMLDR_INSTALLDIR}/command_marshal.c \
- @rm -f ${LCMLDR_INSTALLDIR}/ces_commands.c \
- @rm -f ${LCMLDR_INSTALLDIR}/ces_commands.h \
- @rm -f ${LCMLDR_INSTALLDIR}/r_protrom_family.h \
- @rm -f ${LCMLDR_INSTALLDIR}/ti_transport.c \
- @rm -f ${LCMLDR_INSTALLDIR}/command_protocol.c \
- @rm -f ${LCMLDR_INSTALLDIR}/r_protrom_header.h \
- @rm -f ${LCMLDR_INSTALLDIR}/t_measurement_tool.h \
- @rm -f ${LCMLDR_INSTALLDIR}/commands.h \
- @rm -f ${LCMLDR_INSTALLDIR}/r_protrom_network.h \
- @rm -f ${LCMLDR_INSTALLDIR}/t_protrom_header.h \
- @rm -f ${LCMLDR_INSTALLDIR}/commands_impl.h \
- @rm -f ${LCMLDR_INSTALLDIR}/r_protrom_protocol.h \
- @rm -f ${LCMLDR_INSTALLDIR}/t_protrom_network.h \
- @rm -f ${LCMLDR_INSTALLDIR}/communication_service.c \
- @rm -f ${LCMLDR_INSTALLDIR}/lcm_version.c \
- @rm -f ${LCMLDR_INSTALLDIR}/r_protrom_transport.h \
- @rm -f ${LCMLDR_INSTALLDIR}/t_protrom_protocol.h \
- @rm -f ${LCMLDR_INSTALLDIR}/custom_command_ids.h \
- @rm -f ${LCMLDR_INSTALLDIR}/r_r15_family.h \
- @rm -f ${LCMLDR_INSTALLDIR}/t_protrom_transport.h \
- @rm -f ${LCMLDR_INSTALLDIR}/custom_command_marshal.c \
- @rm -f ${LCMLDR_INSTALLDIR}/r_r15_header.h \
- @rm -f ${LCMLDR_INSTALLDIR}/t_r15_family.h \
- @rm -f ${LCMLDR_INSTALLDIR}/custom_commands.h \
- @rm -f ${LCMLDR_INSTALLDIR}/r_r15_network_layer.h \
- @rm -f ${LCMLDR_INSTALLDIR}/t_r15_header.h \
- @rm -f ${LCMLDR_INSTALLDIR}/custom_commands_impl.h \
- @rm -f ${LCMLDR_INSTALLDIR}/r_r15_transport_layer.h \
- @rm -f ${LCMLDR_INSTALLDIR}/t_r15_network_layer.h \
- @rm -f ${LCMLDR_INSTALLDIR}/error_codes.h \
- @rm -f ${LCMLDR_INSTALLDIR}/r_ti_family.h \
- @rm -f ${LCMLDR_INSTALLDIR}/t_r15_transport_layer.h \
- @rm -f ${LCMLDR_INSTALLDIR}/measurement_tool.c \
- @rm -f ${LCMLDR_INSTALLDIR}/r_ti_header.h \
- @rm -f ${LCMLDR_INSTALLDIR}/t_ti_header.h \
- @rm -f ${LCMLDR_INSTALLDIR}/memmap.h \
- @rm -f ${LCMLDR_INSTALLDIR}/r_ti_network.h \
- @rm -f ${LCMLDR_INSTALLDIR}/t_ti_network.h \
- @rm -f ${LCMLDR_INSTALLDIR}/protrom_family.c \
- @rm -f ${LCMLDR_INSTALLDIR}/r_ti_protocol.h \
- @rm -f ${LCMLDR_INSTALLDIR}/t_ti_protocol.h \
- @rm -f ${LCMLDR_INSTALLDIR}/protrom_header.c \
- @rm -f ${LCMLDR_INSTALLDIR}/r_ti_transport.h \
- @rm -f ${LCMLDR_INSTALLDIR}/t_ti_transport.h \
- @rm -f ${LCMLDR_INSTALLDIR}/protrom_network.c \
- @rm -f ${LCMLDR_INSTALLDIR}/r_z_family.h \
- @rm -f ${LCMLDR_INSTALLDIR}/t_z_header.h \
- @rm -f ${LCMLDR_INSTALLDIR}/protrom_protocol.c \
- @rm -f ${LCMLDR_INSTALLDIR}/r_z_network.h \
- @rm -f ${LCMLDR_INSTALLDIR}/t_z_network.h \
- @rm -f ${LCMLDR_INSTALLDIR}/protrom_transport.c \
- @rm -f ${LCMLDR_INSTALLDIR}/r_z_protocol.h \
- @rm -f ${LCMLDR_INSTALLDIR}/t_z_protocol.h \
- @rm -f ${LCMLDR_INSTALLDIR}/r15_family.c \
- @rm -f ${LCMLDR_INSTALLDIR}/r_z_transport.h \
- @rm -f ${LCMLDR_INSTALLDIR}/z_family.c \
- @rm -f ${LCMLDR_INSTALLDIR}/r15_header.c \
- @rm -f ${LCMLDR_INSTALLDIR}/serialization.c \
- @rm -f ${LCMLDR_INSTALLDIR}/z_network.c \
- @rm -f ${LCMLDR_INSTALLDIR}/r15_network_layer.c \
- @rm -f ${LCMLDR_INSTALLDIR}/t_a2_header.h \
- @rm -f ${LCMLDR_INSTALLDIR}/z_transport.c \
- @rm -f ${LCMLDR_INSTALLDIR}/r15_transport_layer.c \
- @rm -f ${LCMLDR_INSTALLDIR}/t_a2_network.h \
+
@rm -f ${LCMLIB_INSTALLDIR}/LCM.dll \
@rm -f $(LCMLIB_INSTALLDIR)/LCM_x64.dll \
- @rm -f ${LCMLIB_INSTALLDIR}/liblcm.$(LIB_EXTENSION),)
-ifeq ($(LBITS),64)
- $(if ${LCMLDR_INSTALLDIR}, \
- @rm -f ${LCMLIB_INSTALLDIR}/liblcm_x64.$(LIB_EXTENSION),)
-endif
$(if ${LCM_AUTO_DIR}, \
@rm -rf ${LCM_AUTO_DIR},)
$(if $(config_file), \
diff --git a/source/LcmInterface.cpp b/source/LcmInterface.cpp
index cee1714..6ddea57 100644
--- a/source/LcmInterface.cpp
+++ b/source/LcmInterface.cpp
@@ -208,9 +208,9 @@ ErrorCode_e LcmInterface::CommunicationCheckVersion(char *LCMVersion_p, LCM_t LC
ReturnValue = LCM_LOAD_INCOMPATIBLE_LDR_VERSION;
}
- if (strcmp(LCMVersion_p, LCD_LCM_Compatibility) == 0) {
- ReturnValue = E_SUCCESS;
- }
+ if (strcmp(LCMVersion_p, LCD_LCM_Compatibility) == 0) {
+ ReturnValue = E_SUCCESS;
+ }
return static_cast<ErrorCode_e>(ReturnValue);
}