You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by ar...@apache.org on 2023/10/27 03:52:35 UTC
[nuttx-apps] 01/02: archive:create a copy rule for the ojbs with the same name
This is an automated email from the ASF dual-hosted git repository.
archer pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx-apps.git
commit efa1f519154e5d66bd5e069d06f9bf9c76eea7f1
Author: xuxin19 <xu...@xiaomi.com>
AuthorDate: Wed Oct 11 12:15:21 2023 +0800
archive:create a copy rule for the ojbs with the same name
when there are too many target files in archive and need to be processed in batches,
in order to avoid file replacement due to duplicate names,
we dynamically rename the target files here.
Signed-off-by: xuxin19 <xu...@xiaomi.com>
---
Application.mk | 16 ++++++++++++++--
Make.defs | 5 +++++
2 files changed, 19 insertions(+), 2 deletions(-)
diff --git a/Application.mk b/Application.mk
index 269ceaa6b..4d6fd5682 100644
--- a/Application.mk
+++ b/Application.mk
@@ -205,8 +205,20 @@ $(ZIGOBJS): %$(ZIGEXT)$(SUFFIX)$(OBJEXT): %$(ZIGEXT)
$(if $(and $(CONFIG_BUILD_LOADABLE), $(CELFFLAGS)), \
$(call ELFCOMPILEZIG, $<, $@), $(call COMPILEZIG, $<, $@))
-.built: $(OBJS)
- $(call SPLITVARIABLE,ALL_OBJS,$(OBJS),100)
+AROBJS :=
+ifneq ($(OBJS),)
+$(eval $(call SPLITVARIABLE,OBJS_SPILT,$(OBJS),100))
+$(foreach BATCH, $(OBJS_SPILT_TOTAL), \
+ $(foreach obj, $(OBJS_SPILT_$(BATCH)), \
+ $(eval substitute := $(patsubst %$(OBJEXT),%_$(BATCH)$(OBJEXT),$(obj))) \
+ $(eval AROBJS += $(substitute)) \
+ $(eval $(call AROBJSRULES, $(substitute),$(obj))) \
+ ) \
+)
+endif
+
+.built: $(AROBJS)
+ $(call SPLITVARIABLE,ALL_OBJS,$(AROBJS),100)
$(foreach BATCH, $(ALL_OBJS_TOTAL), \
$(shell $(call ARLOCK, $(call CONVERT_PATH,$(BIN)), $(ALL_OBJS_$(BATCH)))) \
)
diff --git a/Make.defs b/Make.defs
index 6f3807def..91842102e 100644
--- a/Make.defs
+++ b/Make.defs
@@ -156,3 +156,8 @@ endef
define ARLOCK
flock $1.lock $(call ARCHIVE, $1, $(2))
endef
+
+define AROBJSRULES
+$(1) : $(2)
+ cp $(2) $(1)
+endef
\ No newline at end of file