[BACK]Return to Makefile CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / src / etc

Annotation of src/etc/Makefile, Revision 1.254

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

CVSweb <webmaster@jp.NetBSD.org>