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.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
168 .if ${MK_DEBUG_FILES} != "no"
169 MTREE+= BSD.debug.dist
174 .if ${MK_SENDMAIL} == "no"
175 ETCMAIL=mailer.conf aliases
177 ETCMAIL=Makefile README mailer.conf access.sample virtusertable.sample \
178 mailertable.sample aliases
181 # Special top level files for FreeBSD
185 DESTDIR:= ${DESTDIR:C://*:/:g}
188 .if ${MK_MAN} != "no"
189 ${_+_}cd ${.CURDIR}/../share/man; ${MAKE} makedb
193 # Avoid installing tests here; "make distribution" will do this and
194 # correctly place them in the right location.
195 ${_+_}cd ${.CURDIR} ; ${MAKE} MK_TESTS=no install \
196 DESTDIR=${DISTDIR}/${DISTRIBUTION}
197 ${_+_}cd ${.CURDIR} ; ${MAKE} distribution DESTDIR=${DISTDIR}/${DISTRIBUTION}
199 .include <bsd.endian.mk>
200 .if ${TARGET_ENDIANNESS} == "1234"
203 .elif ${TARGET_ENDIANNESS} == "4321"
212 METALOG.add?= cat -l >> ${METALOG}
216 .if !defined(DESTDIR)
217 @echo "set DESTDIR before running \"make ${.TARGET}\""
221 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
222 ${BIN1} ${DESTDIR}/etc; \
223 cap_mkdb ${CAP_MKDB_ENDIAN} ${DESTDIR}/etc/login.conf; \
224 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 755 \
225 ${BIN2} ${DESTDIR}/etc; \
226 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 600 \
227 master.passwd nsmb.conf opieaccess ${DESTDIR}/etc;
229 sed -i "" -e 's;.*/usr/libexec/atrun;#&;' ${DESTDIR}/etc/crontab
231 .if ${MK_TCSH} == "no"
232 sed -i "" -e 's;/bin/csh;/bin/sh;' ${DESTDIR}/etc/master.passwd
234 pwd_mkdb ${PWD_MKDB_ENDIAN} -i -p -d ${DESTDIR}/etc \
235 ${DESTDIR}/etc/master.passwd
238 echo "./etc/login.conf.db type=file mode=0644 uname=root gname=wheel"; \
239 echo "./etc/passwd type=file mode=0644 uname=root gname=wheel"; \
240 echo "./etc/pwd.db type=file mode=0644 uname=root gname=wheel"; \
241 echo "./etc/spwd.db type=file mode=0600 uname=root gname=wheel"; \
244 .if ${MK_AUTOFS} != "no"
245 ${_+_}cd ${.CURDIR}/autofs; ${MAKE} install
247 .if ${MK_BLUETOOTH} != "no"
248 ${_+_}cd ${.CURDIR}/bluetooth; ${MAKE} install
250 .if ${MK_CASPER} != "no"
251 ${_+_}cd ${.CURDIR}/casper; ${MAKE} install
253 ${_+_}cd ${.CURDIR}/defaults; ${MAKE} install
254 ${_+_}cd ${.CURDIR}/devd; ${MAKE} install
255 .if ${MK_DMAGENT} != "no"
256 ${_+_}cd ${.CURDIR}/dma; ${MAKE} install
258 ${_+_}cd ${.CURDIR}/gss; ${MAKE} install
259 ${_+_}cd ${.CURDIR}/periodic; ${MAKE} install
260 .if ${MK_PKGBOOTSTRAP} != "no"
261 ${_+_}cd ${.CURDIR}/pkg; ${MAKE} install
263 ${_+_}cd ${.CURDIR}/rc.d; ${MAKE} install
264 ${_+_}cd ${.CURDIR}/../share/termcap; ${MAKE} etc-termcap
265 ${_+_}cd ${.CURDIR}/../usr.sbin/rmt; ${MAKE} etc-rmt
266 ${_+_}cd ${.CURDIR}/pam.d; ${MAKE} install
267 cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 0444 \
268 ${BSM_ETC_OPEN_FILES} ${BSM_ETC_DIR}
269 cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 0600 \
270 ${BSM_ETC_RESTRICTED_FILES} ${BSM_ETC_DIR}
271 cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 0500 \
272 ${BSM_ETC_EXEC_FILES} ${BSM_ETC_DIR}
273 .if ${MK_UNBOUND} != "no"
274 if [ ! -e ${DESTDIR}/etc/unbound ]; then \
275 ${INSTALL_SYMLINK} ../var/unbound ${DESTDIR}/etc/unbound; \
278 .if ${MK_SENDMAIL} != "no"
279 ${_+_}cd ${.CURDIR}/sendmail; ${MAKE} distribution
281 .if ${MK_OPENSSH} != "no"
282 cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
283 ${SSH} ${DESTDIR}/etc/ssh
285 .if ${MK_OPENSSL} != "no"
286 cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
287 ${SSL} ${DESTDIR}/etc/ssl
289 .if ${MK_KERBEROS} != "no"
290 cd ${.CURDIR}/root; \
291 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
292 dot.k5login ${DESTDIR}/root/.k5login;
294 cd ${.CURDIR}/root; \
295 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
296 dot.profile ${DESTDIR}/root/.profile; \
297 rm -f ${DESTDIR}/.profile; \
298 ln ${DESTDIR}/root/.profile ${DESTDIR}/.profile
299 .if ${MK_TCSH} != "no"
300 cd ${.CURDIR}/root; \
301 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
302 dot.cshrc ${DESTDIR}/root/.cshrc; \
303 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
304 dot.login ${DESTDIR}/root/.login; \
305 rm -f ${DESTDIR}/.cshrc; \
306 ln ${DESTDIR}/root/.cshrc ${DESTDIR}/.cshrc
308 cd ${.CURDIR}/mtree; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
309 ${MTREE} ${DESTDIR}/etc/mtree
310 .if ${MK_PPP} != "no"
311 cd ${.CURDIR}/ppp; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 600 \
312 ${PPPCNF} ${DESTDIR}/etc/ppp
314 .if ${MK_MAIL} != "no"
315 cd ${.CURDIR}/mail; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
316 ${ETCMAIL} ${DESTDIR}/etc/mail
317 if [ -d ${DESTDIR}/etc/mail -a -f ${DESTDIR}/etc/mail/aliases -a \
318 ! -f ${DESTDIR}/etc/aliases ]; then \
319 ln -s mail/aliases ${DESTDIR}/etc/aliases; \
322 ${INSTALL} -o ${BINOWN} -g operator -m 664 /dev/null \
323 ${DESTDIR}/etc/dumpdates
324 .if ${MK_LOCATE} != "no"
325 ${INSTALL} -o nobody -g ${BINGRP} -m 644 /dev/null \
326 ${DESTDIR}/var/db/locate.database
328 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 ${.CURDIR}/minfree \
330 cd ${.CURDIR}/..; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
331 ${FREEBSD} ${DESTDIR}/
332 .if ${MK_BOOT} != "no"
333 .if exists(${.CURDIR}/../sys/${MACHINE}/conf/GENERIC.hints)
334 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
335 ${.CURDIR}/../sys/${MACHINE}/conf/GENERIC.hints \
336 ${DESTDIR}/boot/device.hints
339 .if ${MK_NIS} == "no"
340 sed -i "" -e 's/.*_compat:/# &/' -e 's/compat$$/files/' \
341 ${DESTDIR}/etc/nsswitch.conf
346 MTREES= mtree/BSD.root.dist / \
347 mtree/BSD.var.dist /var \
348 mtree/BSD.usr.dist /usr \
349 mtree/BSD.include.dist /usr/include
350 .if ${MK_DEBUG_FILES} != "no"
351 MTREES+= mtree/BSD.debug.dist /usr/lib
353 .if ${MK_GROFF} != "no"
354 MTREES+= mtree/BSD.groff.dist /usr
356 .if ${MK_TESTS} != "no"
357 MTREES+= mtree/BSD.tests.dist ${TESTSBASE}
359 .if ${MK_SENDMAIL} != "no"
360 MTREES+= mtree/BSD.sendmail.dist /
362 .for mtree in ${LOCAL_MTREE}
363 MTREES+= ../${mtree} /
366 distrib-dirs: ${MTREES:N/*}
368 while test $$# -ge 2; do \
373 test -d $$d || mkdir -p $$d; \
374 ${ECHO} ${MTREE_CMD} -deU ${MTREE_FOLLOWS_SYMLINKS} \
376 ${MTREE_CMD} -deU ${MTREE_FOLLOWS_SYMLINKS} -f $$m -p $$d; \
380 while test $$# -ge 2; do \
384 test "$$d" == "/" && d=""; \
387 test -d $$d || mkdir -p $$d; \
388 ${ECHO} "${MTREE_CMD:N-W} -C -f $$m -K uname,gname | " \
389 "sed s#^\.#.$$d# | ${METALOG.add}" ; \
390 ${MTREE_CMD:N-W} -C -f $$m -K uname,gname | sed s#^\.#.$$d# | \
394 ${INSTALL_SYMLINK} usr/src/sys ${DESTDIR}/sys
395 .if ${MK_MAN} != "no"
396 cd ${DESTDIR}/usr/share/man; \
397 for mandir in man*; do \
398 ${INSTALL_SYMLINK} ../$$mandir \
399 ${DESTDIR}/usr/share/man/en.ISO8859-1/; \
400 ${INSTALL_SYMLINK} ../$$mandir \
401 ${DESTDIR}/usr/share/man/en.UTF-8/; \
403 .if ${MK_OPENSSL} != "no"
404 cd ${DESTDIR}/usr/share/openssl/man; \
405 for mandir in man*; do \
406 ${INSTALL_SYMLINK} ../$$mandir \
407 ${DESTDIR}/usr/share/openssl/man/en.ISO8859-1/; \
410 set - `grep "^[a-zA-Z]" ${.CURDIR}/man.alias`; \
411 while [ $$# -gt 0 ] ; do \
412 ${INSTALL_SYMLINK} "$$2" "${DESTDIR}/usr/share/man/$$1"; \
413 if [ "${MK_OPENSSL}" != "no" ]; then \
414 ${INSTALL_SYMLINK} "$$2" \
415 "${DESTDIR}/usr/share/openssl/man/$$1"; \
420 .if ${MK_NLS} != "no"
421 set - `grep "^[a-zA-Z]" ${.CURDIR}/nls.alias`; \
422 while [ $$# -gt 0 ] ; do \
423 ${INSTALL_SYMLINK} "$$2" "${DESTDIR}/usr/share/nls/$$1"; \
429 cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
430 ${BIN1} ${BIN2} nsmb.conf opieaccess \
431 ${DESTDIR}/usr/share/examples/etc
432 ${_+_}cd ${.CURDIR}/defaults; ${MAKE} install \
433 DESTDIR=${DESTDIR}/usr/share/examples
435 .include <bsd.prog.mk>