Makefile.inc1 revision 117376
125723Stegge#
225723Stegge# $FreeBSD: head/Makefile.inc1 117376 2003-07-10 05:29:56Z kris $
325723Stegge#
425723Stegge# Make command line options:
525723Stegge#	-DNO_KERBEROS Do not build Heimdal (Kerberos 5)
625723Stegge#	-DNOCLEANDIR run ${MAKE} clean, instead of ${MAKE} cleandir
725723Stegge#	-DNOCLEAN do not clean at all
825723Stegge#	-DNOCRYPT will prevent building of crypt versions
925723Stegge#	-DNOMAN do not build the manual pages
1025723Stegge#	-DNOPROFILE do not build profiled libraries
1125723Stegge#	-DNOGAMES do not go into games subdir
1225723Stegge#	-DNOSHARE do not go into share subdir
1325723Stegge#	-DNOINFO do not make or install info files
1425723Stegge#	-DNOLIBC_R do not build libc_r.
1525723Stegge#	-DNO_FORTRAN do not build g77 and related libraries.
1625723Stegge#	-DNO_KERNELCONFIG do not run config in ${MAKE} buildkernel
1725723Stegge#	-DNO_KERNELCLEAN do not run ${MAKE} clean in ${MAKE} buildkernel
1825723Stegge#	-DNO_KERNELDEPEND do not run ${MAKE} depend in ${MAKE} buildkernel
1925723Stegge#	-DNO_PORTSUPDATE do not update ports in ${MAKE} update
2025723Stegge#	-DNO_DOCUPDATE do not update doc in ${MAKE} update
2125723Stegge#	LOCAL_DIRS="list of dirs" to add additional dirs to the SUBDIR list
2225723Stegge#	TARGET_ARCH="arch" to crossbuild world to a different arch
2325723Stegge
2425723Stegge#
2525723Stegge# The intended user-driven targets are:
2625723Stegge# buildworld  - rebuild *everything*, including glue to help do upgrades
2725723Stegge# installworld- install everything built by "buildworld"
2825723Stegge# update      - convenient way to update your source tree (eg: sup/cvs)
2925723Stegge# most        - build user commands, no libraries or include files
3025723Stegge# installmost - install user commands, no libraries or include files
3125723Stegge#
3225723Stegge# Standard targets (not defined here) are documented in the makefiles in
3325723Stegge# /usr/share/mk.  These include:
3425723Stegge#		obj depend all install clean cleandepend cleanobj
3525723Stegge
3625723Stegge# Put initial settings here.
3725723SteggeSUBDIR=
3825723Stegge
3925723Stegge# We must do share/info early so that installation of info `dir'
4025723Stegge# entries works correctly.  Do it first since it is less likely to
4125723Stegge# grow dependencies on include and lib than vice versa.
4225723Stegge.if exists(${.CURDIR}/share/info)
4383651SpeterSUBDIR+= share/info
4483651Speter.endif
4583651Speter
46131840Sbrian.if exists(${.CURDIR}/include)
47131840SbrianSUBDIR+= include
4825723Stegge.endif
4925723Stegge.if exists(${.CURDIR}/lib)
5025723SteggeSUBDIR+= lib
5125723Stegge.endif
5267834Stegge
5325723Stegge.if exists(${.CURDIR}/bin)
5425723SteggeSUBDIR+= bin
5588743Srwatson.endif
5625723Stegge.if exists(${.CURDIR}/games) && !defined(NOGAMES)
5725723SteggeSUBDIR+= games
5892219Sluigi.endif
5934924Sbde.if exists(${.CURDIR}/gnu)
6025723SteggeSUBDIR+= gnu
6125723Stegge.endif
6225723Stegge.if exists(${.CURDIR}/kerberos5) && exists(${.CURDIR}/crypto) && \
6325723Stegge    !defined(NOCRYPT) && !defined(NO_OPENSSL) && !defined(NO_KERBEROS)
6425723SteggeSUBDIR+= kerberos5
6525723Stegge.endif
6625723Stegge.if exists(${.CURDIR}/libexec)
6725723SteggeSUBDIR+= libexec
68122698Salfred.endif
69122698Salfred.if exists(${.CURDIR}/rescue) && defined(RESCUE)
7025723SteggeSUBDIR+= rescue
7125723Stegge.endif
7283651Speter.if exists(${.CURDIR}/sbin)
7383651SpeterSUBDIR+= sbin
7483651Speter.endif
7525723Stegge.if exists(${.CURDIR}/secure) && !defined(NOCRYPT)
7625723SteggeSUBDIR+= secure
7725723Stegge.endif
7832609Stegge.if exists(${.CURDIR}/share) && !defined(NOSHARE)
7925723SteggeSUBDIR+= share
8067834Stegge.endif
8167834Stegge.if exists(${.CURDIR}/sys)
8267834SteggeSUBDIR+= sys
8367834Stegge.endif
8425723Stegge.if exists(${.CURDIR}/usr.bin)
8525723SteggeSUBDIR+= usr.bin
8625723Stegge.endif
8725723Stegge.if exists(${.CURDIR}/usr.sbin)
8825723SteggeSUBDIR+= usr.sbin
8925723Stegge.endif
9025723Stegge
9125723Stegge# etc must be last for "distribute" to work
9225723Stegge.if exists(${.CURDIR}/etc)
9325723SteggeSUBDIR+= etc
9467531Stegge.endif
9567531Stegge
9667531Stegge# These are last, since it is nice to at least get the base system
9767531Stegge# rebuilt before you do them.
9867531Stegge.if defined(LOCAL_DIRS)
9967531Stegge.for _DIR in ${LOCAL_DIRS}
10067531Stegge.if exists(${.CURDIR}/${_DIR}) && exists(${.CURDIR}/${_DIR}/Makefile)
10167531SteggeSUBDIR+= ${_DIR}
10267531Stegge.endif
10367531Stegge.endfor
10467531Stegge.endif
10567531Stegge
10667531Stegge.if defined(SUBDIR_OVERRIDE)
10767531SteggeSUBDIR=		${SUBDIR_OVERRIDE}
10888680Sambrisko.endif
10925723Stegge
11025723Stegge.if defined(NOCLEANDIR)
11167834SteggeCLEANDIR=	clean cleandepend
11267834Stegge.else
11367834SteggeCLEANDIR=	cleandir
11467834Stegge.endif
11567834Stegge
11667834SteggeCVS?=		cvs
11767834SteggeSUP?=		/usr/local/bin/cvsup
11867834SteggeSUPFLAGS?=	-g -L 2 -P -
11967834Stegge.if defined(SUPHOST)
12067834SteggeSUPFLAGS+=	-h ${SUPHOST}
12167834Stegge.endif
12267834Stegge
12367834SteggeMAKEOBJDIRPREFIX?=	/usr/obj
12467834Stegge.if !defined(OSRELDATE)
12567834SteggeOSRELDATE!=	awk '/^\#define[[:space:]]*__FreeBSD_version/ { print $$3 }' \
12667834Stegge		/usr/include/osreldate.h
12767834Stegge.endif
12867834SteggeTARGET_ARCH?=	${MACHINE_ARCH}
12967834Stegge.if ${TARGET_ARCH} == ${MACHINE_ARCH}
13067834SteggeTARGET?=	${MACHINE}
13167834SteggeTARGET_CPUTYPE?=${CPUTYPE}
13267834Stegge.else
13367834SteggeTARGET?=	${TARGET_ARCH}
13471915SteggeTARGET_CPUTYPE?=
13571915Stegge.endif
13667834Stegge.if !empty(TARGET_CPUTYPE)
13767834Stegge_TARGET_CPUTYPE=${TARGET_CPUTYPE}
13871915Stegge.else
13967834Stegge_TARGET_CPUTYPE=dummy
14071915Stegge.endif
14171915Stegge_CPUTYPE!=	${MAKE} -f /dev/null -m ${.CURDIR}/share/mk \
14271915Stegge		CPUTYPE=${_TARGET_CPUTYPE} -V CPUTYPE
14367834Stegge.if ${_CPUTYPE} != ${_TARGET_CPUTYPE}
14467834Stegge.error CPUTYPE global should be set with ?=.
14567834Stegge.endif
14667834Stegge.if make(buildworld)
14767834SteggeBUILD_ARCH!=	sysctl -n hw.machine_arch
14867834Stegge.if ${MACHINE_ARCH} != ${BUILD_ARCH}
14967834Stegge.error To cross-build, set TARGET_ARCH.
15067834Stegge.endif
15167834Stegge.endif
15267834Stegge.if ${MACHINE} == ${TARGET}
15367834SteggeOBJTREE=	${MAKEOBJDIRPREFIX}
15467834Stegge.else
15567834SteggeOBJTREE=	${MAKEOBJDIRPREFIX}/${TARGET}
15667834Stegge.endif
15767834SteggeWORLDTMP=	${OBJTREE}${.CURDIR}/${MACHINE_ARCH}
15867834Stegge# /usr/games added for fortune which depend on strfile
15967834SteggeBPATH=		${WORLDTMP}/legacy/usr/sbin:${WORLDTMP}/legacy/usr/bin:${WORLDTMP}/legacy/usr/games
16067834SteggeXPATH=		${WORLDTMP}/usr/sbin:${WORLDTMP}/usr/bin:${WORLDTMP}/usr/games
16167834SteggeSTRICTTMPPATH=	${BPATH}:${XPATH}
16267834SteggeTMPPATH=	${STRICTTMPPATH}:${PATH}
16367834Stegge
16467834SteggeINSTALLTMP!=	/usr/bin/mktemp -d -u -t install
16567834Stegge
16667834Stegge#
16767834Stegge# Building a world goes through the following stages
16867834Stegge#
16967834Stegge# 1. legacy stage [BMAKE]
17067834Stegge#	This stage is responsible for creating compatibility
17167834Stegge#	shims that are needed by the bootstrap-tools,
17225723Stegge#	build-tools and cross-tools stages.
17325723Stegge# 1. bootstrap-tools stage [BMAKE]
17425723Stegge#	This stage is responsible for creating programs that
17567834Stegge#	are needed for backward compatibility reasons. They
17667834Stegge#	are not built as cross-tools.
17767834Stegge# 2. build-tools stage [TMAKE]
17867834Stegge#	This stage is responsible for creating the object
17967834Stegge#	tree and building any tools that are needed during
18067834Stegge#	the build process.
18167834Stegge# 3. cross-tools stage [XMAKE]
18267834Stegge#	This stage is responsible for creating any tools that
18367834Stegge#	are needed for cross-builds. A cross-compiler is one
18467834Stegge#	of them.
18567834Stegge# 4. world stage [WMAKE]
18667834Stegge#	This stage actually builds the world.
18767834Stegge# 5. install stage (optional) [IMAKE]
18867834Stegge#	This stage installs a previously built world.
18967834Stegge#
19067834Stegge
19167834SteggeBOOTSTRAPPING?=	0
19267834Stegge
19367834Stegge# Common environment for world related stages
19467834SteggeCROSSENV=	MAKEOBJDIRPREFIX=${OBJTREE} \
19567834Stegge		MACHINE_ARCH=${TARGET_ARCH} \
19667834Stegge		MACHINE=${TARGET} \
19792219Sluigi		CPUTYPE=${TARGET_CPUTYPE} \
19867834Stegge		GROFF_BIN_PATH=${WORLDTMP}/legacy/usr/bin \
19971915Stegge		GROFF_FONT_PATH=${WORLDTMP}/legacy/usr/share/groff_font \
20071915Stegge		GROFF_TMAC_PATH=${WORLDTMP}/legacy/usr/share/tmac
20171915Stegge
20271915Stegge# bootstrap-tools stage
20371915SteggeBMAKEENV=	DESTDIR= \
20496825Sambrisko		INSTALL="sh ${.CURDIR}/tools/install.sh" \
20596825Sambrisko		PATH=${BPATH}:${PATH} \
20671915Stegge		WORLDTMP=${WORLDTMP} \
20771915Stegge		MAKEFLAGS="-m ${.CURDIR}/tools/build/mk ${.MAKEFLAGS}"
20871915SteggeBMAKE=		MAKEOBJDIRPREFIX=${WORLDTMP} \
20971915Stegge		${BMAKEENV} ${MAKE} -f Makefile.inc1 \
21071915Stegge		BOOTSTRAPPING=${OSRELDATE} \
21171915Stegge		-DNOHTML -DNOINFO -DNOLINT -DNOMAN -DNOPIC -DNOPROFILE \
21292219Sluigi		-DNOSHARED -DNO_CPU_CFLAGS -DNO_WARNS
21392219Sluigi
21492219Sluigi# build-tools stage
21592219SluigiTMAKE=		MAKEOBJDIRPREFIX=${OBJTREE} \
21625723Stegge		${BMAKEENV} ${MAKE} -f Makefile.inc1 \
21783651Speter		BOOTSTRAPPING=${OSRELDATE} -DNOLINT -DNO_CPU_CFLAGS -DNO_WARNS
21883651Speter
219126888Sbrooks# cross-tools stage
220126888SbrooksXMAKE=		TOOLS_PREFIX=${WORLDTMP} ${BMAKE} -DNO_FORTRAN -DNO_GDB
22183651Speter
222126888Sbrooks# world stage
22383651SpeterWMAKEENV=	${CROSSENV} \
22483651Speter		DESTDIR=${WORLDTMP} \
22583651Speter		INSTALL="sh ${.CURDIR}/tools/install.sh" \
22683651Speter		PATH=${TMPPATH}
22783651SpeterWMAKE=		${WMAKEENV} ${MAKE} -f Makefile.inc1
22883651Speter
22983651Speter# install stage
230118639SbillfIMAKEENV=	${CROSSENV} \
23183651Speter		PATH=${STRICTTMPPATH}:${INSTALLTMP}
23283651SpeterIMAKE=		${IMAKEENV} ${MAKE} -f Makefile.inc1
23367834Stegge
23483651Speter# kernel stage
23567834SteggeKMAKEENV=	${WMAKEENV}
23683651Speter
23725723Stegge#
23825723Stegge# buildworld
23983651Speter#
24025723Stegge# Attempt to rebuild the entire system, with reasonable chance of
24125723Stegge# success, regardless of how old your existing system is.
24225723Stegge#
24325723Stegge_worldtmp:
24467834Stegge.if ${.CURDIR:C/[^,]//g} != ""
24525723Stegge#	The m4 build of sendmail files doesn't like it if ',' is used
24625723Stegge#	anywhere in the path of it's files.
24725723Stegge	@echo
24883651Speter	@echo "*** Error: path to source tree contains a comma ','"
24983651Speter	@echo
25025723Stegge	@false
25183651Speter.endif
25283651Speter	@echo
25325723Stegge	@echo "--------------------------------------------------------------"
25483651Speter	@echo ">>> Rebuilding the temporary build tree"
25583651Speter	@echo "--------------------------------------------------------------"
25625723Stegge.if !defined(NOCLEAN)
25783651Speter	rm -rf ${WORLDTMP}
25883651Speter.else
25983651Speter	rm -rf ${WORLDTMP}/legacy/usr/include
26067834Stegge	# XXX - These two can depend on any header file.
26183651Speter	rm -f ${OBJTREE}${.CURDIR}/usr.bin/kdump/ioctl.c
26283651Speter	rm -f ${OBJTREE}${.CURDIR}/usr.bin/truss/ioctl.c
26367834Stegge.endif
26471915Stegge.for _dir in \
26571915Stegge    usr/bin usr/games usr/include/sys usr/lib \
26671915Stegge    usr/libexec usr/sbin usr/share/dict \
26771915Stegge    usr/share/groff_font/devX100 \
26867834Stegge    usr/share/groff_font/devX100-12 \
26967834Stegge    usr/share/groff_font/devX75 \
27067834Stegge    usr/share/groff_font/devX75-12 \
27167834Stegge    usr/share/groff_font/devascii \
27283651Speter    usr/share/groff_font/devcp1047 \
27367834Stegge    usr/share/groff_font/devdvi \
27467834Stegge    usr/share/groff_font/devhtml \
27567834Stegge    usr/share/groff_font/devkoi8-r \
27667834Stegge    usr/share/groff_font/devlatin1 \
27767834Stegge    usr/share/groff_font/devlbp \
27867834Stegge    usr/share/groff_font/devlj4 \
27967834Stegge    usr/share/groff_font/devps \
28025723Stegge    usr/share/groff_font/devutf8 \
28167531Stegge    usr/share/tmac/mdoc usr/share/tmac/mm
28283651Speter	mkdir -p ${WORLDTMP}/legacy/${_dir}
28325723Stegge.endfor
28483651Speter.for _dir in \
28567531Stegge    usr/bin usr/include usr/lib/compat/aout usr/libdata/ldscripts \
28667531Stegge    usr/libexec usr/share/misc
28767531Stegge	mkdir -p ${WORLDTMP}/${_dir}
28867531Stegge.endfor
28967531Stegge	mtree -deU -f ${.CURDIR}/etc/mtree/BSD.include.dist \
29067531Stegge	    -p ${WORLDTMP}/usr/include
29167531Stegge	ln -sf ${.CURDIR}/sys ${WORLDTMP}
29267531Stegge_legacy:
29383651Speter	@echo
29467531Stegge	@echo "--------------------------------------------------------------"
29567834Stegge	@echo ">>> stage 1: legacy release compatibility shims"
29667834Stegge	@echo "--------------------------------------------------------------"
29767531Stegge	cd ${.CURDIR}; ${BMAKE} legacy
29867531Stegge_bootstrap-tools:
29967834Stegge	@echo
30067834Stegge	@echo "--------------------------------------------------------------"
30167531Stegge	@echo ">>> stage 1: bootstrap tools"
30267531Stegge	@echo "--------------------------------------------------------------"
30367531Stegge	cd ${.CURDIR}; ${BMAKE} bootstrap-tools
30467531Stegge_cleanobj:
30567531Stegge.if !defined(NOCLEAN)
30667531Stegge	@echo
30767531Stegge	@echo "--------------------------------------------------------------"
30883651Speter	@echo ">>> stage 2: cleaning up the object tree"
30967531Stegge	@echo "--------------------------------------------------------------"
31067531Stegge	cd ${.CURDIR}; ${WMAKE} ${CLEANDIR:S/^/par-/}
31167531Stegge.endif
31267531Stegge_obj:
31367531Stegge	@echo
31467531Stegge	@echo "--------------------------------------------------------------"
31567531Stegge	@echo ">>> stage 2: rebuilding the object tree"
31667531Stegge	@echo "--------------------------------------------------------------"
31767531Stegge	cd ${.CURDIR}; ${WMAKE} par-obj
31867531Stegge_build-tools:
31967531Stegge	@echo
32067531Stegge	@echo "--------------------------------------------------------------"
32125723Stegge	@echo ">>> stage 2: build tools"
32225723Stegge	@echo "--------------------------------------------------------------"
32367531Stegge	cd ${.CURDIR}; ${TMAKE} build-tools
32467531Stegge_cross-tools:
32525723Stegge	@echo
32683651Speter	@echo "--------------------------------------------------------------"
32767531Stegge	@echo ">>> stage 3: cross tools"
32867531Stegge	@echo "--------------------------------------------------------------"
32967531Stegge	cd ${.CURDIR}; ${XMAKE} cross-tools
33067531Stegge_includes:
33167531Stegge	@echo
33225723Stegge	@echo "--------------------------------------------------------------"
33325723Stegge	@echo ">>> stage 4: populating ${WORLDTMP}/usr/include"
33467531Stegge	@echo "--------------------------------------------------------------"
33567531Stegge	cd ${.CURDIR}; ${WMAKE} SHARED=symlinks par-includes
33625723Stegge_libraries:
33783651Speter	@echo
33867531Stegge	@echo "--------------------------------------------------------------"
33967531Stegge	@echo ">>> stage 4: building libraries"
34067531Stegge	@echo "--------------------------------------------------------------"
34167531Stegge	cd ${.CURDIR}; ${WMAKE} -DNOHTML -DNOINFO -DNOMAN -DNOFSCHG libraries
34267531Stegge_depend:
34367531Stegge	@echo
34467531Stegge	@echo "--------------------------------------------------------------"
34567531Stegge	@echo ">>> stage 4: make dependencies"
346121816Sbrooks	@echo "--------------------------------------------------------------"
34725723Stegge	cd ${.CURDIR}; ${WMAKE} par-depend
34867531Steggeeverything:
34967531Stegge	@echo
35067531Stegge	@echo "--------------------------------------------------------------"
35125723Stegge	@echo ">>> stage 4: building everything.."
35283651Speter	@echo "--------------------------------------------------------------"
35367531Stegge	cd ${.CURDIR}; ${WMAKE} par-all
35467534Stegge
35567531Stegge
35667531SteggeWMAKE_TGTS=
35767531Stegge.if !defined(SUBDIR_OVERRIDE)
35867531SteggeWMAKE_TGTS+=	_worldtmp _legacy _bootstrap-tools
35967531Stegge.endif
36067531SteggeWMAKE_TGTS+=	_cleanobj _obj _build-tools
36167534Stegge.if !defined(SUBDIR_OVERRIDE)
36267534SteggeWMAKE_TGTS+=	_cross-tools
36367531Stegge.endif
36467531SteggeWMAKE_TGTS+=	_includes _libraries _depend everything
36567531Stegge
36625723Steggebuildworld: ${WMAKE_TGTS}
36725723Stegge.ORDER: ${WMAKE_TGTS}
36867531Stegge
36967531Stegge#
37025723Stegge# installcheck
37183651Speter#
37267531Stegge# Checks to be sure system is ready for installworld
373108250Shsu#
37467531Steggeinstallcheck:
375108250Shsu.if !defined(NO_SENDMAIL)
37625723Stegge	@if ! `id -u smmsp > /dev/null`; then \
37725723Stegge		echo "ERROR: Required smmsp user is missing, see /usr/src/UPDATING."; \
37867531Stegge		false; \
37967834Stegge	fi
38067834Stegge	@if ! `id -g smmsp > /dev/null`; then \
38183651Speter		echo "ERROR: Required smmsp group is missing, see /usr/src/UPDATING."; \
382121816Sbrooks		false; \
383121816Sbrooks	fi
38467834Stegge.endif
38567834Stegge.if ${TARGET_ARCH} == ${MACHINE_ARCH} && !defined(DISTDIR) && \
38667834Stegge    (!defined(DESTDIR) || empty(DESTDIR) || ${DESTDIR} == "/")
38767834Stegge	@echo "Checking to see if your booted kernel is fresh enough.."
38867834Stegge	${.OBJDIR}/bin/sh/sh -c \
38967834Stegge	    'echo "Testing installed kernel for new sigaction(2) syscall"'
39067834Stegge	@echo "Seems ok.."
39167834Stegge.endif
39267834Stegge
39367531Stegge#
39425723Stegge# distributeworld
39567531Stegge#
39667531Stegge# Distributes everything compiled by a `buildworld'.
39783651Speter#
39867531Stegge# installworld
399108172Shsu#
40067531Stegge# Installs everything compiled by a 'buildworld'.
40167531Stegge#
40267834Steggedistributeworld installworld: installcheck
40367531Stegge	mkdir -p ${INSTALLTMP}
40467531Stegge	for prog in [ awk cap_mkdb cat chflags chmod chown \
40567834Stegge	    date echo egrep find grep \
40667834Stegge	    ln make mkdir mtree mv pwd_mkdb rm sed sh sysctl \
40767834Stegge	    test true uname wc zic; do \
40825723Stegge		cp `which $$prog` ${INSTALLTMP}; \
409108172Shsu	done
41025723Stegge	cd ${.CURDIR}; ${IMAKE} re${.TARGET:S/world$//}
41167834Stegge	rm -rf ${INSTALLTMP}
41225723Stegge
41367834Stegge#
41467834Stegge# reinstall
41567834Stegge#
41683651Speter# If you have a build server, you can NFS mount the source and obj directories
41767834Stegge# and do a 'make reinstall' on the *client* to install new binaries from the
41867834Stegge# most recent server build.
41967834Stegge#
42067834Steggereinstall:
42167834Stegge	@echo "--------------------------------------------------------------"
42267834Stegge	@echo ">>> Making hierarchy"
42367834Stegge	@echo "--------------------------------------------------------------"
424118639Sbillf	cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 hierarchy
42567834Stegge	@echo
42667834Stegge	@echo "--------------------------------------------------------------"
42767834Stegge	@echo ">>> Installing everything.."
42867834Stegge	@echo "--------------------------------------------------------------"
429118639Sbillf	cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 install
43067834Stegge.if !defined(NOMAN) && !defined(NO_MAKEDB_RUN)
43167834Stegge	@echo
43283651Speter	@echo "--------------------------------------------------------------"
43367834Stegge	@echo ">>> Rebuilding man page indices"
43471915Stegge	@echo "--------------------------------------------------------------"
43571915Stegge	cd ${.CURDIR}/share/man; ${MAKE} makedb
43671915Stegge.endif
43771915Stegge
43871915Steggeredistribute:
43967834Stegge	@echo "--------------------------------------------------------------"
440118639Sbillf	@echo ">>> Distributing everything.."
441118639Sbillf	@echo "--------------------------------------------------------------"
442118639Sbillf	cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 distribute
443118639Sbillf
444118639Sbillf#
44567834Stegge# buildkernel and installkernel
44667834Stegge#
44771915Stegge# Which kernels to build and/or install is specified by setting
44871915Stegge# KERNCONF. If not defined a GENERIC kernel is built/installed.
44971915Stegge# Only the existing (depending TARGET) config files are used
45083651Speter# for building kernels and only the first of these is designated
45171915Stegge# as the one being installed.
45271915Stegge#
45371915Stegge# Note that we have to use TARGET instead of TARGET_ARCH when
45471915Stegge# we're in kernel-land. Since only TARGET_ARCH is (expected) to
45571915Stegge# be set to cross-build, we have to make sure TARGET is set
45671915Stegge# properly.
45771915Stegge
45871915Stegge.if !defined(KERNCONF) && defined(KERNEL)
45971915SteggeKERNCONF=	${KERNEL}
46083651SpeterKERNWARN=	yes
46171915Stegge.else
46271915SteggeKERNCONF?=	GENERIC
46371915Stegge.endif
46471915SteggeINSTKERNNAME?=	kernel
46571915Stegge
46671915SteggeKERNSRCDIR?=	${.CURDIR}/sys
46771915SteggeKRNLCONFDIR=	${KERNSRCDIR}/${TARGET}/conf
46871915SteggeKRNLOBJDIR=	${OBJTREE}${KERNSRCDIR}
46971915SteggeKERNCONFDIR?=	${KRNLCONFDIR}
47083651Speter
47171915SteggeBUILDKERNELS=
47271915SteggeINSTALLKERNEL=
47371915Stegge.for _kernel in ${KERNCONF}
47471915Stegge.if exists(${KERNCONFDIR}/${_kernel})
47571915SteggeBUILDKERNELS+=	${_kernel}
47671915Stegge.if empty(INSTALLKERNEL)
47733181SeivindINSTALLKERNEL= ${_kernel}
47867834Stegge.endif
47983651Speter.endif
48067834Stegge.endfor
48171915Stegge
48271915Stegge#
48383651Speter# buildkernel
48467834Stegge#
48567834Stegge# Builds all kernels defined by BUILDKERNELS.
48667834Stegge#
48767834Steggebuildkernel:
48867834Stegge.if empty(BUILDKERNELS)
48967834Stegge	@echo "ERROR: Missing kernel configuration file(s) (${KERNCONF}).";
49067834Stegge	@false
49167834Stegge.endif
49267834Stegge.if defined(KERNWARN)
49367834Stegge	@echo "--------------------------------------------------------------"
49467834Stegge	@echo ">>> WARNING: KERNEL= setting should be changed to KERNCONF="
49567834Stegge	@echo "--------------------------------------------------------------"
49667834Stegge	@sleep 3
49783651Speter.endif
49871915Stegge	@echo
49971915Stegge.for _kernel in ${BUILDKERNELS}
50071915Stegge	@echo "--------------------------------------------------------------"
50171915Stegge	@echo ">>> Kernel build for ${_kernel} started on `LC_ALL=C date`"
50271915Stegge	@echo "--------------------------------------------------------------"
50371915Stegge	@echo "===> ${_kernel}"
50483651Speter	mkdir -p ${KRNLOBJDIR}
50571915Stegge.if !defined(NO_KERNELCONFIG)
50671915Stegge	cd ${KRNLCONFDIR}; \
50771915Stegge		PATH=${TMPPATH} \
50871915Stegge		    config ${CONFIGARGS} -d ${KRNLOBJDIR}/${_kernel} \
50971915Stegge			${KERNCONFDIR}/${_kernel}
51071915Stegge.endif
51171915Stegge.if !defined(NOCLEAN) && !defined(NO_KERNELCLEAN)
51271915Stegge	cd ${KRNLOBJDIR}/${_kernel}; \
51371915Stegge	    ${KMAKEENV} ${MAKE} KERNEL=${INSTKERNNAME} ${CLEANDIR}
51471915Stegge.endif
51571915Stegge	cd ${KRNLOBJDIR}/${_kernel}; \
51671915Stegge	    MAKESRCPATH=${KERNSRCDIR}/dev/aic7xxx/aicasm \
51771915Stegge	    ${MAKE} -DNO_CPU_CFLAGS -f ${KERNSRCDIR}/dev/aic7xxx/aicasm/Makefile
51897211Speter	cd ${KRNLOBJDIR}/${_kernel}; \
51971915Stegge	    ${KMAKEENV} ${MAKE} KERNEL=${INSTKERNNAME} obj
52083651Speter# XXX - Gratuitously builds aicasm in the ``makeoptions NO_MODULES'' case.
52167834Stegge.if !defined(MODULES_WITH_WORLD) && !defined(NO_MODULES) && exists(${KERNSRCDIR}/modules)
52283651Speter.for target in obj depend all
52371915Stegge	cd ${.CURDIR}/sys/modules/aic7xxx/aicasm; \
52471915Stegge	    MAKEOBJDIRPREFIX=${KRNLOBJDIR}/${_kernel}/modules \
52571915Stegge	    ${MAKE} -DNO_CPU_CFLAGS ${target}
52671915Stegge.endfor
52767834Stegge.endif
52867834Stegge.if !defined(NO_KERNELDEPEND)
52967834Stegge	cd ${KRNLOBJDIR}/${_kernel}; \
53067834Stegge	    ${KMAKEENV} ${MAKE} KERNEL=${INSTKERNNAME} depend -DNO_MODULES_OBJ
53167834Stegge.endif
53267834Stegge	cd ${KRNLOBJDIR}/${_kernel}; \
53367834Stegge	    ${KMAKEENV} ${MAKE} KERNEL=${INSTKERNNAME} all -DNO_MODULES_OBJ
53483651Speter	@echo "--------------------------------------------------------------"
53583651Speter	@echo ">>> Kernel build for ${_kernel} completed on `LC_ALL=C date`"
53667834Stegge	@echo "--------------------------------------------------------------"
53783651Speter.endfor
53867834Stegge
53971915Stegge#
54071915Stegge# installkernel
54171915Stegge#
54271915Stegge# Install the kernel defined by INSTALLKERNEL
54371915Stegge#
54471915Steggeinstallkernel reinstallkernel installkernel.debug reinstallkernel.debug:
54571915Stegge.if empty(INSTALLKERNEL)
54671915Stegge	@echo "ERROR: No kernel \"${KERNCONF}\" to install."
54771915Stegge	@false
54871915Stegge.endif
54971915Stegge	cd ${KRNLOBJDIR}/${INSTALLKERNEL}; \
55083651Speter	    ${CROSSENV} PATH=${TMPPATH} \
55183651Speter	    ${MAKE} KERNEL=${INSTKERNNAME} ${.TARGET:S/kernel//}
55271915Stegge
55371915Stegge#
55471915Stegge# update
55571915Stegge#
55671915Stegge# Update the source tree, by running sup and/or running cvs to update to the
55771915Stegge# latest copy.
55871915Stegge#
55971915Steggeupdate:
56071915Stegge.if defined(SUP_UPDATE)
56171915Stegge	@echo "--------------------------------------------------------------"
56271915Stegge	@echo ">>> Running ${SUP}"
56383651Speter	@echo "--------------------------------------------------------------"
56467834Stegge.if defined(SUPFILE)
56567834Stegge	@${SUP} ${SUPFLAGS} ${SUPFILE}
56667834Stegge.endif
56767834Stegge.if defined(SUPFILE1)
56867834Stegge	@${SUP} ${SUPFLAGS} ${SUPFILE1}
56967834Stegge.endif
57067834Stegge.if defined(SUPFILE2)
57167834Stegge	@${SUP} ${SUPFLAGS} ${SUPFILE2}
57267834Stegge.endif
57367834Stegge.if defined(PORTSSUPFILE) && !defined(NO_PORTSUPDATE)
57467834Stegge	@${SUP} ${SUPFLAGS} ${PORTSSUPFILE}
57567834Stegge.endif
57667834Stegge.if defined(DOCSUPFILE) && !defined(NO_DOCUPDATE)
57783651Speter	@${SUP} ${SUPFLAGS} ${DOCSUPFILE}
57825723Stegge.endif
57925723Stegge.endif
58067834Stegge.if defined(CVS_UPDATE)
58125723Stegge	@echo "--------------------------------------------------------------"
58238482Swollman	@echo ">>> Updating ${.CURDIR} from cvs repository" ${CVSROOT}
58325723Stegge	@echo "--------------------------------------------------------------"
58467834Stegge	cd ${.CURDIR}; ${CVS} -R -q update -A -P -d
58567834Stegge.endif
58667834Stegge
58738482Swollman#
58867834Stegge# most
58967834Stegge#
59067834Stegge# Build most of the user binaries on the existing system libs and includes.
59171915Stegge#
59271915Steggemost:
59383651Speter	@echo "--------------------------------------------------------------"
594130554Srwatson	@echo ">>> Building programs only"
595122261Ssam	@echo "--------------------------------------------------------------"
59625723Stegge.for _dir in bin sbin libexec usr.bin usr.sbin gnu/usr.bin gnu/usr.sbin
59725723Stegge	cd ${.CURDIR}/${_dir};		${MAKE} DIRPRFX=${_dir}/ all
59825723Stegge.endfor
59991406Sjhb
60067834Stegge#
601116070Shsu# installmost
60283651Speter#
60338482Swollman# Install the binaries built by the 'most' target.  This does not include
60438482Swollman# libraries or include files.
60567834Stegge#
606120755Sjeffinstallmost:
60738482Swollman	@echo "--------------------------------------------------------------"
60838482Swollman	@echo ">>> Installing programs only"
60938482Swollman	@echo "--------------------------------------------------------------"
61038482Swollman.for _dir in bin sbin libexec usr.bin usr.sbin gnu/usr.bin gnu/usr.sbin
61183651Speter	cd ${.CURDIR}/${_dir};		${MAKE} DIRPRFX=${_dir}/ install
61267834Stegge.endfor
61367834Stegge
61425723Stegge#
61583651Speter# ------------------------------------------------------------------------
61625723Stegge#
61725723Stegge# From here onwards are utility targets used by the 'make world' and
61825723Stegge# related targets.  If your 'world' breaks, you may like to try to fix
61938482Swollman# the problem and manually run the following targets to attempt to
62067834Stegge# complete the build.  Beware, this is *not* guaranteed to work, you
62138482Swollman# need to have a pretty good grip on the current state of the system
62238482Swollman# to attempt to manually finish it.  If in doubt, 'make world' again.
62367834Stegge#
62467834Stegge
62567834Stegge#
62638482Swollman# legacy: Build compatibility shims for the next three targets
62725723Stegge#
62825723Steggelegacy:
62967834Stegge.for _tool in tools/build
63067834Stegge	@${ECHODIR} "===> ${_tool}"; \
63167834Stegge	    cd ${.CURDIR}/${_tool}; \
63267834Stegge	    ${MAKE} DIRPRFX=${_tool}/ obj; \
63367834Stegge	    ${MAKE} DIRPRFX=${_tool}/ DESTDIR=${MAKEOBJDIRPREFIX}/legacy includes; \
63467834Stegge	    ${MAKE} DIRPRFX=${_tool}/ depend; \
63567834Stegge	    ${MAKE} DIRPRFX=${_tool}/ all; \
63667834Stegge	    ${MAKE} DIRPRFX=${_tool}/ DESTDIR=${MAKEOBJDIRPREFIX}/legacy install
63767834Stegge.endfor
63867834Stegge
63967834Stegge#
64083651Speter# bootstrap-tools: Build tools needed for compatibility
64167834Stegge#
64225723Stegge.if exists(${.CURDIR}/games) && !defined(NOGAMES)
64325723Stegge_strfile=	games/fortune/strfile
64467834Stegge.endif
64567834Stegge
64625723Stegge.if !defined(NO_CXX)
64783366Sjulian_gperf=	gnu/usr.bin/gperf
64867834Stegge.if ${BOOTSTRAPPING} < 500113
64925723Stegge_groff=		gnu/usr.bin/groff
65025723Stegge.else
65125723Stegge_groff=		gnu/usr.bin/groff/tmac
65283651Speter.endif
65325723Stegge.endif
65425723Stegge
65525723Stegge.if ${BOOTSTRAPPING} < 450005 || \
65667834Stegge    ${BOOTSTRAPPING} >= 500000 && ${BOOTSTRAPPING} < 500034
65767834Stegge_uudecode=	usr.bin/uudecode
65825723Stegge.endif
65925723Stegge
66083651Speter.if ${BOOTSTRAPPING} < 430002 || \
66125723Stegge    ${BOOTSTRAPPING} >= 500000 && ${BOOTSTRAPPING} < 500019
66225723Stegge_xargs=		usr.bin/xargs
66325723Stegge.endif
66425723Stegge
66525723Stegge.if ${BOOTSTRAPPING} < 430002 || \
66625723Stegge    ${BOOTSTRAPPING} >= 500000 && ${BOOTSTRAPPING} < 500018
66767834Stegge_yacc=		usr.bin/yacc
66825723Stegge.endif
66983651Speter
67067834Stegge.if defined(RESCUE) && \
67167834Stegge    ${BOOTSTRAPPING} < 501100
67267834Stegge_crunchgen=	usr.sbin/crunch/crunchgen
67367834Stegge.endif
67467834Stegge
67567834Stegge.if ${BOOTSTRAPPING} < 500019
67671915Stegge_kbdcontrol=	usr.sbin/kbdcontrol
67767834Stegge.endif
67867834Stegge
67967834Steggebootstrap-tools:
68067834Stegge.for _tool in \
68167834Stegge    ${_strfile} \
68283651Speter    ${_gperf} \
68367834Stegge    ${_groff} \
68467834Stegge    gnu/usr.bin/texinfo \
68567834Stegge    usr.bin/colldef \
68667834Stegge    usr.bin/makewhatis \
68771915Stegge    usr.bin/rpcgen \
68867834Stegge    ${_uudecode} \
68967834Stegge    ${_xargs} \
69067834Stegge    usr.bin/xinstall \
69171915Stegge    ${_yacc} \
69267834Stegge    usr.sbin/config \
69325723Stegge    ${_crunchgen} \
69467834Stegge    ${_kbdcontrol}
69567834Stegge	@${ECHODIR} "===> ${_tool}"; \
69667834Stegge		cd ${.CURDIR}/${_tool}; \
69771915Stegge		${MAKE} DIRPRFX=${_tool}/ obj; \
69871915Stegge		${MAKE} DIRPRFX=${_tool}/ depend; \
69971915Stegge		${MAKE} DIRPRFX=${_tool}/ all; \
70071915Stegge		${MAKE} DIRPRFX=${_tool}/ DESTDIR=${MAKEOBJDIRPREFIX}/legacy install
70171915Stegge.endfor
70271915Stegge
70371915Stegge#
70471915Stegge# build-tools: Build special purpose build tools
70583366Sjulian#
70671915Stegge.if defined(MODULES_WITH_WORLD) && exists(${KERNSRCDIR}/modules)
70783651Speter_aicasm= sys/modules/aic7xxx/aicasm
70867834Stegge.endif
70983651Speter
71067834Stegge.if exists(${.CURDIR}/share) && !defined(NOSHARE)
71171915Stegge_share=	share/syscons/scrnmaps
71271915Stegge.endif
71371915Stegge
71471915Stegge.if !defined(NO_FORTRAN)
71571915Stegge_fortran= gnu/usr.bin/cc/f771
71671915Stegge.endif
71771915Stegge
71871915Stegge.if exists(${.CURDIR}/kerberos5) && exists(${.CURDIR}/crypto) && \
71971915Stegge    !defined(NOCRYPT) && !defined(NO_OPENSSL) && !defined(NO_KERBEROS)
72071915Stegge_libkrb5= kerberos5/lib/libroken kerberos5/lib/libvers \
72171915Stegge    kerberos5/lib/libasn1 kerberos5/lib/libhdb kerberos5/lib/libsl
72271915Stegge.endif
72371915Stegge
72467834Steggebuild-tools:
72571915Stegge.for _tool in \
72667834Stegge    bin/csh \
72767834Stegge    bin/sh \
72867834Stegge    gnu/usr.bin/cc/cc_tools \
72967834Stegge    ${_fortran} \
73067834Stegge    ${_libkrb5} \
73167834Stegge    lib/libncurses \
73267834Stegge    ${_share} \
73367834Stegge    ${_aicasm} \
73467834Stegge    usr.bin/awk \
73583651Speter    usr.bin/file \
73667834Stegge    usr.sbin/sysinstall
73767834Stegge	@${ECHODIR} "===> ${_tool}"; \
73867834Stegge		cd ${.CURDIR}/${_tool}; \
73967834Stegge		${MAKE} DIRPRFX=${_tool}/ obj; \
74067834Stegge		${MAKE} DIRPRFX=${_tool}/ build-tools
74167834Stegge.endfor
74283366Sjulian
74383651Speter#
74467834Stegge# cross-tools: Build cross-building tools
74583651Speter#
74667834Stegge.if ${TARGET_ARCH} == "sparc64" && ${TARGET_ARCH} != ${MACHINE_ARCH} && \
74767834Stegge    ${BOOTSTRAPPING} < 500037
74867834Stegge_elf2aout=	usr.bin/elf2aout
74983366Sjulian.endif
75067834Stegge
75167834Stegge.if ${TARGET_ARCH} == "i386" && ${TARGET_ARCH} != ${MACHINE_ARCH}
75267834Stegge_btxld=		usr.sbin/btxld
75367834Stegge.endif
75483651Speter
75567834Stegge.if (defined(RESCUE) || \
75683366Sjulian    defined(RELEASEDIR)) && \
75767834Stegge    ( ${TARGET_ARCH} != ${MACHINE_ARCH} || ${BOOTSTRAPPING} < 501101 )
75867834Stegge_crunchide=	usr.sbin/crunch/crunchide
75997658Stanimura.endif
76067834Stegge
76167834Stegge.if ${TARGET_ARCH} == "alpha" && ${TARGET_ARCH} != ${MACHINE_ARCH}
76267834Stegge_elf2exe=	usr.sbin/elf2exe
76367834Stegge.endif
76483651Speter
76567834Stegge.if ${TARGET_ARCH} == "i386" && ${TARGET_ARCH} != ${MACHINE_ARCH} && \
76683651Speter    defined(RELEASEDIR)
76767834Stegge_kgzip=		usr.sbin/kgzip
76867834Stegge.endif
76967834Stegge
77067834Steggecross-tools:
77183366Sjulian.for _tool in \
77267834Stegge    gnu/usr.bin/binutils \
77367834Stegge    gnu/usr.bin/cc \
77467834Stegge    ${_elf2aout} \
77567834Stegge    usr.bin/xlint/lint1 usr.bin/xlint/lint2 usr.bin/xlint/xlint \
77683651Speter    ${_btxld} \
77725723Stegge    ${_crunchide} \
77883651Speter    ${_elf2exe} \
77967834Stegge    ${_kgzip}
78067834Stegge	@${ECHODIR} "===> ${_tool}"; \
78167834Stegge		cd ${.CURDIR}/${_tool}; \
78267834Stegge		${MAKE} DIRPRFX=${_tool}/ obj; \
78367834Stegge		${MAKE} DIRPRFX=${_tool}/ depend; \
78483651Speter		${MAKE} DIRPRFX=${_tool}/ all; \
78525723Stegge		${MAKE} DIRPRFX=${_tool}/ DESTDIR=${MAKEOBJDIRPREFIX} install
78625723Stegge.endfor
78725723Stegge
78867834Stegge#
78971915Stegge# hierarchy - ensure that all the needed directories are present
79067834Stegge#
79167834Steggehierarchy:
79267834Stegge	cd ${.CURDIR}/etc;		${MAKE} distrib-dirs
79383651Speter
79425723Stegge#
79525723Stegge# libraries - build all libraries, and install them under ${DESTDIR}.
79625723Stegge#
79725723Stegge# The list of libraries with dependents (${_prebuild_libs}) and their
79867834Stegge# interdependencies (__L) are built automatically by the
79967834Stegge# ${.CURDIR}/tools/make_libdeps.sh script.
80067834Stegge#
80167834Steggelibraries:
80283651Speter	cd ${.CURDIR}; \
80325723Stegge	    ${MAKE} -f Makefile.inc1 _startup_libs; \
80425723Stegge	    ${MAKE} -f Makefile.inc1 _prebuild_libs; \
80525723Stegge	    ${MAKE} -f Makefile.inc1 _generic_libs;
80625723Stegge
80725723Stegge# These dependencies are not automatically generated:
80867834Stegge#
80983366Sjulian# gnu/lib/csu, gnu/lib/libgcc and lib/csu must be built before all
81083651Speter# shared libraries for ELF.
81125723Stegge#
81267531Stegge# lib/libc (libc_pic.a) must be built before lib/libpthread.
81367531Stegge#
81467834Stegge_startup_libs=	gnu/lib/csu gnu/lib/libgcc
81567834Stegge.if exists(${.CURDIR}/lib/csu/${MACHINE_ARCH}-elf)
81667834Stegge_startup_libs+=	lib/csu/${MACHINE_ARCH}-elf
81767834Stegge.else
81871915Stegge_startup_libs+=	lib/csu/${MACHINE_ARCH}
81971915Stegge.endif
82067834Stegge
82183651Speter_prebuild_libs=
82267834Stegge_generic_libs=	gnu/lib
82367834Stegge
82467834Stegge.if exists(${.CURDIR}/kerberos5) && exists(${.CURDIR}/crypto) && \
82525723Stegge    !defined(NOCRYPT) && !defined(NO_OPENSSL) && !defined(NO_KERBEROS)
82667834Stegge_prebuild_libs+=	kerberos5/lib/libasn1
82725723Stegge_prebuild_libs+=	kerberos5/lib/libgssapi
82867834Stegge_prebuild_libs+=	kerberos5/lib/libkrb5
82983651Speter_prebuild_libs+=	kerberos5/lib/libroken
83032609Stegge_generic_libs+=	kerberos5/lib
83132609Stegge.endif
83225723Stegge
83367834Stegge.if !defined(NOLIBPTHREAD)
83483651Speter_prebuild_libs+= lib/libc
83567834Stegge.endif
83667834Stegge_prebuild_libs+= lib/libcom_err lib/libcrypt lib/libexpat \
83767531Stegge		lib/libkvm lib/libmd \
83883651Speter		lib/libncurses lib/libopie lib/libpam lib/libradius \
83967834Stegge		lib/librpcsvc \
84067834Stegge		lib/libsbuf lib/libtacplus lib/libutil lib/libypclnt \
84167834Stegge		lib/libz lib/msun
84267834Stegge
84367834Steggelib/libopie__L lib/libradius__L lib/libtacplus__L: lib/libmd__L
84467834Steggelib/libypclnt__L: lib/librpcsvc__L
84583651Speter
84667834Stegge_generic_libs+=	lib
84767834Stegge
84867834Stegge.if !defined(NOCRYPT)
84983651Speter.if !defined(NO_OPENSSL)
85067834Stegge_prebuild_libs+=	secure/lib/libcrypto secure/lib/libssl
85167834Stegge.if !defined(NO_OPENSSH)
85267834Stegge_prebuild_libs+=	secure/lib/libssh
85367834Steggesecure/lib/libssh__L: secure/lib/libcrypto__L lib/libz__L
85467834Stegge.endif
85525723Stegge.endif
85667834Stegge_generic_libs+=	secure/lib
85767834Stegge.endif
85825723Stegge
85967834Stegge_generic_libs+=	usr.bin/lex/lib
86071915Stegge
86171915Stegge.if ${MACHINE_ARCH} == "i386"
86271915Stegge_generic_libs+=	usr.sbin/pcvt/keycap
86371915Stegge.endif
86471915Stegge
86571915Stegge.for _lib in ${_startup_libs} ${_prebuild_libs:Nlib/libpam} ${_generic_libs}
86671915Stegge${_lib}__L: .PHONY
86771915Stegge.if exists(${.CURDIR}/${_lib})
86871915Stegge	@${ECHODIR} "===> ${_lib}"; \
86971915Stegge		cd ${.CURDIR}/${_lib}; \
87071915Stegge		${MAKE} DIRPRFX=${_lib}/ depend; \
87171915Stegge		${MAKE} DIRPRFX=${_lib}/ all; \
87271915Stegge		${MAKE} DIRPRFX=${_lib}/ install
87371915Stegge.endif
87471915Stegge.endfor
87571915Stegge
87671915Stegge# libpam is special: we need to build static PAM modules before
87771915Stegge# static PAM library, and dynamic PAM library before dynamic PAM
87871915Stegge# modules.
87971915Steggelib/libpam__L: .PHONY
88067834Stegge	@${ECHODIR} "===> lib/libpam"; \
88171915Stegge		cd ${.CURDIR}/lib/libpam; \
88267834Stegge		${MAKE} DIRPRFX=lib/libpam/ depend; \
88367834Stegge		${MAKE} DIRPRFX=lib/libpam/ -D_NO_LIBPAM_SO_YET all; \
88467834Stegge		${MAKE} DIRPRFX=lib/libpam/ -D_NO_LIBPAM_SO_YET install
88567834Stegge
88667834Stegge_startup_libs: ${_startup_libs:S/$/__L/}
88767834Stegge_prebuild_libs: ${_prebuild_libs:S/$/__L/}
88867834Stegge_generic_libs: ${_generic_libs:S/$/__L/}
88967834Stegge
89067834Stegge.for __target in all clean cleandepend cleandir depend includes obj
89167834Stegge.for entry in ${SUBDIR}
89267834Stegge${entry}.${__target}__D: .PHONY
89367834Stegge	@if test -d ${.CURDIR}/${entry}.${MACHINE_ARCH}; then \
89467834Stegge		${ECHODIR} "===> ${DIRPRFX}${entry}.${MACHINE_ARCH}"; \
89567834Stegge		edir=${entry}.${MACHINE_ARCH}; \
89667834Stegge		cd ${.CURDIR}/$${edir}; \
89767834Stegge	else \
89867834Stegge		${ECHODIR} "===> ${DIRPRFX}${entry}"; \
89967834Stegge		edir=${entry}; \
90067834Stegge		cd ${.CURDIR}/$${edir}; \
90167834Stegge	fi; \
90267834Stegge	${MAKE} ${__target} DIRPRFX=${DIRPRFX}$${edir}/
90367834Stegge.endfor
90467834Steggepar-${__target}: ${SUBDIR:S/$/.${__target}__D/}
90567834Stegge.endfor
90667834Stegge
90767834Stegge.include <bsd.subdir.mk>
90867834Stegge