11.475Spgoyette# $NetBSD: Makefile,v 1.475 2025/04/25 19:34:39 pgoyette 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.471Stsutsui# Flags for creating ISO CDROM image for mac68k and macppc that require 521.471Stsutsui# tools mkhybrid(8) to create hybrid ISO9660/HFS images. 531.471StsutsuiMKISOFS?= ${TOOL_MKHYBRID} 541.260SlukemDISTRIBREV!= ${HOST_SH} ${KERNSRCDIR}/conf/osrelease.sh -s 551.224Sbjh21# ISO 9660 volume ID. Note that this can only contain [A-Z0-9_]. 561.306SmartinISO_VOLID!= echo NETBSD_${DISTRIBREV} | tr a-z A-Z 571.472StsutsuiMKISOFS_FLAGS+= -J -l -r \ 581.224Sbjh21 -V ${ISO_VOLID} \ 591.331Slukem -publisher "The NetBSD Project" \ 601.286Scl -m "${RELEASEDIR}/${RELEASEMACHINEDIR}/installation/cdrom" 611.306Smartin.if ${MKISOFS_FLAGS:N-v} 621.306SmartinMKISOFS_FLAGS+= -quiet 631.306Smartin.endif 641.306Smartin 651.426Schristos# Reproducible build parameters 661.426Schristos.if ${MKREPRO:Uno} == "no" 671.426SchristosBUILDER!= echo $${USER-root}@$$(hostname) 681.426Schristos.else 691.426SchristosBUILDER= builder@localhost.NetBSD.org 701.426Schristos.endif 711.426Schristos.if ${MKREPRO_TIMESTAMP:Uno} == "no" 721.426SchristosPAX_TIMESTAMP= 731.426SchristosBUILD_DATE!= date -u 741.426Schristos.else 751.426SchristosPAX_TIMESTAMP=--timestamp "${MKREPRO_TIMESTAMP}" 761.450SchristosBUILD_DATE!= ${TOOL_DATE} -u -r "${MKREPRO_TIMESTAMP}" 771.426Schristos.endif 781.1Scgd 791.80Sjonathan# MD Makefile.inc may append MD targets to BIN[123]. Make sure all 801.316Shubertf# are empty, to preserve the old semantics of setting them below with "+=". 811.242Slukem# 821.200SlukemBIN1= 831.80SjonathanBIN2= 841.80SjonathanBIN3= 851.80Sjonathan 861.286Scl# Directories to build in ${RELEASEDIR}/${RELEASEMACHINEDIR}. 871.241Slukem# MD Makefile.inc files can add to this. 881.117Ssimonb# NOTE: Parent directories must be listed before subdirectories. 891.242Slukem# 901.217SlukemINSTALLATION_DIRS= binary binary/sets binary/kernel installation 911.117Ssimonb 921.286Scl.if exists(etc.${RELEASEMACHINE}/Makefile.inc) 931.286Scl.include "etc.${RELEASEMACHINE}/Makefile.inc" 941.71Scjs.endif 951.32Sjtc 961.21Scgd# -rw-r--r-- 971.21ScgdBINOWN= root 981.21ScgdBINGRP= wheel 991.227SperryUTMPGRP= utmp 1001.432SchristosBIN1+= auto_master bootptab changelist csh.cshrc csh.login \ 1011.345Sadrianp csh.logout daily daily.conf dm.conf envsys.conf floppytab ftpchroot \ 1021.370Smbalmer ftpusers gettytab gpio.conf group hosts hosts.lpd inetd.conf \ 1031.345Sadrianp locate.conf login.conf mailer.conf man.conf monthly monthly.conf \ 1041.465Snia mrouted.conf named.conf netconfig networks newsyslog.conf \ 1051.465Snia nsswitch.conf ntp.conf passwd.conf pkgpath.conf phones printcap \ 1061.408Sagc profile protocols rbootd.conf rc rc.conf rc.local rc.subr \ 1071.408Sagc rc.shutdown remote rpc security security.conf services shells \ 1081.408Sagc shrc sysctl.conf syslog.conf weekly weekly.conf wscons.conf 1091.291Slukem 1101.242Slukem# Use machine-specific disktab if it exists, or the MI one otherwise 1111.236Sjdolecek.if exists(etc.${MACHINE}/disktab) 1121.236SjdolecekBIN1+= etc.${MACHINE}/disktab 1131.236Sjdolecek.else 1141.236SjdolecekBIN1+= disktab 1151.236Sjdolecek.endif 1161.105Smycroft 1171.433Sryo.if exists(etc.${MACHINE}/ld.so.conf) && \ 1181.464Srin empty(MACHINE_ARCH:M*arm*hf*) && empty(MACHINE_ARCH:Maarch64*) && \ 1191.464Srin ${MACHINE_ARCH} != "powerpc64" 1201.234SjdolecekBIN1+= etc.${MACHINE}/ld.so.conf 1211.152Sperry.endif 1221.152Sperry 1231.234Sjdolecek.if exists(etc.${MACHINE}/ttyaction) 1241.234SjdolecekBIN1+= etc.${MACHINE}/ttyaction 1251.105Smycroft.endif 1261.1Scgd 1271.46Sderaadt# -rw-rw-r-- 1281.80SjonathanBIN2+= motd 1291.400SapbFILESBUILD_motd= YES 1301.1Scgd 1311.77Smycroft# -rw------- 1321.438SroyBIN3+= hosts.equiv wpa_supplicant.conf 1331.77Smycroft 1341.291SlukemSYSPKG= etc 1351.230SperryETC_PKG=-T etc_pkg 1361.230SperryBASE_PKG=-T base_pkg 1371.242SlukemETC_INSTALL_FILE=cd ${.CURDIR} && ${INSTALL_FILE} ${ETC_PKG} 1381.261SclETC_INSTALL_OBJ_FILE=cd ${.OBJDIR} && ${INSTALL_FILE} ${ETC_PKG} 1391.230Sperry 1401.191Stv.if ${TARGET_ENDIANNESS} == "1234" 1411.252SlukemPWD_MKDB_ENDIAN= -L 1421.191Stv.elif ${TARGET_ENDIANNESS} == "4321" 1431.252SlukemPWD_MKDB_ENDIAN= -B 1441.170Sjdolecek.else 1451.252SlukemPWD_MKDB_ENDIAN= 1461.191Stv.endif 1471.149Ssjg 1481.149Ssjg 1491.242Slukem# distribution -- 1501.242Slukem# Build a distribution 1511.242Slukem# 1521.324Sdsldistribution: .PHONY .MAKE check_DESTDIR distrib-dirs 1531.182Schs.if !defined(DISTRIBUTION_DONE) 1541.87Sperry.if !defined(INSTALL_DONE) 1551.285Slukem ${MAKEDIRTARGET} ${NETBSDSRCDIR} include _DISTRIB= 1561.285Slukem ${MAKEDIRTARGET} ${NETBSDSRCDIR} install _DISTRIB= 1571.200Slukem.endif # !INSTALL_DONE 1581.456Schristos ${MAKEDIRTARGET} . install-debugkernels 1591.285Slukem ${MAKEDIRTARGET} . install-etc-files 1601.360Smrg. if ${MKX11} != "no" 1611.358Slukem ${MAKEDIRTARGET} ${NETBSDSRCDIR}/external/mit/xorg distribution 1621.360Smrg. endif 1631.285Slukem ${MAKEDIRTARGET} ${NETBSDSRCDIR}/distrib/sets makesetfiles 1641.200Slukem.endif # !DISTRIBUTION_DONE 1651.193Sthorpej 1661.266Slukem 1671.400Sapb# motd is copied from a different ${MOTD_SOURCE} depending on DISTRIBVER 1681.400Sapb# 1691.400Sapb.if !empty(DISTRIBVER:M*.99.*) 1701.400SapbMOTD_SOURCE= motd.current 1711.400Sapb.elif !empty(DISTRIBVER:M*BETA*) 1721.400SapbMOTD_SOURCE= motd.beta 1731.400Sapb.elif !empty(DISTRIBVER:M*RC*) 1741.400SapbMOTD_SOURCE= motd.rc 1751.400Sapb.else 1761.400SapbMOTD_SOURCE= motd.default 1771.400Sapb.endif 1781.400SapbCLEANFILES+= motd 1791.400Sapbmotd: ${.CURDIR}/${MOTD_SOURCE} ${_NETBSD_VERSION_DEPENDS} 1801.400Sapb ${_MKTARGET_CREATE} 1811.400Sapb ${HOST_INSTALL_FILE} ${.CURDIR}/${MOTD_SOURCE} ${.TARGET} 1821.400Sapb 1831.340SapbCLEANFILES+= MAKEDEV 1841.421SmattMAKEDEV_MACHINE=${"${MACHINE_CPU}" == "aarch64":?${MACHINE_CPU}:${MACHINE}} 1851.386SuebayasiMAKEDEV: ${.CURDIR}/MAKEDEV.awk ${.CURDIR}/MAKEDEV.tmpl \ 1861.421Smatt ${.CURDIR}/etc.${MAKEDEV_MACHINE}/MAKEDEV.conf 1871.263Slukem ${_MKTARGET_CREATE} 1881.421Smatt MACHINE=${MAKEDEV_MACHINE:Q} MACHINE_ARCH=${MACHINE_ARCH:Q} \ 1891.264Slukem NETBSDSRCDIR=${NETBSDSRCDIR:Q} \ 1901.359Sapb ${TOOL_AWK} -f ${.CURDIR}/MAKEDEV.awk ${.CURDIR}/MAKEDEV.tmpl \ 1911.359Sapb > ${.TARGET} 1921.257Sjdolecek 1931.401Sapb.include "${NETBSDSRCDIR}/etc/Makefile.params" 1941.425Schristos 1951.272SlukemCLEANFILES+= etc-release 1961.322Sdsletc-release: .EXEC .MAKE 1971.266Slukem ${_MKTARGET_CREATE} 1981.266Slukem @( echo "NetBSD ${DISTRIBVER}/${MACHINE}"; \ 1991.266Slukem echo ; \ 2001.269Slukem cat ${NETBSDSRCDIR}/sys/conf/copyright; \ 2011.266Slukem echo ; \ 2021.416Sapb echo "Build information:"; \ 2031.425Schristos printf "%20s %s\n" "Build date" "${BUILD_DATE}"; \ 2041.425Schristos printf "%20s %s\n" "Built by" "${BUILDER}"; \ 2051.414Sapb if [ -n "${BUILDID}" ]; then \ 2061.416Sapb printf "%20s %s\n" "Build ID" "${BUILDID}" ; \ 2071.416Sapb fi ; \ 2081.416Sapb if [ -n "${BUILDINFO}" ]; then \ 2091.416Sapb echo ; \ 2101.416Sapb info="$$(printf "%b" ${BUILDINFO:Q})" ; \ 2111.416Sapb printf "%s\n" "$${info}" \ 2121.416Sapb | ${TOOL_SED} -e 's/^/ /' ; \ 2131.414Sapb fi ; \ 2141.281Slukem echo ; \ 2151.416Sapb echo "Build settings:"; \ 2161.416Sapb echo ; \ 2171.401Sapb ${PRINT_PARAMS} ; \ 2181.276Slukem ) >${.OBJDIR}/${.TARGET} 2191.266Slukem 2201.275Slukeminstall-etc-release: .PHONY etc-release 2211.272Slukem ${_MKMSG_INSTALL} etc/release 2221.266Slukem ${ETC_INSTALL_OBJ_FILE} -o ${BINOWN} -g ${BINGRP} -m 444 \ 2231.272Slukem etc-release ${DESTDIR}/etc/release 2241.242Slukem 2251.291Slukem 2261.291SlukemFILESDIR= /etc 2271.291SlukemCONFIGFILES= 2281.291SlukemCONFIGSYMLINKS= 2291.291Slukem 2301.291Slukem.for file in ${BIN1} 2311.291SlukemCONFIGFILES+= ${file} 2321.291SlukemFILESMODE_${file:T}= 644 2331.291Slukem.endfor 2341.291Slukem 2351.291Slukem.for file in ${BIN2} 2361.291SlukemCONFIGFILES+= ${file} 2371.291SlukemFILESMODE_${file:T}= 664 2381.291Slukem.endfor 2391.291Slukem 2401.291Slukem.for file in ${BIN3} 2411.291SlukemCONFIGFILES+= ${file} 2421.291SlukemFILESMODE_${file:T}= 600 2431.291Slukem.endfor 2441.291Slukem 2451.327Stron.if (${MKPOSTFIX} != "no") 2461.291SlukemCONFIGFILES+= aliases 2471.291SlukemFILESDIR_aliases= /etc/mail 2481.291SlukemFILESMODE_aliases= 644 2491.327Stron.endif 2501.291Slukem 2511.291SlukemCONFIGFILES+= MAKEDEV.local 2521.291SlukemFILESDIR_MAKEDEV.local= /dev 2531.291SlukemFILESMODE_MAKEDEV.local=${BINMODE} 2541.291Slukem 2551.291SlukemCONFIGFILES+= crontab 2561.291SlukemFILESDIR_crontab= /var/cron/tabs 2571.291SlukemFILESNAME_crontab= root 2581.291SlukemFILESMODE_crontab= 600 2591.291Slukem 2601.291SlukemCONFIGFILES+= minfree 2611.291SlukemFILESDIR_minfree= /var/crash 2621.291SlukemFILESMODE_minfree= 600 2631.291Slukem 2641.291SlukemCONFIGSYMLINKS+= ${TZDIR}/${LOCALTIME} /etc/localtime \ 2651.291Slukem /usr/sbin/rmt /etc/rmt 2661.291Slukem 2671.291Slukem 2681.242Slukem# install-etc-files -- 2691.242Slukem# Install etc (config) files; not performed by "make build" 2701.242Slukem# 2711.340Sapbinstall-etc-files: .PHONY .MAKE check_DESTDIR MAKEDEV 2721.291Slukem ${_MKMSG_INSTALL} ${DESTDIR}/etc/master.passwd 2731.230Sperry ${ETC_INSTALL_FILE} -o root -g wheel -m 600 \ 2741.230Sperry master.passwd ${DESTDIR}/etc 2751.254Slukem ${TOOL_PWD_MKDB} -p ${PWD_MKDB_ENDIAN} -d ${DESTDIR}/ \ 2761.230Sperry ${DESTDIR}/etc/master.passwd 2771.255Slukem.if ${MKUNPRIVED} != "no" 2781.222Slukem ( \ 2791.403Schristos mode=0600; \ 2801.403Schristos for metaent in spwd.db passwd pwd.db; do \ 2811.403Schristos echo "./etc/$${metaent} type=file mode=$${mode} uname=root gname=wheel tags=etc_pkg"; \ 2821.403Schristos mode=0644; \ 2831.246Slukem done; \ 2841.239Slukem ) | ${METALOG.add} 2851.255Slukem.endif # MKUNPRIVED != no 2861.291Slukem ${_MKMSG_INSTALL} ${DESTDIR}/etc/ttys 2871.421Smatt.if exists(${.CURDIR}/etc.${MACHINE}/ttys) 2881.289Schristos ${ETC_INSTALL_OBJ_FILE} -o ${BINOWN} -g ${BINGRP} -m 644 \ 2891.298Schristos ${.CURDIR}/etc.${MACHINE}/ttys ${DESTDIR}/etc 2901.421Smatt.else 2911.421Smatt ${ETC_INSTALL_OBJ_FILE} -o ${BINOWN} -g ${BINGRP} -m 644 \ 2921.421Smatt ${.CURDIR}/etc.${MACHINE_CPU}/ttys ${DESTDIR}/etc 2931.421Smatt.endif 2941.351Sad.if exists(etc.${MACHINE}/boot.cfg) 2951.351Sad ${_MKMSG_INSTALL} ${DESTDIR}/boot.cfg 2961.351Sad ${ETC_INSTALL_OBJ_FILE} -o ${BINOWN} -g ${BINGRP} -m 644 \ 2971.351Sad ${.CURDIR}/etc.${MACHINE}/boot.cfg ${DESTDIR}/ 2981.351Sad.endif 2991.291Slukem ${_MKMSG_INSTALL} ${DESTDIR}/dev/MAKEDEV 3001.259Sross ${ETC_INSTALL_OBJ_FILE} -o ${BINOWN} -g ${BINGRP} -m 555 \ 3011.257Sjdolecek MAKEDEV ${DESTDIR}/dev 3021.291Slukem.for owner group mode file in \ 3031.291Slukem ${BINOWN} operator 664 /etc/dumpdates \ 3041.291Slukem ${BINOWN} operator 600 /etc/skeykeys \ 3051.291Slukem root wheel 600 /var/at/at.deny \ 3061.378Sdholland root wheel 644 /var/db/locate.database \ 3071.291Slukem ${BINOWN} ${BINGRP} 600 /var/log/authlog \ 3081.291Slukem root wheel 600 /var/log/cron \ 3091.313Slukem ${BINOWN} ${UTMPGRP} 664 /var/log/lastlog \ 3101.313Slukem ${BINOWN} ${UTMPGRP} 664 /var/log/lastlogx \ 3111.291Slukem ${BINOWN} ${BINGRP} 640 /var/log/lpd-errs \ 3121.291Slukem ${BINOWN} ${BINGRP} 600 /var/log/maillog \ 3131.291Slukem ${BINOWN} ${BINGRP} 644 /var/log/messages \ 3141.291Slukem ${BINOWN} ${BINGRP} 600 /var/log/secure \ 3151.313Slukem ${BINOWN} ${UTMPGRP} 664 /var/log/wtmp \ 3161.313Slukem ${BINOWN} ${UTMPGRP} 664 /var/log/wtmpx \ 3171.291Slukem ${BINOWN} ${BINGRP} 600 /var/log/xferlog \ 3181.291Slukem daemon staff 664 /var/msgs/bounds \ 3191.291Slukem ${BINOWN} ${UTMPGRP} 664 /var/run/utmp \ 3201.291Slukem ${BINOWN} ${UTMPGRP} 664 /var/run/utmpx \ 3211.291Slukem games games 664 /var/games/atc_score \ 3221.291Slukem games games 664 /var/games/battlestar.log \ 3231.291Slukem games games 664 /var/games/cfscores \ 3241.291Slukem games games 664 /var/games/criblog \ 3251.291Slukem games games 660 /var/games/hackdir/perm \ 3261.291Slukem games games 660 /var/games/hackdir/record \ 3271.291Slukem games games 664 /var/games/larn/llog12.0 \ 3281.291Slukem games games 664 /var/games/larn/lscore12.0 \ 3291.291Slukem games games 664 /var/games/larn/playerids \ 3301.291Slukem games games 664 /var/games/robots_roll \ 3311.291Slukem games games 664 /var/games/rogue.scores \ 3321.291Slukem games games 664 /var/games/saillog \ 3331.291Slukem games games 664 /var/games/snakerawscores \ 3341.291Slukem games games 664 /var/games/snake.log \ 3351.291Slukem games games 664 /var/games/tetris.scores 3361.291Slukem ${_MKMSG_INSTALL} ${DESTDIR}${file} 3371.385Suebayasi if [ ! -e ${DESTDIR}${file} -o -s ${DESTDIR}${file} ]; then \ 3381.385Suebayasi ${ETC_INSTALL_FILE} -o ${owner} -g ${group} -m ${mode} \ 3391.440Sgson /dev/null ${DESTDIR}${file}; \ 3401.385Suebayasi else true; fi 3411.291Slukem.endfor 3421.432Schristos.for subdir in . defaults autofs bluetooth iscsi mtree namedb pam.d powerd rc.d root skel ssh 3431.291Slukem ${MAKEDIRTARGET} ${subdir} configinstall 3441.291Slukem.endfor 3451.357Sjoerg ${MAKEDIRTARGET} ${NETBSDSRCDIR}/external/bsd/dhcpcd/sbin/dhcpcd configinstall 3461.287Slukem ${MAKEDIRTARGET} ${NETBSDSRCDIR}/usr.bin/mail configinstall 3471.467Sriastrad ${MAKEDIRTARGET} ${NETBSDSRCDIR}/usr.sbin/certctl configinstall 3481.303Speter.if (${MKPF} != "no") 3491.294Syamt ${MAKEDIRTARGET} ${NETBSDSRCDIR}/usr.sbin/pf configinstall 3501.303Speter.endif 3511.369Smrg ${MAKEDIRTARGET} ${NETBSDSRCDIR}/crypto/external/bsd/openssh/bin configinstall 3521.304Slukem.if (${MKPOSTFIX} != "no") 3531.367Stron ${MAKEDIRTARGET} ${NETBSDSRCDIR}/external/ibm-public/postfix configinstall 3541.304Slukem.endif 3551.363Sjmmv.if (${MKATF} != "no") 3561.363Sjmmv ${MAKEDIRTARGET} ${NETBSDSRCDIR}/external/bsd/atf/etc/atf configinstall 3571.363Sjmmv.endif 3581.406Sjmmv.if (${MKKYUA} != "no") 3591.406Sjmmv ${MAKEDIRTARGET} ${NETBSDSRCDIR}/external/bsd/kyua-cli/etc/kyua configinstall 3601.406Sjmmv.endif 3611.247Slukem 3621.247Slukem 3631.247Slukem# install-obsolete-lists -- 3641.247Slukem# Install var/db/obsolete set lists; this is performed by "make build" 3651.247Slukem# 3661.247SlukemOBSOLETE.dir= ${.OBJDIR}/obsolete.dir 3671.452SmayaOBSOLETE.files= base comp etc games gpufw man misc rescue text 3681.405Smatt.if ${MKDEBUG} != "no" 3691.405SmattOBSOLETE.files+= debug 3701.405Smatt.endif 3711.445Sjmcneill.if ${MKDTB} != "no" 3721.445SjmcneillOBSOLETE.files+= dtb 3731.445Sjmcneill.endif 3741.376She.if ${MKKMOD} != "no" 3751.376SheOBSOLETE.files+= modules 3761.376She.endif 3771.383Snjoly.if ${MKATF} != "no" 3781.383SnjolyOBSOLETE.files+= tests 3791.383Snjoly.endif 3801.360Smrg.if ${MKX11} != "no" 3811.311SlukemOBSOLETE.files+= xbase xcomp xetc xfont xserver 3821.449Smartin.if ${MKDEBUG} != "no" 3831.449SmartinOBSOLETE.files+= xdebug 3841.449Smartin.endif 3851.307Stron.endif 3861.247Slukem 3871.387Suebayasi# XXX make "makeobsolete" set wise; then generate files respectively 3881.322Sdslinstall-obsolete-lists: .PHONY .MAKE 3891.246Slukem mkdir -p ${OBSOLETE.dir} 3901.360Smrg.if ${MKX11} != "no" 3911.307Stron (cd ${NETBSDSRCDIR}/distrib/sets && \ 3921.470Schristos AWK=${TOOL_AWK:Q} SED=${TOOL_SED:Q} MAKE=${MAKE:Q} ${HOST_SH} ./makeobsolete -b -t ${OBSOLETE.dir}) 3931.307Stron.else 3941.253Slukem (cd ${NETBSDSRCDIR}/distrib/sets && \ 3951.470Schristos AWK=${TOOL_AWK:Q} SED=${TOOL_SED:Q} MAKE=${MAKE:Q} ${HOST_SH} ./makeobsolete -t ${OBSOLETE.dir}) 3961.307Stron.endif 3971.246Slukem.for file in ${OBSOLETE.files} 3981.291Slukem ${_MKMSG_INSTALL} ${DESTDIR}/var/db/obsolete/${file} 3991.387Suebayasi if [ ! -e ${DESTDIR}/var/db/obsolete/${file} ] || \ 4001.387Suebayasi ! cmp -s ${OBSOLETE.dir}/${file} ${DESTDIR}/var/db/obsolete/${file}; then \ 4011.387Suebayasi ${ETC_INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} -m 644 \ 4021.387Suebayasi ${OBSOLETE.dir}/${file} ${DESTDIR}/var/db/obsolete; \ 4031.387Suebayasi else true; fi 4041.246Slukem.endfor 4051.1Scgd 4061.242Slukem 4071.242Slukem# distrib-dirs -- 4081.242Slukem# Populate $DESTDIR with directories needed by NetBSD 4091.242Slukem# 4101.371Smrgdistrib-dirs: .PHONY check_DESTDIR 4111.371Smrg cd ${NETBSDSRCDIR}/etc/mtree && ${MAKE} distrib-dirs 4121.255Slukem 4131.437SmartinCOMPRESS_PROGRAM=${"${USE_XZ_SETS:Uno}"!="no":?${TOOL_XZ}:${TOOL_GZIP}} 4141.473SmrgXZ_OPT?=-9 4151.437SmartinTAR_SUFF=${"${USE_XZ_SETS:Uno}"!="no":?tar.xz:tgz} 4161.242Slukem 4171.242Slukem# release, snapshot -- 4181.242Slukem# Build a full distribution including kernels & install media. 4191.242Slukem# 4201.324Sdslrelease snapshot: .PHONY .MAKE check_DESTDIR check_RELEASEDIR snap_md_post 4211.285Slukem ${MAKEDIRTARGET} ${NETBSDSRCDIR}/distrib/sets sets 4221.315Sjmc ${MAKESUMS} -A -t ${RELEASEDIR}/${RELEASEMACHINEDIR}/binary/sets \ 4231.434Smartin ${KERNEL_SETS:@.SETS.@kern-${.SETS.}.${TAR_SUFF}@} 4241.286Scl ${MAKESUMS} -t ${RELEASEDIR}/${RELEASEMACHINEDIR}/binary/kernel '*.gz' 4251.161Shubertf 4261.242Slukem 4271.242Slukem# iso-image -- 4281.242Slukem# Standalone target to create a CDROM image after the release 4291.242Slukem# was composed. Should be run after "make release" in src and xsrc. 4301.341Sbouyer# The do-iso-image is to be called from etc.$MACHINE/Makefile.inc 4311.242Slukem# 4321.245Slukem# Note: At least mkisofs 2.0 should be used. 4331.242Slukem# 4341.292SheCDROM_NAME_ADD?= 4351.415SmartinCDROM_IMAGE?=${RELEASEDIR}/images/NetBSD-${DISTRIBVER}-${MACHINE}.iso 4361.319SapbCDROM.dir= ${.OBJDIR}/cdrom.dir 4371.319SapbCDROM.pathlist= ${.OBJDIR}/cdrom.pathlist 4381.242Slukem 4391.341Sbouyeriso-image: 4401.341Sbouyer 4411.341Sbouyerdo-iso-image: .PHONY check_DESTDIR check_RELEASEDIR iso-image-md-post 4421.415Smartin ${MAKESUMS} -t ${RELEASEDIR}/images/ '*.iso' 4431.395Sjoerg @echo "iso-image created as: ${CDROM_IMAGE}" 4441.161Shubertf 4451.275Slukemiso-image-setup: .PHONY check_RELEASEDIR 4461.242Slukem rm -f ${CDROM.pathlist} 4471.302Sfredb.for extra in README SOURCE_DATE source 4481.302Sfredb.if exists(${RELEASEDIR}/${extra}) 4491.302Sfredb echo "${extra}=${RELEASEDIR}/${extra}" >> ${CDROM.pathlist} 4501.302Sfredb.endif 4511.302Sfredb.endfor 4521.342Sbad echo "${MACHINE}/=${RELEASEDIR}/${RELEASEMACHINEDIR}/" >> ${CDROM.pathlist} 4531.242Slukem mkdir -p ${CDROM.dir} 4541.415Smartin 4551.415Smartincheck_imagedir: 4561.415Smartin mkdir -p ${RELEASEDIR}/images 4571.242Slukem 4581.248Slukem# iso-image-mi -- 4591.242Slukem# Create the image after the MD operations have completed. 4601.248Slukem# 4611.415Smartiniso-image-mi: .PHONY check_DESTDIR check_RELEASEDIR iso-image-md-pre check_imagedir 4621.242Slukem ${MKISOFS} ${MKISOFS_FLAGS} -graft-points -path-list ${CDROM.pathlist} \ 4631.395Sjoerg -o ${CDROM_IMAGE} ${CDROM.dir} 4641.242Slukem 4651.248Slukem# iso-image-md-pre -- 4661.242Slukem# Setup ${CDROM.dir} to produce a bootable CD image. 4671.242Slukem# Overridden by etc.$MACHINE/Makefile.inc 4681.242Slukem# 4691.324Sdsliso-image-md-pre: .PHONY check_DESTDIR check_RELEASEDIR iso-image-setup 4701.242Slukem# (empty -- look in the machine-dependent Makefile.inc) 4711.161Shubertf 4721.248Slukem# iso-image-md-post -- 4731.242Slukem# Fixup the CD-image to be bootable. 4741.242Slukem# Overridden by etc.$MACHINE/Makefile.inc 4751.242Slukem# 4761.324Sdsliso-image-md-post: .PHONY check_DESTDIR check_RELEASEDIR iso-image-mi 4771.242Slukem# (empty -- look in the machine-dependent Makefile.inc) 4781.41Scgd 4791.242Slukem 4801.396Stsutsui# live-image -- 4811.396Stsutsui# Standalone target to create live images after the release was composed. 4821.396Stsutsui# Should be run after "make release" in src and xsrc. 4831.396Stsutsui# LIVEIMG_RELEASEDIR specifies where to install live images and 4841.396Stsutsui# it can be set in MD etc.${MACHINE}/Makefile.inc. 4851.396Stsutsui# 4861.398SrizLIVEIMG_RELEASEDIR?= ${RELEASEDIR}/images 4871.396Stsutsui 4881.396Stsutsuilive-image: .PHONY check_DESTDIR check_RELEASEDIR 4891.396Stsutsui ${MAKEDIRTARGET} ${NETBSDSRCDIR}/distrib live_image \ 4901.396Stsutsui LIVEIMG_RELEASEDIR=${LIVEIMG_RELEASEDIR} 4911.396Stsutsui ${MAKESUMS} -t ${LIVEIMG_RELEASEDIR} '*.img.gz' 4921.396Stsutsui 4931.396Stsutsui# install-image -- 4941.396Stsutsui# Standalone target to create installation images 4951.396Stsutsui# after the release was composed. 4961.396Stsutsui# Should be run after "make release" in src and xsrc. 4971.396Stsutsui# INSTIMG_RELEASEDIR specifies where to install live images and 4981.396Stsutsui# it can be set in MD etc.${MACHINE}/Makefile.inc. 4991.396Stsutsui# 5001.398SrizINSTIMG_RELEASEDIR?= ${RELEASEDIR}/images 5011.396Stsutsui 5021.396Stsutsuiinstall-image: .PHONY check_DESTDIR check_RELEASEDIR 5031.396Stsutsui ${MAKEDIRTARGET} ${NETBSDSRCDIR}/distrib install_image \ 5041.396Stsutsui INSTIMG_RELEASEDIR=${INSTIMG_RELEASEDIR} 5051.396Stsutsui ${MAKESUMS} -t ${INSTIMG_RELEASEDIR} '*.img.gz' 5061.396Stsutsui 5071.242Slukem# snap_pre -- 5081.242Slukem# Create ${RELEASEDIR} and necessary subdirectories. 5091.242Slukem# 5101.324Sdslsnap_pre: .PHONY check_DESTDIR check_RELEASEDIR distribution 5111.241Slukem ${INSTALL} -d -m 755 ${RELEASEDIR} 5121.255Slukem.if ${MKUPDATE} == "no" 5131.168Sjmc# Could be a mount point, ignore the errors 5141.286Scl -/bin/rm -rf ${RELEASEDIR}/${RELEASEMACHINEDIR} 5151.240Slukem.endif 5161.286Scl ${INSTALL} -d -m 755 ${RELEASEDIR}/${RELEASEMACHINEDIR} 5171.117Ssimonb.for dir in ${INSTALLATION_DIRS} 5181.286Scl ${INSTALL} -d -m 755 ${RELEASEDIR}/${RELEASEMACHINEDIR}/${dir} 5191.117Ssimonb.endfor 5201.96Scjs 5211.242Slukem# snap_post -- 5221.242Slukem# Build the install media and notes from distrib 5231.242Slukem# 5241.324Sdslsnap_post: .PHONY .MAKE build_kernelsets build_releasekernels 5251.255Slukem.if ${MKUPDATE} == "no" 5261.233Slukem cd ${NETBSDSRCDIR}/distrib && ${MAKE} cleandir 5271.233Slukem.endif 5281.233Slukem cd ${NETBSDSRCDIR}/distrib && ${MAKE} depend && ${MAKE} && \ 5291.233Slukem ${MAKE} release 5301.233Slukem 5311.324Sdsl# build kernels -- 5321.242Slukem# This target builds the kernels specified by each port. 5331.242Slukem# A port may specify the following kernels: 5341.196Sthorpej# 5351.196Sthorpej# KERNEL_SETS The list of kernels that will be 5361.196Sthorpej# packaged into sets, named 5371.436Smartin# kern-${kernel}.tgz (or .tar.xz). 5381.436Smartin# These kernels are also placed in the 5391.436Smartin# binary/kernel area of the release package 5401.436Smartin# as netbsd-${kernel}.gz. 5411.196Sthorpej# 5421.196Sthorpej# EXTRA_KERNELS Additional kernels to place in the 5431.203Schs# binary/kernel area of the release 5441.196Sthorpej# package as netbsd-${kernel}.gz, but 5451.196Sthorpej# which are not placed into sets. This 5461.196Sthorpej# allows a port to provide e.g. a netbootable 5471.196Sthorpej# installation kernel containing a ramdisk. 5481.196Sthorpej# 5491.196Sthorpej# BUILD_KERNELS Additional kernels to build which are 5501.196Sthorpej# not placed into sets nor into the 5511.203Schs# binary/kernel area of the release 5521.196Sthorpej# package. These are typically kernels 5531.196Sthorpej# that are built for inclusion only in 5541.196Sthorpej# installation disk/CD-ROM/tape images. 5551.116Sfair# 5561.242Slukem# A port may also specify KERNEL_SUFFIXES, which is an optional list 5571.242Slukem# of filename suffixes for kernels to include in the kernel sets and 5581.242Slukem# in the binary/kernel area of the release package (e.g. "netbsd" vs. 5591.242Slukem# "netbsd.ecoff" and "netbsd.srec"). It is not an error if kernels 5601.242Slukem# with these suffixes do not exist in the kernel build directory. 5611.197Sthorpej# 5621.229Slukem# 5631.229Slukem# A list of all the kernels to build, which can be overridden from 5641.229Slukem# external sources (such as make(1)'s environment or command line) 5651.229Slukem# 5661.229SlukemALL_KERNELS?= ${KERNEL_SETS} ${EXTRA_KERNELS} ${BUILD_KERNELS} 5671.402Smlelstv.export ALL_KERNELS 5681.242Slukem 5691.359SapbGETKERNELAWK= ${TOOL_AWK} '/^config/ {print $$2; found=1} \ 5701.116Sfair END{ if (found == 0) print "netbsd"; }' 5711.242Slukem 5721.324Sdslbuild_kernels: .PHONY 5731.232Slukem# Configure & compile kernels listed in ${ALL_KERNELS} 5741.232Slukem# 5751.201Slukem.if !defined(KERNELS_DONE) # { 5761.424Suebayasi.for configfile in ${ALL_KERNELS:O:u} # { 5771.324Sdslbuild_kernels: kern-${configfile} 5781.322Sdslkern-${configfile}: .PHONY .MAKE 5791.469Schristos umask 022 && \ 5801.422Suebayasi cd ${KERNCONFDIR} && ${TOOL_CONFIG} ${CONFIGOPTS} -s ${KERNSRCDIR} \ 5811.455Schristos ${MKDEBUGKERNEL == "yes" :? -DDEBUG=-g :} \ 5821.439Smartin -b ${KERNOBJDIR}/${configfile:C/.*\///} ${configfile} 5831.255Slukem.if ${MKUPDATE} == "no" 5841.427Schristos ${MAKE} -C ${KERNOBJDIR}/${configfile:C/.*\///} distclean 5851.96Scjs.endif 5861.427Schristos ${MAKE} -C ${KERNOBJDIR}/${configfile:C/.*\///} depend && \ 5871.456Schristos ${MAKE} -C ${KERNOBJDIR}/${configfile:C/.*\///} && \ 5881.456Schristos ${MAKE} -C ${KERNOBJDIR}/${configfile:C/.*\///} debuginstall 5891.232Slukem.endfor # ALL_KERNELS # } 5901.232Slukem.endif # KERNELS_DONE # } 5911.232Slukem 5921.324Sdslbuild_kernelsets: .PHONY 5931.241Slukem# Create kernel sets from ${KERNEL_SETS} into 5941.286Scl# ${RELEASEDIR}/${RELEASEMACHINEDIR}/binary/sets 5951.232Slukem# 5961.424Suebayasi.for configfile in ${KERNEL_SETS:O:u} # { 5971.424Suebayasi.for configsel in ${ALL_KERNELS:O:u} 5981.402Smlelstv.if ${configfile} == ${configsel} 5991.324Sdslbuild_kernelsets: kernset-${configfile} 6001.324Sdslkernset-${configfile}: .PHONY build_kernels snap_pre 6011.430Schristos @kernlist=$$(${GETKERNELAWK} ${KERNCONFDIR}/${configfile}); \ 6021.197Sthorpej kerndir=${KERNOBJDIR}/${configfile:C/.*\///}; \ 6031.256Sdsl kernsuffixes="${KERNEL_SUFFIXES:S/^/./}"; \ 6041.434Smartin kern_tgz=${RELEASEDIR}/${RELEASEMACHINEDIR}/binary/sets/kern-${configfile}.${TAR_SUFF}; \ 6051.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}"; \ 6061.469Schristos umask 022 && \ 6071.256Sdsl cd $${kerndir} && { \ 6081.256Sdsl kernels=; newest=; \ 6091.210Slukem for kernel in $${kernlist}; do \ 6101.256Sdsl for s in "" $${kernsuffixes}; do \ 6111.256Sdsl ks="$${kernel}$${s}"; \ 6121.256Sdsl [ -f $${ks} ] || continue; \ 6131.256Sdsl kernels="$${kernels} $${ks}"; \ 6141.442Schristos [ -z "$${newest}" -o $${ks} \ 6151.442Schristos -nt "$${newest}" ] && newest=$${ks}; \ 6161.455Schristos [ ${MKDEBUGKERNEL} = "no" -o \ 6171.458Skre ! -f $${ks}.gdb ] && continue; \ 6181.455Schristos kernels="$${kernels} $${ks}.gdb"; \ 6191.197Sthorpej done; \ 6201.256Sdsl done; \ 6211.256Sdsl [ $${kern_tgz} -nt "$${newest}" ] || { \ 6221.256Sdsl echo "echo $${kernels} | $${pax_cmd}"; \ 6231.444Schristos if [ ${KERNEL_DIR} = "yes" ]; then \ 6241.442Schristos tmpdir=kernel$$; \ 6251.442Schristos trap "rm -fr $${tmpdir}" 0 1 2 3 15; \ 6261.442Schristos mkdir -p $${tmpdir}/netbsd; \ 6271.442Schristos d=./netbsd; \ 6281.442Schristos cd $${tmpdir}; \ 6291.442Schristos else \ 6301.442Schristos d=.; \ 6311.442Schristos fi; \ 6321.256Sdsl ( echo "/set uname=${BINOWN} gname=${BINGRP}"; \ 6331.256Sdsl echo ". type=dir optional"; \ 6341.442Schristos if [ ${KERNEL_DIR} = "yes" ]; then \ 6351.442Schristos echo "./netbsd type=dir optional"; \ 6361.442Schristos fi; \ 6371.256Sdsl for kernel in $${kernels}; do \ 6381.442Schristos if [ ${KERNEL_DIR} = "yes" ]; then \ 6391.442Schristos newname=$$(echo $${kernel} | \ 6401.442Schristos ${TOOL_SED} -e s/netbsd/kernel/); \ 6411.475Spgoyette ln -f ../$${kernel} ./netbsd/$${newname}; \ 6421.442Schristos else \ 6431.442Schristos newname=$${kernel}; \ 6441.442Schristos fi; \ 6451.442Schristos echo "$${d}/$${newname} type=file"; \ 6461.256Sdsl done ) | eval $${pax_cmd}; \ 6471.256Sdsl } \ 6481.256Sdsl } 6491.402Smlelstv.endif 6501.402Smlelstv.endfor 6511.232Slukem.endfor # KERNEL_SETS # } 6521.232Slukem 6531.324Sdslbuild_releasekernels: .PHONY 6541.232Slukem# Build kernel.gz from ${KERNEL_SETS} ${EXTRA_KERNELS} into 6551.286Scl# ${RELEASEDIR}/${RELEASEMACHINEDIR}/binary/kernel 6561.232Slukem# 6571.424Suebayasi.for configfile in ${KERNEL_SETS:O:u} ${EXTRA_KERNELS:O:u} # { 6581.424Suebayasi.for configsel in ${ALL_KERNELS:O:u} 6591.402Smlelstv.if ${configfile} == ${configsel} 6601.324Sdslbuild_releasekernels: releasekern-${configfile} 6611.324Sdslreleasekern-${configfile}: .PHONY build_kernels snap_pre 6621.430Schristos @kernlist=$$(${GETKERNELAWK} ${KERNCONFDIR}/${configfile:C/.*\///}); \ 6631.197Sthorpej kerndir=${KERNOBJDIR}/${configfile:C/.*\///}; \ 6641.256Sdsl kernsuffixes="${KERNEL_SUFFIXES:S/^/./}"; \ 6651.429Schristos dest="${RELEASEDIR}/${RELEASEMACHINEDIR}/binary/kernel"; \ 6661.469Schristos umask 022 && \ 6671.256Sdsl cd $${kerndir} && { \ 6681.256Sdsl for kernel in $${kernlist}; do \ 6691.256Sdsl for s in "" $${kernsuffixes}; do \ 6701.256Sdsl ks="$${kernel}$${s}"; \ 6711.256Sdsl [ ! -f $${ks} ] && continue; \ 6721.429Schristos knl_gz="$${dest}/$${kernel}-${configfile:C/.*\///}$${s}.gz"; \ 6731.256Sdsl [ $${knl_gz} -nt $${ks} ] && continue; \ 6741.352Sgdt rm -f $${knl_gz}; \ 6751.419Sapb echo "${TOOL_GZIP} ${GZIP_FLAGS} -c < $${kerndir}/$${ks} > $${knl_gz}"; \ 6761.419Sapb ${TOOL_GZIP} ${GZIP_FLAGS} -c < $${ks} > $${knl_gz}; \ 6771.197Sthorpej done; \ 6781.256Sdsl done; \ 6791.256Sdsl } 6801.402Smlelstv.endif 6811.402Smlelstv.endfor 6821.232Slukem.endfor # KERNEL_SETS EXTRA_KERNELS # } 6831.232Slukem 6841.456Schristos# install-debugkernels: 6851.456Schristos# Create fake kernel debug files to satisfy the sets requirements 6861.456Schristos# They will be later replaced with the real ones if we are building 6871.456Schristos# kernels. This mess is needed because checkflist runs before the 6881.456Schristos# kernels are built. It should really run before the sets are build. 6891.456Schristosinstall-debugkernels: 6901.456Schristos.if ${MKDEBUG:Uno} == "yes" 6911.457Schristos @for i in $$(${NETBSDSRCDIR}/distrib/sets/makeflist debug | \ 6921.457Schristos ${TOOL_GREP} -E '^./usr/libdata/debug/(nfs)?netbsd-'); do \ 6931.457Schristos echo touch ${DESTDIR}/$$i; \ 6941.457Schristos touch ${DESTDIR}/$$i; \ 6951.457Schristos done 6961.456Schristos. for k in ${ALL_KERNELS} 6971.456Schristosinstall-debugkernels: ${DESTDIR}${DEBUGDIR}/netbsd-${k}.debug 6981.456Schristos 6991.456Schristos${DESTDIR}${DEBUGDIR}/netbsd-${k}.debug: 7001.456Schristos ${_MKTARGET_INSTALL} 7011.456Schristos touch ${.TARGET} 7021.456Schristos. endfor 7031.456Schristos.endif 7041.456Schristos 7051.242Slukem# snap_md_post -- 7061.242Slukem# Machine dependent distribution media operations. 7071.242Slukem# Overridden by etc.$MACHINE/Makefile.inc 7081.242Slukem# 7091.324Sdslsnap_md_post: .PHONY check_DESTDIR check_RELEASEDIR snap_post 7101.242Slukem# (empty -- look in the machine-dependent Makefile.inc) 7111.242Slukem 7121.242Slukem 7131.242Slukemclean: 7141.246Slukem -rm -rf ${CDROM.dir} ${CDROM.pathlist} ${OBSOLETE.dir} 7151.7Scgd 7161.474SmrgSUBDIR= defaults rc.d pam.d mtree 7171.362Scube 7181.1Scgd.include <bsd.prog.mk> 7191.362Scube.include <bsd.subdir.mk> 7201.309Stron 7211.309Strontest: 7221.309Stron @echo ${OBSOLETE.files} 723