Use constants rather than string comparison for a saner API.
[dhcpcd-ui] / mk / subdir.mk
1 # Recursive rules
2 # Adapted from FreeBSDs bsd.subdir.mk
3 # Copyright 2007-2008 Roy Marples <roy@marples.name>
4 # All rights reserved. Released under the 2-clause BSD license.
5
6 _+_ ?= +
7 ECHODIR ?= echo 
8 _SUBDIR = @${_+_}for x in ${SUBDIR}; do \
9         if test -d $$x; then \
10         ${ECHODIR} "===> ${DIRPRFX}$$x (${@:realinstall=install})"; \
11                 cd $$x; \
12                 ${MAKE} ${@:realinstall=install} \
13                 DIRPRFX=${DIRPRFX}$$x/ || exit $$?; \
14                 cd ..; \
15         fi; \
16 done
17
18 all:
19         ${_SUBDIR}
20 clean:
21         @if test -n "${CLEANFILES}"; then echo "rm -f ${CLEANFILES}"; rm -f ${CLEANFILES}; fi
22         ${_SUBDIR}
23 realinstall:
24         ${_SUBDIR}
25 proginstall:
26         ${_SUBDIR}
27 install: realinstall ${INSTALLAFTER}
28 check test::
29         ${_SUBDIR}
30 depend:
31         ${_SUBDIR}
32 ignore:
33         ${_SUBDIR}