mirror of
ssh://git.janware.com/srv/git/janware/proj/jw-pkg
synced 2026-01-24 22:50:39 +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),)
|
ifeq ($(SUBDIRS_TO_ITERATE),)
|
||||||
|
|
||||||
all:
|
all install clean distclean:
|
||||||
subdirs:
|
|
||||||
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:
|
.DEFAULT:
|
||||||
install:
|
install:
|
||||||
|
|
||||||
else
|
|
||||||
.PHONY: $(SUBDIRS_TO_ITERATE)
|
.PHONY: $(SUBDIRS_TO_ITERATE)
|
||||||
|
|
||||||
ifeq ($(MAKECMDGOALS),)
|
#ifeq ($(MAKECMDGOALS),)
|
||||||
all:
|
#all:
|
||||||
$(make_subdirs)
|
# $(make_subdirs)
|
||||||
endif
|
# touch dirs.done
|
||||||
|
#
|
||||||
|
#$(MAKECMDGOALS):
|
||||||
|
# $(make_subdirs_target)
|
||||||
|
# touch dirs.done
|
||||||
|
|
||||||
$(MAKECMDGOALS):
|
|
||||||
$(make_subdirs_target)
|
|
||||||
|
|
||||||
clean: dirs.clean
|
define make_dirs
|
||||||
distclean: dirs.distclean clean
|
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:
|
dirs.clean:
|
||||||
|
$(make_dirs)
|
||||||
rm -rf $(TEXTCLEAN) $(CLEAN) dist *.done *~ .*.swp *.tmp core *.rep
|
rm -rf $(TEXTCLEAN) $(CLEAN) dist *.done *~ .*.swp *.tmp core *.rep
|
||||||
|
|
||||||
dirs.distclean:
|
dirs.distclean:
|
||||||
|
$(make_dirs)
|
||||||
rm -rf $(DISTCLEAN)
|
rm -rf $(DISTCLEAN)
|
||||||
|
|
||||||
.DEFAULT:
|
.DEFAULT:
|
||||||
$(make_subdirs_target)
|
$(make_dirs)
|
||||||
endif
|
|
||||||
|
endif # SUBDIRS_TO_ITERATE
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue