lh | 758261d | 2023-07-13 05:52:04 -0700 | [diff] [blame] | 1 | |
| 2 | include $(COMMON_BASE_MK) |
| 3 | |
| 4 | NAME=dlt-daemon |
| 5 | SRC_DIR=dlt-daemon-2.18.8 |
| 6 | INSTALL_DIR=$(APP_DIR)/$(NAME)/install |
| 7 | BUILD_DIR=$(SRC_DIR)/build |
| 8 | GEN_MAKEFILE=$(BUILD_DIR)/Makefile |
| 9 | |
| 10 | CONFIG_OPTS = -DCMAKE_SYSTEM_NAME=Linux |
| 11 | CONFIG_OPTS += -DCMAKE_SYSTEM_PROCESSOR=arm |
| 12 | CONFIG_OPTS += -DCMAKE_C_COMPILER=$(CROSS_COMPILE_PREFIX)gcc |
| 13 | CONFIG_OPTS += -DCMAKE_CXX_COMPILER=$(CROSS_COMPILE_PREFIX)g++ |
| 14 | CONFIG_OPTS += -DCMAKE_AR=$(CROSS_COMPILE_PREFIX)ar |
| 15 | CONFIG_OPTS += -DCMAKE_C_FLAGS=" -march=armv7-a -g " |
| 16 | CONFIG_OPTS += -DCMAKE_CXX_FLAGS=" -march=armv7-a -g " |
| 17 | CONFIG_OPTS += -DCMAKE_C_LINK_FLAGS=" -march=armv7-a " |
| 18 | CONFIG_OPTS += -DCMAKE_CXX_LINK_FLAGS=" -march=armv7-a " |
| 19 | CONFIG_OPTS += -DCMAKE_INSTALL_PREFIX=$(INSTALL_DIR) |
| 20 | CONFIG_OPTS += -DCMAKE_INSTALL_LIBDIR=$(INSTALL_DIR)/lib |
| 21 | CONFIG_OPTS += -DCONFIGURATION_FILES_DIR=$(INSTALL_DIR)/etc |
| 22 | CONFIG_OPTS += -DRT_LIBRARY=$(CROSS_COMPILE_RT_LIBRARY) |
| 23 | |
| 24 | CONFIG_OPTS += -DWITH_SYSTEMD=OFF |
| 25 | CONFIG_OPTS += -DWITH_SYSTEMD_WATCHDOG=OFF |
| 26 | CONFIG_OPTS += -DWITH_SYSTEMD_JOURNAL=OFF |
| 27 | CONFIG_OPTS += -DWITH_DOC=OFF |
| 28 | CONFIG_OPTS += -DWITH_MAN=OFF |
| 29 | CONFIG_OPTS += -DWITH_DLT_ADAPTOR=OFF |
| 30 | CONFIG_OPTS += -DWITH_DLT_CONSOLE=OFF |
| 31 | CONFIG_OPTS += -DWITH_DLT_EXAMPLES=OFF |
| 32 | CONFIG_OPTS += -DWITH_DLT_SYSTEM=OFF |
| 33 | CONFIG_OPTS += -DWITH_DLT_DBUS=OFF |
| 34 | CONFIG_OPTS += -DWITH_DLT_TESTS=ON |
| 35 | CONFIG_OPTS += -DWITH_DLT_UNIT_TESTS=OFF |
| 36 | CONFIG_OPTS += -DWITH_DLT_SHM_ENABLE=OFF |
| 37 | CONFIG_OPTS += -DWITH_DLTTEST=OFF |
| 38 | CONFIG_OPTS += -DWITH_DLT_PKGCONFIG=ON |
| 39 | CONFIG_OPTS += -DWITH_DLT_CXX11_EXT=OFF |
| 40 | CONFIG_OPTS += -DWITH_DLT_COREDUMPHANDLER=OFF |
| 41 | CONFIG_OPTS += -DWITH_DLT_KPI=OFF |
| 42 | CONFIG_OPTS += -DWITH_DLT_FATAL_LOG_TRAP=OFF |
| 43 | CONFIG_OPTS += -DWITH_CHECK_CONFIG_FILE=OFF |
| 44 | CONFIG_OPTS += -DWITH_TESTSCRIPTS=OFF |
| 45 | CONFIG_OPTS += -DWITH_GPROF=OFF |
| 46 | CONFIG_OPTS += -DWITH_DLT_USE_IPv6=ON |
| 47 | CONFIG_OPTS += -DDLT_USER=genivi |
| 48 | CONFIG_OPTS += -DBUILD_SHARED_LIBS=ON |
| 49 | CONFIG_OPTS += -DTARGET_CPU_NAME= |
| 50 | #CONFIG_OPTS += -DCMAKE_INSTALL_PREFIX=/usr |
| 51 | CONFIG_OPTS += -DCMAKE_BUILD_TYPE=RelWithDebInfo |
| 52 | CONFIG_OPTS += -DCMAKE_HOST_SYSTEM_PROCESSOR=x86_64 |
| 53 | CONFIG_OPTS += -DCMAKE_SYSTEM_PROCESSOR=arm |
| 54 | CONFIG_OPTS += -DWITH_DLT_LOGSTORAGE_CTRL_UDEV=OFF |
| 55 | CONFIG_OPTS += -DDLT_IPC=UNIX_SOCKET |
| 56 | CONFIG_OPTS += -DWITH_UDP_CONNECTION=OFF |
| 57 | CONFIG_OPTS += -DWITH_DLT_DISABLE_MACRO=OFF |
| 58 | |
| 59 | CONFIG_OPTS += -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON |
| 60 | |
| 61 | |
| 62 | all: $(GEN_MAKEFILE) |
| 63 | make -C $(BUILD_DIR) all |
| 64 | make -C $(BUILD_DIR) install |
| 65 | |
| 66 | $(GEN_MAKEFILE): |
| 67 | mkdir -p $(BUILD_DIR) |
| 68 | cd $(BUILD_DIR); cmake $(CONFIG_OPTS) .. |
| 69 | |
| 70 | clean: |
| 71 | -rm -fr $(BUILD_DIR) $(INSTALL_DIR) |
| 72 | |
| 73 | romfs: |
| 74 | $(ROMFSINST) $(INSTALL_DIR)/bin/dlt-daemon /bin/dlt-daemon |
| 75 | $(ROMFSINST) $(INSTALL_DIR)/bin/dlt-test-user /bin/dlt-test-user |
| 76 | $(ROMFSINST) $(INSTALL_DIR)/etc/dlt.conf /etc/dlt.conf |
| 77 | cd $(INSTALL_DIR)/lib; \ |
| 78 | for i in *.so*; do \ |
| 79 | if [ -L $$i ]; then \ |
| 80 | $(ROMFSINST) -s `find $$i -printf %l` /lib/$$i; \ |
| 81 | elif [ -f $$i ]; then \ |
| 82 | $(ROMFSINST) /lib/$$i; \ |
| 83 | fi; \ |
| 84 | done |