xref: /original-bsd/share/mk/bsd.subdir.mk (revision d24b829c)
1#	@(#)bsd.subdir.mk	5.8 (Berkeley) 06/22/90
2
3.MAIN: all
4
5STRIP?=	-s
6
7BINGRP?=	bin
8BINOWN?=	bin
9BINMODE?=	555
10
11_SUBDIRUSE: .USE
12	@for entry in ${SUBDIR}; do \
13		(if test -d ${.CURDIR}/$${entry}.${MACHINE}; then \
14			echo "===> $${entry}.${MACHINE}"; \
15			cd ${.CURDIR}/$${entry}.${MACHINE}; \
16		else \
17			echo "===> $$entry"; \
18			cd ${.CURDIR}/$${entry}; \
19		fi; \
20		${MAKE} ${.TARGET:realinstall=install}) \
21	done
22
23${SUBDIR}::
24	@if test -d ${.TARGET}.${MACHINE}; then \
25		cd ${.CURDIR}/${.TARGET}.${MACHINE}; \
26	else \
27		cd ${.CURDIR}/${.TARGET}; \
28	fi; \
29	${MAKE} all
30
31.if !target(all)
32all: _SUBDIRUSE
33.endif
34
35.if !target(clean)
36clean: _SUBDIRUSE
37.endif
38
39.if !target(cleandir)
40cleandir: _SUBDIRUSE
41.endif
42
43.if !target(depend)
44depend: _SUBDIRUSE
45.endif
46
47.if !target(install)
48.if !target(beforeinstall)
49beforeinstall:
50.endif
51.if !target(afterinstall)
52afterinstall:
53.endif
54install: afterinstall
55afterinstall: realinstall
56realinstall: beforeinstall _SUBDIRUSE
57.endif
58
59.if !target(lint)
60lint: _SUBDIRUSE
61.endif
62
63.if !target(obj)
64obj: _SUBDIRUSE
65.endif
66
67.if !target(tags)
68tags: _SUBDIRUSE
69.endif
70