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 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 \ |
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 \ |
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 \ |
27 |
wchar.h wctype.h wordexp.h xlocale.h |
28 |
|
29 |
.PATH: ${.CURDIR}/../contrib/libc-vis |
30 |
INCS+= vis.h |
31 |
|
32 |
# APSL headers |
33 |
INCS+= Availability.h \ |
34 |
AvailabilityInternal.h \ |
35 |
AvailabilityMacros.h \ |
36 |
CrashReporterClient.h \ |
37 |
MacTypes.h \ |
38 |
NSSystemDirectories.h \ |
39 |
TargetConditionals.h \ |
40 |
_simple.h \ |
41 |
_types.h \ |
42 |
aliasdb.h \ |
43 |
ils.h \ |
44 |
libinfo.h \ |
45 |
si_data.h \ |
46 |
si_module.h \ |
47 |
util.h \ |
48 |
utmp.h |
49 |
|
50 |
SUBDIR+= apple |
51 |
|
52 |
|
53 |
MHDRS= float.h floatingpoint.h stdarg.h |
54 |
|
55 |
PHDRS= sched.h _semaphore.h |
56 |
|
57 |
LHDRS= aio.h errno.h fcntl.h linker_set.h poll.h stdint.h syslog.h \ |
58 |
ucontext.h |
59 |
|
60 |
LDIRS= bsm cam geom net net80211 netatalk netgraph netinet netinet6 \ |
61 |
netipsec netipx netnatm ${_netncp} netsmb \ |
62 |
nfs nfsclient nfsserver \ |
63 |
sys vm |
64 |
|
65 |
LSUBDIRS= cam/ata cam/scsi \ |
66 |
dev/acpica dev/agp dev/an dev/bktr dev/ciss dev/filemon dev/firewire \ |
67 |
dev/hwpmc \ |
68 |
dev/ic dev/iicbus ${_dev_ieee488} dev/io dev/lmc dev/mfi dev/ofw \ |
69 |
dev/pbio dev/pci dev/ppbus dev/smbus \ |
70 |
dev/speaker dev/usb dev/utopia dev/vkbd dev/wi \ |
71 |
fs/devfs fs/fdescfs fs/fifofs fs/msdosfs fs/nfs fs/ntfs fs/nullfs \ |
72 |
${_fs_nwfs} fs/portalfs fs/procfs fs/smbfs fs/udf fs/unionfs \ |
73 |
geom/cache geom/concat geom/eli geom/gate geom/journal geom/label \ |
74 |
geom/mirror geom/mountver geom/multipath geom/nop \ |
75 |
geom/raid geom/raid3 geom/raid5 geom/shsec geom/stripe geom/virstor \ |
76 |
netgraph/atm netgraph/netflow \ |
77 |
security/audit \ |
78 |
security/mac_biba security/mac_bsdextended security/mac_lomac \ |
79 |
security/mac_mls security/mac_partition \ |
80 |
ufs/ffs ufs/ufs |
81 |
|
82 |
LSUBSUBDIRS= dev/mpt/mpilib |
83 |
|
84 |
.if ${MK_GPIB} != "no" |
85 |
_dev_ieee488= dev/ieee488 |
86 |
.endif |
87 |
|
88 |
.if ${MK_GSSAPI} != "no" |
89 |
SUBDIR+= gssapi |
90 |
INCS+= gssapi.h |
91 |
.endif |
92 |
|
93 |
.if ${MK_HESIOD} != "no" |
94 |
INCS+= hesiod.h |
95 |
.endif |
96 |
|
97 |
# Handle the #define aliases for libiconv |
98 |
.if ${MK_ICONV} == "yes" |
99 |
INCS+= iconv.h |
100 |
.endif |
101 |
|
102 |
.if ${MK_BLUETOOTH} != "no" |
103 |
LSUBSUBDIRS+= netgraph/bluetooth/include |
104 |
.endif |
105 |
|
106 |
.if ${MK_NCP} != "no" |
107 |
_netncp= netncp |
108 |
_fs_nwfs= fs/nwfs |
109 |
.endif |
110 |
|
111 |
# Define SHARED to indicate whether you want symbolic links to the system |
112 |
# source (``symlinks''), or a separate copy (``copies''). ``symlinks'' is |
113 |
# probably only useful for developers and should be avoided if you do not |
114 |
# wish to tie your /usr/include and /usr/src together. |
115 |
#SHARED= symlinks |
116 |
SHARED?= copies |
117 |
|
118 |
INCS+= osreldate.h |
119 |
|
120 |
osreldate.h: ${.CURDIR}/../sys/conf/newvers.sh ${.CURDIR}/../sys/sys/param.h \ |
121 |
${.CURDIR}/Makefile |
122 |
@${ECHO} creating osreldate.h from newvers.sh |
123 |
@MAKE=${MAKE}; \ |
124 |
PARAMFILE=${.CURDIR}/../sys/sys/param.h; \ |
125 |
. ${.CURDIR}/../sys/conf/newvers.sh; \ |
126 |
echo "$$COPYRIGHT" > osreldate.h; \ |
127 |
echo "#ifdef _KERNEL" >> osreldate.h; \ |
128 |
echo "#error \"<osreldate.h> cannot be used in the kernel, use <sys/param.h>\"" >> osreldate.h; \ |
129 |
echo "#else" >> osreldate.h; \ |
130 |
echo "#undef __MidnightBSD_version" >> osreldate.h; \ |
131 |
echo "#define __MidnightBSD_version $$RELDATE" >> osreldate.h; \ |
132 |
echo "#endif" >> osreldate.h |
133 |
|
134 |
.for i in ${LHDRS} |
135 |
INCSLINKS+= sys/$i ${INCLUDEDIR}/$i |
136 |
.endfor |
137 |
.for i in ${MHDRS} |
138 |
INCSLINKS+= machine/$i ${INCLUDEDIR}/$i |
139 |
.endfor |
140 |
.for i in ${PHDRS} |
141 |
INCSLINKS+= sys/$i ${INCLUDEDIR}/$i |
142 |
.endfor |
143 |
|
144 |
.if ${MACHINE} != ${MACHINE_CPUARCH} |
145 |
_MARCHS= ${MACHINE_CPUARCH} |
146 |
.endif |
147 |
.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" |
148 |
_MARCHS+= x86 |
149 |
.endif |
150 |
|
151 |
.include <bsd.prog.mk> |
152 |
|
153 |
installincludes: ${SHARED} |
154 |
${SHARED}: compat |
155 |
|
156 |
# Take care of stale directory-level symlinks. |
157 |
compat: |
158 |
.for i in ${LDIRS} ${LSUBDIRS} machine ${_MARCHS} crypto |
159 |
if [ -L ${DESTDIR}${INCLUDEDIR}/$i ]; then \ |
160 |
rm -f ${DESTDIR}${INCLUDEDIR}/$i; \ |
161 |
fi |
162 |
.endfor |
163 |
mtree -deU ${MTREE_FOLLOWS_SYMLINKS} \ |
164 |
-f ${.CURDIR}/../etc/mtree/BSD.include.dist \ |
165 |
-p ${DESTDIR}${INCLUDEDIR} |
166 |
.if ${MK_BIND_LIBS} != "no" |
167 |
mtree -deU ${MTREE_FOLLOWS_SYMLINKS} \ |
168 |
-f ${.CURDIR}/../etc/mtree/BIND.include.dist \ |
169 |
-p ${DESTDIR}${INCLUDEDIR} |
170 |
.endif |
171 |
|
172 |
copies: |
173 |
.for i in ${LDIRS} ${LSUBDIRS} ${LSUBSUBDIRS} altq crypto machine machine/pc \ |
174 |
${_MARCHS} |
175 |
.if exists(${DESTDIR}${INCLUDEDIR}/$i) |
176 |
cd ${DESTDIR}${INCLUDEDIR}/$i; \ |
177 |
for h in *.h; do \ |
178 |
if [ -L $$h ]; then rm -f $$h; fi; \ |
179 |
done |
180 |
.endif |
181 |
.endfor |
182 |
.for i in ${LDIRS} ${LSUBDIRS:Ndev/agp:Ndev/acpica:Ndev/bktr:Ndev/pci} ${LSUBSUBDIRS} |
183 |
cd ${.CURDIR}/../sys; \ |
184 |
${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 $i/*.h \ |
185 |
${DESTDIR}${INCLUDEDIR}/$i |
186 |
.endfor |
187 |
cd ${.CURDIR}/../sys/dev/acpica; \ |
188 |
${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 acpiio.h \ |
189 |
${DESTDIR}${INCLUDEDIR}/dev/acpica; \ |
190 |
${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 acpi_hpet.h \ |
191 |
${DESTDIR}${INCLUDEDIR}/dev/acpica |
192 |
cd ${.CURDIR}/../sys/dev/agp; \ |
193 |
${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 agpreg.h \ |
194 |
${DESTDIR}${INCLUDEDIR}/dev/agp |
195 |
cd ${.CURDIR}/../sys/dev/bktr; \ |
196 |
${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 ioctl_*.h \ |
197 |
${DESTDIR}${INCLUDEDIR}/dev/bktr |
198 |
cd ${.CURDIR}/../sys/dev/pci; \ |
199 |
${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 pcireg.h \ |
200 |
${DESTDIR}${INCLUDEDIR}/dev/pci |
201 |
cd ${.CURDIR}/../sys/contrib/altq/altq; \ |
202 |
${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \ |
203 |
${DESTDIR}${INCLUDEDIR}/altq |
204 |
cd ${.CURDIR}/../sys/fs/cd9660/; \ |
205 |
${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \ |
206 |
${DESTDIR}${INCLUDEDIR}/isofs/cd9660 |
207 |
.if ${MK_IPFILTER} != "no" |
208 |
cd ${.CURDIR}/../sys/contrib/ipfilter/netinet; \ |
209 |
${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \ |
210 |
${DESTDIR}${INCLUDEDIR}/netinet |
211 |
.endif |
212 |
cd ${.CURDIR}/../sys/contrib/pf/net; \ |
213 |
${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \ |
214 |
${DESTDIR}${INCLUDEDIR}/net |
215 |
cd ${.CURDIR}/../sys/crypto; \ |
216 |
${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 rijndael/rijndael.h \ |
217 |
${DESTDIR}${INCLUDEDIR}/crypto |
218 |
cd ${.CURDIR}/../sys/opencrypto; \ |
219 |
${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \ |
220 |
${DESTDIR}${INCLUDEDIR}/crypto |
221 |
cd ${.CURDIR}/../sys/${MACHINE}/include; \ |
222 |
${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \ |
223 |
${DESTDIR}${INCLUDEDIR}/machine |
224 |
.if exists(${.CURDIR}/../sys/${MACHINE}/include/pc) |
225 |
cd ${.CURDIR}/../sys/${MACHINE}/include/pc; \ |
226 |
${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \ |
227 |
${DESTDIR}${INCLUDEDIR}/machine/pc |
228 |
.endif |
229 |
.for _MARCH in ${_MARCHS} |
230 |
.if exists(${.CURDIR}/../sys/${_MARCH}/include) |
231 |
${INSTALL} -d -o ${BINOWN} -g ${BINGRP} -m 755 \ |
232 |
${DESTDIR}${INCLUDEDIR}/${_MARCH}; \ |
233 |
cd ${.CURDIR}/../sys/${_MARCH}/include; \ |
234 |
${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \ |
235 |
${DESTDIR}${INCLUDEDIR}/${_MARCH} |
236 |
.if exists(${.CURDIR}/../sys/${_MARCH}/include/pc) |
237 |
${INSTALL} -d -o ${BINOWN} -g ${BINGRP} -m 755 \ |
238 |
${DESTDIR}${INCLUDEDIR}/${_MARCH}/pc; \ |
239 |
cd ${.CURDIR}/../sys/${_MARCH}/include/pc; \ |
240 |
${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \ |
241 |
${DESTDIR}${INCLUDEDIR}/${_MARCH}/pc |
242 |
.endif |
243 |
.endif |
244 |
.endfor |
245 |
cd ${.CURDIR}/../sys/rpc; \ |
246 |
${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 types.h \ |
247 |
${DESTDIR}${INCLUDEDIR}/rpc |
248 |
|
249 |
symlinks: |
250 |
@${ECHO} "Setting up symlinks to kernel source tree..." |
251 |
mkdir -p ${DESTDIR}${INCLUDEDIR}/apple/System |
252 |
ln -fs ../sys ${DESTDIR}${INCLUDEDIR}/apple/System/sys |
253 |
.for i in ${LDIRS} |
254 |
cd ${.CURDIR}/../sys/$i; \ |
255 |
for h in *.h; do \ |
256 |
ln -fs ../../../sys/$i/$$h ${DESTDIR}${INCLUDEDIR}/$i; \ |
257 |
done |
258 |
.endfor |
259 |
.for i in ${LSUBDIRS:Ndev/agp:Ndev/acpica:Ndev/bktr:Ndev/pci} |
260 |
cd ${.CURDIR}/../sys/$i; \ |
261 |
for h in *.h; do \ |
262 |
ln -fs ../../../../sys/$i/$$h ${DESTDIR}${INCLUDEDIR}/$i; \ |
263 |
done |
264 |
.endfor |
265 |
cd ${.CURDIR}/../sys/dev/acpica; \ |
266 |
for h in acpiio.h acpi_hpet.h; do \ |
267 |
ln -fs ../../../../sys/dev/acpica/$$h \ |
268 |
${DESTDIR}${INCLUDEDIR}/dev/acpica; \ |
269 |
done |
270 |
cd ${.CURDIR}/../sys/dev/agp; \ |
271 |
for h in agpreg.h; do \ |
272 |
ln -fs ../../../../sys/dev/agp/$$h \ |
273 |
${DESTDIR}${INCLUDEDIR}/dev/agp; \ |
274 |
done |
275 |
cd ${.CURDIR}/../sys/dev/bktr; \ |
276 |
for h in ioctl_*.h; do \ |
277 |
ln -fs ../../../../sys/dev/bktr/$$h \ |
278 |
${DESTDIR}${INCLUDEDIR}/dev/bktr; \ |
279 |
done |
280 |
cd ${.CURDIR}/../sys/dev/pci; \ |
281 |
for h in pcireg.h; do \ |
282 |
ln -fs ../../../../sys/dev/pci/$$h \ |
283 |
${DESTDIR}${INCLUDEDIR}/dev/pci; \ |
284 |
done |
285 |
.for i in ${LSUBSUBDIRS} |
286 |
cd ${.CURDIR}/../sys/$i; \ |
287 |
for h in *.h; do \ |
288 |
ln -fs ../../../../../sys/$i/$$h ${DESTDIR}${INCLUDEDIR}/$i; \ |
289 |
done |
290 |
.endfor |
291 |
cd ${.CURDIR}/../sys/contrib/altq/altq; \ |
292 |
for h in *.h; do \ |
293 |
ln -fs ../../../sys/contrib/altq/altq/$$h \ |
294 |
${DESTDIR}${INCLUDEDIR}/altq; \ |
295 |
done |
296 |
.if ${MK_IPFILTER} != "no" |
297 |
cd ${.CURDIR}/../sys/contrib/ipfilter/netinet; \ |
298 |
for h in *.h; do \ |
299 |
ln -fs ../../../sys/contrib/ipfilter/netinet/$$h \ |
300 |
${DESTDIR}${INCLUDEDIR}/netinet; \ |
301 |
done |
302 |
.endif |
303 |
cd ${.CURDIR}/../sys/contrib/pf/net; \ |
304 |
for h in *.h; do \ |
305 |
ln -fs ../../../sys/contrib/pf/net/$$h \ |
306 |
${DESTDIR}${INCLUDEDIR}/net; \ |
307 |
done |
308 |
cd ${.CURDIR}/../sys/crypto; \ |
309 |
for h in rijndael/rijndael.h; do \ |
310 |
ln -fs ../../../sys/crypto/$$h \ |
311 |
${DESTDIR}${INCLUDEDIR}/crypto; \ |
312 |
done |
313 |
cd ${.CURDIR}/../sys/opencrypto; \ |
314 |
for h in *.h; do \ |
315 |
ln -fs ../../../sys/opencrypto/$$h \ |
316 |
${DESTDIR}${INCLUDEDIR}/crypto; \ |
317 |
done |
318 |
cd ${.CURDIR}/../sys/${MACHINE}/include; \ |
319 |
for h in *.h; do \ |
320 |
ln -fs ../../../sys/${MACHINE}/include/$$h \ |
321 |
${DESTDIR}${INCLUDEDIR}/machine; \ |
322 |
done |
323 |
.if exists(${.CURDIR}/../sys/${MACHINE}/include/pc) |
324 |
cd ${.CURDIR}/../sys/${MACHINE}/include/pc; \ |
325 |
for h in *.h; do \ |
326 |
ln -fs ../../../../sys/${MACHINE}/include/pc/$$h \ |
327 |
${DESTDIR}${INCLUDEDIR}/machine/pc; \ |
328 |
done |
329 |
.endif |
330 |
.if exists(${.CURDIR}/../sys/${MACHINE}/include/mach) |
331 |
cd ${.CURDIR}/../sys/${MACHINE}/include/mach; \ |
332 |
for h in *.h; do \ |
333 |
ln -fs ../../../../sys/${MACHINE}/include/mach/$$h \ |
334 |
${DESTDIR}${INCLUDEDIR}/machine/mach; \ |
335 |
done |
336 |
for d in *.defs; do \ |
337 |
ln -fs ../../../../sys/${MACHINE}/include/mach/$$d \ |
338 |
${DESTDIR}${INCLUDEDIR}/machine/mach; \ |
339 |
done |
340 |
|
341 |
.endif |
342 |
.for _MARCH in ${_MARCHS} |
343 |
.if exists(${.CURDIR}/../sys/${_MARCH}/include) |
344 |
${INSTALL} -d -o ${BINOWN} -g ${BINGRP} -m 755 \ |
345 |
${DESTDIR}${INCLUDEDIR}/${_MARCH}; \ |
346 |
cd ${.CURDIR}/../sys/${_MARCH}/include; \ |
347 |
for h in *.h; do \ |
348 |
ln -fs ../../../sys/${_MARCH}/include/$$h \ |
349 |
${DESTDIR}${INCLUDEDIR}/${_MARCH}; \ |
350 |
done |
351 |
.if exists(${.CURDIR}/../sys/${_MARCH}/include/pc) |
352 |
${INSTALL} -d -o ${BINOWN} -g ${BINGRP} -m 755 \ |
353 |
${DESTDIR}${INCLUDEDIR}/${_MARCH}/pc; \ |
354 |
cd ${.CURDIR}/../sys/${_MARCH}/include/pc; \ |
355 |
for h in *.h; do \ |
356 |
ln -fs ../../../../sys/${_MARCH}/include/pc/$$h \ |
357 |
${DESTDIR}${INCLUDEDIR}/${_MARCH}/pc; \ |
358 |
done |
359 |
.endif |
360 |
.endif |
361 |
.endfor |
362 |
cd ${.CURDIR}/../sys/fs/cd9660; \ |
363 |
for h in *.h; do \ |
364 |
ln -fs ../../../../sys/fs/cd9660/$$h \ |
365 |
${DESTDIR}${INCLUDEDIR}/isofs/cd9660; \ |
366 |
done |
367 |
cd ${.CURDIR}/../sys/rpc; \ |
368 |
for h in types.h; do \ |
369 |
ln -fs ../../../sys/rpc/$$h \ |
370 |
${DESTDIR}${INCLUDEDIR}/rpc; \ |
371 |
done |