1 # from: @(#)Makefile 5.11 (Berkeley) 5/21/91
9 .if ${MK_SENDMAIL} != "no"
13 .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_AUTOFS} != "no"
93 .if ${MK_BSNMP} != "no"
97 .if ${MK_FREEBSD_UPDATE} != "no"
98 BIN1+= freebsd-update.conf
101 .if ${MK_FTP} != "no"
105 .if ${MK_INETD} != "no"
109 .if ${MK_LOCATE} != "no"
110 BIN1+= ${.CURDIR}/../usr.bin/locate/locate/locate.rc
113 .if ${MK_LPR} != "no"
114 BIN1+= hosts.lpd printcap
117 .if ${MK_MAIL} != "no"
118 BIN1+= ${.CURDIR}/../usr.bin/mail/misc/mail.rc
121 .if ${MK_NTP} != "no"
125 .if ${MK_OPENSSH} != "no"
126 SSH= ${.CURDIR}/../crypto/openssh/ssh_config \
127 ${.CURDIR}/../crypto/openssh/sshd_config \
128 ${.CURDIR}/../crypto/openssh/moduli
130 .if ${MK_OPENSSL} != "no"
131 SSL= ${.CURDIR}/../crypto/openssl/apps/openssl.cnf
134 .if ${MK_NS_CACHING} != "no"
138 .if ${MK_PORTSNAP} != "no"
146 .if ${MK_SENDMAIL} != "no"
150 .if ${MK_TCSH} != "no"
151 BIN1+= csh.cshrc csh.login csh.logout
154 .if ${MK_WIRELESS} != "no"
158 # -rwxr-xr-x root:wheel, for the new cron root:wheel
159 BIN2= netstart pccard_ether rc.suspend rc.resume
161 MTREE= BSD.debug.dist BSD.include.dist BSD.root.dist BSD.usr.dist BSD.var.dist
162 .if ${MK_TESTS} != "no"
163 MTREE+= BSD.tests.dist
165 .if ${MK_SENDMAIL} != "no"
166 MTREE+= BSD.sendmail.dist
171 .if ${MK_SENDMAIL} == "no"
172 ETCMAIL=mailer.conf aliases
174 ETCMAIL=Makefile README mailer.conf access.sample virtusertable.sample \
175 mailertable.sample aliases
178 # Special top level files for FreeBSD
182 DESTDIR:= ${DESTDIR:C://*:/:g}
185 .if ${MK_MAN} != "no"
186 ${_+_}cd ${.CURDIR}/../share/man; ${MAKE} makedb
190 # Avoid installing tests here; "make distribution" will do this and
191 # correctly place them in the right location.
192 ${_+_}cd ${.CURDIR} ; ${MAKE} MK_TESTS=no install \
193 DESTDIR=${DISTDIR}/${DISTRIBUTION}
194 ${_+_}cd ${.CURDIR} ; ${MAKE} distribution DESTDIR=${DISTDIR}/${DISTRIBUTION}
196 .include <bsd.endian.mk>
197 .if ${TARGET_ENDIANNESS} == "1234"
200 .elif ${TARGET_ENDIANNESS} == "4321"
209 METALOG.add?= cat -l >> ${METALOG}
213 .if !defined(DESTDIR)
214 @echo "set DESTDIR before running \"make ${.TARGET}\""
218 ${INSTALL} ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m 644 \
219 ${BIN1} ${DESTDIR}/etc; \
220 cap_mkdb ${CAP_MKDB_ENDIAN} ${DESTDIR}/etc/login.conf; \
221 ${INSTALL} ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m 755 \
222 ${BIN2} ${DESTDIR}/etc; \
223 ${INSTALL} ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m 600 \
224 master.passwd nsmb.conf opieaccess ${DESTDIR}/etc;
226 sed -i "" -e 's;.*/usr/libexec/atrun;#&;' ${DESTDIR}/etc/crontab
228 .if ${MK_TCSH} == "no"
229 sed -i "" -e 's;/bin/csh;/bin/sh;' ${DESTDIR}/etc/master.passwd
231 pwd_mkdb ${PWD_MKDB_ENDIAN} -i -p -d ${DESTDIR}/etc \
232 ${DESTDIR}/etc/master.passwd
235 echo "./etc/login.conf.db type=file mode=0644 uname=root gname=wheel"; \
236 echo "./etc/passwd type=file mode=0644 uname=root gname=wheel"; \
237 echo "./etc/pwd.db type=file mode=0644 uname=root gname=wheel"; \
238 echo "./etc/spwd.db type=file mode=0600 uname=root gname=wheel"; \
241 .if ${MK_AUTOFS} != "no"
242 ${_+_}cd ${.CURDIR}/autofs; ${MAKE} install
244 .if ${MK_BLUETOOTH} != "no"
245 ${_+_}cd ${.CURDIR}/bluetooth; ${MAKE} install
247 .if ${MK_CASPER} != "no"
248 ${_+_}cd ${.CURDIR}/casper; ${MAKE} install
250 ${_+_}cd ${.CURDIR}/defaults; ${MAKE} install
251 ${_+_}cd ${.CURDIR}/devd; ${MAKE} install
252 .if ${MK_DMAGENT} != "no"
253 ${_+_}cd ${.CURDIR}/dma; ${MAKE} install
255 ${_+_}cd ${.CURDIR}/gss; ${MAKE} install
256 ${_+_}cd ${.CURDIR}/periodic; ${MAKE} install
257 .if ${MK_PKGBOOTSTRAP} != "no"
258 ${_+_}cd ${.CURDIR}/pkg; ${MAKE} install
260 ${_+_}cd ${.CURDIR}/rc.d; ${MAKE} install
261 ${_+_}cd ${.CURDIR}/../share/termcap; ${MAKE} etc-termcap
262 ${_+_}cd ${.CURDIR}/../usr.sbin/rmt; ${MAKE} etc-rmt
263 ${_+_}cd ${.CURDIR}/pam.d; ${MAKE} install
264 cd ${.CURDIR}; ${INSTALL} ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m 0444 \
265 ${BSM_ETC_OPEN_FILES} ${BSM_ETC_DIR}
266 cd ${.CURDIR}; ${INSTALL} ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m 0600 \
267 ${BSM_ETC_RESTRICTED_FILES} ${BSM_ETC_DIR}
268 cd ${.CURDIR}; ${INSTALL} ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m 0500 \
269 ${BSM_ETC_EXEC_FILES} ${BSM_ETC_DIR}
270 .if ${MK_UNBOUND} != "no"
271 if [ ! -e ${DESTDIR}/etc/unbound ]; then \
272 ${INSTALL_SYMLINK} -T package=unbound ../var/unbound ${DESTDIR}/etc/unbound; \
275 .if ${MK_SENDMAIL} != "no"
276 ${_+_}cd ${.CURDIR}/sendmail; ${MAKE} distribution
278 .if ${MK_OPENSSH} != "no"
279 cd ${.CURDIR}; ${INSTALL} -T package=ssh,config -o ${BINOWN} -g ${BINGRP} -m 644 \
280 ${SSH} ${DESTDIR}/etc/ssh
282 .if ${MK_OPENSSL} != "no"
283 cd ${.CURDIR}; ${INSTALL} ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m 644 \
284 ${SSL} ${DESTDIR}/etc/ssl
286 .if ${MK_KERBEROS} != "no"
287 cd ${.CURDIR}/root; \
288 ${INSTALL} ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m 644 \
289 dot.k5login ${DESTDIR}/root/.k5login;
291 cd ${.CURDIR}/root; \
292 ${INSTALL} ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m 644 \
293 dot.profile ${DESTDIR}/root/.profile; \
294 rm -f ${DESTDIR}/.profile; \
295 ln ${DESTDIR}/root/.profile ${DESTDIR}/.profile
296 .if ${MK_TCSH} != "no"
297 cd ${.CURDIR}/root; \
298 ${INSTALL} ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m 644 \
299 dot.cshrc ${DESTDIR}/root/.cshrc; \
300 ${INSTALL} ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m 644 \
301 dot.login ${DESTDIR}/root/.login; \
302 rm -f ${DESTDIR}/.cshrc; \
303 ln ${DESTDIR}/root/.cshrc ${DESTDIR}/.cshrc
305 cd ${.CURDIR}/mtree; ${INSTALL} ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m 444 \
306 ${MTREE} ${DESTDIR}/etc/mtree
307 .if ${MK_PPP} != "no"
308 cd ${.CURDIR}/ppp; ${INSTALL} ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m 600 \
309 ${PPPCNF} ${DESTDIR}/etc/ppp
311 .if ${MK_MAIL} != "no"
312 cd ${.CURDIR}/mail; ${INSTALL} ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m 644 \
313 ${ETCMAIL} ${DESTDIR}/etc/mail
314 if [ -d ${DESTDIR}/etc/mail -a -f ${DESTDIR}/etc/mail/aliases -a \
315 ! -f ${DESTDIR}/etc/aliases ]; then \
316 ln -s mail/aliases ${DESTDIR}/etc/aliases; \
319 ${INSTALL} ${TAG_ARGS} -o ${BINOWN} -g operator -m 664 /dev/null \
320 ${DESTDIR}/etc/dumpdates
321 .if ${MK_LOCATE} != "no"
322 ${INSTALL} ${TAG_ARGS} -o nobody -g ${BINGRP} -m 644 /dev/null \
323 ${DESTDIR}/var/db/locate.database
325 ${INSTALL} ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m 644 ${.CURDIR}/minfree \
327 cd ${.CURDIR}/..; ${INSTALL} ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m 444 \
328 ${FREEBSD} ${DESTDIR}/
329 .if ${MK_BOOT} != "no"
330 .if exists(${.CURDIR}/../sys/${MACHINE}/conf/GENERIC.hints)
331 ${INSTALL} ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m 444 \
332 ${.CURDIR}/../sys/${MACHINE}/conf/GENERIC.hints \
333 ${DESTDIR}/boot/device.hints
336 .if ${MK_NIS} == "no"
337 sed -i "" -e 's/.*_compat:/# &/' -e 's/compat$$/files/' \
338 ${DESTDIR}/etc/nsswitch.conf
343 MTREES= mtree/BSD.root.dist / \
344 mtree/BSD.var.dist /var \
345 mtree/BSD.usr.dist /usr \
346 mtree/BSD.include.dist /usr/include \
347 mtree/BSD.debug.dist /usr/lib
348 .if ${MK_GROFF} != "no"
349 MTREES+= mtree/BSD.groff.dist /usr
351 .if ${MK_TESTS} != "no"
352 MTREES+= mtree/BSD.tests.dist ${TESTSBASE}
354 .if ${MK_SENDMAIL} != "no"
355 MTREES+= mtree/BSD.sendmail.dist /
357 .for mtree in ${LOCAL_MTREE}
358 MTREES+= ../${mtree} /
361 distrib-dirs: ${MTREES:N/*}
363 while test $$# -ge 2; do \
368 test -d $$d || mkdir -p $$d; \
369 ${ECHO} ${MTREE_CMD} -deU ${MTREE_FOLLOWS_SYMLINKS} \
371 ${MTREE_CMD} -deU ${MTREE_FOLLOWS_SYMLINKS} -f $$m -p $$d; \
375 while test $$# -ge 2; do \
379 test "$$d" == "/" && d=""; \
382 ${ECHO} "${MTREE_CMD:N-W} -C -f $$m -K all | " \
383 "sed s#^\.#.$$d# | ${METALOG.add}" ; \
384 ${MTREE_CMD:N-W} -C -f $$m -K all | sed s#^\.#.$$d# | \
388 ${INSTALL_SYMLINK} usr/src/sys ${DESTDIR}/sys
389 .if ${MK_MAN} != "no"
390 cd ${DESTDIR}/usr/share/man; \
391 for mandir in man*; do \
392 ${INSTALL_SYMLINK} ../$$mandir \
393 ${DESTDIR}/usr/share/man/en.ISO8859-1/; \
394 ${INSTALL_SYMLINK} ../$$mandir \
395 ${DESTDIR}/usr/share/man/en.UTF-8/; \
397 .if ${MK_OPENSSL} != "no"
398 cd ${DESTDIR}/usr/share/openssl/man; \
399 for mandir in man*; do \
400 ${INSTALL_SYMLINK} ../$$mandir \
401 ${DESTDIR}/usr/share/openssl/man/en.ISO8859-1/; \
404 set - `grep "^[a-zA-Z]" ${.CURDIR}/man.alias`; \
405 while [ $$# -gt 0 ] ; do \
406 ${INSTALL_SYMLINK} "$$2" "${DESTDIR}/usr/share/man/$$1"; \
407 if [ "${MK_OPENSSL}" != "no" ]; then \
408 ${INSTALL_SYMLINK} "$$2" \
409 "${DESTDIR}/usr/share/openssl/man/$$1"; \
414 .if ${MK_NLS} != "no"
415 set - `grep "^[a-zA-Z]" ${.CURDIR}/nls.alias`; \
416 while [ $$# -gt 0 ] ; do \
417 ${INSTALL_SYMLINK} "$$2" "${DESTDIR}/usr/share/nls/$$1"; \
423 cd ${.CURDIR}; ${INSTALL} ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m 444 \
424 ${BIN1} ${BIN2} nsmb.conf opieaccess \
425 ${DESTDIR}/usr/share/examples/etc
426 ${_+_}cd ${.CURDIR}/defaults; ${MAKE} install \
427 DESTDIR=${DESTDIR}/usr/share/examples
429 .include <bsd.prog.mk>