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_BSNMP} != "no"
94 .if ${MK_FREEBSD_UPDATE} != "no"
95 BIN1+= freebsd-update.conf
98 .if ${MK_LOCATE} != "no"
99 BIN1+= ${.CURDIR}/../usr.bin/locate/locate/locate.rc
102 .if ${MK_LPR} != "no"
103 BIN1+= hosts.lpd printcap
106 .if ${MK_MAIL} != "no"
107 BIN1+= ${.CURDIR}/../usr.bin/mail/misc/mail.rc
110 .if ${MK_NTP} != "no"
114 .if ${MK_OPENSSH} != "no"
115 SSH= ${.CURDIR}/../crypto/openssh/ssh_config \
116 ${.CURDIR}/../crypto/openssh/sshd_config \
117 ${.CURDIR}/../crypto/openssh/moduli
119 .if ${MK_OPENSSL} != "no"
120 SSL= ${.CURDIR}/../crypto/openssl/apps/openssl.cnf
123 .if ${MK_NS_CACHING} != "no"
127 .if ${MK_PORTSNAP} != "no"
135 .if ${MK_TCSH} != "no"
136 BIN1+= csh.cshrc csh.login csh.logout
139 .if ${MK_WIRELESS} != "no"
143 # -rwxr-xr-x root:wheel, for the new cron root:wheel
144 BIN2= netstart pccard_ether rc.suspend rc.resume
146 MTREE= BSD.include.dist BSD.root.dist BSD.usr.dist BSD.var.dist
147 .if ${MK_TESTS} != "no"
148 MTREE+= BSD.tests.dist
150 .if ${MK_SENDMAIL} != "no"
151 MTREE+= BSD.sendmail.dist
153 .if ${MK_DEBUG_FILES} != "no"
154 MTREE+= BSD.debug.dist
159 .if ${MK_SENDMAIL} == "no"
160 ETCMAIL=mailer.conf aliases
162 ETCMAIL=Makefile README mailer.conf access.sample virtusertable.sample \
163 mailertable.sample aliases
166 # Special top level files for FreeBSD
170 DESTDIR:= ${DESTDIR:C://*:/:g}
173 .if ${MK_MAN} != "no"
174 ${_+_}cd ${.CURDIR}/../share/man; ${MAKE} makedb
178 # Avoid installing tests here; "make distribution" will do this and
179 # correctly place them in the right location.
180 ${_+_}cd ${.CURDIR} ; ${MAKE} MK_TESTS=no install \
181 DESTDIR=${DISTDIR}/${DISTRIBUTION}
182 ${_+_}cd ${.CURDIR} ; ${MAKE} distribution DESTDIR=${DISTDIR}/${DISTRIBUTION}
184 .include <bsd.endian.mk>
185 .if ${TARGET_ENDIANNESS} == "1234"
188 .elif ${TARGET_ENDIANNESS} == "4321"
197 METALOG.add?= cat -l >> ${METALOG}
201 .if !defined(DESTDIR)
202 @echo "set DESTDIR before running \"make ${.TARGET}\""
206 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
207 ${BIN1} ${DESTDIR}/etc; \
208 cap_mkdb ${CAP_MKDB_ENDIAN} ${DESTDIR}/etc/login.conf; \
209 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 755 \
210 ${BIN2} ${DESTDIR}/etc; \
211 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 600 \
212 master.passwd nsmb.conf opieaccess ${DESTDIR}/etc;
214 sed -i "" -e 's;.*/usr/libexec/atrun;#&;' ${DESTDIR}/etc/crontab
216 .if ${MK_TCSH} == "no"
217 sed -i "" -e 's;/bin/csh;/bin/sh;' ${DESTDIR}/etc/master.passwd
219 pwd_mkdb ${PWD_MKDB_ENDIAN} -i -p -d ${DESTDIR}/etc \
220 ${DESTDIR}/etc/master.passwd
223 echo "./etc/login.conf.db type=file mode=0644 uname=root gname=wheel"; \
224 echo "./etc/passwd type=file mode=0644 uname=root gname=wheel"; \
225 echo "./etc/pwd.db type=file mode=0644 uname=root gname=wheel"; \
226 echo "./etc/spwd.db type=file mode=0600 uname=root gname=wheel"; \
229 ${_+_}cd ${.CURDIR}/autofs; ${MAKE} install
230 .if ${MK_BLUETOOTH} != "no"
231 ${_+_}cd ${.CURDIR}/bluetooth; ${MAKE} install
233 .if ${MK_CASPER} != "no"
234 ${_+_}cd ${.CURDIR}/casper; ${MAKE} install
236 ${_+_}cd ${.CURDIR}/defaults; ${MAKE} install
237 ${_+_}cd ${.CURDIR}/devd; ${MAKE} install
238 .if ${MK_DMAGENT} != "no"
239 ${_+_}cd ${.CURDIR}/dma; ${MAKE} install
241 ${_+_}cd ${.CURDIR}/gss; ${MAKE} install
242 ${_+_}cd ${.CURDIR}/periodic; ${MAKE} install
243 ${_+_}cd ${.CURDIR}/pkg; ${MAKE} install
244 ${_+_}cd ${.CURDIR}/rc.d; ${MAKE} install
245 ${_+_}cd ${.CURDIR}/../share/termcap; ${MAKE} etc-termcap
246 ${_+_}cd ${.CURDIR}/../usr.sbin/rmt; ${MAKE} etc-rmt
247 ${_+_}cd ${.CURDIR}/pam.d; ${MAKE} install
248 cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 0444 \
249 ${BSM_ETC_OPEN_FILES} ${BSM_ETC_DIR}
250 cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 0600 \
251 ${BSM_ETC_RESTRICTED_FILES} ${BSM_ETC_DIR}
252 cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 0500 \
253 ${BSM_ETC_EXEC_FILES} ${BSM_ETC_DIR}
254 .if ${MK_UNBOUND} != "no"
255 if [ ! -e ${DESTDIR}/etc/unbound ]; then \
256 ${INSTALL_SYMLINK} ../var/unbound ${DESTDIR}/etc/unbound; \
259 .if ${MK_SENDMAIL} != "no"
260 ${_+_}cd ${.CURDIR}/sendmail; ${MAKE} distribution
262 .if ${MK_OPENSSH} != "no"
263 cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
264 ${SSH} ${DESTDIR}/etc/ssh
266 .if ${MK_OPENSSL} != "no"
267 cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
268 ${SSL} ${DESTDIR}/etc/ssl
270 .if ${MK_KERBEROS} != "no"
271 cd ${.CURDIR}/root; \
272 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
273 dot.k5login ${DESTDIR}/root/.k5login;
275 cd ${.CURDIR}/root; \
276 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
277 dot.profile ${DESTDIR}/root/.profile; \
278 rm -f ${DESTDIR}/.profile; \
279 ln ${DESTDIR}/root/.profile ${DESTDIR}/.profile
280 .if ${MK_TCSH} != "no"
281 cd ${.CURDIR}/root; \
282 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
283 dot.cshrc ${DESTDIR}/root/.cshrc; \
284 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
285 dot.login ${DESTDIR}/root/.login; \
286 rm -f ${DESTDIR}/.cshrc; \
287 ln ${DESTDIR}/root/.cshrc ${DESTDIR}/.cshrc
289 cd ${.CURDIR}/mtree; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
290 ${MTREE} ${DESTDIR}/etc/mtree
291 .if ${MK_PPP} != "no"
292 cd ${.CURDIR}/ppp; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 600 \
293 ${PPPCNF} ${DESTDIR}/etc/ppp
295 .if ${MK_MAIL} != "no"
296 cd ${.CURDIR}/mail; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
297 ${ETCMAIL} ${DESTDIR}/etc/mail
298 if [ -d ${DESTDIR}/etc/mail -a -f ${DESTDIR}/etc/mail/aliases -a \
299 ! -f ${DESTDIR}/etc/aliases ]; then \
300 ln -s mail/aliases ${DESTDIR}/etc/aliases; \
303 ${INSTALL} -o ${BINOWN} -g operator -m 664 /dev/null \
304 ${DESTDIR}/etc/dumpdates
305 ${INSTALL} -o nobody -g ${BINGRP} -m 644 /dev/null \
306 ${DESTDIR}/var/db/locate.database
307 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 ${.CURDIR}/minfree \
309 cd ${.CURDIR}/..; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
310 ${FREEBSD} ${DESTDIR}/
311 .if ${MK_BOOT} != "no"
312 .if exists(${.CURDIR}/../sys/${MACHINE}/conf/GENERIC.hints)
313 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
314 ${.CURDIR}/../sys/${MACHINE}/conf/GENERIC.hints \
315 ${DESTDIR}/boot/device.hints
318 .if ${MK_NIS} == "no"
319 sed -i "" -e 's/.*_compat:/# &/' -e 's/compat$$/files/' \
320 ${DESTDIR}/etc/nsswitch.conf
325 MTREES= mtree/BSD.root.dist / \
326 mtree/BSD.var.dist /var \
327 mtree/BSD.usr.dist /usr \
328 mtree/BSD.include.dist /usr/include
329 .if ${MK_DEBUG_FILES} != "no"
330 MTREES+= mtree/BSD.debug.dist /usr/lib
332 .if ${MK_GROFF} != "no"
333 MTREES+= mtree/BSD.groff.dist /usr
335 .if ${MK_TESTS} != "no"
336 MTREES+= mtree/BSD.tests.dist /usr
338 .if ${MK_SENDMAIL} != "no"
339 MTREES+= mtree/BSD.sendmail.dist /
341 .for mtree in ${LOCAL_MTREE}
342 MTREES+= ../${mtree} /
345 distrib-dirs: ${MTREES:N/*}
347 while test $$# -ge 2; do \
352 ${ECHO} ${MTREE_CMD} -deU ${MTREE_FOLLOWS_SYMLINKS} \
354 ${MTREE_CMD} -deU ${MTREE_FOLLOWS_SYMLINKS} -f $$m -p $$d; \
358 while test $$# -ge 2; do \
362 test "$$d" == "/" && d=""; \
365 ${ECHO} "${MTREE_CMD:N-W} -C -f $$m -K uname,gname | " \
366 "sed s#^\.#.$$d# | ${METALOG.add}" ; \
367 ${MTREE_CMD:N-W} -C -f $$m -K uname,gname | sed s#^\.#.$$d# | \
371 ${INSTALL_SYMLINK} usr/src/sys ${DESTDIR}/sys
372 cd ${DESTDIR}/usr/share/man; \
373 for mandir in man*; do \
374 ${INSTALL_SYMLINK} ../$$mandir \
375 ${DESTDIR}/usr/share/man/en.ISO8859-1/; \
376 ${INSTALL_SYMLINK} ../$$mandir \
377 ${DESTDIR}/usr/share/man/en.UTF-8/; \
379 cd ${DESTDIR}/usr/share/openssl/man; \
380 for mandir in man*; do \
381 ${INSTALL_SYMLINK} ../$$mandir \
382 ${DESTDIR}/usr/share/openssl/man/en.ISO8859-1/; \
384 set - `grep "^[a-zA-Z]" ${.CURDIR}/man.alias`; \
385 while [ $$# -gt 0 ] ; do \
386 ${INSTALL_SYMLINK} "$$2" "${DESTDIR}/usr/share/man/$$1"; \
387 ${INSTALL_SYMLINK} "$$2" \
388 "${DESTDIR}/usr/share/openssl/man/$$1"; \
391 set - `grep "^[a-zA-Z]" ${.CURDIR}/nls.alias`; \
392 while [ $$# -gt 0 ] ; do \
393 ${INSTALL_SYMLINK} "$$2" "${DESTDIR}/usr/share/nls/$$1"; \
398 cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
399 ${BIN1} ${BIN2} nsmb.conf opieaccess \
400 ${DESTDIR}/usr/share/examples/etc
401 ${_+_}cd ${.CURDIR}/defaults; ${MAKE} install \
402 DESTDIR=${DESTDIR}/usr/share/examples
404 .include <bsd.prog.mk>