jw-pkg/make/dirs.mk
Jan Lindemann 78bd6215b4 $(TOPDIR), make, scripts: Merged changes from V_1_2_3_33_YAPPLICATION_INIFILE_CTOR
Signed-off-by: Jan Lindemann <jan@jannet.de>
2012-09-02 16:06:47 +00:00

80 lines
1.7 KiB
Makefile

# generic utility modules
# (c) 2001 jannet it services
# contact@jannet.de
# $Id$
.NOTPARALLEL:
.PHONY: $(SUBDIRS_TO_ITERATE) all install clean distclean test
ifneq ($(FORCE_REBUILD_SUBDIRS),)
.PHONY: dirs-all.done
endif
include $(MODDIR)/make/defs.mk
SUBDIRS ?= $(FIND_SUBDIRS)
ifeq ($(SUBDIRS_TO_ITERATE),)
all install clean distclean:
else
ifeq ($(MAKECMDGOALS),)
SUBDIR_TARGETS = all
else
SUBDIR_TARGETS = $(filter all install clean distclean,$(MAKECMDGOALS))
endif
ifneq ($(DONT_CHECK_PREREQ_DONE),true)
PREREQ_DIRS_DONE = $(addsuffix /dirs-all.done,$(filter-out $(TOPDIR) /opt/%,$(foreach p,$(PREREQ),$($(p)_DIR))))
endif
all: dirs-all.done
install: dirs-install.done
clean: dirs.clean
distclean: dirs.clean dirs.distclean
%/dirs-all.done:
@echo $@ needs to be rebuilt
exit 1
# 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
ifneq ($(DONT_CHECK_PREREQ_DONE),true)
touch $@
endif
dirs-%.done:
set -e; for d in $(SUBDIRS) ; do make -wC $$d $*; done
ifneq ($(DONT_CHECK_PREREQ_DONE),true)
touch $@
endif
ifeq ($(DEVELOPMENT),true)
dirs-all.done: $(wildcard $(BUILD_HDRDIR))
ifeq ($(SUBDIR_TARGETS),all)
dirs-all.done: $(PREREQ_DIRS_DONE)
endif
ifeq ($(SUBDIR_TARGETS),install)
dirs-all.done: $(PREREQ_DIRS_DONE)
endif
dirs-install.done: dirs-all.done
endif
dirs.clean:
set -e; for d in $(SUBDIRS) ; do make -wC $$d clean; done
rm -rf $(TEXTCLEAN) $(CLEAN) dist *.done *~ .*.swp *.tmp core *.rep
dirs.distclean:
set -e; for d in $(SUBDIRS) ; do make -wC $$d distclean; done
rm -rf $(DISTCLEAN)
.DEFAULT:
$(make_dirs)
endif # SUBDIRS_TO_ITERATE