Makefile revision 38042
120305Sjoerg#
220305Sjoerg#	$Id: Makefile,v 1.206 1998/08/02 09:24:59 wosch Exp $
379755Sdd#
420269Sjoerg# While porting to the another architecture include the bootstrap instead
520269Sjoerg# of the normal build.
620269Sjoerg#
720269Sjoerg.if exists(${.CURDIR}/Makefile.${MACHINE}) && defined(BOOTSTRAP_WORLD)
820269Sjoerg.include "${.CURDIR}/Makefile.${MACHINE}"
920269Sjoerg.else
1020269Sjoerg#
1120269Sjoerg# Make command line options:
1279755Sdd#	-DCLOBBER will remove /usr/include
1320305Sjoerg#	-DMAKE_KERBEROS4 to build KerberosIV
1420269Sjoerg#	-DNOCLEANDIR run ${MAKE} clean, instead of ${MAKE} cleandir
1520269Sjoerg#	-DNOCLEAN do not clean at all
1620305Sjoerg#	-DNOTOOLS do not rebuild any tools first
1720269Sjoerg#	-DNOCRYPT will prevent building of crypt versions
1820269Sjoerg#	-DNOLKM do not build loadable kernel modules
1920269Sjoerg#	-DNOOBJDIR do not run ``${MAKE} obj''
2020269Sjoerg#	-DNOPROFILE do not build profiled libraries
2120269Sjoerg#	-DNOSECURE do not go into secure subdir
2220269Sjoerg#	-DNOGAMES do not go into games subdir
2320269Sjoerg#	-DNOSHARE do not go into share subdir
2420269Sjoerg#	-DNOINFO do not make or install info files
2550479Speter#	-DNOLIBC_R do not build libc_r.
2620269Sjoerg#	LOCAL_DIRS="list of dirs" to add additional dirs to the SUBDIR list
27326849Seugen
2820253Sjoerg#
2920253Sjoerg# The intended user-driven targets are:
3020253Sjoerg# buildworld  - rebuild *everything*, including glue to help do upgrades
3120253Sjoerg# installworld- install everything built by "buildworld"
3220269Sjoerg# world       - buildworld + installworld
3320253Sjoerg# update      - convenient way to update your source tree (eg: sup/cvs)
3468965Sru# most        - build user commands, no libraries or include files
35285092Sbapt# installmost - install user commands, no libraries or include files
3644229Sdavidn#
3720253Sjoerg# Standard targets (not defined here) are documented in the makefiles in
38287084Sbapt# /usr/share/mk.  These include:
3920253Sjoerg#		obj depend all install clean cleandepend cleanobj
4020253Sjoerg
4120253Sjoerg.if (!make(world)) && (!make(buildworld)) && (!make(installworld))
4220253Sjoerg.MAKEFLAGS:=	-m ${.CURDIR}/share/mk ${.MAKEFLAGS}
4320253Sjoerg.endif
4420253Sjoerg
4520253Sjoerg#
4620253Sjoerg# Pick up any macros that are defined in the src-relative bsd.own.mk
4720253Sjoerg# but not in the "system" bsd.own.mk.  The "system" version has
48167919Sle# unfortunately already been included by the "system" sys.mk, so this
4920253Sjoerg# only works for new macros.  First undefine old macros that cause
5098854Ssada# problems.
5120253Sjoerg#
5220253Sjoerg.undef LIBDIR
5320253Sjoerg.include "${.CURDIR}/share/mk/bsd.own.mk"
54124382Siedowse
5520269Sjoerg# Put initial settings here.
5620269SjoergSUBDIR=
5721330Sdavidn
5868965Sru# We must do share/info early so that installation of info `dir'
59285092Sbapt# entries works correctly.  Do it first since it is less likely to
6044229Sdavidn# grow dependencies on include and lib than vice versa.
6120253Sjoerg.if exists(share/info)
6221330SdavidnSUBDIR+= share/info
6320253Sjoerg.endif
6420253Sjoerg
6520253Sjoerg# We must do include and lib early so that the perl *.ph generation
6620253Sjoerg# works correctly as it uses the header files installed by this.
6720253Sjoerg.if exists(include)
6820253SjoergSUBDIR+= include
6920253Sjoerg.endif
7020253Sjoerg.if exists(lib)
71168044SleSUBDIR+= lib
7271898Sru.endif
7371898Sru
7420253Sjoerg.if exists(bin)
7520253SjoergSUBDIR+= bin
7621330Sdavidn.endif
7768965Sru.if exists(games) && !defined(NOGAMES)
78285092SbaptSUBDIR+= games
7944229Sdavidn.endif
8020253Sjoerg.if exists(gnu)
81287084SbaptSUBDIR+= gnu
8220253Sjoerg.endif
8321330Sdavidn.if exists(kerberosIV) && exists(crypto) && !defined(NOCRYPT) && \
8468965Sru    defined(MAKE_KERBEROS4)
85285092SbaptSUBDIR+= kerberosIV
8644229Sdavidn.endif
8720253Sjoerg.if exists(libexec)
88287084SbaptSUBDIR+= libexec
8920253Sjoerg.endif
9020253Sjoerg.if exists(sbin)
9120253SjoergSUBDIR+= sbin
9220253Sjoerg.endif
9320253Sjoerg.if exists(share) && !defined(NOSHARE)
9420253SjoergSUBDIR+= share
9520253Sjoerg.endif
9620253Sjoerg.if exists(sys)
97287084SbaptSUBDIR+= sys
9820253Sjoerg.endif
99167919Sle.if exists(usr.bin)
10020253SjoergSUBDIR+= usr.bin
10120269Sjoerg.endif
10220253Sjoerg.if exists(usr.sbin)
10320253SjoergSUBDIR+= usr.sbin
104124382Siedowse.endif
10520269Sjoerg.if exists(secure) && !defined(NOCRYPT) && !defined(NOSECURE)
10620269SjoergSUBDIR+= secure
10721330Sdavidn.endif
10868965Sru.if exists(lkm) && !defined(NOLKM)
109285092SbaptSUBDIR+= lkm
11044229Sdavidn.endif
11120253Sjoerg
112287084Sbapt# etc must be last for "distribute" to work
11320253Sjoerg.if exists(etc) && make(distribute)
11420269SjoergSUBDIR+= etc
11593865Sdd.endif
11620253Sjoerg
11768965Sru# These are last, since it is nice to at least get the base system
118285092Sbapt# rebuilt before you do them.
11944229Sdavidn.if defined(LOCAL_DIRS)
12020269Sjoerg.for _DIR in ${LOCAL_DIRS}
12120269Sjoerg.if exists(${_DIR}) & exists(${_DIR}/Makefile)
12220269SjoergSUBDIR+= ${_DIR}
12368965Sru.endif
124285092Sbapt.endfor
12544229Sdavidn.endif
12620253Sjoerg
127287084Sbapt# Handle -DNOOBJDIR, -DNOCLEAN and -DNOCLEANDIR
12820253Sjoerg.if defined(NOOBJDIR)
12920253SjoergOBJDIR=
13020269Sjoerg.else
13120253SjoergOBJDIR=		obj
132124382Siedowse.endif
13320269Sjoerg
13420269Sjoerg.if defined(NOCLEAN)
13521330SdavidnCLEANDIR=
13668965Sru.else
137285092Sbapt.if defined(NOCLEANDIR)
13844229SdavidnCLEANDIR=	clean cleandepend
13920253Sjoerg.else
140287084SbaptCLEANDIR=	cleandir
14121330Sdavidn.endif
14268965Sru.endif
143285092Sbapt
14444229Sdavidn.if !defined(NOCLEAN) && ${.MAKEFLAGS:M-j} == ""
14520253Sjoerg_NODEPEND=	true
146287084Sbapt.endif
14720253Sjoerg.if defined(_NODEPEND)
14820253Sjoerg_DEPEND=	cleandepend
149287084Sbapt.else
15020269Sjoerg_DEPEND=	depend
15120269Sjoerg.endif
152176474Sscf
153124382SiedowseSUP?=		cvsup
15420269SjoergSUPFLAGS?=	-g -L 2 -P -
15520269Sjoerg
15621330Sdavidn#
15768965Sru# While building tools for bootstrapping, we don't need to waste time on
158285092Sbapt# shared or profiled libraries, shared linkage, or documentation, except
15944229Sdavidn# when the tools won't get cleaned we must use the defaults for shared
16020253Sjoerg# libraries and shared linkage (and this doesn't waste time).
161287084Sbapt# XXX actually, we do need to waste time building shared libraries.
16220253Sjoerg#
16320269Sjoerg.if defined(NOCLEAN)
16420253SjoergMK_FLAGS=	-DNOINFO -DNOMAN         -DNOPROFILE
16568965Sru.else
166285092SbaptMK_FLAGS=	-DNOINFO -DNOMAN -DNOPIC -DNOPROFILE -DNOSHARED
16744229Sdavidn.endif
16820269Sjoerg
16920269Sjoerg#
17020269Sjoerg# world
17174224Sdd#
172285092Sbapt# Attempt to rebuild and reinstall *everything*, with reasonable chance of
17374224Sdd# success, regardless of how old your existing system is.
17474224Sdd#
175287084Sbapt# >> Beware, it overwrites the local build environment! <<
17674224Sdd#
17774224Sddworld:
17874224Sdd	@echo "--------------------------------------------------------------"
179285092Sbapt	@echo "make world started on `LC_TIME=C date`"
18074224Sdd	@echo "--------------------------------------------------------------"
18174224Sdd.if target(pre-world)
182287084Sbapt	@echo
18374224Sdd	@echo "--------------------------------------------------------------"
18474224Sdd	@echo " Making 'pre-world' target"
18520253Sjoerg	@echo "--------------------------------------------------------------"
18699968Scharnier	cd ${.CURDIR}; ${MAKE} pre-world
18799968Scharnier.endif
18899968Scharnier	cd ${.CURDIR}; ${MAKE} buildworld
18930259Scharnier	cd ${.CURDIR}; ${MAKE} -B installworld
19020253Sjoerg.if target(post-world)
19130259Scharnier	@echo
19223374Sdanny	@echo "--------------------------------------------------------------"
19320253Sjoerg	@echo " Making 'post-world' target"
19420253Sjoerg	@echo "--------------------------------------------------------------"
19530259Scharnier	cd ${.CURDIR}; ${MAKE} post-world
19699968Scharnier.endif
19799968Scharnier	@echo
19899968Scharnier	@echo "--------------------------------------------------------------"
19999968Scharnier	@echo "make world completed on `LC_TIME=C date`"
20099968Scharnier	@echo "--------------------------------------------------------------"
20199968Scharnier
20299968Scharnier.if defined(MAKEOBJDIRPREFIX)
20399968ScharnierWORLDTMP=	${MAKEOBJDIRPREFIX}${.CURDIR}/tmp
20499968Scharnier.else
20579755SddWORLDTMP=	/usr/obj${.CURDIR}/tmp
20679755Sdd.endif
20720265SmppSTRICTTMPPATH=	${WORLDTMP}/sbin:${WORLDTMP}/usr/sbin:${WORLDTMP}/bin:${WORLDTMP}/usr/bin
20820265SmppTMPPATH=	${STRICTTMPPATH}:${PATH}
20920253Sjoerg
21020253Sjoerg# XXX COMPILER_PATH is needed for finding cc1, ld and as
21133354Ssteve# XXX GCC_EXEC_PREFIX is for *crt.o.  It is probably unnecessary now
21279755Sdd#	that LIBRARY_PATH is set.  We still can't use -nostdlib, since gcc
21333354Ssteve#	wouldn't link *crt.o or libgcc if it were used.
21433354Ssteve# XXX LD_LIBRARY_PATH is for ld.so.  It is also used by ld, although we don't
21520253Sjoerg#	want that - all compile-time library paths should be resolved by gcc.
21620253Sjoerg#	It fails for set[ug]id executables (are any used?).
21720253SjoergCOMPILER_ENV=	BISON_SIMPLE=${WORLDTMP}/usr/share/misc/bison.simple \
21833354Ssteve		COMPILER_PATH=${WORLDTMP}/usr/libexec:${WORLDTMP}/usr/bin \
21920253Sjoerg		GCC_EXEC_PREFIX=${WORLDTMP}${SHLIBDIR}:${WORLDTMP}/usr/lib/ \
22020253Sjoerg		LD_LIBRARY_PATH=${WORLDTMP}${SHLIBDIR} \
22120269Sjoerg		LIBRARY_PATH=${WORLDTMP}${SHLIBDIR}:${WORLDTMP}/usr/lib
22220269Sjoerg
22320253SjoergBMAKEENV=	PATH=${TMPPATH} ${COMPILER_ENV} NOEXTRADEPEND=t \
22433354Ssteve		OBJFORMAT_PATH=${WORLDTMP}/usr/libexec:/usr/libexec
22557695SsheldonhXMAKEENV=	PATH=${STRICTTMPPATH} ${COMPILER_ENV} \
22657695Ssheldonh		OBJFORMAT_PATH=${WORLDTMP}/usr/libexec \
22779755Sdd		CFLAGS="-nostdinc ${CFLAGS}"	# XXX -nostdlib
22879755Sdd
22971898Sru# used to compile and install 'make' in temporary build tree
23071898SruMAKETMP=	${WORLDTMP}/make
23133354SsteveIBMAKE=	${BMAKEENV} MAKEOBJDIR=${MAKETMP} ${MAKE} DESTDIR=${WORLDTMP}
23233354Ssteve# bootstrap make
23333354SsteveBMAKE=	${BMAKEENV} ${WORLDTMP}/usr/bin/make DESTDIR=${WORLDTMP}
23430259Scharnier# cross make used for compilation
23533354SsteveXMAKE=	${XMAKEENV} ${WORLDTMP}/usr/bin/make DESTDIR=${WORLDTMP}
236287084Sbapt# cross make used for final installation
237287084SbaptIXMAKE=	${XMAKEENV} ${WORLDTMP}/usr/bin/make
238287084Sbapt
23920253Sjoerg#
24020253Sjoerg# buildworld
24120253Sjoerg#
24220269Sjoerg# Attempt to rebuild the entire system, with reasonable chance of
24320253Sjoerg# success, regardless of how old your existing system is.
24499108Sdd#
24520269Sjoergbuildworld:
246285092Sbapt.if !defined(NOCLEAN)
247285092Sbapt	@echo
248285092Sbapt	@echo "--------------------------------------------------------------"
249285092Sbapt	@echo " Cleaning up the temporary build tree"
250285092Sbapt	@echo "--------------------------------------------------------------"
251285092Sbapt	mkdir -p ${WORLDTMP}
25244229Sdavidn	chflags -R noschg ${WORLDTMP}/
253287084Sbapt	rm -rf ${WORLDTMP}
254287084Sbapt.endif
25544229Sdavidn.if !defined(NOTOOLS)
25644229Sdavidn	@echo
257287084Sbapt	@echo "--------------------------------------------------------------"
258287084Sbapt	@echo " Making make"
259287084Sbapt	@echo "--------------------------------------------------------------"
26044229Sdavidn	mkdir -p ${WORLDTMP}/usr/bin ${MAKETMP}
26144229Sdavidn	( \
26244229Sdavidn	cd ${.CURDIR}/usr.bin/make; \
26344229Sdavidn		MAKEOBJDIRPREFIX=""; unset MAKEOBJDIRPREFIX; \
26444229Sdavidn		${IBMAKE} -I${.CURDIR}/share/mk ${MK_FLAGS} all; \
26544229Sdavidn		${IBMAKE} -I${.CURDIR}/share/mk ${MK_FLAGS} install; \
266285092Sbapt		${IBMAKE} -I${.CURDIR}/share/mk ${MK_FLAGS} clean \
26720253Sjoerg	)
26820253Sjoerg	@echo
26930259Scharnier	@echo "--------------------------------------------------------------"
27020253Sjoerg	@echo " Making mtree"
27120253Sjoerg	@echo "--------------------------------------------------------------"
27233354Ssteve	mkdir -p ${WORLDTMP}/usr/sbin ${WORLDTMP}/mtree
27333354Ssteve	( \
27420269Sjoerg	cd ${.CURDIR}/usr.sbin/mtree; \
27520269Sjoerg		MAKEOBJDIRPREFIX=""; unset MAKEOBJDIRPREFIX; \
27633354Ssteve		export MAKEOBJDIR=${WORLDTMP}/mtree; \
27733354Ssteve		${BMAKE} ${MK_FLAGS} all; \
27833354Ssteve		${BMAKE} ${MK_FLAGS} -B install clean \
27920253Sjoerg	)
28020253Sjoerg.endif
28130259Scharnier	@echo
282287084Sbapt	@echo "--------------------------------------------------------------"
283287084Sbapt	@echo " Making hierarchy"
28420253Sjoerg	@echo "--------------------------------------------------------------"
28530259Scharnier	cd ${.CURDIR}; ${BMAKE} hierarchy
28620253Sjoerg.if !defined(NOCLEAN)
28720269Sjoerg	@echo
28879755Sdd	@echo "--------------------------------------------------------------"
28979755Sdd	@echo " Cleaning up the obj tree"
29079755Sdd	@echo "--------------------------------------------------------------"
29179755Sdd	cd ${.CURDIR}; ${BMAKE} ${CLEANDIR:S/^/par-/}
29233354Ssteve.endif
29330259Scharnier.if !defined(NOOBJDIR)
29433354Ssteve	@echo
29533354Ssteve	@echo "--------------------------------------------------------------"
29620269Sjoerg	@echo " Rebuilding the obj tree"
29720269Sjoerg	@echo "--------------------------------------------------------------"
29820269Sjoerg	cd ${.CURDIR}; ${BMAKE} par-${OBJDIR}
29921330Sdavidn.endif
30021330Sdavidn.if !defined(NOTOOLS)
30130259Scharnier	@echo
30221330Sdavidn	@echo "--------------------------------------------------------------"
30321330Sdavidn	@echo " Rebuilding bootstrap tools"
30421330Sdavidn	@echo "--------------------------------------------------------------"
30521330Sdavidn	cd ${.CURDIR}; ${BMAKE} bootstrap
30699968Scharnier	@echo
30799968Scharnier	@echo "--------------------------------------------------------------"
30899968Scharnier	@echo " Rebuilding tools necessary to build the include files"
30999968Scharnier	@echo "--------------------------------------------------------------"
31099968Scharnier	cd ${.CURDIR}; ${BMAKE} include-tools
31199968Scharnier.endif
31221330Sdavidn	@echo
31399968Scharnier	@echo "--------------------------------------------------------------"
31499968Scharnier	@echo " Rebuilding ${DESTDIR}/usr/include"
31599968Scharnier	@echo "--------------------------------------------------------------"
31633354Ssteve	cd ${.CURDIR}; SHARED=copies ${BMAKE} includes
31733354Ssteve	@echo
31821330Sdavidn	@echo "--------------------------------------------------------------"
31920253Sjoerg	@echo " Rebuilding bootstrap libraries"
32020253Sjoerg	@echo "--------------------------------------------------------------"
32120253Sjoerg	cd ${.CURDIR}; ${BMAKE} bootstrap-libraries
32233354Ssteve.if !defined(NOTOOLS)
32320253Sjoerg	@echo
32433354Ssteve	@echo "--------------------------------------------------------------"
32520253Sjoerg	@echo " Rebuilding tools needed to build libraries"
32620269Sjoerg	@echo "--------------------------------------------------------------"
327287084Sbapt	cd ${.CURDIR}; ${BMAKE} lib-tools
328287084Sbapt.endif
329287084Sbapt.if !defined(NOTOOLS)
330287084Sbapt	@echo
33130259Scharnier	@echo "--------------------------------------------------------------"
332287084Sbapt	@echo " Rebuilding all other tools needed to build the world"
333287084Sbapt	@echo "--------------------------------------------------------------"
334287084Sbapt	cd ${.CURDIR}; ${BMAKE} build-tools
33520253Sjoerg.endif
336287084Sbapt.if !defined(_NODEPEND)
337287084Sbapt	@echo
338287084Sbapt	@echo "--------------------------------------------------------------"
33930259Scharnier	@echo " Rebuilding dependencies"
340287084Sbapt	@echo "--------------------------------------------------------------"
341287084Sbapt	cd ${.CURDIR}; ${XMAKE} par-depend
342287084Sbapt.endif
343287084Sbapt	@echo
344287084Sbapt	@echo "--------------------------------------------------------------"
34520253Sjoerg	@echo " Building libraries"
346287084Sbapt	@echo "--------------------------------------------------------------"
347287084Sbapt	cd ${.CURDIR}; ${XMAKE} -DNOINFO -DNOMAN libraries
348287084Sbapt	@echo
34920253Sjoerg	@echo "--------------------------------------------------------------"
35020253Sjoerg	@echo " Building everything.."
351287084Sbapt	@echo "--------------------------------------------------------------"
352287084Sbapt	cd ${.CURDIR}; ${XMAKE} all
353287084Sbapt
35420253Sjoerg#
355287084Sbapt# installworld
35620253Sjoerg#
35720253Sjoerg# Installs everything compiled by a 'buildworld'.
35874351Sru#
35920269Sjoerginstallworld:
360287084Sbapt	cd ${.CURDIR}; ${IXMAKE} reinstall
36133354Ssteve
36233354Ssteve#
36333354Ssteve# reinstall
36433354Ssteve#
36533354Ssteve# If you have a build server, you can NFS mount the source and obj directories
36633354Ssteve# and do a 'make reinstall' on the *client* to install new binaries from the
36774351Sru# most recent server build.
36833354Ssteve#
36979755Sddreinstall:
37033354Ssteve	@echo "--------------------------------------------------------------"
37120253Sjoerg	@echo " Making hierarchy"
37220253Sjoerg	@echo "--------------------------------------------------------------"
37320253Sjoerg	cd ${.CURDIR}; ${MAKE} hierarchy
374287084Sbapt	@echo
375287084Sbapt	@echo "--------------------------------------------------------------"
376287084Sbapt	@echo " Installing everything.."
37733354Ssteve	@echo "--------------------------------------------------------------"
37820253Sjoerg	cd ${.CURDIR}; ${MAKE} install
379287084Sbapt.if ${MACHINE_ARCH} == "i386"
380287084Sbapt	@echo
38120253Sjoerg	@echo "--------------------------------------------------------------"
382287084Sbapt	@echo " Re-scanning the shared libraries.."
383287084Sbapt	@echo "--------------------------------------------------------------"
38420253Sjoerg	cd ${.CURDIR}; /sbin/ldconfig -R
38533354Ssteve.endif
38633354Ssteve	@echo
38720253Sjoerg	@echo "--------------------------------------------------------------"
38820253Sjoerg	@echo " Rebuilding man page indexes"
389287084Sbapt	@echo "--------------------------------------------------------------"
390287084Sbapt	cd ${.CURDIR}/share/man; ${MAKE} makedb
39179755Sdd
39233354Ssteve#
39330259Scharnier# update
39430259Scharnier#
39533354Ssteve# Update the source tree, by running sup and/or running cvs to update to the
39620253Sjoerg# latest copy.
39779755Sdd#
39820253Sjoergupdate:
39933354Ssteve.if defined(SUP_UPDATE)
400287084Sbapt	@echo "--------------------------------------------------------------"
401287084Sbapt	@echo "Running ${SUP}"
40230259Scharnier	@echo "--------------------------------------------------------------"
40320253Sjoerg	@${SUP} ${SUPFLAGS} ${SUPFILE}
40420253Sjoerg.if defined(SUPFILE1)
40520253Sjoerg	@${SUP} ${SUPFLAGS} ${SUPFILE1}
40620253Sjoerg.endif
407287084Sbapt.if defined(SUPFILE2)
408287084Sbapt	@${SUP} ${SUPFLAGS} ${SUPFILE2}
40920265Smpp.endif
41033354Ssteve.endif
41120253Sjoerg.if defined(CVS_UPDATE)
41230259Scharnier	@echo "--------------------------------------------------------------"
41333354Ssteve	@echo "Updating /usr/src from cvs repository" ${CVSROOT}
41420253Sjoerg	@echo "--------------------------------------------------------------"
41533354Ssteve	cd ${.CURDIR}; cvs -q update -P -d
41674351Sru.endif
41733354Ssteve
41820253Sjoerg#
41930259Scharnier# most
42020253Sjoerg#
42133354Ssteve# Build most of the user binaries on the existing system libs and includes.
42220253Sjoerg#
423297559Swblockmost:
42420253Sjoerg	@echo "--------------------------------------------------------------"
425297559Swblock	@echo " Building programs only"
426297559Swblock	@echo "--------------------------------------------------------------"
427297559Swblock	cd ${.CURDIR}/bin;		${MAKE} all
428297559Swblock	cd ${.CURDIR}/sbin;		${MAKE} all
429297559Swblock	cd ${.CURDIR}/libexec;		${MAKE} all
430297559Swblock	cd ${.CURDIR}/usr.bin;		${MAKE} all
431297559Swblock	cd ${.CURDIR}/usr.sbin;		${MAKE} all
43220253Sjoerg	cd ${.CURDIR}/gnu/libexec;	${MAKE} all
43320269Sjoerg	cd ${.CURDIR}/gnu/usr.bin;	${MAKE} all
43420269Sjoerg	cd ${.CURDIR}/gnu/usr.sbin;	${MAKE} all
43520269Sjoerg#.if defined(MAKE_KERBEROS4) && !defined(NOCRYPT)
43620269Sjoerg#	cd ${.CURDIR}/kerberosIV;	${MAKE} most
43791841Skeramida#.endif
43891841Skeramida#.if !defined(NOSECURE) && !defined(NOCRYPT)
43933354Ssteve#	cd ${.CURDIR}/secure;		${MAKE} most
44020253Sjoerg#.endif
44120253Sjoerg
44230259Scharnier#
44320253Sjoerg# installmost
44420253Sjoerg#
44520253Sjoerg# Install the binaries built by the 'most' target.  This does not include
446287084Sbapt# libraries or include files.
447287084Sbapt#
44820253Sjoerginstallmost:
44920253Sjoerg	@echo "--------------------------------------------------------------"
45020253Sjoerg	@echo " Installing programs only"
45120265Smpp	@echo "--------------------------------------------------------------"
452163165Strhodes	cd ${.CURDIR}/bin;		${MAKE} install
453163169Strhodes	cd ${.CURDIR}/sbin;		${MAKE} install
454163165Strhodes	cd ${.CURDIR}/libexec;		${MAKE} install
455163169Strhodes	cd ${.CURDIR}/usr.bin;		${MAKE} install
456163165Strhodes	cd ${.CURDIR}/usr.sbin;		${MAKE} install
45720253Sjoerg	cd ${.CURDIR}/gnu/libexec;	${MAKE} install
45874351Sru	cd ${.CURDIR}/gnu/usr.bin;	${MAKE} install
45920253Sjoerg	cd ${.CURDIR}/gnu/usr.sbin;	${MAKE} install
46020253Sjoerg#.if defined(MAKE_KERBEROS4) && !defined(NOCRYPT)
46133354Ssteve#	cd ${.CURDIR}/kerberosIV;	${MAKE} installmost
46220253Sjoerg#.endif
46333354Ssteve#.if !defined(NOSECURE) && !defined(NOCRYPT)
46420253Sjoerg#	cd ${.CURDIR}/secure;		${MAKE} installmost
465287084Sbapt#.endif
466287084Sbapt
46720253Sjoerg#
46833354Ssteve# ------------------------------------------------------------------------
46979755Sdd#
47033354Ssteve# From here onwards are utility targets used by the 'make world' and
47133354Ssteve# related targets.  If your 'world' breaks, you may like to try to fix
47279755Sdd# the problem and manually run the following targets to attempt to
47320253Sjoerg# complete the build.  Beware, this is *not* guaranteed to work, you
474167919Sle# need to have a pretty good grip on the current state of the system
475167919Sle# to attempt to manually finish it.  If in doubt, 'make world' again.
476168044Sle#
477168044Sle
478168044Sle#
479167919Sle# heirarchy - ensure that all the needed directories are present
480167919Sle#
481167919Slehierarchy:
482167919Sle	cd ${.CURDIR}/etc;		${MAKE} distrib-dirs
483167919Sle
48420253Sjoerg#
48530259Scharnier# bootstrap - [re]build tools needed to run the actual build, this includes
48620253Sjoerg# tools needed by 'make depend', as some tools are needed to generate source
48733354Ssteve# for the dependency information to be gathered from.
48820253Sjoerg#
48933354Sstevebootstrap:
49074351Sru.if defined(DESTDIR)
49133354Ssteve	rm -f ${DESTDIR}/usr/src/sys
49279755Sdd	ln -s ${.CURDIR}/sys ${DESTDIR}/usr/src
49333354Ssteve	cd ${.CURDIR}/include; find -dx . | cpio -dump ${DESTDIR}/usr/include
49420253Sjoerg.for d in net netinet posix4 sys vm machine
49530259Scharnier	if [ -h ${DESTDIR}/usr/include/$d ]; then \
49620253Sjoerg		rm -f ${DESTDIR}/usr/include/$d ; \
49720253Sjoerg	fi
49830259Scharnier.endfor
49920253Sjoerg	cd ${.CURDIR}/sys; \
50020253Sjoerg		find -dx net netinet posix4 sys vm -name '*.h' -o -type d | \
50120253Sjoerg		cpio -dump ${DESTDIR}/usr/include
50220253Sjoerg	mkdir -p ${DESTDIR}/usr/include/machine
50320253Sjoerg	cd ${.CURDIR}/sys/${MACHINE_ARCH}/include; find -dx . -name '*.h' -o -type d | \
50420253Sjoerg		cpio -dump ${DESTDIR}/usr/include/machine
50520253Sjoerg.endif
50630259Scharnier	cd ${.CURDIR}/usr.bin/make; ${MAKE} ${MK_FLAGS} ${_DEPEND}; \
50720253Sjoerg		${MAKE} ${MK_FLAGS} all; \
50820253Sjoerg		${MAKE} ${MK_FLAGS} -B install ${CLEANDIR} ${OBJDIR}
50920253Sjoerg	cd ${.CURDIR}/usr.bin/xinstall; ${MAKE} ${MK_FLAGS} ${_DEPEND}; \
51030259Scharnier		${MAKE} ${MK_FLAGS} all; \
51120253Sjoerg		${MAKE} ${MK_FLAGS} -B install ${CLEANDIR} ${OBJDIR}
51220253Sjoerg	cd ${.CURDIR}/usr.bin/yacc; ${MAKE} ${MK_FLAGS} ${_DEPEND}; \
51320253Sjoerg		${MAKE} ${MK_FLAGS} all; \
51420253Sjoerg		${MAKE} ${MK_FLAGS} -B install ${CLEANDIR} ${OBJDIR}
51568965Sru	cd ${.CURDIR}/usr.bin/lex; ${MAKE} bootstrap; \
51633354Ssteve		${MAKE} ${MK_FLAGS} ${_DEPEND}; \
51720253Sjoerg		${MAKE} ${MK_FLAGS} -DNOLIB all; \
51830259Scharnier		${MAKE} ${MK_FLAGS} -DNOLIB -B install ${CLEANDIR}
51920253Sjoerg.if !defined(NOOBJDIR)
52020253Sjoerg	cd ${.CURDIR}/usr.bin/lex; ${MAKE} ${OBJDIR}
52120253Sjoerg.endif
52220253Sjoerg	cd ${.CURDIR}/usr.sbin/mtree; ${MAKE} ${MK_FLAGS} ${_DEPEND}; \
52320253Sjoerg		${MAKE} ${MK_FLAGS} all; \
52420253Sjoerg		${MAKE} ${MK_FLAGS} -B install ${CLEANDIR} ${OBJDIR}
52520253Sjoerg.if defined(DESTDIR)
52633354Ssteve	cd ${.CURDIR}/include && ${MAKE} copies
52720253Sjoerg.endif
52834808Scharnier
52920253Sjoerg#
53074351Sru# include-tools - generally the same as 'bootstrap', except that it's for
53120253Sjoerg# things that are specifically needed to generate include files.
53220253Sjoerg#
53320253Sjoerg# XXX should be merged with bootstrap, it's not worth keeeping them separate.
53433354Ssteve# Well, maybe it is now.  We force 'cleandepend' here to avoid dependencies
53533354Ssteve# on cleaned away headers in ${WORLDTMP}.
53620253Sjoerg#
53720253Sjoerginclude-tools:
53833354Ssteve.for d in usr.bin/compile_et usr.bin/rpcgen
53968965Sru	cd ${.CURDIR}/$d; ${MAKE} cleandepend; \
54020253Sjoerg		${MAKE} ${MK_FLAGS} ${_DEPEND}; \
54120253Sjoerg		${MAKE} ${MK_FLAGS} all; \
54220253Sjoerg		${MAKE} ${MK_FLAGS} -B install ${CLEANDIR} ${OBJDIR}
54320253Sjoerg.endfor
54420253Sjoerg
54520253Sjoerg#
54620253Sjoerg# includes - possibly generate and install the include files.
54733354Ssteve#
548124382Siedowseincludes:
549124382Siedowse.if defined(CLOBBER)
550124382Siedowse	rm -rf ${DESTDIR}/usr/include/*
551124382Siedowse	mtree -deU -f ${.CURDIR}/etc/mtree/BSD.include.dist \
552124382Siedowse		-p ${DESTDIR}/usr/include
553124382Siedowse.endif
55420253Sjoerg	cd ${.CURDIR}/include;			${MAKE} -B all install
55520253Sjoerg	cd ${.CURDIR}/gnu/include;		${MAKE} install
55620253Sjoerg	cd ${.CURDIR}/gnu/lib/libmp;		${MAKE} beforeinstall
55720253Sjoerg	cd ${.CURDIR}/gnu/lib/libobjc;		${MAKE} beforeinstall
55820253Sjoerg	cd ${.CURDIR}/gnu/lib/libreadline;	${MAKE} beforeinstall
55920253Sjoerg	cd ${.CURDIR}/gnu/lib/libregex;		${MAKE} beforeinstall
56074351Sru	cd ${.CURDIR}/gnu/lib/libstdc++;	${MAKE} beforeinstall
56120269Sjoerg	cd ${.CURDIR}/gnu/lib/libg++;		${MAKE} beforeinstall
56220269Sjoerg	cd ${.CURDIR}/gnu/lib/libdialog;	${MAKE} beforeinstall
56320269Sjoerg	cd ${.CURDIR}/gnu/lib/libgmp;		${MAKE} beforeinstall
56420269Sjoerg.if exists(secure) && !defined(NOCRYPT)
56520269Sjoerg	cd ${.CURDIR}/secure/lib/libdes;	${MAKE} beforeinstall
56620269Sjoerg.endif
56720253Sjoerg.if exists(kerberosIV) && !defined(NOCRYPT) && defined(MAKE_KERBEROS4)
56820253Sjoerg	cd ${.CURDIR}/kerberosIV/lib/libacl;	${MAKE} beforeinstall
56920253Sjoerg	cd ${.CURDIR}/kerberosIV/lib/libkadm;	${MAKE} beforeinstall
57020253Sjoerg	cd ${.CURDIR}/kerberosIV/lib/libkafs;	${MAKE} beforeinstall
57174351Sru	cd ${.CURDIR}/kerberosIV/lib/libkdb;	${MAKE} beforeinstall
57220269Sjoerg	cd ${.CURDIR}/kerberosIV/lib/libkrb;	${MAKE} beforeinstall
57320253Sjoerg	cd ${.CURDIR}/kerberosIV/lib/libtelnet; ${MAKE} beforeinstall
57430259Scharnier.else
57520253Sjoerg	cd ${.CURDIR}/lib/libtelnet;		${MAKE} beforeinstall
57620253Sjoerg.endif
57720253Sjoerg.if exists(${.CURDIR}/lib/csu/${MACHINE})
57874351Sru	cd ${.CURDIR}/lib/csu/${MACHINE};	${MAKE} beforeinstall
57920269Sjoerg.endif
58074351Sru	cd ${.CURDIR}/lib/libalias;		${MAKE} beforeinstall
58120253Sjoerg	cd ${.CURDIR}/lib/libc;			${MAKE} beforeinstall
58274351Sru	cd ${.CURDIR}/lib/libcalendar;		${MAKE} beforeinstall
58320253Sjoerg	cd ${.CURDIR}/lib/libcurses;		${MAKE} beforeinstall
58420253Sjoerg	cd ${.CURDIR}/lib/libdisk;		${MAKE} beforeinstall
58574351Sru	cd ${.CURDIR}/lib/libedit;		${MAKE} beforeinstall
58620269Sjoerg	cd ${.CURDIR}/lib/libftpio;		${MAKE} beforeinstall
58720253Sjoerg	cd ${.CURDIR}/lib/libmd;		${MAKE} beforeinstall
58820253Sjoerg	cd ${.CURDIR}/lib/libmytinfo;		${MAKE} beforeinstall
58920253Sjoerg	cd ${.CURDIR}/lib/libncurses;		${MAKE} beforeinstall
59020253Sjoerg.if !defined(WANT_CSRG_LIBM)
59120253Sjoerg	cd ${.CURDIR}/lib/msun;			${MAKE} beforeinstall
59220253Sjoerg.endif
59320253Sjoerg	cd ${.CURDIR}/lib/libopie;		${MAKE} beforeinstall
59420253Sjoerg	cd ${.CURDIR}/lib/libpcap;		${MAKE} beforeinstall
59574351Sru	cd ${.CURDIR}/lib/librpcsvc;		${MAKE} beforeinstall
59620269Sjoerg	cd ${.CURDIR}/lib/libskey;		${MAKE} beforeinstall
59720253Sjoerg.if !defined(NOTCL) && exists (${.CURDIR}/contrib/tcl) && \
59830259Scharnier	exists(${.CURDIR}/usr.bin/tclsh) && exists (${.CURDIR}/lib/libtcl)
59920253Sjoerg	cd ${.CURDIR}/lib/libtcl;		${MAKE} installhdrs
60030259Scharnier.endif
60120253Sjoerg	cd ${.CURDIR}/lib/libtermcap;		${MAKE} beforeinstall
60220253Sjoerg	cd ${.CURDIR}/lib/libcom_err;		${MAKE} beforeinstall
60330259Scharnier	cd ${.CURDIR}/lib/libss;		${MAKE} -B hdrs beforeinstall
604287084Sbapt	cd ${.CURDIR}/lib/libscsi;		${MAKE} beforeinstall
605287084Sbapt	cd ${.CURDIR}/lib/libutil;		${MAKE} beforeinstall
606287084Sbapt	cd ${.CURDIR}/lib/libvgl;		${MAKE} beforeinstall
607287084Sbapt	cd ${.CURDIR}/lib/libz;			${MAKE} beforeinstall
608287084Sbapt	cd ${.CURDIR}/usr.bin/f2c;		${MAKE} beforeinstall
609287084Sbapt	cd ${.CURDIR}/usr.bin/lex;		${MAKE} beforeinstall
610287084Sbapt
61120253Sjoerg#
61220253Sjoerg# Declare tools if they are not required on all architectures.
61330259Scharnier#
614326849Seugen.if ${MACHINE_ARCH} == "i386"
615326849Seugen# aout tools:
616326849Seugen_aout_ar	= usr.bin/ar
617326849Seugen_aout_as	= gnu/usr.bin/as
618326849Seugen_aout_ld	= gnu/usr.bin/ld
619326849Seugen_aout_nm	= usr.bin/nm
620326849Seugen_aout_ranlib	= usr.bin/ranlib
621326849Seugen_aout_size	= usr.bin/size
62220253Sjoerg_aout_strip	= usr.bin/strip
62330259Scharnier_objformat	= usr.bin/objformat
62420253Sjoerg.endif
62574351Sru
62633354Ssteve#
62733354Ssteve# lib-tools - build tools to compile and install the libraries.
62820253Sjoerg#
62920253Sjoerg# XXX gperf is required for cc
63033354Ssteve# XXX a new ld and tsort is required for cc
631287084Sbaptlib-tools:
632287084Sbapt.for d in				\
63320253Sjoerg		gnu/usr.bin/gperf	\
63420253Sjoerg		${_aout_ld}		\
63520253Sjoerg		usr.bin/tsort		\
63620253Sjoerg		${_aout_as}		\
63733354Ssteve		gnu/usr.bin/bison	\
63820253Sjoerg		gnu/usr.bin/cc		\
63920253Sjoerg		${_aout_ar}		\
64020253Sjoerg		usr.bin/env		\
64120269Sjoerg		usr.bin/lex/lib		\
64220269Sjoerg		usr.bin/mk_cmds		\
64320253Sjoerg		${_aout_nm}		\
64430259Scharnier		${_aout_ranlib}		\
64520253Sjoerg		${_aout_strip}		\
646287084Sbapt		gnu/usr.bin/binutils	\
647287084Sbapt		usr.bin/uudecode	\
64830259Scharnier		${_objformat}
64920253Sjoerg	cd ${.CURDIR}/$d; ${MAKE} ${MK_FLAGS} ${_DEPEND}; \
650163165Strhodes		${MAKE} ${MK_FLAGS} all; \
651163165Strhodes		${MAKE} ${MK_FLAGS} -B install; \
652163165Strhodes		${MAKE} ${MK_FLAGS:S/-DNOPIC//} -B ${CLEANDIR} ${OBJDIR}
65371898Sru.endfor
65471898Sru
65571898Sru#
65671898Sru# We have to know too much about ordering and subdirs in the lib trees:
657287084Sbapt#
658287084Sbapt# To satisfy shared library linkage when only the libraries being built
65968965Sru# are visible:
66020253Sjoerg#
66120253Sjoerg# libcom_err must be built before libss.
66220253Sjoerg# libcrypt and libmd must be built before libskey.
66320253Sjoerg# libm must be built before libtcl.
664287084Sbapt# libmytinfo must be built before libdialog and libncurses.
665287084Sbapt# libncurses must be built before libdialog.
666287084Sbapt# libtermcap must be built before libcurses, libedit and libreadline.
667287084Sbapt#
668287084Sbapt# Some libraries are built conditionally and/or are in inconsistently
669287084Sbapt# named directories:
67020253Sjoerg#
67120253Sjoerg.if exists(lib/csu/${MACHINE}.pcc)
67274351Sru_csu=lib/csu/${MACHINE}.pcc
673287084Sbapt.else
674287084Sbapt_csu=lib/csu/${MACHINE}
67520253Sjoerg.endif
67620253Sjoerg
67720253Sjoerg.if !defined(NOSECURE) && !defined(NOCRYPT)
67820253Sjoerg_libcrypt=	secure/lib/libcrypt lib/libcrypt
67920253Sjoerg.else
68030259Scharnier_libcrypt=	lib/libcrypt
68120253Sjoerg.endif
68230259Scharnier
68320253Sjoerg.if defined(WANT_CSRG_LIBM)
68430259Scharnier_libm=	lib/libm
68520253Sjoerg.else
68630259Scharnier_libm=	lib/msun
68720253Sjoerg.endif
68820253Sjoerg
68920253Sjoerg#
69020253Sjoerg# bootstrap-libraries - build just enough libraries for the bootstrap
69120253Sjoerg# tools, and install them under ${WORLDTMP}.
69220253Sjoerg#
69320253Sjoerg# Build csu and libgcc early so that some tools get linked to the new
69430259Scharnier# versions (too late for the main tools, however).  Then build the
695287084Sbapt# necessary prerequisite libraries (libtermcap just needs to be before
696287084Sbapt# libcurses, and this only matters for the NOCLEAN case when NOPIC is
697287084Sbapt# not set).
698287084Sbapt#
699287084Sbapt# This is mostly wrong.  The build tools must run on the host system,
70020253Sjoerg# so they should use host libraries.  We depend on the target being
70120253Sjoerg# similar enough to the host for new target libraries to work on the
70220253Sjoerg# host.
70320253Sjoerg#
70420253Sjoergbootstrap-libraries:
70521330Sdavidn.for _lib in ${_csu} gnu/usr.bin/cc/libgcc lib/libtermcap \
70699968Scharnier    gnu/lib/libregex gnu/lib/libreadline lib/libc \
70799968Scharnier    ${_libcrypt} lib/libcurses lib/libedit ${_libm} \
70899968Scharnier    lib/libmd lib/libutil lib/libz usr.bin/lex/lib
70921330Sdavidn.if exists(${.CURDIR}/${_lib})
71021330Sdavidn	cd ${.CURDIR}/${_lib}; \
71199968Scharnier		${MAKE} ${MK_FLAGS} ${_DEPEND}; \
71299968Scharnier		${MAKE} ${MK_FLAGS} all; \
71399968Scharnier		${MAKE} ${MK_FLAGS} -B install ${CLEANDIR} ${OBJDIR}
71499968Scharnier.endif
71599968Scharnier.endfor
71620253Sjoerg
71720253Sjoerg#
71820253Sjoerg# libraries - build all libraries, and install them under ${DESTDIR}.
71920253Sjoerg#
720287084Sbapt# The ordering is not as special as for bootstrap-libraries.  Build
72157673Ssheldonh# the prerequisites first, then build almost everything else in
72274351Sru# alphabetical order.
72320253Sjoerg#
72474351Srulibraries:
72520269Sjoerg.for _lib in lib/libcom_err ${_libcrypt} ${_libm} lib/libmytinfo \
72620269Sjoerg    lib/libncurses lib/libtermcap \
72720269Sjoerg    gnu/lib gnu/usr.bin/cc/libgcc lib usr.bin/lex/lib usr.sbin/pcvt/keycap
72820253Sjoerg.if exists(${.CURDIR}/${_lib})
72920253Sjoerg	cd ${.CURDIR}/${_lib}; ${MAKE} all; ${MAKE} -B install
73030259Scharnier.endif
73120253Sjoerg.endfor
73299968Scharnier.if exists(${.CURDIR}/secure/lib) && !defined(NOCRYPT) && !defined(NOSECURE)
73399968Scharnier	cd ${.CURDIR}/secure/lib; ${MAKE} all; ${MAKE} -B install
73499968Scharnier.endif
735287084Sbapt.if exists(${.CURDIR}/kerberosIV/lib) && !defined(NOCRYPT) && \
736287084Sbapt    defined(MAKE_KERBEROS4)
73720253Sjoerg	cd ${.CURDIR}/kerberosIV/lib; ${MAKE} all; ${MAKE} -B install
73820253Sjoerg.endif
73920253Sjoerg
74020253Sjoerg#
74120253Sjoerg# Exclude unused tools from build-tools.
74220253Sjoerg#
74320253Sjoerg.if !defined(NOGAMES) && exists(${.CURDIR}/games)
74420265Smpp_adventure=	games/adventure
74520253Sjoerg_caesar=	games/caesar
74620253Sjoerg_hack=		games/hack
747287084Sbapt_phantasia=	games/phantasia
748287084Sbapt_strfile=	games/fortune/strfile
74920253Sjoerg.endif
75020253Sjoerg.if !defined(NOPERL)
751287084Sbapt_perl=		gnu/usr.bin/perl/perl
752287084Sbapt.endif
75320253Sjoerg.if !defined(NOSHARE) && exists(${.CURDIR}/share)
75420253Sjoerg_scrnmaps=	share/syscons/scrnmaps
755228795Seadler.endif
756228795Seadler.if !defined(NOLKM) && exists(${.CURDIR}/lkm)
757228795Seadler_linux=		lkm/linux
758287084Sbapt.endif
759228795Seadler
760287084SbaptBTMAKEFLAGS=	${MK_FLAGS} -D_BUILD_TOOLS
761228795Seadler
762228795Seadler#
763228795Seadler# build-tools - build and install any other tools needed to complete the
764228795Seadler# compile and install.
765228795Seadler# ifdef stale
76620253Sjoerg# bc and cpp are required to build groff.  Otherwise, the order here is
76720253Sjoerg# mostly historical, i.e., bogus.
76820253Sjoerg# chmod is used to build gcc's tmpmultilib[2] at obscure times.
76920253Sjoerg# endif stale
77020253Sjoerg# XXX uname is a bug - the target should not depend on the host.
77120253Sjoerg#
77220253Sjoergbuild-tools:
77374351Sru.for d in				\
77420269Sjoerg		bin/cat 		\
77530259Scharnier		bin/chmod		\
77620253Sjoerg		bin/cp 			\
77793865Sdd		bin/date		\
77893865Sdd		bin/dd			\
77993865Sdd		bin/echo		\
78020253Sjoerg		bin/expr		\
78174351Sru		bin/hostname		\
78220269Sjoerg		bin/ln			\
78393866Sdd		bin/ls			\
78493866Sdd		bin/mkdir		\
78593866Sdd		bin/mv			\
78693866Sdd		bin/rm			\
78793866Sdd		bin/test		\
78820253Sjoerg		${_caesar}		\
78920269Sjoerg		${_strfile}		\
79020269Sjoerg		gnu/usr.bin/awk		\
79120269Sjoerg		gnu/usr.bin/bc		\
79220269Sjoerg		gnu/usr.bin/grep	\
79320269Sjoerg		gnu/usr.bin/groff	\
79468965Sru		gnu/usr.bin/gzip	\
79520253Sjoerg		gnu/usr.bin/man/makewhatis	\
79620253Sjoerg		gnu/usr.bin/patch	\
79779755Sdd		${_perl}		\
79820253Sjoerg		gnu/usr.bin/sort	\
79974351Sru		gnu/usr.bin/texinfo	\
80020269Sjoerg		usr.bin/basename	\
80120269Sjoerg		usr.bin/cap_mkdb	\
80220253Sjoerg		usr.bin/chflags		\
80320269Sjoerg		usr.bin/cmp		\
804287084Sbapt		usr.bin/col		\
805287084Sbapt		usr.bin/colldef		\
806287084Sbapt		usr.bin/cpp		\
807287084Sbapt		usr.bin/expand		\
80830259Scharnier		usr.bin/file2c		\
809287084Sbapt		usr.bin/find		\
810287084Sbapt		usr.bin/gencat		\
811287084Sbapt		usr.bin/id		\
81220253Sjoerg		usr.bin/join		\
813287084Sbapt		usr.bin/lorder		\
814287084Sbapt		usr.bin/m4		\
815287084Sbapt		usr.bin/mkdep		\
81630259Scharnier		usr.bin/mklocale	\
817287084Sbapt		usr.bin/paste		\
818287084Sbapt		usr.bin/sed		\
819287084Sbapt		${_aout_size}		\
820287084Sbapt		usr.bin/soelim		\
821287084Sbapt		usr.bin/symorder	\
82220253Sjoerg		usr.bin/touch		\
82320269Sjoerg		usr.bin/tr		\
82420269Sjoerg		usr.bin/true		\
82520269Sjoerg		usr.bin/uname		\
82620269Sjoerg		usr.bin/uuencode	\
82720269Sjoerg		usr.bin/vgrind		\
82839454Sjkoshy		usr.bin/vi		\
82920269Sjoerg		usr.bin/wc		\
83020269Sjoerg		usr.bin/xargs		\
83120269Sjoerg		usr.bin/yacc		\
83220269Sjoerg		usr.sbin/chown		\
83320269Sjoerg		usr.sbin/mtree		\
83420269Sjoerg		usr.sbin/zic		\
83520269Sjoerg		bin/sh
83674351Sru	cd ${.CURDIR}/$d; ${MAKE} ${BTMAKEFLAGS} ${_DEPEND}; \
83720269Sjoerg		${MAKE} ${BTMAKEFLAGS} all; \
83820269Sjoerg		${MAKE} ${BTMAKEFLAGS} -B install ${CLEANDIR} ${OBJDIR}
83933354Ssteve.endfor
84020269Sjoerg.if !defined(NOGAMES) && exists(${.CURDIR}/games)
84133354Ssteve	cd ${DESTDIR}/usr/games; cp -p caesar strfile ${DESTDIR}/usr/bin
84233354Ssteve.endif
843176474Sscf.for d in				\
844176474Sscf		bin/sh			\
845176474Sscf		${_adventure}		\
846176474Sscf		${_hack}		\
847176474Sscf		${_phantasia}		\
848176474Sscf		gnu/usr.bin/cc/cc_tools	\
849176474Sscf		lib/libmytinfo		\
850176474Sscf		${_linux}		\
851176474Sscf		${_scrnmaps}		\
85220253Sjoerg		sys/i386/boot/netboot
85320253Sjoerg	cd ${.CURDIR}/$d; ${MAKE} ${BTMAKEFLAGS} build-tools
85420253Sjoerg.endfor
85520253Sjoerg	cd ${.CURDIR}/usr.bin/tn3270/tools; ${MAKE} ${BTMAKEFLAGS} all
85674351Sru
85733354Ssteve.for __target in clean cleandepend cleandir depend obj
858287084Sbapt.for entry in ${SUBDIR}
859287084Sbapt${entry}.${__target}__D: .PHONY
86020253Sjoerg	@if test -d ${.CURDIR}/${entry}.${MACHINE}; then \
86120253Sjoerg		${ECHODIR} "===> ${DIRPRFX}${entry}.${MACHINE}"; \
86220253Sjoerg		edir=${entry}.${MACHINE}; \
86320253Sjoerg		cd ${.CURDIR}/$${edir}; \
86433354Ssteve	else \
86520269Sjoerg		${ECHODIR} "===> ${DIRPRFX}${entry}"; \
866287084Sbapt		edir=${entry}; \
86720253Sjoerg		cd ${.CURDIR}/$${edir}; \
868287084Sbapt	fi; \
869287084Sbapt	${MAKE} ${__target} DIRPRFX=${DIRPRFX}$${edir}/
870287084Sbapt.endfor
87120253Sjoergpar-${__target}: ${SUBDIR:S/$/.${__target}__D/}
87220253Sjoerg.endfor
87320253Sjoerg
87420253Sjoerg.endif
87520253Sjoerg
87620253Sjoerg.include <bsd.subdir.mk>
87720253Sjoerg