mirror of
ssh://git.janware.com/srv/git/janware/proj/jw-pkg
synced 2026-01-15 12:03:31 +01:00
dirs.mk: Introduced ALLOWED_SUBDIR_TARGETS
Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
parent
970d034202
commit
a0798e4edf
1 changed files with 13 additions and 3 deletions
16
make/dirs.mk
16
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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue