From 60d949607437dc27d2a4c473978c43d7447368ee Mon Sep 17 00:00:00 2001 From: Hevake Date: Sun, 21 Apr 2024 07:57:49 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0cpp-tbox=E7=89=88=E6=9C=AC?= =?UTF-8?q?=E8=87=B3=201.8.11=EF=BC=8C=E5=B9=B6=E8=B0=83=E6=95=B4tools/bui?= =?UTF-8?q?ld=5Fenv.mk?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitmodules | 2 +- 3rd-party/Makefile | 10 +--------- 3rd-party/cpp-tbox | 1 - 3rd-party/cpp-tbox/Makefile | 15 +++++++++++++++ 3rd-party/cpp-tbox/src | 1 + platforms/host/.gitignore | 4 +--- tools/build_env.mk | 22 +++++++--------------- 7 files changed, 26 insertions(+), 29 deletions(-) delete mode 160000 3rd-party/cpp-tbox create mode 100644 3rd-party/cpp-tbox/Makefile create mode 160000 3rd-party/cpp-tbox/src diff --git a/.gitmodules b/.gitmodules index 7c5a188..c59db5b 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,5 +1,5 @@ [submodule "3rd-party/cpp-tbox"] - path = 3rd-party/cpp-tbox + path = 3rd-party/cpp-tbox/src url = git@gitee.com:cpp-master/cpp-tbox.git branch = develop [submodule "3rd-party/mosquitto/src"] diff --git a/3rd-party/Makefile b/3rd-party/Makefile index 9ca7015..7e8e1d9 100644 --- a/3rd-party/Makefile +++ b/3rd-party/Makefile @@ -6,15 +6,7 @@ export PREFIX ?= targets += nlohmann targets += mosquitto - -targets += cpp-tbox/modules/base \ - cpp-tbox/modules/event \ - cpp-tbox/modules/eventx \ - cpp-tbox/modules/util \ - cpp-tbox/modules/log \ - cpp-tbox/modules/network \ - cpp-tbox/modules/terminal \ - cpp-tbox/modules/main \ +targets += cpp-tbox all test clean distclean: @for i in $(targets); do \ diff --git a/3rd-party/cpp-tbox b/3rd-party/cpp-tbox deleted file mode 160000 index ff21b33..0000000 --- a/3rd-party/cpp-tbox +++ /dev/null @@ -1 +0,0 @@ -Subproject commit ff21b3346c77d0f70e578de1997f36d38528ce5a diff --git a/3rd-party/cpp-tbox/Makefile b/3rd-party/cpp-tbox/Makefile new file mode 100644 index 0000000..d95367a --- /dev/null +++ b/3rd-party/cpp-tbox/Makefile @@ -0,0 +1,15 @@ +all: + cd src; \ + make modules RELEASE=1 + +test: + cd src; \ + make tests; + +clean: + cd src; \ + make clean + +distclean: + cd src; \ + make distclean diff --git a/3rd-party/cpp-tbox/src b/3rd-party/cpp-tbox/src new file mode 160000 index 0000000..7a7fba9 --- /dev/null +++ b/3rd-party/cpp-tbox/src @@ -0,0 +1 @@ +Subproject commit 7a7fba91d4bf5f06371006f38ef281fb61a48c0e diff --git a/platforms/host/.gitignore b/platforms/host/.gitignore index 6510139..1f57b97 100644 --- a/platforms/host/.gitignore +++ b/platforms/host/.gitignore @@ -1,3 +1 @@ -/staging_files -/install_files -/build_files +/output diff --git a/tools/build_env.mk b/tools/build_env.mk index 28bfe72..e5953c3 100644 --- a/tools/build_env.mk +++ b/tools/build_env.mk @@ -9,30 +9,22 @@ export CONFIGURE_HELPER ?= $(TOP_DIR)/tools/configure_helper.sh export MAKE_PATCH ?= $(TOP_DIR)/tools/make_patch.sh export COMMON_DIR ?= $(TOP_DIR)/platforms/common -export CONSTANT_DIR ?= $(PLATFORM_DIR)/constant_files -export STAGING_DIR ?= $(PLATFORM_DIR)/staging_files -export INSTALL_DIR ?= $(PLATFORM_DIR)/install_files +export CONSTANT_DIR ?= $(PLATFORM_DIR)/constant + +export STAGING_DIR ?= $(PLATFORM_DIR)/output/staging +export INSTALL_DIR ?= $(PLATFORM_DIR)/output/install export COMMON_INCLUDE := $(COMMON_DIR)/include export STAGING_INCLUDE := $(STAGING_DIR)/include export STAGING_LIB := $(STAGING_DIR)/lib +export INSTALL_LIB := $(INSTALL_DIR)/lib export CONSTANT_INCLUDE := $(CONSTANT_DIR)/include export CONSTANT_LIB := $(CONSTANT_DIR)/lib -export BUILD_DIR := $(PLATFORM_DIR)/build_files +export BUILD_DIR := $(PLATFORM_DIR)/output/build COMPILE_FLAGS := -I$(STAGING_INCLUDE) -I$(CONSTANT_INCLUDE) -I$(COMMON_INCLUDE) -LINK_FLAGS := -L$(STAGING_LIB) -L$(CONSTANT_LIB) - -ifeq ($(RELEASE), 1) -COMPILE_FLAGS += -O2 -Os -else -COMPILE_FLAGS += -DDEBUG=1 -O0 -ggdb -ifeq ($(ENABLE_ASAN), 1) -COMPILE_FLAGS += -fsanitize=address -fno-omit-frame-pointer -LINK_FLAGS += -fsanitize=address -static-libasan -endif -endif +LINK_FLAGS := -L$(STAGING_LIB) -L$(INSTALL_LIB) -L$(CONSTANT_LIB) export CFLAGS := $(COMPILE_FLAGS) export CXXFLAGS := $(COMPILE_FLAGS) -- Gitee