From a0798e4edf8f1dea942c8b2a4818f9f9b742700d Mon Sep 17 00:00:00 2001 From: Jan Lindemann Date: Thu, 1 Aug 2013 13:26:05 +0000 Subject: [PATCH] dirs.mk: Introduced ALLOWED_SUBDIR_TARGETS Signed-off-by: Jan Lindemann --- make/dirs.mk | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/make/dirs.mk b/make/dirs.mk index a6a6d3d4..f04043c8 100644 --- a/make/dirs.mk +++ b/make/dirs.mk @@ -3,8 +3,10 @@ # contact@jannet.de # $Id$ +ALLOWED_SUBDIR_TARGETS ?= all install clean distclean test + .NOTPARALLEL: -.PHONY: $(SUBDIRS_TO_ITERATE) all install clean distclean test +.PHONY: $(SUBDIRS_TO_ITERATE) $(ALLOWED_SUBDIR_TARGETS) ifneq ($(FORCE_REBUILD_SUBDIRS),) .PHONY: dirs-all.done @@ -16,14 +18,14 @@ SUBDIRS ?= $(FIND_SUBDIRS) ifeq ($(SUBDIRS_TO_ITERATE),) -all install clean distclean: +$(ALLOWED_SUBDIR_TARGETS): else ifeq ($(MAKECMDGOALS),) SUBDIR_TARGETS = all else -SUBDIR_TARGETS = $(filter all install clean distclean,$(MAKECMDGOALS)) +SUBDIR_TARGETS = $(filter $(ALLOWED_SUBDIR_TARGETS),$(MAKECMDGOALS)) endif ifneq ($(DONT_CHECK_PREREQ_DONE),true) @@ -35,6 +37,14 @@ install: dirs-install.done clean: dirs.clean distclean: dirs.clean dirs.distclean +define subdir_rule + +$(1): dirs-$(1).done + +endef + +$(foreach t,$(filter-out all install clean distclean,$(ALLOWED_SUBDIR_TARGETS)),$(eval $(call subdir_rule,$(t)))) + %/dirs-all.done: @echo $@ needs to be rebuilt exit 1