Home | History | Annotate | Line # | Download | only in mk
bsd.subdir.mk revision 1.12
      1  1.12      cgd #	$NetBSD: bsd.subdir.mk,v 1.12 1997/03/21 00:53:02 cgd Exp $
      2   1.7      cgd #	@(#)bsd.subdir.mk	5.9 (Berkeley) 2/1/91
      3   1.1      cgd 
      4   1.3  mycroft .if !target(.MAIN)
      5   1.1      cgd .MAIN: all
      6   1.3  mycroft .endif
      7   1.1      cgd 
      8  1.12      cgd _SUBDIRUSE: .USE ${SUBDIR:S/^/${.TARGET}-/}
      9   1.1      cgd 
     10  1.12      cgd __SUBDIRINTERNALUSE: .USE
     11  1.12      cgd 	@(_maketarget_="${.TARGET:S/realinstall/install/}"; \
     12  1.12      cgd 	entry="$${_maketarget_#*-}";\
     13  1.12      cgd 	target="$${_maketarget_%%-*}";\
     14  1.12      cgd 	set -e; if test -d ${.CURDIR}/$${entry}.${MACHINE}; then \
     15  1.12      cgd 		_newdir_="$${entry}.${MACHINE}"; \
     16   1.1      cgd 	else \
     17  1.12      cgd 		_newdir_="$${entry}"; \
     18   1.1      cgd 	fi; \
     19  1.12      cgd 	if test X"${_THISDIR_}" = X""; then \
     20  1.12      cgd 		_nextdir_="$${_newdir_}"; \
     21  1.12      cgd 	else \
     22  1.12      cgd 		_nextdir_="$${_THISDIR_}/$${_newdir_}"; \
     23  1.12      cgd 	fi; \
     24  1.12      cgd 	echo "===> $${_nextdir_}"; \
     25  1.10      cgd 	cd ${.CURDIR}/$${_newdir_}; \
     26  1.12      cgd 	${MAKE} _THISDIR_="$${_nextdir_}" $${target});
     27  1.12      cgd 
     28  1.12      cgd .for dir in ${SUBDIR}
     29  1.12      cgd all-${dir}: __SUBDIRINTERNALUSE
     30  1.12      cgd install-${dir}: __SUBDIRINTERNALUSE
     31  1.12      cgd realinstall-${dir}: __SUBDIRINTERNALUSE
     32  1.12      cgd clean-${dir}: __SUBDIRINTERNALUSE
     33  1.12      cgd cleandir-${dir}: __SUBDIRINTERNALUSE
     34  1.12      cgd includes-${dir}: __SUBDIRINTERNALUSE
     35  1.12      cgd depend-${dir}: __SUBDIRINTERNALUSE
     36  1.12      cgd lint-${dir}: __SUBDIRINTERNALUSE
     37  1.12      cgd obj-${dir}: __SUBDIRINTERNALUSE
     38  1.12      cgd tags-${dir}: __SUBDIRINTERNALUSE
     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.1      cgd .if !target(install)
     46   1.1      cgd .if !target(beforeinstall)
     47   1.1      cgd beforeinstall:
     48   1.1      cgd .endif
     49   1.1      cgd .if !target(afterinstall)
     50   1.1      cgd afterinstall:
     51   1.1      cgd .endif
     52   1.5      cgd install: maninstall
     53   1.3  mycroft maninstall: afterinstall
     54   1.1      cgd afterinstall: realinstall
     55   1.5      cgd realinstall: beforeinstall _SUBDIRUSE
     56   1.1      cgd .endif
     57   1.1      cgd 
     58   1.6      cgd .if !target(all)
     59   1.6      cgd all: _SUBDIRUSE
     60   1.6      cgd .endif
     61   1.6      cgd 
     62   1.6      cgd .if !target(clean)
     63   1.6      cgd clean: _SUBDIRUSE
     64   1.6      cgd .endif
     65   1.6      cgd 
     66   1.6      cgd .if !target(cleandir)
     67   1.6      cgd cleandir: _SUBDIRUSE
     68  1.11      jtc .endif
     69  1.11      jtc 
     70  1.11      jtc .if !target(includes)
     71  1.11      jtc includes: _SUBDIRUSE
     72   1.6      cgd .endif
     73   1.6      cgd 
     74   1.6      cgd .if !target(depend)
     75   1.6      cgd depend: _SUBDIRUSE
     76   1.6      cgd .endif
     77   1.6      cgd 
     78   1.6      cgd .if !target(lint)
     79   1.6      cgd lint: _SUBDIRUSE
     80   1.6      cgd .endif
     81   1.6      cgd 
     82   1.6      cgd .if !target(obj)
     83   1.6      cgd obj: _SUBDIRUSE
     84   1.6      cgd .endif
     85   1.6      cgd 
     86   1.6      cgd .if !target(tags)
     87   1.6      cgd tags: _SUBDIRUSE
     88   1.6      cgd .endif
     89   1.8  mycroft 
     90   1.8  mycroft .include <bsd.own.mk>
     91