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