1 # from: @(#)Makefile 5.11 (Berkeley) 5/21/91
6 .if ${MK_SENDMAIL} != "no"
10 .if ${MK_TESTS} != "no"
58 .if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "powerpc64"
62 .if exists(${.CURDIR}/etc.${MACHINE}/ttys)
63 BIN1+= etc.${MACHINE}/ttys
64 .elif exists(${.CURDIR}/etc.${MACHINE_ARCH}/ttys)
65 BIN1+= etc.${MACHINE_ARCH}/ttys
66 .elif exists(${.CURDIR}/etc.${MACHINE_CPUARCH}/ttys)
67 BIN1+= etc.${MACHINE_CPUARCH}/ttys
69 .error etc.MACHINE/ttys missing
72 OPENBSMDIR= ${.CURDIR}/../contrib/openbsm
73 BSM_ETC_OPEN_FILES= ${OPENBSMDIR}/etc/audit_class \
74 ${OPENBSMDIR}/etc/audit_event
75 BSM_ETC_RESTRICTED_FILES= ${OPENBSMDIR}/etc/audit_control \
76 ${OPENBSMDIR}/etc/audit_user
77 BSM_ETC_EXEC_FILES= ${OPENBSMDIR}/etc/audit_warn
78 BSM_ETC_DIR= ${DESTDIR}/etc/security
80 # NB: keep these sorted by MK_* knobs
90 .if ${MK_FREEBSD_UPDATE} != "no"
91 BIN1+= freebsd-update.conf
94 .if ${MK_LOCATE} != "no"
95 BIN1+= ${.CURDIR}/../usr.bin/locate/locate/locate.rc
99 BIN1+= hosts.lpd printcap
102 .if ${MK_MAIL} != "no"
103 BIN1+= ${.CURDIR}/../usr.bin/mail/misc/mail.rc
106 .if ${MK_NTP} != "no"
110 .if ${MK_OPENSSH} != "no"
111 SSH= ${.CURDIR}/../crypto/openssh/ssh_config \
112 ${.CURDIR}/../crypto/openssh/sshd_config \
113 ${.CURDIR}/../crypto/openssh/moduli
115 .if ${MK_OPENSSL} != "no"
116 SSL= ${.CURDIR}/../crypto/openssl/apps/openssl.cnf
119 .if ${MK_NS_CACHING} != "no"
123 .if ${MK_PORTSNAP} != "no"
131 .if ${MK_TCSH} != "no"
132 BIN1+= csh.cshrc csh.login csh.logout
135 .if ${MK_WIRELESS} != "no"
139 # -rwxr-xr-x root:wheel, for the new cron root:wheel
140 BIN2= netstart pccard_ether rc.suspend rc.resume
142 MTREE= BSD.include.dist BSD.root.dist BSD.usr.dist BSD.var.dist
143 .if ${MK_TESTS} != "no"
144 MTREE+= BSD.tests.dist
146 .if ${MK_SENDMAIL} != "no"
147 MTREE+= BSD.sendmail.dist
149 .if ${MK_DEBUG_FILES} != "no"
150 MTREE+= BSD.debug.dist
155 .if ${MK_SENDMAIL} == "no"
156 ETCMAIL=mailer.conf aliases
158 ETCMAIL=Makefile README mailer.conf access.sample virtusertable.sample \
159 mailertable.sample aliases
162 # Special top level files for FreeBSD
166 DESTDIR:= ${DESTDIR:C://*:/:g}
169 .if ${MK_MAN} != "no"
170 ${_+_}cd ${.CURDIR}/../share/man; ${MAKE} makedb
174 # Avoid installing tests here; "make distribution" will do this and
175 # correctly place them in the right location.
176 ${_+_}cd ${.CURDIR} ; ${MAKE} -DNO_TESTS install \
177 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;
209 .if ${MK_BSNMP} != "no"
211 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 600 \
212 snmpd.config ${DESTDIR}/etc;
215 sed -i "" -e 's;.*/usr/libexec/atrun;#&;' ${DESTDIR}/etc/crontab
217 .if ${MK_TCSH} == "no"
218 sed -i "" -e 's;/bin/csh;/bin/sh;' ${DESTDIR}/etc/master.passwd
220 pwd_mkdb ${PWD_MKDB_ENDIAN} -i -p -d ${DESTDIR}/etc \
221 ${DESTDIR}/etc/master.passwd
224 echo "./etc/login.conf.db type=file mode=0644 uname=root gname=wheel"; \
225 echo "./etc/passwd type=file mode=0644 uname=root gname=wheel"; \
226 echo "./etc/pwd.db type=file mode=0644 uname=root gname=wheel"; \
227 echo "./etc/spwd.db type=file mode=0600 uname=root gname=wheel"; \
230 ${_+_}cd ${.CURDIR}/autofs; ${MAKE} install
231 .if ${MK_BLUETOOTH} != "no"
232 ${_+_}cd ${.CURDIR}/bluetooth; ${MAKE} install
234 ${_+_}cd ${.CURDIR}/defaults; ${MAKE} install
235 ${_+_}cd ${.CURDIR}/devd; ${MAKE} install
236 ${_+_}cd ${.CURDIR}/gss; ${MAKE} install
237 ${_+_}cd ${.CURDIR}/periodic; ${MAKE} install
238 ${_+_}cd ${.CURDIR}/pkg; ${MAKE} install
239 ${_+_}cd ${.CURDIR}/rc.d; ${MAKE} install
240 ${_+_}cd ${.CURDIR}/../share/termcap; ${MAKE} etc-termcap
241 ${_+_}cd ${.CURDIR}/../usr.sbin/rmt; ${MAKE} etc-rmt
242 ${_+_}cd ${.CURDIR}/pam.d; ${MAKE} install
243 cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 0444 \
244 ${BSM_ETC_OPEN_FILES} ${BSM_ETC_DIR}
245 cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 0600 \
246 ${BSM_ETC_RESTRICTED_FILES} ${BSM_ETC_DIR}
247 cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 0500 \
248 ${BSM_ETC_EXEC_FILES} ${BSM_ETC_DIR}
249 .if ${MK_UNBOUND} != "no"
250 if [ ! -e ${DESTDIR}/etc/unbound ]; then \
251 ${INSTALL_SYMLINK} ../var/unbound ${DESTDIR}/etc/unbound; \
254 .if ${MK_SENDMAIL} != "no"
255 ${_+_}cd ${.CURDIR}/sendmail; ${MAKE} distribution
257 .if ${MK_OPENSSH} != "no"
258 cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
259 ${SSH} ${DESTDIR}/etc/ssh
261 .if ${MK_OPENSSL} != "no"
262 cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
263 ${SSL} ${DESTDIR}/etc/ssl
265 .if ${MK_KERBEROS} != "no"
266 cd ${.CURDIR}/root; \
267 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
268 dot.k5login ${DESTDIR}/root/.k5login;
270 cd ${.CURDIR}/root; \
271 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
272 dot.profile ${DESTDIR}/root/.profile; \
273 rm -f ${DESTDIR}/.profile; \
274 ln ${DESTDIR}/root/.profile ${DESTDIR}/.profile
275 .if ${MK_TCSH} != "no"
276 cd ${.CURDIR}/root; \
277 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
278 dot.cshrc ${DESTDIR}/root/.cshrc; \
279 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
280 dot.login ${DESTDIR}/root/.login; \
281 rm -f ${DESTDIR}/.cshrc; \
282 ln ${DESTDIR}/root/.cshrc ${DESTDIR}/.cshrc
284 cd ${.CURDIR}/mtree; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
285 ${MTREE} ${DESTDIR}/etc/mtree
286 .if ${MK_PPP} != "no"
287 cd ${.CURDIR}/ppp; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 600 \
288 ${PPPCNF} ${DESTDIR}/etc/ppp
290 .if ${MK_MAIL} != "no"
291 cd ${.CURDIR}/mail; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
292 ${ETCMAIL} ${DESTDIR}/etc/mail
293 if [ -d ${DESTDIR}/etc/mail -a -f ${DESTDIR}/etc/mail/aliases -a \
294 ! -f ${DESTDIR}/etc/aliases ]; then \
295 ln -s mail/aliases ${DESTDIR}/etc/aliases; \
298 ${INSTALL} -o ${BINOWN} -g operator -m 664 /dev/null \
299 ${DESTDIR}/etc/dumpdates
300 ${INSTALL} -o nobody -g ${BINGRP} -m 644 /dev/null \
301 ${DESTDIR}/var/db/locate.database
302 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 ${.CURDIR}/minfree \
304 cd ${.CURDIR}/..; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
305 ${FREEBSD} ${DESTDIR}/
306 .if ${MK_BOOT} != "no"
307 .if exists(${.CURDIR}/../sys/${MACHINE}/conf/GENERIC.hints)
308 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
309 ${.CURDIR}/../sys/${MACHINE}/conf/GENERIC.hints \
310 ${DESTDIR}/boot/device.hints
313 .if ${MK_NIS} == "no"
314 sed -i "" -e 's/.*_compat:/# &/' -e 's/compat$$/files/' \
315 ${DESTDIR}/etc/nsswitch.conf
320 MTREES= mtree/BSD.root.dist / \
321 mtree/BSD.var.dist /var \
322 mtree/BSD.usr.dist /usr \
323 mtree/BSD.include.dist /usr/include
324 .if ${MK_DEBUG_FILES} != "no"
325 MTREES+= mtree/BSD.debug.dist /usr/lib
327 .if ${MK_GROFF} != "no"
328 MTREES+= mtree/BSD.groff.dist /usr
330 .if ${MK_TESTS} != "no"
331 MTREES+= mtree/BSD.tests.dist /usr
333 .if ${MK_SENDMAIL} != "no"
334 MTREES+= mtree/BSD.sendmail.dist /
336 .for mtree in ${LOCAL_MTREE}
337 MTREES+= ../${mtree} /
340 distrib-dirs: ${MTREES:N/*}
342 while test $$# -ge 2; do \
347 ${ECHO} ${MTREE_CMD} -deU ${MTREE_FOLLOWS_SYMLINKS} \
349 ${MTREE_CMD} -deU ${MTREE_FOLLOWS_SYMLINKS} -f $$m -p $$d; \
353 while test $$# -ge 2; do \
357 test "$$d" == "/" && d=""; \
360 ${ECHO} "${MTREE_CMD:N-W} -C -f $$m -K uname,gname | " \
361 "sed s#^\.#.$$d# | ${METALOG.add}" ; \
362 ${MTREE_CMD:N-W} -C -f $$m -K uname,gname | sed s#^\.#.$$d# | \
366 ${INSTALL_SYMLINK} usr/src/sys ${DESTDIR}/sys
367 cd ${DESTDIR}/usr/share/man; \
368 for mandir in man*; do \
369 ${INSTALL_SYMLINK} ../$$mandir \
370 ${DESTDIR}/usr/share/man/en.ISO8859-1/; \
371 ${INSTALL_SYMLINK} ../$$mandir \
372 ${DESTDIR}/usr/share/man/en.UTF-8/; \
374 cd ${DESTDIR}/usr/share/openssl/man; \
375 for mandir in man*; do \
376 ${INSTALL_SYMLINK} ../$$mandir \
377 ${DESTDIR}/usr/share/openssl/man/en.ISO8859-1/; \
379 set - `grep "^[a-zA-Z]" ${.CURDIR}/man.alias`; \
380 while [ $$# -gt 0 ] ; do \
381 ${INSTALL_SYMLINK} "$$2" "${DESTDIR}/usr/share/man/$$1"; \
382 ${INSTALL_SYMLINK} "$$2" \
383 "${DESTDIR}/usr/share/openssl/man/$$1"; \
386 set - `grep "^[a-zA-Z]" ${.CURDIR}/nls.alias`; \
387 while [ $$# -gt 0 ] ; do \
388 ${INSTALL_SYMLINK} "$$2" "${DESTDIR}/usr/share/nls/$$1"; \
393 cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
394 ${BIN1} ${BIN2} nsmb.conf opieaccess \
395 ${DESTDIR}/usr/share/examples/etc
396 ${_+_}cd ${.CURDIR}/defaults; ${MAKE} install \
397 DESTDIR=${DESTDIR}/usr/share/examples
399 .include <bsd.prog.mk>