Home | History | Annotate | Line # | Download | only in mk
bsd.subdir.mk revision 1.20
      1  1.20   mycroft #	$NetBSD: bsd.subdir.mk,v 1.20 1997/05/07 17:06:30 mycroft Exp $
      2  1.14     mikel #	@(#)bsd.subdir.mk	8.1 (Berkeley) 6/8/93
      3   1.1       cgd 
      4  1.13  christos .include <bsd.own.mk>
      5  1.13  christos 
      6   1.3   mycroft .if !target(.MAIN)
      7   1.1       cgd .MAIN: all
      8   1.3   mycroft .endif
      9   1.1       cgd 
     10  1.12       cgd _SUBDIRUSE: .USE ${SUBDIR:S/^/${.TARGET}-/}
     11   1.1       cgd 
     12  1.12       cgd __SUBDIRINTERNALUSE: .USE
     13  1.19   mycroft 	@(_maketarget_="${.TARGET}"; \
     14  1.12       cgd 	entry="$${_maketarget_#*-}";\
     15  1.12       cgd 	target="$${_maketarget_%%-*}";\
     16  1.12       cgd 	set -e; if test -d ${.CURDIR}/$${entry}.${MACHINE}; then \
     17  1.12       cgd 		_newdir_="$${entry}.${MACHINE}"; \
     18   1.1       cgd 	else \
     19  1.12       cgd 		_newdir_="$${entry}"; \
     20   1.1       cgd 	fi; \
     21  1.12       cgd 	if test X"${_THISDIR_}" = X""; then \
     22  1.12       cgd 		_nextdir_="$${_newdir_}"; \
     23  1.12       cgd 	else \
     24  1.12       cgd 		_nextdir_="$${_THISDIR_}/$${_newdir_}"; \
     25  1.12       cgd 	fi; \
     26  1.15  christos 	if test -d ${.CURDIR}/$${_newdir_}; then \
     27  1.15  christos 		echo "===> $${_nextdir_}"; \
     28  1.15  christos 		cd ${.CURDIR}/$${_newdir_}; \
     29  1.15  christos 		${MAKE} _THISDIR_="$${_nextdir_}" $${target}; \
     30  1.15  christos 	else \
     31  1.16  christos 		echo "===> $${_nextdir_} [skipped: missing]"; \
     32  1.15  christos 	fi)
     33  1.12       cgd 
     34  1.12       cgd .for dir in ${SUBDIR}
     35  1.17   mycroft .for targ in ${TARGETS}
     36  1.17   mycroft .PHONY: ${targ}-${dir}
     37  1.18   mycroft ${targ}-${dir}: .MAKE __SUBDIRINTERNALUSE
     38  1.17   mycroft .endfor
     39  1.12       cgd 
     40  1.12       cgd # Backward-compatibility with the old rules.  If this went away,
     41  1.12       cgd # 'xlint' could become 'lint', 'xinstall' could become 'install', etc.
     42  1.12       cgd ${dir}: all-${dir}
     43  1.12       cgd .endfor
     44   1.1       cgd 
     45  1.20   mycroft .for targ in ${TARGETS}
     46  1.20   mycroft ${targ}: _SUBDIRUSE
     47  1.20   mycroft .endfor
     48   1.8   mycroft 
     49   1.8   mycroft .include <bsd.own.mk>
     50