1 # from: @(#)Makefile 5.11 (Berkeley) 5/21/91
6 .if ${MK_SENDMAIL} != "no"
50 .if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "powerpc64"
54 .if exists(${.CURDIR}/etc.${MACHINE}/ttys)
55 BIN1+= etc.${MACHINE}/ttys
56 .elif exists(${.CURDIR}/etc.${MACHINE_ARCH}/ttys)
57 BIN1+= etc.${MACHINE_ARCH}/ttys
58 .elif exists(${.CURDIR}/etc.${MACHINE_CPUARCH}/ttys)
59 BIN1+= etc.${MACHINE_CPUARCH}/ttys
61 .error etc.MACHINE/ttys missing
64 OPENBSMDIR= ${.CURDIR}/../contrib/openbsm
65 BSM_ETC_OPEN_FILES= ${OPENBSMDIR}/etc/audit_class \
66 ${OPENBSMDIR}/etc/audit_event
67 BSM_ETC_RESTRICTED_FILES= ${OPENBSMDIR}/etc/audit_control \
68 ${OPENBSMDIR}/etc/audit_user
69 BSM_ETC_EXEC_FILES= ${OPENBSMDIR}/etc/audit_warn
70 BSM_ETC_DIR= ${DESTDIR}/etc/security
72 # NB: keep these sorted by MK_* knobs
82 .if ${MK_AUTOFS} != "no"
86 .if ${MK_FREEBSD_UPDATE} != "no"
87 BIN1+= freebsd-update.conf
94 .if ${MK_INETD} != "no"
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_SENDMAIL} != "no"
139 .if ${MK_TCSH} != "no"
140 BIN1+= csh.cshrc csh.login csh.logout
143 .if ${MK_WIRELESS} != "no"
147 # -rwxr-xr-x root:wheel, for the new cron root:wheel
148 BIN2= netstart pccard_ether rc.suspend rc.resume
150 MTREE= BSD.debug.dist BSD.include.dist BSD.root.dist BSD.usr.dist BSD.var.dist
151 .if ${MK_TESTS} != "no"
152 MTREE+= BSD.tests.dist
154 .if ${MK_SENDMAIL} != "no"
155 MTREE+= BSD.sendmail.dist
160 .if ${MK_SENDMAIL} == "no"
161 ETCMAIL=mailer.conf aliases
163 ETCMAIL=Makefile README mailer.conf access.sample virtusertable.sample \
164 mailertable.sample aliases
167 # Special top level files for FreeBSD
171 DESTDIR:= ${DESTDIR:C://*:/:g}
174 .if ${MK_MAN} != "no"
175 ${_+_}cd ${.CURDIR}/../share/man; ${MAKE} makedb
179 # Avoid installing tests here; "make distribution" will do this and
180 # correctly place them in the right location.
181 ${_+_}cd ${.CURDIR} ; ${MAKE} -DNO_TESTS install \
182 DESTDIR=${DISTDIR}/${DISTRIBUTION}
183 ${_+_}cd ${.CURDIR} ; ${MAKE} distribution DESTDIR=${DISTDIR}/${DISTRIBUTION}
185 .include <bsd.endian.mk>
186 .if ${TARGET_ENDIANNESS} == "1234"
189 .elif ${TARGET_ENDIANNESS} == "4321"
198 METALOG.add?= cat -l >> ${METALOG}
202 .if !defined(DESTDIR)
203 @echo "set DESTDIR before running \"make ${.TARGET}\""
207 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
208 ${BIN1} ${DESTDIR}/etc; \
209 cap_mkdb ${CAP_MKDB_ENDIAN} ${DESTDIR}/etc/login.conf; \
210 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 755 \
211 ${BIN2} ${DESTDIR}/etc; \
212 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 600 \
213 master.passwd nsmb.conf opieaccess ${DESTDIR}/etc;
214 .if ${MK_BSNMP} != "no"
216 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 600 \
217 snmpd.config ${DESTDIR}/etc;
220 sed -i "" -e 's;.*/usr/libexec/atrun;#&;' ${DESTDIR}/etc/crontab
222 .if ${MK_TCSH} == "no"
223 sed -i "" -e 's;/bin/csh;/bin/sh;' ${DESTDIR}/etc/master.passwd
225 pwd_mkdb ${PWD_MKDB_ENDIAN} -i -p -d ${DESTDIR}/etc \
226 ${DESTDIR}/etc/master.passwd
229 echo "./etc/login.conf.db type=file mode=0644 uname=root gname=wheel"; \
230 echo "./etc/passwd type=file mode=0644 uname=root gname=wheel"; \
231 echo "./etc/pwd.db type=file mode=0644 uname=root gname=wheel"; \
232 echo "./etc/spwd.db type=file mode=0600 uname=root gname=wheel"; \
235 .if ${MK_AUTOFS} != "no"
236 ${_+_}cd ${.CURDIR}/autofs; ${MAKE} install
238 .if ${MK_BLUETOOTH} != "no"
239 ${_+_}cd ${.CURDIR}/bluetooth; ${MAKE} install
241 ${_+_}cd ${.CURDIR}/cron.d; ${MAKE} install
242 ${_+_}cd ${.CURDIR}/defaults; ${MAKE} install
243 ${_+_}cd ${.CURDIR}/devd; ${MAKE} install
244 ${_+_}cd ${.CURDIR}/gss; ${MAKE} install
245 ${_+_}cd ${.CURDIR}/newsyslog.conf.d; ${MAKE} install
246 .if ${MK_NTP} != "no"
247 ${_+_}cd ${.CURDIR}/ntp; ${MAKE} install
249 ${_+_}cd ${.CURDIR}/periodic; ${MAKE} install
250 .if ${MK_PKGBOOTSTRAP} != "no"
251 ${_+_}cd ${.CURDIR}/pkg; ${MAKE} install
253 ${_+_}cd ${.CURDIR}/rc.d; ${MAKE} install
254 ${_+_}cd ${.CURDIR}/../share/termcap; ${MAKE} etc-termcap
255 ${_+_}cd ${.CURDIR}/syslog.d; ${MAKE} install
256 ${_+_}cd ${.CURDIR}/../usr.sbin/rmt; ${MAKE} etc-rmt
257 ${_+_}cd ${.CURDIR}/pam.d; ${MAKE} install
258 cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 0444 \
259 ${BSM_ETC_OPEN_FILES} ${BSM_ETC_DIR}
260 cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 0600 \
261 ${BSM_ETC_RESTRICTED_FILES} ${BSM_ETC_DIR}
262 cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 0500 \
263 ${BSM_ETC_EXEC_FILES} ${BSM_ETC_DIR}
264 .if ${MK_UNBOUND} != "no"
265 if [ ! -e ${DESTDIR}/etc/unbound ]; then \
266 ${INSTALL_SYMLINK} ../var/unbound ${DESTDIR}/etc/unbound; \
269 .if ${MK_SENDMAIL} != "no"
270 ${_+_}cd ${.CURDIR}/sendmail; ${MAKE} distribution
272 .if ${MK_OPENSSH} != "no"
273 cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
274 ${SSH} ${DESTDIR}/etc/ssh
276 .if ${MK_OPENSSL} != "no"
277 cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
278 ${SSL} ${DESTDIR}/etc/ssl
280 .if ${MK_KERBEROS} != "no"
281 cd ${.CURDIR}/root; \
282 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
283 dot.k5login ${DESTDIR}/root/.k5login;
285 cd ${.CURDIR}/root; \
286 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
287 dot.profile ${DESTDIR}/root/.profile; \
288 rm -f ${DESTDIR}/.profile; \
289 ln ${DESTDIR}/root/.profile ${DESTDIR}/.profile
290 .if ${MK_TCSH} != "no"
291 cd ${.CURDIR}/root; \
292 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
293 dot.cshrc ${DESTDIR}/root/.cshrc; \
294 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
295 dot.login ${DESTDIR}/root/.login; \
296 rm -f ${DESTDIR}/.cshrc; \
297 ln ${DESTDIR}/root/.cshrc ${DESTDIR}/.cshrc
299 cd ${.CURDIR}/mtree; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
300 ${MTREE} ${DESTDIR}/etc/mtree
301 .if ${MK_PPP} != "no"
302 cd ${.CURDIR}/ppp; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 600 \
303 ${PPPCNF} ${DESTDIR}/etc/ppp
305 .if ${MK_MAIL} != "no"
306 cd ${.CURDIR}/mail; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
307 ${ETCMAIL} ${DESTDIR}/etc/mail
308 if [ -d ${DESTDIR}/etc/mail -a -f ${DESTDIR}/etc/mail/aliases -a \
309 ! -f ${DESTDIR}/etc/aliases ]; then \
310 ln -s mail/aliases ${DESTDIR}/etc/aliases; \
313 ${INSTALL} -o ${BINOWN} -g operator -m 664 /dev/null \
314 ${DESTDIR}/etc/dumpdates
315 .if ${MK_LOCATE} != "no"
316 ${INSTALL} -o nobody -g ${BINGRP} -m 644 /dev/null \
317 ${DESTDIR}/var/db/locate.database
319 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 ${.CURDIR}/minfree \
321 cd ${.CURDIR}/..; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
322 ${FREEBSD} ${DESTDIR}/
323 .if ${MK_BOOT} != "no"
324 .if exists(${.CURDIR}/../sys/${MACHINE}/conf/GENERIC.hints)
325 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
326 ${.CURDIR}/../sys/${MACHINE}/conf/GENERIC.hints \
327 ${DESTDIR}/boot/device.hints
330 .if ${MK_NIS} == "no"
331 sed -i "" -e 's/.*_compat:/# &/' -e 's/compat$$/files/' \
332 ${DESTDIR}/etc/nsswitch.conf
337 MTREES= mtree/BSD.root.dist / \
338 mtree/BSD.var.dist /var \
339 mtree/BSD.usr.dist /usr \
340 mtree/BSD.include.dist /usr/include \
341 mtree/BSD.debug.dist /usr/lib
342 .if ${MK_GROFF} != "no"
343 MTREES+= mtree/BSD.groff.dist /usr
345 .if ${MK_TESTS} != "no"
346 MTREES+= mtree/BSD.tests.dist ${TESTSBASE}
348 .if ${MK_SENDMAIL} != "no"
349 MTREES+= mtree/BSD.sendmail.dist /
351 .for mtree in ${LOCAL_MTREE}
352 MTREES+= ../${mtree} /
355 distrib-dirs: ${MTREES:N/*}
357 while test $$# -ge 2; do \
362 test -d $$d || mkdir -p $$d; \
363 ${ECHO} ${MTREE_CMD} -deU ${MTREE_FOLLOWS_SYMLINKS} \
365 ${MTREE_CMD} -deU ${MTREE_FOLLOWS_SYMLINKS} -f $$m -p $$d; \
369 while test $$# -ge 2; do \
373 test "$$d" == "/" && d=""; \
376 test -d $$d || mkdir -p $$d; \
377 ${ECHO} "${MTREE_CMD:N-W} -C -f $$m -K uname,gname | " \
378 "sed s#^\.#.$$d# | ${METALOG.add}" ; \
379 ${MTREE_CMD:N-W} -C -f $$m -K uname,gname | sed s#^\.#.$$d# | \
383 ${INSTALL_SYMLINK} usr/src/sys ${DESTDIR}/sys
384 .if ${MK_MAN} != "no"
385 cd ${DESTDIR}${SHAREDIR}/man; \
386 for mandir in man*; do \
387 ${INSTALL_SYMLINK} ../$$mandir \
388 ${DESTDIR}${SHAREDIR}/man/en.ISO8859-1/; \
389 ${INSTALL_SYMLINK} ../$$mandir \
390 ${DESTDIR}${SHAREDIR}/man/en.UTF-8/; \
392 .if ${MK_OPENSSL} != "no"
393 cd ${DESTDIR}${SHAREDIR}/openssl/man; \
394 for mandir in man*; do \
395 ${INSTALL_SYMLINK} ../$$mandir \
396 ${DESTDIR}${SHAREDIR}/openssl/man/en.ISO8859-1/; \
399 set - `grep "^[a-zA-Z]" ${.CURDIR}/man.alias`; \
400 while [ $$# -gt 0 ] ; do \
401 ${INSTALL_SYMLINK} "$$2" "${DESTDIR}${SHAREDIR}/man/$$1"; \
402 if [ "${MK_OPENSSL}" != "no" ]; then \
403 ${INSTALL_SYMLINK} "$$2" \
404 "${DESTDIR}${SHAREDIR}/openssl/man/$$1"; \
409 .if ${MK_NLS} != "no"
410 set - `grep "^[a-zA-Z]" ${.CURDIR}/nls.alias`; \
411 while [ $$# -gt 0 ] ; do \
412 ${INSTALL_SYMLINK} "$$2" "${DESTDIR}${SHAREDIR}/nls/$$1"; \
418 cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
419 ${BIN1} ${BIN2} nsmb.conf opieaccess \
420 ${DESTDIR}${SHAREDIR}/examples/etc
421 ${_+_}cd ${.CURDIR}/defaults; ${MAKE} install \
422 DESTDIR=${DESTDIR}${SHAREDIR}/examples
424 .include <bsd.prog.mk>