1 # from: @(#)Makefile 5.11 (Berkeley) 5/21/91
9 .if ${MK_SENDMAIL} != "no"
53 .if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "powerpc64"
57 .if exists(${.CURDIR}/etc.${MACHINE}/ttys)
58 BIN1+= etc.${MACHINE}/ttys
59 .elif exists(${.CURDIR}/etc.${MACHINE_ARCH}/ttys)
60 BIN1+= etc.${MACHINE_ARCH}/ttys
61 .elif exists(${.CURDIR}/etc.${MACHINE_CPUARCH}/ttys)
62 BIN1+= etc.${MACHINE_CPUARCH}/ttys
64 .error etc.MACHINE/ttys missing
67 OPENBSMDIR= ${.CURDIR}/../contrib/openbsm
68 BSM_ETC_OPEN_FILES= ${OPENBSMDIR}/etc/audit_class \
69 ${OPENBSMDIR}/etc/audit_event
70 BSM_ETC_RESTRICTED_FILES= ${OPENBSMDIR}/etc/audit_control \
71 ${OPENBSMDIR}/etc/audit_user
72 BSM_ETC_EXEC_FILES= ${OPENBSMDIR}/etc/audit_warn
73 BSM_ETC_DIR= ${DESTDIR}/etc/security
75 # NB: keep these sorted by MK_* knobs
85 .if ${MK_AUTOFS} != "no"
89 .if ${MK_BSNMP} != "no"
93 .if ${MK_FREEBSD_UPDATE} != "no"
94 BIN1+= freebsd-update.conf
101 .if ${MK_INETD} != "no"
105 .if ${MK_LOCATE} != "no"
106 BIN1+= ${.CURDIR}/../usr.bin/locate/locate/locate.rc
109 .if ${MK_LPR} != "no"
110 BIN1+= hosts.lpd printcap
113 .if ${MK_MAIL} != "no"
114 BIN1+= ${.CURDIR}/../usr.bin/mail/misc/mail.rc
117 .if ${MK_NTP} != "no"
121 .if ${MK_OPENSSH} != "no"
122 SSH= ${.CURDIR}/../crypto/openssh/ssh_config \
123 ${.CURDIR}/../crypto/openssh/sshd_config \
124 ${.CURDIR}/../crypto/openssh/moduli
126 .if ${MK_OPENSSL} != "no"
127 SSL= ${.CURDIR}/../crypto/openssl/apps/openssl.cnf
130 .if ${MK_NS_CACHING} != "no"
134 .if ${MK_PORTSNAP} != "no"
142 .if ${MK_SENDMAIL} != "no"
146 .if ${MK_TCSH} != "no"
147 BIN1+= csh.cshrc csh.login csh.logout
150 .if ${MK_WIRELESS} != "no"
154 # -rwxr-xr-x root:wheel, for the new cron root:wheel
155 BIN2= netstart pccard_ether rc.suspend rc.resume
157 MTREE= BSD.include.dist BSD.root.dist BSD.usr.dist BSD.var.dist
158 .if ${MK_TESTS} != "no"
159 MTREE+= BSD.tests.dist
161 .if ${MK_SENDMAIL} != "no"
162 MTREE+= BSD.sendmail.dist
164 .if ${MK_DEBUG_FILES} != "no"
165 MTREE+= BSD.debug.dist
170 .if ${MK_SENDMAIL} == "no"
171 ETCMAIL=mailer.conf aliases
173 ETCMAIL=Makefile README mailer.conf access.sample virtusertable.sample \
174 mailertable.sample aliases
177 # Special top level files for FreeBSD
181 DESTDIR:= ${DESTDIR:C://*:/:g}
184 .if ${MK_MAN} != "no"
185 ${_+_}cd ${.CURDIR}/../share/man; ${MAKE} makedb
189 # Avoid installing tests here; "make distribution" will do this and
190 # correctly place them in the right location.
191 ${_+_}cd ${.CURDIR} ; ${MAKE} -DNO_TESTS install \
192 DESTDIR=${DISTDIR}/${DISTRIBUTION}
193 ${_+_}cd ${.CURDIR} ; ${MAKE} distribution DESTDIR=${DISTDIR}/${DISTRIBUTION}
195 .include <bsd.endian.mk>
196 .if ${TARGET_ENDIANNESS} == "1234"
199 .elif ${TARGET_ENDIANNESS} == "4321"
208 METALOG.add?= cat -l >> ${METALOG}
212 .if !defined(DESTDIR)
213 @echo "set DESTDIR before running \"make ${.TARGET}\""
217 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
218 ${BIN1} ${DESTDIR}/etc; \
219 cap_mkdb ${CAP_MKDB_ENDIAN} ${DESTDIR}/etc/login.conf; \
220 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 755 \
221 ${BIN2} ${DESTDIR}/etc; \
222 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 600 \
223 master.passwd nsmb.conf opieaccess ${DESTDIR}/etc;
225 sed -i "" -e 's;.*/usr/libexec/atrun;#&;' ${DESTDIR}/etc/crontab
227 .if ${MK_TCSH} == "no"
228 sed -i "" -e 's;/bin/csh;/bin/sh;' ${DESTDIR}/etc/master.passwd
230 pwd_mkdb ${PWD_MKDB_ENDIAN} -i -p -d ${DESTDIR}/etc \
231 ${DESTDIR}/etc/master.passwd
234 echo "./etc/login.conf.db type=file mode=0644 uname=root gname=wheel"; \
235 echo "./etc/passwd type=file mode=0644 uname=root gname=wheel"; \
236 echo "./etc/pwd.db type=file mode=0644 uname=root gname=wheel"; \
237 echo "./etc/spwd.db type=file mode=0600 uname=root gname=wheel"; \
240 .if ${MK_AUTOFS} != "no"
241 ${_+_}cd ${.CURDIR}/autofs; ${MAKE} install
243 .if ${MK_BLUETOOTH} != "no"
244 ${_+_}cd ${.CURDIR}/bluetooth; ${MAKE} install
246 ${_+_}cd ${.CURDIR}/defaults; ${MAKE} install
247 ${_+_}cd ${.CURDIR}/devd; ${MAKE} install
248 ${_+_}cd ${.CURDIR}/gss; ${MAKE} install
249 ${_+_}cd ${.CURDIR}/periodic; ${MAKE} install
250 .if ${MK_PKGBOOTSTRAP} != "no"
251 ${_+_}cd ${.CURDIR}/pkg; ${MAKE} install
253 ${_+_}cd ${.CURDIR}/rc.d; ${MAKE} install
254 ${_+_}cd ${.CURDIR}/../share/termcap; ${MAKE} etc-termcap
255 ${_+_}cd ${.CURDIR}/../usr.sbin/rmt; ${MAKE} etc-rmt
256 ${_+_}cd ${.CURDIR}/pam.d; ${MAKE} install
257 cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 0444 \
258 ${BSM_ETC_OPEN_FILES} ${BSM_ETC_DIR}
259 cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 0600 \
260 ${BSM_ETC_RESTRICTED_FILES} ${BSM_ETC_DIR}
261 cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 0500 \
262 ${BSM_ETC_EXEC_FILES} ${BSM_ETC_DIR}
263 .if ${MK_UNBOUND} != "no"
264 if [ ! -e ${DESTDIR}/etc/unbound ]; then \
265 ${INSTALL_SYMLINK} ../var/unbound ${DESTDIR}/etc/unbound; \
268 .if ${MK_SENDMAIL} != "no"
269 ${_+_}cd ${.CURDIR}/sendmail; ${MAKE} distribution
271 .if ${MK_OPENSSH} != "no"
272 cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
273 ${SSH} ${DESTDIR}/etc/ssh
275 .if ${MK_OPENSSL} != "no"
276 cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
277 ${SSL} ${DESTDIR}/etc/ssl
279 .if ${MK_KERBEROS} != "no"
280 cd ${.CURDIR}/root; \
281 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
282 dot.k5login ${DESTDIR}/root/.k5login;
284 cd ${.CURDIR}/root; \
285 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
286 dot.profile ${DESTDIR}/root/.profile; \
287 rm -f ${DESTDIR}/.profile; \
288 ln ${DESTDIR}/root/.profile ${DESTDIR}/.profile
289 .if ${MK_TCSH} != "no"
290 cd ${.CURDIR}/root; \
291 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
292 dot.cshrc ${DESTDIR}/root/.cshrc; \
293 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
294 dot.login ${DESTDIR}/root/.login; \
295 rm -f ${DESTDIR}/.cshrc; \
296 ln ${DESTDIR}/root/.cshrc ${DESTDIR}/.cshrc
298 cd ${.CURDIR}/mtree; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
299 ${MTREE} ${DESTDIR}/etc/mtree
300 .if ${MK_PPP} != "no"
301 cd ${.CURDIR}/ppp; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 600 \
302 ${PPPCNF} ${DESTDIR}/etc/ppp
304 .if ${MK_MAIL} != "no"
305 cd ${.CURDIR}/mail; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
306 ${ETCMAIL} ${DESTDIR}/etc/mail
307 if [ -d ${DESTDIR}/etc/mail -a -f ${DESTDIR}/etc/mail/aliases -a \
308 ! -f ${DESTDIR}/etc/aliases ]; then \
309 ln -s mail/aliases ${DESTDIR}/etc/aliases; \
312 ${INSTALL} -o ${BINOWN} -g operator -m 664 /dev/null \
313 ${DESTDIR}/etc/dumpdates
314 .if ${MK_LOCATE} != "no"
315 ${INSTALL} -o nobody -g ${BINGRP} -m 644 /dev/null \
316 ${DESTDIR}/var/db/locate.database
318 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 ${.CURDIR}/minfree \
320 cd ${.CURDIR}/..; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
321 ${FREEBSD} ${DESTDIR}/
322 .if ${MK_BOOT} != "no"
323 .if exists(${.CURDIR}/../sys/${MACHINE}/conf/GENERIC.hints)
324 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
325 ${.CURDIR}/../sys/${MACHINE}/conf/GENERIC.hints \
326 ${DESTDIR}/boot/device.hints
329 .if ${MK_NIS} == "no"
330 sed -i "" -e 's/.*_compat:/# &/' -e 's/compat$$/files/' \
331 ${DESTDIR}/etc/nsswitch.conf
336 MTREES= mtree/BSD.root.dist / \
337 mtree/BSD.var.dist /var \
338 mtree/BSD.usr.dist /usr \
339 mtree/BSD.include.dist /usr/include
340 .if ${MK_DEBUG_FILES} != "no"
341 MTREES+= mtree/BSD.debug.dist /usr/lib
343 .if ${MK_GROFF} != "no"
344 MTREES+= mtree/BSD.groff.dist /usr
346 .if ${MK_TESTS} != "no"
347 MTREES+= mtree/BSD.tests.dist ${TESTSBASE}
349 .if ${MK_SENDMAIL} != "no"
350 MTREES+= mtree/BSD.sendmail.dist /
352 .for mtree in ${LOCAL_MTREE}
353 MTREES+= ../${mtree} /
356 distrib-dirs: ${MTREES:N/*}
358 while test $$# -ge 2; do \
363 test -d $$d || mkdir -p $$d; \
364 ${ECHO} ${MTREE_CMD} -deU ${MTREE_FOLLOWS_SYMLINKS} \
366 ${MTREE_CMD} -deU ${MTREE_FOLLOWS_SYMLINKS} -f $$m -p $$d; \
370 while test $$# -ge 2; do \
374 test "$$d" == "/" && d=""; \
377 test -d $$d || mkdir -p $$d; \
378 ${ECHO} "${MTREE_CMD:N-W} -C -f $$m -K uname,gname | " \
379 "sed s#^\.#.$$d# | ${METALOG.add}" ; \
380 ${MTREE_CMD:N-W} -C -f $$m -K uname,gname | sed s#^\.#.$$d# | \
384 ${INSTALL_SYMLINK} usr/src/sys ${DESTDIR}/sys
385 .if ${MK_MAN} != "no"
386 cd ${DESTDIR}/usr/share/man; \
387 for mandir in man*; do \
388 ${INSTALL_SYMLINK} ../$$mandir \
389 ${DESTDIR}/usr/share/man/en.ISO8859-1/; \
390 ${INSTALL_SYMLINK} ../$$mandir \
391 ${DESTDIR}/usr/share/man/en.UTF-8/; \
393 .if ${MK_OPENSSL} != "no"
394 cd ${DESTDIR}/usr/share/openssl/man; \
395 for mandir in man*; do \
396 ${INSTALL_SYMLINK} ../$$mandir \
397 ${DESTDIR}/usr/share/openssl/man/en.ISO8859-1/; \
400 set - `grep "^[a-zA-Z]" ${.CURDIR}/man.alias`; \
401 while [ $$# -gt 0 ] ; do \
402 ${INSTALL_SYMLINK} "$$2" "${DESTDIR}/usr/share/man/$$1"; \
403 if [ "${MK_OPENSSL}" != "no" ]; then \
404 ${INSTALL_SYMLINK} "$$2" \
405 "${DESTDIR}/usr/share/openssl/man/$$1"; \
410 .if ${MK_NLS} != "no"
411 set - `grep "^[a-zA-Z]" ${.CURDIR}/nls.alias`; \
412 while [ $$# -gt 0 ] ; do \
413 ${INSTALL_SYMLINK} "$$2" "${DESTDIR}/usr/share/nls/$$1"; \
419 cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
420 ${BIN1} ${BIN2} nsmb.conf opieaccess \
421 ${DESTDIR}/usr/share/examples/etc
422 ${_+_}cd ${.CURDIR}/defaults; ${MAKE} install \
423 DESTDIR=${DESTDIR}/usr/share/examples
425 .include <bsd.prog.mk>