1 # from: @(#)Makefile 5.11 (Berkeley) 5/21/91
6 .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_BSNMP} != "no"
89 .if ${MK_FREEBSD_UPDATE} != "no"
90 BIN1+= freebsd-update.conf
93 .if ${MK_LOCATE} != "no"
94 BIN1+= ${.CURDIR}/../usr.bin/locate/locate/locate.rc
98 BIN1+= hosts.lpd printcap
101 .if ${MK_MAIL} != "no"
102 BIN1+= ${.CURDIR}/../usr.bin/mail/misc/mail.rc
105 .if ${MK_NTP} != "no"
109 .if ${MK_OPENSSH} != "no"
110 SSH= ${.CURDIR}/../crypto/openssh/ssh_config \
111 ${.CURDIR}/../crypto/openssh/sshd_config \
112 ${.CURDIR}/../crypto/openssh/moduli
114 .if ${MK_OPENSSL} != "no"
115 SSL= ${.CURDIR}/../crypto/openssl/apps/openssl.cnf
118 .if ${MK_NS_CACHING} != "no"
122 .if ${MK_PORTSNAP} != "no"
130 .if ${MK_TCSH} != "no"
131 BIN1+= csh.cshrc csh.login csh.logout
134 .if ${MK_WIRELESS} != "no"
138 # -rwxr-xr-x root:wheel, for the new cron root:wheel
139 BIN2= netstart pccard_ether rc.suspend rc.resume
141 MTREE= BSD.include.dist BSD.root.dist BSD.usr.dist BSD.var.dist
142 .if ${MK_SENDMAIL} != "no"
143 MTREE+= BSD.sendmail.dist
145 .if ${MK_DEBUG_FILES} != "no"
146 MTREE+= BSD.debug.dist
151 .if ${MK_SENDMAIL} == "no"
152 ETCMAIL=mailer.conf aliases
154 ETCMAIL=Makefile README mailer.conf access.sample virtusertable.sample \
155 mailertable.sample aliases
158 # Special top level files for FreeBSD
162 DESTDIR:= ${DESTDIR:C://*:/:g}
165 .if ${MK_MAN} != "no"
166 ${_+_}cd ${.CURDIR}/../share/man; ${MAKE} makedb
170 ${_+_}cd ${.CURDIR} ; ${MAKE} install DESTDIR=${DISTDIR}/${DISTRIBUTION}
171 ${_+_}cd ${.CURDIR} ; ${MAKE} distribution DESTDIR=${DISTDIR}/${DISTRIBUTION}
173 .include <bsd.endian.mk>
174 .if ${TARGET_ENDIANNESS} == "1234"
177 .elif ${TARGET_ENDIANNESS} == "4321"
186 METALOG.add?= cat -l >> ${METALOG}
190 .if !defined(DESTDIR)
191 @echo "set DESTDIR before running \"make ${.TARGET}\""
195 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
196 ${BIN1} ${DESTDIR}/etc; \
197 cap_mkdb ${CAP_MKDB_ENDIAN} ${DESTDIR}/etc/login.conf; \
198 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 755 \
199 ${BIN2} ${DESTDIR}/etc; \
200 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 600 \
201 master.passwd nsmb.conf opieaccess ${DESTDIR}/etc;
203 sed -i "" -e 's;.*/usr/libexec/atrun;#&;' ${DESTDIR}/etc/crontab
205 .if ${MK_TCSH} == "no"
206 sed -i "" -e 's;/bin/csh;/bin/sh;' ${DESTDIR}/etc/master.passwd
208 pwd_mkdb ${PWD_MKDB_ENDIAN} -i -p -d ${DESTDIR}/etc \
209 ${DESTDIR}/etc/master.passwd
212 echo "./etc/login.conf.db type=file mode=0644 uname=root gname=wheel"; \
213 echo "./etc/passwd type=file mode=0644 uname=root gname=wheel"; \
214 echo "./etc/pwd.db type=file mode=0644 uname=root gname=wheel"; \
215 echo "./etc/spwd.db type=file mode=0600 uname=root gname=wheel"; \
218 .if ${MK_BLUETOOTH} != "no"
219 ${_+_}cd ${.CURDIR}/bluetooth; ${MAKE} install
221 ${_+_}cd ${.CURDIR}/defaults; ${MAKE} install
222 ${_+_}cd ${.CURDIR}/devd; ${MAKE} install
223 ${_+_}cd ${.CURDIR}/gss; ${MAKE} install
224 ${_+_}cd ${.CURDIR}/keys; ${MAKE} install
225 ${_+_}cd ${.CURDIR}/periodic; ${MAKE} install
226 .if ${MK_PKGBOOTSTRAP} != "no"
227 ${_+_}cd ${.CURDIR}/pkg; ${MAKE} install
229 ${_+_}cd ${.CURDIR}/rc.d; ${MAKE} install
230 ${_+_}cd ${.CURDIR}/../gnu/usr.bin/send-pr; ${MAKE} etc-gnats-freefall
231 ${_+_}cd ${.CURDIR}/../share/termcap; ${MAKE} etc-termcap
232 ${_+_}cd ${.CURDIR}/../usr.sbin/rmt; ${MAKE} etc-rmt
233 ${_+_}cd ${.CURDIR}/pam.d; ${MAKE} install
234 cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 0444 \
235 ${BSM_ETC_OPEN_FILES} ${BSM_ETC_DIR}
236 cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 0600 \
237 ${BSM_ETC_RESTRICTED_FILES} ${BSM_ETC_DIR}
238 cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 0500 \
239 ${BSM_ETC_EXEC_FILES} ${BSM_ETC_DIR}
240 .if ${MK_UNBOUND} != "no"
241 if [ ! -e ${DESTDIR}/etc/unbound ]; then \
242 ${INSTALL_SYMLINK} ../var/unbound ${DESTDIR}/etc/unbound; \
245 .if ${MK_SENDMAIL} != "no"
246 ${_+_}cd ${.CURDIR}/sendmail; ${MAKE} distribution
248 .if ${MK_OPENSSH} != "no"
249 cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
250 ${SSH} ${DESTDIR}/etc/ssh
252 .if ${MK_OPENSSL} != "no"
253 cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
254 ${SSL} ${DESTDIR}/etc/ssl
256 .if ${MK_KERBEROS} != "no"
257 cd ${.CURDIR}/root; \
258 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
259 dot.k5login ${DESTDIR}/root/.k5login;
261 cd ${.CURDIR}/root; \
262 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
263 dot.profile ${DESTDIR}/root/.profile; \
264 rm -f ${DESTDIR}/.profile; \
265 ln ${DESTDIR}/root/.profile ${DESTDIR}/.profile
266 .if ${MK_TCSH} != "no"
267 cd ${.CURDIR}/root; \
268 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
269 dot.cshrc ${DESTDIR}/root/.cshrc; \
270 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
271 dot.login ${DESTDIR}/root/.login; \
272 rm -f ${DESTDIR}/.cshrc; \
273 ln ${DESTDIR}/root/.cshrc ${DESTDIR}/.cshrc
275 cd ${.CURDIR}/mtree; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
276 ${MTREE} ${DESTDIR}/etc/mtree
277 .if ${MK_PPP} != "no"
278 cd ${.CURDIR}/ppp; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 600 \
279 ${PPPCNF} ${DESTDIR}/etc/ppp
281 .if ${MK_MAIL} != "no"
282 cd ${.CURDIR}/mail; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
283 ${ETCMAIL} ${DESTDIR}/etc/mail
284 if [ -d ${DESTDIR}/etc/mail -a -f ${DESTDIR}/etc/mail/aliases -a \
285 ! -f ${DESTDIR}/etc/aliases ]; then \
286 ln -s mail/aliases ${DESTDIR}/etc/aliases; \
289 ${INSTALL} -o ${BINOWN} -g operator -m 664 /dev/null \
290 ${DESTDIR}/etc/dumpdates
291 ${INSTALL} -o nobody -g ${BINGRP} -m 644 /dev/null \
292 ${DESTDIR}/var/db/locate.database
293 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 ${.CURDIR}/minfree \
295 cd ${.CURDIR}/..; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
296 ${FREEBSD} ${DESTDIR}/
297 .if ${MK_BOOT} != "no"
298 .if exists(${.CURDIR}/../sys/${MACHINE}/conf/GENERIC.hints)
299 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
300 ${.CURDIR}/../sys/${MACHINE}/conf/GENERIC.hints \
301 ${DESTDIR}/boot/device.hints
304 .if ${MK_NIS} == "no"
305 sed -i "" -e 's/.*_compat:/# &/' -e 's/compat$$/files/' \
306 ${DESTDIR}/etc/nsswitch.conf
311 MTREES= mtree/BSD.root.dist / \
312 mtree/BSD.var.dist /var \
313 mtree/BSD.usr.dist /usr \
314 mtree/BSD.include.dist /usr/include
315 .if ${MK_DEBUG_FILES} != "no"
316 MTREES+= mtree/BSD.debug.dist /usr/lib
318 .if ${MK_GROFF} != "no"
319 MTREES+= mtree/BSD.groff.dist /usr
321 .if ${MK_SENDMAIL} != "no"
322 MTREES+= mtree/BSD.sendmail.dist /
324 .for mtree in ${LOCAL_MTREE}
325 MTREES+= ../${mtree} /
328 distrib-dirs: ${MTREES:N/*}
330 while test $$# -ge 2; do \
335 ${ECHO} ${MTREE_CMD} -deU ${MTREE_FOLLOWS_SYMLINKS} \
337 ${MTREE_CMD} -deU ${MTREE_FOLLOWS_SYMLINKS} -f $$m -p $$d; \
341 while test $$# -ge 2; do \
345 test "$$d" == "/" && d=""; \
348 ${ECHO} "${MTREE_CMD:N-W} -C -f $$m -K uname,gname | " \
349 "sed s#^\.#.$$d# | ${METALOG.add}" ; \
350 ${MTREE_CMD:N-W} -C -f $$m -K uname,gname | sed s#^\.#.$$d# | \
354 ${INSTALL_SYMLINK} usr/src/sys ${DESTDIR}/sys
355 cd ${DESTDIR}/usr/share/man; \
356 for mandir in man*; do \
357 ${INSTALL_SYMLINK} ../$$mandir \
358 ${DESTDIR}/usr/share/man/en.ISO8859-1/; \
359 ${INSTALL_SYMLINK} ../$$mandir \
360 ${DESTDIR}/usr/share/man/en.UTF-8/; \
362 cd ${DESTDIR}/usr/share/openssl/man; \
363 for mandir in man*; do \
364 ${INSTALL_SYMLINK} ../$$mandir \
365 ${DESTDIR}/usr/share/openssl/man/en.ISO8859-1/; \
367 set - `grep "^[a-zA-Z]" ${.CURDIR}/man.alias`; \
368 while [ $$# -gt 0 ] ; do \
369 ${INSTALL_SYMLINK} "$$2" "${DESTDIR}/usr/share/man/$$1"; \
370 ${INSTALL_SYMLINK} "$$2" \
371 "${DESTDIR}/usr/share/openssl/man/$$1"; \
374 set - `grep "^[a-zA-Z]" ${.CURDIR}/nls.alias`; \
375 while [ $$# -gt 0 ] ; do \
376 ${INSTALL_SYMLINK} "$$2" "${DESTDIR}/usr/share/nls/$$1"; \
381 cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
382 ${BIN1} ${BIN2} nsmb.conf opieaccess \
383 ${DESTDIR}/usr/share/examples/etc
384 ${_+_}cd ${.CURDIR}/defaults; ${MAKE} install \
385 DESTDIR=${DESTDIR}/usr/share/examples
387 .include <bsd.prog.mk>