1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-06-12 23:10:51 +00:00

Simplify the dependency and recursion setup so it's easier to add new rules

This commit is contained in:
Jonas Fonseca 2006-01-03 18:50:26 +01:00 committed by Jonas Fonseca
parent b5065e7a17
commit 8c7a1dfecc

View File

@ -125,6 +125,9 @@ CLEAN += $(PROG)
all-default: $(LIB_O) $(PROGS) $(MAN1) $(MAN5)
# Ensure that Makefiles in subdirs are created before we recursive into them
init-recursive: init-default
init-default:
@$(foreach subdir,$(sort $(SUBDIRS)), \
$(MKINSTALLDIRS) $(subdir) >/dev/null; \
@ -191,28 +194,24 @@ endif
# Recursion:
.PHONY: all-recursive install-recursive clean-recursive cleanall-recursive init-recursive check-recursive test-recursive
RULES = all install clean cleanall init check test
RECRULES = $(addsuffix -recursive,$(RULES))
all-recursive install-recursive clean-recursive cleanall-recursive init-recursive check-recursive test-recursive:
.PHONY: $(RECRULES)
# The -recursive rules decend all subdirs.
$(RECRULES):
ifdef SUBDIRS
@$(foreach subdir,$(sort $(SUBDIRS)), \
$(call ncmd,recmake,$(subdir),$(subst -recursive,,$@)) || exit 1;)
endif
all: all-recursive all-default all-local
install: install-recursive install-default install-local
check: check-recursive check-default check-local
clean: clean-recursive clean-default clean-local
test: test-recursive test-default test-local
# Setup the default sub commands dependency. First decend subdirs then do all
# the default stuff and finally do any local hooks.
$(RULES): $$@-recursive $$@-default $$@-local
cleanall: cleanall-recursive cleanall-default
init: init-default init-recursive
all-local:
install-local:
clean-local:
check-local:
test-local:
# Dummy rules for local hooks
$(addsuffix -local,$(RULES)):
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.