1 |
# @(#)Makefile 8.2 (Berkeley) 1/4/94 |
2 |
# $MidnightBSD$ |
3 |
# |
4 |
# Doing a "make install" builds /usr/include. |
5 |
|
6 |
.include <bsd.own.mk> |
7 |
|
8 |
CLEANFILES= osreldate.h version vers.c |
9 |
SUBDIR= arpa gssapi protocols rpcsvc rpc xlocale |
10 |
INCS= a.out.h ar.h assert.h bitstring.h complex.h cpio.h _ctype.h ctype.h \ |
11 |
db.h \ |
12 |
dirent.h dlfcn.h elf.h elf-hints.h err.h fmtmsg.h fnmatch.h fstab.h \ |
13 |
fts.h ftw.h getopt.h glob.h grp.h gssapi.h \ |
14 |
ieeefp.h ifaddrs.h \ |
15 |
inttypes.h iso646.h kenv.h langinfo.h libgen.h limits.h link.h \ |
16 |
locale.h malloc.h malloc_np.h memory.h monetary.h mpool.h mqueue.h \ |
17 |
ndbm.h netconfig.h \ |
18 |
netdb.h nl_types.h nlist.h nss.h nsswitch.h ohash.h paths.h \ |
19 |
printf.h proc_service.h pthread.h \ |
20 |
pthread_np.h pwd.h ranlib.h readpassphrase.h regex.h \ |
21 |
res_update.h resolv.h runetype.h search.h semaphore.h setjmp.h \ |
22 |
signal.h spawn.h stab.h stdatomic.h \ |
23 |
stdbool.h stddef.h stdio.h stdlib.h string.h stringlist.h \ |
24 |
strings.h sysexits.h tar.h termios.h tgmath.h \ |
25 |
time.h timeconv.h timers.h ttyent.h \ |
26 |
ulimit.h unistd.h utime.h utmpx.h uuid.h varargs.h vis.h \ |
27 |
wchar.h wctype.h wordexp.h xlocale.h |
28 |
|
29 |
MHDRS= float.h floatingpoint.h stdarg.h |
30 |
|
31 |
PHDRS= sched.h _semaphore.h |
32 |
|
33 |
LHDRS= aio.h errno.h fcntl.h linker_set.h poll.h stdint.h syslog.h \ |
34 |
ucontext.h |
35 |
|
36 |
LDIRS= bsm cam geom net net80211 netatalk netgraph netinet netinet6 \ |
37 |
netipsec netipx netnatm ${_netncp} netsmb \ |
38 |
nfs nfsclient nfsserver \ |
39 |
sys vm |
40 |
|
41 |
LSUBDIRS= cam/ata cam/scsi \ |
42 |
dev/acpica dev/an dev/bktr dev/ciss dev/filemon dev/firewire dev/hwpmc \ |
43 |
dev/ic dev/iicbus ${_dev_ieee488} dev/io dev/lmc dev/mfi dev/ofw \ |
44 |
dev/pbio dev/ppbus dev/smbus \ |
45 |
dev/speaker dev/usb dev/utopia dev/vkbd dev/wi \ |
46 |
fs/devfs fs/fdescfs fs/fifofs fs/msdosfs fs/nfs fs/ntfs fs/nullfs \ |
47 |
${_fs_nwfs} fs/portalfs fs/procfs fs/smbfs fs/udf fs/unionfs \ |
48 |
geom/cache geom/concat geom/eli geom/gate geom/journal geom/label \ |
49 |
geom/mirror geom/mountver geom/multipath geom/nop \ |
50 |
geom/raid geom/raid3 geom/raid5 geom/shsec geom/stripe geom/virstor \ |
51 |
netgraph/atm netgraph/netflow \ |
52 |
security/audit \ |
53 |
security/mac_biba security/mac_bsdextended security/mac_lomac \ |
54 |
security/mac_mls security/mac_partition \ |
55 |
ufs/ffs ufs/ufs |
56 |
|
57 |
LSUBSUBDIRS= dev/mpt/mpilib |
58 |
.if ${MK_GPIB} != "no" |
59 |
_dev_ieee488= dev/ieee488 |
60 |
.endif |
61 |
|
62 |
.if ${MK_HESIOD} != "no" |
63 |
INCS+= hesiod.h |
64 |
.endif |
65 |
|
66 |
.if ${MK_ICONV} != "no" |
67 |
INCS+= iconv.h |
68 |
.endif |
69 |
|
70 |
.if ${MK_BLUETOOTH} != "no" |
71 |
LSUBSUBDIRS+= netgraph/bluetooth/include |
72 |
.endif |
73 |
|
74 |
.if ${MK_NCP} != "no" |
75 |
_netncp= netncp |
76 |
_fs_nwfs= fs/nwfs |
77 |
.endif |
78 |
|
79 |
# Define SHARED to indicate whether you want symbolic links to the system |
80 |
# source (``symlinks''), or a separate copy (``copies''). ``symlinks'' is |
81 |
# probably only useful for developers and should be avoided if you do not |
82 |
# wish to tie your /usr/include and /usr/src together. |
83 |
#SHARED= symlinks |
84 |
SHARED?= copies |
85 |
|
86 |
INCS+= osreldate.h |
87 |
|
88 |
osreldate.h: ${.CURDIR}/../sys/conf/newvers.sh ${.CURDIR}/../sys/sys/param.h \ |
89 |
${.CURDIR}/Makefile |
90 |
@${ECHO} creating osreldate.h from newvers.sh |
91 |
@MAKE=${MAKE}; \ |
92 |
PARAMFILE=${.CURDIR}/../sys/sys/param.h; \ |
93 |
. ${.CURDIR}/../sys/conf/newvers.sh; \ |
94 |
echo "$$COPYRIGHT" > osreldate.h; \ |
95 |
echo "#ifdef _KERNEL" >> osreldate.h; \ |
96 |
echo "#error \"<osreldate.h> cannot be used in the kernel, use <sys/param.h>\"" >> osreldate.h; \ |
97 |
echo "#else" >> osreldate.h; \ |
98 |
echo "#undef __MidnightBSD_version" >> osreldate.h; \ |
99 |
echo "#define __MidnightBSD_version $$RELDATE" >> osreldate.h; \ |
100 |
echo "#endif" >> osreldate.h |
101 |
|
102 |
.for i in ${LHDRS} |
103 |
INCSLINKS+= sys/$i ${INCLUDEDIR}/$i |
104 |
.endfor |
105 |
.for i in ${MHDRS} |
106 |
INCSLINKS+= machine/$i ${INCLUDEDIR}/$i |
107 |
.endfor |
108 |
.for i in ${PHDRS} |
109 |
INCSLINKS+= sys/$i ${INCLUDEDIR}/$i |
110 |
.endfor |
111 |
|
112 |
.if ${MACHINE} != ${MACHINE_CPUARCH} |
113 |
_MARCHS= ${MACHINE_CPUARCH} |
114 |
.endif |
115 |
.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" |
116 |
_MARCHS+= x86 |
117 |
.endif |
118 |
|
119 |
.include <bsd.prog.mk> |
120 |
|
121 |
installincludes: ${SHARED} |
122 |
${SHARED}: compat |
123 |
|
124 |
# Take care of stale directory-level symlinks. |
125 |
compat: |
126 |
.for i in ${LDIRS} ${LSUBDIRS} machine ${_MARCHS} crypto |
127 |
if [ -L ${DESTDIR}${INCLUDEDIR}/$i ]; then \ |
128 |
rm -f ${DESTDIR}${INCLUDEDIR}/$i; \ |
129 |
fi |
130 |
.endfor |
131 |
mtree -deU ${MTREE_FOLLOWS_SYMLINKS} \ |
132 |
-f ${.CURDIR}/../etc/mtree/BSD.include.dist \ |
133 |
-p ${DESTDIR}${INCLUDEDIR} |
134 |
.if ${MK_BIND_LIBS} != "no" |
135 |
mtree -deU ${MTREE_FOLLOWS_SYMLINKS} \ |
136 |
-f ${.CURDIR}/../etc/mtree/BIND.include.dist \ |
137 |
-p ${DESTDIR}${INCLUDEDIR} |
138 |
.endif |
139 |
|
140 |
copies: |
141 |
.for i in ${LDIRS} ${LSUBDIRS} ${LSUBSUBDIRS} altq crypto machine machine/pc \ |
142 |
${_MARCHS} |
143 |
.if exists(${DESTDIR}${INCLUDEDIR}/$i) |
144 |
cd ${DESTDIR}${INCLUDEDIR}/$i; \ |
145 |
for h in *.h; do \ |
146 |
if [ -L $$h ]; then rm -f $$h; fi; \ |
147 |
done |
148 |
.endif |
149 |
.endfor |
150 |
.for i in ${LDIRS} ${LSUBDIRS:Ndev/acpica:Ndev/bktr} ${LSUBSUBDIRS} |
151 |
cd ${.CURDIR}/../sys; \ |
152 |
${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 $i/*.h \ |
153 |
${DESTDIR}${INCLUDEDIR}/$i |
154 |
.endfor |
155 |
cd ${.CURDIR}/../sys/dev/acpica; \ |
156 |
${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 acpiio.h \ |
157 |
${DESTDIR}${INCLUDEDIR}/dev/acpica |
158 |
cd ${.CURDIR}/../sys/dev/bktr; \ |
159 |
${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 ioctl_*.h \ |
160 |
${DESTDIR}${INCLUDEDIR}/dev/bktr |
161 |
cd ${.CURDIR}/../sys/contrib/altq/altq; \ |
162 |
${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \ |
163 |
${DESTDIR}${INCLUDEDIR}/altq |
164 |
cd ${.CURDIR}/../sys/fs/cd9660/; \ |
165 |
${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \ |
166 |
${DESTDIR}${INCLUDEDIR}/isofs/cd9660 |
167 |
.if ${MK_IPFILTER} != "no" |
168 |
cd ${.CURDIR}/../sys/contrib/ipfilter/netinet; \ |
169 |
${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \ |
170 |
${DESTDIR}${INCLUDEDIR}/netinet |
171 |
.endif |
172 |
cd ${.CURDIR}/../sys/contrib/pf/net; \ |
173 |
${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \ |
174 |
${DESTDIR}${INCLUDEDIR}/net |
175 |
cd ${.CURDIR}/../sys/crypto; \ |
176 |
${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 rijndael/rijndael.h \ |
177 |
${DESTDIR}${INCLUDEDIR}/crypto |
178 |
cd ${.CURDIR}/../sys/opencrypto; \ |
179 |
${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \ |
180 |
${DESTDIR}${INCLUDEDIR}/crypto |
181 |
cd ${.CURDIR}/../sys/${MACHINE}/include; \ |
182 |
${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \ |
183 |
${DESTDIR}${INCLUDEDIR}/machine |
184 |
.if exists(${.CURDIR}/../sys/${MACHINE}/include/pc) |
185 |
cd ${.CURDIR}/../sys/${MACHINE}/include/pc; \ |
186 |
${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \ |
187 |
${DESTDIR}${INCLUDEDIR}/machine/pc |
188 |
.endif |
189 |
.for _MARCH in ${_MARCHS} |
190 |
.if exists(${.CURDIR}/../sys/${_MARCH}/include) |
191 |
${INSTALL} -d -o ${BINOWN} -g ${BINGRP} -m 755 \ |
192 |
${DESTDIR}${INCLUDEDIR}/${_MARCH}; \ |
193 |
cd ${.CURDIR}/../sys/${_MARCH}/include; \ |
194 |
${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \ |
195 |
${DESTDIR}${INCLUDEDIR}/${_MARCH} |
196 |
.if exists(${.CURDIR}/../sys/${_MARCH}/include/pc) |
197 |
${INSTALL} -d -o ${BINOWN} -g ${BINGRP} -m 755 \ |
198 |
${DESTDIR}${INCLUDEDIR}/${_MARCH}/pc; \ |
199 |
cd ${.CURDIR}/../sys/${_MARCH}/include/pc; \ |
200 |
${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \ |
201 |
${DESTDIR}${INCLUDEDIR}/${_MARCH}/pc |
202 |
.endif |
203 |
.endif |
204 |
.endfor |
205 |
cd ${.CURDIR}/../sys/rpc; \ |
206 |
${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 types.h \ |
207 |
${DESTDIR}${INCLUDEDIR}/rpc |
208 |
|
209 |
symlinks: |
210 |
@${ECHO} "Setting up symlinks to kernel source tree..." |
211 |
.for i in ${LDIRS} |
212 |
cd ${.CURDIR}/../sys/$i; \ |
213 |
for h in *.h; do \ |
214 |
ln -fs ../../../sys/$i/$$h ${DESTDIR}${INCLUDEDIR}/$i; \ |
215 |
done |
216 |
.endfor |
217 |
.for i in ${LSUBDIRS:Ndev/acpica:Ndev/bktr} |
218 |
cd ${.CURDIR}/../sys/$i; \ |
219 |
for h in *.h; do \ |
220 |
ln -fs ../../../../sys/$i/$$h ${DESTDIR}${INCLUDEDIR}/$i; \ |
221 |
done |
222 |
.endfor |
223 |
cd ${.CURDIR}/../sys/dev/acpica; \ |
224 |
for h in acpiio.h; do \ |
225 |
ln -fs ../../../../sys/dev/acpica/$$h \ |
226 |
${DESTDIR}${INCLUDEDIR}/dev/acpica; \ |
227 |
done |
228 |
cd ${.CURDIR}/../sys/dev/bktr; \ |
229 |
for h in ioctl_*.h; do \ |
230 |
ln -fs ../../../../sys/dev/bktr/$$h \ |
231 |
${DESTDIR}${INCLUDEDIR}/dev/bktr; \ |
232 |
done |
233 |
.for i in ${LSUBSUBDIRS} |
234 |
cd ${.CURDIR}/../sys/$i; \ |
235 |
for h in *.h; do \ |
236 |
ln -fs ../../../../../sys/$i/$$h ${DESTDIR}${INCLUDEDIR}/$i; \ |
237 |
done |
238 |
.endfor |
239 |
cd ${.CURDIR}/../sys/contrib/altq/altq; \ |
240 |
for h in *.h; do \ |
241 |
ln -fs ../../../sys/contrib/altq/altq/$$h \ |
242 |
${DESTDIR}${INCLUDEDIR}/altq; \ |
243 |
done |
244 |
.if ${MK_IPFILTER} != "no" |
245 |
cd ${.CURDIR}/../sys/contrib/ipfilter/netinet; \ |
246 |
for h in *.h; do \ |
247 |
ln -fs ../../../sys/contrib/ipfilter/netinet/$$h \ |
248 |
${DESTDIR}${INCLUDEDIR}/netinet; \ |
249 |
done |
250 |
.endif |
251 |
cd ${.CURDIR}/../sys/contrib/pf/net; \ |
252 |
for h in *.h; do \ |
253 |
ln -fs ../../../sys/contrib/pf/net/$$h \ |
254 |
${DESTDIR}${INCLUDEDIR}/net; \ |
255 |
done |
256 |
cd ${.CURDIR}/../sys/crypto; \ |
257 |
for h in rijndael/rijndael.h; do \ |
258 |
ln -fs ../../../sys/crypto/$$h \ |
259 |
${DESTDIR}${INCLUDEDIR}/crypto; \ |
260 |
done |
261 |
cd ${.CURDIR}/../sys/opencrypto; \ |
262 |
for h in *.h; do \ |
263 |
ln -fs ../../../sys/opencrypto/$$h \ |
264 |
${DESTDIR}${INCLUDEDIR}/crypto; \ |
265 |
done |
266 |
cd ${.CURDIR}/../sys/${MACHINE}/include; \ |
267 |
for h in *.h; do \ |
268 |
ln -fs ../../../sys/${MACHINE}/include/$$h \ |
269 |
${DESTDIR}${INCLUDEDIR}/machine; \ |
270 |
done |
271 |
.if exists(${.CURDIR}/../sys/${MACHINE}/include/pc) |
272 |
cd ${.CURDIR}/../sys/${MACHINE}/include/pc; \ |
273 |
for h in *.h; do \ |
274 |
ln -fs ../../../../sys/${MACHINE}/include/pc/$$h \ |
275 |
${DESTDIR}${INCLUDEDIR}/machine/pc; \ |
276 |
done |
277 |
.endif |
278 |
.for _MARCH in ${_MARCHS} |
279 |
.if exists(${.CURDIR}/../sys/${_MARCH}/include) |
280 |
${INSTALL} -d -o ${BINOWN} -g ${BINGRP} -m 755 \ |
281 |
${DESTDIR}${INCLUDEDIR}/${_MARCH}; \ |
282 |
cd ${.CURDIR}/../sys/${_MARCH}/include; \ |
283 |
for h in *.h; do \ |
284 |
ln -fs ../../../sys/${_MARCH}/include/$$h \ |
285 |
${DESTDIR}${INCLUDEDIR}/${_MARCH}; \ |
286 |
done |
287 |
.if exists(${.CURDIR}/../sys/${_MARCH}/include/pc) |
288 |
${INSTALL} -d -o ${BINOWN} -g ${BINGRP} -m 755 \ |
289 |
${DESTDIR}${INCLUDEDIR}/${_MARCH}/pc; \ |
290 |
cd ${.CURDIR}/../sys/${_MARCH}/include/pc; \ |
291 |
for h in *.h; do \ |
292 |
ln -fs ../../../../sys/${_MARCH}/include/pc/$$h \ |
293 |
${DESTDIR}${INCLUDEDIR}/${_MARCH}/pc; \ |
294 |
done |
295 |
.endif |
296 |
.endif |
297 |
.endfor |
298 |
cd ${.CURDIR}/../sys/fs/cd9660; \ |
299 |
for h in *.h; do \ |
300 |
ln -fs ../../../../sys/fs/cd9660/$$h \ |
301 |
${DESTDIR}${INCLUDEDIR}/isofs/cd9660; \ |
302 |
done |
303 |
cd ${.CURDIR}/../sys/rpc; \ |
304 |
for h in types.h; do \ |
305 |
ln -fs ../../../sys/rpc/$$h \ |
306 |
${DESTDIR}${INCLUDEDIR}/rpc; \ |
307 |
done |