From 36cef7e23fcd4c37b768eb121a8f226e1f88f109 Mon Sep 17 00:00:00 2001 From: ypc <15051963820@163.com> Date: Wed, 8 Jul 2026 13:36:48 +0800 Subject: [PATCH] =?UTF-8?q?fix(build):=20=E4=BF=AE=E5=A4=8D=20makefile=20d?= =?UTF-8?q?efine=20=E4=B8=AD=20@for=20=E8=AF=AD=E6=B3=95=20+=20=E6=B3=A8?= =?UTF-8?q?=E5=86=8C=20libcomm?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - release/makefile, release/src/makefile, release/src/public/makefile: 将 define 内的 @for 移除 @ 前缀,避免 /bin/sh 语法错误 - release/src/public/makefile: SUBDIRS 添加 ./libcomm - release/copy_headers.sh: 添加 myComm.h 复制 --- release/copy_headers.sh | 1 + release/makefile | 4 ++-- release/src/makefile | 6 +++--- release/src/public/makefile | 8 ++++---- 4 files changed, 10 insertions(+), 9 deletions(-) diff --git a/release/copy_headers.sh b/release/copy_headers.sh index 3f754ce..ce281f3 100755 --- a/release/copy_headers.sh +++ b/release/copy_headers.sh @@ -47,5 +47,6 @@ copy_module "libxml" "myXml.h" copy_module "libxml" "tinyxml2.h" copy_module "libcmd" "myCmd.h" copy_module "libdatacenter" "myDatacenter.h" +copy_module "libcomm" "myComm.h" echo "=== done ===" diff --git a/release/makefile b/release/makefile index 896dd86..0466925 100644 --- a/release/makefile +++ b/release/makefile @@ -1,8 +1,8 @@ SUBDIRS := ./src define make_subdir - @for d in $(SUBDIRS); do [ -f "$$d/makefile" ] && (cd "$$d" && make -f makefile $1) || true; done + for d in $(SUBDIRS); do [ -f "$$d/makefile" ] && (cd "$$d" && make -f makefile $1) || true; done endef .PHONY: all clean rebuild -all:; $(call make_subdir,all) +all:; @$(call make_subdir,all) clean:; @echo "clean..."; $(call make_subdir,clean) rebuild: clean all diff --git a/release/src/makefile b/release/src/makefile index f82f724..b981499 100644 --- a/release/src/makefile +++ b/release/src/makefile @@ -1,8 +1,8 @@ SUBDIRS := ./public define make_subdir - @for d in $(SUBDIRS); do [ -f "$$d/makefile" ] && (cd "$$d" && make -f makefile $1) || true; done + for d in $(SUBDIRS); do [ -f "$$d/makefile" ] && (cd "$$d" && make -f makefile $1) || true; done endef .PHONY: all clean rebuild -all:; $(call make_subdir,all) -clean:; $(call make_subdir,clean) +all:; @$(call make_subdir,all) +clean:; @$(call make_subdir,clean) rebuild: clean all diff --git a/release/src/public/makefile b/release/src/public/makefile index e9825e3..cbf5aef 100644 --- a/release/src/public/makefile +++ b/release/src/public/makefile @@ -1,10 +1,10 @@ -SUBDIRS := ./liblist ./libfunc ./liblog ./libmd5 ./libcJSON ./libmy_xxhash ./libtask ./libxml ./libcmd ./libdatacenter +SUBDIRS := ./liblist ./libfunc ./liblog ./libmd5 ./libcJSON ./libmy_xxhash ./libtask ./libxml ./libcmd ./libdatacenter ./libcomm define make_subdir - @for d in $(SUBDIRS); do [ -f "$$d/makefile" ] && (cd "$$d" && make -f makefile $1) || true; done + for d in $(SUBDIRS); do [ -f "$$d/makefile" ] && (cd "$$d" && make -f makefile $1) || true; done endef ROOT_DIR := $(realpath $(CURDIR)/../../..) .PHONY: all clean rebuild headers headers:; @cd $(ROOT_DIR) && ./release/copy_headers.sh -all: headers; $(call make_subdir,all) -clean:; $(call make_subdir,clean) +all: headers; @$(call make_subdir,all) +clean:; @$(call make_subdir,clean) rebuild: clean all