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:
|
2012-01-30 14:59:21 +00:00
|
|
|
.PHONY: $(SUBDIRS_TO_ITERATE) all install clean distclean test
|
|
|
|
|
|
|
|
|
|
ifneq ($(FORCE_REBUILD_SUBDIRS),)
|
|
|
|
|
.PHONY: dirs-all.done
|
|
|
|
|
endif
|
2009-05-27 11:56:26 +00:00
|
|
|
|
2001-07-27 22:02:40 +00:00
|
|
|
include $(MODDIR)/make/defs.mk
|
2001-07-06 13:12:14 +00:00
|
|
|
|
2009-06-02 12:46:17 +00:00
|
|
|
SUBDIRS ?= $(FIND_SUBDIRS)
|
|
|
|
|
|
2010-12-04 13:59:24 +00:00
|
|
|
ifeq ($(SUBDIRS_TO_ITERATE),)
|
2010-12-02 21:43:03 +00:00
|
|
|
|
2011-06-15 08:36:58 +00:00
|
|
|
all install clean distclean:
|
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-02-20 14:15:22 +00:00
|
|
|
ifeq ($(MAKECMDGOALS),)
|
2011-06-15 08:36:58 +00:00
|
|
|
SUBDIR_TARGETS = all
|
|
|
|
|
else
|
|
|
|
|
SUBDIR_TARGETS = $(filter all install clean distclean,$(MAKECMDGOALS))
|
2011-02-20 14:15:22 +00:00
|
|
|
endif
|
2001-07-06 13:12:14 +00:00
|
|
|
|
2012-09-02 16:06:47 +00:00
|
|
|
ifneq ($(DONT_CHECK_PREREQ_DONE),true)
|
2011-08-21 15:34:16 +00:00
|
|
|
PREREQ_DIRS_DONE = $(addsuffix /dirs-all.done,$(filter-out $(TOPDIR) /opt/%,$(foreach p,$(PREREQ),$($(p)_DIR))))
|
2012-09-02 16:06:47 +00:00
|
|
|
endif
|
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
|
|
|
|
|
|
2011-06-15 12:39:53 +00:00
|
|
|
%/dirs-all.done:
|
2011-06-20 07:47:23 +00:00
|
|
|
@echo $@ needs to be rebuilt
|
2011-06-15 12:39:53 +00:00
|
|
|
exit 1
|
|
|
|
|
|
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:
|
|
|
|
|
set -e; for d in $(SUBDIRS) ; 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
|
|
|
|
2011-06-15 10:12:37 +00:00
|
|
|
dirs-%.done:
|
|
|
|
|
set -e; for d in $(SUBDIRS) ; 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
|
|
|
|
|
|
|
|
dirs-all.done: $(wildcard $(BUILD_HDRDIR))
|
|
|
|
|
|
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:
|
2011-06-20 07:47:23 +00:00
|
|
|
set -e; for d in $(SUBDIRS) ; do make -wC $$d clean; done
|
2009-06-02 12:46:17 +00:00
|
|
|
rm -rf $(TEXTCLEAN) $(CLEAN) dist *.done *~ .*.swp *.tmp core *.rep
|
2001-07-06 13:12:14 +00:00
|
|
|
|
2010-12-02 21:43:03 +00:00
|
|
|
dirs.distclean:
|
2011-06-20 07:47:23 +00:00
|
|
|
set -e; for d in $(SUBDIRS) ; do make -wC $$d distclean; done
|
2002-07-25 10:39:55 +00:00
|
|
|
rm -rf $(DISTCLEAN)
|
|
|
|
|
|
2001-07-06 13:12:14 +00:00
|
|
|
.DEFAULT:
|
2011-06-15 08:36:58 +00:00
|
|
|
$(make_dirs)
|
|
|
|
|
|
|
|
|
|
endif # SUBDIRS_TO_ITERATE
|