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

Annotation of src/etc/Makefile, Revision 1.116

1.116   ! fair        1: #      $NetBSD: Makefile,v 1.115 1999/04/08 08:24:44 fair 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
                     15: #      ${KERNSRCDIR}/arch/${MACHINE}/compile/KERNELNAME, but can be
                     16: #      overridden.
                     17: #   KERNCONFDIR is where the configuration files for kernels are found;
                     18: #      default is ${KERNSRCDIR}/arch/${MACHINE}/conf but can be overridden.
1.97      cjs        19: #   UPDATE is normally undefined; if defined, don't do a 'make clean'
                     20: #      before kernel compile
1.96      cjs        21: #   NO_SENDMAIL is normally undefined; if defined, it will not do a
                     22: #      `make distribution' in the sendmail config file source directory.
                     23: #   USE_BIND4 is normally unset; if set, it will install a named.boot
                     24: #      instead of a named.conf in etc/namedb.
                     25: #   EXTRA_KERNELS has a machine-dependent list of kernels to build added
                     26: #      to it, but you may also set this to have extra ones built.
                     27: #
                     28: # Targets:
                     29: #    distribution: makes a full NetBSD distribution in DESTDIR. If
                     30: #      INSTALL_DONE is set, it will not do a `make install.'
                     31: #    distrib-dirs: creates an empty NetBSD directory tree in DESTDIR.
                     32: #      Called by distribution.
                     33: #    snapshot: calls distribution, above, and then tars up the files
                     34: #      into a release(7) format in RELEASEDIR. Any port-dependent
                     35: #      stuff for this target is found in etc.${MACHINE}/Makefile.inc.
1.106     cjs        36: #    release: a synonym for `snapshot'
1.96      cjs        37:
1.91      tron       38: # XXX: For NO_SENDMAIL and USE_BIND4
1.90      kim        39: .include <bsd.own.mk>
                     40:
1.23      cgd        41: TZDIR=         /usr/share/zoneinfo
1.90      kim        42: LOCALTIME?=    US/Pacific
1.19      deraadt    43:
1.55      perry      44: # setting NOOBJ prevents "make obj" from doing anything;
                     45: # an objdir would break the installation stuff below
1.101     lukem      46: MKOBJ= no
1.1       cgd        47:
1.80      jonathan   48: # MD Makefile.inc may append MD targets to BIN[123].  Make sure all
                     49: # are empty, to preserve the old semantics of setting them below with "=".
                     50: BIN1=
                     51: BIN2=
                     52: BIN3=
                     53:
1.71      cjs        54: .if exists(etc.${MACHINE}/Makefile.inc)
                     55: .include "etc.${MACHINE}/Makefile.inc"
                     56: .endif
1.32      jtc        57:
1.96      cjs        58: # Use multiple jobs for kernel builds, if NBUILDJOBS set.
                     59: # (Taken from src/Makefile.)
                     60: .if defined(NBUILDJOBS)
                     61: _J= -j${NBUILDJOBS}
                     62: .endif
                     63:
1.21      cgd        64: # -rw-r--r--
                     65: BINOWN= root
                     66: BINGRP= wheel
1.92      perry      67: BIN1+= aliases bootptab changelist csh.cshrc csh.login \
                     68:        csh.logout daily daily.conf dm.conf floppytab ftpchroot \
                     69:        ftpusers ftpwelcome gettytab group hosts hosts.lpd \
1.105     mycroft    70:        inetd.conf lkm.conf mailer.conf man.conf \
1.92      perry      71:        monthly monthly.conf mrouted.conf netstart networks \
1.94      lukem      72:        newsyslog.conf nsswitch.conf phones printcap profile protocols \
1.92      perry      73:        rbootd.conf rc rc.conf rc.lkm rc.local rc.subr \
1.108     drochner   74:        rc.shutdown rc.wscons remote rpc security security.conf services \
1.109     drochner   75:        shells syslog.conf weekly weekly.conf wscons.conf \
                     76:        etc.${MACHINE}/ttys etc.${MACHINE}/disktab
1.105     mycroft    77:
                     78: .if    (${MACHINE_ARCH} == "i386") || \
                     79:        (${MACHINE_ARCH} == "m68k") || \
                     80:        (${MACHINE_ARCH} == "ns32k") || \
                     81:        (${MACHINE_ARCH} == "sparc") || \
                     82:        (${MACHINE_ARCH} == "vax") || \
                     83:        (${MACHINE_ARCH} == "arm32")
                     84: BIN1+= ld.so.conf
                     85: .endif
1.1       cgd        86:
1.46      deraadt    87: # -rw-rw-r--
1.80      jonathan   88: BIN2+= motd
1.1       cgd        89:
1.77      mycroft    90: # -rw-------
1.80      jonathan   91: BIN3+= hosts.equiv
1.77      mycroft    92:
1.95      mycroft    93: NAMEDB=        127 root.cache
1.91      tron       94: .ifdef USE_BIND4
                     95: NAMEDB+=       named.boot
                     96: .else
1.90      kim        97: NAMEDB+=       named.conf
                     98: .endif
1.1       cgd        99: PCS=   pcs750.bin
                    100:
1.88      lukem     101: all clean cleandir depend distclean etc includes install lint:
1.1       cgd       102:
1.34      cgd       103: .ifndef DESTDIR
1.106     cjs       104: distribution distrib-dirs release snapshot:
1.36      cgd       105:        @echo setenv DESTDIR before doing that!
1.34      cgd       106:        @false
                    107: .else
1.7       cgd       108: distribution: distrib-dirs
1.87      perry     109: .if !defined(INSTALL_DONE)
1.107     scottr    110:        (cd ..; ${MAKE} _DISTRIB= includes)
                    111:        (cd ..; ${MAKE} _DISTRIB= install)
1.87      perry     112: .endif
1.56      thorpej   113:        ${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 644 ${BIN1} ${DESTDIR}/etc
                    114:        ${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 664 ${BIN2} ${DESTDIR}/etc
1.77      mycroft   115:        ${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 600 ${BIN3} ${DESTDIR}/etc
1.56      thorpej   116:        ${INSTALL} -c -o root -g wheel -m 600 crontab \
                    117:            ${DESTDIR}/var/cron/tabs/root
                    118:        ${INSTALL} -c -o root -g wheel -m 600 master.passwd ${DESTDIR}/etc
1.68      perry     119:        pwd_mkdb -p -d ${DESTDIR}/ ${DESTDIR}/etc/master.passwd
1.56      thorpej   120:        ${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 555 \
1.1       cgd       121:             MAKEDEV.local etc.${MACHINE}/MAKEDEV ${DESTDIR}/dev
1.73      perry     122:        ${INSTALL} -c -o root -g wheel -m 600 minfree \
                    123:            ${DESTDIR}/var/crash
1.1       cgd       124:        (cd root; \
1.56      thorpej   125:                ${INSTALL} -c -o root -g wheel -m 644 dot.cshrc \
1.1       cgd       126:                    ${DESTDIR}/root/.cshrc; \
1.65      mikel     127:                ${INSTALL} -c -o root -g wheel -m 600 dot.klogin \
1.1       cgd       128:                    ${DESTDIR}/root/.klogin; \
1.56      thorpej   129:                ${INSTALL} -c -o root -g wheel -m 644 dot.login \
1.1       cgd       130:                    ${DESTDIR}/root/.login; \
1.56      thorpej   131:                ${INSTALL} -c -o root -g wheel -m 644 dot.profile \
1.1       cgd       132:                    ${DESTDIR}/root/.profile; \
                    133:                rm -f ${DESTDIR}/.cshrc ${DESTDIR}/.profile; \
                    134:                ln ${DESTDIR}/root/.cshrc ${DESTDIR}/.cshrc; \
                    135:                ln ${DESTDIR}/root/.profile ${DESTDIR}/.profile)
1.83      mrg       136:        (cd mtree; ${MAKE} install)
1.63      mikel     137:        (cd namedb; \
                    138:                ${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 644 ${NAMEDB} \
1.64      pk        139:                    ${DESTDIR}/etc/namedb)
1.19      deraadt   140:        /bin/rm -f ${DESTDIR}/etc/localtime
                    141:        ln -s ${TZDIR}/${LOCALTIME} ${DESTDIR}/etc/localtime
1.48      deraadt   142:        /bin/rm -f ${DESTDIR}/etc/rmt
                    143:        ln -s /usr/sbin/rmt ${DESTDIR}/etc/rmt
1.56      thorpej   144:        ${INSTALL} -c -o ${BINOWN} -g operator -m 664 /dev/null \
1.32      jtc       145:                ${DESTDIR}/etc/dumpdates
1.93      abs       146:        ${INSTALL} -c -o ${BINOWN} -g operator -m 600 /dev/null \
1.44      deraadt   147:                ${DESTDIR}/etc/skeykeys
1.56      thorpej   148:        ${INSTALL} -c -o root -g wheel -m 600 /dev/null \
1.38      cgd       149:                ${DESTDIR}/var/cron/log
1.56      thorpej   150:        ${INSTALL} -c -o nobody -g ${BINGRP} -m 664 /dev/null \
1.32      jtc       151:                ${DESTDIR}/var/db/locate.database
1.113     fair      152:        ${INSTALL} -c -o uucp -g dialer -m 640 /dev/null \
                    153:                ${DESTDIR}/var/log/aculog
1.69      perry     154:        ${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 600 /dev/null \
                    155:                ${DESTDIR}/var/log/authlog
1.56      thorpej   156:        ${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 664 /dev/null \
1.32      jtc       157:                ${DESTDIR}/var/log/lastlog
1.58      lukem     158:        ${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 640 /dev/null \
1.32      jtc       159:                ${DESTDIR}/var/log/lpd-errs
1.58      lukem     160:        ${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 600 /dev/null \
1.32      jtc       161:                ${DESTDIR}/var/log/maillog
1.58      lukem     162:        ${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 644 /dev/null \
1.32      jtc       163:                ${DESTDIR}/var/log/messages
1.58      lukem     164:        ${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 600 /dev/null \
                    165:                ${DESTDIR}/var/log/secure
                    166:        ${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 644 /dev/null \
1.32      jtc       167:                ${DESTDIR}/var/log/wtmp
1.69      perry     168:        ${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 600 /dev/null \
                    169:                ${DESTDIR}/var/log/xferlog
1.56      thorpej   170:        ${INSTALL} -c -o daemon -g staff -m 664 /dev/null \
1.39      cgd       171:                ${DESTDIR}/var/msgs/bounds
1.56      thorpej   172:        ${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 664 /dev/null \
1.32      jtc       173:                ${DESTDIR}/var/run/utmp
1.81      mrg       174:        ${INSTALL} -c -o games -g games -m 664 /dev/null \
                    175:                ${DESTDIR}/var/games/atc_scores
                    176:        ${INSTALL} -c -o games -g games -m 664 /dev/null \
                    177:                ${DESTDIR}/var/games/battlestar.log
                    178:        ${INSTALL} -c -o games -g games -m 664 /dev/null \
                    179:                ${DESTDIR}/var/games/cfscores
                    180:        ${INSTALL} -c -o games -g games -m 664 /dev/null \
1.82      perry     181:                ${DESTDIR}/var/games/criblog
1.81      mrg       182:        ${INSTALL} -c -o games -g games -m 664 /dev/null \
                    183:                ${DESTDIR}/var/games/robots_roll
                    184:        ${INSTALL} -c -o games -g games -m 664 /dev/null \
                    185:                ${DESTDIR}/var/games/rogue.scores
                    186:        ${INSTALL} -c -o games -g games -m 664 /dev/null \
                    187:                ${DESTDIR}/var/games/saillog
                    188:        ${INSTALL} -c -o games -g games -m 664 /dev/null \
                    189:                ${DESTDIR}/var/games/snakerawscores
                    190:        ${INSTALL} -c -o games -g games -m 664 /dev/null \
                    191:                ${DESTDIR}/var/games/snake.log
                    192:        ${INSTALL} -c -o games -g games -m 664 /dev/null \
                    193:                ${DESTDIR}/var/games/tetris.scores
                    194:        ${INSTALL} -c -o games -g games -m 664 /dev/null \
                    195:                ${DESTDIR}/var/games/larn/llog12.0
                    196:        ${INSTALL} -c -o games -g games -m 664 /dev/null \
                    197:                ${DESTDIR}/var/games/larn/lscore12.0
                    198:        ${INSTALL} -c -o games -g games -m 664 /dev/null \
                    199:                ${DESTDIR}/var/games/larn/playerids
1.56      thorpej   200:        (cd etc.${MACHINE}; ${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 444 \
1.6       cgd       201:            fstab.* ${DESTDIR}/etc)
1.49      tls       202:        (cd ${DESTDIR}/dev; ./MAKEDEV all)
1.62      perry     203:        (cd ../usr.bin/mail; ${MAKE} distribution)
1.90      kim       204: .ifndef NO_SENDMAIL
1.35      cgd       205:        (cd ../usr.sbin/sendmail/cf/cf; ${MAKE} distribution)
1.90      kim       206: .endif
1.112     perry     207: .ifdef BUILD_POSTFIX
1.110     mrg       208:        (cd ../usr.sbin/postfix/etc; ${MAKE} distribution)
1.111     simonb    209: .endif
1.1       cgd       210:
                    211:
1.7       cgd       212: distrib-dirs:
1.56      thorpej   213:        ${INSTALL} -d -o root -g wheel -m 755 ${DESTDIR}
1.67      perry     214:        -mtree -def mtree/NetBSD.dist -p ${DESTDIR}/ -u
1.28      jtc       215:        cd ${DESTDIR}; rm -f sys; ln -s usr/src/sys sys
1.99      cjs       216:
1.96      cjs       217: .if !defined(RELEASEDIR)
1.106     cjs       218: release snapshot snap_pre:
1.96      cjs       219:        @echo setenv RELEASEDIR before doing that!
                    220:        @false
                    221: .else
1.100     cjs       222: release snapshot: distribution snap_pre snap_md snap_kern
1.96      cjs       223:        sh ../distrib/sets/maketars -s ../distrib/sets \
                    224:                -d ${DESTDIR} -t ${RELEASEDIR}/binary/sets
1.104     itohy     225: .if exists(../domestic) && !defined(EXPORTABLE_SYSTEM)
1.103     fair      226:        sh ../distrib/sets/maketars -s ../distrib/sets \
                    227:                -d ${DESTDIR} -t ${RELEASEDIR}/binary/security secr
                    228:        (cd ${RELEASEDIR}/binary/security && \
                    229:                cksum -o 1 *.tgz >BSDSUM && \
                    230:                cksum *.tgz >CKSUM && \
                    231:                cksum -m *.tgz >MD5 && \
                    232:                cksum -o 2 *.tgz >SYSVSUM )
                    233: .endif
1.96      cjs       234:        (cd ${RELEASEDIR}/binary/sets && \
                    235:                cksum -o 1 *.tgz >BSDSUM && \
                    236:                cksum *.tgz >CKSUM && \
                    237:                cksum -m *.tgz >MD5 && \
                    238:                cksum -o 2 *.tgz >SYSVSUM )
1.104     itohy     239: .ifdef EXTRA_KERNELS
                    240:        (cd ${RELEASEDIR}/binary/kernel && \
1.96      cjs       241:                cksum -o 1 *.gz >BSDSUM && \
                    242:                cksum *.gz >CKSUM && \
                    243:                cksum -m *.gz >MD5 && \
1.104     itohy     244:                cksum -o 2 *.gz >SYSVSUM )
                    245: .endif
1.41      cgd       246:
                    247: snap_pre:
1.96      cjs       248:        /bin/rm -rf ${RELEASEDIR}
                    249:        ${INSTALL} -d -o root -g wheel -m 755 ${RELEASEDIR}
                    250:        ${INSTALL} -d -o root -g wheel -m 755 ${RELEASEDIR}/binary
                    251:        ${INSTALL} -d -o root -g wheel -m 755 ${RELEASEDIR}/binary/sets
                    252:        ${INSTALL} -d -o root -g wheel -m 755 ${RELEASEDIR}/binary/kernel
                    253:        ${INSTALL} -d -o root -g wheel -m 755 ${RELEASEDIR}/binary/security
                    254:        ${INSTALL} -d -o root -g wheel -m 755 ${RELEASEDIR}/installation
                    255:
                    256: # the regular expression does a basename(1) on .CURDIR so that we don't
                    257: # have to keep looking up .. at compile time.
                    258: KERNSRCDIR?=   ${.CURDIR:C/[^\/]+$//}sys
                    259: KERNOBJDIR?=   ${KERNSRCDIR}/arch/${MACHINE}/compile
                    260: KERNCONFDIR?=  ${KERNSRCDIR}/arch/${MACHINE}/conf
                    261:
                    262: # This target builds the GENERIC kernel (which must exist for all
                    263: # ports) and puts it in binary/sets/kern.tgz, and also builds any
1.114     fair      264: # kernels specified in EXTRA_KERNELS. Since NetBSD's kernel build
                    265: # system can create more than one kernel from a single configuration
                    266: # we figure out how many there are, what they're named, and move them
                    267: # to binary/kernel/${KERNEL}.${CONFIGFILE}.gz - most often KERNEL will
1.116   ! fair      268: # simply be "netbsd". If we don't find the "config" line, assume the
        !           269: # kernel will be "netbsd" (some config files are simple additions on
        !           270: # GENERIC, and just include it).
        !           271: #
        !           272: GETKERNELAWK=  awk '/^config/ {print $$2; found=1} \
        !           273:                END{ if (found == 0) print "netbsd"; }'
1.96      cjs       274: #
                    275: snap_kern:
                    276:        cd ${KERNCONFDIR} && config \
                    277:                -b ${KERNOBJDIR}/GENERIC -s ${KERNSRCDIR} GENERIC
1.97      cjs       278: .ifndef UPDATE
1.96      cjs       279:        cd ${KERNOBJDIR}/GENERIC && ${MAKE} clean
                    280: .endif
1.115     fair      281:        cd ${KERNOBJDIR}/GENERIC && ${MAKE} depend && ${MAKE} ${_J}
1.96      cjs       282:        cd ${KERNOBJDIR}/GENERIC &&     \
1.116   ! fair      283:                tar cf - `${GETKERNELAWK} ${KERNCONFDIR}/GENERIC` |\
1.96      cjs       284:                gzip -c -9 > ${RELEASEDIR}/binary/sets/kern.tgz
1.114     fair      285: .for configfile in ${EXTRA_KERNELS}
1.96      cjs       286:        cd ${KERNCONFDIR} && config \
1.114     fair      287:                -b ${KERNOBJDIR}/${configfile} -s ${KERNSRCDIR} ${configfile}
1.98      cjs       288: .ifndef UPDATE
1.114     fair      289:        cd ${KERNOBJDIR}/${configfile} && ${MAKE} clean
1.96      cjs       290: .endif
1.115     fair      291:        cd ${KERNOBJDIR}/${configfile} && ${MAKE} depend && ${MAKE} ${_J}
1.114     fair      292:        cd ${KERNOBJDIR}/${configfile} &&       \
1.116   ! fair      293:                for kernel in `${GETKERNELAWK} \
1.114     fair      294:                        ${KERNCONFDIR}/${configfile}` ; {   \
                    295:                gzip -c -9 < $${kernel} > \
                    296:                        ${RELEASEDIR}/binary/kernel/$${kernel}.${configfile}.gz ; }
1.96      cjs       297: .endfor # EXTRA_KERNELS
1.108     drochner  298:
1.96      cjs       299: .endif # RELEASEDIR check
1.41      cgd       300:
                    301: snap_md:
                    302: # nothing here -- look in the machine-dependent Makefile.inc
                    303:
1.34      cgd       304: .endif # DESTDIR check
1.7       cgd       305:
1.1       cgd       306: .include <bsd.prog.mk>

CVSweb <webmaster@jp.NetBSD.org>