bsd.subdir.mk revision 6716
1#	from: @(#)bsd.subdir.mk	5.9 (Berkeley) 2/1/91
2#	$Id: bsd.subdir.mk,v 1.7 1995/01/23 20:50:56 jkh Exp $
3
4.MAIN: all
5
6.if !defined(DEBUG_FLAGS)
7STRIP?=	-s
8.endif
9
10BINGRP?=	bin
11BINOWN?=	bin
12BINMODE?=	555
13
14_SUBDIRUSE: .USE
15	@for entry in ${SUBDIR}; do \
16		(if test -d ${.CURDIR}/$${entry}.${MACHINE}; then \
17			${ECHODIR} "===> ${DIRPRFX}$${entry}.${MACHINE}"; \
18			edir=$${entry}.${MACHINE}; \
19			cd ${.CURDIR}/$${edir}; \
20		else \
21			${ECHODIR} "===> ${DIRPRFX}$$entry"; \
22			edir=$${entry}; \
23			cd ${.CURDIR}/$${edir}; \
24		fi; \
25		${MAKE} ${.TARGET:realinstall=install} DIRPRFX=${DIRPRFX}$$edir/); \
26	done
27
28${SUBDIR}::
29	@if test -d ${.TARGET}.${MACHINE}; then \
30		cd ${.CURDIR}/${.TARGET}.${MACHINE}; \
31	else \
32		cd ${.CURDIR}/${.TARGET}; \
33	fi; \
34	${MAKE} all
35
36.if !target(all)
37all: _SUBDIRUSE
38.endif
39
40.if !target(clean)
41clean: _SUBDIRUSE
42.endif
43
44.if !target(cleandir)
45cleandir: _SUBDIRUSE
46.endif
47
48.if !target(depend)
49depend: _SUBDIRUSE
50.endif
51
52.if !target (maninstall)
53maninstall: _SUBDIRUSE
54.endif
55
56DISTRIBUTION?=	bin
57.if !target(afterdistribute)
58afterdistribute:
59.endif
60.if !target(distribute)
61distribute: _SUBDIRUSE 
62	cd ${.CURDIR} ; ${MAKE} afterdistribute DESTDIR=${DISTDIR}/${DISTRIBUTION}
63.endif
64
65.if !target(install)
66.if !target(beforeinstall)
67beforeinstall:
68.endif
69.if !target(afterinstall)
70afterinstall:
71.endif
72install: afterinstall
73afterinstall: realinstall
74realinstall: beforeinstall _SUBDIRUSE
75.endif
76
77.if !target(lint)
78lint: _SUBDIRUSE
79.endif
80
81.if !target(obj)
82obj: _SUBDIRUSE
83.endif
84
85.if !target(tags)
86tags: _SUBDIRUSE
87.endif
88