Annotation of src/share/mk/bsd.subdir.mk, Revision 1.7
1.7 ! deraadt 1: # $OpenBSD: bsd.subdir.mk,v 1.6 1996/03/16 05:32:40 etheisen Exp $
! 2: # $NetBSD: bsd.subdir.mk,v 1.11 1996/04/04 02:05:06 jtc Exp $
1.1 deraadt 3: # @(#)bsd.subdir.mk 5.9 (Berkeley) 2/1/91
4:
5: .if !target(.MAIN)
6: .MAIN: all
7: .endif
8:
9: _SUBDIRUSE: .USE
10: .if defined(SUBDIR)
11: @for entry in ${SUBDIR}; do \
12: (set -e; if test -d ${.CURDIR}/$${entry}.${MACHINE}; then \
13: _newdir_="$${entry}.${MACHINE}"; \
14: else \
15: _newdir_="$${entry}"; \
16: fi; \
17: if test X"${_THISDIR_}" = X""; then \
18: _nextdir_="$${_newdir_}"; \
19: else \
20: _nextdir_="$${_THISDIR_}/$${_newdir_}"; \
21: fi; \
1.3 deraadt 22: _makefile_spec_=""; \
1.6 etheisen 23: if [ -e ${.CURDIR}/$${_newdir_}/Makefile.bsd-wrapper ]; then \
1.3 deraadt 24: _makefile_spec_="-f Makefile.bsd-wrapper"; \
25: fi; \
26: echo "===> $${_nextdir_}"; \
1.1 deraadt 27: cd ${.CURDIR}/$${_newdir_}; \
1.2 niklas 28: ${MAKE} $${_makefile_spec_} _THISDIR_="$${_nextdir_}" \
1.1 deraadt 29: ${.TARGET:S/realinstall/install/:S/.depend/depend/}); \
30: done
31:
32: ${SUBDIR}::
33: @set -e; if test -d ${.CURDIR}/${.TARGET}.${MACHINE}; then \
34: _newdir_=${.TARGET}.${MACHINE}; \
35: else \
36: _newdir_=${.TARGET}; \
37: fi; \
1.3 deraadt 38: _makefile_spec_=""; \
1.6 etheisen 39: if [ -f ${.CURDIR}/$${_newdir_}/Makefile.bsd-wrapper ]; then \
1.3 deraadt 40: _makefile_spec_="-f Makefile.bsd-wrapper"; \
41: fi; \
1.1 deraadt 42: echo "===> $${_newdir_}"; \
43: cd ${.CURDIR}/$${_newdir_}; \
1.2 niklas 44: ${MAKE} $${_makefile_spec_} _THISDIR_="$${_newdir_}" all
1.1 deraadt 45: .endif
46:
47: .if !target(install)
48: .if !target(beforeinstall)
49: beforeinstall:
50: .endif
51: .if !target(afterinstall)
52: afterinstall:
53: .endif
54: install: maninstall
55: maninstall: afterinstall
56: afterinstall: realinstall
57: realinstall: beforeinstall _SUBDIRUSE
58: .endif
59:
60: .if !target(all)
61: all: _SUBDIRUSE
62: .endif
63:
64: .if !target(clean)
65: clean: _SUBDIRUSE
66: .endif
67:
68: .if !target(cleandir)
69: cleandir: _SUBDIRUSE
1.7 ! deraadt 70: .endif
! 71:
! 72: .if !target(includes)
! 73: includes: _SUBDIRUSE
1.1 deraadt 74: .endif
75:
76: .if !target(depend)
77: depend: _SUBDIRUSE
78: .endif
79:
80: .if !target(lint)
81: lint: _SUBDIRUSE
82: .endif
83:
84: .if !target(obj)
85: obj: _SUBDIRUSE
86: .endif
87:
88: .if !target(tags)
89: tags: _SUBDIRUSE
90: .endif
91:
92: .include <bsd.own.mk>