From 6ddf3471780712135cfb219bb548980e3dd61f25 Mon Sep 17 00:00:00 2001 From: Xiang Xiao Date: Sun, 22 Mar 2020 11:06:37 -0500 Subject: [PATCH] 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 31cf4f257..bd6570729 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 7f30e9e6d..f0cbc2681 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 3ba9113c8..c72f3193b 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)))