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

Annotation of src/etc/Makefile, Revision 1.280

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

CVSweb <webmaster@jp.NetBSD.org>