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