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}/periodic; ${MAKE} install
225 .if ${MK_PKGBOOTSTRAP} != "no"
226 ${_+_}cd ${.CURDIR}/pkg; ${MAKE} install
228 ${_+_}cd ${.CURDIR}/rc.d; ${MAKE} install
229 ${_+_}cd ${.CURDIR}/../gnu/usr.bin/send-pr; ${MAKE} etc-gnats-freefall
230 ${_+_}cd ${.CURDIR}/../share/termcap; ${MAKE} etc-termcap
231 ${_+_}cd ${.CURDIR}/../usr.sbin/rmt; ${MAKE} etc-rmt
232 ${_+_}cd ${.CURDIR}/pam.d; ${MAKE} install
233 cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 0444 \
234 ${BSM_ETC_OPEN_FILES} ${BSM_ETC_DIR}
235 cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 0600 \
236 ${BSM_ETC_RESTRICTED_FILES} ${BSM_ETC_DIR}
237 cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 0500 \
238 ${BSM_ETC_EXEC_FILES} ${BSM_ETC_DIR}
239 .if ${MK_UNBOUND} != "no"
240 if [ ! -e ${DESTDIR}/etc/unbound ]; then \
241 ${INSTALL_SYMLINK} ../var/unbound ${DESTDIR}/etc/unbound; \
244 .if ${MK_SENDMAIL} != "no"
245 ${_+_}cd ${.CURDIR}/sendmail; ${MAKE} distribution
247 .if ${MK_OPENSSH} != "no"
248 cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
249 ${SSH} ${DESTDIR}/etc/ssh
251 .if ${MK_OPENSSL} != "no"
252 cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
253 ${SSL} ${DESTDIR}/etc/ssl
255 .if ${MK_KERBEROS} != "no"
256 cd ${.CURDIR}/root; \
257 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
258 dot.k5login ${DESTDIR}/root/.k5login;
260 cd ${.CURDIR}/root; \
261 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
262 dot.profile ${DESTDIR}/root/.profile; \
263 rm -f ${DESTDIR}/.profile; \
264 ln ${DESTDIR}/root/.profile ${DESTDIR}/.profile
265 .if ${MK_TCSH} != "no"
266 cd ${.CURDIR}/root; \
267 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
268 dot.cshrc ${DESTDIR}/root/.cshrc; \
269 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
270 dot.login ${DESTDIR}/root/.login; \
271 rm -f ${DESTDIR}/.cshrc; \
272 ln ${DESTDIR}/root/.cshrc ${DESTDIR}/.cshrc
274 cd ${.CURDIR}/mtree; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
275 ${MTREE} ${DESTDIR}/etc/mtree
276 .if ${MK_PPP} != "no"
277 cd ${.CURDIR}/ppp; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 600 \
278 ${PPPCNF} ${DESTDIR}/etc/ppp
280 .if ${MK_MAIL} != "no"
281 cd ${.CURDIR}/mail; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
282 ${ETCMAIL} ${DESTDIR}/etc/mail
283 if [ -d ${DESTDIR}/etc/mail -a -f ${DESTDIR}/etc/mail/aliases -a \
284 ! -f ${DESTDIR}/etc/aliases ]; then \
285 ln -s mail/aliases ${DESTDIR}/etc/aliases; \
288 ${INSTALL} -o ${BINOWN} -g operator -m 664 /dev/null \
289 ${DESTDIR}/etc/dumpdates
290 ${INSTALL} -o nobody -g ${BINGRP} -m 644 /dev/null \
291 ${DESTDIR}/var/db/locate.database
292 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 ${.CURDIR}/minfree \
294 cd ${.CURDIR}/..; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
295 ${FREEBSD} ${DESTDIR}/
296 .if ${MK_BOOT} != "no"
297 .if exists(${.CURDIR}/../sys/${MACHINE}/conf/GENERIC.hints)
298 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
299 ${.CURDIR}/../sys/${MACHINE}/conf/GENERIC.hints \
300 ${DESTDIR}/boot/device.hints
303 .if ${MK_NIS} == "no"
304 sed -i "" -e 's/.*_compat:/# &/' -e 's/compat$$/files/' \
305 ${DESTDIR}/etc/nsswitch.conf
310 MTREES= mtree/BSD.root.dist / \
311 mtree/BSD.var.dist /var \
312 mtree/BSD.usr.dist /usr \
313 mtree/BSD.include.dist /usr/include
314 .if ${MK_DEBUG_FILES} != "no"
315 MTREES+= mtree/BSD.debug.dist /usr/lib
317 .if ${MK_GROFF} != "no"
318 MTREES+= mtree/BSD.groff.dist /usr
320 .if ${MK_SENDMAIL} != "no"
321 MTREES+= mtree/BSD.sendmail.dist /
323 .for mtree in ${LOCAL_MTREE}
324 MTREES+= ../${mtree} /
327 distrib-dirs: ${MTREES:N/*}
329 while test $$# -ge 2; do \
334 ${ECHO} ${MTREE_CMD} -deU ${MTREE_FOLLOWS_SYMLINKS} \
336 ${MTREE_CMD} -deU ${MTREE_FOLLOWS_SYMLINKS} -f $$m -p $$d; \
340 while test $$# -ge 2; do \
344 test "$$d" == "/" && d=""; \
347 ${ECHO} "${MTREE_CMD:N-W} -C -f $$m -K uname,gname | " \
348 "sed s#^\.#.$$d# | ${METALOG.add}" ; \
349 ${MTREE_CMD:N-W} -C -f $$m -K uname,gname | sed s#^\.#.$$d# | \
353 ${INSTALL_SYMLINK} usr/src/sys ${DESTDIR}/sys
354 cd ${DESTDIR}/usr/share/man; \
355 for mandir in man*; do \
356 ${INSTALL_SYMLINK} ../$$mandir \
357 ${DESTDIR}/usr/share/man/en.ISO8859-1/; \
358 ${INSTALL_SYMLINK} ../$$mandir \
359 ${DESTDIR}/usr/share/man/en.UTF-8/; \
361 cd ${DESTDIR}/usr/share/openssl/man; \
362 for mandir in man*; do \
363 ${INSTALL_SYMLINK} ../$$mandir \
364 ${DESTDIR}/usr/share/openssl/man/en.ISO8859-1/; \
366 set - `grep "^[a-zA-Z]" ${.CURDIR}/man.alias`; \
367 while [ $$# -gt 0 ] ; do \
368 ${INSTALL_SYMLINK} "$$2" "${DESTDIR}/usr/share/man/$$1"; \
369 ${INSTALL_SYMLINK} "$$2" \
370 "${DESTDIR}/usr/share/openssl/man/$$1"; \
373 set - `grep "^[a-zA-Z]" ${.CURDIR}/nls.alias`; \
374 while [ $$# -gt 0 ] ; do \
375 ${INSTALL_SYMLINK} "$$2" "${DESTDIR}/usr/share/nls/$$1"; \
380 cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
381 ${BIN1} ${BIN2} nsmb.conf opieaccess \
382 ${DESTDIR}/usr/share/examples/etc
383 ${_+_}cd ${.CURDIR}/defaults; ${MAKE} install \
384 DESTDIR=${DESTDIR}/usr/share/examples
386 .include <bsd.prog.mk>