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

Annotation of src/etc/Makefile, Revision 1.249

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

CVSweb <webmaster@jp.NetBSD.org>