freebsd-dev/share/mk/bsd.subdir.mk

56 lines
1.2 KiB
Makefile
Raw Normal View History

# from: @(#)bsd.subdir.mk 5.9 (Berkeley) 2/1/91
# $FreeBSD$
1994-05-30 19:09:18 +00:00
.MAIN: all
_SUBDIRUSE: .USE
@for entry in ${SUBDIR}; do \
(if test -d ${.CURDIR}/$${entry}.${MACHINE}; then \
${ECHODIR} "===> ${DIRPRFX}$${entry}.${MACHINE}"; \
edir=$${entry}.${MACHINE}; \
cd ${.CURDIR}/$${edir}; \
1994-05-30 19:09:18 +00:00
else \
${ECHODIR} "===> ${DIRPRFX}$$entry"; \
edir=$${entry}; \
cd ${.CURDIR}/$${edir}; \
1994-05-30 19:09:18 +00:00
fi; \
${MAKE} ${.TARGET:realinstall=install} DIRPRFX=${DIRPRFX}$$edir/); \
1994-05-30 19:09:18 +00:00
done
${SUBDIR}::
@if test -d ${.TARGET}.${MACHINE}; then \
cd ${.CURDIR}/${.TARGET}.${MACHINE}; \
else \
cd ${.CURDIR}/${.TARGET}; \
fi; \
${MAKE} all
.for __target in all checkdpadd clean cleandepend cleandir depend lint \
maninstall obj objlink tags
.if !target(__target)
${__target}: _SUBDIRUSE
.endif
.endfor
1994-05-30 19:09:18 +00:00
.if !target(install)
.if !target(beforeinstall)
beforeinstall:
.endif
.if !target(afterinstall)
afterinstall:
.endif
install: afterinstall
afterinstall: realinstall
realinstall: beforeinstall _SUBDIRUSE
.endif
DISTRIBUTION?= bin
.if !target(afterdistribute)
afterdistribute:
1994-05-30 19:09:18 +00:00
.endif
.if !target(distribute)
distribute: _SUBDIRUSE
cd ${.CURDIR} ; ${MAKE} afterdistribute DESTDIR=${DISTDIR}/${DISTRIBUTION}
1994-05-30 19:09:18 +00:00
.endif