1 # from: @(#)Makefile 5.11 (Berkeley) 5/21/91
9 .if ${MK_SENDMAIL} != "no"
13 .if ${MK_TESTS} != "no"
61 .if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "powerpc64"
65 .if exists(${.CURDIR}/etc.${MACHINE}/ttys)
66 BIN1+= etc.${MACHINE}/ttys
67 .elif exists(${.CURDIR}/etc.${MACHINE_ARCH}/ttys)
68 BIN1+= etc.${MACHINE_ARCH}/ttys
69 .elif exists(${.CURDIR}/etc.${MACHINE_CPUARCH}/ttys)
70 BIN1+= etc.${MACHINE_CPUARCH}/ttys
72 .error etc.MACHINE/ttys missing
75 OPENBSMDIR= ${.CURDIR}/../contrib/openbsm
76 BSM_ETC_OPEN_FILES= ${OPENBSMDIR}/etc/audit_class \
77 ${OPENBSMDIR}/etc/audit_event
78 BSM_ETC_RESTRICTED_FILES= ${OPENBSMDIR}/etc/audit_control \
79 ${OPENBSMDIR}/etc/audit_user
80 BSM_ETC_EXEC_FILES= ${OPENBSMDIR}/etc/audit_warn
81 BSM_ETC_DIR= ${DESTDIR}/etc/security
83 # NB: keep these sorted by MK_* knobs
93 .if ${MK_BSNMP} != "no"
97 .if ${MK_FREEBSD_UPDATE} != "no"
98 BIN1+= freebsd-update.conf
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_TCSH} != "no"
139 BIN1+= csh.cshrc csh.login csh.logout
142 .if ${MK_WIRELESS} != "no"
146 # -rwxr-xr-x root:wheel, for the new cron root:wheel
147 BIN2= netstart pccard_ether rc.suspend rc.resume
149 MTREE= BSD.include.dist BSD.root.dist BSD.usr.dist BSD.var.dist
150 .if ${MK_TESTS} != "no"
151 MTREE+= BSD.tests.dist
153 .if ${MK_SENDMAIL} != "no"
154 MTREE+= BSD.sendmail.dist
156 .if ${MK_DEBUG_FILES} != "no"
157 MTREE+= BSD.debug.dist
162 .if ${MK_SENDMAIL} == "no"
163 ETCMAIL=mailer.conf aliases
165 ETCMAIL=Makefile README mailer.conf access.sample virtusertable.sample \
166 mailertable.sample aliases
169 # Special top level files for FreeBSD
173 DESTDIR:= ${DESTDIR:C://*:/:g}
176 .if ${MK_MAN} != "no"
177 ${_+_}cd ${.CURDIR}/../share/man; ${MAKE} makedb
181 # Avoid installing tests here; "make distribution" will do this and
182 # correctly place them in the right location.
183 ${_+_}cd ${.CURDIR} ; ${MAKE} -DNO_TESTS install \
184 DESTDIR=${DISTDIR}/${DISTRIBUTION}
185 ${_+_}cd ${.CURDIR} ; ${MAKE} distribution DESTDIR=${DISTDIR}/${DISTRIBUTION}
187 .include <bsd.endian.mk>
188 .if ${TARGET_ENDIANNESS} == "1234"
191 .elif ${TARGET_ENDIANNESS} == "4321"
200 METALOG.add?= cat -l >> ${METALOG}
204 .if !defined(DESTDIR)
205 @echo "set DESTDIR before running \"make ${.TARGET}\""
209 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
210 ${BIN1} ${DESTDIR}/etc; \
211 cap_mkdb ${CAP_MKDB_ENDIAN} ${DESTDIR}/etc/login.conf; \
212 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 755 \
213 ${BIN2} ${DESTDIR}/etc; \
214 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 600 \
215 master.passwd nsmb.conf opieaccess ${DESTDIR}/etc;
217 sed -i "" -e 's;.*/usr/libexec/atrun;#&;' ${DESTDIR}/etc/crontab
219 .if ${MK_TCSH} == "no"
220 sed -i "" -e 's;/bin/csh;/bin/sh;' ${DESTDIR}/etc/master.passwd
222 pwd_mkdb ${PWD_MKDB_ENDIAN} -i -p -d ${DESTDIR}/etc \
223 ${DESTDIR}/etc/master.passwd
226 echo "./etc/login.conf.db type=file mode=0644 uname=root gname=wheel"; \
227 echo "./etc/passwd type=file mode=0644 uname=root gname=wheel"; \
228 echo "./etc/pwd.db type=file mode=0644 uname=root gname=wheel"; \
229 echo "./etc/spwd.db type=file mode=0600 uname=root gname=wheel"; \
232 ${_+_}cd ${.CURDIR}/autofs; ${MAKE} install
233 .if ${MK_BLUETOOTH} != "no"
234 ${_+_}cd ${.CURDIR}/bluetooth; ${MAKE} install
236 ${_+_}cd ${.CURDIR}/defaults; ${MAKE} install
237 ${_+_}cd ${.CURDIR}/devd; ${MAKE} install
238 ${_+_}cd ${.CURDIR}/gss; ${MAKE} install
239 ${_+_}cd ${.CURDIR}/periodic; ${MAKE} install
240 ${_+_}cd ${.CURDIR}/pkg; ${MAKE} install
241 ${_+_}cd ${.CURDIR}/rc.d; ${MAKE} install
242 ${_+_}cd ${.CURDIR}/../share/termcap; ${MAKE} etc-termcap
243 ${_+_}cd ${.CURDIR}/../usr.sbin/rmt; ${MAKE} etc-rmt
244 ${_+_}cd ${.CURDIR}/pam.d; ${MAKE} install
245 cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 0444 \
246 ${BSM_ETC_OPEN_FILES} ${BSM_ETC_DIR}
247 cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 0600 \
248 ${BSM_ETC_RESTRICTED_FILES} ${BSM_ETC_DIR}
249 cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 0500 \
250 ${BSM_ETC_EXEC_FILES} ${BSM_ETC_DIR}
251 .if ${MK_UNBOUND} != "no"
252 if [ ! -e ${DESTDIR}/etc/unbound ]; then \
253 ${INSTALL_SYMLINK} ../var/unbound ${DESTDIR}/etc/unbound; \
256 .if ${MK_SENDMAIL} != "no"
257 ${_+_}cd ${.CURDIR}/sendmail; ${MAKE} distribution
259 .if ${MK_OPENSSH} != "no"
260 cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
261 ${SSH} ${DESTDIR}/etc/ssh
263 .if ${MK_OPENSSL} != "no"
264 cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
265 ${SSL} ${DESTDIR}/etc/ssl
267 .if ${MK_KERBEROS} != "no"
268 cd ${.CURDIR}/root; \
269 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
270 dot.k5login ${DESTDIR}/root/.k5login;
272 cd ${.CURDIR}/root; \
273 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
274 dot.profile ${DESTDIR}/root/.profile; \
275 rm -f ${DESTDIR}/.profile; \
276 ln ${DESTDIR}/root/.profile ${DESTDIR}/.profile
277 .if ${MK_TCSH} != "no"
278 cd ${.CURDIR}/root; \
279 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
280 dot.cshrc ${DESTDIR}/root/.cshrc; \
281 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
282 dot.login ${DESTDIR}/root/.login; \
283 rm -f ${DESTDIR}/.cshrc; \
284 ln ${DESTDIR}/root/.cshrc ${DESTDIR}/.cshrc
286 cd ${.CURDIR}/mtree; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
287 ${MTREE} ${DESTDIR}/etc/mtree
288 .if ${MK_PPP} != "no"
289 cd ${.CURDIR}/ppp; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 600 \
290 ${PPPCNF} ${DESTDIR}/etc/ppp
292 .if ${MK_MAIL} != "no"
293 cd ${.CURDIR}/mail; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
294 ${ETCMAIL} ${DESTDIR}/etc/mail
295 if [ -d ${DESTDIR}/etc/mail -a -f ${DESTDIR}/etc/mail/aliases -a \
296 ! -f ${DESTDIR}/etc/aliases ]; then \
297 ln -s mail/aliases ${DESTDIR}/etc/aliases; \
300 ${INSTALL} -o ${BINOWN} -g operator -m 664 /dev/null \
301 ${DESTDIR}/etc/dumpdates
302 ${INSTALL} -o nobody -g ${BINGRP} -m 644 /dev/null \
303 ${DESTDIR}/var/db/locate.database
304 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 ${.CURDIR}/minfree \
306 cd ${.CURDIR}/..; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
307 ${FREEBSD} ${DESTDIR}/
308 .if ${MK_BOOT} != "no"
309 .if exists(${.CURDIR}/../sys/${MACHINE}/conf/GENERIC.hints)
310 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
311 ${.CURDIR}/../sys/${MACHINE}/conf/GENERIC.hints \
312 ${DESTDIR}/boot/device.hints
315 .if ${MK_NIS} == "no"
316 sed -i "" -e 's/.*_compat:/# &/' -e 's/compat$$/files/' \
317 ${DESTDIR}/etc/nsswitch.conf
322 MTREES= mtree/BSD.root.dist / \
323 mtree/BSD.var.dist /var \
324 mtree/BSD.usr.dist /usr \
325 mtree/BSD.include.dist /usr/include
326 .if ${MK_DEBUG_FILES} != "no"
327 MTREES+= mtree/BSD.debug.dist /usr/lib
329 .if ${MK_GROFF} != "no"
330 MTREES+= mtree/BSD.groff.dist /usr
332 .if ${MK_TESTS} != "no"
333 MTREES+= mtree/BSD.tests.dist ${TESTSBASE}
335 .if ${MK_SENDMAIL} != "no"
336 MTREES+= mtree/BSD.sendmail.dist /
338 .for mtree in ${LOCAL_MTREE}
339 MTREES+= ../${mtree} /
342 distrib-dirs: ${MTREES:N/*}
344 while test $$# -ge 2; do \
349 test -d $$d || mkdir -p $$d; \
350 ${ECHO} ${MTREE_CMD} -deU ${MTREE_FOLLOWS_SYMLINKS} \
352 ${MTREE_CMD} -deU ${MTREE_FOLLOWS_SYMLINKS} -f $$m -p $$d; \
356 while test $$# -ge 2; do \
360 test "$$d" == "/" && d=""; \
363 test -d $$d || mkdir -p $$d; \
364 ${ECHO} "${MTREE_CMD:N-W} -C -f $$m -K uname,gname | " \
365 "sed s#^\.#.$$d# | ${METALOG.add}" ; \
366 ${MTREE_CMD:N-W} -C -f $$m -K uname,gname | sed s#^\.#.$$d# | \
370 ${INSTALL_SYMLINK} usr/src/sys ${DESTDIR}/sys
371 cd ${DESTDIR}/usr/share/man; \
372 for mandir in man*; do \
373 ${INSTALL_SYMLINK} ../$$mandir \
374 ${DESTDIR}/usr/share/man/en.ISO8859-1/; \
375 ${INSTALL_SYMLINK} ../$$mandir \
376 ${DESTDIR}/usr/share/man/en.UTF-8/; \
378 cd ${DESTDIR}/usr/share/openssl/man; \
379 for mandir in man*; do \
380 ${INSTALL_SYMLINK} ../$$mandir \
381 ${DESTDIR}/usr/share/openssl/man/en.ISO8859-1/; \
383 set - `grep "^[a-zA-Z]" ${.CURDIR}/man.alias`; \
384 while [ $$# -gt 0 ] ; do \
385 ${INSTALL_SYMLINK} "$$2" "${DESTDIR}/usr/share/man/$$1"; \
386 ${INSTALL_SYMLINK} "$$2" \
387 "${DESTDIR}/usr/share/openssl/man/$$1"; \
390 set - `grep "^[a-zA-Z]" ${.CURDIR}/nls.alias`; \
391 while [ $$# -gt 0 ] ; do \
392 ${INSTALL_SYMLINK} "$$2" "${DESTDIR}/usr/share/nls/$$1"; \
397 cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
398 ${BIN1} ${BIN2} nsmb.conf opieaccess \
399 ${DESTDIR}/usr/share/examples/etc
400 ${_+_}cd ${.CURDIR}/defaults; ${MAKE} install \
401 DESTDIR=${DESTDIR}/usr/share/examples
403 .include <bsd.prog.mk>