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_BSNMP} != "no"
93 .if ${MK_FREEBSD_UPDATE} != "no"
94 BIN1+= freebsd-update.conf
101 .if ${MK_INETD} != "no"
105 .if ${MK_LOCATE} != "no"
106 BIN1+= ${.CURDIR}/../usr.bin/locate/locate/locate.rc
109 .if ${MK_LPR} != "no"
110 BIN1+= hosts.lpd printcap
113 .if ${MK_MAIL} != "no"
114 BIN1+= ${.CURDIR}/../usr.bin/mail/misc/mail.rc
117 .if ${MK_NTP} != "no"
121 .if ${MK_OPENSSH} != "no"
122 SSH= ${.CURDIR}/../crypto/openssh/ssh_config \
123 ${.CURDIR}/../crypto/openssh/sshd_config \
124 ${.CURDIR}/../crypto/openssh/moduli
126 .if ${MK_OPENSSL} != "no"
127 SSL= ${.CURDIR}/../crypto/openssl/apps/openssl.cnf
130 .if ${MK_NS_CACHING} != "no"
134 .if ${MK_PORTSNAP} != "no"
142 .if ${MK_SENDMAIL} != "no"
146 .if ${MK_TCSH} != "no"
147 BIN1+= csh.cshrc csh.login csh.logout
150 .if ${MK_WIRELESS} != "no"
154 # -rwxr-xr-x root:wheel, for the new cron root:wheel
155 BIN2= netstart pccard_ether rc.suspend rc.resume
157 MTREE= BSD.debug.dist BSD.include.dist BSD.root.dist BSD.usr.dist BSD.var.dist
158 .if ${MK_TESTS} != "no"
159 MTREE+= BSD.tests.dist
161 .if ${MK_SENDMAIL} != "no"
162 MTREE+= BSD.sendmail.dist
167 .if ${MK_SENDMAIL} == "no"
168 ETCMAIL=mailer.conf aliases
170 ETCMAIL=Makefile README mailer.conf access.sample virtusertable.sample \
171 mailertable.sample aliases
174 # Special top level files for FreeBSD
178 DESTDIR:= ${DESTDIR:C://*:/:g}
181 .if ${MK_MAN} != "no"
182 ${_+_}cd ${.CURDIR}/../share/man; ${MAKE} makedb
186 # Avoid installing tests here; "make distribution" will do this and
187 # correctly place them in the right location.
188 ${_+_}cd ${.CURDIR} ; ${MAKE} -DNO_TESTS install \
189 DESTDIR=${DISTDIR}/${DISTRIBUTION}
190 ${_+_}cd ${.CURDIR} ; ${MAKE} distribution DESTDIR=${DISTDIR}/${DISTRIBUTION}
192 .include <bsd.endian.mk>
193 .if ${TARGET_ENDIANNESS} == "1234"
196 .elif ${TARGET_ENDIANNESS} == "4321"
205 METALOG.add?= cat -l >> ${METALOG}
209 .if !defined(DESTDIR)
210 @echo "set DESTDIR before running \"make ${.TARGET}\""
214 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
215 ${BIN1} ${DESTDIR}/etc; \
216 cap_mkdb ${CAP_MKDB_ENDIAN} ${DESTDIR}/etc/login.conf; \
217 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 755 \
218 ${BIN2} ${DESTDIR}/etc; \
219 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 600 \
220 master.passwd nsmb.conf opieaccess ${DESTDIR}/etc;
222 sed -i "" -e 's;.*/usr/libexec/atrun;#&;' ${DESTDIR}/etc/crontab
224 .if ${MK_TCSH} == "no"
225 sed -i "" -e 's;/bin/csh;/bin/sh;' ${DESTDIR}/etc/master.passwd
227 pwd_mkdb ${PWD_MKDB_ENDIAN} -i -p -d ${DESTDIR}/etc \
228 ${DESTDIR}/etc/master.passwd
231 echo "./etc/login.conf.db type=file mode=0644 uname=root gname=wheel"; \
232 echo "./etc/passwd type=file mode=0644 uname=root gname=wheel"; \
233 echo "./etc/pwd.db type=file mode=0644 uname=root gname=wheel"; \
234 echo "./etc/spwd.db type=file mode=0600 uname=root gname=wheel"; \
237 .if ${MK_AUTOFS} != "no"
238 ${_+_}cd ${.CURDIR}/autofs; ${MAKE} install
240 .if ${MK_BLUETOOTH} != "no"
241 ${_+_}cd ${.CURDIR}/bluetooth; ${MAKE} install
243 ${_+_}cd ${.CURDIR}/defaults; ${MAKE} install
244 ${_+_}cd ${.CURDIR}/devd; ${MAKE} install
245 ${_+_}cd ${.CURDIR}/gss; ${MAKE} install
246 ${_+_}cd ${.CURDIR}/periodic; ${MAKE} install
247 .if ${MK_PKGBOOTSTRAP} != "no"
248 ${_+_}cd ${.CURDIR}/pkg; ${MAKE} install
250 ${_+_}cd ${.CURDIR}/rc.d; ${MAKE} install
251 ${_+_}cd ${.CURDIR}/../share/termcap; ${MAKE} etc-termcap
252 ${_+_}cd ${.CURDIR}/../usr.sbin/rmt; ${MAKE} etc-rmt
253 ${_+_}cd ${.CURDIR}/pam.d; ${MAKE} install
254 cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 0444 \
255 ${BSM_ETC_OPEN_FILES} ${BSM_ETC_DIR}
256 cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 0600 \
257 ${BSM_ETC_RESTRICTED_FILES} ${BSM_ETC_DIR}
258 cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 0500 \
259 ${BSM_ETC_EXEC_FILES} ${BSM_ETC_DIR}
260 .if ${MK_UNBOUND} != "no"
261 if [ ! -e ${DESTDIR}/etc/unbound ]; then \
262 ${INSTALL_SYMLINK} ../var/unbound ${DESTDIR}/etc/unbound; \
265 .if ${MK_SENDMAIL} != "no"
266 ${_+_}cd ${.CURDIR}/sendmail; ${MAKE} distribution
268 .if ${MK_OPENSSH} != "no"
269 cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
270 ${SSH} ${DESTDIR}/etc/ssh
272 .if ${MK_OPENSSL} != "no"
273 cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
274 ${SSL} ${DESTDIR}/etc/ssl
276 .if ${MK_KERBEROS} != "no"
277 cd ${.CURDIR}/root; \
278 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
279 dot.k5login ${DESTDIR}/root/.k5login;
281 cd ${.CURDIR}/root; \
282 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
283 dot.profile ${DESTDIR}/root/.profile; \
284 rm -f ${DESTDIR}/.profile; \
285 ln ${DESTDIR}/root/.profile ${DESTDIR}/.profile
286 .if ${MK_TCSH} != "no"
287 cd ${.CURDIR}/root; \
288 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
289 dot.cshrc ${DESTDIR}/root/.cshrc; \
290 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
291 dot.login ${DESTDIR}/root/.login; \
292 rm -f ${DESTDIR}/.cshrc; \
293 ln ${DESTDIR}/root/.cshrc ${DESTDIR}/.cshrc
295 cd ${.CURDIR}/mtree; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
296 ${MTREE} ${DESTDIR}/etc/mtree
297 .if ${MK_PPP} != "no"
298 cd ${.CURDIR}/ppp; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 600 \
299 ${PPPCNF} ${DESTDIR}/etc/ppp
301 .if ${MK_MAIL} != "no"
302 cd ${.CURDIR}/mail; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
303 ${ETCMAIL} ${DESTDIR}/etc/mail
304 if [ -d ${DESTDIR}/etc/mail -a -f ${DESTDIR}/etc/mail/aliases -a \
305 ! -f ${DESTDIR}/etc/aliases ]; then \
306 ln -s mail/aliases ${DESTDIR}/etc/aliases; \
309 ${INSTALL} -o ${BINOWN} -g operator -m 664 /dev/null \
310 ${DESTDIR}/etc/dumpdates
311 .if ${MK_LOCATE} != "no"
312 ${INSTALL} -o nobody -g ${BINGRP} -m 644 /dev/null \
313 ${DESTDIR}/var/db/locate.database
315 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 ${.CURDIR}/minfree \
317 cd ${.CURDIR}/..; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
318 ${FREEBSD} ${DESTDIR}/
319 .if ${MK_BOOT} != "no"
320 .if exists(${.CURDIR}/../sys/${MACHINE}/conf/GENERIC.hints)
321 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
322 ${.CURDIR}/../sys/${MACHINE}/conf/GENERIC.hints \
323 ${DESTDIR}/boot/device.hints
326 .if ${MK_NIS} == "no"
327 sed -i "" -e 's/.*_compat:/# &/' -e 's/compat$$/files/' \
328 ${DESTDIR}/etc/nsswitch.conf
333 MTREES= mtree/BSD.root.dist / \
334 mtree/BSD.var.dist /var \
335 mtree/BSD.usr.dist /usr \
336 mtree/BSD.include.dist /usr/include \
337 mtree/BSD.debug.dist /usr/lib
338 .if ${MK_GROFF} != "no"
339 MTREES+= mtree/BSD.groff.dist /usr
341 .if ${MK_TESTS} != "no"
342 MTREES+= mtree/BSD.tests.dist ${TESTSBASE}
344 .if ${MK_SENDMAIL} != "no"
345 MTREES+= mtree/BSD.sendmail.dist /
347 .for mtree in ${LOCAL_MTREE}
348 MTREES+= ../${mtree} /
351 distrib-dirs: ${MTREES:N/*}
353 while test $$# -ge 2; do \
358 test -d $$d || mkdir -p $$d; \
359 ${ECHO} ${MTREE_CMD} -deU ${MTREE_FOLLOWS_SYMLINKS} \
361 ${MTREE_CMD} -deU ${MTREE_FOLLOWS_SYMLINKS} -f $$m -p $$d; \
365 while test $$# -ge 2; do \
369 test "$$d" == "/" && d=""; \
372 test -d $$d || mkdir -p $$d; \
373 ${ECHO} "${MTREE_CMD:N-W} -C -f $$m -K uname,gname | " \
374 "sed s#^\.#.$$d# | ${METALOG.add}" ; \
375 ${MTREE_CMD:N-W} -C -f $$m -K uname,gname | sed s#^\.#.$$d# | \
379 ${INSTALL_SYMLINK} usr/src/sys ${DESTDIR}/sys
380 .if ${MK_MAN} != "no"
381 cd ${DESTDIR}${SHAREDIR}/man; \
382 for mandir in man*; do \
383 ${INSTALL_SYMLINK} ../$$mandir \
384 ${DESTDIR}${SHAREDIR}/man/en.ISO8859-1/; \
385 ${INSTALL_SYMLINK} ../$$mandir \
386 ${DESTDIR}${SHAREDIR}/man/en.UTF-8/; \
388 .if ${MK_OPENSSL} != "no"
389 cd ${DESTDIR}${SHAREDIR}/openssl/man; \
390 for mandir in man*; do \
391 ${INSTALL_SYMLINK} ../$$mandir \
392 ${DESTDIR}${SHAREDIR}/openssl/man/en.ISO8859-1/; \
395 set - `grep "^[a-zA-Z]" ${.CURDIR}/man.alias`; \
396 while [ $$# -gt 0 ] ; do \
397 ${INSTALL_SYMLINK} "$$2" "${DESTDIR}${SHAREDIR}/man/$$1"; \
398 if [ "${MK_OPENSSL}" != "no" ]; then \
399 ${INSTALL_SYMLINK} "$$2" \
400 "${DESTDIR}${SHAREDIR}/openssl/man/$$1"; \
405 .if ${MK_NLS} != "no"
406 set - `grep "^[a-zA-Z]" ${.CURDIR}/nls.alias`; \
407 while [ $$# -gt 0 ] ; do \
408 ${INSTALL_SYMLINK} "$$2" "${DESTDIR}${SHAREDIR}/nls/$$1"; \
414 cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
415 ${BIN1} ${BIN2} nsmb.conf opieaccess \
416 ${DESTDIR}${SHAREDIR}/examples/etc
417 ${_+_}cd ${.CURDIR}/defaults; ${MAKE} install \
418 DESTDIR=${DESTDIR}${SHAREDIR}/examples
420 .include <bsd.prog.mk>