1 # from: @(#)Makefile 5.11 (Berkeley) 5/21/91
6 .if ${MK_SENDMAIL} != "no"
10 .if ${MK_TESTS} != "no"
52 .if exists(${.CURDIR}/etc.${MACHINE}/ttys)
53 BIN1+= etc.${MACHINE}/ttys
54 .elif exists(${.CURDIR}/etc.${MACHINE_ARCH}/ttys)
55 BIN1+= etc.${MACHINE_ARCH}/ttys
56 .elif exists(${.CURDIR}/etc.${MACHINE_CPUARCH}/ttys)
57 BIN1+= etc.${MACHINE_CPUARCH}/ttys
59 .error etc.MACHINE/ttys missing
62 OPENBSMDIR= ${.CURDIR}/../contrib/openbsm
63 BSM_ETC_OPEN_FILES= ${OPENBSMDIR}/etc/audit_class \
64 ${OPENBSMDIR}/etc/audit_event
65 BSM_ETC_RESTRICTED_FILES= ${OPENBSMDIR}/etc/audit_control \
66 ${OPENBSMDIR}/etc/audit_user
67 BSM_ETC_EXEC_FILES= ${OPENBSMDIR}/etc/audit_warn
68 BSM_ETC_DIR= ${DESTDIR}/etc/security
70 # NB: keep these sorted by MK_* knobs
80 .if ${MK_AUTOFS} != "no"
84 .if ${MK_BSNMP} != "no"
88 .if ${MK_FREEBSD_UPDATE} != "no"
89 BIN1+= freebsd-update.conf
96 .if ${MK_INETD} != "no"
100 .if ${MK_IPFW} != "no"
104 .if ${MK_LOCATE} != "no"
105 BIN1+= ${.CURDIR}/../usr.bin/locate/locate/locate.rc
108 .if ${MK_LIB32} != "no"
112 .if ${MK_LPR} != "no"
113 BIN1+= hosts.lpd printcap
116 .if ${MK_MAC_SUPPORT} != "no"
117 BIN1+= rc.bsdextended
120 .if ${MK_MAIL} != "no"
121 BIN1+= ${.CURDIR}/../usr.bin/mail/misc/mail.rc
124 .if ${MK_NTP} != "no"
128 .if ${MK_OPENSSH} != "no"
129 SSH= ${.CURDIR}/../crypto/openssh/ssh_config \
130 ${.CURDIR}/../crypto/openssh/sshd_config \
131 ${.CURDIR}/../crypto/openssh/moduli
133 .if ${MK_OPENSSL} != "no"
134 SSL= ${.CURDIR}/../crypto/openssl/apps/openssl.cnf
137 .if ${MK_NS_CACHING} != "no"
141 .if ${MK_PORTSNAP} != "no"
149 .if ${MK_SENDMAIL} != "no"
153 .if ${MK_TCSH} != "no"
154 BIN1+= csh.cshrc csh.login csh.logout
157 .if ${MK_WIRELESS} != "no"
161 # -rwxr-xr-x root:wheel, for the new cron root:wheel
162 BIN2= netstart pccard_ether rc.suspend rc.resume
164 MTREE= BSD.include.dist BSD.root.dist BSD.usr.dist BSD.var.dist
165 .if ${MK_TESTS} != "no"
166 MTREE+= BSD.tests.dist
168 .if ${MK_SENDMAIL} != "no"
169 MTREE+= BSD.sendmail.dist
171 .if ${MK_DEBUG_FILES} != "no"
172 MTREE+= BSD.debug.dist
177 .if ${MK_SENDMAIL} == "no"
178 ETCMAIL=mailer.conf aliases
180 ETCMAIL=Makefile README mailer.conf access.sample virtusertable.sample \
181 mailertable.sample aliases
184 # Special top level files for FreeBSD
188 DESTDIR:= ${DESTDIR:C://*:/:g}
191 .if ${MK_MAN} != "no"
192 ${_+_}cd ${.CURDIR}/../share/man; ${MAKE} makedb
196 # Avoid installing tests here; "make distribution" will do this and
197 # correctly place them in the right location.
198 ${_+_}cd ${.CURDIR} ; ${MAKE} MK_TESTS=no install \
199 DESTDIR=${DISTDIR}/${DISTRIBUTION}
200 ${_+_}cd ${.CURDIR} ; ${MAKE} distribution DESTDIR=${DISTDIR}/${DISTRIBUTION}
202 .include <bsd.endian.mk>
203 .if ${TARGET_ENDIANNESS} == "1234"
206 .elif ${TARGET_ENDIANNESS} == "4321"
215 METALOG.add?= cat -l >> ${METALOG}
219 .if !defined(DESTDIR)
220 @echo "set DESTDIR before running \"make ${.TARGET}\""
224 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
225 ${BIN1} ${DESTDIR}/etc; \
226 cap_mkdb ${CAP_MKDB_ENDIAN} ${DESTDIR}/etc/login.conf; \
227 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 755 \
228 ${BIN2} ${DESTDIR}/etc; \
229 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 600 \
230 master.passwd nsmb.conf opieaccess ${DESTDIR}/etc;
232 sed -i "" -e 's;.*/usr/libexec/atrun;#&;' ${DESTDIR}/etc/crontab
234 .if ${MK_TCSH} == "no"
235 sed -i "" -e 's;/bin/csh;/bin/sh;' ${DESTDIR}/etc/master.passwd
237 pwd_mkdb ${PWD_MKDB_ENDIAN} -i -p -d ${DESTDIR}/etc \
238 ${DESTDIR}/etc/master.passwd
241 echo "./etc/login.conf.db type=file mode=0644 uname=root gname=wheel"; \
242 echo "./etc/passwd type=file mode=0644 uname=root gname=wheel"; \
243 echo "./etc/pwd.db type=file mode=0644 uname=root gname=wheel"; \
244 echo "./etc/spwd.db type=file mode=0600 uname=root gname=wheel"; \
247 .if ${MK_AUTOFS} != "no"
248 ${_+_}cd ${.CURDIR}/autofs; ${MAKE} install
250 .if ${MK_BLUETOOTH} != "no"
251 ${_+_}cd ${.CURDIR}/bluetooth; ${MAKE} install
253 .if ${MK_CASPER} != "no"
254 ${_+_}cd ${.CURDIR}/casper; ${MAKE} install
256 ${_+_}cd ${.CURDIR}/defaults; ${MAKE} install
257 ${_+_}cd ${.CURDIR}/devd; ${MAKE} install
258 .if ${MK_DMAGENT} != "no"
259 ${_+_}cd ${.CURDIR}/dma; ${MAKE} install
261 .if ${MK_GSSAPI} != "no"
262 ${_+_}cd ${.CURDIR}/gss; ${MAKE} install
264 ${_+_}cd ${.CURDIR}/periodic; ${MAKE} install
265 .if ${MK_PKGBOOTSTRAP} != "no"
266 ${_+_}cd ${.CURDIR}/pkg; ${MAKE} install
268 ${_+_}cd ${.CURDIR}/rc.d; ${MAKE} install
269 ${_+_}cd ${.CURDIR}/../share/termcap; ${MAKE} etc-termcap
270 ${_+_}cd ${.CURDIR}/../usr.sbin/rmt; ${MAKE} etc-rmt
271 ${_+_}cd ${.CURDIR}/pam.d; ${MAKE} install
272 .if ${MK_AUDIT} != "no"
273 cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 0444 \
274 ${BSM_ETC_OPEN_FILES} ${BSM_ETC_DIR}
275 cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 0600 \
276 ${BSM_ETC_RESTRICTED_FILES} ${BSM_ETC_DIR}
277 cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 0500 \
278 ${BSM_ETC_EXEC_FILES} ${BSM_ETC_DIR}
280 .if ${MK_UNBOUND} != "no"
281 if [ ! -e ${DESTDIR}/etc/unbound ]; then \
282 ${INSTALL_SYMLINK} ../var/unbound ${DESTDIR}/etc/unbound; \
285 .if ${MK_SENDMAIL} != "no"
286 ${_+_}cd ${.CURDIR}/sendmail; ${MAKE} distribution
288 .if ${MK_OPENSSH} != "no"
289 cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
290 ${SSH} ${DESTDIR}/etc/ssh
292 .if ${MK_OPENSSL} != "no"
293 cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
294 ${SSL} ${DESTDIR}/etc/ssl
296 .if ${MK_KERBEROS} != "no"
297 cd ${.CURDIR}/root; \
298 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
299 dot.k5login ${DESTDIR}/root/.k5login;
301 cd ${.CURDIR}/root; \
302 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
303 dot.profile ${DESTDIR}/root/.profile; \
304 rm -f ${DESTDIR}/.profile; \
305 ln ${DESTDIR}/root/.profile ${DESTDIR}/.profile
306 .if ${MK_TCSH} != "no"
307 cd ${.CURDIR}/root; \
308 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
309 dot.cshrc ${DESTDIR}/root/.cshrc; \
310 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
311 dot.login ${DESTDIR}/root/.login; \
312 rm -f ${DESTDIR}/.cshrc; \
313 ln ${DESTDIR}/root/.cshrc ${DESTDIR}/.cshrc
315 cd ${.CURDIR}/mtree; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
316 ${MTREE} ${DESTDIR}/etc/mtree
317 .if ${MK_PPP} != "no"
318 cd ${.CURDIR}/ppp; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 600 \
319 ${PPPCNF} ${DESTDIR}/etc/ppp
321 .if ${MK_MAIL} != "no"
322 cd ${.CURDIR}/mail; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
323 ${ETCMAIL} ${DESTDIR}/etc/mail
324 if [ -d ${DESTDIR}/etc/mail -a -f ${DESTDIR}/etc/mail/aliases -a \
325 ! -f ${DESTDIR}/etc/aliases ]; then \
326 ln -s mail/aliases ${DESTDIR}/etc/aliases; \
329 ${INSTALL} -o ${BINOWN} -g operator -m 664 /dev/null \
330 ${DESTDIR}/etc/dumpdates
331 .if ${MK_LOCATE} != "no"
332 ${INSTALL} -o nobody -g ${BINGRP} -m 644 /dev/null \
333 ${DESTDIR}/var/db/locate.database
335 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 ${.CURDIR}/minfree \
337 cd ${.CURDIR}/..; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
338 ${FREEBSD} ${DESTDIR}/
339 .if ${MK_BOOT} != "no"
340 .if exists(${.CURDIR}/../sys/${MACHINE}/conf/GENERIC.hints)
341 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
342 ${.CURDIR}/../sys/${MACHINE}/conf/GENERIC.hints \
343 ${DESTDIR}/boot/device.hints
346 .if ${MK_NIS} == "no"
347 sed -i "" -e 's/.*_compat:/# &/' -e 's/compat$$/files/' \
348 ${DESTDIR}/etc/nsswitch.conf
353 MTREES= mtree/BSD.root.dist / \
354 mtree/BSD.var.dist /var \
355 mtree/BSD.usr.dist /usr \
356 mtree/BSD.include.dist /usr/include
357 .if ${MK_DEBUG_FILES} != "no"
358 MTREES+= mtree/BSD.debug.dist /usr/lib
360 .if ${MK_GROFF} != "no"
361 MTREES+= mtree/BSD.groff.dist /usr
363 .if ${MK_TESTS} != "no"
364 MTREES+= mtree/BSD.tests.dist /usr
366 .if ${MK_SENDMAIL} != "no"
367 MTREES+= mtree/BSD.sendmail.dist /
369 .for mtree in ${LOCAL_MTREE}
370 MTREES+= ../${mtree} /
373 distrib-dirs: ${MTREES:N/*}
375 while test $$# -ge 2; do \
380 ${ECHO} ${MTREE_CMD} -deU ${MTREE_FOLLOWS_SYMLINKS} \
382 ${MTREE_CMD} -deU ${MTREE_FOLLOWS_SYMLINKS} -f $$m -p $$d; \
386 while test $$# -ge 2; do \
390 test "$$d" == "/" && d=""; \
393 ${ECHO} "${MTREE_CMD:N-W} -C -f $$m -K uname,gname | " \
394 "sed s#^\.#.$$d# | ${METALOG.add}" ; \
395 ${MTREE_CMD:N-W} -C -f $$m -K uname,gname | sed s#^\.#.$$d# | \
399 ${INSTALL_SYMLINK} usr/src/sys ${DESTDIR}/sys
400 .if ${MK_MAN} != "no"
401 cd ${DESTDIR}/usr/share/man; \
402 for mandir in man*; do \
403 ${INSTALL_SYMLINK} ../$$mandir \
404 ${DESTDIR}/usr/share/man/en.ISO8859-1/; \
405 ${INSTALL_SYMLINK} ../$$mandir \
406 ${DESTDIR}/usr/share/man/en.UTF-8/; \
408 .if ${MK_OPENSSL} != "no"
409 cd ${DESTDIR}/usr/share/openssl/man; \
410 for mandir in man*; do \
411 ${INSTALL_SYMLINK} ../$$mandir \
412 ${DESTDIR}/usr/share/openssl/man/en.ISO8859-1/; \
415 set - `grep "^[a-zA-Z]" ${.CURDIR}/man.alias`; \
416 while [ $$# -gt 0 ] ; do \
417 ${INSTALL_SYMLINK} "$$2" "${DESTDIR}/usr/share/man/$$1"; \
418 if [ "${MK_OPENSSL}" != "no" ]; then \
419 ${INSTALL_SYMLINK} "$$2" \
420 "${DESTDIR}/usr/share/openssl/man/$$1"; \
425 .if ${MK_NLS} != "no"
426 set - `grep "^[a-zA-Z]" ${.CURDIR}/nls.alias`; \
427 while [ $$# -gt 0 ] ; do \
428 ${INSTALL_SYMLINK} "$$2" "${DESTDIR}/usr/share/nls/$$1"; \
434 cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
435 ${BIN1} ${BIN2} nsmb.conf opieaccess \
436 ${DESTDIR}/usr/share/examples/etc
437 ${_+_}cd ${.CURDIR}/defaults; ${MAKE} install \
438 DESTDIR=${DESTDIR}/usr/share/examples
440 .include <bsd.prog.mk>