2001-07-06 13:12:14 +00:00
|
|
|
# generic utility modules
|
|
|
|
|
# (c) 2001 jannet it services
|
|
|
|
|
# contact@jannet.de
|
|
|
|
|
# $Id$
|
|
|
|
|
|
2009-05-27 11:56:26 +00:00
|
|
|
.NOTPARALLEL:
|
2013-08-01 13:26:05 +00:00
|
|
|
.PHONY: $(SUBDIRS_TO_ITERATE) $(ALLOWED_SUBDIR_TARGETS)
|
2012-01-30 14:59:21 +00:00
|
|
|
|
|
|
|
|
ifneq ($(FORCE_REBUILD_SUBDIRS),)
|
|
|
|
|
.PHONY: dirs-all.done
|
|
|
|
|
endif
|
2009-05-27 11:56:26 +00:00
|
|
|
|
2019-06-29 21:34:18 +00:00
|
|
|
include $(JWBDIR)/make/defs.mk
|
|
|
|
|
include $(JWBDIR)/make/defs-dirs.mk
|
2009-06-02 12:46:17 +00:00
|
|
|
|
2010-12-04 13:59:24 +00:00
|
|
|
ifeq ($(SUBDIRS_TO_ITERATE),)
|
2010-12-02 21:43:03 +00:00
|
|
|
|
2013-08-01 13:26:05 +00:00
|
|
|
$(ALLOWED_SUBDIR_TARGETS):
|
2010-12-02 21:43:03 +00:00
|
|
|
|
2001-10-29 17:10:45 +00:00
|
|
|
else
|
2010-12-02 21:43:03 +00:00
|
|
|
|
2011-06-15 10:12:37 +00:00
|
|
|
all: dirs-all.done
|
|
|
|
|
install: dirs-install.done
|
2010-12-02 21:43:03 +00:00
|
|
|
clean: dirs.clean
|
2011-06-15 08:36:58 +00:00
|
|
|
distclean: dirs.clean dirs.distclean
|
|
|
|
|
|
2016-09-21 14:30:07 +00:00
|
|
|
subdirs-%:
|
|
|
|
|
FORCE_REBUILD_SUBDIRS=true make $*
|
|
|
|
|
|
2017-06-14 18:48:46 +00:00
|
|
|
local-%:
|
|
|
|
|
FORCE_REBUILD_SUBDIRS=true DONT_CHECK_PREREQ_DONE=true make $*
|
|
|
|
|
|
2013-08-01 13:26:05 +00:00
|
|
|
define subdir_rule
|
|
|
|
|
|
|
|
|
|
$(1): dirs-$(1).done
|
|
|
|
|
|
|
|
|
|
endef
|
|
|
|
|
|
|
|
|
|
$(foreach t,$(filter-out all install clean distclean,$(ALLOWED_SUBDIR_TARGETS)),$(eval $(call subdir_rule,$(t))))
|
|
|
|
|
|
2011-06-15 12:39:53 +00:00
|
|
|
%/dirs-all.done:
|
2011-06-20 07:47:23 +00:00
|
|
|
@echo $@ needs to be rebuilt
|
2016-03-30 21:40:47 +00:00
|
|
|
ifneq ($(DONT_CHECK_PREREQ_PROJECTS),true)
|
2011-06-15 12:39:53 +00:00
|
|
|
exit 1
|
2016-03-30 21:40:47 +00:00
|
|
|
endif
|
2011-06-15 12:39:53 +00:00
|
|
|
|
2012-01-30 14:59:21 +00:00
|
|
|
# explicit duplication of pattern-rule is needed, otherwise .PHONY: dirs-all.done won't match
|
|
|
|
|
dirs-all.done:
|
2017-12-17 16:29:44 +00:00
|
|
|
touch started-dirs-all.done
|
2017-12-10 13:58:53 +00:00
|
|
|
set -e; for d in $(SUBDIRS_TO_ITERATE) ; do make -wC $$d $*; done
|
2012-09-02 16:06:47 +00:00
|
|
|
ifneq ($(DONT_CHECK_PREREQ_DONE),true)
|
2012-01-30 14:59:21 +00:00
|
|
|
touch $@
|
2012-09-02 16:06:47 +00:00
|
|
|
endif
|
2012-01-30 14:59:21 +00:00
|
|
|
|
2017-08-31 18:56:20 +00:00
|
|
|
ifeq ($(filter clean distclean,$(MAKECMDGOALS)),)
|
2017-09-19 13:10:01 +00:00
|
|
|
dirs-all.done: $(wildcard $(BUILD_HDRDIR)/*.h) $(wildcard $(BUILD_HDRDIR)/$(HDRDIR_SCOPE_PREFIX)/*.h)
|
2017-08-31 18:56:20 +00:00
|
|
|
endif
|
|
|
|
|
|
2011-06-15 10:12:37 +00:00
|
|
|
dirs-%.done:
|
2017-12-17 16:29:44 +00:00
|
|
|
touch started-dirs-$*.done
|
2017-12-10 13:58:53 +00:00
|
|
|
set -e; for d in $(SUBDIRS_TO_ITERATE) ; do make -wC $$d $*; done
|
2012-09-02 16:06:47 +00:00
|
|
|
ifneq ($(DONT_CHECK_PREREQ_DONE),true)
|
2011-06-15 08:36:58 +00:00
|
|
|
touch $@
|
2012-09-02 16:06:47 +00:00
|
|
|
endif
|
2010-12-02 21:43:03 +00:00
|
|
|
|
2011-06-15 14:55:50 +00:00
|
|
|
ifeq ($(DEVELOPMENT),true)
|
2011-08-09 19:34:12 +00:00
|
|
|
|
2012-09-02 16:06:47 +00:00
|
|
|
ifeq ($(SUBDIR_TARGETS),all)
|
2011-08-09 19:34:12 +00:00
|
|
|
dirs-all.done: $(PREREQ_DIRS_DONE)
|
|
|
|
|
endif
|
2012-09-02 16:06:47 +00:00
|
|
|
ifeq ($(SUBDIR_TARGETS),install)
|
2011-08-09 19:34:12 +00:00
|
|
|
dirs-all.done: $(PREREQ_DIRS_DONE)
|
|
|
|
|
endif
|
|
|
|
|
|
2011-06-15 10:12:37 +00:00
|
|
|
dirs-install.done: dirs-all.done
|
2011-06-15 14:55:50 +00:00
|
|
|
endif
|
2011-06-15 10:12:37 +00:00
|
|
|
|
2010-12-02 21:43:03 +00:00
|
|
|
dirs.clean:
|
2017-12-10 13:58:53 +00:00
|
|
|
set -e; for d in $(call reverse,$(SUBDIRS_TO_ITERATE)) ; do make -wC $$d clean; done
|
2017-09-02 19:26:52 +00:00
|
|
|
$(RM) -rf $(TEXTCLEAN) $(CLEAN) *.done *~ .*.swp *.tmp core *.rep dirs-*.done
|
2001-07-06 13:12:14 +00:00
|
|
|
|
2010-12-02 21:43:03 +00:00
|
|
|
dirs.distclean:
|
2017-12-10 13:58:53 +00:00
|
|
|
set -e; for d in $(call reverse,$(SUBDIRS_TO_ITERATE)) ; do make -wC $$d distclean; done
|
2017-09-02 19:26:52 +00:00
|
|
|
$(RM) -rf $(DISTCLEAN)
|
2002-07-25 10:39:55 +00:00
|
|
|
|
2011-06-15 08:36:58 +00:00
|
|
|
endif # SUBDIRS_TO_ITERATE
|