Makefile revision 1.195
11.195Sthorpej#	$NetBSD: Makefile,v 1.195 2001/11/25 18:19:14 thorpej Exp $
21.66Smikel#	from: @(#)Makefile	8.7 (Berkeley) 5/25/95
31.1Scgd
41.96Scjs# Environment variables without default values:
51.96Scjs#   DESTDIR must be set before anything in this file will work.
61.96Scjs#   RELEASEDIR is where the tarred up stuff for a snapshot or
71.96Scjs#	release will be placed.
81.96Scjs#
91.96Scjs# Environment variables with default values:
101.96Scjs#   LOCALTIME will set the default local time for the system you
111.96Scjs#	build; it determines what /etc/localtime is symlink'd to.
121.96Scjs#   KERNSRCDIR points to kernel source; it is set by default to ../sys,
131.96Scjs#	but can be overridden.
141.96Scjs#   KERNOBJDIR is the kernel build directory, it defaults to
151.172Sjlam#	${KERNSRCDIR}/arch/${MACHINE}/compile, but can be overridden.
161.96Scjs#   KERNCONFDIR is where the configuration files for kernels are found;
171.96Scjs#	default is ${KERNSRCDIR}/arch/${MACHINE}/conf but can be overridden.
181.97Scjs#   UPDATE is normally undefined; if defined, don't do a 'make clean'
191.97Scjs#	before kernel compile
201.96Scjs#   NO_SENDMAIL is normally undefined; if defined, it will not do a
211.96Scjs#	`make distribution' in the sendmail config file source directory.
221.96Scjs#   EXTRA_KERNELS has a machine-dependent list of kernels to build added
231.96Scjs#	to it, but you may also set this to have extra ones built.
241.119Sross#   BUILD_KERNELS are a machine-dependent list of kernels that should just
251.119Sross#	be built in place but not made into sets or installed, e.g., an
261.119Sross#	INSTALL kernel used later in src/distrib/.
271.154Sthorpej#
281.96Scjs# Targets:
291.96Scjs#    distribution: makes a full NetBSD distribution in DESTDIR. If
301.96Scjs#	INSTALL_DONE is set, it will not do a `make install.'
311.182Schs#	if DISTRIBUTION_DONE is set, it will not do anything.
321.96Scjs#    distrib-dirs: creates an empty NetBSD directory tree in DESTDIR.
331.96Scjs#	Called by distribution.
341.96Scjs#    snapshot: calls distribution, above, and then tars up the files
351.96Scjs#	into a release(7) format in RELEASEDIR. Any port-dependent
361.96Scjs#	stuff for this target is found in etc.${MACHINE}/Makefile.inc.
371.106Scjs#    release: a synonym for `snapshot'
381.96Scjs
391.149Ssjg# do this before bsd.own.mk so we get correct KERNSRCDIR
401.145Ssjg.include "../Makefile.inc"
411.145Ssjg
421.155Sthorpej# For NO_SENDMAIL, INSTPRIV, MKCRYPTO
431.90Skim.include <bsd.own.mk>
441.187Sjmc
451.187Sjmc.MAKEOVERRIDES+=	USETOOLS
461.90Skim
471.23ScgdTZDIR=		/usr/share/zoneinfo
481.157SkleinkLOCALTIME?=	UTC
491.19Sderaadt
501.161Shubertf# Flags for creating ISO CDROM image
511.161Shubertf# mkisofs is expected to be in $PATH, install via pkgsrc/sysutils/cdrecord
521.161ShubertfMKISOFS?=	mkisofs
531.161ShubertfMKISOFS_FLAGS+= -J -l \
541.161Shubertf		-r -T -v \
551.161Shubertf		-P "The NetBSD Project" \
561.164Shubertf		-m "${RELEASEDIR}/installation/cdrom"
571.161Shubertf
581.55Sperry# setting NOOBJ prevents "make obj" from doing anything;
591.55Sperry# an objdir would break the installation stuff below
601.101SlukemMKOBJ=	no
611.1Scgd
621.80Sjonathan# MD Makefile.inc may append MD targets to BIN[123].  Make sure all
631.80Sjonathan# are empty, to preserve the old semantics of setting them below with "=".
641.80SjonathanBIN1=	
651.80SjonathanBIN2=
661.80SjonathanBIN3=
671.80Sjonathan
681.117Ssimonb# Directories to build in ${RELEASEDIR}.   MD Makefile.inc files can
691.117Ssimonb# add to this.
701.117Ssimonb# NOTE: Parent directories must be listed before subdirectories.
711.117SsimonbINSTALLATION_DIRS= \
721.158Sfvdl	binary binary/sets binary/kernel installation
731.117Ssimonb
741.71Scjs.if exists(etc.${MACHINE}/Makefile.inc)
751.71Scjs.include "etc.${MACHINE}/Makefile.inc"
761.71Scjs.endif
771.32Sjtc
781.96Scjs# Use multiple jobs for kernel builds, if NBUILDJOBS set.
791.96Scjs# (Taken from src/Makefile.)
801.96Scjs.if defined(NBUILDJOBS)
811.96Scjs_J= -j${NBUILDJOBS}
821.96Scjs.endif
831.96Scjs
841.21Scgd# -rw-r--r--
851.21ScgdBINOWN= root
861.21ScgdBINGRP= wheel
871.184SlukemBIN1+=	bootptab changelist csh.cshrc csh.login csh.logout daily \
881.131Sveego	daily.conf dm.conf floppytab ftpchroot ftpusers ftpwelcome \
891.131Sveego	gettytab group hosts hosts.lpd inetd.conf lkm.conf \
901.131Sveego	mailer.conf man.conf monthly monthly.conf mrouted.conf \
911.151Sfvdl	netconfig networks newsyslog.conf nsswitch.conf ntp.conf \
921.131Sveego	phones printcap profile protocols rbootd.conf rc rc.conf \
931.159Slukem	rc.lkm rc.local rc.subr rc.shutdown remote rpc \
941.142Stsarna	security security.conf services shells sysctl.conf syslog.conf \
951.142Stsarna	weekly weekly.conf wscons.conf \
961.109Sdrochner	etc.${MACHINE}/ttys etc.${MACHINE}/disktab
971.105Smycroft
981.121Sfvdl.if	(${MACHINE_ARCH} == "m68k") || \
991.105Smycroft	(${MACHINE_ARCH} == "ns32k") || \
1001.105Smycroft	(${MACHINE_ARCH} == "vax") || \
1011.105Smycroft	(${MACHINE_ARCH} == "arm32")
1021.129SchristosBIN1+=	ld.so.conf
1031.129Schristos.elif exists(etc.${MACHINE_ARCH}/ld.so.conf)
1041.132SjlamBIN1+=	etc.${MACHINE_ARCH}/ld.so.conf
1051.152Sperry.endif
1061.152Sperry
1071.152Sperry.if exists(etc.${MACHINE_ARCH}/ttyaction)
1081.152SperryBIN1+=	etc.${MACHINE_ARCH}/ttyaction
1091.105Smycroft.endif
1101.1Scgd
1111.46Sderaadt# -rw-rw-r--
1121.80SjonathanBIN2+=	motd
1131.1Scgd
1141.77Smycroft# -rw-------
1151.80SjonathanBIN3+=	hosts.equiv
1161.77Smycroft
1171.144SthorpejNAMEDB=	127 root.cache named.conf localhost loopback.v6
1181.1ScgdPCS=	pcs750.bin
1191.1Scgd
1201.191Stv.if make(release) || make(snapshot) || make(distribution)
1211.170Sjdolecek# find out endianness of target and set proper flag for pwd_mkdb so that
1221.170Sjdolecek# it creates database in same endianness
1231.191Stv.if exists(${DESTDIR}/usr/include/sys/endian.h)
1241.171SsimonbTARGET_ENDIANNESS!= \
1251.191Stv	printf '\#include <sys/endian.h>\n_BYTE_ORDER\n' | \
1261.171Ssimonb	${CC} -I${DESTDIR}/usr/include -E - | tail -1 | awk '{print $$1}'
1271.170Sjdolecek.else
1281.170SjdolecekTARGET_ENDIANNESS=
1291.170Sjdolecek.endif
1301.170Sjdolecek
1311.191Stv.if ${TARGET_ENDIANNESS} == "1234"
1321.170SjdolecekTARGET_ENDIANNESS= -L
1331.191Stv.elif ${TARGET_ENDIANNESS} == "4321"
1341.170SjdolecekTARGET_ENDIANNESS= -B
1351.170Sjdolecek.else
1361.170SjdolecekTARGET_ENDIANNESS=
1371.191Stv.endif
1381.170Sjdolecek.endif
1391.170Sjdolecek
1401.149Ssjg.include <bsd.kernobj.mk>
1411.149Ssjg
1421.149Ssjgobj:
1431.149Ssjg	mkdir -p ${KERNOBJDIR}
1441.149Ssjg
1451.190Sjmc.if !defined(DESTDIR) || ${DESTDIR} == ""
1461.174Schristos__warndestdir: .USE
1471.36Scgd	@echo setenv DESTDIR before doing that!
1481.34Scgd	@false
1491.174Schristosdistribution distrib-dirs release snapshot snap_pre snap_md_pre \
1501.174Schristosiso-image: __warndestdir
1511.174Schristos.if !target(snap_md_post)
1521.174Schristossnap_md_post: __warndestdir
1531.174Schristos.endif
1541.34Scgd.else
1551.7Scgddistribution: distrib-dirs
1561.182Schs.if !defined(DISTRIBUTION_DONE)
1571.87Sperry.if !defined(INSTALL_DONE)
1581.107Sscottr	(cd ..; ${MAKE} _DISTRIB= includes)
1591.107Sscottr	(cd ..; ${MAKE} _DISTRIB= install)
1601.87Sperry.endif
1611.193Sthorpej	${MAKE} install-etc-files
1621.195Sthorpej.endif
1631.193Sthorpej
1641.193Sthorpejinstall-etc-files:
1651.124Ssimonb	${INSTALL} ${INSTPRIV} -c -o ${BINOWN} -g ${BINGRP} -m 644 ${BIN1} \
1661.124Ssimonb	    ${DESTDIR}/etc
1671.124Ssimonb	${INSTALL} ${INSTPRIV} -c -o ${BINOWN} -g ${BINGRP} -m 664 ${BIN2} \
1681.124Ssimonb	    ${DESTDIR}/etc
1691.124Ssimonb	${INSTALL} ${INSTPRIV} -c -o ${BINOWN} -g ${BINGRP} -m 600 ${BIN3} \
1701.124Ssimonb	    ${DESTDIR}/etc
1711.124Ssimonb	${INSTALL} ${INSTPRIV} -c -o ${BINOWN} -g ${BINGRP} -m 644 aliases \
1721.147Sitojun	    ${DESTDIR}/etc/mail
1731.124Ssimonb	${INSTALL} ${INSTPRIV} -c -o root -g wheel -m 600 crontab \
1741.56Sthorpej	    ${DESTDIR}/var/cron/tabs/root
1751.124Ssimonb	${INSTALL} ${INSTPRIV} -c -o root -g wheel -m 600 master.passwd \
1761.124Ssimonb	    ${DESTDIR}/etc
1771.171Ssimonb	pwd_mkdb -p ${TARGET_ENDIANNESS} -d ${DESTDIR}/ \
1781.171Ssimonb		${DESTDIR}/etc/master.passwd
1791.194Sperry.if defined(UNPRIVED)
1801.194Sperry	echo "${DESTDIR}/etc/passwd type=file mode=0644 uname=root gname=wheel" \
1811.194Sperry		| sed -e 's|^/|./|g' -e 's|//|/|g' >>${METALOG}
1821.194Sperry	echo "${DESTDIR}/etc/pwd.db type=file mode=0644 uname=root gname=wheel" \
1831.194Sperry		| sed -e 's|^/|./|g' -e 's|//|/|g' >>${METALOG}
1841.194Sperry	echo "${DESTDIR}/etc/spwd.db type=file mode=0600 uname=root gname=wheel" \
1851.194Sperry		| sed -e 's|^/|./|g' -e 's|//|/|g' >>${METALOG}
1861.194Sperry.endif
1871.124Ssimonb	${INSTALL} ${INSTPRIV} -c -o ${BINOWN} -g ${BINGRP} -m 555 \
1881.1Scgd	     MAKEDEV.local etc.${MACHINE}/MAKEDEV ${DESTDIR}/dev
1891.124Ssimonb	${INSTALL} ${INSTPRIV} -c -o root -g wheel -m 600 minfree \
1901.73Sperry	    ${DESTDIR}/var/crash
1911.1Scgd	(cd root; \
1921.124Ssimonb		${INSTALL} ${INSTPRIV} -c -o root -g wheel -m 644 dot.cshrc \
1931.1Scgd		    ${DESTDIR}/root/.cshrc; \
1941.124Ssimonb		${INSTALL} ${INSTPRIV} -c -o root -g wheel -m 600 dot.klogin \
1951.1Scgd		    ${DESTDIR}/root/.klogin; \
1961.124Ssimonb		${INSTALL} ${INSTPRIV} -c -o root -g wheel -m 644 dot.login \
1971.1Scgd		    ${DESTDIR}/root/.login; \
1981.124Ssimonb		${INSTALL} ${INSTPRIV} -c -o root -g wheel -m 644 dot.profile \
1991.1Scgd		    ${DESTDIR}/root/.profile; \
2001.128Smycroft		${INSTALL} ${INSTPRIV} -c -o root -g wheel -m 644 dot.shrc \
2011.128Smycroft		    ${DESTDIR}/root/.shrc; \
2021.189Sperry		rm -f ${DESTDIR}/.cshrc ${DESTDIR}/.profile; \
2031.188Sperry		${INSTALL} ${INSTPRIV} -l h \
2041.188Sperry			${DESTDIR}/root/.cshrc ${DESTDIR}/.cshrc; \
2051.188Sperry		${INSTALL} ${INSTPRIV} -l h \
2061.188Sperry			${DESTDIR}/root/.profile ${DESTDIR}/.profile)
2071.162Slukem	(cd defaults; ${MAKE} install)
2081.83Smrg	(cd mtree; ${MAKE} install)
2091.63Smikel	(cd namedb; \
2101.124Ssimonb		${INSTALL} ${INSTPRIV} -c -o ${BINOWN} -g ${BINGRP} -m 644 \
2111.124Ssimonb		    ${NAMEDB} ${DESTDIR}/etc/namedb)
2121.140Slukem	(cd rc.d; ${MAKE} install)
2131.188Sperry	${INSTALL} ${INSTPRIV} -l s -o root -g wheel -m 755 \
2141.188Sperry		${TZDIR}/${LOCALTIME} ${DESTDIR}/etc/localtime
2151.188Sperry	${INSTALL} ${INSTPRIV} -l s -o root -g wheel -m 755 \
2161.188Sperry		/usr/sbin/rmt ${DESTDIR}/etc/rmt
2171.124Ssimonb	${INSTALL} ${INSTPRIV} -c -o ${BINOWN} -g operator -m 664 /dev/null \
2181.32Sjtc		${DESTDIR}/etc/dumpdates
2191.124Ssimonb	${INSTALL} ${INSTPRIV} -c -o ${BINOWN} -g operator -m 600 /dev/null \
2201.44Sderaadt		${DESTDIR}/etc/skeykeys
2211.127Sperry	${INSTALL} ${INSTPRIV} -c -o root -g wheel -m 600 /dev/null \
2221.127Sperry		${DESTDIR}/var/at/at.deny
2231.124Ssimonb	${INSTALL} ${INSTPRIV} -c -o root -g wheel -m 600 /dev/null \
2241.38Scgd		${DESTDIR}/var/cron/log
2251.124Ssimonb	${INSTALL} ${INSTPRIV} -c -o nobody -g ${BINGRP} -m 664 /dev/null \
2261.32Sjtc		${DESTDIR}/var/db/locate.database
2271.124Ssimonb	${INSTALL} ${INSTPRIV} -c -o uucp -g dialer -m 640 /dev/null \
2281.113Sfair		${DESTDIR}/var/log/aculog
2291.124Ssimonb	${INSTALL} ${INSTPRIV} -c -o ${BINOWN} -g ${BINGRP} -m 600 /dev/null \
2301.69Sperry		${DESTDIR}/var/log/authlog
2311.124Ssimonb	${INSTALL} ${INSTPRIV} -c -o ${BINOWN} -g ${BINGRP} -m 664 /dev/null \
2321.32Sjtc		${DESTDIR}/var/log/lastlog
2331.124Ssimonb	${INSTALL} ${INSTPRIV} -c -o ${BINOWN} -g ${BINGRP} -m 640 /dev/null \
2341.32Sjtc		${DESTDIR}/var/log/lpd-errs
2351.124Ssimonb	${INSTALL} ${INSTPRIV} -c -o ${BINOWN} -g ${BINGRP} -m 600 /dev/null \
2361.32Sjtc		${DESTDIR}/var/log/maillog
2371.124Ssimonb	${INSTALL} ${INSTPRIV} -c -o ${BINOWN} -g ${BINGRP} -m 644 /dev/null \
2381.32Sjtc		${DESTDIR}/var/log/messages
2391.124Ssimonb	${INSTALL} ${INSTPRIV} -c -o ${BINOWN} -g ${BINGRP} -m 600 /dev/null \
2401.58Slukem		${DESTDIR}/var/log/secure
2411.137Smycroft	${INSTALL} ${INSTPRIV} -c -o ${BINOWN} -g ${BINGRP} -m 644 /dev/null \
2421.137Smycroft		${DESTDIR}/var/log/sendmail.st
2431.124Ssimonb	${INSTALL} ${INSTPRIV} -c -o ${BINOWN} -g ${BINGRP} -m 644 /dev/null \
2441.32Sjtc		${DESTDIR}/var/log/wtmp
2451.124Ssimonb	${INSTALL} ${INSTPRIV} -c -o ${BINOWN} -g ${BINGRP} -m 600 /dev/null \
2461.69Sperry		${DESTDIR}/var/log/xferlog
2471.124Ssimonb	${INSTALL} ${INSTPRIV} -c -o daemon -g staff -m 664 /dev/null \
2481.39Scgd		${DESTDIR}/var/msgs/bounds
2491.124Ssimonb	${INSTALL} ${INSTPRIV} -c -o ${BINOWN} -g ${BINGRP} -m 664 /dev/null \
2501.32Sjtc		${DESTDIR}/var/run/utmp
2511.124Ssimonb	${INSTALL} ${INSTPRIV} -c -o games -g games -m 664 /dev/null \
2521.81Smrg		${DESTDIR}/var/games/atc_scores
2531.124Ssimonb	${INSTALL} ${INSTPRIV} -c -o games -g games -m 664 /dev/null \
2541.81Smrg		${DESTDIR}/var/games/battlestar.log
2551.124Ssimonb	${INSTALL} ${INSTPRIV} -c -o games -g games -m 664 /dev/null \
2561.81Smrg		${DESTDIR}/var/games/cfscores
2571.124Ssimonb	${INSTALL} ${INSTPRIV} -c -o games -g games -m 664 /dev/null \
2581.82Sperry		${DESTDIR}/var/games/criblog
2591.124Ssimonb	${INSTALL} ${INSTPRIV} -c -o games -g games -m 664 /dev/null \
2601.81Smrg		${DESTDIR}/var/games/robots_roll
2611.124Ssimonb	${INSTALL} ${INSTPRIV} -c -o games -g games -m 664 /dev/null \
2621.81Smrg		${DESTDIR}/var/games/rogue.scores
2631.124Ssimonb	${INSTALL} ${INSTPRIV} -c -o games -g games -m 664 /dev/null \
2641.81Smrg		${DESTDIR}/var/games/saillog
2651.124Ssimonb	${INSTALL} ${INSTPRIV} -c -o games -g games -m 664 /dev/null \
2661.81Smrg		${DESTDIR}/var/games/snakerawscores
2671.124Ssimonb	${INSTALL} ${INSTPRIV} -c -o games -g games -m 664 /dev/null \
2681.81Smrg		${DESTDIR}/var/games/snake.log
2691.124Ssimonb	${INSTALL} ${INSTPRIV} -c -o games -g games -m 664 /dev/null \
2701.81Smrg		${DESTDIR}/var/games/tetris.scores
2711.124Ssimonb	${INSTALL} ${INSTPRIV} -c -o games -g games -m 664 /dev/null \
2721.81Smrg		${DESTDIR}/var/games/larn/llog12.0
2731.124Ssimonb	${INSTALL} ${INSTPRIV} -c -o games -g games -m 664 /dev/null \
2741.81Smrg		${DESTDIR}/var/games/larn/lscore12.0
2751.124Ssimonb	${INSTALL} ${INSTPRIV} -c -o games -g games -m 664 /dev/null \
2761.81Smrg		${DESTDIR}/var/games/larn/playerids
2771.124Ssimonb	(cd etc.${MACHINE}; ${INSTALL} ${INSTPRIV} -c -o ${BINOWN} \
2781.124Ssimonb	    -g ${BINGRP} -m 444 fstab.* ${DESTDIR}/etc)
2791.165Ssimonb	(cd skel; ${MAKE} distribution)
2801.62Sperry	(cd ../usr.bin/mail; ${MAKE} distribution)
2811.143Sperry	(cd ../gnu/usr.sbin/postfix/; ${MAKE} distribution)
2821.155Sthorpej.if (${MKCRYPTO} != "no")
2831.155Sthorpej	(cd ../usr.bin/ssh; ${MAKE} distribution)
2841.155Sthorpej.endif
2851.90Skim.ifndef NO_SENDMAIL
2861.133Stron	(cd ../gnu/usr.sbin/sendmail/cf/cf; ${MAKE} distribution)
2871.90Skim.endif
2881.1Scgd
2891.7Scgddistrib-dirs:
2901.124Ssimonb	${INSTALL} ${INSTPRIV} -d -o root -g wheel -m 755 ${DESTDIR}
2911.192Sperry	${MTREE} -def mtree/NetBSD.dist -p ${DESTDIR}/ -U ${UNPRIVED:D-W}
2921.189Sperry	rm -f ${DESTDIR}/sys
2931.188Sperry	${INSTALL} ${INSTPRIV} -l s -o root -g wheel -m 755 \
2941.188Sperry		usr/src/sys ${DESTDIR}/sys
2951.99Scjs
2961.96Scjs.if !defined(RELEASEDIR)
2971.175Schristos__warnreleasedir: .USE
2981.96Scjs	@echo setenv RELEASEDIR before doing that!
2991.96Scjs	@false
3001.175Schristosrelease snapshot snap_pre snap_md_pre iso-image: __warnreleasedir
3011.175Schristos.if !target(snap_md_post)
3021.175Schristossnap_md_post: __warnreleasedir
3031.175Schristos.endif
3041.96Scjs.else
3051.117Ssimonbrelease snapshot: distribution snap_pre snap_md_pre snap_kern snap_md_post
3061.141Sthorpej	(cd ../distrib/sets; ${MAKE} sets)
3071.123Sis	sh ../distrib/sets/makesums -t ${RELEASEDIR}/binary/kernel '*.gz'
3081.161Shubertf
3091.161Shubertf# Standalone target to create a CDROM image after the release
3101.161Shubertf# was composed. Should be run after "make build" in both src and xsrc
3111.161Shubertfiso-image: iso-image_md_post
3121.161Shubertf
3131.161Shubertfiso-image_mi: iso-image_md_pre
3141.161Shubertf	@if ${MKISOFS} --version; then \
3151.161Shubertf		mkdir -p ${RELEASEDIR}/installation/cdrom ; \
3161.161Shubertf		${MKISOFS} ${MKISOFS_FLAGS} \
3171.161Shubertf			-o ${RELEASEDIR}/installation/cdrom/netbsd-${MACHINE}.iso \
3181.161Shubertf			${RELEASEDIR} ; \
3191.161Shubertf		sh ../distrib/sets/makesums -t ${RELEASEDIR}/installation/cdrom '*.iso' ; \
3201.161Shubertf	else \
3211.161Shubertf		echo "install pkgsrc/sysutils/cdrecord and type 'make iso-image'." ; \
3221.161Shubertf	fi
3231.161Shubertf
3241.161Shubertf# Setup the $RELEASEDIR to produce a bootable CD image:
3251.161Shubertfiso-image_md_pre:
3261.161Shubertf# nothing here -- look in the machine-dependent Makefile.inc
3271.161Shubertf
3281.161Shubertf# Fixup the  CD-image to be bootable
3291.161Shubertfiso-image_md_post: iso-image_mi
3301.161Shubertf# nothing here -- look in the machine-dependent Makefile.inc
3311.41Scgd
3321.41Scgdsnap_pre:
3331.168Sjmc# Could be a mount point, ignore the errors
3341.167Sjmc	-/bin/rm -rf ${RELEASEDIR}
3351.124Ssimonb	${INSTALL} ${INSTPRIV} -d -o root -g wheel -m 755 ${RELEASEDIR}
3361.117Ssimonb.for dir in ${INSTALLATION_DIRS}
3371.124Ssimonb	${INSTALL} ${INSTPRIV} -d -o root -g wheel -m 755 ${RELEASEDIR}/${dir}
3381.117Ssimonb.endfor
3391.96Scjs
3401.96Scjs
3411.96Scjs# This target builds the GENERIC kernel (which must exist for all
3421.96Scjs# ports) and puts it in binary/sets/kern.tgz, and also builds any
3431.114Sfair# kernels specified in EXTRA_KERNELS. Since NetBSD's kernel build
3441.114Sfair# system can create more than one kernel from a single configuration
3451.114Sfair# we figure out how many there are, what they're named, and move them
3461.114Sfair# to binary/kernel/${KERNEL}.${CONFIGFILE}.gz - most often KERNEL will
3471.116Sfair# simply be "netbsd". If we don't find the "config" line, assume the
3481.116Sfair# kernel will be "netbsd" (some config files are simple additions on
3491.116Sfair# GENERIC, and just include it).
3501.116Sfair#
3511.116SfairGETKERNELAWK=	awk '/^config/ {print $$2; found=1} \
3521.116Sfair		END{ if (found == 0) print "netbsd"; }'
3531.96Scjs#
3541.118Sgwr.if !target(snap_kern)
3551.96Scjssnap_kern:
3561.145Ssjg.ifndef KERNELS_DONE
3571.135Smycroft.for configfile in GENERIC ${EXTRA_KERNELS} ${BUILD_KERNELS}
3581.125Ssommerfe	cd ${KERNCONFDIR} && ${CONFIG} \
3591.179Smrg		-b ${KERNOBJDIR}/${configfile:C/.*\///} -s ${KERNSRCDIR} ${configfile}
3601.97Scjs.ifndef UPDATE
3611.179Smrg	cd ${KERNOBJDIR}/${configfile:C/.*\///} && ${MAKE} distclean 
3621.96Scjs.endif
3631.179Smrg	cd ${KERNOBJDIR}/${configfile:C/.*\///} && ${MAKE} depend && ${MAKE} ${_J}
3641.135Smycroft.endfor # kernels
3651.96Scjs	cd ${KERNOBJDIR}/GENERIC &&	\
3661.116Sfair		tar cf - `${GETKERNELAWK} ${KERNCONFDIR}/GENERIC` |\
3671.96Scjs		gzip -c -9 > ${RELEASEDIR}/binary/sets/kern.tgz
3681.135Smycroft.for configfile in GENERIC ${EXTRA_KERNELS}
3691.179Smrg	cd ${KERNOBJDIR}/${configfile:C/.*\///} &&	\
3701.116Sfair		for kernel in `${GETKERNELAWK} \
3711.179Smrg			${KERNCONFDIR}/${configfile:C/.*\///}` ; do   \
3721.114Sfair		gzip -c -9 < $${kernel} > \
3731.179Smrg			${RELEASEDIR}/binary/kernel/$${kernel}.${configfile:C/.*\///}.gz ; done
3741.96Scjs.endfor # EXTRA_KERNELS
3751.145Ssjg.endif # KERNELS_DONE
3761.118Sgwr.endif # no target(snap_kern)
3771.108Sdrochner
3781.96Scjs.endif # RELEASEDIR check
3791.41Scgd
3801.117Ssimonbsnap_md_pre:
3811.117Ssimonb# nothing here -- look in the machine-dependent Makefile.inc
3821.117Ssimonb
3831.117Ssimonbsnap_md_post:
3841.41Scgd# nothing here -- look in the machine-dependent Makefile.inc
3851.41Scgd
3861.34Scgd.endif	# DESTDIR check
3871.7Scgd
3881.1Scgd.include <bsd.prog.mk>
389