This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx-apps.git

commit 293c05b5e6134fe878804fe5846d656df126257e
Author: anjiahao <anjia...@xiaomi.com>
AuthorDate: Fri Mar 22 16:00:19 2024 +0800

    apps/Makefile:Add a postinstall keyword to do something before compilation 
is completed and linking begin
    
    It is better to package the dynamic module into romfs after it is compiled.
    
    Signed-off-by: anjiahao <anjia...@xiaomi.com>
---
 Application.mk | 4 +++-
 Makefile       | 6 +++++-
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/Application.mk b/Application.mk
index bf86e2769..69f042a2f 100644
--- a/Application.mk
+++ b/Application.mk
@@ -347,9 +347,11 @@ install::
 
 endif # BUILD_MODULE
 
-context::
+postinstall::
        @:
 
+context::
+
 ifeq ($(DO_REGISTRATION),y)
 
 $(REGLIST): $(DEPCONFIG) Makefile
diff --git a/Makefile b/Makefile
index fe39dfe94..c5910c6d2 100644
--- a/Makefile
+++ b/Makefile
@@ -46,11 +46,12 @@ SYMTABOBJ = $(SYMTABSRC:.c=$(OBJEXT))
 all: $(BIN)
 
 .PHONY: import install dirlinks export .depdirs preconfig depend clean 
distclean
-.PHONY: context clean_context context_all register register_all
+.PHONY: context postinstall clean_context context_all postinstall_all register 
register_all
 .PRECIOUS: $(BIN)
 
 $(foreach SDIR, $(CONFIGURED_APPS), $(eval $(call SDIR_template,$(SDIR),all)))
 $(foreach SDIR, $(CONFIGURED_APPS), $(eval $(call 
SDIR_template,$(SDIR),install)))
+$(foreach SDIR, $(CONFIGURED_APPS), $(eval $(call 
SDIR_template,$(SDIR),postinstall)))
 $(foreach SDIR, $(CONFIGURED_APPS), $(eval $(call 
SDIR_template,$(SDIR),context)))
 $(foreach SDIR, $(CONFIGURED_APPS), $(eval $(call 
SDIR_template,$(SDIR),register)))
 $(foreach SDIR, $(CONFIGURED_APPS), $(eval $(call 
SDIR_template,$(SDIR),depend)))
@@ -96,6 +97,7 @@ $(BIN): $(foreach SDIR, $(CONFIGURED_APPS), $(SDIR)_all)
 .import: $(BIN)
        $(Q) install libapps.a $(APPDIR)$(DELIM)import$(DELIM)libs
        $(Q) $(MAKE) install
+       $(Q) $(MAKE) postinstall
 
 import: $(IMPORT_TOOLS)
        $(Q) $(MAKE) context TOPDIR="$(APPDIR)$(DELIM)import"
@@ -138,6 +140,7 @@ $(BIN): $(SYMTABOBJ)
 endif # !CONFIG_MODULES
 
 install: $(foreach SDIR, $(CONFIGURED_APPS), $(SDIR)_install)
+       $(Q) $(MAKE) postinstall_all
 
 # Link nuttx
 
@@ -173,6 +176,7 @@ dirlinks:
 
 context_all: $(foreach SDIR, $(CONFIGURED_APPS), $(SDIR)_context)
 register_all: $(foreach SDIR, $(CONFIGURED_APPS), $(SDIR)_register)
+postinstall_all: $(foreach SDIR, $(CONFIGURED_APPS), $(SDIR)_postinstall)
 
 staging:
        $(Q) mkdir -p $@

Reply via email to