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