1 # from: @(#)Makefile 5.11 (Berkeley) 5/21/91
11 .if ${MK_SENDMAIL} != "no"
55 .if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "powerpc64"
59 .if exists(${.CURDIR}/etc.${MACHINE}/ttys)
60 BIN1+= etc.${MACHINE}/ttys
61 .elif exists(${.CURDIR}/etc.${MACHINE_ARCH}/ttys)
62 BIN1+= etc.${MACHINE_ARCH}/ttys
63 .elif exists(${.CURDIR}/etc.${MACHINE_CPUARCH}/ttys)
64 BIN1+= etc.${MACHINE_CPUARCH}/ttys
66 .error etc.MACHINE/ttys missing
69 OPENBSMDIR= ${.CURDIR}/../contrib/openbsm
70 BSM_ETC_OPEN_FILES= ${OPENBSMDIR}/etc/audit_class \
71 ${OPENBSMDIR}/etc/audit_event
72 BSM_ETC_RESTRICTED_FILES= ${OPENBSMDIR}/etc/audit_control \
73 ${OPENBSMDIR}/etc/audit_user
74 BSM_ETC_EXEC_FILES= ${OPENBSMDIR}/etc/audit_warn
75 BSM_ETC_DIR= ${DESTDIR}/etc/security
77 # NB: keep these sorted by MK_* knobs
87 .if ${MK_AUTOFS} != "no"
91 .if ${MK_FREEBSD_UPDATE} != "no"
92 BIN1+= freebsd-update.conf
99 .if ${MK_INETD} != "no"
103 .if ${MK_LOCATE} != "no"
104 BIN1+= ${.CURDIR}/../usr.bin/locate/locate/locate.rc
107 .if ${MK_LPR} != "no"
108 BIN1+= hosts.lpd printcap
111 .if ${MK_MAIL} != "no"
112 BIN1+= ${.CURDIR}/../usr.bin/mail/misc/mail.rc
115 .if ${MK_NTP} != "no"
119 .if ${MK_OPENSSH} != "no"
120 SSH= ${.CURDIR}/../crypto/openssh/ssh_config \
121 ${.CURDIR}/../crypto/openssh/sshd_config \
122 ${.CURDIR}/../crypto/openssh/moduli
124 .if ${MK_OPENSSL} != "no"
125 SSL= ${.CURDIR}/../crypto/openssl/apps/openssl.cnf
128 .if ${MK_NS_CACHING} != "no"
132 .if ${MK_PORTSNAP} != "no"
140 .if ${MK_SENDMAIL} != "no"
144 .if ${MK_TCSH} != "no"
145 BIN1+= csh.cshrc csh.login csh.logout
148 .if ${MK_WIRELESS} != "no"
152 # -rwxr-xr-x root:wheel, for the new cron root:wheel
153 BIN2= netstart pccard_ether rc.suspend rc.resume
155 MTREE= BSD.debug.dist BSD.include.dist BSD.root.dist BSD.usr.dist BSD.var.dist
156 .if ${MK_TESTS} != "no"
157 MTREE+= BSD.tests.dist
159 .if ${MK_SENDMAIL} != "no"
160 MTREE+= BSD.sendmail.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 # Avoid installing tests here; "make distribution" will do this and
185 # correctly place them in the right location.
186 ${_+_}cd ${.CURDIR} ; ${MAKE} -DNO_TESTS install \
187 DESTDIR=${DISTDIR}/${DISTRIBUTION}
188 ${_+_}cd ${.CURDIR} ; ${MAKE} distribution DESTDIR=${DISTDIR}/${DISTRIBUTION}
190 .include <bsd.endian.mk>
191 .if ${TARGET_ENDIANNESS} == "1234"
194 .elif ${TARGET_ENDIANNESS} == "4321"
203 METALOG.add?= cat -l >> ${METALOG}
207 .if !defined(DESTDIR)
208 @echo "set DESTDIR before running \"make ${.TARGET}\""
212 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
213 ${BIN1} ${DESTDIR}/etc; \
214 cap_mkdb ${CAP_MKDB_ENDIAN} ${DESTDIR}/etc/login.conf; \
215 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 755 \
216 ${BIN2} ${DESTDIR}/etc; \
217 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 600 \
218 master.passwd nsmb.conf opieaccess ${DESTDIR}/etc;
219 .if ${MK_BSNMP} != "no"
221 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 600 \
222 snmpd.config ${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 .if ${MK_NTP} != "no"
250 ${_+_}cd ${.CURDIR}/ntp; ${MAKE} install
252 ${_+_}cd ${.CURDIR}/periodic; ${MAKE} install
253 .if ${MK_PKGBOOTSTRAP} != "no"
254 ${_+_}cd ${.CURDIR}/pkg; ${MAKE} install
256 ${_+_}cd ${.CURDIR}/rc.d; ${MAKE} install
257 ${_+_}cd ${.CURDIR}/../share/termcap; ${MAKE} etc-termcap
258 ${_+_}cd ${.CURDIR}/../usr.sbin/rmt; ${MAKE} etc-rmt
259 ${_+_}cd ${.CURDIR}/pam.d; ${MAKE} install
260 cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 0444 \
261 ${BSM_ETC_OPEN_FILES} ${BSM_ETC_DIR}
262 cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 0600 \
263 ${BSM_ETC_RESTRICTED_FILES} ${BSM_ETC_DIR}
264 cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 0500 \
265 ${BSM_ETC_EXEC_FILES} ${BSM_ETC_DIR}
266 .if ${MK_UNBOUND} != "no"
267 if [ ! -e ${DESTDIR}/etc/unbound ]; then \
268 ${INSTALL_SYMLINK} ../var/unbound ${DESTDIR}/etc/unbound; \
271 .if ${MK_SENDMAIL} != "no"
272 ${_+_}cd ${.CURDIR}/sendmail; ${MAKE} distribution
274 .if ${MK_OPENSSH} != "no"
275 cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
276 ${SSH} ${DESTDIR}/etc/ssh
278 .if ${MK_OPENSSL} != "no"
279 cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
280 ${SSL} ${DESTDIR}/etc/ssl
282 .if ${MK_KERBEROS} != "no"
283 cd ${.CURDIR}/root; \
284 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
285 dot.k5login ${DESTDIR}/root/.k5login;
287 cd ${.CURDIR}/root; \
288 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
289 dot.profile ${DESTDIR}/root/.profile; \
290 rm -f ${DESTDIR}/.profile; \
291 ln ${DESTDIR}/root/.profile ${DESTDIR}/.profile
292 .if ${MK_TCSH} != "no"
293 cd ${.CURDIR}/root; \
294 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
295 dot.cshrc ${DESTDIR}/root/.cshrc; \
296 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
297 dot.login ${DESTDIR}/root/.login; \
298 rm -f ${DESTDIR}/.cshrc; \
299 ln ${DESTDIR}/root/.cshrc ${DESTDIR}/.cshrc
301 cd ${.CURDIR}/mtree; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
302 ${MTREE} ${DESTDIR}/etc/mtree
303 .if ${MK_PPP} != "no"
304 cd ${.CURDIR}/ppp; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 600 \
305 ${PPPCNF} ${DESTDIR}/etc/ppp
307 .if ${MK_MAIL} != "no"
308 cd ${.CURDIR}/mail; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
309 ${ETCMAIL} ${DESTDIR}/etc/mail
310 if [ -d ${DESTDIR}/etc/mail -a -f ${DESTDIR}/etc/mail/aliases -a \
311 ! -f ${DESTDIR}/etc/aliases ]; then \
312 ln -s mail/aliases ${DESTDIR}/etc/aliases; \
315 ${INSTALL} -o ${BINOWN} -g operator -m 664 /dev/null \
316 ${DESTDIR}/etc/dumpdates
317 .if ${MK_LOCATE} != "no"
318 ${INSTALL} -o nobody -g ${BINGRP} -m 644 /dev/null \
319 ${DESTDIR}/var/db/locate.database
321 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 ${.CURDIR}/minfree \
323 cd ${.CURDIR}/..; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
324 ${FREEBSD} ${DESTDIR}/
325 .if ${MK_BOOT} != "no"
326 .if exists(${.CURDIR}/../sys/${MACHINE}/conf/GENERIC.hints)
327 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
328 ${.CURDIR}/../sys/${MACHINE}/conf/GENERIC.hints \
329 ${DESTDIR}/boot/device.hints
332 .if ${MK_NIS} == "no"
333 sed -i "" -e 's/.*_compat:/# &/' -e 's/compat$$/files/' \
334 ${DESTDIR}/etc/nsswitch.conf
339 MTREES= mtree/BSD.root.dist / \
340 mtree/BSD.var.dist /var \
341 mtree/BSD.usr.dist /usr \
342 mtree/BSD.include.dist /usr/include \
343 mtree/BSD.debug.dist /usr/lib
344 .if ${MK_GROFF} != "no"
345 MTREES+= mtree/BSD.groff.dist /usr
347 .if ${MK_TESTS} != "no"
348 MTREES+= mtree/BSD.tests.dist ${TESTSBASE}
350 .if ${MK_SENDMAIL} != "no"
351 MTREES+= mtree/BSD.sendmail.dist /
353 .for mtree in ${LOCAL_MTREE}
354 MTREES+= ../${mtree} /
357 distrib-dirs: ${MTREES:N/*}
359 while test $$# -ge 2; do \
364 test -d $$d || mkdir -p $$d; \
365 ${ECHO} ${MTREE_CMD} -deU ${MTREE_FOLLOWS_SYMLINKS} \
367 ${MTREE_CMD} -deU ${MTREE_FOLLOWS_SYMLINKS} -f $$m -p $$d; \
371 while test $$# -ge 2; do \
375 test "$$d" == "/" && d=""; \
378 test -d $$d || mkdir -p $$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}${SHAREDIR}/man; \
388 for mandir in man*; do \
389 ${INSTALL_SYMLINK} ../$$mandir \
390 ${DESTDIR}${SHAREDIR}/man/en.ISO8859-1/; \
391 ${INSTALL_SYMLINK} ../$$mandir \
392 ${DESTDIR}${SHAREDIR}/man/en.UTF-8/; \
394 .if ${MK_OPENSSL} != "no"
395 cd ${DESTDIR}${SHAREDIR}/openssl/man; \
396 for mandir in man*; do \
397 ${INSTALL_SYMLINK} ../$$mandir \
398 ${DESTDIR}${SHAREDIR}/openssl/man/en.ISO8859-1/; \
401 set - `grep "^[a-zA-Z]" ${.CURDIR}/man.alias`; \
402 while [ $$# -gt 0 ] ; do \
403 ${INSTALL_SYMLINK} "$$2" "${DESTDIR}${SHAREDIR}/man/$$1"; \
404 if [ "${MK_OPENSSL}" != "no" ]; then \
405 ${INSTALL_SYMLINK} "$$2" \
406 "${DESTDIR}${SHAREDIR}/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}${SHAREDIR}/nls/$$1"; \
420 cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
421 ${BIN1} ${BIN2} nsmb.conf opieaccess \
422 ${DESTDIR}${SHAREDIR}/examples/etc
423 ${_+_}cd ${.CURDIR}/defaults; ${MAKE} install \
424 DESTDIR=${DESTDIR}${SHAREDIR}/examples
426 .include <bsd.prog.mk>