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

Annotation of src/etc/Makefile, Revision 1.390

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

CVSweb <webmaster@jp.NetBSD.org>