1# from: @(#)Makefile 5.11 (Berkeley) 5/21/91 2# $FreeBSD$ 3 4.include <src.opts.mk> 5 6SUBDIR= \ 7 newsyslog.conf.d 8 9.if ${MK_SENDMAIL} != "no" 10SUBDIR+=sendmail 11.endif 12 13BIN1= crontab \ 14 devd.conf \ 15 devfs.conf \ 16 ddb.conf \ 17 dhclient.conf \ 18 disktab \ 19 fbtab \ 20 gettytab \ 21 group \ 22 hosts \ 23 hosts.allow \ 24 hosts.equiv \ 25 libalias.conf \ 26 libmap.conf \ 27 login.access \ 28 login.conf \ 29 mac.conf \ 30 motd \ 31 netconfig \ 32 network.subr \ 33 networks \ 34 newsyslog.conf \ 35 nsswitch.conf \ 36 phones \ 37 profile \ 38 protocols \ 39 rc \ 40 rc.bsdextended \ 41 rc.firewall \ 42 rc.initdiskless \ 43 rc.shutdown \ 44 rc.subr \ 45 remote \ 46 rpc \ 47 services \ 48 shells \ 49 sysctl.conf \ 50 syslog.conf \ 51 termcap.small 52 53.if exists(${.CURDIR}/etc.${MACHINE}/ttys) 54BIN1+= etc.${MACHINE}/ttys 55.elif exists(${.CURDIR}/etc.${MACHINE_ARCH}/ttys) 56BIN1+= etc.${MACHINE_ARCH}/ttys 57.elif exists(${.CURDIR}/etc.${MACHINE_CPUARCH}/ttys) 58BIN1+= etc.${MACHINE_CPUARCH}/ttys 59.else 60.error etc.MACHINE/ttys missing 61.endif 62 63OPENBSMDIR= ${.CURDIR}/../contrib/openbsm 64BSM_ETC_OPEN_FILES= ${OPENBSMDIR}/etc/audit_class \ 65 ${OPENBSMDIR}/etc/audit_event 66BSM_ETC_RESTRICTED_FILES= ${OPENBSMDIR}/etc/audit_control \ 67 ${OPENBSMDIR}/etc/audit_user 68BSM_ETC_EXEC_FILES= ${OPENBSMDIR}/etc/audit_warn 69BSM_ETC_DIR= ${DESTDIR}/etc/security 70 71# NB: keep these sorted by MK_* knobs 72 73.if ${MK_AMD} != "no" 74BIN1+= amd.map 75.endif 76 77.if ${MK_APM} != "no" 78BIN1+= apmd.conf 79.endif 80 81.if ${MK_AUTOFS} != "no" 82BIN1+= auto_master 83.endif 84 85.if ${MK_BSNMP} != "no" 86BIN1+= snmpd.config 87.endif 88 89.if ${MK_FREEBSD_UPDATE} != "no" 90BIN1+= freebsd-update.conf 91.endif 92 93.if ${MK_FTP} != "no" 94BIN1+= ftpusers 95.endif 96 97.if ${MK_INETD} != "no" 98BIN1+= inetd.conf 99.endif 100 101.if ${MK_LOCATE} != "no" 102BIN1+= ${.CURDIR}/../usr.bin/locate/locate/locate.rc 103.endif 104 105.if ${MK_LPR} != "no" 106BIN1+= hosts.lpd printcap 107.endif 108 109.if ${MK_MAIL} != "no" 110BIN1+= ${.CURDIR}/../usr.bin/mail/misc/mail.rc 111.endif 112 113.if ${MK_NTP} != "no" 114BIN1+= ntp.conf 115.endif 116 117.if ${MK_OPENSSH} != "no" 118SSH= ${.CURDIR}/../crypto/openssh/ssh_config \ 119 ${.CURDIR}/../crypto/openssh/sshd_config \ 120 ${.CURDIR}/../crypto/openssh/moduli 121.endif 122.if ${MK_OPENSSL} != "no" 123SSL= ${.CURDIR}/../crypto/openssl/apps/openssl.cnf 124.endif 125 126.if ${MK_NS_CACHING} != "no" 127BIN1+= nscd.conf 128.endif 129 130.if ${MK_PORTSNAP} != "no" 131BIN1+= portsnap.conf 132.endif 133 134.if ${MK_PF} != "no" 135BIN1+= pf.os 136.endif 137 138.if ${MK_SENDMAIL} != "no" 139BIN1+= rc.sendmail 140.endif 141 142.if ${MK_TCSH} != "no" 143BIN1+= csh.cshrc csh.login csh.logout 144.endif 145 146.if ${MK_WIRELESS} != "no" 147BIN1+= regdomain.xml 148.endif 149 150# -rwxr-xr-x root:wheel, for the new cron root:wheel 151BIN2= netstart pccard_ether rc.suspend rc.resume 152 153MTREE= BSD.debug.dist BSD.include.dist BSD.root.dist BSD.usr.dist BSD.var.dist 154.if ${MK_TESTS} != "no" 155MTREE+= BSD.tests.dist 156.endif 157.if ${MK_SENDMAIL} != "no" 158MTREE+= BSD.sendmail.dist 159.endif 160 161PPPCNF= ppp.conf 162 163.if ${MK_SENDMAIL} == "no" 164ETCMAIL=mailer.conf aliases 165.else 166ETCMAIL=Makefile README mailer.conf access.sample virtusertable.sample \ 167 mailertable.sample aliases 168.endif 169 170# Special top level files for FreeBSD 171FREEBSD=COPYRIGHT 172 173# Sanitize DESTDIR 174DESTDIR:= ${DESTDIR:C://*:/:g} 175 176afterinstall: 177.if ${MK_MAN} != "no" 178 ${_+_}cd ${.CURDIR}/../share/man; ${MAKE} makedb 179.endif 180 181distribute: 182 # Avoid installing tests here; "make distribution" will do this and 183 # correctly place them in the right location. 184 ${_+_}cd ${.CURDIR} ; ${MAKE} MK_TESTS=no install \ 185 DESTDIR=${DISTDIR}/${DISTRIBUTION} 186 ${_+_}cd ${.CURDIR} ; ${MAKE} distribution DESTDIR=${DISTDIR}/${DISTRIBUTION} 187 188.include <bsd.endian.mk> 189.if ${TARGET_ENDIANNESS} == "1234" 190CAP_MKDB_ENDIAN?= -l 191PWD_MKDB_ENDIAN?= -L 192.elif ${TARGET_ENDIANNESS} == "4321" 193CAP_MKDB_ENDIAN?= -b 194PWD_MKDB_ENDIAN?= -B 195.else 196CAP_MKDB_ENDIAN?= 197PWD_MKDB_ENDIAN?= 198.endif 199 200.if defined(NO_ROOT) 201METALOG.add?= cat -l >> ${METALOG} 202.endif 203 204distribution: 205.if !defined(DESTDIR) 206 @echo "set DESTDIR before running \"make ${.TARGET}\"" 207 @false 208.endif 209 cd ${.CURDIR}; \ 210 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \ 211 ${BIN1} ${DESTDIR}/etc; \ 212 cap_mkdb ${CAP_MKDB_ENDIAN} ${DESTDIR}/etc/login.conf; \ 213 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 755 \ 214 ${BIN2} ${DESTDIR}/etc; \ 215 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 600 \ 216 master.passwd nsmb.conf opieaccess ${DESTDIR}/etc; 217.if ${MK_AT} == "no" 218 sed -i "" -e 's;.*/usr/libexec/atrun;#&;' ${DESTDIR}/etc/crontab 219.endif 220.if ${MK_TCSH} == "no" 221 sed -i "" -e 's;/bin/csh;/bin/sh;' ${DESTDIR}/etc/master.passwd 222.endif 223 pwd_mkdb ${PWD_MKDB_ENDIAN} -i -p -d ${DESTDIR}/etc \ 224 ${DESTDIR}/etc/master.passwd 225.if defined(NO_ROOT) 226 ( \ 227 echo "./etc/login.conf.db type=file mode=0644 uname=root gname=wheel"; \ 228 echo "./etc/passwd type=file mode=0644 uname=root gname=wheel"; \ 229 echo "./etc/pwd.db type=file mode=0644 uname=root gname=wheel"; \ 230 echo "./etc/spwd.db type=file mode=0600 uname=root gname=wheel"; \ 231 ) | ${METALOG.add} 232.endif 233.if ${MK_AUTOFS} != "no" 234 ${_+_}cd ${.CURDIR}/autofs; ${MAKE} install 235.endif 236.if ${MK_BLUETOOTH} != "no" 237 ${_+_}cd ${.CURDIR}/bluetooth; ${MAKE} install 238.endif 239.if ${MK_CASPER} != "no" 240 ${_+_}cd ${.CURDIR}/casper; ${MAKE} install 241.endif 242 ${_+_}cd ${.CURDIR}/defaults; ${MAKE} install 243 ${_+_}cd ${.CURDIR}/devd; ${MAKE} install 244.if ${MK_DMAGENT} != "no" 245 ${_+_}cd ${.CURDIR}/dma; ${MAKE} install 246.endif 247 ${_+_}cd ${.CURDIR}/gss; ${MAKE} install 248 ${_+_}cd ${.CURDIR}/periodic; ${MAKE} install 249.if ${MK_PKGBOOTSTRAP} != "no" 250 ${_+_}cd ${.CURDIR}/pkg; ${MAKE} install 251.endif 252 ${_+_}cd ${.CURDIR}/rc.d; ${MAKE} install 253 ${_+_}cd ${.CURDIR}/../share/termcap; ${MAKE} etc-termcap 254 ${_+_}cd ${.CURDIR}/../usr.sbin/rmt; ${MAKE} etc-rmt 255 ${_+_}cd ${.CURDIR}/pam.d; ${MAKE} install 256 cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 0444 \ 257 ${BSM_ETC_OPEN_FILES} ${BSM_ETC_DIR} 258 cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 0600 \ 259 ${BSM_ETC_RESTRICTED_FILES} ${BSM_ETC_DIR} 260 cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 0500 \ 261 ${BSM_ETC_EXEC_FILES} ${BSM_ETC_DIR} 262.if ${MK_UNBOUND} != "no" 263 if [ ! -e ${DESTDIR}/etc/unbound ]; then \ 264 ${INSTALL_SYMLINK} ../var/unbound ${DESTDIR}/etc/unbound; \ 265 fi 266.endif 267.if ${MK_SENDMAIL} != "no" 268 ${_+_}cd ${.CURDIR}/sendmail; ${MAKE} distribution 269.endif 270.if ${MK_OPENSSH} != "no" 271 cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \ 272 ${SSH} ${DESTDIR}/etc/ssh 273.endif 274.if ${MK_OPENSSL} != "no" 275 cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \ 276 ${SSL} ${DESTDIR}/etc/ssl 277.endif 278.if ${MK_KERBEROS} != "no" 279 cd ${.CURDIR}/root; \ 280 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \ 281 dot.k5login ${DESTDIR}/root/.k5login; 282.endif 283 cd ${.CURDIR}/root; \ 284 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \ 285 dot.profile ${DESTDIR}/root/.profile; \ 286 rm -f ${DESTDIR}/.profile; \ 287 ln ${DESTDIR}/root/.profile ${DESTDIR}/.profile 288.if ${MK_TCSH} != "no" 289 cd ${.CURDIR}/root; \ 290 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \ 291 dot.cshrc ${DESTDIR}/root/.cshrc; \ 292 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \ 293 dot.login ${DESTDIR}/root/.login; \ 294 rm -f ${DESTDIR}/.cshrc; \ 295 ln ${DESTDIR}/root/.cshrc ${DESTDIR}/.cshrc 296.endif 297 cd ${.CURDIR}/mtree; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \ 298 ${MTREE} ${DESTDIR}/etc/mtree 299.if ${MK_PPP} != "no" 300 cd ${.CURDIR}/ppp; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 600 \ 301 ${PPPCNF} ${DESTDIR}/etc/ppp 302.endif 303.if ${MK_MAIL} != "no" 304 cd ${.CURDIR}/mail; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \ 305 ${ETCMAIL} ${DESTDIR}/etc/mail 306 if [ -d ${DESTDIR}/etc/mail -a -f ${DESTDIR}/etc/mail/aliases -a \ 307 ! -f ${DESTDIR}/etc/aliases ]; then \ 308 ln -s mail/aliases ${DESTDIR}/etc/aliases; \ 309 fi 310.endif 311 ${INSTALL} -o ${BINOWN} -g operator -m 664 /dev/null \ 312 ${DESTDIR}/etc/dumpdates 313.if ${MK_LOCATE} != "no" 314 ${INSTALL} -o nobody -g ${BINGRP} -m 644 /dev/null \ 315 ${DESTDIR}/var/db/locate.database 316.endif 317 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 ${.CURDIR}/minfree \ 318 ${DESTDIR}/var/crash 319 cd ${.CURDIR}/..; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \ 320 ${FREEBSD} ${DESTDIR}/ 321.if ${MK_BOOT} != "no" 322.if exists(${.CURDIR}/../sys/${MACHINE}/conf/GENERIC.hints) 323 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \ 324 ${.CURDIR}/../sys/${MACHINE}/conf/GENERIC.hints \ 325 ${DESTDIR}/boot/device.hints 326.endif 327.endif 328.if ${MK_NIS} == "no" 329 sed -i "" -e 's/.*_compat:/# &/' -e 's/compat$$/files/' \ 330 ${DESTDIR}/etc/nsswitch.conf 331.endif 332 333MTREE_CMD?= mtree 334 335.if ${MK_INSTALL_AS_USER} != "no" && ${_uid} != 0 336MTREE_FILTER= sed -e 's,\([gu]\)name=,\1id=,g' \ 337 -e 's,\(uid=\)[^ ]* ,\1${_uid} ,' \ 338 -e 's,\(gid=\)[^ ]* ,\1${_gid} ,' \ 339 -e 's,\(uid=\)[^ ]*$$,\1${_uid},' \ 340 -e 's,\(gid=\)[^ ]*$$,\1${_gid},' 341.else 342MTREE_FILTER= cat 343.endif 344 345MTREES= mtree/BSD.root.dist / \ 346 mtree/BSD.var.dist /var \ 347 mtree/BSD.usr.dist /usr \ 348 mtree/BSD.include.dist /usr/include \ 349 mtree/BSD.debug.dist /usr/lib 350.if ${MK_GROFF} != "no" 351MTREES+= mtree/BSD.groff.dist /usr 352.endif 353.if ${MK_TESTS} != "no" 354MTREES+= mtree/BSD.tests.dist ${TESTSBASE} 355.endif 356.if ${MK_SENDMAIL} != "no" 357MTREES+= mtree/BSD.sendmail.dist / 358.endif 359.for mtree in ${LOCAL_MTREE} 360MTREES+= ../${mtree} / 361.endfor 362 363distrib-dirs: ${MTREES:N/*} 364 @set ${MTREES}; \ 365 while test $$# -ge 2; do \ 366 m=${.CURDIR}/$$1; \ 367 shift; \ 368 d=${DESTDIR}$$1; \ 369 shift; \ 370 test -d $$d || mkdir -p $$d; \ 371 ${ECHO} ${MTREE_CMD} -deU ${MTREE_FOLLOWS_SYMLINKS} \ 372 -f $$m -p $$d; \ 373 ${MTREE_FILTER} $$m | \ 374 ${MTREE_CMD} -deU ${MTREE_FOLLOWS_SYMLINKS} -p $$d; \ 375 done; true 376.if defined(NO_ROOT) 377 @set ${MTREES}; \ 378 while test $$# -ge 2; do \ 379 m=${.CURDIR}/$$1; \ 380 shift; \ 381 d=$$1; \ 382 test "$$d" == "/" && d=""; \ 383 d=${DISTBASE}$$d; \ 384 shift; \ 385 test -d ${DESTDIR}/$$d || mkdir -p ${DESTDIR}/$$d; \ 386 ${ECHO} "${MTREE_CMD:N-W} -C -f $$m -K uname,gname | " \ 387 "sed s#^\.#.$$d# | ${METALOG.add}" ; \ 388 ${MTREE_FILTER} $$m | \ 389 ${MTREE_CMD:N-W} -C -K uname,gname | sed s#^\.#.$$d# | \ 390 ${METALOG.add} ; \ 391 done; true 392.endif 393 ${INSTALL_SYMLINK} usr/src/sys ${DESTDIR}/sys 394.if ${MK_MAN} != "no" 395 cd ${DESTDIR}/usr/share/man; \ 396 for mandir in man*; do \ 397 ${INSTALL_SYMLINK} ../$$mandir \ 398 ${DESTDIR}/usr/share/man/en.ISO8859-1/; \ 399 ${INSTALL_SYMLINK} ../$$mandir \ 400 ${DESTDIR}/usr/share/man/en.UTF-8/; \ 401 done 402.if ${MK_OPENSSL} != "no" 403 cd ${DESTDIR}/usr/share/openssl/man; \ 404 for mandir in man*; do \ 405 ${INSTALL_SYMLINK} ../$$mandir \ 406 ${DESTDIR}/usr/share/openssl/man/en.ISO8859-1/; \ 407 done 408.endif 409 set - `grep "^[a-zA-Z]" ${.CURDIR}/man.alias`; \ 410 while [ $$# -gt 0 ] ; do \ 411 ${INSTALL_SYMLINK} "$$2" "${DESTDIR}/usr/share/man/$$1"; \ 412 if [ "${MK_OPENSSL}" != "no" ]; then \ 413 ${INSTALL_SYMLINK} "$$2" \ 414 "${DESTDIR}/usr/share/openssl/man/$$1"; \ 415 fi; \ 416 shift; shift; \ 417 done 418.endif 419.if ${MK_NLS} != "no" 420 set - `grep "^[a-zA-Z]" ${.CURDIR}/nls.alias`; \ 421 while [ $$# -gt 0 ] ; do \ 422 ${INSTALL_SYMLINK} "$$2" "${DESTDIR}/usr/share/nls/$$1"; \ 423 shift; shift; \ 424 done 425.endif 426 427etc-examples: 428 cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \ 429 ${BIN1} ${BIN2} nsmb.conf opieaccess \ 430 ${DESTDIR}/usr/share/examples/etc 431 ${_+_}cd ${.CURDIR}/defaults; ${MAKE} install \ 432 DESTDIR=${DESTDIR}/usr/share/examples 433 434.include <bsd.prog.mk> 435