mirror of
ssh://git.janware.com/srv/git/janware/proj/jw-pkg
synced 2026-01-15 12:03:31 +01:00
dirs.mk: Now shortcutting already built directories (dirs.done)
This commit is contained in:
parent
e9a20dd905
commit
c7ad273556
1 changed files with 41 additions and 14 deletions
55
make/dirs.mk
55
make/dirs.mk
|
|
@ -11,32 +11,59 @@ SUBDIRS ?= $(FIND_SUBDIRS)
|
|||
|
||||
ifeq ($(SUBDIRS_TO_ITERATE),)
|
||||
|
||||
all:
|
||||
subdirs:
|
||||
clean distclean:
|
||||
all install clean distclean:
|
||||
|
||||
else
|
||||
|
||||
ifeq ($(MAKECMDGOALS),)
|
||||
SUBDIR_TARGETS = all
|
||||
else
|
||||
SUBDIR_TARGETS = $(filter all install clean distclean,$(MAKECMDGOALS))
|
||||
endif
|
||||
|
||||
all: dirs.done
|
||||
subdirs: dirs.done
|
||||
clean: dirs.clean
|
||||
distclean: dirs.clean dirs.distclean
|
||||
|
||||
.DEFAULT:
|
||||
install:
|
||||
|
||||
else
|
||||
.PHONY: $(SUBDIRS_TO_ITERATE)
|
||||
|
||||
ifeq ($(MAKECMDGOALS),)
|
||||
all:
|
||||
$(make_subdirs)
|
||||
endif
|
||||
#ifeq ($(MAKECMDGOALS),)
|
||||
#all:
|
||||
# $(make_subdirs)
|
||||
# touch dirs.done
|
||||
#
|
||||
#$(MAKECMDGOALS):
|
||||
# $(make_subdirs_target)
|
||||
# touch dirs.done
|
||||
|
||||
$(MAKECMDGOALS):
|
||||
$(make_subdirs_target)
|
||||
|
||||
clean: dirs.clean
|
||||
distclean: dirs.distclean clean
|
||||
define make_dirs
|
||||
set -e; for t in $(SUBDIR_TARGETS); do \
|
||||
for d in $(SUBDIRS) ; do \
|
||||
make -wC $$d $$t ;\
|
||||
done ;\
|
||||
done
|
||||
endef
|
||||
|
||||
PREREQ_DIRS_DONE = $(foreach p,$(PREREQ),$($(p)_DIR)/dirs.done)
|
||||
|
||||
dirs.done: $(wildcard $(BUILD_HDRDIR)) $(PREREQ_DIRS_DONE)
|
||||
$(make_dirs)
|
||||
touch $@
|
||||
|
||||
dirs.clean:
|
||||
$(make_dirs)
|
||||
rm -rf $(TEXTCLEAN) $(CLEAN) dist *.done *~ .*.swp *.tmp core *.rep
|
||||
|
||||
dirs.distclean:
|
||||
$(make_dirs)
|
||||
rm -rf $(DISTCLEAN)
|
||||
|
||||
.DEFAULT:
|
||||
$(make_subdirs_target)
|
||||
endif
|
||||
$(make_dirs)
|
||||
|
||||
endif # SUBDIRS_TO_ITERATE
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue