diff options
author | Girts Folkmanis <girtsf@users.noreply.github.com> | 2016-09-14 18:06:47 -0700 |
---|---|---|
committer | Travis Geiselbrecht <geist@foobox.com> | 2016-09-30 10:41:23 -0700 |
commit | 9a2fcf2b608dc704daa2101a390aae8c6340c0e6 (patch) | |
tree | 219c350e700d43b3a5a289e977a1ab42e832eca4 | |
parent | 6782ea9af6ff1d5bb91b5879b44c7118fe792b30 (diff) | |
download | common-9a2fcf2b608dc704daa2101a390aae8c6340c0e6.tar.gz |
[make] don't call build engine multiple times.
If some included rule.mk defines an additional make target that the user
might want to call (e.g., "flash"), and user specifies a project name on
the command line, then previously the outer "makefile" would call
engine.mk multiple times. The new logic prevents that.
Additionally, silence extra "Nothing to be done" messages when calling
engine.mk again after removing the project name from make goals.
-rw-r--r-- | engine.mk | 1 | ||||
-rw-r--r-- | makefile | 11 |
2 files changed, 10 insertions, 2 deletions
@@ -24,6 +24,7 @@ ifneq ($(project-name),) ifneq ($(strip $(foreach d,$(LKINC),$(wildcard $(d)/project/$(project-name).mk))),) do-nothing := 1 $(MAKECMDGOALS) _all: make-make + @: make-make: @PROJECT=$(project-name) $(MAKE) -rR -f $(LOCAL_MAKEFILE) $(filter-out $(project-name), $(MAKECMDGOALS)) @@ -28,9 +28,16 @@ export BUILDROOT export DEFAULT_PROJECT export TOOLCHAIN_PREFIX -# vaneer makefile that calls into the engine with lk as the build root +# veneer makefile that calls into the engine with lk as the build root # if we're the top level invocation, call ourselves with additional args -$(MAKECMDGOALS) _top: +_top: @$(MAKE) -C $(LKMAKEROOT) -rR -f $(LKROOT)/engine.mk $(addprefix -I,$(LKINC)) $(MAKECMDGOALS) +# If any arguments were provided, create a recipe for them that depends +# on the _top rule (thus calling it), but otherwise do nothing. +# "@:" (vs empty rule ";") prevents extra "'foo' is up to date." messages from +# being emitted. +$(MAKECMDGOALS): _top + @: + .PHONY: _top |