Makefile revision 1.97
11.4Sperry# $NetBSD: Makefile,v 1.97 1999/02/07 06:51:41 cjs Exp $ 21.1Snakayama# from: @(#)Makefile 8.7 (Berkeley) 5/25/95 31.1Snakayama 41.1Snakayama# Environment variables without default values: 51.1Snakayama# DESTDIR must be set before anything in this file will work. 61.1Snakayama# RELEASEDIR is where the tarred up stuff for a snapshot or 71.1Snakayama# release will be placed. 81.1Snakayama# 91.1Snakayama# Environment variables with default values: 101.1Snakayama# LOCALTIME will set the default local time for the system you 111.1Snakayama# build; it determines what /etc/localtime is symlink'd to. 121.1Snakayama# KERNSRCDIR points to kernel source; it is set by default to ../sys, 131.1Snakayama# but can be overridden. 141.1Snakayama# KERNOBJDIR is the kernel build directory, it defaults to 151.1Snakayama# ${KERNSRCDIR}/arch/${MACHINE}/compile/KERNELNAME, but can be 161.1Snakayama# overridden. 171.1Snakayama# KERNCONFDIR is where the configuration files for kernels are found; 181.1Snakayama# default is ${KERNSRCDIR}/arch/${MACHINE}/conf but can be overridden. 191.1Snakayama# UPDATE is normally undefined; if defined, don't do a 'make clean' 201.1Snakayama# before kernel compile 211.1Snakayama# NO_SENDMAIL is normally undefined; if defined, it will not do a 221.1Snakayama# `make distribution' in the sendmail config file source directory. 231.1Snakayama# USE_BIND4 is normally unset; if set, it will install a named.boot 241.1Snakayama# instead of a named.conf in etc/namedb. 251.1Snakayama# EXTRA_KERNELS has a machine-dependent list of kernels to build added 261.1Snakayama# to it, but you may also set this to have extra ones built. 271.1Snakayama# 281.1Snakayama# Targets: 291.1Snakayama# distribution: makes a full NetBSD distribution in DESTDIR. If 301.1Snakayama# INSTALL_DONE is set, it will not do a `make install.' 311.1Snakayama# distrib-dirs: creates an empty NetBSD directory tree in DESTDIR. 321.1Snakayama# Called by distribution. 331.1Snakayama# snapshot: calls distribution, above, and then tars up the files 341.1Snakayama# into a release(7) format in RELEASEDIR. Any port-dependent 351.1Snakayama# stuff for this target is found in etc.${MACHINE}/Makefile.inc. 361.1Snakayama 371.1Snakayama# XXX: For NO_SENDMAIL and USE_BIND4 381.1Snakayama.include <bsd.own.mk> 391.1Snakayama 401.1SnakayamaTZDIR= /usr/share/zoneinfo 411.1SnakayamaLOCALTIME?= US/Pacific 421.1Snakayama 431.1Snakayama# setting NOOBJ prevents "make obj" from doing anything; 441.1Snakayama# an objdir would break the installation stuff below 451.1SnakayamaNOOBJ= oobj 461.1Snakayama 471.1Snakayama# MD Makefile.inc may append MD targets to BIN[123]. Make sure all 481.1Snakayama# are empty, to preserve the old semantics of setting them below with "=". 491.1SnakayamaBIN1= 501.1SnakayamaBIN2= 511.1SnakayamaBIN3= 521.1Snakayama 531.1Snakayama.if exists(etc.${MACHINE}/Makefile.inc) 541.4Sperry.include "etc.${MACHINE}/Makefile.inc" 551.1Snakayama.endif 561.1Snakayama 571.1Snakayama# Use multiple jobs for kernel builds, if NBUILDJOBS set. 581.1Snakayama# (Taken from src/Makefile.) 591.1Snakayama.if defined(NBUILDJOBS) 601.1Snakayama_J= -j${NBUILDJOBS} 611.1Snakayama.endif 621.1Snakayama 631.1Snakayama# -rw-r--r-- 641.2SfairBINOWN= root 651.2SfairBINGRP= wheel 661.2SfairBIN1+= aliases bootptab changelist csh.cshrc csh.login \ 671.1Snakayama csh.logout daily daily.conf dm.conf floppytab ftpchroot \ 681.1Snakayama ftpusers ftpwelcome gettytab group hosts hosts.lpd \ 691.1Snakayama inetd.conf ld.so.conf lkm.conf mailer.conf man.conf \ 701.1Snakayama monthly monthly.conf mrouted.conf netstart networks \ 711.1Snakayama newsyslog.conf nsswitch.conf phones printcap profile protocols \ 721.1Snakayama rbootd.conf rc rc.conf rc.lkm rc.local rc.subr \ 731.1Snakayama rc.shutdown remote rpc security security.conf services \ 741.4Sperry shells syslog.conf weekly weekly.conf etc.${MACHINE}/ttys \ 751.1Snakayama etc.${MACHINE}/disktab 761.1Snakayama 771.1Snakayama# -rw-rw-r-- 781.1SnakayamaBIN2+= motd 791.1Snakayama 801.1Snakayama# -rw------- 811.4SperryBIN3+= hosts.equiv 821.1Snakayama 831.1SnakayamaNAMEDB= 127 root.cache 841.1Snakayama.ifdef USE_BIND4 851.1SnakayamaNAMEDB+= named.boot 861.1Snakayama.else 871.1SnakayamaNAMEDB+= named.conf 881.4Sperry.endif 891.1SnakayamaPCS= pcs750.bin 901.1Snakayama 911.1Snakayamaall clean cleandir depend distclean etc includes install lint: 921.1Snakayama 931.1Snakayama.ifndef DESTDIR 941.1Snakayamadistribution distrib-dirs snapshot: 951.1Snakayama @echo setenv DESTDIR before doing that! 961.1Snakayama @false 971.1Snakayama.else 98distribution: distrib-dirs 99.if !defined(INSTALL_DONE) 100 (cd ..; ${MAKE} includes) 101 (cd ..; ${MAKE} install) 102.endif 103 ${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 644 ${BIN1} ${DESTDIR}/etc 104 ${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 664 ${BIN2} ${DESTDIR}/etc 105 ${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 600 ${BIN3} ${DESTDIR}/etc 106 ${INSTALL} -c -o root -g wheel -m 600 crontab \ 107 ${DESTDIR}/var/cron/tabs/root 108 ${INSTALL} -c -o root -g wheel -m 600 master.passwd ${DESTDIR}/etc 109 pwd_mkdb -p -d ${DESTDIR}/ ${DESTDIR}/etc/master.passwd 110 ${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 555 \ 111 MAKEDEV.local etc.${MACHINE}/MAKEDEV ${DESTDIR}/dev 112 ${INSTALL} -c -o root -g wheel -m 600 minfree \ 113 ${DESTDIR}/var/crash 114 (cd root; \ 115 ${INSTALL} -c -o root -g wheel -m 644 dot.cshrc \ 116 ${DESTDIR}/root/.cshrc; \ 117 ${INSTALL} -c -o root -g wheel -m 600 dot.klogin \ 118 ${DESTDIR}/root/.klogin; \ 119 ${INSTALL} -c -o root -g wheel -m 644 dot.login \ 120 ${DESTDIR}/root/.login; \ 121 ${INSTALL} -c -o root -g wheel -m 644 dot.profile \ 122 ${DESTDIR}/root/.profile; \ 123 rm -f ${DESTDIR}/.cshrc ${DESTDIR}/.profile; \ 124 ln ${DESTDIR}/root/.cshrc ${DESTDIR}/.cshrc; \ 125 ln ${DESTDIR}/root/.profile ${DESTDIR}/.profile) 126 (cd mtree; ${MAKE} install) 127 (cd namedb; \ 128 ${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 644 ${NAMEDB} \ 129 ${DESTDIR}/etc/namedb) 130 /bin/rm -f ${DESTDIR}/etc/localtime 131 ln -s ${TZDIR}/${LOCALTIME} ${DESTDIR}/etc/localtime 132 /bin/rm -f ${DESTDIR}/etc/rmt 133 ln -s /usr/sbin/rmt ${DESTDIR}/etc/rmt 134 ${INSTALL} -c -o ${BINOWN} -g operator -m 664 /dev/null \ 135 ${DESTDIR}/etc/dumpdates 136 ${INSTALL} -c -o ${BINOWN} -g operator -m 600 /dev/null \ 137 ${DESTDIR}/etc/skeykeys 138 ${INSTALL} -c -o root -g wheel -m 600 /dev/null \ 139 ${DESTDIR}/var/cron/log 140 ${INSTALL} -c -o nobody -g ${BINGRP} -m 664 /dev/null \ 141 ${DESTDIR}/var/db/locate.database 142 ${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 600 /dev/null \ 143 ${DESTDIR}/var/log/authlog 144 ${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 664 /dev/null \ 145 ${DESTDIR}/var/log/lastlog 146 ${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 640 /dev/null \ 147 ${DESTDIR}/var/log/lpd-errs 148 ${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 600 /dev/null \ 149 ${DESTDIR}/var/log/maillog 150 ${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 644 /dev/null \ 151 ${DESTDIR}/var/log/messages 152 ${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 600 /dev/null \ 153 ${DESTDIR}/var/log/secure 154 ${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 644 /dev/null \ 155 ${DESTDIR}/var/log/wtmp 156 ${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 600 /dev/null \ 157 ${DESTDIR}/var/log/xferlog 158 ${INSTALL} -c -o daemon -g staff -m 664 /dev/null \ 159 ${DESTDIR}/var/msgs/bounds 160 ${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 664 /dev/null \ 161 ${DESTDIR}/var/run/utmp 162 ${INSTALL} -c -o games -g games -m 664 /dev/null \ 163 ${DESTDIR}/var/games/atc_scores 164 ${INSTALL} -c -o games -g games -m 664 /dev/null \ 165 ${DESTDIR}/var/games/battlestar.log 166 ${INSTALL} -c -o games -g games -m 664 /dev/null \ 167 ${DESTDIR}/var/games/cfscores 168 ${INSTALL} -c -o games -g games -m 664 /dev/null \ 169 ${DESTDIR}/var/games/criblog 170 ${INSTALL} -c -o games -g games -m 664 /dev/null \ 171 ${DESTDIR}/var/games/robots_roll 172 ${INSTALL} -c -o games -g games -m 664 /dev/null \ 173 ${DESTDIR}/var/games/rogue.scores 174 ${INSTALL} -c -o games -g games -m 664 /dev/null \ 175 ${DESTDIR}/var/games/saillog 176 ${INSTALL} -c -o games -g games -m 664 /dev/null \ 177 ${DESTDIR}/var/games/snakerawscores 178 ${INSTALL} -c -o games -g games -m 664 /dev/null \ 179 ${DESTDIR}/var/games/snake.log 180 ${INSTALL} -c -o games -g games -m 664 /dev/null \ 181 ${DESTDIR}/var/games/tetris.scores 182 ${INSTALL} -c -o games -g games -m 664 /dev/null \ 183 ${DESTDIR}/var/games/larn/llog12.0 184 ${INSTALL} -c -o games -g games -m 664 /dev/null \ 185 ${DESTDIR}/var/games/larn/lscore12.0 186 ${INSTALL} -c -o games -g games -m 664 /dev/null \ 187 ${DESTDIR}/var/games/larn/playerids 188 (cd etc.${MACHINE}; ${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 444 \ 189 fstab.* ${DESTDIR}/etc) 190 (cd ${DESTDIR}/dev; ./MAKEDEV all) 191 (cd ../usr.bin/mail; ${MAKE} distribution) 192.ifndef NO_SENDMAIL 193 (cd ../usr.sbin/sendmail/cf/cf; ${MAKE} distribution) 194.endif 195 196 197distrib-dirs: 198 ${INSTALL} -d -o root -g wheel -m 755 ${DESTDIR} 199 -mtree -def mtree/NetBSD.dist -p ${DESTDIR}/ -u 200 cd ${DESTDIR}; rm -f sys; ln -s usr/src/sys sys 201 202.if !defined(RELEASEDIR) 203snapshot snap_pre: 204 @echo setenv RELEASEDIR before doing that! 205 @false 206.else 207snapshot: distribution snap_pre snap_md snap_kern 208 sh ../distrib/sets/maketars -s ../distrib/sets \ 209 -d ${DESTDIR} -t ${RELEASEDIR}/binary/sets 210 (cd ${RELEASEDIR}/binary/sets && \ 211 cksum -o 1 *.tgz >BSDSUM && \ 212 cksum *.tgz >CKSUM && \ 213 cksum -m *.tgz >MD5 && \ 214 cksum -o 2 *.tgz >SYSVSUM ) 215 (cd ${RELEASEDIR}/binary/kernel && if [ -r *.gz ]; then \ 216 cksum -o 1 *.gz >BSDSUM && \ 217 cksum *.gz >CKSUM && \ 218 cksum -m *.gz >MD5 && \ 219 cksum -o 2 *.gz >SYSVSUM \ 220 ; fi ) 221 222snap_pre: 223 /bin/rm -rf ${RELEASEDIR} 224 ${INSTALL} -d -o root -g wheel -m 755 ${RELEASEDIR} 225 ${INSTALL} -d -o root -g wheel -m 755 ${RELEASEDIR}/binary 226 ${INSTALL} -d -o root -g wheel -m 755 ${RELEASEDIR}/binary/sets 227 ${INSTALL} -d -o root -g wheel -m 755 ${RELEASEDIR}/binary/kernel 228 ${INSTALL} -d -o root -g wheel -m 755 ${RELEASEDIR}/binary/security 229 ${INSTALL} -d -o root -g wheel -m 755 ${RELEASEDIR}/installation 230 231# the regular expression does a basename(1) on .CURDIR so that we don't 232# have to keep looking up .. at compile time. 233KERNSRCDIR?= ${.CURDIR:C/[^\/]+$//}sys 234KERNOBJDIR?= ${KERNSRCDIR}/arch/${MACHINE}/compile 235KERNCONFDIR?= ${KERNSRCDIR}/arch/${MACHINE}/conf 236 237# This target builds the GENERIC kernel (which must exist for all 238# ports) and puts it in binary/sets/kern.tgz, and also builds any 239# kernels specified in EXTRA_KERNELS and puts them in 240# binary/kernel/netbsd.${KERN}.gz 241# 242snap_kern: 243 cd ${KERNCONFDIR} && config \ 244 -b ${KERNOBJDIR}/GENERIC -s ${KERNSRCDIR} GENERIC 245.ifndef UPDATE 246 cd ${KERNOBJDIR}/GENERIC && ${MAKE} clean 247.endif 248 cd ${KERNOBJDIR}/GENERIC && \ 249 ${MAKE} depend && ${MAKE} ${_J} && \ 250 tar cf - netbsd |\ 251 gzip -c -9 > ${RELEASEDIR}/binary/sets/kern.tgz 252.for kernel in ${EXTRA_KERNELS} 253 cd ${KERNCONFDIR} && config \ 254 -b ${KERNOBJDIR}/${kernel} -s ${KERNSRCDIR} ${kernel} 255.ifndef BUILD 256 cd ${KERNOBJDIR}/${kernel} && ${MAKE} clean 257.endif 258 cd ${KERNOBJDIR}/${kernel} && \ 259 ${MAKE} depend && ${MAKE} ${_J} && \ 260 tar cf - netbsd |\ 261 gzip -c -9 > ${RELEASEDIR}/binary/kernel/netbsd.${kernel}.gz 262.endfor # EXTRA_KERNELS 263 264.endif # RELEASEDIR check 265 266snap_md: 267# nothing here -- look in the machine-dependent Makefile.inc 268 269.endif # DESTDIR check 270 271.include <bsd.prog.mk> 272