Deleted Added
full compact
bsd.subdir.mk (96668) bsd.subdir.mk (97769)
1# from: @(#)bsd.subdir.mk 5.9 (Berkeley) 2/1/91
1# from: @(#)bsd.subdir.mk 5.9 (Berkeley) 2/1/91
2# $FreeBSD: head/share/mk/bsd.subdir.mk 96668 2002-05-15 16:19:54Z ru $
2# $FreeBSD: head/share/mk/bsd.subdir.mk 97769 2002-06-03 14:49:34Z ru $
3#
4# The include file <bsd.subdir.mk> contains the default targets
5# for building subdirectories.
6#
7# For all of the directories listed in the variable SUBDIRS, the
8# specified directory will be visited and the target made. There is
9# also a default target which allows the command "make subdir" where
10# subdir is any directory listed in the variable SUBDIRS.
11#
12#
13# +++ variables +++
14#
15# DISTRIBUTION Name of distribution. [base]
16#
17# SUBDIR A list of subdirectories that should be built as well.
18# Each of the targets will execute the same target in the
19# subdirectories.
20#
21# +++ targets +++
22#
23# distribute:
24# This is a variant of install, which will
25# put the stuff into the right "distribution".
26#
27# afterinstall, all, all-man, beforeinstall, checkdpadd,
28# clean, cleandepend, cleandir, depend, install, lint, maninstall,
29# obj, objlink, realinstall, regress, tags
30#
31
32.include <bsd.init.mk>
33
34_SUBDIR: .USE
35.if defined(SUBDIR) && !empty(SUBDIR)
36 @for entry in ${SUBDIR}; do \
37 if test -d ${.CURDIR}/$${entry}.${MACHINE_ARCH}; then \
38 ${ECHODIR} "===> ${DIRPRFX}$${entry}.${MACHINE_ARCH}"; \
39 edir=$${entry}.${MACHINE_ARCH}; \
40 cd ${.CURDIR}/$${edir}; \
41 else \
42 ${ECHODIR} "===> ${DIRPRFX}$$entry"; \
43 edir=$${entry}; \
44 cd ${.CURDIR}/$${edir}; \
45 fi; \
46 ${MAKE} ${.TARGET:realinstall=install} \
47 DIRPRFX=${DIRPRFX}$$edir/; \
48 done
49.endif
50
51${SUBDIR}::
52 @if test -d ${.TARGET}.${MACHINE_ARCH}; then \
53 cd ${.CURDIR}/${.TARGET}.${MACHINE_ARCH}; \
54 else \
55 cd ${.CURDIR}/${.TARGET}; \
56 fi; \
57 ${MAKE} all
58
59
60.for __target in all all-man checkdpadd clean cleandepend cleandir \
61 depend distribute lint maninstall \
62 obj objlink realinstall regress tags
63${__target}: _SUBDIR
64.endfor
65
3#
4# The include file <bsd.subdir.mk> contains the default targets
5# for building subdirectories.
6#
7# For all of the directories listed in the variable SUBDIRS, the
8# specified directory will be visited and the target made. There is
9# also a default target which allows the command "make subdir" where
10# subdir is any directory listed in the variable SUBDIRS.
11#
12#
13# +++ variables +++
14#
15# DISTRIBUTION Name of distribution. [base]
16#
17# SUBDIR A list of subdirectories that should be built as well.
18# Each of the targets will execute the same target in the
19# subdirectories.
20#
21# +++ targets +++
22#
23# distribute:
24# This is a variant of install, which will
25# put the stuff into the right "distribution".
26#
27# afterinstall, all, all-man, beforeinstall, checkdpadd,
28# clean, cleandepend, cleandir, depend, install, lint, maninstall,
29# obj, objlink, realinstall, regress, tags
30#
31
32.include <bsd.init.mk>
33
34_SUBDIR: .USE
35.if defined(SUBDIR) && !empty(SUBDIR)
36 @for entry in ${SUBDIR}; do \
37 if test -d ${.CURDIR}/$${entry}.${MACHINE_ARCH}; then \
38 ${ECHODIR} "===> ${DIRPRFX}$${entry}.${MACHINE_ARCH}"; \
39 edir=$${entry}.${MACHINE_ARCH}; \
40 cd ${.CURDIR}/$${edir}; \
41 else \
42 ${ECHODIR} "===> ${DIRPRFX}$$entry"; \
43 edir=$${entry}; \
44 cd ${.CURDIR}/$${edir}; \
45 fi; \
46 ${MAKE} ${.TARGET:realinstall=install} \
47 DIRPRFX=${DIRPRFX}$$edir/; \
48 done
49.endif
50
51${SUBDIR}::
52 @if test -d ${.TARGET}.${MACHINE_ARCH}; then \
53 cd ${.CURDIR}/${.TARGET}.${MACHINE_ARCH}; \
54 else \
55 cd ${.CURDIR}/${.TARGET}; \
56 fi; \
57 ${MAKE} all
58
59
60.for __target in all all-man checkdpadd clean cleandepend cleandir \
61 depend distribute lint maninstall \
62 obj objlink realinstall regress tags
63${__target}: _SUBDIR
64.endfor
65
66.for __target in includes
66.for __target in files includes
67.for __stage in build install
68${__stage}${__target}:
69.if make(${__stage}${__target})
70${__stage}${__target}: _SUBDIR
71.endif
72.endfor
73${__target}:
74 cd ${.CURDIR}; ${MAKE} build${__target}; ${MAKE} install${__target}
75.endfor
76
77.if !target(install)
78.if !target(beforeinstall)
79beforeinstall:
80.endif
81.if !target(afterinstall)
82afterinstall:
83.endif
84install: afterinstall
85afterinstall: realinstall
86realinstall: beforeinstall
87.endif
67.for __stage in build install
68${__stage}${__target}:
69.if make(${__stage}${__target})
70${__stage}${__target}: _SUBDIR
71.endif
72.endfor
73${__target}:
74 cd ${.CURDIR}; ${MAKE} build${__target}; ${MAKE} install${__target}
75.endfor
76
77.if !target(install)
78.if !target(beforeinstall)
79beforeinstall:
80.endif
81.if !target(afterinstall)
82afterinstall:
83.endif
84install: afterinstall
85afterinstall: realinstall
86realinstall: beforeinstall
87.endif