Correct minor tinderbox -DDEBUG error.
[dragonfly.git] / etc / Makefile
CommitLineData
984263bc
MD
1# from: @(#)Makefile 5.11 (Berkeley) 5/21/91
2# $FreeBSD: src/etc/Makefile,v 1.219.2.38 2003/03/04 09:49:00 ru Exp $
e75ceb5b 3# $DragonFly: src/etc/Makefile,v 1.30 2004/10/21 18:49:51 dillon Exp $
984263bc
MD
4
5.if !defined(NO_SENDMAIL)
6SUBDIR= sendmail
7.endif
8
e75ceb5b
MD
9# Files that should be installed read-only (444)
10#
e50c8f0c 11BINUPDATE= apmd.conf fbtab gettytab network.subr \
95cc27f0 12 pf.os \
e50c8f0c 13 protocols \
9c600e7d
MD
14 rc rc.firewall rc.firewall6 \
15 rc.sendmail rc.shutdown \
e50c8f0c 16 rc.subr rpc services \
984263bc 17 etc.${MACHINE_ARCH}/disktab \
984263bc
MD
18 ${.CURDIR}/../usr.bin/mail/misc/mail.rc \
19 ${.CURDIR}/../usr.bin/locate/locate/locate.rc
20
e75ceb5b
MD
21# Initial distribution files are installed read-write (644)
22#
23BIN1= amd.map auth.conf \
e50c8f0c
MD
24 crontab csh.cshrc csh.login csh.logout \
25 dhclient.conf dm.conf ftpusers group \
26 hosts hosts.allow host.conf hosts.equiv hosts.lpd \
27 inetd.conf login.access login.conf \
28 motd modems networks newsyslog.conf \
95cc27f0 29 pam.conf pf.conf phones printcap profile \
e50c8f0c
MD
30 remote \
31 shells sysctl.conf syslog.conf usbd.conf \
32 etc.${MACHINE_ARCH}/ttys \
33 ${.CURDIR}/../gnu/usr.bin/man/manpath/manpath.config
34
984263bc
MD
35.if exists(${.CURDIR}/../crypto) && !defined(NO_OPENSSL)
36.if !defined(NO_OPENSSH)
9c45a0f5
SU
37SSH= lib/libssh \
38 usr.bin/ssh \
39 usr.sbin/sshd
984263bc 40.endif
e5e17d6f 41SSL= ${.CURDIR}/../crypto/openssl-0.9.7d/apps/openssl.cnf
984263bc
MD
42.endif
43
e75ceb5b
MD
44# Files that should be installed read-only-executable (555) root:wheel
45#
9c600e7d 46BIN2= pccard_ether rc.suspend rc.resume
984263bc
MD
47
48DEFAULTS= rc.conf make.conf pccard.conf periodic.conf
49
50MTREE= BSD.include.dist BSD.local.dist BSD.root.dist BSD.usr.dist \
51 BSD.var.dist BSD.x11.dist BSD.x11-4.dist
52.if !defined(NO_SENDMAIL)
53MTREE+= BSD.sendmail.dist
54.endif
55
56NAMEDB= PROTO.localhost.rev PROTO.localhost-v6.rev named.conf named.root \
cd7c643f 57 make-localhost getroot README
984263bc
MD
58
59PPPCNF= ppp.conf
60
61ETCMAIL=Makefile README mailer.conf access.sample virtusertable.sample \
62 mailertable.sample aliases
63
64# Special top level files for FreeBSD
65FREEBSD=COPYRIGHT
66
67distribute:
68 cd ${.CURDIR} ; ${MAKE} distribution DESTDIR=${DISTDIR}/${DISTRIBUTION}
984263bc 69
e50c8f0c 70upgrade_etc:
1bccbc53 71 cd ${.CURDIR}/../share/mk; ${MAKE} install
e50c8f0c 72 cd ${.CURDIR}; \
e75ceb5b 73 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
e50c8f0c
MD
74 ${BINUPDATE} ${DESTDIR}/etc; \
75 cap_mkdb ${DESTDIR}/etc/login.conf; \
e75ceb5b 76 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 555 \
e50c8f0c 77 ${BIN2} ${DESTDIR}/etc;
e75ceb5b 78 cd ${.CURDIR}/defaults; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
e50c8f0c
MD
79 ${DEFAULTS} ${DESTDIR}/etc/defaults
80 cd ${.CURDIR}/periodic; ${MAKE} install
81 cd ${.CURDIR}/rc.d; ${MAKE} install
e50c8f0c
MD
82 cd ${.CURDIR}/../share/termcap; ${MAKE} etc-termcap
83 cd ${.CURDIR}/../usr.sbin/rmt; ${MAKE} etc-rmt
84.if !defined(NO_I4B)
85 cd ${.CURDIR}/isdn; ${MAKE} install
86.endif
87.if !defined(NO_MAKEDEV)
88 cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 555 \
89 MAKEDEV.local MAKEDEV ${DESTDIR}/dev
90.if !defined(NO_MAKEDEV_RUN)
91 cd ${DESTDIR}/dev; sh MAKEDEV all
92.endif
93.endif
94 cd ${.CURDIR}/mtree; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
95 ${MTREE} ${DESTDIR}/etc/mtree
96 cd ${.CURDIR}/..; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
97 ${FREEBSD} ${DESTDIR}/
98.if !defined(NOMAN)
99 cd ${.CURDIR}/../share/man; ${MAKE} makedb
100.endif
a8f70ff2
MD
101 rm -f ${DESTDIR}/usr/include/machine/ioctl_meteor.h
102 rm -f ${DESTDIR}/usr/include/machine/ioctl_bt848.h
103 ln -s "../dev/video/bktr/ioctl_bt848.h" ${DESTDIR}/usr/include/machine/ioctl_bt848.h
104 ln -s "../dev/video/meteor/ioctl_meteor.h" ${DESTDIR}/usr/include/machine/ioctl_meteor.h
cd7c643f
MD
105.if exists(${DESTDIR}/usr/sbin/named-checkzone)
106 rm -f ${DESTDIR}/usr/libexec/named-xfer
107 rm -f ${DESTDIR}/usr/bin/dnsquery
108 rm -f ${DESTDIR}/usr/bin/dnskeygen
109 rm -f ${DESTDIR}/usr/sbin/ndc
110.endif
703c4292
MD
111.if exists(${DESTDIR}/usr/lib/crtbegin.o)
112 csh -c "rm -f ${DESTDIR}/usr/lib/gcc2/{crtbegin.o,crtbeginS.o,crtend.o,crtendS.o}"
113 csh -c "rm -f ${DESTDIR}/usr/lib/gcc3/{crtbegin.o,crtbeginS.o,crtend.o,crtendS.o}"
859c656a 114.endif
340f5b2b
MD
115.if exists(${DESTDIR}/usr/include/netproto/802_11/if_wavelan_ieee.h)
116 rm -f ${DESTDIR}/usr/include/dev/netif/wi/if_wavelan_ieee.h
117 rm -f ${DESTDIR}/usr/include/net/if_ieee80211.h
118.endif
17030342 119.if exists(${DESTDIR}/usr/libexec/binutils212/elf/as)
5fb65e14 120 ldconfig -m ${DESTDIR}/usr/lib/gcc2
73e93a5d
DR
121 rm -rf ${DESTDIR}/usr/lib/gcc3
122 rm -rf ${DESTDIR}/usr/libexec/gcc3
5fb65e14 123 rm -rf ${DESTDIR}/usr/libdata/ldscripts
17030342
MD
124 rm -rf ${DESTDIR}/usr/libdata/gcc2
125 rm -rf ${DESTDIR}/usr/libdata/gcc3
5fb65e14 126 rm -rf ${DESTDIR}/usr/libexec/elf
aba5ef0f 127 rm -rf ${DESTDIR}/usr/libexec/aout
17030342
MD
128 rm -rf ${DESTDIR}/usr/bin/gcc2
129 rm -rf ${DESTDIR}/usr/bin/gcc3
bb7c020d
MD
130 rm -rf ${DESTDIR}/usr/include/g++
131 csh -c "rm -f ${DESTDIR}/usr/bin/{genassym,gensetdefs,nawk}"
aa1fd55d 132 csh -c "rm -f ${DESTDIR}/usr/share/man/{man8,cat8}/{genassym,gensetdefs}.8.gz"
bb7c020d 133 csh -c "rm -f ${DESTDIR}/usr/share/man/{man1,cat1}/{gawk,nawk}.1.gz"
17030342
MD
134 csh -c "rm -f ${DESTDIR}/usr/libexec/{cc1,cc1obj,cc1plus}"
135 csh -c "rm -f ${DESTDIR}/usr/libexec/{cpp,cpp0,f771,objformat}"
136 csh -c "rm -f ${DESTDIR}/usr/libexec/binutils212/{cc1,cc1obj,cc1plus}"
137 csh -c "rm -f ${DESTDIR}/usr/libexec/binutils212/{cpp,cpp0,f771,objformat}"
138 csh -c "rm -f ${DESTDIR}/usr/libexec/binutils214/{cc1,cc1obj,cc1plus}"
139 csh -c "rm -f ${DESTDIR}/usr/libexec/binutils214/{cpp,cpp0,f771,objformat}"
859c656a 140 csh -c "rm -f ${DESTDIR}/usr/lib/{libgcc.a,libgcc_p.a}"
5fb65e14
MD
141 csh -c "rm -f ${DESTDIR}/usr/lib/{libobjc.a,libobjc_p.a,libstdc++.a}"
142 csh -c "rm -f ${DESTDIR}/usr/lib/{libstdc++.so,libstdc++.so.3}"
143 csh -c "rm -f ${DESTDIR}/usr/lib/{libstdc++_p.a}"
144 csh -c "rm -f ${DESTDIR}/usr/bin/CC"
540deb60
MD
145 rm -f ${DESTDIR}/usr/bin/makewhatis
146 rm -f ${DESTDIR}/usr/sbin/prebind
5fb65e14
MD
147 ldconfig -R
148.endif
93fce123
MD
149.if exists(${DESTDIR}/usr/share/examples/bc)
150 rm -rf ${DESTDIR}/usr/share/examples/bc
151.endif
152.if exists(${DESTDIR}/usr/share/info/dc.info.gz)
153 gzip -d ${DESTDIR}/usr/share/info/dc.info.gz
154 install-info --delete ${DESTDIR}/usr/share/info/dc.info ${DESTDIR}/usr/share/info/dir
155 rm -f ${DESTDIR}/usr/share/info/dc.info ${DESTDIR}/usr/share/info/dc.info.gz
156.endif
e50c8f0c 157
984263bc
MD
158distribution:
159 cd ${.CURDIR}; \
e75ceb5b
MD
160 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
161 ${BINUPDATE} ${DESTDIR}/etc; \
984263bc
MD
162 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
163 ${BIN1} ${DESTDIR}/etc; \
164 cap_mkdb ${DESTDIR}/etc/login.conf; \
e75ceb5b 165 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 555 \
984263bc
MD
166 ${BIN2} ${DESTDIR}/etc; \
167 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 600 \
168 master.passwd nsmb.conf opieaccess ${DESTDIR}/etc; \
169 pwd_mkdb -p -d ${DESTDIR}/etc ${DESTDIR}/etc/master.passwd
170 cd ${.CURDIR}/defaults; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
171 ${DEFAULTS} ${DESTDIR}/etc/defaults
172 cd ${.CURDIR}/periodic; ${MAKE} install
9c600e7d 173 cd ${.CURDIR}/rc.d; ${MAKE} install
984263bc
MD
174 cd ${.CURDIR}/../share/termcap; ${MAKE} etc-termcap
175 cd ${.CURDIR}/../usr.sbin/rmt; ${MAKE} etc-rmt
176.if !defined(NO_I4B)
177 cd ${.CURDIR}/isdn; ${MAKE} install
178.endif
179.if !defined(NO_SENDMAIL)
a8f70ff2 180 cd ${.CURDIR}/sendmail; ${MAKE} obj
984263bc
MD
181 cd ${.CURDIR}/sendmail; ${MAKE} distribution
182.endif
984263bc
MD
183.if exists(${.CURDIR}/../crypto) && !defined(NO_OPENSSL)
184.if !defined(NO_OPENSSH)
9c45a0f5 185.for _f in ${SSH}
60e4bcce 186 cd ${.CURDIR}/../secure/${_f} && ${MAKE} obj
9c45a0f5
SU
187 cd ${.CURDIR}/../secure/${_f} && ${MAKE} etc-ssh
188.endfor
984263bc
MD
189.endif
190 cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
191 ${SSL} ${DESTDIR}/etc/ssl
192.endif
193.if !defined(NO_MAKEDEV)
194 cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 555 \
195 MAKEDEV.local MAKEDEV ${DESTDIR}/dev
196.if !defined(NO_MAKEDEV_RUN)
197 cd ${DESTDIR}/dev; sh MAKEDEV all
198.endif
199.endif
200 cd ${.CURDIR}/root; \
201 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
202 dot.cshrc ${DESTDIR}/root/.cshrc; \
203 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
204 dot.klogin ${DESTDIR}/root/.klogin; \
205 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
206 dot.login ${DESTDIR}/root/.login; \
207 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
208 dot.profile ${DESTDIR}/root/.profile; \
209 rm -f ${DESTDIR}/.cshrc ${DESTDIR}/.profile; \
210 ln ${DESTDIR}/root/.cshrc ${DESTDIR}/.cshrc; \
211 ln ${DESTDIR}/root/.profile ${DESTDIR}/.profile
212 cd ${.CURDIR}/mtree; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
213 ${MTREE} ${DESTDIR}/etc/mtree
214 cd ${.CURDIR}/namedb; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
215 ${NAMEDB} ${DESTDIR}/etc/namedb
216 cd ${.CURDIR}/ppp; ${INSTALL} -o root -g ${BINGRP} -m 600 \
217 ${PPPCNF} ${DESTDIR}/etc/ppp
218 cd ${.CURDIR}/mail; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
219 ${ETCMAIL} ${DESTDIR}/etc/mail
220 @if [ -d ${DESTDIR}/etc/mail -a -f ${DESTDIR}/etc/mail/aliases -a \
221 ! -f ${DESTDIR}/etc/aliases ]; then \
222 set -x; \
223 ln -s mail/aliases ${DESTDIR}/etc/aliases; \
224 fi
225 ${INSTALL} -o ${BINOWN} -g operator -m 664 /dev/null \
226 ${DESTDIR}/etc/dumpdates
227 ${INSTALL} -o nobody -g ${BINGRP} -m 644 /dev/null \
228 ${DESTDIR}/var/db/locate.database
229 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 600 /dev/null \
230 ${DESTDIR}/var/log/auth.log
231 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 600 /dev/null \
232 ${DESTDIR}/var/log/cron
233 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 /dev/null \
234 ${DESTDIR}/var/log/lpd-errs
235 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 640 /dev/null \
236 ${DESTDIR}/var/log/maillog
237 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 /dev/null \
238 ${DESTDIR}/var/log/lastlog
239 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 /dev/null \
240 ${DESTDIR}/var/log/messages
241 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 600 /dev/null \
242 ${DESTDIR}/var/log/security
243 ${INSTALL} -o ${BINOWN} -g network -m 640 /dev/null \
244 ${DESTDIR}/var/log/slip.log
245 ${INSTALL} -o ${BINOWN} -g network -m 640 /dev/null \
246 ${DESTDIR}/var/log/ppp.log
247 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 /dev/null \
248 ${DESTDIR}/var/log/wtmp
249 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 /dev/null \
250 ${DESTDIR}/var/run/utmp
251 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 ${.CURDIR}/minfree \
252 ${DESTDIR}/var/crash
253 cd ${.CURDIR}/..; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
254 ${FREEBSD} ${DESTDIR}/
255.if !defined(NOMAN)
256 cd ${.CURDIR}/../share/man; ${MAKE} makedb
257.endif
258
259distrib-dirs:
260 -set - `grep "^[a-zA-Z]" ${.CURDIR}/locale.deprecated`; \
261 while [ $$# -gt 0 ] ; \
262 do \
263 for dir in /usr/share/locale \
264 /usr/share/nls \
265 /usr/local/share/nls; \
266 do \
267 test -d ${DESTDIR}/$${dir} && cd ${DESTDIR}/$${dir}; \
268 test -L "$$2" && rm -rf "$$2"; \
269 test \! -L "$$1" && test -d "$$1" && mv "$$1" "$$2"; \
270 done; \
271 shift; shift; \
272 done
273 mtree -deU -f ${.CURDIR}/mtree/BSD.root.dist -p ${DESTDIR}/
274 mtree -deU -f ${.CURDIR}/mtree/BSD.var.dist -p ${DESTDIR}/var
275 mtree -deU -f ${.CURDIR}/mtree/BSD.usr.dist -p ${DESTDIR}/usr
276 mtree -deU -f ${.CURDIR}/mtree/BSD.include.dist \
277 -p ${DESTDIR}/usr/include
278 mtree -deU -f ${.CURDIR}/mtree/BSD.include.dist \
279 -p ${DESTDIR}/usr/libdata/perl/5.00503/mach
280.if !defined(NO_SENDMAIL)
281 mtree -deU -f ${.CURDIR}/mtree/BSD.sendmail.dist -p ${DESTDIR}/
282.endif
cd7c643f 283 cd ${DESTDIR}/etc/namedb; rm -f etc/namedb; ln -s ".." etc/namedb
984263bc
MD
284 cd ${DESTDIR}/; rm -f ${DESTDIR}/sys; ln -s usr/src/sys sys
285 cd ${DESTDIR}/usr/share/man/en.ISO8859-1; ln -sf ../man* .
286 cd ${DESTDIR}/usr/share/man; \
287 set - `grep "^[a-zA-Z]" ${.CURDIR}/man.alias`; \
288 while [ $$# -gt 0 ] ; \
289 do \
290 rm -rf "$$1"; \
291 ln -s "$$2" "$$1"; \
292 shift; shift; \
293 done
294 cd ${DESTDIR}/usr/share/locale; \
295 set - `grep "^[a-zA-Z]" ${.CURDIR}/locale.alias`; \
296 while [ $$# -gt 0 ] ; \
297 do \
298 rm -rf "$$1"; \
299 ln -s "$$2" "$$1"; \
300 shift; shift; \
301 done
302 cd ${DESTDIR}/usr/share/openssl/man/en.ISO8859-1; ln -sf ../man* .
303 cd ${DESTDIR}/usr/share/nls; \
304 set - `grep "^[a-zA-Z]" ${.CURDIR}/nls.alias`; \
305 while [ $$# -gt 0 ] ; \
306 do \
307 rm -rf "$$1"; \
308 ln -s "$$2" "$$1"; \
309 shift; shift; \
310 done
311
312etc-examples:
313 cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
e75ceb5b 314 ${BINUPDATE} ${BIN1} ${BIN2} nsmb.conf opieaccess \
984263bc
MD
315 ${DESTDIR}/usr/share/examples/etc
316 cd ${.CURDIR}/defaults; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
317 ${DEFAULTS} ${DESTDIR}/usr/share/examples/etc/defaults
318
319.include <bsd.prog.mk>