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