1 # from: @(#)bsd.subdir.mk 5.9 (Berkeley) 2/1/91
4 # The include file <bsd.subdir.mk> contains the default targets
5 # for building subdirectories.
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.
15 # DISTRIBUTION Name of distribution. [base]
17 # SUBDIR A list of subdirectories that should be built as well.
18 # Each of the targets will execute the same target in the
24 # This is a variant of install, which will
25 # put the stuff into the right "distribution".
27 # afterdistribute, afterinstall, all, all-man, beforeinstall, checkdpadd,
28 # clean, cleandepend, cleandir, depend, install, lint,
29 # obj, objlink, realinstall, regress, tags
32 .include <bsd.init.mk>
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}; \
42 ${ECHODIR} "===> ${DIRPRFX}$$entry"; \
44 cd ${.CURDIR}/$${edir}; \
46 ${MAKE} ${.TARGET:realinstall=install} \
47 DIRPRFX=${DIRPRFX}$$edir/; \
52 @if test -d ${.TARGET}.${MACHINE_ARCH}; then \
53 cd ${.CURDIR}/${.TARGET}.${MACHINE_ARCH}; \
55 cd ${.CURDIR}/${.TARGET}; \
60 .for __target in all all-man checkdpadd clean cleandepend cleandir depend lint \
61 obj objlink realinstall regress tags
66 .if !target(beforeinstall)
69 .if !target(afterinstall)
73 afterinstall: realinstall
74 realinstall: beforeinstall
78 .if !target(afterdistribute)
81 .if !target(distribute)
83 .for dist in ${DISTRIBUTION}
84 cd ${.CURDIR} ; ${MAKE} afterdistribute DESTDIR=${DISTDIR}/${dist}