1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-12-04 14:46:47 -05: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) 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: init-default:
@$(foreach subdir,$(sort $(SUBDIRS)), \ @$(foreach subdir,$(sort $(SUBDIRS)), \
$(MKINSTALLDIRS) $(subdir) >/dev/null; \ $(MKINSTALLDIRS) $(subdir) >/dev/null; \
@ -191,28 +194,24 @@ endif
# Recursion: # 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 ifdef SUBDIRS
@$(foreach subdir,$(sort $(SUBDIRS)), \ @$(foreach subdir,$(sort $(SUBDIRS)), \
$(call ncmd,recmake,$(subdir),$(subst -recursive,,$@)) || exit 1;) $(call ncmd,recmake,$(subdir),$(subst -recursive,,$@)) || exit 1;)
endif endif
all: all-recursive all-default all-local # Setup the default sub commands dependency. First decend subdirs then do all
install: install-recursive install-default install-local # the default stuff and finally do any local hooks.
check: check-recursive check-default check-local $(RULES): $$@-recursive $$@-default $$@-local
clean: clean-recursive clean-default clean-local
test: test-recursive test-default test-local
cleanall: cleanall-recursive cleanall-default # Dummy rules for local hooks
init: init-default init-recursive $(addsuffix -local,$(RULES)):
all-local:
install-local:
clean-local:
check-local:
test-local:
# Tell versions [3.59,3.63) of GNU make to not export all variables. # 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. # Otherwise a system limit (for SysV at least) may be exceeded.