That way header and library files can end up in the right place on the file system, and perf tools compiled without having to specify any environment variable.
Signed-off-by: Mathieu Poirier mathieu.poirier@linaro.org --- decoder/build/linux/makefile | 17 +++++++++++++++++ 1 file changed, 17 insertions(+)
diff --git a/decoder/build/linux/makefile b/decoder/build/linux/makefile index c9724bbfb371..969cd24a9b17 100644 --- a/decoder/build/linux/makefile +++ b/decoder/build/linux/makefile @@ -61,11 +61,18 @@ export OCSD_SOURCE=$(OCSD_ROOT)/source
export OCSD_TESTS=$(OCSD_ROOT)/tests
+UAPI_INCLUDE=$(OCSD_INCLUDE)/$(LIB_BASE_NAME) + # tools export MASTER_CC=$(CROSS_COMPILE)gcc export MASTER_CPP=$(CROSS_COMPILE)g++ export MASTER_LINKER=$(CROSS_COMPILE)g++ export MASTER_LIB=$(CROSS_COMPILE)ar +INSTALL=install + +# installation directory +INSTALL_LIB_DIR=/usr/lib/ +INSTALL_INCLUDE_DIR=/usr/include/
# compile flags MASTER_CC_FLAGS := -c -Wall -DLINUX @@ -125,6 +132,11 @@ all: libs tests
libs: $(LIB_BASE_NAME)_lib $(LIB_CAPI_NAME)_lib
+install: libs + $(INSTALL) --mode=644 $(LIB_TARGET_DIR)/lib$(LIB_BASE_NAME).so $(INSTALL_LIB_DIR)/ + $(INSTALL) --mode=644 $(LIB_TARGET_DIR)/lib$(LIB_CAPI_NAME).so $(INSTALL_LIB_DIR)/ + cp -dR $(UAPI_INCLUDE) $(INSTALL_INCLUDE_DIR)/ + ################################ # build OpenCSD trace decode library # @@ -177,3 +189,8 @@ clean_tests: cd $(OCSD_ROOT)/tests/build/linux/snapshot_parser_lib && make clean cd $(OCSD_ROOT)/tests/build/linux/trc_pkt_lister && make clean cd $(OCSD_ROOT)/tests/build/linux/c_api_pkt_print_test && make clean + +clean_install: + rm -f $(INSTALL_LIB_DIR)/lib$(LIB_BASE_NAME).so + rm -f $(INSTALL_LIB_DIR)/lib$(LIB_CAPI_NAME).so + rm -rf $(INSTALL_INCLUDE_DIR)/$(LIB_BASE_NAME)