1 # from: @(#)Makefile 5.11 (Berkeley) 5/21/91
9 .if ${MK_SENDMAIL} != "no"
53 .if exists(${.CURDIR}/etc.${MACHINE}/ttys)
54 BIN1+= etc.${MACHINE}/ttys
55 .elif exists(${.CURDIR}/etc.${MACHINE_ARCH}/ttys)
56 BIN1+= etc.${MACHINE_ARCH}/ttys
57 .elif exists(${.CURDIR}/etc.${MACHINE_CPUARCH}/ttys)
58 BIN1+= etc.${MACHINE_CPUARCH}/ttys
60 .error etc.MACHINE/ttys missing
63 OPENBSMDIR= ${.CURDIR}/../contrib/openbsm
64 BSM_ETC_OPEN_FILES= ${OPENBSMDIR}/etc/audit_class \
65 ${OPENBSMDIR}/etc/audit_event
66 BSM_ETC_RESTRICTED_FILES= ${OPENBSMDIR}/etc/audit_control \
67 ${OPENBSMDIR}/etc/audit_user
68 BSM_ETC_EXEC_FILES= ${OPENBSMDIR}/etc/audit_warn
69 BSM_ETC_DIR= ${DESTDIR}/etc/security
71 # NB: keep these sorted by MK_* knobs
81 .if ${MK_AUTOFS} != "no"
85 .if ${MK_BSNMP} != "no"
89 .if ${MK_FREEBSD_UPDATE} != "no"
90 BIN1+= freebsd-update.conf
97 .if ${MK_INETD} != "no"
101 .if ${MK_LOCATE} != "no"
102 BIN1+= ${.CURDIR}/../usr.bin/locate/locate/locate.rc
105 .if ${MK_LPR} != "no"
106 BIN1+= hosts.lpd printcap
109 .if ${MK_MAIL} != "no"
110 BIN1+= ${.CURDIR}/../usr.bin/mail/misc/mail.rc
113 .if ${MK_NTP} != "no"
117 .if ${MK_OPENSSH} != "no"
118 SSH= ${.CURDIR}/../crypto/openssh/ssh_config \
119 ${.CURDIR}/../crypto/openssh/sshd_config \
120 ${.CURDIR}/../crypto/openssh/moduli
122 .if ${MK_OPENSSL} != "no"
123 SSL= ${.CURDIR}/../crypto/openssl/apps/openssl.cnf
126 .if ${MK_NS_CACHING} != "no"
130 .if ${MK_PORTSNAP} != "no"
138 .if ${MK_SENDMAIL} != "no"
142 .if ${MK_TCSH} != "no"
143 BIN1+= csh.cshrc csh.login csh.logout
146 .if ${MK_WIRELESS} != "no"
150 # -rwxr-xr-x root:wheel, for the new cron root:wheel
151 BIN2= netstart pccard_ether rc.suspend rc.resume
153 MTREE= BSD.debug.dist BSD.include.dist BSD.root.dist BSD.usr.dist BSD.var.dist
154 .if ${MK_LIB32} != "no"
155 MTREE+= BSD.lib32.dist
157 .if ${MK_LIBSOFT} != "no"
158 MTREE+= BSD.libsoft.dist
160 .if ${MK_TESTS} != "no"
161 MTREE+= BSD.tests.dist
163 .if ${MK_SENDMAIL} != "no"
164 MTREE+= BSD.sendmail.dist
169 .if ${MK_SENDMAIL} == "no"
170 ETCMAIL=mailer.conf aliases
172 ETCMAIL=Makefile README mailer.conf access.sample virtusertable.sample \
173 mailertable.sample aliases
176 # Special top level files for FreeBSD
180 DESTDIR:= ${DESTDIR:C://*:/:g}
183 .if ${MK_MAN} != "no"
184 ${_+_}cd ${.CURDIR}/../share/man; ${MAKE} makedb
188 # Avoid installing tests here; "make distribution" will do this and
189 # correctly place them in the right location.
190 ${_+_}cd ${.CURDIR} ; ${MAKE} MK_TESTS=no install \
191 DESTDIR=${DISTDIR}/${DISTRIBUTION}
192 ${_+_}cd ${.CURDIR} ; ${MAKE} distribution DESTDIR=${DISTDIR}/${DISTRIBUTION}
194 .include <bsd.endian.mk>
195 .if ${TARGET_ENDIANNESS} == "1234"
197 .elif ${TARGET_ENDIANNESS} == "4321"
204 METALOG.add?= cat -l >> ${METALOG}
208 .if !defined(DESTDIR)
209 @echo "set DESTDIR before running \"make ${.TARGET}\""
213 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
214 ${BIN1} ${DESTDIR}/etc; \
215 cap_mkdb ${CAP_MKDB_ENDIAN} ${DESTDIR}/etc/login.conf; \
216 services_mkdb ${CAP_MKDB_ENDIAN} -q -o ${DESTDIR}/var/db/services.db \
217 ${DESTDIR}/etc/services; \
218 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 755 \
219 ${BIN2} ${DESTDIR}/etc; \
220 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 600 \
221 master.passwd nsmb.conf opieaccess ${DESTDIR}/etc;
223 sed -i "" -e 's;.*/usr/libexec/atrun;#&;' ${DESTDIR}/etc/crontab
225 .if ${MK_TCSH} == "no"
226 sed -i "" -e 's;/bin/csh;/bin/sh;' ${DESTDIR}/etc/master.passwd
228 pwd_mkdb -i -p -d ${DESTDIR}/etc ${DESTDIR}/etc/master.passwd
231 echo "./etc/login.conf.db type=file mode=0644 uname=root gname=wheel"; \
232 echo "./etc/passwd type=file mode=0644 uname=root gname=wheel"; \
233 echo "./etc/pwd.db type=file mode=0644 uname=root gname=wheel"; \
234 echo "./etc/spwd.db type=file mode=0600 uname=root gname=wheel"; \
237 .if ${MK_AUTOFS} != "no"
238 ${_+_}cd ${.CURDIR}/autofs; ${MAKE} install
240 .if ${MK_BLUETOOTH} != "no"
241 ${_+_}cd ${.CURDIR}/bluetooth; ${MAKE} install
243 .if ${MK_CASPER} != "no"
244 ${_+_}cd ${.CURDIR}/casper; ${MAKE} install
246 ${_+_}cd ${.CURDIR}/defaults; ${MAKE} install
247 ${_+_}cd ${.CURDIR}/devd; ${MAKE} install
248 ${_+_}cd ${.CURDIR}/gss; ${MAKE} install
249 .if ${MK_NTP} != "no"
250 ${_+_}cd ${.CURDIR}/ntp; ${MAKE} install
252 ${_+_}cd ${.CURDIR}/periodic; ${MAKE} install
253 .if ${MK_PKGBOOTSTRAP} != "no"
254 ${_+_}cd ${.CURDIR}/pkg; ${MAKE} install
256 ${_+_}cd ${.CURDIR}/rc.d; ${MAKE} install
257 ${_+_}cd ${.CURDIR}/../share/termcap; ${MAKE} etc-termcap
258 ${_+_}cd ${.CURDIR}/../usr.sbin/rmt; ${MAKE} etc-rmt
259 ${_+_}cd ${.CURDIR}/pam.d; ${MAKE} install
260 cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 0444 \
261 ${BSM_ETC_OPEN_FILES} ${BSM_ETC_DIR}
262 cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 0600 \
263 ${BSM_ETC_RESTRICTED_FILES} ${BSM_ETC_DIR}
264 cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 0500 \
265 ${BSM_ETC_EXEC_FILES} ${BSM_ETC_DIR}
266 .if ${MK_UNBOUND} != "no"
267 if [ ! -e ${DESTDIR}/etc/unbound ]; then \
268 ${INSTALL_SYMLINK} ../var/unbound ${DESTDIR}/etc/unbound; \
271 .if ${MK_SENDMAIL} != "no"
272 ${_+_}cd ${.CURDIR}/sendmail; ${MAKE} distribution
274 .if ${MK_OPENSSH} != "no"
275 cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
276 ${SSH} ${DESTDIR}/etc/ssh
278 .if ${MK_OPENSSL} != "no"
279 cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
280 ${SSL} ${DESTDIR}/etc/ssl
282 .if ${MK_KERBEROS} != "no"
283 cd ${.CURDIR}/root; \
284 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
285 dot.k5login ${DESTDIR}/root/.k5login;
287 cd ${.CURDIR}/root; \
288 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
289 dot.profile ${DESTDIR}/root/.profile; \
290 rm -f ${DESTDIR}/.profile; \
291 ln ${DESTDIR}/root/.profile ${DESTDIR}/.profile
292 .if ${MK_TCSH} != "no"
293 cd ${.CURDIR}/root; \
294 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
295 dot.cshrc ${DESTDIR}/root/.cshrc; \
296 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
297 dot.login ${DESTDIR}/root/.login; \
298 rm -f ${DESTDIR}/.cshrc; \
299 ln ${DESTDIR}/root/.cshrc ${DESTDIR}/.cshrc
301 cd ${.CURDIR}/mtree; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
302 ${MTREE} ${DESTDIR}/etc/mtree
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; \
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
317 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 ${.CURDIR}/minfree \
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
328 .if ${MK_NIS} == "no"
329 sed -i "" -e 's/.*_compat:/# &/' -e 's/compat$$/files/' \
330 ${DESTDIR}/etc/nsswitch.conf
335 .if ${MK_INSTALL_AS_USER} == "yes" && ${_uid} != 0
336 MTREE_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},'
343 .if !defined(NO_FSCHG)
348 MTREES= mtree/BSD.root.dist / \
349 mtree/BSD.var.dist /var \
350 mtree/BSD.usr.dist /usr \
351 mtree/BSD.include.dist /usr/include \
352 mtree/BSD.debug.dist /usr/lib
353 .if ${MK_GROFF} != "no"
354 MTREES+= mtree/BSD.groff.dist /usr
356 .if ${MK_LIB32} != "no"
357 MTREES+= mtree/BSD.lib32.dist /usr
358 MTREES+= mtree/BSD.lib32.dist /usr/lib/debug/usr
360 .if ${MK_LIBSOFT} != "no"
361 MTREES+= mtree/BSD.libsoft.dist /usr
362 MTREES+= mtree/BSD.libsoft.dist /usr/lib/debug/usr
364 .if ${MK_TESTS} != "no"
365 MTREES+= mtree/BSD.tests.dist ${TESTSBASE}
366 MTREES+= mtree/BSD.tests.dist /usr/lib/debug/${TESTSBASE}
368 .if ${MK_SENDMAIL} != "no"
369 MTREES+= mtree/BSD.sendmail.dist /
371 .for mtree in ${LOCAL_MTREE}
372 MTREES+= ../${mtree} /
375 # Clean up some directories that where mistakenly created as files that
376 # should not have been as part of the nvi update in r281994.
377 # This should be removed after 11.0-RELEASE.
378 DISTRIB_CLEANUP_SHARE_FILES= ${SHAREDIR}/doc/usd/10.exref ${SHAREDIR}/doc/usd/11.edit
379 DISTRIB_CLEANUP_SHARE_FILES+= ${SHAREDIR}/doc/usd/12.vi ${SHAREDIR}/doc/usd/13.viref
380 distrib-cleanup: .PHONY
381 for file in ${DISTRIB_CLEANUP_SHARE_FILES}; do \
382 if [ -f ${DESTDIR}/$${file} ]; then \
383 rm -f ${DESTDIR}/$${file}; \
387 distrib-dirs: ${MTREES:N/*} distrib-cleanup .PHONY
389 while test $$# -ge 2; do \
394 test -d $$d || mkdir -p $$d; \
395 ${ECHO} ${MTREE_CMD} -deU ${MTREE_FSCHG} \
396 ${MTREE_FOLLOWS_SYMLINKS} -f $$m -p $$d; \
397 ${MTREE_FILTER} $$m | \
398 ${MTREE_CMD} -deU ${MTREE_FSCHG} ${MTREE_FOLLOWS_SYMLINKS} \
403 while test $$# -ge 2; do \
407 test "$$d" == "/" && d=""; \
410 test -d ${DESTDIR}/$$d || mkdir -p ${DESTDIR}/$$d; \
411 ${ECHO} "${MTREE_CMD:N-W} -C -f $$m -K uname,gname | " \
412 "sed s#^\.#.$$d# | ${METALOG.add}" ; \
413 ${MTREE_FILTER} $$m | \
414 ${MTREE_CMD:N-W} -C -K uname,gname | sed s#^\.#.$$d# | \
418 ${INSTALL_SYMLINK} usr/src/sys ${DESTDIR}/sys
419 .if ${MK_MAN} != "no"
420 cd ${DESTDIR}${SHAREDIR}/man; \
421 for mandir in man*; do \
422 ${INSTALL_SYMLINK} ../$$mandir \
423 ${DESTDIR}${SHAREDIR}/man/en.ISO8859-1/; \
424 ${INSTALL_SYMLINK} ../$$mandir \
425 ${DESTDIR}${SHAREDIR}/man/en.UTF-8/; \
427 .if ${MK_OPENSSL} != "no"
428 cd ${DESTDIR}${SHAREDIR}/openssl/man; \
429 for mandir in man*; do \
430 ${INSTALL_SYMLINK} ../$$mandir \
431 ${DESTDIR}${SHAREDIR}/openssl/man/en.ISO8859-1/; \
434 set - `grep "^[a-zA-Z]" ${.CURDIR}/man.alias`; \
435 while [ $$# -gt 0 ] ; do \
436 ${INSTALL_SYMLINK} "$$2" "${DESTDIR}${SHAREDIR}/man/$$1"; \
437 if [ "${MK_OPENSSL}" != "no" ]; then \
438 ${INSTALL_SYMLINK} "$$2" \
439 "${DESTDIR}${SHAREDIR}/openssl/man/$$1"; \
444 .if ${MK_NLS} != "no"
445 set - `grep "^[a-zA-Z]" ${.CURDIR}/nls.alias`; \
446 while [ $$# -gt 0 ] ; do \
447 ${INSTALL_SYMLINK} "$$2" "${DESTDIR}${SHAREDIR}/nls/$$1"; \
453 cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
454 ${BIN1} ${BIN2} nsmb.conf opieaccess \
455 ${DESTDIR}${SHAREDIR}/examples/etc
456 ${_+_}cd ${.CURDIR}/defaults; ${MAKE} install \
457 DESTDIR=${DESTDIR}${SHAREDIR}/examples
459 .include <bsd.prog.mk>