Makefile revision 1.455
11.455Schristos# $NetBSD: Makefile,v 1.455 2021/12/23 14:50:59 christos 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.172Sjlam# ${KERNSRCDIR}/arch/${MACHINE}/compile, but can be overridden. 161.96Scjs# KERNCONFDIR is where the configuration files for kernels are found; 171.96Scjs# default is ${KERNSRCDIR}/arch/${MACHINE}/conf but can be overridden. 181.304Slukem# MKPOSTFIX; if not `no', install postfix configuration 191.270Slukem# MKUNPRIVED; if not `no', allow non-root installs. 201.255Slukem# MKUPDATE; if not `no', don't do a 'make clean' before kernel compile 211.154Sthorpej# 221.96Scjs# Targets: 231.96Scjs# distribution: makes a full NetBSD distribution in DESTDIR. If 241.96Scjs# INSTALL_DONE is set, it will not do a `make install.' 251.182Schs# if DISTRIBUTION_DONE is set, it will not do anything. 261.96Scjs# distrib-dirs: creates an empty NetBSD directory tree in DESTDIR. 271.96Scjs# Called by distribution. 281.96Scjs# snapshot: calls distribution, above, and then tars up the files 291.286Scl# into a release(7) format in RELEASEDIR/${RELEASEMACHINEDIR}. 301.241Slukem# Any port-dependent stuff for this target is found in 311.241Slukem# etc.${MACHINE}/Makefile.inc. 321.106Scjs# release: a synonym for `snapshot' 331.242Slukem# 341.199Stv 351.270Slukem# For MK* vars 361.90Skim.include <bsd.own.mk> 371.187Sjmc 381.260Slukem.include <bsd.kernobj.mk> # For KERNSRCDIR, KERNOBJDIR, ... 391.260Slukem.include <bsd.endian.mk> # For TARGET_ENDIANNESS 401.252Slukem 411.187Sjmc.MAKEOVERRIDES+= USETOOLS 421.90Skim 431.23ScgdTZDIR= /usr/share/zoneinfo 441.157SkleinkLOCALTIME?= UTC 451.283SagcCKSUM?= ${TOOL_CKSUM} 461.330SchristosMAKESUMS= MAKE=${MAKE:Q} CKSUM=${CKSUM:Q} ${HOST_SH} ${NETBSDSRCDIR}/distrib/sets/makesums 471.266SlukemDISTRIBVER!= ${HOST_SH} ${NETBSDSRCDIR}/sys/conf/osrelease.sh 481.19Sderaadt 491.419SapbGZIP_FLAGS= -9 ${GZIP_N_FLAG} 501.419Sapb 511.161Shubertf# Flags for creating ISO CDROM image 521.320Sapb# mkisofs is expected to be in $PATH, install via pkgsrc/sysutils/cdrtools 531.242Slukem# Note: At least mkisofs 2.0 should be used. 541.242Slukem# 551.341Sbouyer.if !defined(MKISOFS) 561.407SuebayasiMKISOFS!= (which mkisofs || echo true) 2>/dev/null 571.341Sbouyer.endif 581.260SlukemDISTRIBREV!= ${HOST_SH} ${KERNSRCDIR}/conf/osrelease.sh -s 591.224Sbjh21# ISO 9660 volume ID. Note that this can only contain [A-Z0-9_]. 601.306SmartinISO_VOLID!= echo NETBSD_${DISTRIBREV} | tr a-z A-Z 611.306SmartinMKISOFS_FLAGS+= -J -l -hide-joliet-trans-tbl -r -T \ 621.224Sbjh21 -V ${ISO_VOLID} \ 631.331Slukem -publisher "The NetBSD Project" \ 641.286Scl -m "${RELEASEDIR}/${RELEASEMACHINEDIR}/installation/cdrom" 651.306Smartin.if ${MKISOFS_FLAGS:N-v} 661.306SmartinMKISOFS_FLAGS+= -quiet 671.306Smartin.endif 681.306Smartin 691.426Schristos# Reproducible build parameters 701.426Schristos.if ${MKREPRO:Uno} == "no" 711.426SchristosBUILDER!= echo $${USER-root}@$$(hostname) 721.426Schristos.else 731.426SchristosBUILDER= builder@localhost.NetBSD.org 741.426Schristos.endif 751.426Schristos.if ${MKREPRO_TIMESTAMP:Uno} == "no" 761.426SchristosPAX_TIMESTAMP= 771.426SchristosBUILD_DATE!= date -u 781.426Schristos.else 791.426SchristosPAX_TIMESTAMP=--timestamp "${MKREPRO_TIMESTAMP}" 801.450SchristosBUILD_DATE!= ${TOOL_DATE} -u -r "${MKREPRO_TIMESTAMP}" 811.426Schristos.endif 821.1Scgd 831.80Sjonathan# MD Makefile.inc may append MD targets to BIN[123]. Make sure all 841.316Shubertf# are empty, to preserve the old semantics of setting them below with "+=". 851.242Slukem# 861.200SlukemBIN1= 871.80SjonathanBIN2= 881.80SjonathanBIN3= 891.80Sjonathan 901.286Scl# Directories to build in ${RELEASEDIR}/${RELEASEMACHINEDIR}. 911.241Slukem# MD Makefile.inc files can add to this. 921.117Ssimonb# NOTE: Parent directories must be listed before subdirectories. 931.242Slukem# 941.217SlukemINSTALLATION_DIRS= binary binary/sets binary/kernel installation 951.117Ssimonb 961.286Scl.if exists(etc.${RELEASEMACHINE}/Makefile.inc) 971.286Scl.include "etc.${RELEASEMACHINE}/Makefile.inc" 981.71Scjs.endif 991.32Sjtc 1001.21Scgd# -rw-r--r-- 1011.21ScgdBINOWN= root 1021.21ScgdBINGRP= wheel 1031.227SperryUTMPGRP= utmp 1041.432SchristosBIN1+= auto_master bootptab changelist csh.cshrc csh.login \ 1051.345Sadrianp csh.logout daily daily.conf dm.conf envsys.conf floppytab ftpchroot \ 1061.370Smbalmer ftpusers gettytab gpio.conf group hosts hosts.lpd inetd.conf \ 1071.345Sadrianp locate.conf login.conf mailer.conf man.conf monthly monthly.conf \ 1081.345Sadrianp mrouted.conf named.conf netconfig networks newsyslog.conf \ 1091.409Sagc nsswitch.conf ntp.conf passwd.conf pkgpath.conf phones printcap \ 1101.408Sagc profile protocols rbootd.conf rc rc.conf rc.local rc.subr \ 1111.408Sagc rc.shutdown remote rpc security security.conf services shells \ 1121.408Sagc shrc sysctl.conf syslog.conf weekly weekly.conf wscons.conf 1131.291Slukem 1141.242Slukem# Use machine-specific disktab if it exists, or the MI one otherwise 1151.236Sjdolecek.if exists(etc.${MACHINE}/disktab) 1161.236SjdolecekBIN1+= etc.${MACHINE}/disktab 1171.236Sjdolecek.else 1181.236SjdolecekBIN1+= disktab 1191.236Sjdolecek.endif 1201.105Smycroft 1211.433Sryo.if exists(etc.${MACHINE}/ld.so.conf) && \ 1221.447Sjakllsch empty(MACHINE_ARCH:M*arm*hf*) && empty(MACHINE_ARCH:Maarch64*) 1231.234SjdolecekBIN1+= etc.${MACHINE}/ld.so.conf 1241.152Sperry.endif 1251.152Sperry 1261.234Sjdolecek.if exists(etc.${MACHINE}/ttyaction) 1271.234SjdolecekBIN1+= etc.${MACHINE}/ttyaction 1281.105Smycroft.endif 1291.1Scgd 1301.46Sderaadt# -rw-rw-r-- 1311.80SjonathanBIN2+= motd 1321.400SapbFILESBUILD_motd= YES 1331.1Scgd 1341.77Smycroft# -rw------- 1351.438SroyBIN3+= hosts.equiv wpa_supplicant.conf 1361.77Smycroft 1371.291SlukemSYSPKG= etc 1381.230SperryETC_PKG=-T etc_pkg 1391.230SperryBASE_PKG=-T base_pkg 1401.242SlukemETC_INSTALL_FILE=cd ${.CURDIR} && ${INSTALL_FILE} ${ETC_PKG} 1411.261SclETC_INSTALL_OBJ_FILE=cd ${.OBJDIR} && ${INSTALL_FILE} ${ETC_PKG} 1421.230Sperry 1431.191Stv.if ${TARGET_ENDIANNESS} == "1234" 1441.252SlukemPWD_MKDB_ENDIAN= -L 1451.191Stv.elif ${TARGET_ENDIANNESS} == "4321" 1461.252SlukemPWD_MKDB_ENDIAN= -B 1471.170Sjdolecek.else 1481.252SlukemPWD_MKDB_ENDIAN= 1491.191Stv.endif 1501.149Ssjg 1511.149Ssjg 1521.242Slukem# distribution -- 1531.242Slukem# Build a distribution 1541.242Slukem# 1551.324Sdsldistribution: .PHONY .MAKE check_DESTDIR distrib-dirs 1561.182Schs.if !defined(DISTRIBUTION_DONE) 1571.87Sperry.if !defined(INSTALL_DONE) 1581.285Slukem ${MAKEDIRTARGET} ${NETBSDSRCDIR} include _DISTRIB= 1591.285Slukem ${MAKEDIRTARGET} ${NETBSDSRCDIR} install _DISTRIB= 1601.200Slukem.endif # !INSTALL_DONE 1611.285Slukem ${MAKEDIRTARGET} . install-etc-files 1621.360Smrg. if ${MKX11} != "no" 1631.358Slukem ${MAKEDIRTARGET} ${NETBSDSRCDIR}/external/mit/xorg distribution 1641.360Smrg. endif 1651.374Suebayasi. if ${MKEXTSRC} != "no" 1661.374Suebayasi ${MAKEDIRTARGET} ${NETBSDSRCDIR}/extsrc distribution 1671.374Suebayasi. endif 1681.285Slukem ${MAKEDIRTARGET} ${NETBSDSRCDIR}/distrib/sets makesetfiles 1691.200Slukem.endif # !DISTRIBUTION_DONE 1701.193Sthorpej 1711.266Slukem 1721.400Sapb# motd is copied from a different ${MOTD_SOURCE} depending on DISTRIBVER 1731.400Sapb# 1741.400Sapb.if !empty(DISTRIBVER:M*.99.*) 1751.400SapbMOTD_SOURCE= motd.current 1761.400Sapb.elif !empty(DISTRIBVER:M*BETA*) 1771.400SapbMOTD_SOURCE= motd.beta 1781.400Sapb.elif !empty(DISTRIBVER:M*RC*) 1791.400SapbMOTD_SOURCE= motd.rc 1801.400Sapb.else 1811.400SapbMOTD_SOURCE= motd.default 1821.400Sapb.endif 1831.400SapbCLEANFILES+= motd 1841.400Sapbmotd: ${.CURDIR}/${MOTD_SOURCE} ${_NETBSD_VERSION_DEPENDS} 1851.400Sapb ${_MKTARGET_CREATE} 1861.400Sapb ${HOST_INSTALL_FILE} ${.CURDIR}/${MOTD_SOURCE} ${.TARGET} 1871.400Sapb 1881.340SapbCLEANFILES+= MAKEDEV 1891.421SmattMAKEDEV_MACHINE=${"${MACHINE_CPU}" == "aarch64":?${MACHINE_CPU}:${MACHINE}} 1901.386SuebayasiMAKEDEV: ${.CURDIR}/MAKEDEV.awk ${.CURDIR}/MAKEDEV.tmpl \ 1911.421Smatt ${.CURDIR}/etc.${MAKEDEV_MACHINE}/MAKEDEV.conf 1921.263Slukem ${_MKTARGET_CREATE} 1931.421Smatt MACHINE=${MAKEDEV_MACHINE:Q} MACHINE_ARCH=${MACHINE_ARCH:Q} \ 1941.264Slukem NETBSDSRCDIR=${NETBSDSRCDIR:Q} \ 1951.359Sapb ${TOOL_AWK} -f ${.CURDIR}/MAKEDEV.awk ${.CURDIR}/MAKEDEV.tmpl \ 1961.359Sapb > ${.TARGET} 1971.257Sjdolecek 1981.401Sapb.include "${NETBSDSRCDIR}/etc/Makefile.params" 1991.425Schristos 2001.272SlukemCLEANFILES+= etc-release 2011.322Sdsletc-release: .EXEC .MAKE 2021.266Slukem ${_MKTARGET_CREATE} 2031.266Slukem @( echo "NetBSD ${DISTRIBVER}/${MACHINE}"; \ 2041.266Slukem echo ; \ 2051.269Slukem cat ${NETBSDSRCDIR}/sys/conf/copyright; \ 2061.266Slukem echo ; \ 2071.416Sapb echo "Build information:"; \ 2081.425Schristos printf "%20s %s\n" "Build date" "${BUILD_DATE}"; \ 2091.425Schristos printf "%20s %s\n" "Built by" "${BUILDER}"; \ 2101.414Sapb if [ -n "${BUILDID}" ]; then \ 2111.416Sapb printf "%20s %s\n" "Build ID" "${BUILDID}" ; \ 2121.416Sapb fi ; \ 2131.416Sapb if [ -n "${BUILDINFO}" ]; then \ 2141.416Sapb echo ; \ 2151.416Sapb info="$$(printf "%b" ${BUILDINFO:Q})" ; \ 2161.416Sapb printf "%s\n" "$${info}" \ 2171.416Sapb | ${TOOL_SED} -e 's/^/ /' ; \ 2181.414Sapb fi ; \ 2191.281Slukem echo ; \ 2201.416Sapb echo "Build settings:"; \ 2211.416Sapb echo ; \ 2221.401Sapb ${PRINT_PARAMS} ; \ 2231.276Slukem ) >${.OBJDIR}/${.TARGET} 2241.266Slukem 2251.275Slukeminstall-etc-release: .PHONY etc-release 2261.272Slukem ${_MKMSG_INSTALL} etc/release 2271.266Slukem ${ETC_INSTALL_OBJ_FILE} -o ${BINOWN} -g ${BINGRP} -m 444 \ 2281.272Slukem etc-release ${DESTDIR}/etc/release 2291.242Slukem 2301.291Slukem 2311.291SlukemFILESDIR= /etc 2321.291SlukemCONFIGFILES= 2331.291SlukemCONFIGSYMLINKS= 2341.291Slukem 2351.291Slukem.for file in ${BIN1} 2361.291SlukemCONFIGFILES+= ${file} 2371.291SlukemFILESMODE_${file:T}= 644 2381.291Slukem.endfor 2391.291Slukem 2401.291Slukem.for file in ${BIN2} 2411.291SlukemCONFIGFILES+= ${file} 2421.291SlukemFILESMODE_${file:T}= 664 2431.291Slukem.endfor 2441.291Slukem 2451.291Slukem.for file in ${BIN3} 2461.291SlukemCONFIGFILES+= ${file} 2471.291SlukemFILESMODE_${file:T}= 600 2481.291Slukem.endfor 2491.291Slukem 2501.327Stron.if (${MKPOSTFIX} != "no") 2511.291SlukemCONFIGFILES+= aliases 2521.291SlukemFILESDIR_aliases= /etc/mail 2531.291SlukemFILESMODE_aliases= 644 2541.327Stron.endif 2551.291Slukem 2561.291SlukemCONFIGFILES+= MAKEDEV.local 2571.291SlukemFILESDIR_MAKEDEV.local= /dev 2581.291SlukemFILESMODE_MAKEDEV.local=${BINMODE} 2591.291Slukem 2601.291SlukemCONFIGFILES+= crontab 2611.291SlukemFILESDIR_crontab= /var/cron/tabs 2621.291SlukemFILESNAME_crontab= root 2631.291SlukemFILESMODE_crontab= 600 2641.291Slukem 2651.291SlukemCONFIGFILES+= minfree 2661.291SlukemFILESDIR_minfree= /var/crash 2671.291SlukemFILESMODE_minfree= 600 2681.291Slukem 2691.291SlukemCONFIGSYMLINKS+= ${TZDIR}/${LOCALTIME} /etc/localtime \ 2701.291Slukem /usr/sbin/rmt /etc/rmt 2711.291Slukem 2721.291Slukem 2731.242Slukem# install-etc-files -- 2741.242Slukem# Install etc (config) files; not performed by "make build" 2751.242Slukem# 2761.340Sapbinstall-etc-files: .PHONY .MAKE check_DESTDIR MAKEDEV 2771.291Slukem ${_MKMSG_INSTALL} ${DESTDIR}/etc/master.passwd 2781.230Sperry ${ETC_INSTALL_FILE} -o root -g wheel -m 600 \ 2791.230Sperry master.passwd ${DESTDIR}/etc 2801.254Slukem ${TOOL_PWD_MKDB} -p ${PWD_MKDB_ENDIAN} -d ${DESTDIR}/ \ 2811.230Sperry ${DESTDIR}/etc/master.passwd 2821.255Slukem.if ${MKUNPRIVED} != "no" 2831.222Slukem ( \ 2841.403Schristos mode=0600; \ 2851.403Schristos for metaent in spwd.db passwd pwd.db; do \ 2861.403Schristos echo "./etc/$${metaent} type=file mode=$${mode} uname=root gname=wheel tags=etc_pkg"; \ 2871.403Schristos mode=0644; \ 2881.246Slukem done; \ 2891.239Slukem ) | ${METALOG.add} 2901.255Slukem.endif # MKUNPRIVED != no 2911.291Slukem ${_MKMSG_INSTALL} ${DESTDIR}/etc/ttys 2921.421Smatt.if exists(${.CURDIR}/etc.${MACHINE}/ttys) 2931.289Schristos ${ETC_INSTALL_OBJ_FILE} -o ${BINOWN} -g ${BINGRP} -m 644 \ 2941.298Schristos ${.CURDIR}/etc.${MACHINE}/ttys ${DESTDIR}/etc 2951.421Smatt.else 2961.421Smatt ${ETC_INSTALL_OBJ_FILE} -o ${BINOWN} -g ${BINGRP} -m 644 \ 2971.421Smatt ${.CURDIR}/etc.${MACHINE_CPU}/ttys ${DESTDIR}/etc 2981.421Smatt.endif 2991.351Sad.if exists(etc.${MACHINE}/boot.cfg) 3001.351Sad ${_MKMSG_INSTALL} ${DESTDIR}/boot.cfg 3011.351Sad ${ETC_INSTALL_OBJ_FILE} -o ${BINOWN} -g ${BINGRP} -m 644 \ 3021.351Sad ${.CURDIR}/etc.${MACHINE}/boot.cfg ${DESTDIR}/ 3031.351Sad.endif 3041.291Slukem ${_MKMSG_INSTALL} ${DESTDIR}/dev/MAKEDEV 3051.259Sross ${ETC_INSTALL_OBJ_FILE} -o ${BINOWN} -g ${BINGRP} -m 555 \ 3061.257Sjdolecek MAKEDEV ${DESTDIR}/dev 3071.291Slukem.for owner group mode file in \ 3081.291Slukem ${BINOWN} operator 664 /etc/dumpdates \ 3091.291Slukem ${BINOWN} operator 600 /etc/skeykeys \ 3101.291Slukem root wheel 600 /var/at/at.deny \ 3111.378Sdholland root wheel 644 /var/db/locate.database \ 3121.291Slukem ${BINOWN} ${BINGRP} 600 /var/log/authlog \ 3131.291Slukem root wheel 600 /var/log/cron \ 3141.313Slukem ${BINOWN} ${UTMPGRP} 664 /var/log/lastlog \ 3151.313Slukem ${BINOWN} ${UTMPGRP} 664 /var/log/lastlogx \ 3161.291Slukem ${BINOWN} ${BINGRP} 640 /var/log/lpd-errs \ 3171.291Slukem ${BINOWN} ${BINGRP} 600 /var/log/maillog \ 3181.291Slukem ${BINOWN} ${BINGRP} 644 /var/log/messages \ 3191.291Slukem ${BINOWN} ${BINGRP} 600 /var/log/secure \ 3201.313Slukem ${BINOWN} ${UTMPGRP} 664 /var/log/wtmp \ 3211.313Slukem ${BINOWN} ${UTMPGRP} 664 /var/log/wtmpx \ 3221.291Slukem ${BINOWN} ${BINGRP} 600 /var/log/xferlog \ 3231.291Slukem daemon staff 664 /var/msgs/bounds \ 3241.291Slukem ${BINOWN} ${UTMPGRP} 664 /var/run/utmp \ 3251.291Slukem ${BINOWN} ${UTMPGRP} 664 /var/run/utmpx \ 3261.291Slukem games games 664 /var/games/atc_score \ 3271.291Slukem games games 664 /var/games/battlestar.log \ 3281.291Slukem games games 664 /var/games/cfscores \ 3291.291Slukem games games 664 /var/games/criblog \ 3301.291Slukem games games 660 /var/games/hackdir/perm \ 3311.291Slukem games games 660 /var/games/hackdir/record \ 3321.291Slukem games games 664 /var/games/larn/llog12.0 \ 3331.291Slukem games games 664 /var/games/larn/lscore12.0 \ 3341.291Slukem games games 664 /var/games/larn/playerids \ 3351.291Slukem games games 664 /var/games/robots_roll \ 3361.291Slukem games games 664 /var/games/rogue.scores \ 3371.291Slukem games games 664 /var/games/saillog \ 3381.291Slukem games games 664 /var/games/snakerawscores \ 3391.291Slukem games games 664 /var/games/snake.log \ 3401.291Slukem games games 664 /var/games/tetris.scores 3411.291Slukem ${_MKMSG_INSTALL} ${DESTDIR}${file} 3421.385Suebayasi if [ ! -e ${DESTDIR}${file} -o -s ${DESTDIR}${file} ]; then \ 3431.385Suebayasi ${ETC_INSTALL_FILE} -o ${owner} -g ${group} -m ${mode} \ 3441.440Sgson /dev/null ${DESTDIR}${file}; \ 3451.385Suebayasi else true; fi 3461.291Slukem.endfor 3471.432Schristos.for subdir in . defaults autofs bluetooth iscsi mtree namedb pam.d powerd rc.d root skel ssh 3481.291Slukem ${MAKEDIRTARGET} ${subdir} configinstall 3491.291Slukem.endfor 3501.357Sjoerg ${MAKEDIRTARGET} ${NETBSDSRCDIR}/external/bsd/dhcpcd/sbin/dhcpcd configinstall 3511.287Slukem ${MAKEDIRTARGET} ${NETBSDSRCDIR}/usr.bin/mail configinstall 3521.303Speter.if (${MKPF} != "no") 3531.294Syamt ${MAKEDIRTARGET} ${NETBSDSRCDIR}/usr.sbin/pf configinstall 3541.303Speter.endif 3551.369Smrg ${MAKEDIRTARGET} ${NETBSDSRCDIR}/crypto/external/bsd/openssh/bin configinstall 3561.304Slukem.if (${MKPOSTFIX} != "no") 3571.367Stron ${MAKEDIRTARGET} ${NETBSDSRCDIR}/external/ibm-public/postfix configinstall 3581.304Slukem.endif 3591.363Sjmmv.if (${MKATF} != "no") 3601.363Sjmmv ${MAKEDIRTARGET} ${NETBSDSRCDIR}/external/bsd/atf/etc/atf configinstall 3611.363Sjmmv.endif 3621.406Sjmmv.if (${MKKYUA} != "no") 3631.406Sjmmv ${MAKEDIRTARGET} ${NETBSDSRCDIR}/external/bsd/kyua-cli/etc/kyua configinstall 3641.406Sjmmv.endif 3651.247Slukem 3661.247Slukem 3671.247Slukem# install-obsolete-lists -- 3681.247Slukem# Install var/db/obsolete set lists; this is performed by "make build" 3691.247Slukem# 3701.247SlukemOBSOLETE.dir= ${.OBJDIR}/obsolete.dir 3711.452SmayaOBSOLETE.files= base comp etc games gpufw man misc rescue text 3721.405Smatt.if ${MKDEBUG} != "no" 3731.405SmattOBSOLETE.files+= debug 3741.405Smatt.endif 3751.445Sjmcneill.if ${MKDTB} != "no" 3761.445SjmcneillOBSOLETE.files+= dtb 3771.445Sjmcneill.endif 3781.376She.if ${MKKMOD} != "no" 3791.376SheOBSOLETE.files+= modules 3801.376She.endif 3811.383Snjoly.if ${MKATF} != "no" 3821.383SnjolyOBSOLETE.files+= tests 3831.383Snjoly.endif 3841.360Smrg.if ${MKX11} != "no" 3851.311SlukemOBSOLETE.files+= xbase xcomp xetc xfont xserver 3861.449Smartin.if ${MKDEBUG} != "no" 3871.449SmartinOBSOLETE.files+= xdebug 3881.449Smartin.endif 3891.307Stron.endif 3901.247Slukem 3911.387Suebayasi# XXX make "makeobsolete" set wise; then generate files respectively 3921.322Sdslinstall-obsolete-lists: .PHONY .MAKE 3931.246Slukem mkdir -p ${OBSOLETE.dir} 3941.360Smrg.if ${MKX11} != "no" 3951.307Stron (cd ${NETBSDSRCDIR}/distrib/sets && \ 3961.364Ssketch AWK=${TOOL_AWK:Q} MAKE=${MAKE:Q} ${HOST_SH} ./makeobsolete -b -t ${OBSOLETE.dir}) 3971.307Stron.else 3981.253Slukem (cd ${NETBSDSRCDIR}/distrib/sets && \ 3991.364Ssketch AWK=${TOOL_AWK:Q} MAKE=${MAKE:Q} ${HOST_SH} ./makeobsolete -t ${OBSOLETE.dir}) 4001.307Stron.endif 4011.246Slukem.for file in ${OBSOLETE.files} 4021.291Slukem ${_MKMSG_INSTALL} ${DESTDIR}/var/db/obsolete/${file} 4031.387Suebayasi if [ ! -e ${DESTDIR}/var/db/obsolete/${file} ] || \ 4041.387Suebayasi ! cmp -s ${OBSOLETE.dir}/${file} ${DESTDIR}/var/db/obsolete/${file}; then \ 4051.387Suebayasi ${ETC_INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} -m 644 \ 4061.387Suebayasi ${OBSOLETE.dir}/${file} ${DESTDIR}/var/db/obsolete; \ 4071.387Suebayasi else true; fi 4081.246Slukem.endfor 4091.1Scgd 4101.242Slukem 4111.242Slukem# distrib-dirs -- 4121.242Slukem# Populate $DESTDIR with directories needed by NetBSD 4131.242Slukem# 4141.371Smrgdistrib-dirs: .PHONY check_DESTDIR 4151.371Smrg cd ${NETBSDSRCDIR}/etc/mtree && ${MAKE} distrib-dirs 4161.255Slukem 4171.437SmartinCOMPRESS_PROGRAM=${"${USE_XZ_SETS:Uno}"!="no":?${TOOL_XZ}:${TOOL_GZIP}} 4181.434SmartinXZ_OPT=-9 4191.437SmartinTAR_SUFF=${"${USE_XZ_SETS:Uno}"!="no":?tar.xz:tgz} 4201.242Slukem 4211.242Slukem# release, snapshot -- 4221.242Slukem# Build a full distribution including kernels & install media. 4231.242Slukem# 4241.324Sdslrelease snapshot: .PHONY .MAKE check_DESTDIR check_RELEASEDIR snap_md_post 4251.285Slukem ${MAKEDIRTARGET} ${NETBSDSRCDIR}/distrib/sets sets 4261.315Sjmc ${MAKESUMS} -A -t ${RELEASEDIR}/${RELEASEMACHINEDIR}/binary/sets \ 4271.434Smartin ${KERNEL_SETS:@.SETS.@kern-${.SETS.}.${TAR_SUFF}@} 4281.286Scl ${MAKESUMS} -t ${RELEASEDIR}/${RELEASEMACHINEDIR}/binary/kernel '*.gz' 4291.161Shubertf 4301.242Slukem 4311.242Slukem# iso-image -- 4321.242Slukem# Standalone target to create a CDROM image after the release 4331.242Slukem# was composed. Should be run after "make release" in src and xsrc. 4341.341Sbouyer# The do-iso-image is to be called from etc.$MACHINE/Makefile.inc 4351.242Slukem# 4361.245Slukem# Note: At least mkisofs 2.0 should be used. 4371.242Slukem# 4381.292SheCDROM_NAME_ADD?= 4391.415SmartinCDROM_IMAGE?=${RELEASEDIR}/images/NetBSD-${DISTRIBVER}-${MACHINE}.iso 4401.319SapbCDROM.dir= ${.OBJDIR}/cdrom.dir 4411.319SapbCDROM.pathlist= ${.OBJDIR}/cdrom.pathlist 4421.242Slukem 4431.341Sbouyeriso-image: 4441.341Sbouyer 4451.341Sbouyer.if ${MKISOFS} != true 4461.341Sbouyerdo-iso-image: .PHONY check_DESTDIR check_RELEASEDIR iso-image-md-post 4471.415Smartin ${MAKESUMS} -t ${RELEASEDIR}/images/ '*.iso' 4481.395Sjoerg @echo "iso-image created as: ${CDROM_IMAGE}" 4491.341Sbouyer.else 4501.341Sbouyerdo-iso-image: 4511.341Sbouyer @echo iso-image: mkisofs not found 4521.341Sbouyer.endif 4531.161Shubertf 4541.275Slukemiso-image-setup: .PHONY check_RELEASEDIR 4551.242Slukem rm -f ${CDROM.pathlist} 4561.302Sfredb.for extra in README SOURCE_DATE source 4571.302Sfredb.if exists(${RELEASEDIR}/${extra}) 4581.302Sfredb echo "${extra}=${RELEASEDIR}/${extra}" >> ${CDROM.pathlist} 4591.302Sfredb.endif 4601.302Sfredb.endfor 4611.342Sbad echo "${MACHINE}/=${RELEASEDIR}/${RELEASEMACHINEDIR}/" >> ${CDROM.pathlist} 4621.242Slukem mkdir -p ${CDROM.dir} 4631.415Smartin 4641.415Smartincheck_imagedir: 4651.415Smartin mkdir -p ${RELEASEDIR}/images 4661.242Slukem 4671.248Slukem# iso-image-mi -- 4681.242Slukem# Create the image after the MD operations have completed. 4691.248Slukem# 4701.415Smartiniso-image-mi: .PHONY check_DESTDIR check_RELEASEDIR iso-image-md-pre check_imagedir 4711.242Slukem @if ! ${MKISOFS} --version; then \ 4721.320Sapb echo "install pkgsrc/sysutils/cdrtools and run 'make iso-image'." ; \ 4731.242Slukem false; \ 4741.161Shubertf fi 4751.242Slukem ${MKISOFS} ${MKISOFS_FLAGS} -graft-points -path-list ${CDROM.pathlist} \ 4761.395Sjoerg -o ${CDROM_IMAGE} ${CDROM.dir} 4771.242Slukem 4781.248Slukem# iso-image-md-pre -- 4791.242Slukem# Setup ${CDROM.dir} to produce a bootable CD image. 4801.242Slukem# Overridden by etc.$MACHINE/Makefile.inc 4811.242Slukem# 4821.324Sdsliso-image-md-pre: .PHONY check_DESTDIR check_RELEASEDIR iso-image-setup 4831.242Slukem# (empty -- look in the machine-dependent Makefile.inc) 4841.161Shubertf 4851.248Slukem# iso-image-md-post -- 4861.242Slukem# Fixup the CD-image to be bootable. 4871.242Slukem# Overridden by etc.$MACHINE/Makefile.inc 4881.242Slukem# 4891.324Sdsliso-image-md-post: .PHONY check_DESTDIR check_RELEASEDIR iso-image-mi 4901.242Slukem# (empty -- look in the machine-dependent Makefile.inc) 4911.41Scgd 4921.242Slukem 4931.396Stsutsui# live-image -- 4941.396Stsutsui# Standalone target to create live images after the release was composed. 4951.396Stsutsui# Should be run after "make release" in src and xsrc. 4961.396Stsutsui# LIVEIMG_RELEASEDIR specifies where to install live images and 4971.396Stsutsui# it can be set in MD etc.${MACHINE}/Makefile.inc. 4981.396Stsutsui# 4991.398SrizLIVEIMG_RELEASEDIR?= ${RELEASEDIR}/images 5001.396Stsutsui 5011.396Stsutsuilive-image: .PHONY check_DESTDIR check_RELEASEDIR 5021.396Stsutsui ${MAKEDIRTARGET} ${NETBSDSRCDIR}/distrib live_image \ 5031.396Stsutsui LIVEIMG_RELEASEDIR=${LIVEIMG_RELEASEDIR} 5041.396Stsutsui ${MAKESUMS} -t ${LIVEIMG_RELEASEDIR} '*.img.gz' 5051.396Stsutsui 5061.396Stsutsui# install-image -- 5071.396Stsutsui# Standalone target to create installation images 5081.396Stsutsui# after the release was composed. 5091.396Stsutsui# Should be run after "make release" in src and xsrc. 5101.396Stsutsui# INSTIMG_RELEASEDIR specifies where to install live images and 5111.396Stsutsui# it can be set in MD etc.${MACHINE}/Makefile.inc. 5121.396Stsutsui# 5131.398SrizINSTIMG_RELEASEDIR?= ${RELEASEDIR}/images 5141.396Stsutsui 5151.396Stsutsuiinstall-image: .PHONY check_DESTDIR check_RELEASEDIR 5161.396Stsutsui ${MAKEDIRTARGET} ${NETBSDSRCDIR}/distrib install_image \ 5171.396Stsutsui INSTIMG_RELEASEDIR=${INSTIMG_RELEASEDIR} 5181.396Stsutsui ${MAKESUMS} -t ${INSTIMG_RELEASEDIR} '*.img.gz' 5191.396Stsutsui 5201.242Slukem# snap_pre -- 5211.242Slukem# Create ${RELEASEDIR} and necessary subdirectories. 5221.242Slukem# 5231.324Sdslsnap_pre: .PHONY check_DESTDIR check_RELEASEDIR distribution 5241.241Slukem ${INSTALL} -d -m 755 ${RELEASEDIR} 5251.255Slukem.if ${MKUPDATE} == "no" 5261.168Sjmc# Could be a mount point, ignore the errors 5271.286Scl -/bin/rm -rf ${RELEASEDIR}/${RELEASEMACHINEDIR} 5281.240Slukem.endif 5291.286Scl ${INSTALL} -d -m 755 ${RELEASEDIR}/${RELEASEMACHINEDIR} 5301.117Ssimonb.for dir in ${INSTALLATION_DIRS} 5311.286Scl ${INSTALL} -d -m 755 ${RELEASEDIR}/${RELEASEMACHINEDIR}/${dir} 5321.117Ssimonb.endfor 5331.96Scjs 5341.242Slukem# snap_post -- 5351.242Slukem# Build the install media and notes from distrib 5361.242Slukem# 5371.324Sdslsnap_post: .PHONY .MAKE build_kernelsets build_releasekernels 5381.255Slukem.if ${MKUPDATE} == "no" 5391.233Slukem cd ${NETBSDSRCDIR}/distrib && ${MAKE} cleandir 5401.233Slukem.endif 5411.233Slukem cd ${NETBSDSRCDIR}/distrib && ${MAKE} depend && ${MAKE} && \ 5421.233Slukem ${MAKE} release 5431.233Slukem 5441.324Sdsl# build kernels -- 5451.242Slukem# This target builds the kernels specified by each port. 5461.242Slukem# A port may specify the following kernels: 5471.196Sthorpej# 5481.196Sthorpej# KERNEL_SETS The list of kernels that will be 5491.196Sthorpej# packaged into sets, named 5501.436Smartin# kern-${kernel}.tgz (or .tar.xz). 5511.436Smartin# These kernels are also placed in the 5521.436Smartin# binary/kernel area of the release package 5531.436Smartin# as netbsd-${kernel}.gz. 5541.196Sthorpej# 5551.196Sthorpej# EXTRA_KERNELS Additional kernels to place in the 5561.203Schs# binary/kernel area of the release 5571.196Sthorpej# package as netbsd-${kernel}.gz, but 5581.196Sthorpej# which are not placed into sets. This 5591.196Sthorpej# allows a port to provide e.g. a netbootable 5601.196Sthorpej# installation kernel containing a ramdisk. 5611.196Sthorpej# 5621.196Sthorpej# BUILD_KERNELS Additional kernels to build which are 5631.196Sthorpej# not placed into sets nor into the 5641.203Schs# binary/kernel area of the release 5651.196Sthorpej# package. These are typically kernels 5661.196Sthorpej# that are built for inclusion only in 5671.196Sthorpej# installation disk/CD-ROM/tape images. 5681.116Sfair# 5691.242Slukem# A port may also specify KERNEL_SUFFIXES, which is an optional list 5701.242Slukem# of filename suffixes for kernels to include in the kernel sets and 5711.242Slukem# in the binary/kernel area of the release package (e.g. "netbsd" vs. 5721.242Slukem# "netbsd.ecoff" and "netbsd.srec"). It is not an error if kernels 5731.242Slukem# with these suffixes do not exist in the kernel build directory. 5741.197Sthorpej# 5751.229Slukem# 5761.229Slukem# A list of all the kernels to build, which can be overridden from 5771.229Slukem# external sources (such as make(1)'s environment or command line) 5781.229Slukem# 5791.229SlukemALL_KERNELS?= ${KERNEL_SETS} ${EXTRA_KERNELS} ${BUILD_KERNELS} 5801.402Smlelstv.export ALL_KERNELS 5811.242Slukem 5821.359SapbGETKERNELAWK= ${TOOL_AWK} '/^config/ {print $$2; found=1} \ 5831.116Sfair END{ if (found == 0) print "netbsd"; }' 5841.242Slukem 5851.324Sdslbuild_kernels: .PHONY 5861.232Slukem# Configure & compile kernels listed in ${ALL_KERNELS} 5871.232Slukem# 5881.201Slukem.if !defined(KERNELS_DONE) # { 5891.424Suebayasi.for configfile in ${ALL_KERNELS:O:u} # { 5901.324Sdslbuild_kernels: kern-${configfile} 5911.322Sdslkern-${configfile}: .PHONY .MAKE 5921.422Suebayasi cd ${KERNCONFDIR} && ${TOOL_CONFIG} ${CONFIGOPTS} -s ${KERNSRCDIR} \ 5931.455Schristos ${MKDEBUGKERNEL == "yes" :? -DDEBUG=-g :} \ 5941.439Smartin -b ${KERNOBJDIR}/${configfile:C/.*\///} ${configfile} 5951.255Slukem.if ${MKUPDATE} == "no" 5961.427Schristos ${MAKE} -C ${KERNOBJDIR}/${configfile:C/.*\///} distclean 5971.96Scjs.endif 5981.427Schristos ${MAKE} -C ${KERNOBJDIR}/${configfile:C/.*\///} depend && \ 5991.427Schristos ${MAKE} -C ${KERNOBJDIR}/${configfile:C/.*\///} 6001.232Slukem.endfor # ALL_KERNELS # } 6011.232Slukem.endif # KERNELS_DONE # } 6021.232Slukem 6031.324Sdslbuild_kernelsets: .PHONY 6041.241Slukem# Create kernel sets from ${KERNEL_SETS} into 6051.286Scl# ${RELEASEDIR}/${RELEASEMACHINEDIR}/binary/sets 6061.232Slukem# 6071.424Suebayasi.for configfile in ${KERNEL_SETS:O:u} # { 6081.424Suebayasi.for configsel in ${ALL_KERNELS:O:u} 6091.402Smlelstv.if ${configfile} == ${configsel} 6101.324Sdslbuild_kernelsets: kernset-${configfile} 6111.324Sdslkernset-${configfile}: .PHONY build_kernels snap_pre 6121.430Schristos @kernlist=$$(${GETKERNELAWK} ${KERNCONFDIR}/${configfile}); \ 6131.197Sthorpej kerndir=${KERNOBJDIR}/${configfile:C/.*\///}; \ 6141.256Sdsl kernsuffixes="${KERNEL_SUFFIXES:S/^/./}"; \ 6151.434Smartin kern_tgz=${RELEASEDIR}/${RELEASEMACHINEDIR}/binary/sets/kern-${configfile}.${TAR_SUFF}; \ 6161.434Smartin pax_cmd="GZIP=${GZIP_FLAGS:Q} XZ_OPT=${XZ_OPT:Q} ${TOOL_PAX} ${PAX_TIMESTAMP} --use-compress-program ${COMPRESS_PROGRAM:Q} -O -w -M -N ${NETBSDSRCDIR}/etc -f $${kern_tgz}"; \ 6171.256Sdsl cd $${kerndir} && { \ 6181.256Sdsl kernels=; newest=; \ 6191.210Slukem for kernel in $${kernlist}; do \ 6201.256Sdsl for s in "" $${kernsuffixes}; do \ 6211.256Sdsl ks="$${kernel}$${s}"; \ 6221.256Sdsl [ -f $${ks} ] || continue; \ 6231.256Sdsl kernels="$${kernels} $${ks}"; \ 6241.442Schristos [ -z "$${newest}" -o $${ks} \ 6251.442Schristos -nt "$${newest}" ] && newest=$${ks}; \ 6261.455Schristos [ ${MKDEBUGKERNEL} = "no" -o \ 6271.455Schristos ! -f $${ks}.gdb ] continue; \ 6281.455Schristos kernels="$${kernels} $${ks}.gdb"; \ 6291.197Sthorpej done; \ 6301.256Sdsl done; \ 6311.256Sdsl [ $${kern_tgz} -nt "$${newest}" ] || { \ 6321.256Sdsl echo "echo $${kernels} | $${pax_cmd}"; \ 6331.444Schristos if [ ${KERNEL_DIR} = "yes" ]; then \ 6341.442Schristos tmpdir=kernel$$; \ 6351.442Schristos trap "rm -fr $${tmpdir}" 0 1 2 3 15; \ 6361.442Schristos mkdir -p $${tmpdir}/netbsd; \ 6371.442Schristos d=./netbsd; \ 6381.442Schristos cd $${tmpdir}; \ 6391.442Schristos else \ 6401.442Schristos d=.; \ 6411.442Schristos fi; \ 6421.256Sdsl ( echo "/set uname=${BINOWN} gname=${BINGRP}"; \ 6431.256Sdsl echo ". type=dir optional"; \ 6441.442Schristos if [ ${KERNEL_DIR} = "yes" ]; then \ 6451.442Schristos echo "./netbsd type=dir optional"; \ 6461.442Schristos fi; \ 6471.256Sdsl for kernel in $${kernels}; do \ 6481.442Schristos if [ ${KERNEL_DIR} = "yes" ]; then \ 6491.442Schristos newname=$$(echo $${kernel} | \ 6501.442Schristos ${TOOL_SED} -e s/netbsd/kernel/); \ 6511.442Schristos ln ../$${kernel} ./netbsd/$${newname}; \ 6521.442Schristos else \ 6531.442Schristos newname=$${kernel}; \ 6541.442Schristos fi; \ 6551.442Schristos echo "$${d}/$${newname} type=file"; \ 6561.256Sdsl done ) | eval $${pax_cmd}; \ 6571.442Schristos if [ ${KERNEL_DIR} = "yes" ]; then \ 6581.442Schristos mv $${kern_tgz} ..; \ 6591.442Schristos fi; \ 6601.256Sdsl } \ 6611.256Sdsl } 6621.402Smlelstv.endif 6631.402Smlelstv.endfor 6641.232Slukem.endfor # KERNEL_SETS # } 6651.232Slukem 6661.324Sdslbuild_releasekernels: .PHONY 6671.232Slukem# Build kernel.gz from ${KERNEL_SETS} ${EXTRA_KERNELS} into 6681.286Scl# ${RELEASEDIR}/${RELEASEMACHINEDIR}/binary/kernel 6691.232Slukem# 6701.424Suebayasi.for configfile in ${KERNEL_SETS:O:u} ${EXTRA_KERNELS:O:u} # { 6711.424Suebayasi.for configsel in ${ALL_KERNELS:O:u} 6721.402Smlelstv.if ${configfile} == ${configsel} 6731.324Sdslbuild_releasekernels: releasekern-${configfile} 6741.324Sdslreleasekern-${configfile}: .PHONY build_kernels snap_pre 6751.430Schristos @kernlist=$$(${GETKERNELAWK} ${KERNCONFDIR}/${configfile:C/.*\///}); \ 6761.197Sthorpej kerndir=${KERNOBJDIR}/${configfile:C/.*\///}; \ 6771.256Sdsl kernsuffixes="${KERNEL_SUFFIXES:S/^/./}"; \ 6781.429Schristos dest="${RELEASEDIR}/${RELEASEMACHINEDIR}/binary/kernel"; \ 6791.256Sdsl cd $${kerndir} && { \ 6801.256Sdsl for kernel in $${kernlist}; do \ 6811.256Sdsl for s in "" $${kernsuffixes}; do \ 6821.256Sdsl ks="$${kernel}$${s}"; \ 6831.256Sdsl [ ! -f $${ks} ] && continue; \ 6841.429Schristos knl_gz="$${dest}/$${kernel}-${configfile:C/.*\///}$${s}.gz"; \ 6851.256Sdsl [ $${knl_gz} -nt $${ks} ] && continue; \ 6861.352Sgdt rm -f $${knl_gz}; \ 6871.419Sapb echo "${TOOL_GZIP} ${GZIP_FLAGS} -c < $${kerndir}/$${ks} > $${knl_gz}"; \ 6881.419Sapb ${TOOL_GZIP} ${GZIP_FLAGS} -c < $${ks} > $${knl_gz}; \ 6891.197Sthorpej done; \ 6901.256Sdsl done; \ 6911.256Sdsl } 6921.402Smlelstv.endif 6931.402Smlelstv.endfor 6941.232Slukem.endfor # KERNEL_SETS EXTRA_KERNELS # } 6951.232Slukem 6961.242Slukem# snap_md_post -- 6971.242Slukem# Machine dependent distribution media operations. 6981.242Slukem# Overridden by etc.$MACHINE/Makefile.inc 6991.242Slukem# 7001.324Sdslsnap_md_post: .PHONY check_DESTDIR check_RELEASEDIR snap_post 7011.242Slukem# (empty -- look in the machine-dependent Makefile.inc) 7021.242Slukem 7031.242Slukem 7041.242Slukemclean: 7051.246Slukem -rm -rf ${CDROM.dir} ${CDROM.pathlist} ${OBSOLETE.dir} 7061.7Scgd 7071.392SjymSUBDIR= defaults rc.d mtree 7081.362Scube 7091.1Scgd.include <bsd.prog.mk> 7101.362Scube.include <bsd.subdir.mk> 7111.309Stron 7121.309Strontest: 7131.309Stron @echo ${OBSOLETE.files} 714