xref: /netbsd-src/share/mk/bsd.subdir.mk (revision 5f7096188587a2c7c95fa3c69b78e1ec9c7923d0)
1#	from: @(#)bsd.subdir.mk	5.9 (Berkeley) 2/1/91
2#	$Id: bsd.subdir.mk,v 1.4 1993/08/17 17:00:40 mycroft Exp $
3
4.if !target(.MAIN)
5.MAIN: all
6.endif
7
8_SUBDIRUSE: .USE
9.if defined(SUBDIR)
10	@for entry in ${SUBDIR}; do \
11		(if test -d ${.CURDIR}/$${entry}.${MACHINE}; then \
12			echo "===> $${entry}.${MACHINE}"; \
13			cd ${.CURDIR}/$${entry}.${MACHINE}; \
14		else \
15			echo "===> $$entry"; \
16			cd ${.CURDIR}/$${entry}; \
17		fi; \
18		${MAKE} ${.TARGET:S/realinstall/install/:S/.depend/depend/}); \
19	done
20
21${SUBDIR}::
22	@if test -d ${.TARGET}.${MACHINE}; then \
23		cd ${.CURDIR}/${.TARGET}.${MACHINE}; \
24	else \
25		cd ${.CURDIR}/${.TARGET}; \
26	fi; \
27	${MAKE} all
28.endif
29
30.if !target(install)
31.if !target(beforeinstall)
32beforeinstall:
33.endif
34.if !target(afterinstall)
35afterinstall:
36.endif
37install: maninstall _SUBDIRUSE
38maninstall: afterinstall
39afterinstall: realinstall
40realinstall: beforeinstall
41.endif
42
43all clean cleandir depend lint obj tags: _SUBDIRUSE
44