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 gssapi protocols rpcsvc rpc xlocale
10 INCS= a.out.h ar.h assert.h bitstring.h complex.h cpio.h _ctype.h ctype.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 \
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 \
18 netdb.h nl_types.h nlist.h nss.h nsswitch.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
29 .PATH: ${.CURDIR}/../contrib/libc-vis
32 MHDRS= float.h floatingpoint.h stdarg.h
34 PHDRS= sched.h _semaphore.h
36 LHDRS= aio.h errno.h fcntl.h linker_set.h poll.h stdint.h syslog.h \
39 LDIRS= bsm cam geom net net80211 netatalk netgraph netinet netinet6 \
40 netipsec ${_netipx} netnatm ${_netncp} netsmb \
41 nfs nfsclient nfsserver \
44 LSUBDIRS= cam/ata cam/scsi \
45 dev/acpica dev/an dev/bktr dev/ciss dev/filemon dev/firewire dev/hwpmc \
46 dev/ic dev/iicbus ${_dev_ieee488} dev/io dev/lmc dev/mfi dev/ofw \
47 dev/pbio ${_dev_powermac_nvram} dev/ppbus dev/smbus \
48 dev/speaker dev/usb dev/utopia dev/vkbd dev/wi \
49 fs/devfs fs/fdescfs fs/fifofs fs/msdosfs fs/nfs fs/ntfs fs/nullfs \
50 ${_fs_nwfs} fs/portalfs fs/procfs fs/smbfs fs/udf fs/unionfs \
51 geom/cache geom/concat geom/eli geom/gate geom/journal geom/label \
52 geom/mirror geom/mountver geom/multipath geom/nop \
53 geom/raid geom/raid3 geom/shsec geom/stripe geom/virstor \
54 netgraph/atm netgraph/netflow \
56 security/mac_biba security/mac_bsdextended security/mac_lomac \
57 security/mac_mls security/mac_partition \
60 LSUBSUBDIRS= dev/mpt/mpilib
62 .if ${MACHINE_ARCH} == "powerpc" || ${MACHINE_ARCH} == "powerpc64"
63 _dev_powermac_nvram= dev/powermac_nvram
66 .if ${MK_GPIB} != "no"
67 _dev_ieee488= dev/ieee488
70 .if ${MK_HESIOD} != "no"
74 .if ${MK_ICONV} != "no"
78 .if ${MK_BLUETOOTH} != "no"
79 LSUBSUBDIRS+= netgraph/bluetooth/include
82 # XXX unconditionally needed by <netsmb/netbios.h>
83 #.if ${MK_IPX} != "no"
92 # Define SHARED to indicate whether you want symbolic links to the system
93 # source (``symlinks''), or a separate copy (``copies''). ``symlinks'' is
94 # probably only useful for developers and should be avoided if you do not
95 # wish to tie your /usr/include and /usr/src together.
101 osreldate.h: ${.CURDIR}/../sys/conf/newvers.sh ${.CURDIR}/../sys/sys/param.h \
103 @${ECHO} creating osreldate.h from newvers.sh
105 PARAMFILE=${.CURDIR}/../sys/sys/param.h; \
106 . ${.CURDIR}/../sys/conf/newvers.sh; \
107 echo "$$COPYRIGHT" > osreldate.h; \
108 echo "#ifdef _KERNEL" >> osreldate.h; \
109 echo "#error \"<osreldate.h> cannot be used in the kernel, use <sys/param.h>\"" >> osreldate.h; \
110 echo "#else" >> osreldate.h; \
111 echo "#undef __FreeBSD_version" >> osreldate.h; \
112 echo "#define __FreeBSD_version $$RELDATE" >> osreldate.h; \
113 echo "#endif" >> osreldate.h
116 INCSLINKS+= sys/$i ${INCLUDEDIR}/$i
119 INCSLINKS+= machine/$i ${INCLUDEDIR}/$i
122 INCSLINKS+= sys/$i ${INCLUDEDIR}/$i
125 .if ${MACHINE} != ${MACHINE_CPUARCH}
126 _MARCHS= ${MACHINE_CPUARCH}
128 .if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64"
132 .include <bsd.prog.mk>
134 installincludes: ${SHARED}
137 # Take care of stale directory-level symlinks.
139 .for i in ${LDIRS} ${LSUBDIRS} machine ${_MARCHS} crypto
140 if [ -L ${DESTDIR}${INCLUDEDIR}/$i ]; then \
141 rm -f ${DESTDIR}${INCLUDEDIR}/$i; \
144 mtree -deU ${MTREE_FOLLOWS_SYMLINKS} \
145 -f ${.CURDIR}/../etc/mtree/BSD.include.dist \
146 -p ${DESTDIR}${INCLUDEDIR}
147 .if ${MK_BIND_LIBS} != "no"
148 mtree -deU ${MTREE_FOLLOWS_SYMLINKS} \
149 -f ${.CURDIR}/../etc/mtree/BIND.include.dist \
150 -p ${DESTDIR}${INCLUDEDIR}
154 .for i in ${LDIRS} ${LSUBDIRS} ${LSUBSUBDIRS} altq crypto machine machine/pc \
156 .if exists(${DESTDIR}${INCLUDEDIR}/$i)
157 cd ${DESTDIR}${INCLUDEDIR}/$i; \
159 if [ -L $$h ]; then rm -f $$h; fi; \
163 .for i in ${LDIRS} ${LSUBDIRS:Ndev/acpica:Ndev/bktr} ${LSUBSUBDIRS}
164 cd ${.CURDIR}/../sys; \
165 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 $i/*.h \
166 ${DESTDIR}${INCLUDEDIR}/$i
168 cd ${.CURDIR}/../sys/dev/acpica; \
169 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 acpiio.h \
170 ${DESTDIR}${INCLUDEDIR}/dev/acpica
171 cd ${.CURDIR}/../sys/dev/bktr; \
172 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 ioctl_*.h \
173 ${DESTDIR}${INCLUDEDIR}/dev/bktr
174 cd ${.CURDIR}/../sys/contrib/altq/altq; \
175 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
176 ${DESTDIR}${INCLUDEDIR}/altq
177 cd ${.CURDIR}/../sys/fs/cd9660/; \
178 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
179 ${DESTDIR}${INCLUDEDIR}/isofs/cd9660
180 .if ${MK_IPFILTER} != "no"
181 cd ${.CURDIR}/../sys/contrib/ipfilter/netinet; \
182 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
183 ${DESTDIR}${INCLUDEDIR}/netinet
185 cd ${.CURDIR}/../sys/contrib/pf/net; \
186 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
187 ${DESTDIR}${INCLUDEDIR}/net
188 cd ${.CURDIR}/../sys/crypto; \
189 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 rijndael/rijndael.h \
190 ${DESTDIR}${INCLUDEDIR}/crypto
191 cd ${.CURDIR}/../sys/opencrypto; \
192 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
193 ${DESTDIR}${INCLUDEDIR}/crypto
194 cd ${.CURDIR}/../sys/${MACHINE}/include; \
195 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
196 ${DESTDIR}${INCLUDEDIR}/machine
197 .if exists(${.CURDIR}/../sys/${MACHINE}/include/pc)
198 cd ${.CURDIR}/../sys/${MACHINE}/include/pc; \
199 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
200 ${DESTDIR}${INCLUDEDIR}/machine/pc
202 .for _MARCH in ${_MARCHS}
203 .if exists(${.CURDIR}/../sys/${_MARCH}/include)
204 ${INSTALL} -d -o ${BINOWN} -g ${BINGRP} -m 755 \
205 ${DESTDIR}${INCLUDEDIR}/${_MARCH}; \
206 cd ${.CURDIR}/../sys/${_MARCH}/include; \
207 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
208 ${DESTDIR}${INCLUDEDIR}/${_MARCH}
209 .if exists(${.CURDIR}/../sys/${_MARCH}/include/pc)
210 ${INSTALL} -d -o ${BINOWN} -g ${BINGRP} -m 755 \
211 ${DESTDIR}${INCLUDEDIR}/${_MARCH}/pc; \
212 cd ${.CURDIR}/../sys/${_MARCH}/include/pc; \
213 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
214 ${DESTDIR}${INCLUDEDIR}/${_MARCH}/pc
218 cd ${.CURDIR}/../sys/rpc; \
219 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 types.h \
220 ${DESTDIR}${INCLUDEDIR}/rpc
223 @${ECHO} "Setting up symlinks to kernel source tree..."
225 cd ${.CURDIR}/../sys/$i; \
227 ln -fs ../../../sys/$i/$$h ${DESTDIR}${INCLUDEDIR}/$i; \
230 .for i in ${LSUBDIRS:Ndev/acpica:Ndev/bktr}
231 cd ${.CURDIR}/../sys/$i; \
233 ln -fs ../../../../sys/$i/$$h ${DESTDIR}${INCLUDEDIR}/$i; \
236 cd ${.CURDIR}/../sys/dev/acpica; \
237 for h in acpiio.h; do \
238 ln -fs ../../../../sys/dev/acpica/$$h \
239 ${DESTDIR}${INCLUDEDIR}/dev/acpica; \
241 cd ${.CURDIR}/../sys/dev/bktr; \
242 for h in ioctl_*.h; do \
243 ln -fs ../../../../sys/dev/bktr/$$h \
244 ${DESTDIR}${INCLUDEDIR}/dev/bktr; \
246 .for i in ${LSUBSUBDIRS}
247 cd ${.CURDIR}/../sys/$i; \
249 ln -fs ../../../../../sys/$i/$$h ${DESTDIR}${INCLUDEDIR}/$i; \
252 cd ${.CURDIR}/../sys/contrib/altq/altq; \
254 ln -fs ../../../sys/contrib/altq/altq/$$h \
255 ${DESTDIR}${INCLUDEDIR}/altq; \
257 .if ${MK_IPFILTER} != "no"
258 cd ${.CURDIR}/../sys/contrib/ipfilter/netinet; \
260 ln -fs ../../../sys/contrib/ipfilter/netinet/$$h \
261 ${DESTDIR}${INCLUDEDIR}/netinet; \
264 cd ${.CURDIR}/../sys/contrib/pf/net; \
266 ln -fs ../../../sys/contrib/pf/net/$$h \
267 ${DESTDIR}${INCLUDEDIR}/net; \
269 cd ${.CURDIR}/../sys/crypto; \
270 for h in rijndael/rijndael.h; do \
271 ln -fs ../../../sys/crypto/$$h \
272 ${DESTDIR}${INCLUDEDIR}/crypto; \
274 cd ${.CURDIR}/../sys/opencrypto; \
276 ln -fs ../../../sys/opencrypto/$$h \
277 ${DESTDIR}${INCLUDEDIR}/crypto; \
279 cd ${.CURDIR}/../sys/${MACHINE}/include; \
281 ln -fs ../../../sys/${MACHINE}/include/$$h \
282 ${DESTDIR}${INCLUDEDIR}/machine; \
284 .if exists(${.CURDIR}/../sys/${MACHINE}/include/pc)
285 cd ${.CURDIR}/../sys/${MACHINE}/include/pc; \
287 ln -fs ../../../../sys/${MACHINE}/include/pc/$$h \
288 ${DESTDIR}${INCLUDEDIR}/machine/pc; \
291 .for _MARCH in ${_MARCHS}
292 .if exists(${.CURDIR}/../sys/${_MARCH}/include)
293 ${INSTALL} -d -o ${BINOWN} -g ${BINGRP} -m 755 \
294 ${DESTDIR}${INCLUDEDIR}/${_MARCH}; \
295 cd ${.CURDIR}/../sys/${_MARCH}/include; \
297 ln -fs ../../../sys/${_MARCH}/include/$$h \
298 ${DESTDIR}${INCLUDEDIR}/${_MARCH}; \
300 .if exists(${.CURDIR}/../sys/${_MARCH}/include/pc)
301 ${INSTALL} -d -o ${BINOWN} -g ${BINGRP} -m 755 \
302 ${DESTDIR}${INCLUDEDIR}/${_MARCH}/pc; \
303 cd ${.CURDIR}/../sys/${_MARCH}/include/pc; \
305 ln -fs ../../../../sys/${_MARCH}/include/pc/$$h \
306 ${DESTDIR}${INCLUDEDIR}/${_MARCH}/pc; \
311 cd ${.CURDIR}/../sys/fs/cd9660; \
313 ln -fs ../../../../sys/fs/cd9660/$$h \
314 ${DESTDIR}${INCLUDEDIR}/isofs/cd9660; \
316 cd ${.CURDIR}/../sys/rpc; \
317 for h in types.h; do \
318 ln -fs ../../../sys/rpc/$$h \
319 ${DESTDIR}${INCLUDEDIR}/rpc; \