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