Skip to content

Commit 8862aef

Browse files
Move MAKE_template and SDIR_template to Make.defs
so Directory.mk and Makefile can share the same definition Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
1 parent d614ee8 commit 8862aef

File tree

3 files changed

+13
-16
lines changed

3 files changed

+13
-16
lines changed

Directory.mk

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,6 @@ all: nothing
4444

4545
.PHONY: nothing context depend clean distclean
4646

47-
define SDIR_template
48-
$(1)_$(2):
49-
+$(Q) $(MAKE) -C $(1) $(2) TOPDIR="$(TOPDIR)" APPDIR="$(APPDIR)" BINDIR="$(BINDIR)"
50-
endef
51-
5247
$(foreach SDIR, $(SUBDIRS), $(eval $(call SDIR_template,$(SDIR),preconfig)))
5348
$(foreach SDIR, $(SUBDIRS), $(eval $(call SDIR_template,$(SDIR),context)))
5449
$(foreach SDIR, $(SUBDIRS), $(eval $(call SDIR_template,$(SDIR),depend)))

Make.defs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,19 @@ BINDIR ?= $(APPDIR)$(DELIM)bin
7373

7474
BIN ?= $(APPDIR)$(DELIM)libapps$(LIBEXT)
7575

76+
# Invoke make
77+
78+
define MAKE_template
79+
+$(Q) $(MAKE) -C $(1) $(2) TOPDIR="$(TOPDIR)" APPDIR="$(APPDIR)"
80+
81+
endef
82+
83+
define SDIR_template
84+
$(1)_$(2):
85+
+$(Q) $(MAKE) -C $(1) $(2) TOPDIR="$(TOPDIR)" APPDIR="$(APPDIR)"
86+
87+
endef
88+
7689
# Builtin Registration
7790

7891
BUILTIN_REGISTRY = $(APPDIR)$(DELIM)builtin$(DELIM)registry

Makefile

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -61,17 +61,6 @@ all: $(BIN)
6161
.PHONY: import install dirlinks context context_serialize clean_context context_rest export .depdirs preconfig depend clean distclean
6262
.PRECIOUS: $(BIN)
6363

64-
define MAKE_template
65-
+$(Q) $(MAKE) -C $(1) $(2) TOPDIR="$(TOPDIR)" APPDIR="$(APPDIR)"
66-
67-
endef
68-
69-
define SDIR_template
70-
$(1)_$(2):
71-
+$(Q) $(MAKE) -C $(1) $(2) TOPDIR="$(TOPDIR)" APPDIR="$(APPDIR)"
72-
73-
endef
74-
7564
$(foreach SDIR, $(CONFIGURED_APPS), $(eval $(call SDIR_template,$(SDIR),all)))
7665
$(foreach SDIR, $(CONFIGURED_APPS), $(eval $(call SDIR_template,$(SDIR),install)))
7766
$(foreach SDIR, $(CONFIGURED_APPS), $(eval $(call SDIR_template,$(SDIR),context)))

0 commit comments

Comments
 (0)