1 # @(#)Makefile 8.2 (Berkeley) 1/4/94
4 # Doing a "make install" builds /usr/include.
8 CLEANFILES= osreldate.h version vers.c
9 SUBDIR= arpa protocols rpcsvc rpc xlocale
11 INCS= a.out.h ar.h assert.h bitstring.h complex.h cpio.h _ctype.h ctype.h \
13 dirent.h dlfcn.h elf.h elf-hints.h err.h fmtmsg.h fnmatch.h fstab.h \
14 fts.h ftw.h getopt.h glob.h grp.h \
16 inttypes.h iso646.h kenv.h langinfo.h libgen.h limits.h link.h \
17 locale.h malloc.h malloc_np.h memory.h monetary.h mpool.h mqueue.h \
19 netdb.h nl_types.h nlist.h nss.h nsswitch.h paths.h \
20 printf.h proc_service.h pthread.h \
21 pthread_np.h pwd.h ranlib.h readpassphrase.h regex.h \
22 res_update.h resolv.h runetype.h search.h semaphore.h setjmp.h \
23 signal.h spawn.h stab.h stdalign.h stdbool.h stddef.h \
24 stdnoreturn.h stdio.h stdlib.h string.h stringlist.h \
25 strings.h sysexits.h tar.h termios.h tgmath.h \
26 time.h timeconv.h timers.h ttyent.h \
27 uchar.h ulimit.h unistd.h utime.h utmpx.h uuid.h varargs.h \
28 wchar.h wctype.h wordexp.h xlocale.h
30 .PATH: ${.CURDIR}/../contrib/libc-vis
33 MHDRS= float.h floatingpoint.h stdarg.h
35 PHDRS= sched.h _semaphore.h
37 LHDRS= aio.h errno.h fcntl.h linker_set.h poll.h stdatomic.h stdint.h \
40 LDIRS= bsm cam geom net net80211 netatalk netgraph netinet netinet6 \
41 netipsec ${_netipx} netnatm netsmb \
42 nfs nfsclient nfsserver \
45 LSUBDIRS= cam/ata cam/scsi \
46 dev/acpica dev/agp dev/an dev/bktr dev/ciss dev/filemon dev/firewire \
48 dev/ic dev/iicbus ${_dev_ieee488} dev/io dev/lmc dev/mfi dev/nvme \
49 dev/ofw dev/pbio dev/pci ${_dev_powermac_nvram} dev/ppbus dev/smbus \
50 dev/speaker dev/utopia dev/vkbd dev/wi \
51 fs/devfs fs/fdescfs fs/msdosfs fs/nandfs fs/nfs fs/nullfs \
52 fs/procfs fs/smbfs fs/udf fs/unionfs \
53 geom/cache geom/concat geom/eli geom/gate geom/journal geom/label \
54 geom/mirror geom/mountver geom/multipath geom/nop \
55 geom/raid geom/raid3 geom/shsec geom/stripe geom/virstor \
56 netgraph/atm netgraph/netflow \
58 security/mac_biba security/mac_bsdextended security/mac_lomac \
59 security/mac_mls security/mac_partition \
62 LSUBSUBDIRS= dev/mpt/mpilib
64 .if ${MK_BLUETOOTH} != "no"
65 LSUBSUBDIRS+= netgraph/bluetooth/include
68 .if ${MK_GPIB} != "no"
69 _dev_ieee488= dev/ieee488
72 .if ${MK_GSSAPI} != "no"
77 .if ${MK_HESIOD} != "no"
81 # XXX unconditionally needed by <netsmb/netbios.h>
82 #.if ${MK_IPX} != "no"
86 # Handle the #define aliases for libiconv
87 .if ${MK_ICONV} == "yes"
95 .if ${MACHINE_ARCH} == "powerpc" || ${MACHINE_ARCH} == "powerpc64"
96 _dev_powermac_nvram= dev/powermac_nvram
99 # Define SHARED to indicate whether you want symbolic links to the system
100 # source (``symlinks''), or a separate copy (``copies''). ``symlinks'' is
101 # probably only useful for developers and should be avoided if you do not
102 # wish to tie your /usr/include and /usr/src together.
108 SYSDIR= ${.CURDIR}/../sys
109 NEWVERS_SH= ${SYSDIR}/conf/newvers.sh
110 PARAM_H= ${SYSDIR}/sys/param.h
111 MK_OSRELDATE_SH= ${.CURDIR}/mk-osreldate.sh
113 osreldate.h vers.c: ${NEWVERS_SH} ${PARAM_H} ${MK_OSRELDATE_SH}
116 NEWVERS_SH=${NEWVERS_SH} \
119 sh ${MK_OSRELDATE_SH}
122 INCSLINKS+= sys/$i ${INCLUDEDIR}/$i
125 INCSLINKS+= machine/$i ${INCLUDEDIR}/$i
128 INCSLINKS+= sys/$i ${INCLUDEDIR}/$i
131 .if ${MACHINE} != ${MACHINE_CPUARCH}
132 _MARCHS= ${MACHINE_CPUARCH}
134 .if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64"
138 .include <bsd.prog.mk>
140 installincludes: ${SHARED}
143 # Take care of stale directory-level symlinks.
145 .for i in ${LDIRS} ${LSUBDIRS} machine ${_MARCHS} crypto
146 if [ -L ${DESTDIR}${INCLUDEDIR}/$i ]; then \
147 rm -f ${DESTDIR}${INCLUDEDIR}/$i; \
150 mtree -deU ${MTREE_FOLLOWS_SYMLINKS} \
151 -f ${.CURDIR}/../etc/mtree/BSD.include.dist \
152 -p ${DESTDIR}${INCLUDEDIR}
155 .for i in ${LDIRS} ${LSUBDIRS} ${LSUBSUBDIRS} altq crypto machine machine/pc \
157 .if exists(${DESTDIR}${INCLUDEDIR}/$i)
158 cd ${DESTDIR}${INCLUDEDIR}/$i; \
160 if [ -L $$h ]; then rm -f $$h; fi; \
164 .for i in ${LDIRS} ${LSUBDIRS:Ndev/agp:Ndev/acpica:Ndev/bktr:Ndev/nand:Ndev/pci} ${LSUBSUBDIRS}
165 cd ${.CURDIR}/../sys; \
166 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 $i/*.h \
167 ${DESTDIR}${INCLUDEDIR}/$i
169 cd ${.CURDIR}/../sys/dev/acpica; \
170 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 acpiio.h \
171 ${DESTDIR}${INCLUDEDIR}/dev/acpica; \
172 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 acpi_hpet.h \
173 ${DESTDIR}${INCLUDEDIR}/dev/acpica
174 cd ${.CURDIR}/../sys/dev/agp; \
175 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 agpreg.h \
176 ${DESTDIR}${INCLUDEDIR}/dev/agp
177 cd ${.CURDIR}/../sys/dev/bktr; \
178 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 ioctl_*.h \
179 ${DESTDIR}${INCLUDEDIR}/dev/bktr
180 .if ${MK_NAND} != "no"
181 cd ${.CURDIR}/../sys/dev/nand; \
182 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 nandsim.h \
183 ${DESTDIR}${INCLUDEDIR}/dev/nand; \
184 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 nand_dev.h \
185 ${DESTDIR}${INCLUDEDIR}/dev/nand
187 cd ${.CURDIR}/../sys/dev/pci; \
188 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 pcireg.h \
189 ${DESTDIR}${INCLUDEDIR}/dev/pci
190 cd ${.CURDIR}/../sys/contrib/altq/altq; \
191 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
192 ${DESTDIR}${INCLUDEDIR}/altq
193 cd ${.CURDIR}/../sys/fs/cd9660/; \
194 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
195 ${DESTDIR}${INCLUDEDIR}/isofs/cd9660
196 .if ${MK_IPFILTER} != "no"
197 cd ${.CURDIR}/../sys/contrib/ipfilter/netinet; \
198 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
199 ${DESTDIR}${INCLUDEDIR}/netinet
202 cd ${.CURDIR}/../sys/netpfil/pf; \
203 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
204 ${DESTDIR}${INCLUDEDIR}/netpfil/pf
206 cd ${.CURDIR}/../sys/crypto; \
207 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 rijndael/rijndael.h \
208 ${DESTDIR}${INCLUDEDIR}/crypto
209 cd ${.CURDIR}/../sys/opencrypto; \
210 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
211 ${DESTDIR}${INCLUDEDIR}/crypto
212 cd ${.CURDIR}/../sys/${MACHINE}/include; \
213 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
214 ${DESTDIR}${INCLUDEDIR}/machine
215 .if exists(${.CURDIR}/../sys/${MACHINE}/include/pc)
216 cd ${.CURDIR}/../sys/${MACHINE}/include/pc; \
217 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
218 ${DESTDIR}${INCLUDEDIR}/machine/pc
220 .for _MARCH in ${_MARCHS}
221 .if exists(${.CURDIR}/../sys/${_MARCH}/include)
222 ${INSTALL} -d -o ${BINOWN} -g ${BINGRP} -m 755 \
223 ${DESTDIR}${INCLUDEDIR}/${_MARCH}; \
224 cd ${.CURDIR}/../sys/${_MARCH}/include; \
225 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
226 ${DESTDIR}${INCLUDEDIR}/${_MARCH}
227 .if exists(${.CURDIR}/../sys/${_MARCH}/include/pc)
228 ${INSTALL} -d -o ${BINOWN} -g ${BINGRP} -m 755 \
229 ${DESTDIR}${INCLUDEDIR}/${_MARCH}/pc; \
230 cd ${.CURDIR}/../sys/${_MARCH}/include/pc; \
231 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
232 ${DESTDIR}${INCLUDEDIR}/${_MARCH}/pc
236 cd ${.CURDIR}/../sys/rpc; \
237 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 types.h \
238 ${DESTDIR}${INCLUDEDIR}/rpc
241 @${ECHO} "Setting up symlinks to kernel source tree..."
243 cd ${.CURDIR}/../sys/$i; \
245 ln -fs ../../../sys/$i/$$h ${DESTDIR}${INCLUDEDIR}/$i; \
248 .for i in ${LSUBDIRS:Ndev/agp:Ndev/acpica:Ndev/bktr:Ndev/nand:Ndev/pci}
249 cd ${.CURDIR}/../sys/$i; \
251 ln -fs ../../../../sys/$i/$$h ${DESTDIR}${INCLUDEDIR}/$i; \
254 cd ${.CURDIR}/../sys/dev/acpica; \
255 for h in acpiio.h acpi_hpet.h; do \
256 ln -fs ../../../../sys/dev/acpica/$$h \
257 ${DESTDIR}${INCLUDEDIR}/dev/acpica; \
259 cd ${.CURDIR}/../sys/dev/agp; \
260 for h in agpreg.h; do \
261 ln -fs ../../../../sys/dev/agp/$$h \
262 ${DESTDIR}${INCLUDEDIR}/dev/agp; \
264 cd ${.CURDIR}/../sys/dev/bktr; \
265 for h in ioctl_*.h; do \
266 ln -fs ../../../../sys/dev/bktr/$$h \
267 ${DESTDIR}${INCLUDEDIR}/dev/bktr; \
269 .if ${MK_NAND} != "no"
270 cd ${.CURDIR}/../sys/dev/nand; \
271 for h in nandsim.h nand_dev.h; do \
272 ln -fs ../../../../sys/dev/nand/$$h \
273 ${DESTDIR}${INCLUDEDIR}/dev/nand; \
276 cd ${.CURDIR}/../sys/dev/pci; \
277 for h in pcireg.h; do \
278 ln -fs ../../../../sys/dev/pci/$$h \
279 ${DESTDIR}${INCLUDEDIR}/dev/pci; \
281 .for i in ${LSUBSUBDIRS}
282 cd ${.CURDIR}/../sys/$i; \
284 ln -fs ../../../../../sys/$i/$$h ${DESTDIR}${INCLUDEDIR}/$i; \
287 cd ${.CURDIR}/../sys/contrib/altq/altq; \
289 ln -fs ../../../sys/contrib/altq/altq/$$h \
290 ${DESTDIR}${INCLUDEDIR}/altq; \
292 .if ${MK_IPFILTER} != "no"
293 cd ${.CURDIR}/../sys/contrib/ipfilter/netinet; \
295 ln -fs ../../../sys/contrib/ipfilter/netinet/$$h \
296 ${DESTDIR}${INCLUDEDIR}/netinet; \
300 cd ${.CURDIR}/../sys/netpfil/pf; \
302 ln -fs ../../../../sys/netpfil/pf/$$h \
303 ${DESTDIR}${INCLUDEDIR}/netpfil/pf; \
306 cd ${.CURDIR}/../sys/crypto; \
307 for h in rijndael/rijndael.h; do \
308 ln -fs ../../../sys/crypto/$$h \
309 ${DESTDIR}${INCLUDEDIR}/crypto; \
311 cd ${.CURDIR}/../sys/opencrypto; \
313 ln -fs ../../../sys/opencrypto/$$h \
314 ${DESTDIR}${INCLUDEDIR}/crypto; \
316 cd ${.CURDIR}/../sys/${MACHINE}/include; \
318 ln -fs ../../../sys/${MACHINE}/include/$$h \
319 ${DESTDIR}${INCLUDEDIR}/machine; \
321 .if exists(${.CURDIR}/../sys/${MACHINE}/include/pc)
322 cd ${.CURDIR}/../sys/${MACHINE}/include/pc; \
324 ln -fs ../../../../sys/${MACHINE}/include/pc/$$h \
325 ${DESTDIR}${INCLUDEDIR}/machine/pc; \
328 .for _MARCH in ${_MARCHS}
329 .if exists(${.CURDIR}/../sys/${_MARCH}/include)
330 ${INSTALL} -d -o ${BINOWN} -g ${BINGRP} -m 755 \
331 ${DESTDIR}${INCLUDEDIR}/${_MARCH}; \
332 cd ${.CURDIR}/../sys/${_MARCH}/include; \
334 ln -fs ../../../sys/${_MARCH}/include/$$h \
335 ${DESTDIR}${INCLUDEDIR}/${_MARCH}; \
337 .if exists(${.CURDIR}/../sys/${_MARCH}/include/pc)
338 ${INSTALL} -d -o ${BINOWN} -g ${BINGRP} -m 755 \
339 ${DESTDIR}${INCLUDEDIR}/${_MARCH}/pc; \
340 cd ${.CURDIR}/../sys/${_MARCH}/include/pc; \
342 ln -fs ../../../../sys/${_MARCH}/include/pc/$$h \
343 ${DESTDIR}${INCLUDEDIR}/${_MARCH}/pc; \
348 cd ${.CURDIR}/../sys/fs/cd9660; \
350 ln -fs ../../../../sys/fs/cd9660/$$h \
351 ${DESTDIR}${INCLUDEDIR}/isofs/cd9660; \
353 cd ${.CURDIR}/../sys/rpc; \
354 for h in types.h; do \
355 ln -fs ../../../sys/rpc/$$h \
356 ${DESTDIR}${INCLUDEDIR}/rpc; \