Makefile revision 1.147
11.147Sitojun# $NetBSD: Makefile,v 1.147 2000/05/03 10:55:19 itojun Exp $ 21.66Smikel# from: @(#)Makefile 8.7 (Berkeley) 5/25/95 31.1Scgd 41.96Scjs# Environment variables without default values: 51.96Scjs# DESTDIR must be set before anything in this file will work. 61.96Scjs# RELEASEDIR is where the tarred up stuff for a snapshot or 71.96Scjs# release will be placed. 81.96Scjs# 91.96Scjs# Environment variables with default values: 101.96Scjs# LOCALTIME will set the default local time for the system you 111.96Scjs# build; it determines what /etc/localtime is symlink'd to. 121.96Scjs# KERNSRCDIR points to kernel source; it is set by default to ../sys, 131.96Scjs# but can be overridden. 141.96Scjs# KERNOBJDIR is the kernel build directory, it defaults to 151.96Scjs# ${KERNSRCDIR}/arch/${MACHINE}/compile/KERNELNAME, but can be 161.96Scjs# overridden. 171.96Scjs# KERNCONFDIR is where the configuration files for kernels are found; 181.96Scjs# default is ${KERNSRCDIR}/arch/${MACHINE}/conf but can be overridden. 191.97Scjs# UPDATE is normally undefined; if defined, don't do a 'make clean' 201.97Scjs# before kernel compile 211.96Scjs# NO_SENDMAIL is normally undefined; if defined, it will not do a 221.96Scjs# `make distribution' in the sendmail config file source directory. 231.96Scjs# EXTRA_KERNELS has a machine-dependent list of kernels to build added 241.96Scjs# to it, but you may also set this to have extra ones built. 251.119Sross# BUILD_KERNELS are a machine-dependent list of kernels that should just 261.119Sross# be built in place but not made into sets or installed, e.g., an 271.119Sross# INSTALL kernel used later in src/distrib/. 281.134Serh# CRYPTOPATH is automatically defined by bsd.crypto.mk to be either 291.134Serh# ../crypto-us or ../crypto-intl. It controls the building of 301.134Serh# the secr set, which can be disabled by setting CRYPTOPATH to 311.134Serh# "none". 321.96Scjs# 331.96Scjs# Targets: 341.96Scjs# distribution: makes a full NetBSD distribution in DESTDIR. If 351.96Scjs# INSTALL_DONE is set, it will not do a `make install.' 361.96Scjs# distrib-dirs: creates an empty NetBSD directory tree in DESTDIR. 371.96Scjs# Called by distribution. 381.96Scjs# snapshot: calls distribution, above, and then tars up the files 391.96Scjs# into a release(7) format in RELEASEDIR. Any port-dependent 401.96Scjs# stuff for this target is found in etc.${MACHINE}/Makefile.inc. 411.106Scjs# release: a synonym for `snapshot' 421.96Scjs 431.146Ssjg# do this before bsd.own.mk so we get correct SRCDIR 441.145Ssjg.include "../Makefile.inc" 451.145Ssjg 461.134Serh# For NO_SENDMAIL and INSTPRIV and CRYPTOPATH 471.90Skim.include <bsd.own.mk> 481.134SerhSRCTOP= .. 491.134Serh.include <bsd.crypto.mk> 501.90Skim 511.23ScgdTZDIR= /usr/share/zoneinfo 521.90SkimLOCALTIME?= US/Pacific 531.19Sderaadt 541.55Sperry# setting NOOBJ prevents "make obj" from doing anything; 551.55Sperry# an objdir would break the installation stuff below 561.101SlukemMKOBJ= no 571.1Scgd 581.80Sjonathan# MD Makefile.inc may append MD targets to BIN[123]. Make sure all 591.80Sjonathan# are empty, to preserve the old semantics of setting them below with "=". 601.80SjonathanBIN1= 611.80SjonathanBIN2= 621.80SjonathanBIN3= 631.80Sjonathan 641.117Ssimonb# Directories to build in ${RELEASEDIR}. MD Makefile.inc files can 651.117Ssimonb# add to this. 661.117Ssimonb# NOTE: Parent directories must be listed before subdirectories. 671.117SsimonbINSTALLATION_DIRS= \ 681.117Ssimonb binary binary/sets binary/kernel binary/security installation 691.117Ssimonb 701.71Scjs.if exists(etc.${MACHINE}/Makefile.inc) 711.71Scjs.include "etc.${MACHINE}/Makefile.inc" 721.71Scjs.endif 731.32Sjtc 741.96Scjs# Use multiple jobs for kernel builds, if NBUILDJOBS set. 751.96Scjs# (Taken from src/Makefile.) 761.96Scjs.if defined(NBUILDJOBS) 771.96Scjs_J= -j${NBUILDJOBS} 781.96Scjs.endif 791.96Scjs 801.21Scgd# -rw-r--r-- 811.21ScgdBINOWN= root 821.21ScgdBINGRP= wheel 831.131SveegoBIN1+= bootptab changelist csh.cshrc csh.login csh.logout daily \ 841.131Sveego daily.conf dm.conf floppytab ftpchroot ftpusers ftpwelcome \ 851.131Sveego gettytab group hosts hosts.lpd inetd.conf lkm.conf \ 861.131Sveego mailer.conf man.conf monthly monthly.conf mrouted.conf \ 871.131Sveego netstart networks newsyslog.conf nsswitch.conf ntp.conf \ 881.131Sveego phones printcap profile protocols rbootd.conf rc rc.conf \ 891.131Sveego rc.lkm rc.local rc.subr rc.shutdown rc.wscons remote rpc \ 901.142Stsarna security security.conf services shells sysctl.conf syslog.conf \ 911.142Stsarna weekly weekly.conf wscons.conf \ 921.109Sdrochner etc.${MACHINE}/ttys etc.${MACHINE}/disktab 931.105Smycroft 941.121Sfvdl.if (${MACHINE_ARCH} == "m68k") || \ 951.105Smycroft (${MACHINE_ARCH} == "ns32k") || \ 961.105Smycroft (${MACHINE_ARCH} == "vax") || \ 971.105Smycroft (${MACHINE_ARCH} == "arm32") 981.129SchristosBIN1+= ld.so.conf 991.129Schristos.elif exists(etc.${MACHINE_ARCH}/ld.so.conf) 1001.132SjlamBIN1+= etc.${MACHINE_ARCH}/ld.so.conf 1011.105Smycroft.endif 1021.120Sitojun 1031.120Sitojun# IPv6 1041.120SitojunBIN1+= rtadvd.conf 1051.1Scgd 1061.46Sderaadt# -rw-rw-r-- 1071.80SjonathanBIN2+= motd 1081.1Scgd 1091.77Smycroft# -rw------- 1101.80SjonathanBIN3+= hosts.equiv 1111.77Smycroft 1121.144SthorpejNAMEDB= 127 root.cache named.conf localhost loopback.v6 1131.1ScgdPCS= pcs750.bin 1141.1Scgd 1151.88Slukemall clean cleandir depend distclean etc includes install lint: 1161.1Scgd 1171.34Scgd.ifndef DESTDIR 1181.106Scjsdistribution distrib-dirs release snapshot: 1191.36Scgd @echo setenv DESTDIR before doing that! 1201.34Scgd @false 1211.34Scgd.else 1221.7Scgddistribution: distrib-dirs 1231.87Sperry.if !defined(INSTALL_DONE) 1241.107Sscottr (cd ..; ${MAKE} _DISTRIB= includes) 1251.107Sscottr (cd ..; ${MAKE} _DISTRIB= install) 1261.87Sperry.endif 1271.124Ssimonb ${INSTALL} ${INSTPRIV} -c -o ${BINOWN} -g ${BINGRP} -m 644 ${BIN1} \ 1281.124Ssimonb ${DESTDIR}/etc 1291.124Ssimonb ${INSTALL} ${INSTPRIV} -c -o ${BINOWN} -g ${BINGRP} -m 664 ${BIN2} \ 1301.124Ssimonb ${DESTDIR}/etc 1311.124Ssimonb ${INSTALL} ${INSTPRIV} -c -o ${BINOWN} -g ${BINGRP} -m 600 ${BIN3} \ 1321.124Ssimonb ${DESTDIR}/etc 1331.124Ssimonb ${INSTALL} ${INSTPRIV} -c -o ${BINOWN} -g ${BINGRP} -m 644 aliases \ 1341.147Sitojun ${DESTDIR}/etc/mail 1351.124Ssimonb ${INSTALL} ${INSTPRIV} -c -o root -g wheel -m 600 crontab \ 1361.56Sthorpej ${DESTDIR}/var/cron/tabs/root 1371.124Ssimonb ${INSTALL} ${INSTPRIV} -c -o root -g wheel -m 600 master.passwd \ 1381.124Ssimonb ${DESTDIR}/etc 1391.68Sperry pwd_mkdb -p -d ${DESTDIR}/ ${DESTDIR}/etc/master.passwd 1401.124Ssimonb ${INSTALL} ${INSTPRIV} -c -o ${BINOWN} -g ${BINGRP} -m 555 \ 1411.1Scgd MAKEDEV.local etc.${MACHINE}/MAKEDEV ${DESTDIR}/dev 1421.124Ssimonb ${INSTALL} ${INSTPRIV} -c -o root -g wheel -m 600 minfree \ 1431.73Sperry ${DESTDIR}/var/crash 1441.1Scgd (cd root; \ 1451.124Ssimonb ${INSTALL} ${INSTPRIV} -c -o root -g wheel -m 644 dot.cshrc \ 1461.1Scgd ${DESTDIR}/root/.cshrc; \ 1471.124Ssimonb ${INSTALL} ${INSTPRIV} -c -o root -g wheel -m 600 dot.klogin \ 1481.1Scgd ${DESTDIR}/root/.klogin; \ 1491.124Ssimonb ${INSTALL} ${INSTPRIV} -c -o root -g wheel -m 644 dot.login \ 1501.1Scgd ${DESTDIR}/root/.login; \ 1511.124Ssimonb ${INSTALL} ${INSTPRIV} -c -o root -g wheel -m 644 dot.profile \ 1521.1Scgd ${DESTDIR}/root/.profile; \ 1531.128Smycroft ${INSTALL} ${INSTPRIV} -c -o root -g wheel -m 644 dot.shrc \ 1541.128Smycroft ${DESTDIR}/root/.shrc; \ 1551.1Scgd rm -f ${DESTDIR}/.cshrc ${DESTDIR}/.profile; \ 1561.1Scgd ln ${DESTDIR}/root/.cshrc ${DESTDIR}/.cshrc; \ 1571.1Scgd ln ${DESTDIR}/root/.profile ${DESTDIR}/.profile) 1581.83Smrg (cd mtree; ${MAKE} install) 1591.63Smikel (cd namedb; \ 1601.124Ssimonb ${INSTALL} ${INSTPRIV} -c -o ${BINOWN} -g ${BINGRP} -m 644 \ 1611.124Ssimonb ${NAMEDB} ${DESTDIR}/etc/namedb) 1621.140Slukem (cd rc.d; ${MAKE} install) 1631.19Sderaadt /bin/rm -f ${DESTDIR}/etc/localtime 1641.19Sderaadt ln -s ${TZDIR}/${LOCALTIME} ${DESTDIR}/etc/localtime 1651.48Sderaadt /bin/rm -f ${DESTDIR}/etc/rmt 1661.48Sderaadt ln -s /usr/sbin/rmt ${DESTDIR}/etc/rmt 1671.124Ssimonb ${INSTALL} ${INSTPRIV} -c -o ${BINOWN} -g operator -m 664 /dev/null \ 1681.32Sjtc ${DESTDIR}/etc/dumpdates 1691.124Ssimonb ${INSTALL} ${INSTPRIV} -c -o ${BINOWN} -g operator -m 600 /dev/null \ 1701.44Sderaadt ${DESTDIR}/etc/skeykeys 1711.127Sperry ${INSTALL} ${INSTPRIV} -c -o root -g wheel -m 600 /dev/null \ 1721.127Sperry ${DESTDIR}/var/at/at.deny 1731.124Ssimonb ${INSTALL} ${INSTPRIV} -c -o root -g wheel -m 600 /dev/null \ 1741.38Scgd ${DESTDIR}/var/cron/log 1751.124Ssimonb ${INSTALL} ${INSTPRIV} -c -o nobody -g ${BINGRP} -m 664 /dev/null \ 1761.32Sjtc ${DESTDIR}/var/db/locate.database 1771.124Ssimonb ${INSTALL} ${INSTPRIV} -c -o uucp -g dialer -m 640 /dev/null \ 1781.113Sfair ${DESTDIR}/var/log/aculog 1791.124Ssimonb ${INSTALL} ${INSTPRIV} -c -o ${BINOWN} -g ${BINGRP} -m 600 /dev/null \ 1801.69Sperry ${DESTDIR}/var/log/authlog 1811.124Ssimonb ${INSTALL} ${INSTPRIV} -c -o ${BINOWN} -g ${BINGRP} -m 664 /dev/null \ 1821.32Sjtc ${DESTDIR}/var/log/lastlog 1831.124Ssimonb ${INSTALL} ${INSTPRIV} -c -o ${BINOWN} -g ${BINGRP} -m 640 /dev/null \ 1841.32Sjtc ${DESTDIR}/var/log/lpd-errs 1851.124Ssimonb ${INSTALL} ${INSTPRIV} -c -o ${BINOWN} -g ${BINGRP} -m 600 /dev/null \ 1861.32Sjtc ${DESTDIR}/var/log/maillog 1871.124Ssimonb ${INSTALL} ${INSTPRIV} -c -o ${BINOWN} -g ${BINGRP} -m 644 /dev/null \ 1881.32Sjtc ${DESTDIR}/var/log/messages 1891.124Ssimonb ${INSTALL} ${INSTPRIV} -c -o ${BINOWN} -g ${BINGRP} -m 600 /dev/null \ 1901.58Slukem ${DESTDIR}/var/log/secure 1911.137Smycroft ${INSTALL} ${INSTPRIV} -c -o ${BINOWN} -g ${BINGRP} -m 644 /dev/null \ 1921.137Smycroft ${DESTDIR}/var/log/sendmail.st 1931.124Ssimonb ${INSTALL} ${INSTPRIV} -c -o ${BINOWN} -g ${BINGRP} -m 644 /dev/null \ 1941.32Sjtc ${DESTDIR}/var/log/wtmp 1951.124Ssimonb ${INSTALL} ${INSTPRIV} -c -o ${BINOWN} -g ${BINGRP} -m 600 /dev/null \ 1961.69Sperry ${DESTDIR}/var/log/xferlog 1971.124Ssimonb ${INSTALL} ${INSTPRIV} -c -o daemon -g staff -m 664 /dev/null \ 1981.39Scgd ${DESTDIR}/var/msgs/bounds 1991.124Ssimonb ${INSTALL} ${INSTPRIV} -c -o ${BINOWN} -g ${BINGRP} -m 664 /dev/null \ 2001.32Sjtc ${DESTDIR}/var/run/utmp 2011.124Ssimonb ${INSTALL} ${INSTPRIV} -c -o games -g games -m 664 /dev/null \ 2021.81Smrg ${DESTDIR}/var/games/atc_scores 2031.124Ssimonb ${INSTALL} ${INSTPRIV} -c -o games -g games -m 664 /dev/null \ 2041.81Smrg ${DESTDIR}/var/games/battlestar.log 2051.124Ssimonb ${INSTALL} ${INSTPRIV} -c -o games -g games -m 664 /dev/null \ 2061.81Smrg ${DESTDIR}/var/games/cfscores 2071.124Ssimonb ${INSTALL} ${INSTPRIV} -c -o games -g games -m 664 /dev/null \ 2081.82Sperry ${DESTDIR}/var/games/criblog 2091.124Ssimonb ${INSTALL} ${INSTPRIV} -c -o games -g games -m 664 /dev/null \ 2101.81Smrg ${DESTDIR}/var/games/robots_roll 2111.124Ssimonb ${INSTALL} ${INSTPRIV} -c -o games -g games -m 664 /dev/null \ 2121.81Smrg ${DESTDIR}/var/games/rogue.scores 2131.124Ssimonb ${INSTALL} ${INSTPRIV} -c -o games -g games -m 664 /dev/null \ 2141.81Smrg ${DESTDIR}/var/games/saillog 2151.124Ssimonb ${INSTALL} ${INSTPRIV} -c -o games -g games -m 664 /dev/null \ 2161.81Smrg ${DESTDIR}/var/games/snakerawscores 2171.124Ssimonb ${INSTALL} ${INSTPRIV} -c -o games -g games -m 664 /dev/null \ 2181.81Smrg ${DESTDIR}/var/games/snake.log 2191.124Ssimonb ${INSTALL} ${INSTPRIV} -c -o games -g games -m 664 /dev/null \ 2201.81Smrg ${DESTDIR}/var/games/tetris.scores 2211.124Ssimonb ${INSTALL} ${INSTPRIV} -c -o games -g games -m 664 /dev/null \ 2221.81Smrg ${DESTDIR}/var/games/larn/llog12.0 2231.124Ssimonb ${INSTALL} ${INSTPRIV} -c -o games -g games -m 664 /dev/null \ 2241.81Smrg ${DESTDIR}/var/games/larn/lscore12.0 2251.124Ssimonb ${INSTALL} ${INSTPRIV} -c -o games -g games -m 664 /dev/null \ 2261.81Smrg ${DESTDIR}/var/games/larn/playerids 2271.124Ssimonb (cd etc.${MACHINE}; ${INSTALL} ${INSTPRIV} -c -o ${BINOWN} \ 2281.124Ssimonb -g ${BINGRP} -m 444 fstab.* ${DESTDIR}/etc) 2291.49Stls (cd ${DESTDIR}/dev; ./MAKEDEV all) 2301.62Sperry (cd ../usr.bin/mail; ${MAKE} distribution) 2311.143Sperry (cd ../gnu/usr.sbin/postfix/; ${MAKE} distribution) 2321.90Skim.ifndef NO_SENDMAIL 2331.133Stron (cd ../gnu/usr.sbin/sendmail/cf/cf; ${MAKE} distribution) 2341.147Sitojun ${DESTDIR}/usr/libexec/sendmail/sendmail -C ${DESTDIR}/mail/etc/sendmail.cf -O AliasFile=${DESTDIR}/etc/mail/aliases -O DontBlameSendmail=groupwritabledirpathsafe -bi 2351.90Skim.endif 2361.1Scgd 2371.7Scgddistrib-dirs: 2381.124Ssimonb ${INSTALL} ${INSTPRIV} -d -o root -g wheel -m 755 ${DESTDIR} 2391.67Sperry -mtree -def mtree/NetBSD.dist -p ${DESTDIR}/ -u 2401.28Sjtc cd ${DESTDIR}; rm -f sys; ln -s usr/src/sys sys 2411.99Scjs 2421.96Scjs.if !defined(RELEASEDIR) 2431.117Ssimonbrelease snapshot snap_pre snap_md_pre snap_md_post: 2441.96Scjs @echo setenv RELEASEDIR before doing that! 2451.96Scjs @false 2461.96Scjs.else 2471.117Ssimonbrelease snapshot: distribution snap_pre snap_md_pre snap_kern snap_md_post 2481.141Sthorpej (cd ../distrib/sets; ${MAKE} sets) 2491.123Sis sh ../distrib/sets/makesums -t ${RELEASEDIR}/binary/kernel '*.gz' 2501.141Sthorpej 2511.141Sthorpejcryptoset: distribution snap_pre snap_md_pre snap_kern snap_md_post 2521.141Sthorpej (cd ../distrib/sets; ${MAKE} cryptoset) 2531.41Scgd 2541.41Scgdsnap_pre: 2551.96Scjs /bin/rm -rf ${RELEASEDIR} 2561.124Ssimonb ${INSTALL} ${INSTPRIV} -d -o root -g wheel -m 755 ${RELEASEDIR} 2571.117Ssimonb.for dir in ${INSTALLATION_DIRS} 2581.124Ssimonb ${INSTALL} ${INSTPRIV} -d -o root -g wheel -m 755 ${RELEASEDIR}/${dir} 2591.117Ssimonb.endfor 2601.96Scjs 2611.145Ssjg.include <bsd.kernobj.mk> 2621.96Scjs 2631.96Scjs# This target builds the GENERIC kernel (which must exist for all 2641.96Scjs# ports) and puts it in binary/sets/kern.tgz, and also builds any 2651.114Sfair# kernels specified in EXTRA_KERNELS. Since NetBSD's kernel build 2661.114Sfair# system can create more than one kernel from a single configuration 2671.114Sfair# we figure out how many there are, what they're named, and move them 2681.114Sfair# to binary/kernel/${KERNEL}.${CONFIGFILE}.gz - most often KERNEL will 2691.116Sfair# simply be "netbsd". If we don't find the "config" line, assume the 2701.116Sfair# kernel will be "netbsd" (some config files are simple additions on 2711.116Sfair# GENERIC, and just include it). 2721.116Sfair# 2731.116SfairGETKERNELAWK= awk '/^config/ {print $$2; found=1} \ 2741.116Sfair END{ if (found == 0) print "netbsd"; }' 2751.96Scjs# 2761.118Sgwr.if !target(snap_kern) 2771.96Scjssnap_kern: 2781.145Ssjg.ifndef KERNELS_DONE 2791.145Ssjg mkdir -p ${KERNOBJDIR} 2801.135Smycroft.for configfile in GENERIC ${EXTRA_KERNELS} ${BUILD_KERNELS} 2811.125Ssommerfe cd ${KERNCONFDIR} && ${CONFIG} \ 2821.135Smycroft -b ${KERNOBJDIR}/${configfile} -s ${KERNSRCDIR} ${configfile} 2831.97Scjs.ifndef UPDATE 2841.135Smycroft cd ${KERNOBJDIR}/${configfile} && ${MAKE} clean 2851.96Scjs.endif 2861.135Smycroft cd ${KERNOBJDIR}/${configfile} && ${MAKE} depend && ${MAKE} ${_J} 2871.135Smycroft.endfor # kernels 2881.96Scjs cd ${KERNOBJDIR}/GENERIC && \ 2891.116Sfair tar cf - `${GETKERNELAWK} ${KERNCONFDIR}/GENERIC` |\ 2901.96Scjs gzip -c -9 > ${RELEASEDIR}/binary/sets/kern.tgz 2911.135Smycroft.for configfile in GENERIC ${EXTRA_KERNELS} 2921.114Sfair cd ${KERNOBJDIR}/${configfile} && \ 2931.116Sfair for kernel in `${GETKERNELAWK} \ 2941.114Sfair ${KERNCONFDIR}/${configfile}` ; { \ 2951.114Sfair gzip -c -9 < $${kernel} > \ 2961.114Sfair ${RELEASEDIR}/binary/kernel/$${kernel}.${configfile}.gz ; } 2971.96Scjs.endfor # EXTRA_KERNELS 2981.145Ssjg.endif # KERNELS_DONE 2991.118Sgwr.endif # no target(snap_kern) 3001.108Sdrochner 3011.96Scjs.endif # RELEASEDIR check 3021.41Scgd 3031.117Ssimonbsnap_md_pre: 3041.117Ssimonb# nothing here -- look in the machine-dependent Makefile.inc 3051.117Ssimonb 3061.117Ssimonbsnap_md_post: 3071.41Scgd# nothing here -- look in the machine-dependent Makefile.inc 3081.41Scgd 3091.34Scgd.endif # DESTDIR check 3101.7Scgd 3111.1Scgd.include <bsd.prog.mk> 312