1 # from: @(#)Makefile 5.11 (Berkeley) 5/21/91
9 .if ${MK_SENDMAIL} != "no"
13 .if ${MK_TESTS} != "no"
60 .if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "powerpc64"
64 .if exists(${.CURDIR}/etc.${MACHINE}/ttys)
65 BIN1+= etc.${MACHINE}/ttys
66 .elif exists(${.CURDIR}/etc.${MACHINE_ARCH}/ttys)
67 BIN1+= etc.${MACHINE_ARCH}/ttys
68 .elif exists(${.CURDIR}/etc.${MACHINE_CPUARCH}/ttys)
69 BIN1+= etc.${MACHINE_CPUARCH}/ttys
71 .error etc.MACHINE/ttys missing
74 OPENBSMDIR= ${.CURDIR}/../contrib/openbsm
75 BSM_ETC_OPEN_FILES= ${OPENBSMDIR}/etc/audit_class \
76 ${OPENBSMDIR}/etc/audit_event
77 BSM_ETC_RESTRICTED_FILES= ${OPENBSMDIR}/etc/audit_control \
78 ${OPENBSMDIR}/etc/audit_user
79 BSM_ETC_EXEC_FILES= ${OPENBSMDIR}/etc/audit_warn
80 BSM_ETC_DIR= ${DESTDIR}/etc/security
82 # NB: keep these sorted by MK_* knobs
92 .if ${MK_AUTOFS} != "no"
96 .if ${MK_BSNMP} != "no"
100 .if ${MK_FREEBSD_UPDATE} != "no"
101 BIN1+= freebsd-update.conf
104 .if ${MK_LOCATE} != "no"
105 BIN1+= ${.CURDIR}/../usr.bin/locate/locate/locate.rc
108 .if ${MK_LPR} != "no"
109 BIN1+= hosts.lpd printcap
112 .if ${MK_MAIL} != "no"
113 BIN1+= ${.CURDIR}/../usr.bin/mail/misc/mail.rc
116 .if ${MK_NTP} != "no"
120 .if ${MK_OPENSSH} != "no"
121 SSH= ${.CURDIR}/../crypto/openssh/ssh_config \
122 ${.CURDIR}/../crypto/openssh/sshd_config \
123 ${.CURDIR}/../crypto/openssh/moduli
125 .if ${MK_OPENSSL} != "no"
126 SSL= ${.CURDIR}/../crypto/openssl/apps/openssl.cnf
129 .if ${MK_NS_CACHING} != "no"
133 .if ${MK_PORTSNAP} != "no"
141 .if ${MK_TCSH} != "no"
142 BIN1+= csh.cshrc csh.login csh.logout
145 .if ${MK_WIRELESS} != "no"
149 # -rwxr-xr-x root:wheel, for the new cron root:wheel
150 BIN2= netstart pccard_ether rc.suspend rc.resume
152 MTREE= BSD.include.dist BSD.root.dist BSD.usr.dist BSD.var.dist
153 .if ${MK_TESTS} != "no"
154 MTREE+= BSD.tests.dist
156 .if ${MK_SENDMAIL} != "no"
157 MTREE+= BSD.sendmail.dist
159 .if ${MK_DEBUG_FILES} != "no"
160 MTREE+= BSD.debug.dist
165 .if ${MK_SENDMAIL} == "no"
166 ETCMAIL=mailer.conf aliases
168 ETCMAIL=Makefile README mailer.conf access.sample virtusertable.sample \
169 mailertable.sample aliases
172 # Special top level files for FreeBSD
176 DESTDIR:= ${DESTDIR:C://*:/:g}
179 .if ${MK_MAN} != "no"
180 ${_+_}cd ${.CURDIR}/../share/man; ${MAKE} makedb
184 # Avoid installing tests here; "make distribution" will do this and
185 # correctly place them in the right location.
186 ${_+_}cd ${.CURDIR} ; ${MAKE} -DNO_TESTS install \
187 DESTDIR=${DISTDIR}/${DISTRIBUTION}
188 ${_+_}cd ${.CURDIR} ; ${MAKE} distribution DESTDIR=${DISTDIR}/${DISTRIBUTION}
190 .include <bsd.endian.mk>
191 .if ${TARGET_ENDIANNESS} == "1234"
194 .elif ${TARGET_ENDIANNESS} == "4321"
203 METALOG.add?= cat -l >> ${METALOG}
207 .if !defined(DESTDIR)
208 @echo "set DESTDIR before running \"make ${.TARGET}\""
212 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
213 ${BIN1} ${DESTDIR}/etc; \
214 cap_mkdb ${CAP_MKDB_ENDIAN} ${DESTDIR}/etc/login.conf; \
215 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 755 \
216 ${BIN2} ${DESTDIR}/etc; \
217 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 600 \
218 master.passwd nsmb.conf opieaccess ${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}/defaults; ${MAKE} install
242 ${_+_}cd ${.CURDIR}/devd; ${MAKE} install
243 ${_+_}cd ${.CURDIR}/gss; ${MAKE} install
244 ${_+_}cd ${.CURDIR}/periodic; ${MAKE} install
245 ${_+_}cd ${.CURDIR}/pkg; ${MAKE} install
246 ${_+_}cd ${.CURDIR}/rc.d; ${MAKE} install
247 ${_+_}cd ${.CURDIR}/../share/termcap; ${MAKE} etc-termcap
248 ${_+_}cd ${.CURDIR}/../usr.sbin/rmt; ${MAKE} etc-rmt
249 ${_+_}cd ${.CURDIR}/pam.d; ${MAKE} install
250 cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 0444 \
251 ${BSM_ETC_OPEN_FILES} ${BSM_ETC_DIR}
252 cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 0600 \
253 ${BSM_ETC_RESTRICTED_FILES} ${BSM_ETC_DIR}
254 cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 0500 \
255 ${BSM_ETC_EXEC_FILES} ${BSM_ETC_DIR}
256 .if ${MK_UNBOUND} != "no"
257 if [ ! -e ${DESTDIR}/etc/unbound ]; then \
258 ${INSTALL_SYMLINK} ../var/unbound ${DESTDIR}/etc/unbound; \
261 .if ${MK_SENDMAIL} != "no"
262 ${_+_}cd ${.CURDIR}/sendmail; ${MAKE} distribution
264 .if ${MK_OPENSSH} != "no"
265 cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
266 ${SSH} ${DESTDIR}/etc/ssh
268 .if ${MK_OPENSSL} != "no"
269 cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
270 ${SSL} ${DESTDIR}/etc/ssl
272 .if ${MK_KERBEROS} != "no"
273 cd ${.CURDIR}/root; \
274 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
275 dot.k5login ${DESTDIR}/root/.k5login;
277 cd ${.CURDIR}/root; \
278 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
279 dot.profile ${DESTDIR}/root/.profile; \
280 rm -f ${DESTDIR}/.profile; \
281 ln ${DESTDIR}/root/.profile ${DESTDIR}/.profile
282 .if ${MK_TCSH} != "no"
283 cd ${.CURDIR}/root; \
284 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
285 dot.cshrc ${DESTDIR}/root/.cshrc; \
286 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
287 dot.login ${DESTDIR}/root/.login; \
288 rm -f ${DESTDIR}/.cshrc; \
289 ln ${DESTDIR}/root/.cshrc ${DESTDIR}/.cshrc
291 cd ${.CURDIR}/mtree; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
292 ${MTREE} ${DESTDIR}/etc/mtree
293 .if ${MK_PPP} != "no"
294 cd ${.CURDIR}/ppp; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 600 \
295 ${PPPCNF} ${DESTDIR}/etc/ppp
297 .if ${MK_MAIL} != "no"
298 cd ${.CURDIR}/mail; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
299 ${ETCMAIL} ${DESTDIR}/etc/mail
300 if [ -d ${DESTDIR}/etc/mail -a -f ${DESTDIR}/etc/mail/aliases -a \
301 ! -f ${DESTDIR}/etc/aliases ]; then \
302 ln -s mail/aliases ${DESTDIR}/etc/aliases; \
305 ${INSTALL} -o ${BINOWN} -g operator -m 664 /dev/null \
306 ${DESTDIR}/etc/dumpdates
307 ${INSTALL} -o nobody -g ${BINGRP} -m 644 /dev/null \
308 ${DESTDIR}/var/db/locate.database
309 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 ${.CURDIR}/minfree \
311 cd ${.CURDIR}/..; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
312 ${FREEBSD} ${DESTDIR}/
313 .if ${MK_BOOT} != "no"
314 .if exists(${.CURDIR}/../sys/${MACHINE}/conf/GENERIC.hints)
315 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
316 ${.CURDIR}/../sys/${MACHINE}/conf/GENERIC.hints \
317 ${DESTDIR}/boot/device.hints
320 .if ${MK_NIS} == "no"
321 sed -i "" -e 's/.*_compat:/# &/' -e 's/compat$$/files/' \
322 ${DESTDIR}/etc/nsswitch.conf
327 MTREES= mtree/BSD.root.dist / \
328 mtree/BSD.var.dist /var \
329 mtree/BSD.usr.dist /usr \
330 mtree/BSD.include.dist /usr/include
331 .if ${MK_DEBUG_FILES} != "no"
332 MTREES+= mtree/BSD.debug.dist /usr/lib
334 .if ${MK_GROFF} != "no"
335 MTREES+= mtree/BSD.groff.dist /usr
337 .if ${MK_TESTS} != "no"
338 MTREES+= mtree/BSD.tests.dist ${TESTSBASE}
340 .if ${MK_SENDMAIL} != "no"
341 MTREES+= mtree/BSD.sendmail.dist /
343 .for mtree in ${LOCAL_MTREE}
344 MTREES+= ../${mtree} /
347 distrib-dirs: ${MTREES:N/*}
349 while test $$# -ge 2; do \
354 test -d $$d || mkdir -p $$d; \
355 ${ECHO} ${MTREE_CMD} -deU ${MTREE_FOLLOWS_SYMLINKS} \
357 ${MTREE_CMD} -deU ${MTREE_FOLLOWS_SYMLINKS} -f $$m -p $$d; \
361 while test $$# -ge 2; do \
365 test "$$d" == "/" && d=""; \
368 test -d $$d || mkdir -p $$d; \
369 ${ECHO} "${MTREE_CMD:N-W} -C -f $$m -K uname,gname | " \
370 "sed s#^\.#.$$d# | ${METALOG.add}" ; \
371 ${MTREE_CMD:N-W} -C -f $$m -K uname,gname | sed s#^\.#.$$d# | \
375 ${INSTALL_SYMLINK} usr/src/sys ${DESTDIR}/sys
376 cd ${DESTDIR}/usr/share/man; \
377 for mandir in man*; do \
378 ${INSTALL_SYMLINK} ../$$mandir \
379 ${DESTDIR}/usr/share/man/en.ISO8859-1/; \
380 ${INSTALL_SYMLINK} ../$$mandir \
381 ${DESTDIR}/usr/share/man/en.UTF-8/; \
383 cd ${DESTDIR}/usr/share/openssl/man; \
384 for mandir in man*; do \
385 ${INSTALL_SYMLINK} ../$$mandir \
386 ${DESTDIR}/usr/share/openssl/man/en.ISO8859-1/; \
388 set - `grep "^[a-zA-Z]" ${.CURDIR}/man.alias`; \
389 while [ $$# -gt 0 ] ; do \
390 ${INSTALL_SYMLINK} "$$2" "${DESTDIR}/usr/share/man/$$1"; \
391 ${INSTALL_SYMLINK} "$$2" \
392 "${DESTDIR}/usr/share/openssl/man/$$1"; \
395 set - `grep "^[a-zA-Z]" ${.CURDIR}/nls.alias`; \
396 while [ $$# -gt 0 ] ; do \
397 ${INSTALL_SYMLINK} "$$2" "${DESTDIR}/usr/share/nls/$$1"; \
402 cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
403 ${BIN1} ${BIN2} nsmb.conf opieaccess \
404 ${DESTDIR}/usr/share/examples/etc
405 ${_+_}cd ${.CURDIR}/defaults; ${MAKE} install \
406 DESTDIR=${DESTDIR}/usr/share/examples
408 .include <bsd.prog.mk>