1 # from: @(#)Makefile 5.11 (Berkeley) 5/21/91
6 .if ${MK_SENDMAIL} != "no"
10 .if ${MK_TESTS} != "no"
57 .if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "powerpc64"
61 .if exists(${.CURDIR}/etc.${MACHINE}/ttys)
62 BIN1+= etc.${MACHINE}/ttys
63 .elif exists(${.CURDIR}/etc.${MACHINE_ARCH}/ttys)
64 BIN1+= etc.${MACHINE_ARCH}/ttys
65 .elif exists(${.CURDIR}/etc.${MACHINE_CPUARCH}/ttys)
66 BIN1+= etc.${MACHINE_CPUARCH}/ttys
68 .error etc.MACHINE/ttys missing
71 OPENBSMDIR= ${.CURDIR}/../contrib/openbsm
72 BSM_ETC_OPEN_FILES= ${OPENBSMDIR}/etc/audit_class \
73 ${OPENBSMDIR}/etc/audit_event
74 BSM_ETC_RESTRICTED_FILES= ${OPENBSMDIR}/etc/audit_control \
75 ${OPENBSMDIR}/etc/audit_user
76 BSM_ETC_EXEC_FILES= ${OPENBSMDIR}/etc/audit_warn
77 BSM_ETC_DIR= ${DESTDIR}/etc/security
79 # NB: keep these sorted by MK_* knobs
89 .if ${MK_BSNMP} != "no"
93 .if ${MK_FREEBSD_UPDATE} != "no"
94 BIN1+= freebsd-update.conf
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_TCSH} != "no"
135 BIN1+= csh.cshrc csh.login csh.logout
138 .if ${MK_WIRELESS} != "no"
142 # -rwxr-xr-x root:wheel, for the new cron root:wheel
143 BIN2= netstart pccard_ether rc.suspend rc.resume
145 MTREE= BSD.include.dist BSD.root.dist BSD.usr.dist BSD.var.dist
146 .if ${MK_TESTS} != "no"
147 MTREE+= BSD.tests.dist
149 .if ${MK_SENDMAIL} != "no"
150 MTREE+= BSD.sendmail.dist
152 .if ${MK_DEBUG_FILES} != "no"
153 MTREE+= BSD.debug.dist
158 .if ${MK_SENDMAIL} == "no"
159 ETCMAIL=mailer.conf aliases
161 ETCMAIL=Makefile README mailer.conf access.sample virtusertable.sample \
162 mailertable.sample aliases
165 # Special top level files for FreeBSD
169 DESTDIR:= ${DESTDIR:C://*:/:g}
172 .if ${MK_MAN} != "no"
173 ${_+_}cd ${.CURDIR}/../share/man; ${MAKE} makedb
177 ${_+_}cd ${.CURDIR} ; ${MAKE} install DESTDIR=${DISTDIR}/${DISTRIBUTION}
178 ${_+_}cd ${.CURDIR} ; ${MAKE} distribution DESTDIR=${DISTDIR}/${DISTRIBUTION}
180 .include <bsd.endian.mk>
181 .if ${TARGET_ENDIANNESS} == "1234"
184 .elif ${TARGET_ENDIANNESS} == "4321"
193 METALOG.add?= cat -l >> ${METALOG}
197 .if !defined(DESTDIR)
198 @echo "set DESTDIR before running \"make ${.TARGET}\""
202 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
203 ${BIN1} ${DESTDIR}/etc; \
204 cap_mkdb ${CAP_MKDB_ENDIAN} ${DESTDIR}/etc/login.conf; \
205 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 755 \
206 ${BIN2} ${DESTDIR}/etc; \
207 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 600 \
208 master.passwd nsmb.conf opieaccess ${DESTDIR}/etc;
210 sed -i "" -e 's;.*/usr/libexec/atrun;#&;' ${DESTDIR}/etc/crontab
212 .if ${MK_TCSH} == "no"
213 sed -i "" -e 's;/bin/csh;/bin/sh;' ${DESTDIR}/etc/master.passwd
215 pwd_mkdb ${PWD_MKDB_ENDIAN} -i -p -d ${DESTDIR}/etc \
216 ${DESTDIR}/etc/master.passwd
219 echo "./etc/login.conf.db type=file mode=0644 uname=root gname=wheel"; \
220 echo "./etc/passwd type=file mode=0644 uname=root gname=wheel"; \
221 echo "./etc/pwd.db type=file mode=0644 uname=root gname=wheel"; \
222 echo "./etc/spwd.db type=file mode=0600 uname=root gname=wheel"; \
225 .if ${MK_BLUETOOTH} != "no"
226 ${_+_}cd ${.CURDIR}/bluetooth; ${MAKE} install
228 ${_+_}cd ${.CURDIR}/defaults; ${MAKE} install
229 ${_+_}cd ${.CURDIR}/devd; ${MAKE} install
230 ${_+_}cd ${.CURDIR}/gss; ${MAKE} install
231 ${_+_}cd ${.CURDIR}/periodic; ${MAKE} install
232 ${_+_}cd ${.CURDIR}/pkg; ${MAKE} install
233 ${_+_}cd ${.CURDIR}/rc.d; ${MAKE} install
234 ${_+_}cd ${.CURDIR}/../gnu/usr.bin/send-pr; ${MAKE} etc-gnats-freefall
235 ${_+_}cd ${.CURDIR}/../share/termcap; ${MAKE} etc-termcap
236 ${_+_}cd ${.CURDIR}/../usr.sbin/rmt; ${MAKE} etc-rmt
237 ${_+_}cd ${.CURDIR}/pam.d; ${MAKE} install
238 cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 0444 \
239 ${BSM_ETC_OPEN_FILES} ${BSM_ETC_DIR}
240 cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 0600 \
241 ${BSM_ETC_RESTRICTED_FILES} ${BSM_ETC_DIR}
242 cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 0500 \
243 ${BSM_ETC_EXEC_FILES} ${BSM_ETC_DIR}
244 .if ${MK_UNBOUND} != "no"
245 if [ ! -e ${DESTDIR}/etc/unbound ]; then \
246 ${INSTALL_SYMLINK} ../var/unbound ${DESTDIR}/etc/unbound; \
249 .if ${MK_SENDMAIL} != "no"
250 ${_+_}cd ${.CURDIR}/sendmail; ${MAKE} distribution
252 .if ${MK_OPENSSH} != "no"
253 cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
254 ${SSH} ${DESTDIR}/etc/ssh
256 .if ${MK_OPENSSL} != "no"
257 cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
258 ${SSL} ${DESTDIR}/etc/ssl
260 .if ${MK_KERBEROS} != "no"
261 cd ${.CURDIR}/root; \
262 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
263 dot.k5login ${DESTDIR}/root/.k5login;
265 cd ${.CURDIR}/root; \
266 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
267 dot.profile ${DESTDIR}/root/.profile; \
268 rm -f ${DESTDIR}/.profile; \
269 ln ${DESTDIR}/root/.profile ${DESTDIR}/.profile
270 .if ${MK_TCSH} != "no"
271 cd ${.CURDIR}/root; \
272 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
273 dot.cshrc ${DESTDIR}/root/.cshrc; \
274 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
275 dot.login ${DESTDIR}/root/.login; \
276 rm -f ${DESTDIR}/.cshrc; \
277 ln ${DESTDIR}/root/.cshrc ${DESTDIR}/.cshrc
279 cd ${.CURDIR}/mtree; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
280 ${MTREE} ${DESTDIR}/etc/mtree
281 .if ${MK_PPP} != "no"
282 cd ${.CURDIR}/ppp; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 600 \
283 ${PPPCNF} ${DESTDIR}/etc/ppp
285 .if ${MK_MAIL} != "no"
286 cd ${.CURDIR}/mail; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
287 ${ETCMAIL} ${DESTDIR}/etc/mail
288 if [ -d ${DESTDIR}/etc/mail -a -f ${DESTDIR}/etc/mail/aliases -a \
289 ! -f ${DESTDIR}/etc/aliases ]; then \
290 ln -s mail/aliases ${DESTDIR}/etc/aliases; \
293 ${INSTALL} -o ${BINOWN} -g operator -m 664 /dev/null \
294 ${DESTDIR}/etc/dumpdates
295 ${INSTALL} -o nobody -g ${BINGRP} -m 644 /dev/null \
296 ${DESTDIR}/var/db/locate.database
297 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 ${.CURDIR}/minfree \
299 cd ${.CURDIR}/..; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
300 ${FREEBSD} ${DESTDIR}/
301 .if ${MK_BOOT} != "no"
302 .if exists(${.CURDIR}/../sys/${MACHINE}/conf/GENERIC.hints)
303 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
304 ${.CURDIR}/../sys/${MACHINE}/conf/GENERIC.hints \
305 ${DESTDIR}/boot/device.hints
308 .if ${MK_NIS} == "no"
309 sed -i "" -e 's/.*_compat:/# &/' -e 's/compat$$/files/' \
310 ${DESTDIR}/etc/nsswitch.conf
315 MTREES= mtree/BSD.root.dist / \
316 mtree/BSD.var.dist /var \
317 mtree/BSD.usr.dist /usr \
318 mtree/BSD.include.dist /usr/include
319 .if ${MK_DEBUG_FILES} != "no"
320 MTREES+= mtree/BSD.debug.dist /usr/lib
322 .if ${MK_GROFF} != "no"
323 MTREES+= mtree/BSD.groff.dist /usr
325 .if ${MK_TESTS} != "no"
326 MTREES+= mtree/BSD.tests.dist /usr
328 .if ${MK_SENDMAIL} != "no"
329 MTREES+= mtree/BSD.sendmail.dist /
331 .for mtree in ${LOCAL_MTREE}
332 MTREES+= ../${mtree} /
335 distrib-dirs: ${MTREES:N/*}
337 while test $$# -ge 2; do \
342 ${ECHO} ${MTREE_CMD} -deU ${MTREE_FOLLOWS_SYMLINKS} \
344 ${MTREE_CMD} -deU ${MTREE_FOLLOWS_SYMLINKS} -f $$m -p $$d; \
348 while test $$# -ge 2; do \
352 test "$$d" == "/" && d=""; \
355 ${ECHO} "${MTREE_CMD:N-W} -C -f $$m -K uname,gname | " \
356 "sed s#^\.#.$$d# | ${METALOG.add}" ; \
357 ${MTREE_CMD:N-W} -C -f $$m -K uname,gname | sed s#^\.#.$$d# | \
361 ${INSTALL_SYMLINK} usr/src/sys ${DESTDIR}/sys
362 cd ${DESTDIR}/usr/share/man; \
363 for mandir in man*; do \
364 ${INSTALL_SYMLINK} ../$$mandir \
365 ${DESTDIR}/usr/share/man/en.ISO8859-1/; \
366 ${INSTALL_SYMLINK} ../$$mandir \
367 ${DESTDIR}/usr/share/man/en.UTF-8/; \
369 cd ${DESTDIR}/usr/share/openssl/man; \
370 for mandir in man*; do \
371 ${INSTALL_SYMLINK} ../$$mandir \
372 ${DESTDIR}/usr/share/openssl/man/en.ISO8859-1/; \
374 set - `grep "^[a-zA-Z]" ${.CURDIR}/man.alias`; \
375 while [ $$# -gt 0 ] ; do \
376 ${INSTALL_SYMLINK} "$$2" "${DESTDIR}/usr/share/man/$$1"; \
377 ${INSTALL_SYMLINK} "$$2" \
378 "${DESTDIR}/usr/share/openssl/man/$$1"; \
381 set - `grep "^[a-zA-Z]" ${.CURDIR}/nls.alias`; \
382 while [ $$# -gt 0 ] ; do \
383 ${INSTALL_SYMLINK} "$$2" "${DESTDIR}/usr/share/nls/$$1"; \
388 cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
389 ${BIN1} ${BIN2} nsmb.conf opieaccess \
390 ${DESTDIR}/usr/share/examples/etc
391 ${_+_}cd ${.CURDIR}/defaults; ${MAKE} install \
392 DESTDIR=${DESTDIR}/usr/share/examples
394 .include <bsd.prog.mk>