Annotation of src/etc/Makefile, Revision 1.417
1.417 ! apb 1: # $NetBSD: Makefile,v 1.416 2014/08/03 09:19:34 apb 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.270 lukem 18: # MKCRYPTO; if not `no', install crypto-related configuration
1.304 lukem 19: # MKPOSTFIX; if not `no', install postfix configuration
1.270 lukem 20: # MKUNPRIVED; if not `no', allow non-root installs.
1.255 lukem 21: # MKUPDATE; if not `no', don't do a 'make clean' before kernel compile
1.154 thorpej 22: #
1.96 cjs 23: # Targets:
24: # distribution: makes a full NetBSD distribution in DESTDIR. If
25: # INSTALL_DONE is set, it will not do a `make install.'
1.182 chs 26: # if DISTRIBUTION_DONE is set, it will not do anything.
1.96 cjs 27: # distrib-dirs: creates an empty NetBSD directory tree in DESTDIR.
28: # Called by distribution.
29: # snapshot: calls distribution, above, and then tars up the files
1.286 cl 30: # into a release(7) format in RELEASEDIR/${RELEASEMACHINEDIR}.
1.241 lukem 31: # Any port-dependent stuff for this target is found in
32: # etc.${MACHINE}/Makefile.inc.
1.106 cjs 33: # release: a synonym for `snapshot'
1.242 lukem 34: #
1.199 tv 35:
1.270 lukem 36: # For MK* vars
1.90 kim 37: .include <bsd.own.mk>
1.187 jmc 38:
1.260 lukem 39: .include <bsd.kernobj.mk> # For KERNSRCDIR, KERNOBJDIR, ...
40: .include <bsd.endian.mk> # For TARGET_ENDIANNESS
1.252 lukem 41:
1.187 jmc 42: .MAKEOVERRIDES+= USETOOLS
1.90 kim 43:
1.23 cgd 44: TZDIR= /usr/share/zoneinfo
1.157 kleink 45: LOCALTIME?= UTC
1.283 agc 46: CKSUM?= ${TOOL_CKSUM}
1.330 christos 47: MAKESUMS= MAKE=${MAKE:Q} CKSUM=${CKSUM:Q} ${HOST_SH} ${NETBSDSRCDIR}/distrib/sets/makesums
1.266 lukem 48: DISTRIBVER!= ${HOST_SH} ${NETBSDSRCDIR}/sys/conf/osrelease.sh
1.19 deraadt 49:
1.161 hubertf 50: # Flags for creating ISO CDROM image
1.320 apb 51: # mkisofs is expected to be in $PATH, install via pkgsrc/sysutils/cdrtools
1.242 lukem 52: # Note: At least mkisofs 2.0 should be used.
53: #
1.341 bouyer 54: .if !defined(MKISOFS)
1.407 uebayasi 55: MKISOFS!= (which mkisofs || echo true) 2>/dev/null
1.341 bouyer 56: .endif
1.260 lukem 57: DISTRIBREV!= ${HOST_SH} ${KERNSRCDIR}/conf/osrelease.sh -s
1.224 bjh21 58: # ISO 9660 volume ID. Note that this can only contain [A-Z0-9_].
1.306 martin 59: ISO_VOLID!= echo NETBSD_${DISTRIBREV} | tr a-z A-Z
60: MKISOFS_FLAGS+= -J -l -hide-joliet-trans-tbl -r -T \
1.224 bjh21 61: -V ${ISO_VOLID} \
1.331 lukem 62: -publisher "The NetBSD Project" \
1.286 cl 63: -m "${RELEASEDIR}/${RELEASEMACHINEDIR}/installation/cdrom"
1.306 martin 64: .if ${MKISOFS_FLAGS:N-v}
65: MKISOFS_FLAGS+= -quiet
66: .endif
67:
1.1 cgd 68:
1.80 jonathan 69: # MD Makefile.inc may append MD targets to BIN[123]. Make sure all
1.316 hubertf 70: # are empty, to preserve the old semantics of setting them below with "+=".
1.242 lukem 71: #
1.200 lukem 72: BIN1=
1.80 jonathan 73: BIN2=
74: BIN3=
75:
1.286 cl 76: # Directories to build in ${RELEASEDIR}/${RELEASEMACHINEDIR}.
1.241 lukem 77: # MD Makefile.inc files can add to this.
1.117 simonb 78: # NOTE: Parent directories must be listed before subdirectories.
1.242 lukem 79: #
1.217 lukem 80: INSTALLATION_DIRS= binary binary/sets binary/kernel installation
1.117 simonb 81:
1.286 cl 82: .if exists(etc.${RELEASEMACHINE}/Makefile.inc)
83: .include "etc.${RELEASEMACHINE}/Makefile.inc"
1.71 cjs 84: .endif
1.32 jtc 85:
1.21 cgd 86: # -rw-r--r--
87: BINOWN= root
88: BINGRP= wheel
1.227 perry 89: UTMPGRP= utmp
1.365 joerg 90: BIN1+= bootptab changelist csh.cshrc csh.login \
1.345 adrianp 91: csh.logout daily daily.conf dm.conf envsys.conf floppytab ftpchroot \
1.370 mbalmer 92: ftpusers gettytab gpio.conf group hosts hosts.lpd inetd.conf \
1.345 adrianp 93: locate.conf login.conf mailer.conf man.conf monthly monthly.conf \
94: mrouted.conf named.conf netconfig networks newsyslog.conf \
1.409 agc 95: nsswitch.conf ntp.conf passwd.conf pkgpath.conf phones printcap \
1.408 agc 96: profile protocols rbootd.conf rc rc.conf rc.local rc.subr \
97: rc.shutdown remote rpc security security.conf services shells \
98: shrc sysctl.conf syslog.conf weekly weekly.conf wscons.conf
1.291 lukem 99:
1.242 lukem 100: # Use machine-specific disktab if it exists, or the MI one otherwise
1.236 jdolecek 101: .if exists(etc.${MACHINE}/disktab)
102: BIN1+= etc.${MACHINE}/disktab
103: .else
104: BIN1+= disktab
105: .endif
1.105 mycroft 106:
1.410 matt 107: .if exists(etc.${MACHINE}/ld.so.conf) && empty(MACHINE_ARCH:M*arm*hf*)
1.234 jdolecek 108: BIN1+= etc.${MACHINE}/ld.so.conf
1.152 perry 109: .endif
110:
1.234 jdolecek 111: .if exists(etc.${MACHINE}/ttyaction)
112: BIN1+= etc.${MACHINE}/ttyaction
1.105 mycroft 113: .endif
1.1 cgd 114:
1.46 deraadt 115: # -rw-rw-r--
1.80 jonathan 116: BIN2+= motd
1.400 apb 117: FILESBUILD_motd= YES
1.1 cgd 118:
1.77 mycroft 119: # -rw-------
1.80 jonathan 120: BIN3+= hosts.equiv
1.77 mycroft 121:
1.291 lukem 122: SYSPKG= etc
1.230 perry 123: ETC_PKG=-T etc_pkg
124: BASE_PKG=-T base_pkg
1.242 lukem 125: ETC_INSTALL_FILE=cd ${.CURDIR} && ${INSTALL_FILE} ${ETC_PKG}
1.261 cl 126: ETC_INSTALL_OBJ_FILE=cd ${.OBJDIR} && ${INSTALL_FILE} ${ETC_PKG}
1.230 perry 127:
1.191 tv 128: .if ${TARGET_ENDIANNESS} == "1234"
1.252 lukem 129: PWD_MKDB_ENDIAN= -L
1.191 tv 130: .elif ${TARGET_ENDIANNESS} == "4321"
1.252 lukem 131: PWD_MKDB_ENDIAN= -B
1.170 jdolecek 132: .else
1.252 lukem 133: PWD_MKDB_ENDIAN=
1.191 tv 134: .endif
1.149 sjg 135:
136:
1.242 lukem 137: # distribution --
138: # Build a distribution
139: #
1.324 dsl 140: distribution: .PHONY .MAKE check_DESTDIR distrib-dirs
1.182 chs 141: .if !defined(DISTRIBUTION_DONE)
1.87 perry 142: .if !defined(INSTALL_DONE)
1.285 lukem 143: ${MAKEDIRTARGET} ${NETBSDSRCDIR} include _DISTRIB=
144: ${MAKEDIRTARGET} ${NETBSDSRCDIR} install _DISTRIB=
1.200 lukem 145: .endif # !INSTALL_DONE
1.285 lukem 146: ${MAKEDIRTARGET} . install-etc-files
1.360 mrg 147: . if ${MKX11} != "no"
148: . if ${X11FLAVOUR} == "Xorg"
1.358 lukem 149: ${MAKEDIRTARGET} ${NETBSDSRCDIR}/external/mit/xorg distribution
1.360 mrg 150: . else
1.288 lukem 151: ${MAKEDIRTARGET} ${NETBSDSRCDIR}/x11 distribution
1.360 mrg 152: . endif
153: . endif
1.374 uebayasi 154: . if ${MKEXTSRC} != "no"
155: ${MAKEDIRTARGET} ${NETBSDSRCDIR}/extsrc distribution
156: . endif
1.285 lukem 157: ${MAKEDIRTARGET} ${NETBSDSRCDIR}/distrib/sets makesetfiles
1.200 lukem 158: .endif # !DISTRIBUTION_DONE
1.193 thorpej 159:
1.266 lukem 160:
1.400 apb 161: # motd is copied from a different ${MOTD_SOURCE} depending on DISTRIBVER
162: #
163: .if !empty(DISTRIBVER:M*.99.*)
164: MOTD_SOURCE= motd.current
165: .elif !empty(DISTRIBVER:M*BETA*)
166: MOTD_SOURCE= motd.beta
167: .elif !empty(DISTRIBVER:M*RC*)
168: MOTD_SOURCE= motd.rc
169: .elif !empty(DISTRIBVER:M*STABLE*)
170: MOTD_SOURCE= motd.stable
171: .else
172: MOTD_SOURCE= motd.default
173: .endif
174: CLEANFILES+= motd
175: motd: ${.CURDIR}/${MOTD_SOURCE} ${_NETBSD_VERSION_DEPENDS}
176: ${_MKTARGET_CREATE}
177: ${HOST_INSTALL_FILE} ${.CURDIR}/${MOTD_SOURCE} ${.TARGET}
178:
1.340 apb 179: CLEANFILES+= MAKEDEV
1.386 uebayasi 180: MAKEDEV: ${.CURDIR}/MAKEDEV.awk ${.CURDIR}/MAKEDEV.tmpl \
181: ${.CURDIR}/etc.${MACHINE}/MAKEDEV.conf
1.263 lukem 182: ${_MKTARGET_CREATE}
1.264 lukem 183: MACHINE=${MACHINE:Q} MACHINE_ARCH=${MACHINE_ARCH:Q} \
184: NETBSDSRCDIR=${NETBSDSRCDIR:Q} \
1.359 apb 185: ${TOOL_AWK} -f ${.CURDIR}/MAKEDEV.awk ${.CURDIR}/MAKEDEV.tmpl \
186: > ${.TARGET}
1.257 jdolecek 187:
1.401 apb 188: .include "${NETBSDSRCDIR}/etc/Makefile.params"
1.272 lukem 189: CLEANFILES+= etc-release
1.322 dsl 190: etc-release: .EXEC .MAKE
1.266 lukem 191: ${_MKTARGET_CREATE}
192: @( echo "NetBSD ${DISTRIBVER}/${MACHINE}"; \
193: echo ; \
1.269 lukem 194: cat ${NETBSDSRCDIR}/sys/conf/copyright; \
1.266 lukem 195: echo ; \
1.416 apb 196: echo "Build information:"; \
1.412 apb 197: printf "%20s %s\n" "Build date" "$$(date -u)"; \
1.281 lukem 198: printf "%20s %s\n" "Built by" "$${USER-root}@$$(hostname)"; \
1.414 apb 199: if [ -n "${BUILDID}" ]; then \
1.416 apb 200: printf "%20s %s\n" "Build ID" "${BUILDID}" ; \
201: fi ; \
202: if [ -n "${BUILDINFO}" ]; then \
203: echo ; \
204: info="$$(printf "%b" ${BUILDINFO:Q})" ; \
205: printf "%s\n" "$${info}" \
206: | ${TOOL_SED} -e 's/^/ /' ; \
1.414 apb 207: fi ; \
1.281 lukem 208: echo ; \
1.416 apb 209: echo "Build settings:"; \
210: echo ; \
1.401 apb 211: ${PRINT_PARAMS} ; \
1.276 lukem 212: ) >${.OBJDIR}/${.TARGET}
1.266 lukem 213:
1.275 lukem 214: install-etc-release: .PHONY etc-release
1.272 lukem 215: ${_MKMSG_INSTALL} etc/release
1.266 lukem 216: ${ETC_INSTALL_OBJ_FILE} -o ${BINOWN} -g ${BINGRP} -m 444 \
1.272 lukem 217: etc-release ${DESTDIR}/etc/release
1.242 lukem 218:
1.291 lukem 219:
220: FILESDIR= /etc
221: CONFIGFILES=
222: CONFIGSYMLINKS=
223:
224: .for file in ${BIN1}
225: CONFIGFILES+= ${file}
226: FILESMODE_${file:T}= 644
227: .endfor
228:
229: .for file in ${BIN2}
230: CONFIGFILES+= ${file}
231: FILESMODE_${file:T}= 664
232: .endfor
233:
234: .for file in ${BIN3}
235: CONFIGFILES+= ${file}
236: FILESMODE_${file:T}= 600
237: .endfor
238:
1.327 tron 239: .if (${MKPOSTFIX} != "no")
1.291 lukem 240: CONFIGFILES+= aliases
241: FILESDIR_aliases= /etc/mail
242: FILESMODE_aliases= 644
1.327 tron 243: .endif
1.291 lukem 244:
245: CONFIGFILES+= MAKEDEV.local
246: FILESDIR_MAKEDEV.local= /dev
247: FILESMODE_MAKEDEV.local=${BINMODE}
248:
249: CONFIGFILES+= crontab
250: FILESDIR_crontab= /var/cron/tabs
251: FILESNAME_crontab= root
252: FILESMODE_crontab= 600
253:
254: CONFIGFILES+= minfree
255: FILESDIR_minfree= /var/crash
256: FILESMODE_minfree= 600
257:
258: CONFIGSYMLINKS+= ${TZDIR}/${LOCALTIME} /etc/localtime \
259: /usr/sbin/rmt /etc/rmt
260:
261:
1.242 lukem 262: # install-etc-files --
263: # Install etc (config) files; not performed by "make build"
264: #
1.340 apb 265: install-etc-files: .PHONY .MAKE check_DESTDIR MAKEDEV
1.291 lukem 266: ${_MKMSG_INSTALL} ${DESTDIR}/etc/master.passwd
1.230 perry 267: ${ETC_INSTALL_FILE} -o root -g wheel -m 600 \
268: master.passwd ${DESTDIR}/etc
1.254 lukem 269: ${TOOL_PWD_MKDB} -p ${PWD_MKDB_ENDIAN} -d ${DESTDIR}/ \
1.230 perry 270: ${DESTDIR}/etc/master.passwd
1.255 lukem 271: .if ${MKUNPRIVED} != "no"
1.222 lukem 272: ( \
1.403 christos 273: mode=0600; \
274: for metaent in spwd.db passwd pwd.db; do \
275: echo "./etc/$${metaent} type=file mode=$${mode} uname=root gname=wheel tags=etc_pkg"; \
276: mode=0644; \
1.246 lukem 277: done; \
1.239 lukem 278: ) | ${METALOG.add}
1.255 lukem 279: .endif # MKUNPRIVED != no
1.291 lukem 280: ${_MKMSG_INSTALL} ${DESTDIR}/etc/ttys
1.289 christos 281: ${ETC_INSTALL_OBJ_FILE} -o ${BINOWN} -g ${BINGRP} -m 644 \
1.298 christos 282: ${.CURDIR}/etc.${MACHINE}/ttys ${DESTDIR}/etc
1.351 ad 283: .if exists(etc.${MACHINE}/boot.cfg)
284: ${_MKMSG_INSTALL} ${DESTDIR}/boot.cfg
285: ${ETC_INSTALL_OBJ_FILE} -o ${BINOWN} -g ${BINGRP} -m 644 \
286: ${.CURDIR}/etc.${MACHINE}/boot.cfg ${DESTDIR}/
287: .endif
1.291 lukem 288: ${_MKMSG_INSTALL} ${DESTDIR}/dev/MAKEDEV
1.259 ross 289: ${ETC_INSTALL_OBJ_FILE} -o ${BINOWN} -g ${BINGRP} -m 555 \
1.257 jdolecek 290: MAKEDEV ${DESTDIR}/dev
1.291 lukem 291: .for owner group mode file in \
292: ${BINOWN} operator 664 /etc/dumpdates \
293: ${BINOWN} operator 600 /etc/skeykeys \
294: root wheel 600 /var/at/at.deny \
1.378 dholland 295: root wheel 644 /var/db/locate.database \
1.291 lukem 296: ${BINOWN} ${BINGRP} 600 /var/log/authlog \
297: root wheel 600 /var/log/cron \
1.313 lukem 298: ${BINOWN} ${UTMPGRP} 664 /var/log/lastlog \
299: ${BINOWN} ${UTMPGRP} 664 /var/log/lastlogx \
1.291 lukem 300: ${BINOWN} ${BINGRP} 640 /var/log/lpd-errs \
301: ${BINOWN} ${BINGRP} 600 /var/log/maillog \
302: ${BINOWN} ${BINGRP} 644 /var/log/messages \
303: ${BINOWN} ${BINGRP} 600 /var/log/secure \
1.313 lukem 304: ${BINOWN} ${UTMPGRP} 664 /var/log/wtmp \
305: ${BINOWN} ${UTMPGRP} 664 /var/log/wtmpx \
1.291 lukem 306: ${BINOWN} ${BINGRP} 600 /var/log/xferlog \
307: daemon staff 664 /var/msgs/bounds \
308: ${BINOWN} ${UTMPGRP} 664 /var/run/utmp \
309: ${BINOWN} ${UTMPGRP} 664 /var/run/utmpx \
310: games games 664 /var/games/atc_score \
311: games games 664 /var/games/battlestar.log \
312: games games 664 /var/games/cfscores \
313: games games 664 /var/games/criblog \
314: games games 660 /var/games/hackdir/perm \
315: games games 660 /var/games/hackdir/record \
316: games games 664 /var/games/larn/llog12.0 \
317: games games 664 /var/games/larn/lscore12.0 \
318: games games 664 /var/games/larn/playerids \
319: games games 664 /var/games/robots_roll \
320: games games 664 /var/games/rogue.scores \
321: games games 664 /var/games/saillog \
322: games games 664 /var/games/snakerawscores \
323: games games 664 /var/games/snake.log \
324: games games 664 /var/games/tetris.scores
325: ${_MKMSG_INSTALL} ${DESTDIR}${file}
1.385 uebayasi 326: if [ ! -e ${DESTDIR}${file} -o -s ${DESTDIR}${file} ]; then \
327: ${ETC_INSTALL_FILE} -o ${owner} -g ${group} -m ${mode} \
328: /dev/null ${DESTDIR}${file}; \
329: else true; fi
1.291 lukem 330: .endfor
1.363 jmmv 331: .for subdir in . defaults bluetooth iscsi mtree namedb pam.d powerd rc.d root skel ssh
1.291 lukem 332: ${MAKEDIRTARGET} ${subdir} configinstall
333: .endfor
1.357 joerg 334: ${MAKEDIRTARGET} ${NETBSDSRCDIR}/external/bsd/dhcpcd/sbin/dhcpcd configinstall
1.287 lukem 335: ${MAKEDIRTARGET} ${NETBSDSRCDIR}/usr.bin/mail configinstall
1.303 peter 336: .if (${MKPF} != "no")
1.294 yamt 337: ${MAKEDIRTARGET} ${NETBSDSRCDIR}/usr.sbin/pf configinstall
1.303 peter 338: .endif
1.155 thorpej 339: .if (${MKCRYPTO} != "no")
1.369 mrg 340: ${MAKEDIRTARGET} ${NETBSDSRCDIR}/crypto/external/bsd/openssh/bin configinstall
1.155 thorpej 341: .endif
1.304 lukem 342: .if (${MKPOSTFIX} != "no")
1.367 tron 343: ${MAKEDIRTARGET} ${NETBSDSRCDIR}/external/ibm-public/postfix configinstall
1.304 lukem 344: .endif
1.363 jmmv 345: .if (${MKATF} != "no")
346: ${MAKEDIRTARGET} ${NETBSDSRCDIR}/external/bsd/atf/etc/atf configinstall
347: .endif
1.406 jmmv 348: .if (${MKKYUA} != "no")
349: ${MAKEDIRTARGET} ${NETBSDSRCDIR}/external/bsd/kyua-cli/etc/kyua configinstall
350: .endif
1.247 lukem 351:
352:
353: # install-obsolete-lists --
354: # Install var/db/obsolete set lists; this is performed by "make build"
355: #
356: OBSOLETE.dir= ${.OBJDIR}/obsolete.dir
1.405 matt 357: OBSOLETE.files= base comp etc games man misc text
358: .if ${MKDEBUG} != "no"
359: OBSOLETE.files+= debug
360: .endif
1.376 he 361: .if ${MKKMOD} != "no"
362: OBSOLETE.files+= modules
363: .endif
1.383 njoly 364: .if ${MKATF} != "no"
365: OBSOLETE.files+= tests
366: .endif
1.360 mrg 367: .if ${MKX11} != "no"
1.311 lukem 368: OBSOLETE.files+= xbase xcomp xetc xfont xserver
1.307 tron 369: .endif
1.247 lukem 370:
1.387 uebayasi 371: # XXX make "makeobsolete" set wise; then generate files respectively
1.322 dsl 372: install-obsolete-lists: .PHONY .MAKE
1.246 lukem 373: mkdir -p ${OBSOLETE.dir}
1.360 mrg 374: .if ${MKX11} != "no"
1.307 tron 375: (cd ${NETBSDSRCDIR}/distrib/sets && \
1.364 sketch 376: AWK=${TOOL_AWK:Q} MAKE=${MAKE:Q} ${HOST_SH} ./makeobsolete -b -t ${OBSOLETE.dir})
1.307 tron 377: .else
1.253 lukem 378: (cd ${NETBSDSRCDIR}/distrib/sets && \
1.364 sketch 379: AWK=${TOOL_AWK:Q} MAKE=${MAKE:Q} ${HOST_SH} ./makeobsolete -t ${OBSOLETE.dir})
1.307 tron 380: .endif
1.246 lukem 381: .for file in ${OBSOLETE.files}
1.291 lukem 382: ${_MKMSG_INSTALL} ${DESTDIR}/var/db/obsolete/${file}
1.387 uebayasi 383: if [ ! -e ${DESTDIR}/var/db/obsolete/${file} ] || \
384: ! cmp -s ${OBSOLETE.dir}/${file} ${DESTDIR}/var/db/obsolete/${file}; then \
385: ${ETC_INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} -m 644 \
386: ${OBSOLETE.dir}/${file} ${DESTDIR}/var/db/obsolete; \
387: else true; fi
1.246 lukem 388: .endfor
1.1 cgd 389:
1.242 lukem 390:
391: # distrib-dirs --
392: # Populate $DESTDIR with directories needed by NetBSD
393: #
1.371 mrg 394: distrib-dirs: .PHONY check_DESTDIR
395: cd ${NETBSDSRCDIR}/etc/mtree && ${MAKE} distrib-dirs
1.255 lukem 396:
1.242 lukem 397:
398: # release, snapshot --
399: # Build a full distribution including kernels & install media.
400: #
1.324 dsl 401: release snapshot: .PHONY .MAKE check_DESTDIR check_RELEASEDIR snap_md_post
1.285 lukem 402: ${MAKEDIRTARGET} ${NETBSDSRCDIR}/distrib/sets sets
1.315 jmc 403: ${MAKESUMS} -A -t ${RELEASEDIR}/${RELEASEMACHINEDIR}/binary/sets \
404: ${KERNEL_SETS:@.SETS.@kern-${.SETS.}.tgz@}
1.286 cl 405: ${MAKESUMS} -t ${RELEASEDIR}/${RELEASEMACHINEDIR}/binary/kernel '*.gz'
1.161 hubertf 406:
1.242 lukem 407:
408: # iso-image --
409: # Standalone target to create a CDROM image after the release
410: # was composed. Should be run after "make release" in src and xsrc.
1.341 bouyer 411: # The do-iso-image is to be called from etc.$MACHINE/Makefile.inc
1.242 lukem 412: #
1.245 lukem 413: # Note: At least mkisofs 2.0 should be used.
1.242 lukem 414: #
1.292 he 415: CDROM_NAME_ADD?=
1.415 martin 416: CDROM_IMAGE?=${RELEASEDIR}/images/NetBSD-${DISTRIBVER}-${MACHINE}.iso
1.319 apb 417: CDROM.dir= ${.OBJDIR}/cdrom.dir
418: CDROM.pathlist= ${.OBJDIR}/cdrom.pathlist
1.242 lukem 419:
1.341 bouyer 420: iso-image:
421:
422: .if ${MKISOFS} != true
423: do-iso-image: .PHONY check_DESTDIR check_RELEASEDIR iso-image-md-post
1.415 martin 424: ${MAKESUMS} -t ${RELEASEDIR}/images/ '*.iso'
1.395 joerg 425: @echo "iso-image created as: ${CDROM_IMAGE}"
1.341 bouyer 426: .else
427: do-iso-image:
428: @echo iso-image: mkisofs not found
429: .endif
1.161 hubertf 430:
1.275 lukem 431: iso-image-setup: .PHONY check_RELEASEDIR
1.242 lukem 432: rm -f ${CDROM.pathlist}
1.302 fredb 433: .for extra in README SOURCE_DATE source
434: .if exists(${RELEASEDIR}/${extra})
435: echo "${extra}=${RELEASEDIR}/${extra}" >> ${CDROM.pathlist}
436: .endif
437: .endfor
1.342 bad 438: echo "${MACHINE}/=${RELEASEDIR}/${RELEASEMACHINEDIR}/" >> ${CDROM.pathlist}
1.242 lukem 439: mkdir -p ${CDROM.dir}
1.415 martin 440:
441: check_imagedir:
442: mkdir -p ${RELEASEDIR}/images
1.242 lukem 443:
1.248 lukem 444: # iso-image-mi --
1.242 lukem 445: # Create the image after the MD operations have completed.
1.248 lukem 446: #
1.415 martin 447: iso-image-mi: .PHONY check_DESTDIR check_RELEASEDIR iso-image-md-pre check_imagedir
1.242 lukem 448: @if ! ${MKISOFS} --version; then \
1.320 apb 449: echo "install pkgsrc/sysutils/cdrtools and run 'make iso-image'." ; \
1.242 lukem 450: false; \
1.161 hubertf 451: fi
1.242 lukem 452: ${MKISOFS} ${MKISOFS_FLAGS} -graft-points -path-list ${CDROM.pathlist} \
1.395 joerg 453: -o ${CDROM_IMAGE} ${CDROM.dir}
1.242 lukem 454:
1.248 lukem 455: # iso-image-md-pre --
1.242 lukem 456: # Setup ${CDROM.dir} to produce a bootable CD image.
457: # Overridden by etc.$MACHINE/Makefile.inc
458: #
1.324 dsl 459: iso-image-md-pre: .PHONY check_DESTDIR check_RELEASEDIR iso-image-setup
1.242 lukem 460: # (empty -- look in the machine-dependent Makefile.inc)
1.161 hubertf 461:
1.248 lukem 462: # iso-image-md-post --
1.242 lukem 463: # Fixup the CD-image to be bootable.
464: # Overridden by etc.$MACHINE/Makefile.inc
465: #
1.324 dsl 466: iso-image-md-post: .PHONY check_DESTDIR check_RELEASEDIR iso-image-mi
1.242 lukem 467: # (empty -- look in the machine-dependent Makefile.inc)
1.41 cgd 468:
1.242 lukem 469:
1.396 tsutsui 470: # live-image --
471: # Standalone target to create live images after the release was composed.
472: # Should be run after "make release" in src and xsrc.
473: # LIVEIMG_RELEASEDIR specifies where to install live images and
474: # it can be set in MD etc.${MACHINE}/Makefile.inc.
475: #
1.398 riz 476: LIVEIMG_RELEASEDIR?= ${RELEASEDIR}/images
1.396 tsutsui 477:
478: live-image: .PHONY check_DESTDIR check_RELEASEDIR
479: ${MAKEDIRTARGET} ${NETBSDSRCDIR}/distrib live_image \
480: LIVEIMG_RELEASEDIR=${LIVEIMG_RELEASEDIR}
481: ${MAKESUMS} -t ${LIVEIMG_RELEASEDIR} '*.img.gz'
482:
483: # install-image --
484: # Standalone target to create installation images
485: # after the release was composed.
486: # Should be run after "make release" in src and xsrc.
487: # INSTIMG_RELEASEDIR specifies where to install live images and
488: # it can be set in MD etc.${MACHINE}/Makefile.inc.
489: #
1.398 riz 490: INSTIMG_RELEASEDIR?= ${RELEASEDIR}/images
1.396 tsutsui 491:
492: install-image: .PHONY check_DESTDIR check_RELEASEDIR
493: ${MAKEDIRTARGET} ${NETBSDSRCDIR}/distrib install_image \
494: INSTIMG_RELEASEDIR=${INSTIMG_RELEASEDIR}
495: ${MAKESUMS} -t ${INSTIMG_RELEASEDIR} '*.img.gz'
496:
1.242 lukem 497: # snap_pre --
498: # Create ${RELEASEDIR} and necessary subdirectories.
499: #
1.324 dsl 500: snap_pre: .PHONY check_DESTDIR check_RELEASEDIR distribution
1.241 lukem 501: ${INSTALL} -d -m 755 ${RELEASEDIR}
1.255 lukem 502: .if ${MKUPDATE} == "no"
1.168 jmc 503: # Could be a mount point, ignore the errors
1.286 cl 504: -/bin/rm -rf ${RELEASEDIR}/${RELEASEMACHINEDIR}
1.240 lukem 505: .endif
1.286 cl 506: ${INSTALL} -d -m 755 ${RELEASEDIR}/${RELEASEMACHINEDIR}
1.117 simonb 507: .for dir in ${INSTALLATION_DIRS}
1.286 cl 508: ${INSTALL} -d -m 755 ${RELEASEDIR}/${RELEASEMACHINEDIR}/${dir}
1.117 simonb 509: .endfor
1.96 cjs 510:
1.242 lukem 511: # snap_post --
512: # Build the install media and notes from distrib
513: #
1.324 dsl 514: snap_post: .PHONY .MAKE build_kernelsets build_releasekernels
1.255 lukem 515: .if ${MKUPDATE} == "no"
1.233 lukem 516: cd ${NETBSDSRCDIR}/distrib && ${MAKE} cleandir
517: .endif
518: cd ${NETBSDSRCDIR}/distrib && ${MAKE} depend && ${MAKE} && \
519: ${MAKE} release
520:
1.324 dsl 521: # build kernels --
1.242 lukem 522: # This target builds the kernels specified by each port.
523: # A port may specify the following kernels:
1.196 thorpej 524: #
525: # KERNEL_SETS The list of kernels that will be
526: # packaged into sets, named
527: # kern-${kernel}.tgz. These kernels
1.203 chs 528: # are also placed in the binary/kernel
1.196 thorpej 529: # area of the release package as
530: # netbsd-${kernel}.gz.
531: #
532: # EXTRA_KERNELS Additional kernels to place in the
1.203 chs 533: # binary/kernel area of the release
1.196 thorpej 534: # package as netbsd-${kernel}.gz, but
535: # which are not placed into sets. This
536: # allows a port to provide e.g. a netbootable
537: # installation kernel containing a ramdisk.
538: #
539: # BUILD_KERNELS Additional kernels to build which are
540: # not placed into sets nor into the
1.203 chs 541: # binary/kernel area of the release
1.196 thorpej 542: # package. These are typically kernels
543: # that are built for inclusion only in
544: # installation disk/CD-ROM/tape images.
1.116 fair 545: #
1.242 lukem 546: # A port may also specify KERNEL_SUFFIXES, which is an optional list
547: # of filename suffixes for kernels to include in the kernel sets and
548: # in the binary/kernel area of the release package (e.g. "netbsd" vs.
549: # "netbsd.ecoff" and "netbsd.srec"). It is not an error if kernels
550: # with these suffixes do not exist in the kernel build directory.
1.197 thorpej 551: #
1.229 lukem 552: #
553: # A list of all the kernels to build, which can be overridden from
554: # external sources (such as make(1)'s environment or command line)
555: #
556: ALL_KERNELS?= ${KERNEL_SETS} ${EXTRA_KERNELS} ${BUILD_KERNELS}
1.402 mlelstv 557: .export ALL_KERNELS
1.242 lukem 558:
1.359 apb 559: GETKERNELAWK= ${TOOL_AWK} '/^config/ {print $$2; found=1} \
1.116 fair 560: END{ if (found == 0) print "netbsd"; }'
1.242 lukem 561:
1.324 dsl 562: build_kernels: .PHONY
1.232 lukem 563: # Configure & compile kernels listed in ${ALL_KERNELS}
564: #
1.284 cgd 565: # The 'sync' is so that all writes during the build are pushed back
566: # to the disk. Not having it causes problems on some host systems
567: # (e.g. Linux) when building on NFS.
568: #
1.201 lukem 569: .if !defined(KERNELS_DONE) # {
1.232 lukem 570: .for configfile in ${ALL_KERNELS} # {
1.324 dsl 571: build_kernels: kern-${configfile}
1.322 dsl 572: kern-${configfile}: .PHONY .MAKE
1.254 lukem 573: cd ${KERNCONFDIR} && ${TOOL_CONFIG} -s ${KERNSRCDIR} \
1.413 martin 574: -U DEBUG -b ${KERNOBJDIR}/${configfile:C/.*\///} ${configfile}
1.255 lukem 575: .if ${MKUPDATE} == "no"
1.200 lukem 576: cd ${KERNOBJDIR}/${configfile:C/.*\///} && ${MAKE} distclean
1.96 cjs 577: .endif
1.218 sommerfe 578: cd ${KERNOBJDIR}/${configfile:C/.*\///} && ${MAKE} depend && ${MAKE}
1.284 cgd 579: sync
1.232 lukem 580: .endfor # ALL_KERNELS # }
581: .endif # KERNELS_DONE # }
582:
1.324 dsl 583: build_kernelsets: .PHONY
1.241 lukem 584: # Create kernel sets from ${KERNEL_SETS} into
1.286 cl 585: # ${RELEASEDIR}/${RELEASEMACHINEDIR}/binary/sets
1.232 lukem 586: #
587: .for configfile in ${KERNEL_SETS} # {
1.402 mlelstv 588: .for configsel in ${ALL_KERNELS}
589: .if ${configfile} == ${configsel}
1.324 dsl 590: build_kernelsets: kernset-${configfile}
591: kernset-${configfile}: .PHONY build_kernels snap_pre
1.384 christos 592: @ kernlist=$$(${GETKERNELAWK} ${KERNCONFDIR}/${configfile}); \
1.197 thorpej 593: kerndir=${KERNOBJDIR}/${configfile:C/.*\///}; \
1.256 dsl 594: kernsuffixes="${KERNEL_SUFFIXES:S/^/./}"; \
1.286 cl 595: kern_tgz=${RELEASEDIR}/${RELEASEMACHINEDIR}/binary/sets/kern-${configfile}.tgz; \
1.412 apb 596: pax_cmd="COMPRESS_PROGRAM=${TOOL_GZIP:Q} GZIP=-9n ${TOOL_PAX} -O -zw -M -N ${NETBSDSRCDIR}/etc -f $${kern_tgz}"; \
1.256 dsl 597: cd $${kerndir} && { \
598: kernels=; newest=; \
1.210 lukem 599: for kernel in $${kernlist}; do \
1.256 dsl 600: for s in "" $${kernsuffixes}; do \
601: ks="$${kernel}$${s}"; \
602: [ -f $${ks} ] || continue; \
603: kernels="$${kernels} $${ks}"; \
604: [ -z "$${newest}" -o $${ks} -nt "$${newest}" ] && \
605: newest=$${ks}; \
1.197 thorpej 606: done; \
1.256 dsl 607: done; \
608: [ $${kern_tgz} -nt "$${newest}" ] || { \
609: echo "echo $${kernels} | $${pax_cmd}"; \
610: ( echo "/set uname=${BINOWN} gname=${BINGRP}"; \
611: echo ". type=dir optional"; \
612: for kernel in $${kernels}; do \
613: echo "./$${kernel} type=file"; \
614: done ) | eval $${pax_cmd}; \
615: } \
616: }
1.402 mlelstv 617: .endif
618: .endfor
1.232 lukem 619: .endfor # KERNEL_SETS # }
620:
1.324 dsl 621: build_releasekernels: .PHONY
1.232 lukem 622: # Build kernel.gz from ${KERNEL_SETS} ${EXTRA_KERNELS} into
1.286 cl 623: # ${RELEASEDIR}/${RELEASEMACHINEDIR}/binary/kernel
1.232 lukem 624: #
625: .for configfile in ${KERNEL_SETS} ${EXTRA_KERNELS} # {
1.402 mlelstv 626: .for configsel in ${ALL_KERNELS}
627: .if ${configfile} == ${configsel}
1.324 dsl 628: build_releasekernels: releasekern-${configfile}
629: releasekern-${configfile}: .PHONY build_kernels snap_pre
1.384 christos 630: @ kernlist=$$(${GETKERNELAWK} ${KERNCONFDIR}/${configfile:C/.*\///}); \
1.197 thorpej 631: kerndir=${KERNOBJDIR}/${configfile:C/.*\///}; \
1.256 dsl 632: kernsuffixes="${KERNEL_SUFFIXES:S/^/./}"; \
633: cd $${kerndir} && { \
634: for kernel in $${kernlist}; do \
635: for s in "" $${kernsuffixes}; do \
636: ks="$${kernel}$${s}"; \
637: [ ! -f $${ks} ] && continue; \
1.382 tsutsui 638: knl_gz="${RELEASEDIR}/${RELEASEMACHINEDIR}/binary/kernel/$${kernel}-${configfile:C/.*\///}$${s}.gz"; \
1.256 dsl 639: [ $${knl_gz} -nt $${ks} ] && continue; \
1.352 gdt 640: rm -f $${knl_gz}; \
1.417 ! apb 641: echo "${TOOL_GZIP_N} -c -9 < $${kerndir}/$${ks} > $${knl_gz}"; \
! 642: ${TOOL_GZIP_N} -c -9 < $${ks} > $${knl_gz}; \
1.197 thorpej 643: done; \
1.256 dsl 644: done; \
645: }
1.402 mlelstv 646: .endif
647: .endfor
1.232 lukem 648: .endfor # KERNEL_SETS EXTRA_KERNELS # }
649:
1.242 lukem 650: # snap_md_post --
651: # Machine dependent distribution media operations.
652: # Overridden by etc.$MACHINE/Makefile.inc
653: #
1.324 dsl 654: snap_md_post: .PHONY check_DESTDIR check_RELEASEDIR snap_post
1.242 lukem 655: # (empty -- look in the machine-dependent Makefile.inc)
656:
657:
658: clean:
1.246 lukem 659: -rm -rf ${CDROM.dir} ${CDROM.pathlist} ${OBSOLETE.dir}
1.7 cgd 660:
1.392 jym 661: SUBDIR= defaults rc.d mtree
1.362 cube 662:
1.1 cgd 663: .include <bsd.prog.mk>
1.362 cube 664: .include <bsd.subdir.mk>
1.309 tron 665:
666: test:
667: @echo ${OBSOLETE.files}
CVSweb <webmaster@jp.NetBSD.org>