1 # from: @(#)Makefile 5.11 (Berkeley) 5/21/91
9 .if ${MK_SENDMAIL} != "no"
53 .if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "powerpc64"
57 .if exists(${.CURDIR}/etc.${MACHINE}/ttys)
58 BIN1+= etc.${MACHINE}/ttys
59 .elif exists(${.CURDIR}/etc.${MACHINE_ARCH}/ttys)
60 BIN1+= etc.${MACHINE_ARCH}/ttys
61 .elif exists(${.CURDIR}/etc.${MACHINE_CPUARCH}/ttys)
62 BIN1+= etc.${MACHINE_CPUARCH}/ttys
64 .error etc.MACHINE/ttys missing
67 OPENBSMDIR= ${.CURDIR}/../contrib/openbsm
68 BSM_ETC_OPEN_FILES= ${OPENBSMDIR}/etc/audit_class \
69 ${OPENBSMDIR}/etc/audit_event
70 BSM_ETC_RESTRICTED_FILES= ${OPENBSMDIR}/etc/audit_control \
71 ${OPENBSMDIR}/etc/audit_user
72 BSM_ETC_EXEC_FILES= ${OPENBSMDIR}/etc/audit_warn
73 BSM_ETC_DIR= ${DESTDIR}/etc/security
75 # NB: keep these sorted by MK_* knobs
85 .if ${MK_AUTOFS} != "no"
89 .if ${MK_FREEBSD_UPDATE} != "no"
90 BIN1+= freebsd-update.conf
97 .if ${MK_INETD} != "no"
101 .if ${MK_LOCATE} != "no"
102 BIN1+= ${.CURDIR}/../usr.bin/locate/locate/locate.rc
105 .if ${MK_LPR} != "no"
106 BIN1+= hosts.lpd printcap
109 .if ${MK_MAIL} != "no"
110 BIN1+= ${.CURDIR}/../usr.bin/mail/misc/mail.rc
113 .if ${MK_NTP} != "no"
117 .if ${MK_OPENSSH} != "no"
118 SSH= ${.CURDIR}/../crypto/openssh/ssh_config \
119 ${.CURDIR}/../crypto/openssh/sshd_config \
120 ${.CURDIR}/../crypto/openssh/moduli
122 .if ${MK_OPENSSL} != "no"
123 SSL= ${.CURDIR}/../crypto/openssl/apps/openssl.cnf
126 .if ${MK_NS_CACHING} != "no"
130 .if ${MK_PORTSNAP} != "no"
138 .if ${MK_SENDMAIL} != "no"
142 .if ${MK_TCSH} != "no"
143 BIN1+= csh.cshrc csh.login csh.logout
146 .if ${MK_WIRELESS} != "no"
150 # -rwxr-xr-x root:wheel, for the new cron root:wheel
151 BIN2= netstart pccard_ether rc.suspend rc.resume
153 MTREE= BSD.debug.dist BSD.include.dist BSD.root.dist BSD.usr.dist BSD.var.dist
154 .if ${MK_TESTS} != "no"
155 MTREE+= BSD.tests.dist
157 .if ${MK_SENDMAIL} != "no"
158 MTREE+= BSD.sendmail.dist
163 .if ${MK_SENDMAIL} == "no"
164 ETCMAIL=mailer.conf aliases
166 ETCMAIL=Makefile README mailer.conf access.sample virtusertable.sample \
167 mailertable.sample aliases
170 # Special top level files for FreeBSD
174 DESTDIR:= ${DESTDIR:C://*:/:g}
177 .if ${MK_MAN} != "no"
178 ${_+_}cd ${.CURDIR}/../share/man; ${MAKE} makedb
182 # Avoid installing tests here; "make distribution" will do this and
183 # correctly place them in the right location.
184 ${_+_}cd ${.CURDIR} ; ${MAKE} -DNO_TESTS install \
185 DESTDIR=${DISTDIR}/${DISTRIBUTION}
186 ${_+_}cd ${.CURDIR} ; ${MAKE} distribution DESTDIR=${DISTDIR}/${DISTRIBUTION}
188 .include <bsd.endian.mk>
189 .if ${TARGET_ENDIANNESS} == "1234"
192 .elif ${TARGET_ENDIANNESS} == "4321"
201 METALOG.add?= cat -l >> ${METALOG}
205 .if !defined(DESTDIR)
206 @echo "set DESTDIR before running \"make ${.TARGET}\""
210 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
211 ${BIN1} ${DESTDIR}/etc; \
212 cap_mkdb ${CAP_MKDB_ENDIAN} ${DESTDIR}/etc/login.conf; \
213 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 755 \
214 ${BIN2} ${DESTDIR}/etc; \
215 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 600 \
216 master.passwd nsmb.conf opieaccess ${DESTDIR}/etc;
217 .if ${MK_BSNMP} != "no"
219 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 600 \
220 snmpd.config ${DESTDIR}/etc;
223 sed -i "" -e 's;.*/usr/libexec/atrun;#&;' ${DESTDIR}/etc/crontab
225 .if ${MK_TCSH} == "no"
226 sed -i "" -e 's;/bin/csh;/bin/sh;' ${DESTDIR}/etc/master.passwd
228 pwd_mkdb ${PWD_MKDB_ENDIAN} -i -p -d ${DESTDIR}/etc \
229 ${DESTDIR}/etc/master.passwd
232 echo "./etc/login.conf.db type=file mode=0644 uname=root gname=wheel"; \
233 echo "./etc/passwd type=file mode=0644 uname=root gname=wheel"; \
234 echo "./etc/pwd.db type=file mode=0644 uname=root gname=wheel"; \
235 echo "./etc/spwd.db type=file mode=0600 uname=root gname=wheel"; \
238 .if ${MK_AUTOFS} != "no"
239 ${_+_}cd ${.CURDIR}/autofs; ${MAKE} install
241 .if ${MK_BLUETOOTH} != "no"
242 ${_+_}cd ${.CURDIR}/bluetooth; ${MAKE} install
244 ${_+_}cd ${.CURDIR}/defaults; ${MAKE} install
245 ${_+_}cd ${.CURDIR}/devd; ${MAKE} install
246 ${_+_}cd ${.CURDIR}/gss; ${MAKE} install
247 ${_+_}cd ${.CURDIR}/periodic; ${MAKE} install
248 .if ${MK_PKGBOOTSTRAP} != "no"
249 ${_+_}cd ${.CURDIR}/pkg; ${MAKE} install
251 ${_+_}cd ${.CURDIR}/rc.d; ${MAKE} install
252 ${_+_}cd ${.CURDIR}/../share/termcap; ${MAKE} etc-termcap
253 ${_+_}cd ${.CURDIR}/../usr.sbin/rmt; ${MAKE} etc-rmt
254 ${_+_}cd ${.CURDIR}/pam.d; ${MAKE} install
255 cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 0444 \
256 ${BSM_ETC_OPEN_FILES} ${BSM_ETC_DIR}
257 cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 0600 \
258 ${BSM_ETC_RESTRICTED_FILES} ${BSM_ETC_DIR}
259 cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 0500 \
260 ${BSM_ETC_EXEC_FILES} ${BSM_ETC_DIR}
261 .if ${MK_UNBOUND} != "no"
262 if [ ! -e ${DESTDIR}/etc/unbound ]; then \
263 ${INSTALL_SYMLINK} ../var/unbound ${DESTDIR}/etc/unbound; \
266 .if ${MK_SENDMAIL} != "no"
267 ${_+_}cd ${.CURDIR}/sendmail; ${MAKE} distribution
269 .if ${MK_OPENSSH} != "no"
270 cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
271 ${SSH} ${DESTDIR}/etc/ssh
273 .if ${MK_OPENSSL} != "no"
274 cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
275 ${SSL} ${DESTDIR}/etc/ssl
277 .if ${MK_KERBEROS} != "no"
278 cd ${.CURDIR}/root; \
279 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
280 dot.k5login ${DESTDIR}/root/.k5login;
282 cd ${.CURDIR}/root; \
283 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
284 dot.profile ${DESTDIR}/root/.profile; \
285 rm -f ${DESTDIR}/.profile; \
286 ln ${DESTDIR}/root/.profile ${DESTDIR}/.profile
287 .if ${MK_TCSH} != "no"
288 cd ${.CURDIR}/root; \
289 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
290 dot.cshrc ${DESTDIR}/root/.cshrc; \
291 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
292 dot.login ${DESTDIR}/root/.login; \
293 rm -f ${DESTDIR}/.cshrc; \
294 ln ${DESTDIR}/root/.cshrc ${DESTDIR}/.cshrc
296 cd ${.CURDIR}/mtree; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
297 ${MTREE} ${DESTDIR}/etc/mtree
298 .if ${MK_PPP} != "no"
299 cd ${.CURDIR}/ppp; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 600 \
300 ${PPPCNF} ${DESTDIR}/etc/ppp
302 .if ${MK_MAIL} != "no"
303 cd ${.CURDIR}/mail; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
304 ${ETCMAIL} ${DESTDIR}/etc/mail
305 if [ -d ${DESTDIR}/etc/mail -a -f ${DESTDIR}/etc/mail/aliases -a \
306 ! -f ${DESTDIR}/etc/aliases ]; then \
307 ln -s mail/aliases ${DESTDIR}/etc/aliases; \
310 ${INSTALL} -o ${BINOWN} -g operator -m 664 /dev/null \
311 ${DESTDIR}/etc/dumpdates
312 .if ${MK_LOCATE} != "no"
313 ${INSTALL} -o nobody -g ${BINGRP} -m 644 /dev/null \
314 ${DESTDIR}/var/db/locate.database
316 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 ${.CURDIR}/minfree \
318 cd ${.CURDIR}/..; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
319 ${FREEBSD} ${DESTDIR}/
320 .if ${MK_BOOT} != "no"
321 .if exists(${.CURDIR}/../sys/${MACHINE}/conf/GENERIC.hints)
322 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
323 ${.CURDIR}/../sys/${MACHINE}/conf/GENERIC.hints \
324 ${DESTDIR}/boot/device.hints
327 .if ${MK_NIS} == "no"
328 sed -i "" -e 's/.*_compat:/# &/' -e 's/compat$$/files/' \
329 ${DESTDIR}/etc/nsswitch.conf
334 MTREES= mtree/BSD.root.dist / \
335 mtree/BSD.var.dist /var \
336 mtree/BSD.usr.dist /usr \
337 mtree/BSD.include.dist /usr/include \
338 mtree/BSD.debug.dist /usr/lib
339 .if ${MK_GROFF} != "no"
340 MTREES+= mtree/BSD.groff.dist /usr
342 .if ${MK_TESTS} != "no"
343 MTREES+= mtree/BSD.tests.dist ${TESTSBASE}
345 .if ${MK_SENDMAIL} != "no"
346 MTREES+= mtree/BSD.sendmail.dist /
348 .for mtree in ${LOCAL_MTREE}
349 MTREES+= ../${mtree} /
352 distrib-dirs: ${MTREES:N/*}
354 while test $$# -ge 2; do \
359 test -d $$d || mkdir -p $$d; \
360 ${ECHO} ${MTREE_CMD} -deU ${MTREE_FOLLOWS_SYMLINKS} \
362 ${MTREE_CMD} -deU ${MTREE_FOLLOWS_SYMLINKS} -f $$m -p $$d; \
366 while test $$# -ge 2; do \
370 test "$$d" == "/" && d=""; \
373 test -d $$d || mkdir -p $$d; \
374 ${ECHO} "${MTREE_CMD:N-W} -C -f $$m -K uname,gname | " \
375 "sed s#^\.#.$$d# | ${METALOG.add}" ; \
376 ${MTREE_CMD:N-W} -C -f $$m -K uname,gname | sed s#^\.#.$$d# | \
380 ${INSTALL_SYMLINK} usr/src/sys ${DESTDIR}/sys
381 .if ${MK_MAN} != "no"
382 cd ${DESTDIR}${SHAREDIR}/man; \
383 for mandir in man*; do \
384 ${INSTALL_SYMLINK} ../$$mandir \
385 ${DESTDIR}${SHAREDIR}/man/en.ISO8859-1/; \
386 ${INSTALL_SYMLINK} ../$$mandir \
387 ${DESTDIR}${SHAREDIR}/man/en.UTF-8/; \
389 .if ${MK_OPENSSL} != "no"
390 cd ${DESTDIR}${SHAREDIR}/openssl/man; \
391 for mandir in man*; do \
392 ${INSTALL_SYMLINK} ../$$mandir \
393 ${DESTDIR}${SHAREDIR}/openssl/man/en.ISO8859-1/; \
396 set - `grep "^[a-zA-Z]" ${.CURDIR}/man.alias`; \
397 while [ $$# -gt 0 ] ; do \
398 ${INSTALL_SYMLINK} "$$2" "${DESTDIR}${SHAREDIR}/man/$$1"; \
399 if [ "${MK_OPENSSL}" != "no" ]; then \
400 ${INSTALL_SYMLINK} "$$2" \
401 "${DESTDIR}${SHAREDIR}/openssl/man/$$1"; \
406 .if ${MK_NLS} != "no"
407 set - `grep "^[a-zA-Z]" ${.CURDIR}/nls.alias`; \
408 while [ $$# -gt 0 ] ; do \
409 ${INSTALL_SYMLINK} "$$2" "${DESTDIR}${SHAREDIR}/nls/$$1"; \
415 cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
416 ${BIN1} ${BIN2} nsmb.conf opieaccess \
417 ${DESTDIR}${SHAREDIR}/examples/etc
418 ${_+_}cd ${.CURDIR}/defaults; ${MAKE} install \
419 DESTDIR=${DESTDIR}${SHAREDIR}/examples
421 .include <bsd.prog.mk>