You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by gn...@apache.org on 2020/03/22 16:06:45 UTC

[incubator-nuttx-apps] branch master updated: Move MAKE_template and SDIR_template to Make.defs (#135)

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

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


The following commit(s) were added to refs/heads/master by this push:
     new 6ddf347  Move MAKE_template and SDIR_template to Make.defs (#135)
6ddf347 is described below

commit 6ddf3471780712135cfb219bb548980e3dd61f25
Author: Xiang Xiao <xi...@xiaomi.com>
AuthorDate: Sun Mar 22 11:06:37 2020 -0500

    Move MAKE_template and SDIR_template to Make.defs (#135)
    
    So Directory.mk and Makefile can share the same definition
---
 Directory.mk |  5 -----
 Make.defs    | 13 +++++++++++++
 Makefile     | 11 -----------
 3 files changed, 13 insertions(+), 16 deletions(-)

diff --git a/Directory.mk b/Directory.mk
index 31cf4f2..bd65707 100644
--- a/Directory.mk
+++ b/Directory.mk
@@ -44,11 +44,6 @@ all: nothing
 
 .PHONY: nothing context depend clean distclean
 
-define SDIR_template
-$(1)_$(2):
-	+$(Q) $(MAKE) -C $(1) $(2) TOPDIR="$(TOPDIR)" APPDIR="$(APPDIR)" BINDIR="$(BINDIR)"
-endef
-
 $(foreach SDIR, $(SUBDIRS), $(eval $(call SDIR_template,$(SDIR),preconfig)))
 $(foreach SDIR, $(SUBDIRS), $(eval $(call SDIR_template,$(SDIR),context)))
 $(foreach SDIR, $(SUBDIRS), $(eval $(call SDIR_template,$(SDIR),depend)))
diff --git a/Make.defs b/Make.defs
index 7f30e9e..f0cbc26 100644
--- a/Make.defs
+++ b/Make.defs
@@ -73,6 +73,19 @@ BINDIR ?= $(APPDIR)$(DELIM)bin
 
 BIN ?= $(APPDIR)$(DELIM)libapps$(LIBEXT)
 
+# Invoke make
+
+define MAKE_template
+	+$(Q) $(MAKE) -C $(1) $(2) TOPDIR="$(TOPDIR)" APPDIR="$(APPDIR)"
+
+endef
+
+define SDIR_template
+$(1)_$(2):
+	+$(Q) $(MAKE) -C $(1) $(2) TOPDIR="$(TOPDIR)" APPDIR="$(APPDIR)"
+
+endef
+
 # Builtin Registration
 
 BUILTIN_REGISTRY = $(APPDIR)$(DELIM)builtin$(DELIM)registry
diff --git a/Makefile b/Makefile
index 3ba9113..c72f319 100644
--- a/Makefile
+++ b/Makefile
@@ -61,17 +61,6 @@ all: $(BIN)
 .PHONY: import install dirlinks context context_serialize clean_context context_rest export .depdirs preconfig depend clean distclean
 .PRECIOUS: $(BIN)
 
-define MAKE_template
-	+$(Q) $(MAKE) -C $(1) $(2) TOPDIR="$(TOPDIR)" APPDIR="$(APPDIR)"
-
-endef
-
-define SDIR_template
-$(1)_$(2):
-	+$(Q) $(MAKE) -C $(1) $(2) TOPDIR="$(TOPDIR)" APPDIR="$(APPDIR)"
-
-endef
-
 $(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),context)))