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