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_FREEBSD_UPDATE} != "no"
86 BIN1+= freebsd-update.conf
93 .if ${MK_INETD} != "no"
97 .if ${MK_LOCATE} != "no"
98 BIN1+= ${.CURDIR}/../usr.bin/locate/locate/locate.rc
101 .if ${MK_LPR} != "no"
102 BIN1+= hosts.lpd printcap
105 .if ${MK_MAIL} != "no"
106 BIN1+= ${.CURDIR}/../usr.bin/mail/misc/mail.rc
109 .if ${MK_NTP} != "no"
113 .if ${MK_OPENSSH} != "no"
114 SSH= ${.CURDIR}/../crypto/openssh/ssh_config \
115 ${.CURDIR}/../crypto/openssh/sshd_config \
116 ${.CURDIR}/../crypto/openssh/moduli
118 .if ${MK_OPENSSL} != "no"
119 SSL= ${.CURDIR}/../crypto/openssl/apps/openssl.cnf
122 .if ${MK_NS_CACHING} != "no"
126 .if ${MK_PORTSNAP} != "no"
134 .if ${MK_SENDMAIL} != "no"
138 .if ${MK_TCSH} != "no"
139 BIN1+= csh.cshrc csh.login csh.logout
142 .if ${MK_WIRELESS} != "no"
146 # -rwxr-xr-x root:wheel, for the new cron root:wheel
147 BIN2= netstart pccard_ether rc.suspend rc.resume
149 MTREE= BSD.include.dist BSD.root.dist BSD.usr.dist BSD.var.dist
150 .if ${MK_SENDMAIL} != "no"
151 MTREE+= BSD.sendmail.dist
153 .if ${MK_BIND} != "no"
154 MTREE+= BIND.chroot.dist
155 .if ${MK_BIND_LIBS} != "no"
156 MTREE+= BIND.include.dist
159 .if ${MK_DEBUG_FILES} != "no"
160 MTREE+= BSD.debug.dist
165 .if ${MK_SENDMAIL} == "no"
166 ETCMAIL=mailer.conf aliases
168 ETCMAIL=Makefile README mailer.conf access.sample virtusertable.sample \
169 mailertable.sample aliases
172 # Special top level files for FreeBSD
176 DESTDIR:= ${DESTDIR:C://*:/:g}
179 .if ${MK_MAN} != "no"
180 ${_+_}cd ${.CURDIR}/../share/man; ${MAKE} makedb
184 ${_+_}cd ${.CURDIR} ; ${MAKE} install DESTDIR=${DISTDIR}/${DISTRIBUTION}
185 ${_+_}cd ${.CURDIR} ; ${MAKE} distribution DESTDIR=${DISTDIR}/${DISTRIBUTION}
187 .include <bsd.endian.mk>
188 .if ${TARGET_ENDIANNESS} == "1234"
191 .elif ${TARGET_ENDIANNESS} == "4321"
200 METALOG.add?= cat -l >> ${METALOG}
204 .if !defined(DESTDIR)
205 @echo "set DESTDIR before running \"make ${.TARGET}\""
209 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
210 ${BIN1} ${DESTDIR}/etc; \
211 cap_mkdb ${CAP_MKDB_ENDIAN} ${DESTDIR}/etc/login.conf; \
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;
216 .if ${MK_BSNMP} != "no"
218 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 600 \
219 snmpd.config ${DESTDIR}/etc;
222 sed -i "" -e 's;.*/usr/libexec/atrun;#&;' ${DESTDIR}/etc/crontab
224 .if ${MK_TCSH} == "no"
225 sed -i "" -e 's;/bin/csh;/bin/sh;' ${DESTDIR}/etc/master.passwd
227 pwd_mkdb ${PWD_MKDB_ENDIAN} -i -p -d ${DESTDIR}/etc \
228 ${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_BLUETOOTH} != "no"
238 ${_+_}cd ${.CURDIR}/bluetooth; ${MAKE} install
240 ${_+_}cd ${.CURDIR}/defaults; ${MAKE} install
241 ${_+_}cd ${.CURDIR}/devd; ${MAKE} install
242 ${_+_}cd ${.CURDIR}/gss; ${MAKE} install
243 .if ${MK_NTP} != "no"
244 ${_+_}cd ${.CURDIR}/ntp; ${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_BIND_MTREE} != "no"
261 if [ ! -e ${DESTDIR}/etc/namedb ]; then \
262 ln -s ../var/named/etc/namedb ${DESTDIR}/etc/namedb; \
265 .if ${MK_BIND_ETC} != "no"
266 ${_+_}cd ${.CURDIR}/namedb; ${MAKE} install
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_BIND_LIBS} != "no"
344 MTREES+= mtree/BIND.include.dist /usr/include
346 .if ${MK_BIND_MTREE} != "no"
347 MTREES+= mtree/BIND.chroot.dist /var/named
349 .if ${MK_GROFF} != "no"
350 MTREES+= mtree/BSD.groff.dist /usr
352 .if ${MK_SENDMAIL} != "no"
353 MTREES+= mtree/BSD.sendmail.dist /
355 .for mtree in ${LOCAL_MTREE}
356 MTREES+= ../${mtree} /
359 distrib-dirs: ${MTREES:N/*}
361 while test $$# -ge 2; do \
366 ${ECHO} ${MTREE_CMD} -deU ${MTREE_FOLLOWS_SYMLINKS} \
368 ${MTREE_CMD} -deU ${MTREE_FOLLOWS_SYMLINKS} -f $$m -p $$d; \
372 while test $$# -ge 2; do \
376 test "$$d" == "/" && d=""; \
379 ${ECHO} "${MTREE_CMD:N-W} -C -f $$m -K uname,gname | " \
380 "sed s#^\.#.$$d# | ${METALOG.add}" ; \
381 ${MTREE_CMD:N-W} -C -f $$m -K uname,gname | sed s#^\.#.$$d# | \
385 ${INSTALL_SYMLINK} usr/src/sys ${DESTDIR}/sys
386 .if ${MK_MAN} != "no"
387 cd ${DESTDIR}/usr/share/man; \
388 for mandir in man*; do \
389 ${INSTALL_SYMLINK} ../$$mandir \
390 ${DESTDIR}/usr/share/man/en.ISO8859-1/; \
391 ${INSTALL_SYMLINK} ../$$mandir \
392 ${DESTDIR}/usr/share/man/en.UTF-8/; \
394 .if ${MK_OPENSSL} != "no"
395 cd ${DESTDIR}/usr/share/openssl/man; \
396 for mandir in man*; do \
397 ${INSTALL_SYMLINK} ../$$mandir \
398 ${DESTDIR}/usr/share/openssl/man/en.ISO8859-1/; \
401 set - `grep "^[a-zA-Z]" ${.CURDIR}/man.alias`; \
402 while [ $$# -gt 0 ] ; do \
403 ${INSTALL_SYMLINK} "$$2" "${DESTDIR}/usr/share/man/$$1"; \
404 if [ "${MK_OPENSSL}" != "no" ]; then \
405 ${INSTALL_SYMLINK} "$$2" \
406 "${DESTDIR}/usr/share/openssl/man/$$1"; \
411 .if ${MK_NLS} != "no"
412 set - `grep "^[a-zA-Z]" ${.CURDIR}/nls.alias`; \
413 while [ $$# -gt 0 ] ; do \
414 ${INSTALL_SYMLINK} "$$2" "${DESTDIR}/usr/share/nls/$$1"; \
420 cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
421 ${BIN1} ${BIN2} nsmb.conf opieaccess \
422 ${DESTDIR}/usr/share/examples/etc
423 ${_+_}cd ${.CURDIR}/defaults; ${MAKE} install \
424 DESTDIR=${DESTDIR}/usr/share/examples
426 .include <bsd.prog.mk>