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
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 \
14 histedit.h 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 \
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 regexp.h \
21 res_update.h resolv.h runetype.h search.h setjmp.h sgtty.h \
23 stdbool.h stddef.h stdio.h stdlib.h string.h stringlist.h \
24 strings.h sysexits.h tar.h tgmath.h \
25 time.h timeconv.h timers.h ttyent.h \
26 ulimit.h unistd.h utime.h utmp.h uuid.h varargs.h vis.h wchar.h \
29 I4BHDRS=i4b_cause.h i4b_debug.h i4b_ioctl.h i4b_rbch_ioctl.h \
30 i4b_tel_ioctl.h i4b_trace.h
32 MHDRS= float.h floatingpoint.h stdarg.h
34 PHDRS= sched.h semaphore.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 \
46 dev/acpica dev/an dev/bktr dev/firewire dev/hwpmc \
47 dev/ic dev/iicbus ${_dev_ieee488} dev/lmc dev/ofw \
48 dev/pbio ${_dev_powermac_nvram} dev/ppbus dev/smbus dev/speaker dev/usb dev/utopia dev/vkbd dev/wi \
49 fs/devfs fs/fdescfs fs/fifofs fs/msdosfs 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/nop geom/raid3 geom/shsec geom/stripe geom/virstor \
53 netgraph/atm netgraph/netflow \
55 security/mac_biba security/mac_bsdextended security/mac_lomac \
56 security/mac_mls security/mac_partition \
58 #LSUBDIRS+= netatm/ipatm netatm/sigpvc netatm/spans netatm/uni
60 .if ${MACHINE_ARCH} == "powerpc"
61 _dev_powermac_nvram= dev/powermac_nvram
64 .if ${MK_GPIB} != "no"
65 _dev_ieee488= dev/ieee488
68 .if ${MK_HESIOD} != "no"
72 .if ${MK_BLUETOOTH} != "no"
73 LSUBSUBDIRS= netgraph/bluetooth/include
76 # XXX unconditionally needed by <netsmb/netbios.h>
77 #.if ${MK_IPX} != "no"
86 # Define SHARED to indicate whether you want symbolic links to the system
87 # source (``symlinks''), or a separate copy (``copies''). ``symlinks'' is
88 # probably only useful for developers and should be avoided if you do not
89 # wish to tie your /usr/include and /usr/src together.
95 osreldate.h: ${.CURDIR}/../sys/conf/newvers.sh ${.CURDIR}/../sys/sys/param.h \
97 @${ECHO} creating osreldate.h from newvers.sh
99 PARAMFILE=${.CURDIR}/../sys/sys/param.h; \
100 . ${.CURDIR}/../sys/conf/newvers.sh; \
101 echo "$$COPYRIGHT" > osreldate.h; \
102 echo "#ifdef _KERNEL" >> osreldate.h; \
103 echo "#error \"<osreldate.h> cannot be used in the kernel, use <sys/param.h>\"" >> osreldate.h; \
104 echo "#else" >> osreldate.h; \
105 echo "#undef __FreeBSD_version" >> osreldate.h; \
106 echo "#define __FreeBSD_version $$RELDATE" >> osreldate.h; \
107 echo "#endif" >> osreldate.h
110 INCSLINKS+= sys/$i ${INCLUDEDIR}/$i
113 INCSLINKS+= machine/$i ${INCLUDEDIR}/$i
116 INCSLINKS+= sys/$i ${INCLUDEDIR}/$i
119 .if ${MACHINE} != ${MACHINE_ARCH}
120 _MARCH=${MACHINE_ARCH}
123 .include <bsd.prog.mk>
125 installincludes: ${SHARED}
128 # Take care of stale directory-level symlinks.
130 .for i in ${LDIRS} ${LSUBDIRS} machine ${_MARCH} crypto
131 if [ -L ${DESTDIR}${INCLUDEDIR}/$i ]; then \
132 rm -f ${DESTDIR}${INCLUDEDIR}/$i; \
135 mtree -deU ${MTREE_FOLLOWS_SYMLINKS} \
136 -f ${.CURDIR}/../etc/mtree/BSD.include.dist \
137 -p ${DESTDIR}${INCLUDEDIR}
138 .if ${MK_BIND_LIBS} != "no"
139 mtree -deU ${MTREE_FOLLOWS_SYMLINKS} \
140 -f ${.CURDIR}/../etc/mtree/BIND.include.dist \
141 -p ${DESTDIR}${INCLUDEDIR}
145 .for i in ${LDIRS} ${LSUBDIRS} ${LSUBSUBDIRS} altq crypto machine machine/pc \
147 .if exists(${DESTDIR}${INCLUDEDIR}/$i)
148 cd ${DESTDIR}${INCLUDEDIR}/$i; \
150 if [ -L $$h ]; then rm -f $$h; fi; \
154 .for i in ${LDIRS} ${LSUBDIRS:Ndev/acpica:Ndev/bktr} ${LSUBSUBDIRS}
155 cd ${.CURDIR}/../sys; \
156 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 $i/*.h \
157 ${DESTDIR}${INCLUDEDIR}/$i
159 cd ${.CURDIR}/../sys/dev/acpica; \
160 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 acpiio.h \
161 ${DESTDIR}${INCLUDEDIR}/dev/acpica
162 cd ${.CURDIR}/../sys/dev/bktr; \
163 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 ioctl_*.h \
164 ${DESTDIR}${INCLUDEDIR}/dev/bktr
165 cd ${.CURDIR}/../sys/contrib/altq/altq; \
166 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
167 ${DESTDIR}${INCLUDEDIR}/altq
168 cd ${.CURDIR}/../sys/fs/cd9660/; \
169 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
170 ${DESTDIR}${INCLUDEDIR}/isofs/cd9660
171 .if ${MK_IPFILTER} != "no"
172 cd ${.CURDIR}/../sys/contrib/ipfilter/netinet; \
173 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
174 ${DESTDIR}${INCLUDEDIR}/netinet
176 cd ${.CURDIR}/../sys/contrib/pf/net; \
177 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
178 ${DESTDIR}${INCLUDEDIR}/net
179 cd ${.CURDIR}/../sys/crypto; \
180 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 rijndael/rijndael.h \
181 ${DESTDIR}${INCLUDEDIR}/crypto
182 .if ${MACHINE_ARCH} == "i386"
183 .if ${MK_I4B} != "no"
184 cd ${.CURDIR}/../sys/i4b/include; \
185 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 ${I4BHDRS} \
186 ${DESTDIR}${INCLUDEDIR}/i4b
189 cd ${.CURDIR}/../sys/opencrypto; \
190 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
191 ${DESTDIR}${INCLUDEDIR}/crypto
192 cd ${.CURDIR}/../sys/${MACHINE}/include; \
193 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
194 ${DESTDIR}${INCLUDEDIR}/machine
195 .if exists(${.CURDIR}/../sys/${MACHINE}/include/pc)
196 cd ${.CURDIR}/../sys/${MACHINE}/include/pc; \
197 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
198 ${DESTDIR}${INCLUDEDIR}/machine/pc
201 ${INSTALL} -d -o ${BINOWN} -g ${BINGRP} -m 755 \
202 ${DESTDIR}${INCLUDEDIR}/${_MARCH}; \
203 cd ${.CURDIR}/../sys/${_MARCH}/include; \
204 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
205 ${DESTDIR}${INCLUDEDIR}/${_MARCH}
206 .if exists(${.CURDIR}/../sys/${_MARCH}/include/pc)
207 ${INSTALL} -d -o ${BINOWN} -g ${BINGRP} -m 755 \
208 ${DESTDIR}${INCLUDEDIR}/${_MARCH}/pc; \
209 cd ${.CURDIR}/../sys/${_MARCH}/include/pc; \
210 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
211 ${DESTDIR}${INCLUDEDIR}/${_MARCH}/pc
214 cd ${.CURDIR}/../sys/rpc; \
215 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 types.h \
216 ${DESTDIR}${INCLUDEDIR}/rpc
219 @${ECHO} "Setting up symlinks to kernel source tree..."
221 cd ${.CURDIR}/../sys/$i; \
223 ln -fs ../../../sys/$i/$$h ${DESTDIR}${INCLUDEDIR}/$i; \
226 .for i in ${LSUBDIRS:Ndev/acpica:Ndev/bktr}
227 cd ${.CURDIR}/../sys/$i; \
229 ln -fs ../../../../sys/$i/$$h ${DESTDIR}${INCLUDEDIR}/$i; \
232 cd ${.CURDIR}/../sys/dev/acpica; \
233 for h in acpiio.h; do \
234 ln -fs ../../../../sys/dev/acpica/$$h \
235 ${DESTDIR}${INCLUDEDIR}/dev/acpica; \
237 cd ${.CURDIR}/../sys/dev/bktr; \
238 for h in ioctl_*.h; do \
239 ln -fs ../../../../sys/dev/bktr/$$h \
240 ${DESTDIR}${INCLUDEDIR}/dev/bktr; \
242 .for i in ${LSUBSUBDIRS}
243 cd ${.CURDIR}/../sys/$i; \
245 ln -fs ../../../../../sys/$i/$$h ${DESTDIR}${INCLUDEDIR}/$i; \
248 cd ${.CURDIR}/../sys/contrib/altq/altq; \
250 ln -fs ../../../sys/contrib/altq/altq/$$h \
251 ${DESTDIR}${INCLUDEDIR}/altq; \
253 .if ${MK_IPFILTER} != "no"
254 cd ${.CURDIR}/../sys/contrib/ipfilter/netinet; \
256 ln -fs ../../../sys/contrib/ipfilter/netinet/$$h \
257 ${DESTDIR}${INCLUDEDIR}/netinet; \
260 cd ${.CURDIR}/../sys/contrib/pf/net; \
262 ln -fs ../../../sys/contrib/pf/net/$$h \
263 ${DESTDIR}${INCLUDEDIR}/net; \
265 cd ${.CURDIR}/../sys/crypto; \
266 for h in rijndael/rijndael.h; do \
267 ln -fs ../../../sys/crypto/$$h \
268 ${DESTDIR}${INCLUDEDIR}/crypto; \
270 cd ${.CURDIR}/../sys/i4b/include; \
271 for h in ${I4BHDRS}; do \
272 ln -fs ../../../sys/i4b/include/$$h \
273 ${DESTDIR}${INCLUDEDIR}/i4b; \
275 cd ${.CURDIR}/../sys/opencrypto; \
277 ln -fs ../../../sys/opencrypto/$$h \
278 ${DESTDIR}${INCLUDEDIR}/crypto; \
280 cd ${.CURDIR}/../sys/${MACHINE}/include; \
282 ln -fs ../../../sys/${MACHINE}/include/$$h \
283 ${DESTDIR}${INCLUDEDIR}/machine; \
285 .if exists(${.CURDIR}/../sys/${MACHINE}/include/pc)
286 cd ${.CURDIR}/../sys/${MACHINE}/include/pc; \
288 ln -fs ../../../../sys/${MACHINE}/include/pc/$$h \
289 ${DESTDIR}${INCLUDEDIR}/machine/pc; \
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; \
310 cd ${.CURDIR}/../sys/fs/cd9660; \
312 ln -fs ../../../../sys/fs/cd9660/$$h \
313 ${DESTDIR}${INCLUDEDIR}/isofs/cd9660; \
315 cd ${.CURDIR}/../sys/rpc; \
316 for h in types.h; do \
317 ln -fs ../../../sys/rpc/$$h \
318 ${DESTDIR}${INCLUDEDIR}/rpc; \