diff options
Diffstat (limited to 'subdir.mk')
-rw-r--r-- | subdir.mk | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/subdir.mk b/subdir.mk new file mode 100644 index 00000000..03bec8c3 --- /dev/null +++ b/subdir.mk @@ -0,0 +1,25 @@ +# Recursive rules +# Adapted from FreeBSDs bsd.subdir.mk +_+_ ?= + +ECHODIR ?= true +_SUBDIR = @${_+_}for x in ${SUBDIR}; do \ + if test -d $$x; then \ + ${ECHODIR} "===> ${DIRPRFX}$$x ($@)"; \ + cd $$x; \ + ${MAKE} $@ DIRPRFX=${DIRPRFX}$$x/ || exit $$?; \ + cd ..; \ + fi; \ + if test -d $$x.${OS}; then \ + ${ECHODIR} "===> ${DIRPRFX}$$x.${OS} ($@)"; \ + cd $$x.${OS}; \ + ${MAKE} $@ DIRPRFX=${DIRPRFX}$$x/ || exit $$?; \ + cd ..; \ + fi; \ +done + +all: + $(_SUBDIR) +clean: + $(_SUBDIR) +install: + $(_SUBDIR) |