Annotation of src/etc/Makefile, Revision 1.269
1.269 ! lukem 1: # $NetBSD: Makefile,v 1.268 2004/01/05 00:12:01 lukem Exp $
1.66 mikel 2: # from: @(#)Makefile 8.7 (Berkeley) 5/25/95
1.1 cgd 3:
1.96 cjs 4: # Environment variables without default values:
5: # DESTDIR must be set before anything in this file will work.
6: # RELEASEDIR is where the tarred up stuff for a snapshot or
7: # release will be placed.
8: #
9: # Environment variables with default values:
10: # LOCALTIME will set the default local time for the system you
11: # build; it determines what /etc/localtime is symlink'd to.
12: # KERNSRCDIR points to kernel source; it is set by default to ../sys,
13: # but can be overridden.
14: # KERNOBJDIR is the kernel build directory, it defaults to
1.172 jlam 15: # ${KERNSRCDIR}/arch/${MACHINE}/compile, but can be overridden.
1.96 cjs 16: # KERNCONFDIR is where the configuration files for kernels are found;
17: # default is ${KERNSRCDIR}/arch/${MACHINE}/conf but can be overridden.
1.255 lukem 18: # MKUPDATE; if not `no', don't do a 'make clean' before kernel compile
1.96 cjs 19: # NO_SENDMAIL is normally undefined; if defined, it will not do a
20: # `make distribution' in the sendmail config file source directory.
1.154 thorpej 21: #
1.96 cjs 22: # Targets:
23: # distribution: makes a full NetBSD distribution in DESTDIR. If
24: # INSTALL_DONE is set, it will not do a `make install.'
1.182 chs 25: # if DISTRIBUTION_DONE is set, it will not do anything.
1.96 cjs 26: # distrib-dirs: creates an empty NetBSD directory tree in DESTDIR.
27: # Called by distribution.
28: # snapshot: calls distribution, above, and then tars up the files
1.241 lukem 29: # into a release(7) format in RELEASEDIR/${MACHINE}.
30: # Any port-dependent stuff for this target is found in
31: # etc.${MACHINE}/Makefile.inc.
1.106 cjs 32: # release: a synonym for `snapshot'
1.242 lukem 33: #
1.199 tv 34:
1.155 thorpej 35: # For NO_SENDMAIL, INSTPRIV, MKCRYPTO
1.242 lukem 36: #
1.90 kim 37: .include <bsd.own.mk>
1.187 jmc 38:
1.260 lukem 39: .include <bsd.sys.mk> # for HOST_SH
40: .include <bsd.kernobj.mk> # For KERNSRCDIR, KERNOBJDIR, ...
41: .include <bsd.endian.mk> # For TARGET_ENDIANNESS
1.252 lukem 42:
1.211 lukem 43:
1.187 jmc 44: .MAKEOVERRIDES+= USETOOLS
1.90 kim 45:
1.23 cgd 46: TZDIR= /usr/share/zoneinfo
1.157 kleink 47: LOCALTIME?= UTC
1.254 lukem 48: MAKESUMS= CKSUM=${TOOL_CKSUM:Q} ${HOST_SH} ${NETBSDSRCDIR}/distrib/sets/makesums
1.266 lukem 49: DISTRIBVER!= ${HOST_SH} ${NETBSDSRCDIR}/sys/conf/osrelease.sh
1.19 deraadt 50:
1.161 hubertf 51: # Flags for creating ISO CDROM image
52: # mkisofs is expected to be in $PATH, install via pkgsrc/sysutils/cdrecord
1.242 lukem 53: # Note: At least mkisofs 2.0 should be used.
54: #
1.161 hubertf 55: MKISOFS?= mkisofs
1.260 lukem 56: DISTRIBREV!= ${HOST_SH} ${KERNSRCDIR}/conf/osrelease.sh -s
1.224 bjh21 57: # ISO 9660 volume ID. Note that this can only contain [A-Z0-9_].
58: ISO_VOLID!= echo NETBSD_${MACHINE}_${DISTRIBREV} | tr a-z A-Z
1.161 hubertf 59: MKISOFS_FLAGS+= -J -l \
60: -r -T -v \
1.224 bjh21 61: -V ${ISO_VOLID} \
1.161 hubertf 62: -P "The NetBSD Project" \
1.241 lukem 63: -m "${RELEASEDIR}/${MACHINE}/installation/cdrom"
1.1 cgd 64:
1.80 jonathan 65: # MD Makefile.inc may append MD targets to BIN[123]. Make sure all
66: # are empty, to preserve the old semantics of setting them below with "=".
1.242 lukem 67: #
1.200 lukem 68: BIN1=
1.80 jonathan 69: BIN2=
70: BIN3=
71:
1.241 lukem 72: # Directories to build in ${RELEASEDIR}/${MACHINE}.
73: # MD Makefile.inc files can add to this.
1.117 simonb 74: # NOTE: Parent directories must be listed before subdirectories.
1.242 lukem 75: #
1.217 lukem 76: INSTALLATION_DIRS= binary binary/sets binary/kernel installation
1.117 simonb 77:
1.71 cjs 78: .if exists(etc.${MACHINE}/Makefile.inc)
79: .include "etc.${MACHINE}/Makefile.inc"
80: .endif
1.32 jtc 81:
1.21 cgd 82: # -rw-r--r--
83: BINOWN= root
84: BINGRP= wheel
1.227 perry 85: UTMPGRP= utmp
1.184 lukem 86: BIN1+= bootptab changelist csh.cshrc csh.login csh.logout daily \
1.223 fredette 87: daily.conf dm.conf floppytab ftpchroot ftpusers \
1.131 veego 88: gettytab group hosts hosts.lpd inetd.conf lkm.conf \
89: mailer.conf man.conf monthly monthly.conf mrouted.conf \
1.151 fvdl 90: netconfig networks newsyslog.conf nsswitch.conf ntp.conf \
1.213 perry 91: passwd.conf phones printcap profile protocols rbootd.conf rc rc.conf \
1.159 lukem 92: rc.lkm rc.local rc.subr rc.shutdown remote rpc \
1.142 tsarna 93: security security.conf services shells sysctl.conf syslog.conf \
94: weekly weekly.conf wscons.conf \
1.236 jdolecek 95: etc.${MACHINE}/ttys
96:
1.242 lukem 97: # Use machine-specific disktab if it exists, or the MI one otherwise
1.236 jdolecek 98: .if exists(etc.${MACHINE}/disktab)
99: BIN1+= etc.${MACHINE}/disktab
100: .else
101: BIN1+= disktab
102: .endif
1.105 mycroft 103:
1.234 jdolecek 104: .if exists(etc.${MACHINE}/ld.so.conf)
105: BIN1+= etc.${MACHINE}/ld.so.conf
1.152 perry 106: .endif
107:
1.234 jdolecek 108: .if exists(etc.${MACHINE}/ttyaction)
109: BIN1+= etc.${MACHINE}/ttyaction
1.105 mycroft 110: .endif
1.1 cgd 111:
1.46 deraadt 112: # -rw-rw-r--
1.80 jonathan 113: BIN2+= motd
1.1 cgd 114:
1.77 mycroft 115: # -rw-------
1.80 jonathan 116: BIN3+= hosts.equiv
1.77 mycroft 117:
1.230 perry 118: ETC_PKG=-T etc_pkg
119: BASE_PKG=-T base_pkg
1.242 lukem 120: ETC_INSTALL_FILE=cd ${.CURDIR} && ${INSTALL_FILE} ${ETC_PKG}
1.261 cl 121: ETC_INSTALL_OBJ_FILE=cd ${.OBJDIR} && ${INSTALL_FILE} ${ETC_PKG}
1.242 lukem 122: ETC_INSTALL_LINK=cd ${.CURDIR} && ${INSTALL_LINK} ${ETC_PKG}
123: ETC_INSTALL_SYMLINK=cd ${.CURDIR} && ${INSTALL_SYMLINK} ${ETC_PKG}
1.230 perry 124:
1.144 thorpej 125: NAMEDB= 127 root.cache named.conf localhost loopback.v6
1.1 cgd 126:
1.191 tv 127: .if ${TARGET_ENDIANNESS} == "1234"
1.252 lukem 128: PWD_MKDB_ENDIAN= -L
1.191 tv 129: .elif ${TARGET_ENDIANNESS} == "4321"
1.252 lukem 130: PWD_MKDB_ENDIAN= -B
1.170 jdolecek 131: .else
1.252 lukem 132: PWD_MKDB_ENDIAN=
1.191 tv 133: .endif
1.149 sjg 134:
135:
1.242 lukem 136: # distribution --
137: # Build a distribution
138: #
1.204 lukem 139: distribution: check_DESTDIR .WAIT distrib-dirs
1.182 chs 140: .if !defined(DISTRIBUTION_DONE)
1.87 perry 141: .if !defined(INSTALL_DONE)
1.233 lukem 142: (cd ${NETBSDSRCDIR}; ${MAKE} _DISTRIB= includes)
143: (cd ${NETBSDSRCDIR}; ${MAKE} _DISTRIB= install)
1.200 lukem 144: .endif # !INSTALL_DONE
1.243 lukem 145: (cd ${.CURDIR}; ${MAKE} install-etc-files)
1.200 lukem 146: .endif # !DISTRIBUTION_DONE
1.193 thorpej 147:
1.266 lukem 148:
149: .PHONY: MAKEDEV release-info
150: CLEANFILES+= MAKEDEV release-info
151:
1.257 jdolecek 152: MAKEDEV:
1.263 lukem 153: ${_MKTARGET_CREATE}
1.264 lukem 154: MACHINE=${MACHINE:Q} MACHINE_ARCH=${MACHINE_ARCH:Q} \
155: NETBSDSRCDIR=${NETBSDSRCDIR:Q} \
156: awk -f ${.CURDIR}/MAKEDEV.awk ${.CURDIR}/MAKEDEV.tmpl > ${.TARGET}
1.257 jdolecek 157:
1.266 lukem 158:
159: RELEASEVARS= BSDOBJDIR BSDSRCDIR BUILDID \
160: DESTDIR EXTERNAL_TOOLCHAIN \
161: INSTALLWORLDDIR \
162: KERNARCHDIR KERNCONFDIR KERNOBJDIR KERNSRCDIR \
163: MACHINE MACHINE_ARCH MAKE MAKECONF MAKEFLAGS \
164: MAKEOBJDIR MAKEOBJDIRPREFIX MAKEVERBOSE \
165: MKCATPAGES MKCRYPTO MKDOC MKHOSTOBJ MKINFO \
166: MKLINT MKMAN MKNLS MKOBJ MKOBJDIRS \
167: MKPIC MKPICINSTALL MKPROFILE MKSHARE \
168: MKUNPRIVED MKUPDATE \
169: NBUILDJOBS \
170: NOCLEANDIR NODISTRIBDIRS NOINCLUDES \
171: RELEASEDIR TOOLCHAIN_MISSING TOOLDIR USETOOLS
172:
173: release-info:
174: ${_MKTARGET_CREATE}
175: @( echo "NetBSD ${DISTRIBVER}/${MACHINE}"; \
176: echo " $$(date -u) $${USER-root}@$$(hostname)"; \
177: echo ; \
1.269 ! lukem 178: cat ${NETBSDSRCDIR}/sys/conf/copyright; \
1.266 lukem 179: echo ; \
180: echo "Build settings:"; \
181: ) >${.TARGET}
182: .for var in ${RELEASEVARS}
183: .if defined(${var})
184: @printf "%20s = '%-s'\n" ${var} ${${var}:Q} >> ${.TARGET}
185: .else
186: @printf "%20s = (undefined)\n" ${var} >> ${.TARGET}
187: .endif
188: .endfor
189:
1.268 lukem 190: install-release-info: release-info
1.266 lukem 191: ${_MKMSG_INSTALL} etc/release-info
192: ${ETC_INSTALL_OBJ_FILE} -o ${BINOWN} -g ${BINGRP} -m 444 \
1.267 lukem 193: release-info ${DESTDIR}/etc/release
1.242 lukem 194:
195: # install-etc-files --
196: # Install etc (config) files; not performed by "make build"
197: #
1.257 jdolecek 198: install-etc-files: check_DESTDIR MAKEDEV
1.230 perry 199: ${ETC_INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} -m 644 \
200: ${BIN1} ${DESTDIR}/etc
201: ${ETC_INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} -m 664 \
202: ${BIN2} ${DESTDIR}/etc
203: ${ETC_INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} -m 600 \
204: ${BIN3} ${DESTDIR}/etc
205: ${ETC_INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} -m 644 \
206: aliases ${DESTDIR}/etc/mail
207: ${ETC_INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} -m 644 \
208: /dev/null ${DESTDIR}/etc/mail/local-host-names
209: ${ETC_INSTALL_FILE} -o root -g wheel -m 600 \
210: crontab ${DESTDIR}/var/cron/tabs/root
211: ${ETC_INSTALL_FILE} -o root -g wheel -m 600 \
212: master.passwd ${DESTDIR}/etc
1.254 lukem 213: ${TOOL_PWD_MKDB} -p ${PWD_MKDB_ENDIAN} -d ${DESTDIR}/ \
1.230 perry 214: ${DESTDIR}/etc/master.passwd
1.255 lukem 215: .if ${MKUNPRIVED} != "no"
1.222 lukem 216: ( \
1.246 lukem 217: for metaent in passwd pwd.db spwd.db; do \
218: echo "./etc/$${metaent} type=file mode=0644 uname=root gname=wheel tags=etc_pkg"; \
219: done; \
1.239 lukem 220: ) | ${METALOG.add}
1.255 lukem 221: .endif # MKUNPRIVED != no
1.259 ross 222: ${ETC_INSTALL_OBJ_FILE} -o ${BINOWN} -g ${BINGRP} -m 555 \
1.257 jdolecek 223: MAKEDEV ${DESTDIR}/dev
224: ${ETC_INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} -m 555 \
225: MAKEDEV.local ${DESTDIR}/dev
1.230 perry 226: ${ETC_INSTALL_FILE} -o root -g wheel -m 600 \
227: minfree ${DESTDIR}/var/crash
1.242 lukem 228: .for file in cshrc login profile shrc
229: ${ETC_INSTALL_FILE} -o root -g wheel -m 644 \
230: root/dot.${file} ${DESTDIR}/root/.${file}
231: .endfor
232: ${ETC_INSTALL_FILE} -o root -g wheel -m 600 \
233: root/dot.klogin ${DESTDIR}/root/.klogin
234: rm -f ${DESTDIR}/.cshrc ${DESTDIR}/.profile
235: ${ETC_INSTALL_LINK} ${DESTDIR}/root/.cshrc ${DESTDIR}/.cshrc
236: ${ETC_INSTALL_LINK} ${DESTDIR}/root/.profile ${DESTDIR}/.profile
237: (cd ${.CURDIR}/defaults; ${MAKE} install)
238: (cd ${.CURDIR}/mtree; ${MAKE} install)
239: .for file in ${NAMEDB}
240: ${ETC_INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} -m 644 \
241: namedb/${file} ${DESTDIR}/etc/namedb
242: .endfor
1.251 thorpej 243: (cd ${.CURDIR}/powerd; ${MAKE} install)
1.242 lukem 244: (cd ${.CURDIR}/rc.d; ${MAKE} install)
1.230 perry 245: ${ETC_INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \
246: postinstall ${DESTDIR}/etc
247: ${ETC_INSTALL_SYMLINK} -o root -g wheel -m 755 \
248: ${TZDIR}/${LOCALTIME} ${DESTDIR}/etc/localtime
249: ${ETC_INSTALL_SYMLINK} -o root -g wheel -m 755 \
250: /usr/sbin/rmt ${DESTDIR}/etc/rmt
251: ${ETC_INSTALL_FILE} -o ${BINOWN} -g operator -m 664 \
252: /dev/null ${DESTDIR}/etc/dumpdates
253: ${ETC_INSTALL_FILE} -o ${BINOWN} -g operator -m 600 \
254: /dev/null ${DESTDIR}/etc/skeykeys
255: ${ETC_INSTALL_FILE} -o root -g wheel -m 600 \
256: /dev/null ${DESTDIR}/var/at/at.deny
257: ${ETC_INSTALL_FILE} -o nobody -g ${BINGRP} -m 664 \
258: /dev/null ${DESTDIR}/var/db/locate.database
259: ${ETC_INSTALL_FILE} -o uucp -g dialer -m 640 \
260: /dev/null ${DESTDIR}/var/log/aculog
261: ${ETC_INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} -m 600 \
262: /dev/null ${DESTDIR}/var/log/authlog
1.250 perry 263: ${ETC_INSTALL_FILE} -o root -g wheel -m 600 \
264: /dev/null ${DESTDIR}/var/log/cron
1.230 perry 265: ${ETC_INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} -m 664 \
266: /dev/null ${DESTDIR}/var/log/lastlog
267: ${ETC_INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} -m 640 \
268: /dev/null ${DESTDIR}/var/log/lpd-errs
269: ${ETC_INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} -m 600 \
270: /dev/null ${DESTDIR}/var/log/maillog
271: ${ETC_INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} -m 644 \
272: /dev/null ${DESTDIR}/var/log/messages
273: ${ETC_INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} -m 600 \
274: /dev/null ${DESTDIR}/var/log/secure
275: ${ETC_INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} -m 644 \
276: /dev/null ${DESTDIR}/var/log/sendmail.st
277: ${ETC_INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} -m 644 \
278: /dev/null ${DESTDIR}/var/log/wtmp
279: ${ETC_INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} -m 644 \
280: /dev/null ${DESTDIR}/var/log/wtmpx
281: ${ETC_INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} -m 600 \
282: /dev/null ${DESTDIR}/var/log/xferlog
283: ${ETC_INSTALL_FILE} -o daemon -g staff -m 664 \
284: /dev/null ${DESTDIR}/var/msgs/bounds
285: ${ETC_INSTALL_FILE} -o ${BINOWN} -g ${UTMPGRP} -m 664 \
286: /dev/null ${DESTDIR}/var/run/utmp
287: ${ETC_INSTALL_FILE} -o ${BINOWN} -g ${UTMPGRP} -m 664 \
288: /dev/null ${DESTDIR}/var/run/utmpx
289: ${ETC_INSTALL_FILE} -o games -g games -m 664 \
1.249 jdolecek 290: /dev/null ${DESTDIR}/var/games/atc_score
1.230 perry 291: ${ETC_INSTALL_FILE} -o games -g games -m 664 \
292: /dev/null ${DESTDIR}/var/games/battlestar.log
293: ${ETC_INSTALL_FILE} -o games -g games -m 664 \
294: /dev/null ${DESTDIR}/var/games/cfscores
295: ${ETC_INSTALL_FILE} -o games -g games -m 664 \
296: /dev/null ${DESTDIR}/var/games/criblog
1.231 perry 297: ${ETC_INSTALL_FILE} -o games -g games -m 660 \
298: /dev/null ${DESTDIR}/var/games/hackdir/perm
299: ${ETC_INSTALL_FILE} -o games -g games -m 660 \
300: /dev/null ${DESTDIR}/var/games/hackdir/record
301: ${ETC_INSTALL_FILE} -o games -g games -m 664 \
302: /dev/null ${DESTDIR}/var/games/larn/llog12.0
303: ${ETC_INSTALL_FILE} -o games -g games -m 664 \
304: /dev/null ${DESTDIR}/var/games/larn/lscore12.0
305: ${ETC_INSTALL_FILE} -o games -g games -m 664 \
306: /dev/null ${DESTDIR}/var/games/larn/playerids
1.230 perry 307: ${ETC_INSTALL_FILE} -o games -g games -m 664 \
308: /dev/null ${DESTDIR}/var/games/robots_roll
309: ${ETC_INSTALL_FILE} -o games -g games -m 664 \
310: /dev/null ${DESTDIR}/var/games/rogue.scores
311: ${ETC_INSTALL_FILE} -o games -g games -m 664 \
312: /dev/null ${DESTDIR}/var/games/saillog
313: ${ETC_INSTALL_FILE} -o games -g games -m 664 \
314: /dev/null ${DESTDIR}/var/games/snakerawscores
315: ${ETC_INSTALL_FILE} -o games -g games -m 664 \
316: /dev/null ${DESTDIR}/var/games/snake.log
317: ${ETC_INSTALL_FILE} -o games -g games -m 664 \
318: /dev/null ${DESTDIR}/var/games/tetris.scores
1.242 lukem 319: (cd ${.CURDIR}/skel; ${MAKE} distribution)
1.233 lukem 320: (cd ${NETBSDSRCDIR}/usr.bin/mail; ${MAKE} distribution)
321: (cd ${NETBSDSRCDIR}/gnu/usr.sbin/postfix/; ${MAKE} distribution)
1.155 thorpej 322: .if (${MKCRYPTO} != "no")
1.233 lukem 323: (cd ${NETBSDSRCDIR}/usr.bin/ssh; ${MAKE} distribution)
1.155 thorpej 324: .endif
1.244 mrg 325: .if !defined(NO_SENDMAIL) || ${NO_SENDMAIL} == "no"
1.233 lukem 326: (cd ${NETBSDSRCDIR}/gnu/usr.sbin/sendmail/cf/cf; ${MAKE} distribution)
1.90 kim 327: .endif
1.247 lukem 328:
329:
330: # install-obsolete-lists --
331: # Install var/db/obsolete set lists; this is performed by "make build"
332: #
333: OBSOLETE.dir= ${.OBJDIR}/obsolete.dir
334: OBSOLETE.files= base comp etc games man misc text
335:
336: install-obsolete-lists:
1.246 lukem 337: mkdir -p ${OBSOLETE.dir}
1.253 lukem 338: (cd ${NETBSDSRCDIR}/distrib/sets && \
339: MAKE=${MAKE:Q} ${HOST_SH} ./makeobsolete -t ${OBSOLETE.dir})
1.246 lukem 340: .for file in ${OBSOLETE.files}
341: ${ETC_INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} -m 644 \
1.247 lukem 342: ${OBSOLETE.dir}/${file} ${DESTDIR}/var/db/obsolete
1.246 lukem 343: .endfor
1.1 cgd 344:
1.242 lukem 345:
346: # distrib-dirs --
347: # Populate $DESTDIR with directories needed by NetBSD
348: #
1.255 lukem 349: .if ${MKUNPRIVED} == "no"
350: TOOL_MTREE.unpriv=
351: .else
352: TOOL_MTREE.unpriv= -W
353: .endif
354:
1.204 lukem 355: distrib-dirs: check_DESTDIR
1.256 dsl 356: .if !defined(DISTRIBUTION_DONE)
1.230 perry 357: ${INSTALL_DIR} -o root -g wheel -m 755 ${BASE_PKG} ${DESTDIR}
1.256 dsl 358: .endif
1.254 lukem 359: ${TOOL_MTREE} -def ${.CURDIR}/mtree/NetBSD.dist -N ${.CURDIR} \
1.255 lukem 360: -p ${DESTDIR}/ -U ${TOOL_MTREE.unpriv}
1.200 lukem 361:
1.242 lukem 362:
363: # release, snapshot --
364: # Build a full distribution including kernels & install media.
365: #
1.204 lukem 366: release snapshot: check_DESTDIR check_RELEASEDIR .WAIT \
1.233 lukem 367: distribution .WAIT \
368: snap_pre .WAIT snap_kern .WAIT \
369: snap_post .WAIT snap_md_post
370: (cd ${NETBSDSRCDIR}/distrib/sets; ${MAKE} sets)
1.241 lukem 371: ${MAKESUMS} -t ${RELEASEDIR}/${MACHINE}/binary/kernel '*.gz'
1.161 hubertf 372:
1.242 lukem 373:
374: # iso-image --
375: # Standalone target to create a CDROM image after the release
376: # was composed. Should be run after "make release" in src and xsrc.
377: #
1.245 lukem 378: # Note: At least mkisofs 2.0 should be used.
1.242 lukem 379: #
380: CDROM.image=${RELEASEDIR}/${MACHINE}/installation/cdrom/netbsd-${MACHINE}.iso
381: CDROM.dir= cdrom.dir
382: CDROM.pathlist= cdrom.pathlist
383:
1.248 lukem 384: iso-image: check_DESTDIR check_RELEASEDIR .WAIT iso-image-md-post
385: ${MAKESUMS} -t ${RELEASEDIR}/${MACHINE}/installation/cdrom '*.iso'
1.265 lukem 386: @echo "iso-image created as: ${CDROM.image}"
1.161 hubertf 387:
1.248 lukem 388: iso-image-setup: check_RELEASEDIR
1.242 lukem 389: rm -f ${CDROM.pathlist}
390: echo "${MACHINE}=${RELEASEDIR}/${MACHINE}" >> ${CDROM.pathlist}
391: mkdir -p ${CDROM.dir}
392: mkdir -p ${RELEASEDIR}/${MACHINE}/installation/cdrom
393:
1.248 lukem 394: # iso-image-mi --
1.242 lukem 395: # Create the image after the MD operations have completed.
1.248 lukem 396: #
397: iso-image-mi: check_DESTDIR check_RELEASEDIR .WAIT \
398: iso-image-setup .WAIT iso-image-md-pre
1.242 lukem 399: @if ! ${MKISOFS} --version; then \
400: echo "install pkgsrc/sysutils/cdrecord and run 'make iso-image'." ; \
401: false; \
1.161 hubertf 402: fi
1.242 lukem 403: ${MKISOFS} ${MKISOFS_FLAGS} -graft-points -path-list ${CDROM.pathlist} \
404: -o ${CDROM.image} ${CDROM.dir}
405:
1.248 lukem 406: # iso-image-md-pre --
1.242 lukem 407: # Setup ${CDROM.dir} to produce a bootable CD image.
408: # Overridden by etc.$MACHINE/Makefile.inc
409: #
1.248 lukem 410: iso-image-md-pre: check_DESTDIR check_RELEASEDIR
1.242 lukem 411: # (empty -- look in the machine-dependent Makefile.inc)
1.161 hubertf 412:
1.248 lukem 413: # iso-image-md-post --
1.242 lukem 414: # Fixup the CD-image to be bootable.
415: # Overridden by etc.$MACHINE/Makefile.inc
416: #
1.248 lukem 417: iso-image-md-post: check_DESTDIR check_RELEASEDIR .WAIT iso-image-mi
1.242 lukem 418: # (empty -- look in the machine-dependent Makefile.inc)
1.41 cgd 419:
1.242 lukem 420:
421: # snap_pre --
422: # Create ${RELEASEDIR} and necessary subdirectories.
423: #
1.204 lukem 424: snap_pre: check_DESTDIR check_RELEASEDIR
1.241 lukem 425: ${INSTALL} -d -m 755 ${RELEASEDIR}
1.255 lukem 426: .if ${MKUPDATE} == "no"
1.168 jmc 427: # Could be a mount point, ignore the errors
1.241 lukem 428: -/bin/rm -rf ${RELEASEDIR}/${MACHINE}
1.240 lukem 429: .endif
1.241 lukem 430: ${INSTALL} -d -m 755 ${RELEASEDIR}/${MACHINE}
1.117 simonb 431: .for dir in ${INSTALLATION_DIRS}
1.241 lukem 432: ${INSTALL} -d -m 755 ${RELEASEDIR}/${MACHINE}/${dir}
1.117 simonb 433: .endfor
1.96 cjs 434:
1.242 lukem 435: # snap_post --
436: # Build the install media and notes from distrib
437: #
1.233 lukem 438: snap_post: check_DESTDIR check_RELEASEDIR
1.255 lukem 439: .if ${MKUPDATE} == "no"
1.233 lukem 440: cd ${NETBSDSRCDIR}/distrib && ${MAKE} cleandir
441: .endif
442: cd ${NETBSDSRCDIR}/distrib && ${MAKE} depend && ${MAKE} && \
443: ${MAKE} release
444:
1.232 lukem 445: # snap_kern --
1.242 lukem 446: # This target builds the kernels specified by each port.
447: # A port may specify the following kernels:
1.196 thorpej 448: #
449: # KERNEL_SETS The list of kernels that will be
450: # packaged into sets, named
451: # kern-${kernel}.tgz. These kernels
1.203 chs 452: # are also placed in the binary/kernel
1.196 thorpej 453: # area of the release package as
454: # netbsd-${kernel}.gz.
455: #
456: # EXTRA_KERNELS Additional kernels to place in the
1.203 chs 457: # binary/kernel area of the release
1.196 thorpej 458: # package as netbsd-${kernel}.gz, but
459: # which are not placed into sets. This
460: # allows a port to provide e.g. a netbootable
461: # installation kernel containing a ramdisk.
462: #
463: # BUILD_KERNELS Additional kernels to build which are
464: # not placed into sets nor into the
1.203 chs 465: # binary/kernel area of the release
1.196 thorpej 466: # package. These are typically kernels
467: # that are built for inclusion only in
468: # installation disk/CD-ROM/tape images.
1.116 fair 469: #
1.242 lukem 470: # A port may also specify KERNEL_SUFFIXES, which is an optional list
471: # of filename suffixes for kernels to include in the kernel sets and
472: # in the binary/kernel area of the release package (e.g. "netbsd" vs.
473: # "netbsd.ecoff" and "netbsd.srec"). It is not an error if kernels
474: # with these suffixes do not exist in the kernel build directory.
1.197 thorpej 475: #
1.229 lukem 476: #
477: # A list of all the kernels to build, which can be overridden from
478: # external sources (such as make(1)'s environment or command line)
479: #
480: ALL_KERNELS?= ${KERNEL_SETS} ${EXTRA_KERNELS} ${BUILD_KERNELS}
1.242 lukem 481:
1.116 fair 482: GETKERNELAWK= awk '/^config/ {print $$2; found=1} \
483: END{ if (found == 0) print "netbsd"; }'
1.242 lukem 484:
1.232 lukem 485: .if !target(snap_kern) # {
486:
487: # build_kernels --
488: # Configure & compile kernels listed in ${ALL_KERNELS}
489: #
1.201 lukem 490: .if !defined(KERNELS_DONE) # {
1.232 lukem 491: .for configfile in ${ALL_KERNELS} # {
492: _KERNELS_TO_BUILD+=kern-${configfile}
493: kern-${configfile}:
1.254 lukem 494: cd ${KERNCONFDIR} && ${TOOL_CONFIG} -s ${KERNSRCDIR} \
1.232 lukem 495: -b ${KERNOBJDIR}/${configfile:C/.*\///} ${configfile}
1.255 lukem 496: .if ${MKUPDATE} == "no"
1.200 lukem 497: cd ${KERNOBJDIR}/${configfile:C/.*\///} && ${MAKE} distclean
1.96 cjs 498: .endif
1.218 sommerfe 499: cd ${KERNOBJDIR}/${configfile:C/.*\///} && ${MAKE} depend && ${MAKE}
1.232 lukem 500: .endfor # ALL_KERNELS # }
501: .endif # KERNELS_DONE # }
502:
503: build_kernels: ${_KERNELS_TO_BUILD}
504:
505: # build_kernelsets --
1.241 lukem 506: # Create kernel sets from ${KERNEL_SETS} into
507: # ${RELEASEDIR}/${MACHINE}/binary/sets
1.232 lukem 508: #
509: .for configfile in ${KERNEL_SETS} # {
510: _KERNELSETS_TO_BUILD+=kernset-${configfile}
511: kernset-${configfile}:
1.256 dsl 512: @ kernlist=`${GETKERNELAWK} ${KERNCONFDIR}/${configfile}`; \
1.197 thorpej 513: kerndir=${KERNOBJDIR}/${configfile:C/.*\///}; \
1.256 dsl 514: kernsuffixes="${KERNEL_SUFFIXES:S/^/./}"; \
515: kern_tgz=${RELEASEDIR}/${MACHINE}/binary/sets/kern-${configfile}.tgz; \
516: pax_cmd="GZIP=-9 ${TOOL_PAX} -O -zw -M -N ${NETBSDSRCDIR}/etc -f $${kern_tgz}"; \
517: cd $${kerndir} && { \
518: kernels=; newest=; \
1.210 lukem 519: for kernel in $${kernlist}; do \
1.256 dsl 520: for s in "" $${kernsuffixes}; do \
521: ks="$${kernel}$${s}"; \
522: [ -f $${ks} ] || continue; \
523: kernels="$${kernels} $${ks}"; \
524: [ -z "$${newest}" -o $${ks} -nt "$${newest}" ] && \
525: newest=$${ks}; \
1.197 thorpej 526: done; \
1.256 dsl 527: done; \
528: [ $${kern_tgz} -nt "$${newest}" ] || { \
529: echo "echo $${kernels} | $${pax_cmd}"; \
530: ( echo "/set uname=${BINOWN} gname=${BINGRP}"; \
531: echo ". type=dir optional"; \
532: for kernel in $${kernels}; do \
533: echo "./$${kernel} type=file"; \
534: done ) | eval $${pax_cmd}; \
535: } \
536: }
1.232 lukem 537: .endfor # KERNEL_SETS # }
538:
539: build_kernelsets: ${_KERNELSETS_TO_BUILD}
540:
541: # build_releasekernels --
542: # Build kernel.gz from ${KERNEL_SETS} ${EXTRA_KERNELS} into
1.241 lukem 543: # ${RELEASEDIR}/${MACHINE}/binary/kernel
1.232 lukem 544: #
545: .for configfile in ${KERNEL_SETS} ${EXTRA_KERNELS} # {
546: _RELEASEKERNELS_TO_BUILD+=releasekern-${configfile}
547: releasekern-${configfile}:
1.256 dsl 548: @ kernlist=`${GETKERNELAWK} ${KERNCONFDIR}/${configfile:C/.*\///}`; \
1.197 thorpej 549: kerndir=${KERNOBJDIR}/${configfile:C/.*\///}; \
1.256 dsl 550: kernsuffixes="${KERNEL_SUFFIXES:S/^/./}"; \
551: cd $${kerndir} && { \
552: for kernel in $${kernlist}; do \
553: for s in "" $${kernsuffixes}; do \
554: ks="$${kernel}$${s}"; \
555: [ ! -f $${ks} ] && continue; \
556: knl_gz="${RELEASEDIR}/${MACHINE}/binary/kernel/$${ks}-${configfile:C/.*\///}.gz"; \
557: [ $${knl_gz} -nt $${ks} ] && continue; \
558: echo "gzip -c -9 < $${kerndir}/$${ks} > $${knl_gz}"; \
559: gzip -c -9 < $${ks} > $${knl_gz}; \
1.197 thorpej 560: done; \
1.256 dsl 561: done; \
562: }
1.232 lukem 563: .endfor # KERNEL_SETS EXTRA_KERNELS # }
564:
565: build_releasekernels: ${_RELEASEKERNELS_TO_BUILD}
566:
567: # snap_kern --
568: # build the kernels, then the sets & release kernels
1.242 lukem 569: #
1.232 lukem 570: snap_kern: check_DESTDIR check_RELEASEDIR .WAIT \
571: build_kernels .WAIT \
572: build_kernelsets build_releasekernels
573:
574: .endif # !target(snap_kern) # }
575:
1.108 drochner 576:
1.242 lukem 577: # snap_md_post --
578: # Machine dependent distribution media operations.
579: # Overridden by etc.$MACHINE/Makefile.inc
580: #
1.204 lukem 581: snap_md_post: check_DESTDIR check_RELEASEDIR
1.242 lukem 582: # (empty -- look in the machine-dependent Makefile.inc)
583:
584:
585: clean:
1.246 lukem 586: -rm -rf ${CDROM.dir} ${CDROM.pathlist} ${OBSOLETE.dir}
1.7 cgd 587:
1.1 cgd 588: .include <bsd.prog.mk>
CVSweb <webmaster@jp.NetBSD.org>