1# $OpenBSD: Makefile,v 1.295 2011/04/17 21:26:38 schwarze Exp $ 2 3TZDIR= /usr/share/zoneinfo 4LOCALTIME= Canada/Mountain 5MTREEDIR= /etc/mtree 6 7NOOBJ= 8 9.if exists(etc.${MACHINE}/Makefile.inc) 10.include "etc.${MACHINE}/Makefile.inc" 11.endif 12 13# -rw-r--r-- 14BINOWN= root 15BINGRP= wheel 16BIN1= changelist ccd.conf csh.cshrc csh.login csh.logout daily dhcpd.conf \ 17 exports ftpusers ftpchroot gettytab group hosts hosts.lpd inetd.conf \ 18 ksh.kshrc locate.rc man.conf monthly motd mrouted.conf myname \ 19 netstart networks newsyslog.conf printcap protocols \ 20 rbootd.conf rc rc.conf rc.local rc.securelevel rc.shutdown \ 21 remote rpc services shells syslog.conf weekly \ 22 etc.${MACHINE}/disktab dhclient.conf mailer.conf ntpd.conf \ 23 moduli pf.os sensorsd.conf ifstated.conf 24 25.if ${MACHINE} != "aviion" && ${MACHINE} != "mvme68k" && \ 26 ${MACHINE} != "mvme88k" 27BIN1+= wsconsctl.conf 28.endif 29 30# -rw-rw-r-- 31BIN2= motd 32 33MISETS= base${OSrev}.tgz comp${OSrev}.tgz \ 34 man${OSrev}.tgz game${OSrev}.tgz etc${OSrev}.tgz 35 36PCS= pcs750.bin 37 38# Use NOGZIP on architectures where the gzip'ing would take too much time 39# (pmax or slower :-)). This way you get only tar'ed snap files and you can 40# gzip them on a faster machine 41.ifndef NOGZIP 42GZIPCMD?= gzip 43GZIPFLAGS?= -9 44GZIPEXT?= .gz 45.else 46GZIPCMD= cat 47GZIPFLAGS= 48GZIPEXT= 49.endif 50 51all clean cleandir depend etc install lint: 52 53install-mtree: 54 ${INSTALL} -c -o root -g wheel -m 600 ${.CURDIR}/mtree/special \ 55 ${DESTDIR}${MTREEDIR} 56 ${INSTALL} -c -o root -g wheel -m 444 ${.CURDIR}/mtree/4.4BSD.dist \ 57 ${DESTDIR}${MTREEDIR} 58 ${INSTALL} -c -o root -g wheel -m 444 ${.CURDIR}/mtree/BSD.local.dist \ 59 ${DESTDIR}${MTREEDIR} 60 ${INSTALL} -c -o root -g wheel -m 444 ${.CURDIR}/mtree/BSD.x11.dist \ 61 ${DESTDIR}${MTREEDIR} 62 63.ifndef DESTDIR 64distribution-etc-root-var distribution distrib-dirs release: 65 @echo setenv DESTDIR before doing that! 66 @false 67.else 68distribution-etc-root-var: distrib-dirs 69 ${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 644 ${BIN1} ${DESTDIR}/etc 70 ksh ttys.pty | cat etc.${MACHINE}/ttys - > ${DESTDIR}/etc/ttys && \ 71 chown ${BINOWN} ${DESTDIR}/etc/ttys && \ 72 chgrp ${BINGRP} ${DESTDIR}/etc/ttys && \ 73 chmod 644 ${DESTDIR}/etc/ttys 74 cat sysctl.conf etc.${MACHINE}/sysctl.conf > ${DESTDIR}/etc/sysctl.conf && \ 75 chown ${BINOWN} ${DESTDIR}/etc/sysctl.conf && \ 76 chgrp ${BINGRP} ${DESTDIR}/etc/sysctl.conf && \ 77 chmod 644 ${DESTDIR}/etc/sysctl.conf 78 cat fbtab.head etc.${MACHINE}/fbtab fbtab.tail > ${DESTDIR}/etc/fbtab && \ 79 chown ${BINOWN} ${DESTDIR}/etc/fbtab && \ 80 chgrp ${BINGRP} ${DESTDIR}/etc/fbtab && \ 81 chmod 644 ${DESTDIR}/etc/fbtab 82 awk -f ${.CURDIR}/mklogin.conf `test -f etc.${MACHINE}/login.conf.overrides && echo etc.${MACHINE}/login.conf.overrides` < ${.CURDIR}/login.conf.in > \ 83 ${DESTDIR}/etc/login.conf && \ 84 chown ${BINOWN}:${BINGRP} ${DESTDIR}/etc/login.conf && \ 85 chmod 644 ${DESTDIR}/etc/login.conf 86 ${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 664 ${BIN2} ${DESTDIR}/etc 87 ${INSTALL} -c -o root -g wheel -m 600 hosts.equiv ${DESTDIR}/etc 88 ${INSTALL} -c -o root -g crontab -m 600 crontab ${DESTDIR}/var/cron/tabs/root 89 ${INSTALL} -c -o root -g wheel -m 600 master.passwd ${DESTDIR}/etc 90 pwd_mkdb -p -d ${DESTDIR}/etc /etc/master.passwd 91 ${INSTALL} -c -o root -g wheel -m 600 bgpd.conf ${DESTDIR}/etc 92 ${INSTALL} -c -o root -g wheel -m 600 ospfd.conf ${DESTDIR}/etc 93 ${INSTALL} -c -o root -g wheel -m 600 ospf6d.conf ${DESTDIR}/etc 94 ${INSTALL} -c -o root -g wheel -m 600 ripd.conf ${DESTDIR}/etc 95 ${INSTALL} -c -o root -g wheel -m 600 dvmrpd.conf ${DESTDIR}/etc 96 ${INSTALL} -c -o root -g wheel -m 600 ldpd.conf ${DESTDIR}/etc 97 ${INSTALL} -c -o root -g wheel -m 600 pf.conf ${DESTDIR}/etc 98 ${INSTALL} -c -o root -g operator -m 644 chio.conf ${DESTDIR}/etc 99 ${INSTALL} -c -o root -g wheel -m 600 hostapd.conf ${DESTDIR}/etc 100 ${INSTALL} -c -o root -g wheel -m 600 relayd.conf ${DESTDIR}/etc 101 ${INSTALL} -c -o root -g wheel -m 600 iked.conf ${DESTDIR}/etc 102 ${INSTALL} -c -o root -g wheel -m 600 ipsec.conf ${DESTDIR}/etc 103 ${INSTALL} -c -o root -g wheel -m 600 sasyncd.conf ${DESTDIR}/etc 104 ${INSTALL} -c -o root -g wheel -m 600 snmpd.conf ${DESTDIR}/etc 105 ${INSTALL} -c -o root -g wheel -m 600 ldapd.conf ${DESTDIR}/etc 106 ${INSTALL} -c -o root -g _nsd -m 640 nsd.conf ${DESTDIR}/etc 107 ${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 555 \ 108 etc.${MACHINE}/MAKEDEV ${DESTDIR}/dev 109 cd root; \ 110 ${INSTALL} -c -o root -g wheel -m 644 dot.cshrc \ 111 ${DESTDIR}/root/.cshrc; \ 112 ${INSTALL} -c -o root -g wheel -m 600 dot.klogin \ 113 ${DESTDIR}/root/.klogin; \ 114 ${INSTALL} -c -o root -g wheel -m 644 dot.login \ 115 ${DESTDIR}/root/.login; \ 116 ${INSTALL} -c -o root -g wheel -m 644 dot.profile \ 117 ${DESTDIR}/root/.profile; \ 118 ${INSTALL} -c -o root -g wheel -m 644 dot.Xdefaults \ 119 ${DESTDIR}/root/.Xdefaults; \ 120 rm -f ${DESTDIR}/.cshrc ${DESTDIR}/.profile; \ 121 ${INSTALL} -c -o root -g wheel -m 644 dot.cshrc \ 122 ${DESTDIR}/.cshrc; \ 123 ${INSTALL} -c -o root -g wheel -m 644 dot.profile \ 124 ${DESTDIR}/.profile 125 cd skel; \ 126 ${INSTALL} -c -o root -g wheel -m 644 dot.cshrc \ 127 ${DESTDIR}/etc/skel/.cshrc; \ 128 ${INSTALL} -c -o root -g wheel -m 644 dot.login \ 129 ${DESTDIR}/etc/skel/.login; \ 130 ${INSTALL} -c -o root -g wheel -m 644 dot.mailrc \ 131 ${DESTDIR}/etc/skel/.mailrc; \ 132 ${INSTALL} -c -o root -g wheel -m 644 dot.profile \ 133 ${DESTDIR}/etc/skel/.profile; \ 134 ${INSTALL} -c -o root -g wheel -m 644 dot.Xdefaults \ 135 ${DESTDIR}/etc/skel/.Xdefaults; \ 136 ${INSTALL} -c -o root -g wheel -m 600 /dev/null \ 137 ${DESTDIR}/etc/skel/.ssh/authorized_keys 138 cd kerberosV; \ 139 ${INSTALL} -c -o root -g wheel -m 644 README \ 140 ${DESTDIR}/etc/kerberosV; \ 141 ${INSTALL} -c -o root -g wheel -m 644 krb5.conf.example \ 142 ${DESTDIR}/etc/kerberosV 143 cd amd; \ 144 ${INSTALL} -c -o root -g wheel -m 644 master.sample \ 145 ${DESTDIR}/etc/amd 146 cd ppp; \ 147 ${INSTALL} -c -o root -g wheel -m 600 chap-secrets \ 148 ${DESTDIR}/etc/ppp; \ 149 ${INSTALL} -c -o root -g wheel -m 600 options \ 150 ${DESTDIR}/etc/ppp; \ 151 ${INSTALL} -c -o root -g wheel -m 600 options.leaf \ 152 ${DESTDIR}/etc/ppp; \ 153 ${INSTALL} -c -o root -g wheel -m 600 options.sample \ 154 ${DESTDIR}/etc/ppp; \ 155 ${INSTALL} -c -o root -g wheel -m 600 chatscript.sample \ 156 ${DESTDIR}/etc/ppp; \ 157 ${INSTALL} -c -o root -g wheel -m 600 pap-secrets \ 158 ${DESTDIR}/etc/ppp; \ 159 ${INSTALL} -c -o root -g wheel -m 600 ppp.conf.sample \ 160 ${DESTDIR}/etc/ppp; \ 161 ${INSTALL} -c -o root -g wheel -m 644 ppp.linkup.sample \ 162 ${DESTDIR}/etc/ppp; \ 163 ${INSTALL} -c -o root -g wheel -m 644 ppp.linkdown.sample \ 164 ${DESTDIR}/etc/ppp; \ 165 ${INSTALL} -c -o root -g wheel -m 644 ppp.secret.sample \ 166 ${DESTDIR}/etc/ppp 167 cd afs; \ 168 ${INSTALL} -c -o root -g wheel -m 644 afsd.conf \ 169 ${DESTDIR}/etc/afs; \ 170 ${INSTALL} -c -o root -g wheel -m 644 ThisCell \ 171 ${DESTDIR}/etc/afs; \ 172 ${INSTALL} -c -o root -g wheel -m 644 CellServDB \ 173 ${DESTDIR}/etc/afs; \ 174 ${INSTALL} -c -o root -g wheel -m 644 SuidCells \ 175 ${DESTDIR}/etc/afs; \ 176 ${INSTALL} -c -o root -g wheel -m 644 README \ 177 ${DESTDIR}/etc/afs 178 cd systrace; \ 179 ${INSTALL} -c -o root -g wheel -m 600 usr_sbin_lpd \ 180 ${DESTDIR}/etc/systrace; \ 181 ${INSTALL} -c -o root -g wheel -m 600 usr_sbin_named \ 182 ${DESTDIR}/etc/systrace 183 cd bind; \ 184 ${INSTALL} -c -o root -g named -m 640 named-simple.conf \ 185 ${DESTDIR}/var/named/etc/named.conf; \ 186 ${INSTALL} -c -o root -g named -m 640 named-*.conf \ 187 ${DESTDIR}/var/named/etc; \ 188 ${INSTALL} -c -o root -g wheel -m 644 root.hint \ 189 ${DESTDIR}/var/named/etc; \ 190 ${INSTALL} -c -o root -g wheel -m 644 db.localhost \ 191 ${DESTDIR}/var/named/standard/localhost; \ 192 ${INSTALL} -c -o root -g wheel -m 644 db.loopback \ 193 ${DESTDIR}/var/named/standard/loopback; \ 194 ${INSTALL} -c -o root -g wheel -m 644 db.loopback6.arpa \ 195 ${DESTDIR}/var/named/standard/loopback6.arpa 196 /bin/rm -f ${DESTDIR}/etc/localtime 197 ln -s ${TZDIR}/${LOCALTIME} ${DESTDIR}/etc/localtime 198 /bin/rm -f ${DESTDIR}/etc/rmt 199 ln -s /usr/sbin/rmt ${DESTDIR}/etc/rmt 200 ${INSTALL} -c -o root -g wheel -m 644 minfree \ 201 ${DESTDIR}/var/crash 202 ${INSTALL} -c -o ${BINOWN} -g operator -m 664 /dev/null \ 203 ${DESTDIR}/etc/dumpdates 204 ${INSTALL} -c -o root -g crontab -m 660 /dev/null \ 205 ${DESTDIR}/var/cron/at.deny 206 ${INSTALL} -c -o root -g crontab -m 660 /dev/null \ 207 ${DESTDIR}/var/cron/cron.deny 208 ${INSTALL} -c -o root -g wheel -m 600 /dev/null \ 209 ${DESTDIR}/var/cron/log 210 ${INSTALL} -c -o root -g wheel -m 444 /dev/null \ 211 ${DESTDIR}/var/db/locate.database 212 ${INSTALL} -c -o ${BINOWN} -g wheel -m 640 /dev/null \ 213 ${DESTDIR}/var/log/authlog 214 ${INSTALL} -c -o ${BINOWN} -g wheel -m 640 /dev/null \ 215 ${DESTDIR}/var/log/daemon 216 ${INSTALL} -c -o ${BINOWN} -g wheel -m 600 /dev/null \ 217 ${DESTDIR}/var/log/failedlogin 218 ${INSTALL} -c -o ${BINOWN} -g wheel -m 640 /dev/null \ 219 ${DESTDIR}/var/log/ftpd 220 ${INSTALL} -c -o ${BINOWN} -g wheel -m 644 /dev/null \ 221 ${DESTDIR}/var/log/lastlog 222 ${INSTALL} -c -o ${BINOWN} -g wheel -m 640 /dev/null \ 223 ${DESTDIR}/var/log/lpd-errs 224 ${INSTALL} -c -o ${BINOWN} -g wheel -m 600 /dev/null \ 225 ${DESTDIR}/var/log/maillog 226 ${INSTALL} -c -o ${BINOWN} -g wheel -m 644 /dev/null \ 227 ${DESTDIR}/var/log/messages 228 ${INSTALL} -c -o ${BINOWN} -g wheel -m 600 /dev/null \ 229 ${DESTDIR}/var/log/secure 230 ${INSTALL} -c -o ${BINOWN} -g wheel -m 664 /dev/null \ 231 ${DESTDIR}/var/log/sendmail.st 232 ${INSTALL} -c -o ${BINOWN} -g wheel -m 644 /dev/null \ 233 ${DESTDIR}/var/log/wtmp 234 ${INSTALL} -c -o ${BINOWN} -g wheel -m 640 /dev/null \ 235 ${DESTDIR}/var/log/xferlog 236 ${INSTALL} -c -o ${BINOWN} -g utmp -m 664 /dev/null \ 237 ${DESTDIR}/var/run/utmp 238.if ${MACHINE} == "vax" 239 uudecode -p etc.vax/${PCS}.uu > ${DESTDIR}/${PCS} && \ 240 chown ${BINOWN} ${DESTDIR}/${PCS} && \ 241 chgrp ${BINGRP} ${DESTDIR}/${PCS} && \ 242 chmod 644 ${DESTDIR}/${PCS} 243.endif 244 cd ../gnu/usr.sbin/sendmail/cf/cf && exec ${MAKE} distribution 245 cd ../usr.sbin/ypserv/ypinit && exec ${MAKE} distribution 246 cd ../usr.bin/ssh && exec ${MAKE} distribution 247 cd ../usr.sbin/httpd && exec ${MAKE} -f Makefile.bsd-wrapper distribution 248 cd ../lib/libssl && exec ${MAKE} distribution 249 cd ../gnu/usr.bin/lynx && exec ${MAKE} -f Makefile.bsd-wrapper distribution 250 cd ../usr.bin/bgplg && exec ${MAKE} distribution 251 cd ../usr.bin/mail && exec ${MAKE} distribution 252 cd ../usr.sbin/ldapd && exec ${MAKE} distribution 253 cd mail && exec ${MAKE} distribution 254 ${INSTALL} -c -o root -g wheel -m 600 root/root.mail \ 255 ${DESTDIR}/var/mail/root 256 ${INSTALL} -c -o root -g wheel -m 440 ../usr.bin/sudo/sudoers \ 257 ${DESTDIR}/etc/sudoers 258 cd rc.d; \ 259 ${INSTALL} -c -o root -g wheel -m 644 rc.subr \ 260 ${DESTDIR}/etc/rc.d 261 262distribution: 263 exec ${SUDO} ${MAKE} distribution-etc-root-var 264 cd .. && exec ${SUDO} ${MAKE} install 265 touch ${DESTDIR}/var/db/sysmerge/etcsum 266 TMPSUM=`mktemp /tmp/_etcsum.XXXXXXXXXX` || exit 1; \ 267 sort ../distrib/sets/lists/etc/{mi,md.${MACHINE}} > $${TMPSUM}; \ 268 cd ${DESTDIR} && \ 269 xargs cksum < $${TMPSUM} > ${DESTDIR}/var/db/sysmerge/etcsum; \ 270 rm -f $${TMPSUM} 271 272distrib-dirs: 273 if [ ! -d ${DESTDIR}/. ]; then \ 274 ${INSTALL} -d -o root -g wheel -m 755 ${DESTDIR}; \ 275 fi 276 mtree -qdef mtree/4.4BSD.dist -p ${DESTDIR}/ -U 277 if [ ! -d ${DESTDIR}/usr/src ]; then \ 278 ${INSTALL} -d -o root -g wsrc -m 775 ${DESTDIR}/usr/src; \ 279 fi 280 cd ${DESTDIR}/; rm -f sys; ln -s usr/src/sys sys 281 282.ifndef RELEASEDIR 283release: 284 @echo setenv RELEASEDIR before building a release. 285 @false 286.else 287 288release-sets: 289 cd ${.CURDIR}/../distrib/sets && exec ${SUDO} sh maketars ${OSrev} 290 291sha: 292 -cd ${RELEASEDIR}; \ 293 sum -a sha256 INSTALL.`arch -ks` ${MDEXT} ${MISETS} > SHA256 294 295release: distribution kernels release-sets distrib sha 296 297.endif 298 299.endif # DESTDIR check 300 301distrib: 302 cd ${.CURDIR}/../distrib && \ 303 ${MAKE} && exec ${SUDO} ${MAKE} install 304 305DHSIZE=1024 1536 2048 3072 4096 306update-moduli: 307 ( \ 308 echo -n '# $$Open'; echo 'BSD$$'; \ 309 echo '# Time Type Tests Tries Size Generator Modulus'; \ 310 ( for i in ${DHSIZE}; do \ 311 ssh-keygen -b $$i -G /dev/stdout; \ 312 done) | \ 313 ssh-keygen -T /dev/stdout \ 314 ) > moduli 315 316.PHONY: distribution-etc-root-var distribution distrib-dirs \ 317 release allarchs kernels release-sets m4 install-mtree 318 319SUBDIR+= etc.alpha etc.amd64 etc.armish etc.aviion etc.hp300 etc.hppa 320SUBDIR+= etc.hppa64 etc.i386 etc.landisk etc.loongson etc.luna88k 321SUBDIR+= etc.mac68k etc.macppc etc.mvme68k etc.mvme88k etc.palm 322SUBDIR+= etc.sgi etc.socppc etc.sparc etc.sparc64 etc.vax etc.zaurus 323 324.include <bsd.subdir.mk> 325.include <bsd.prog.mk> 326