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_TESTS} != "no"
155 MTREE+= BSD.tests.dist
157 .if ${MK_SENDMAIL} != "no"
158 MTREE+= BSD.sendmail.dist
163 .if ${MK_SENDMAIL} == "no"
164 ETCMAIL=mailer.conf aliases
166 ETCMAIL=Makefile README mailer.conf access.sample virtusertable.sample \
167 mailertable.sample aliases
170 # Special top level files for FreeBSD
174 DESTDIR:= ${DESTDIR:C://*:/:g}
177 .if ${MK_MAN} != "no"
178 ${_+_}cd ${.CURDIR}/../share/man; ${MAKE} makedb
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}
188 .include <bsd.endian.mk>
189 .if ${TARGET_ENDIANNESS} == "1234"
191 .elif ${TARGET_ENDIANNESS} == "4321"
198 METALOG.add?= cat -l >> ${METALOG}
202 .if !defined(DESTDIR)
203 @echo "set DESTDIR before running \"make ${.TARGET}\""
207 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
208 ${BIN1} ${DESTDIR}/etc; \
209 cap_mkdb ${CAP_MKDB_ENDIAN} ${DESTDIR}/etc/login.conf; \
210 services_mkdb ${CAP_MKDB_ENDIAN} -q -o ${DESTDIR}/var/db/services.db \
211 ${DESTDIR}/etc/services; \
212 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 755 \
213 ${BIN2} ${DESTDIR}/etc; \
214 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 600 \
215 master.passwd nsmb.conf opieaccess ${DESTDIR}/etc;
217 sed -i "" -e 's;.*/usr/libexec/atrun;#&;' ${DESTDIR}/etc/crontab
219 .if ${MK_TCSH} == "no"
220 sed -i "" -e 's;/bin/csh;/bin/sh;' ${DESTDIR}/etc/master.passwd
222 pwd_mkdb -i -p -d ${DESTDIR}/etc ${DESTDIR}/etc/master.passwd
225 echo "./etc/login.conf.db type=file mode=0644 uname=root gname=wheel"; \
226 echo "./etc/passwd type=file mode=0644 uname=root gname=wheel"; \
227 echo "./etc/pwd.db type=file mode=0644 uname=root gname=wheel"; \
228 echo "./etc/spwd.db type=file mode=0600 uname=root gname=wheel"; \
231 .if ${MK_AUTOFS} != "no"
232 ${_+_}cd ${.CURDIR}/autofs; ${MAKE} install
234 .if ${MK_BLUETOOTH} != "no"
235 ${_+_}cd ${.CURDIR}/bluetooth; ${MAKE} install
237 .if ${MK_CASPER} != "no"
238 ${_+_}cd ${.CURDIR}/casper; ${MAKE} install
240 ${_+_}cd ${.CURDIR}/defaults; ${MAKE} install
241 ${_+_}cd ${.CURDIR}/devd; ${MAKE} install
242 .if ${MK_DMAGENT} != "no"
243 ${_+_}cd ${.CURDIR}/dma; ${MAKE} install
245 ${_+_}cd ${.CURDIR}/gss; ${MAKE} install
246 ${_+_}cd ${.CURDIR}/periodic; ${MAKE} install
247 .if ${MK_PKGBOOTSTRAP} != "no"
248 ${_+_}cd ${.CURDIR}/pkg; ${MAKE} install
250 ${_+_}cd ${.CURDIR}/rc.d; ${MAKE} install
251 ${_+_}cd ${.CURDIR}/../share/termcap; ${MAKE} etc-termcap
252 ${_+_}cd ${.CURDIR}/../usr.sbin/rmt; ${MAKE} etc-rmt
253 ${_+_}cd ${.CURDIR}/pam.d; ${MAKE} install
254 cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 0444 \
255 ${BSM_ETC_OPEN_FILES} ${BSM_ETC_DIR}
256 cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 0600 \
257 ${BSM_ETC_RESTRICTED_FILES} ${BSM_ETC_DIR}
258 cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 0500 \
259 ${BSM_ETC_EXEC_FILES} ${BSM_ETC_DIR}
260 .if ${MK_UNBOUND} != "no"
261 if [ ! -e ${DESTDIR}/etc/unbound ]; then \
262 ${INSTALL_SYMLINK} ../var/unbound ${DESTDIR}/etc/unbound; \
265 .if ${MK_SENDMAIL} != "no"
266 ${_+_}cd ${.CURDIR}/sendmail; ${MAKE} distribution
268 .if ${MK_OPENSSH} != "no"
269 cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
270 ${SSH} ${DESTDIR}/etc/ssh
272 .if ${MK_OPENSSL} != "no"
273 cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
274 ${SSL} ${DESTDIR}/etc/ssl
276 .if ${MK_KERBEROS} != "no"
277 cd ${.CURDIR}/root; \
278 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
279 dot.k5login ${DESTDIR}/root/.k5login;
281 cd ${.CURDIR}/root; \
282 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
283 dot.profile ${DESTDIR}/root/.profile; \
284 rm -f ${DESTDIR}/.profile; \
285 ln ${DESTDIR}/root/.profile ${DESTDIR}/.profile
286 .if ${MK_TCSH} != "no"
287 cd ${.CURDIR}/root; \
288 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
289 dot.cshrc ${DESTDIR}/root/.cshrc; \
290 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
291 dot.login ${DESTDIR}/root/.login; \
292 rm -f ${DESTDIR}/.cshrc; \
293 ln ${DESTDIR}/root/.cshrc ${DESTDIR}/.cshrc
295 cd ${.CURDIR}/mtree; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
296 ${MTREE} ${DESTDIR}/etc/mtree
297 .if ${MK_PPP} != "no"
298 cd ${.CURDIR}/ppp; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 600 \
299 ${PPPCNF} ${DESTDIR}/etc/ppp
301 .if ${MK_MAIL} != "no"
302 cd ${.CURDIR}/mail; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
303 ${ETCMAIL} ${DESTDIR}/etc/mail
304 if [ -d ${DESTDIR}/etc/mail -a -f ${DESTDIR}/etc/mail/aliases -a \
305 ! -f ${DESTDIR}/etc/aliases ]; then \
306 ln -s mail/aliases ${DESTDIR}/etc/aliases; \
309 ${INSTALL} -o ${BINOWN} -g operator -m 664 /dev/null \
310 ${DESTDIR}/etc/dumpdates
311 .if ${MK_LOCATE} != "no"
312 ${INSTALL} -o nobody -g ${BINGRP} -m 644 /dev/null \
313 ${DESTDIR}/var/db/locate.database
315 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 ${.CURDIR}/minfree \
317 cd ${.CURDIR}/..; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
318 ${FREEBSD} ${DESTDIR}/
319 .if ${MK_BOOT} != "no"
320 .if exists(${.CURDIR}/../sys/${MACHINE}/conf/GENERIC.hints)
321 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
322 ${.CURDIR}/../sys/${MACHINE}/conf/GENERIC.hints \
323 ${DESTDIR}/boot/device.hints
326 .if ${MK_NIS} == "no"
327 sed -i "" -e 's/.*_compat:/# &/' -e 's/compat$$/files/' \
328 ${DESTDIR}/etc/nsswitch.conf
333 .if ${MK_INSTALL_AS_USER} == "yes" && ${_uid} != 0
334 MTREE_FILTER= sed -e 's,\([gu]\)name=,\1id=,g' \
335 -e 's,\(uid=\)[^ ]* ,\1${_uid} ,' \
336 -e 's,\(gid=\)[^ ]* ,\1${_gid} ,' \
337 -e 's,\(uid=\)[^ ]*$$,\1${_uid},' \
338 -e 's,\(gid=\)[^ ]*$$,\1${_gid},'
343 MTREES= mtree/BSD.root.dist / \
344 mtree/BSD.var.dist /var \
345 mtree/BSD.usr.dist /usr \
346 mtree/BSD.include.dist /usr/include \
347 mtree/BSD.debug.dist /usr/lib
348 .if ${MK_GROFF} != "no"
349 MTREES+= mtree/BSD.groff.dist /usr
351 .if ${MK_TESTS} != "no"
352 MTREES+= mtree/BSD.tests.dist ${TESTSBASE}
354 .if ${MK_SENDMAIL} != "no"
355 MTREES+= mtree/BSD.sendmail.dist /
357 .for mtree in ${LOCAL_MTREE}
358 MTREES+= ../${mtree} /
361 distrib-dirs: ${MTREES:N/*}
363 while test $$# -ge 2; do \
368 test -d $$d || mkdir -p $$d; \
369 ${ECHO} ${MTREE_CMD} -deU ${MTREE_FOLLOWS_SYMLINKS} \
371 ${MTREE_FILTER} $$m | \
372 ${MTREE_CMD} -deU ${MTREE_FOLLOWS_SYMLINKS} -p $$d; \
376 while test $$# -ge 2; do \
380 test "$$d" == "/" && d=""; \
383 test -d ${DESTDIR}/$$d || mkdir -p ${DESTDIR}/$$d; \
384 ${ECHO} "${MTREE_CMD:N-W} -C -f $$m -K uname,gname | " \
385 "sed s#^\.#.$$d# | ${METALOG.add}" ; \
386 ${MTREE_FILTER} $$m | \
387 ${MTREE_CMD:N-W} -C -K uname,gname | sed s#^\.#.$$d# | \
391 ${INSTALL_SYMLINK} usr/src/sys ${DESTDIR}/sys
392 .if ${MK_MAN} != "no"
393 cd ${DESTDIR}/usr/share/man; \
394 for mandir in man*; do \
395 ${INSTALL_SYMLINK} ../$$mandir \
396 ${DESTDIR}/usr/share/man/en.ISO8859-1/; \
397 ${INSTALL_SYMLINK} ../$$mandir \
398 ${DESTDIR}/usr/share/man/en.UTF-8/; \
400 .if ${MK_OPENSSL} != "no"
401 cd ${DESTDIR}/usr/share/openssl/man; \
402 for mandir in man*; do \
403 ${INSTALL_SYMLINK} ../$$mandir \
404 ${DESTDIR}/usr/share/openssl/man/en.ISO8859-1/; \
407 set - `grep "^[a-zA-Z]" ${.CURDIR}/man.alias`; \
408 while [ $$# -gt 0 ] ; do \
409 ${INSTALL_SYMLINK} "$$2" "${DESTDIR}/usr/share/man/$$1"; \
410 if [ "${MK_OPENSSL}" != "no" ]; then \
411 ${INSTALL_SYMLINK} "$$2" \
412 "${DESTDIR}/usr/share/openssl/man/$$1"; \
417 .if ${MK_NLS} != "no"
418 set - `grep "^[a-zA-Z]" ${.CURDIR}/nls.alias`; \
419 while [ $$# -gt 0 ] ; do \
420 ${INSTALL_SYMLINK} "$$2" "${DESTDIR}/usr/share/nls/$$1"; \
426 cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
427 ${BIN1} ${BIN2} nsmb.conf opieaccess \
428 ${DESTDIR}/usr/share/examples/etc
429 ${_+_}cd ${.CURDIR}/defaults; ${MAKE} install \
430 DESTDIR=${DESTDIR}/usr/share/examples
432 .include <bsd.prog.mk>