Move MAKE_template and SDIR_template to Make.defs (#135)

So Directory.mk and Makefile can share the same definition
This commit is contained in:
Xiang Xiao 2020-03-22 11:06:37 -05:00 committed by GitHub
parent 6e3a9a2eda
commit 6ddf347178
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 16 deletions

View File

@ -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)))

View File

@ -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

View File

@ -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)))