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 \
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 vis.h \
27 wchar.h wctype.h wordexp.h
29 MHDRS= float.h floatingpoint.h stdarg.h
31 PHDRS= sched.h _semaphore.h
33 LHDRS= aio.h errno.h fcntl.h linker_set.h poll.h stdint.h syslog.h \
36 LDIRS= bsm cam geom net net80211 netatalk netgraph netinet netinet6 \
37 netipsec ${_netipx} netnatm ${_netncp} netsmb \
38 nfs nfsclient nfsserver \
41 LSUBDIRS= cam/ata cam/scsi \
42 dev/acpica dev/an dev/bktr dev/ciss dev/firewire dev/hwpmc \
43 dev/ic dev/iicbus ${_dev_ieee488} dev/io dev/lmc dev/mfi dev/ofw \
44 dev/pbio ${_dev_powermac_nvram} 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/shsec geom/stripe geom/virstor \
51 netgraph/atm netgraph/netflow \
53 security/mac_biba security/mac_bsdextended security/mac_lomac \
54 security/mac_mls security/mac_partition \
57 LSUBSUBDIRS= dev/mpt/mpilib
59 .if ${MACHINE_ARCH} == "powerpc" || ${MACHINE_ARCH} == "powerpc64"
60 _dev_powermac_nvram= dev/powermac_nvram
63 .if ${MK_GPIB} != "no"
64 _dev_ieee488= dev/ieee488
67 .if ${MK_HESIOD} != "no"
71 .if ${MK_ICONV} != "no"
75 .if ${MK_BLUETOOTH} != "no"
76 LSUBSUBDIRS+= netgraph/bluetooth/include
79 # XXX unconditionally needed by <netsmb/netbios.h>
80 #.if ${MK_IPX} != "no"
89 # Define SHARED to indicate whether you want symbolic links to the system
90 # source (``symlinks''), or a separate copy (``copies''). ``symlinks'' is
91 # probably only useful for developers and should be avoided if you do not
92 # wish to tie your /usr/include and /usr/src together.
98 osreldate.h: ${.CURDIR}/../sys/conf/newvers.sh ${.CURDIR}/../sys/sys/param.h \
100 @${ECHO} creating osreldate.h from newvers.sh
102 PARAMFILE=${.CURDIR}/../sys/sys/param.h; \
103 . ${.CURDIR}/../sys/conf/newvers.sh; \
104 echo "$$COPYRIGHT" > osreldate.h; \
105 echo "#ifdef _KERNEL" >> osreldate.h; \
106 echo "#error \"<osreldate.h> cannot be used in the kernel, use <sys/param.h>\"" >> osreldate.h; \
107 echo "#else" >> osreldate.h; \
108 echo "#undef __FreeBSD_version" >> osreldate.h; \
109 echo "#define __FreeBSD_version $$RELDATE" >> osreldate.h; \
110 echo "#endif" >> osreldate.h
113 INCSLINKS+= sys/$i ${INCLUDEDIR}/$i
116 INCSLINKS+= machine/$i ${INCLUDEDIR}/$i
119 INCSLINKS+= sys/$i ${INCLUDEDIR}/$i
122 .if ${MACHINE} != ${MACHINE_CPUARCH}
123 _MARCHS= ${MACHINE_CPUARCH}
125 .if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64"
129 .include <bsd.prog.mk>
131 installincludes: ${SHARED}
134 # Take care of stale directory-level symlinks.
136 .for i in ${LDIRS} ${LSUBDIRS} machine ${_MARCHS} crypto
137 if [ -L ${DESTDIR}${INCLUDEDIR}/$i ]; then \
138 rm -f ${DESTDIR}${INCLUDEDIR}/$i; \
141 mtree -deU ${MTREE_FOLLOWS_SYMLINKS} \
142 -f ${.CURDIR}/../etc/mtree/BSD.include.dist \
143 -p ${DESTDIR}${INCLUDEDIR}
144 .if ${MK_BIND_LIBS} != "no"
145 mtree -deU ${MTREE_FOLLOWS_SYMLINKS} \
146 -f ${.CURDIR}/../etc/mtree/BIND.include.dist \
147 -p ${DESTDIR}${INCLUDEDIR}
151 .for i in ${LDIRS} ${LSUBDIRS} ${LSUBSUBDIRS} altq crypto machine machine/pc \
153 .if exists(${DESTDIR}${INCLUDEDIR}/$i)
154 cd ${DESTDIR}${INCLUDEDIR}/$i; \
156 if [ -L $$h ]; then rm -f $$h; fi; \
160 .for i in ${LDIRS} ${LSUBDIRS:Ndev/acpica:Ndev/bktr} ${LSUBSUBDIRS}
161 cd ${.CURDIR}/../sys; \
162 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 $i/*.h \
163 ${DESTDIR}${INCLUDEDIR}/$i
165 cd ${.CURDIR}/../sys/dev/acpica; \
166 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 acpiio.h \
167 ${DESTDIR}${INCLUDEDIR}/dev/acpica
168 cd ${.CURDIR}/../sys/dev/bktr; \
169 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 ioctl_*.h \
170 ${DESTDIR}${INCLUDEDIR}/dev/bktr
171 cd ${.CURDIR}/../sys/contrib/altq/altq; \
172 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
173 ${DESTDIR}${INCLUDEDIR}/altq
174 cd ${.CURDIR}/../sys/fs/cd9660/; \
175 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
176 ${DESTDIR}${INCLUDEDIR}/isofs/cd9660
177 .if ${MK_IPFILTER} != "no"
178 cd ${.CURDIR}/../sys/contrib/ipfilter/netinet; \
179 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
180 ${DESTDIR}${INCLUDEDIR}/netinet
182 cd ${.CURDIR}/../sys/contrib/pf/net; \
183 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
184 ${DESTDIR}${INCLUDEDIR}/net
185 cd ${.CURDIR}/../sys/crypto; \
186 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 rijndael/rijndael.h \
187 ${DESTDIR}${INCLUDEDIR}/crypto
188 cd ${.CURDIR}/../sys/opencrypto; \
189 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
190 ${DESTDIR}${INCLUDEDIR}/crypto
191 cd ${.CURDIR}/../sys/${MACHINE}/include; \
192 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
193 ${DESTDIR}${INCLUDEDIR}/machine
194 .if exists(${.CURDIR}/../sys/${MACHINE}/include/pc)
195 cd ${.CURDIR}/../sys/${MACHINE}/include/pc; \
196 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
197 ${DESTDIR}${INCLUDEDIR}/machine/pc
199 .for _MARCH in ${_MARCHS}
200 .if exists(${.CURDIR}/../sys/${_MARCH}/include)
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
215 cd ${.CURDIR}/../sys/rpc; \
216 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 types.h \
217 ${DESTDIR}${INCLUDEDIR}/rpc
220 @${ECHO} "Setting up symlinks to kernel source tree..."
222 cd ${.CURDIR}/../sys/$i; \
224 ln -fs ../../../sys/$i/$$h ${DESTDIR}${INCLUDEDIR}/$i; \
227 .for i in ${LSUBDIRS:Ndev/acpica:Ndev/bktr}
228 cd ${.CURDIR}/../sys/$i; \
230 ln -fs ../../../../sys/$i/$$h ${DESTDIR}${INCLUDEDIR}/$i; \
233 cd ${.CURDIR}/../sys/dev/acpica; \
234 for h in acpiio.h; do \
235 ln -fs ../../../../sys/dev/acpica/$$h \
236 ${DESTDIR}${INCLUDEDIR}/dev/acpica; \
238 cd ${.CURDIR}/../sys/dev/bktr; \
239 for h in ioctl_*.h; do \
240 ln -fs ../../../../sys/dev/bktr/$$h \
241 ${DESTDIR}${INCLUDEDIR}/dev/bktr; \
243 .for i in ${LSUBSUBDIRS}
244 cd ${.CURDIR}/../sys/$i; \
246 ln -fs ../../../../../sys/$i/$$h ${DESTDIR}${INCLUDEDIR}/$i; \
249 cd ${.CURDIR}/../sys/contrib/altq/altq; \
251 ln -fs ../../../sys/contrib/altq/altq/$$h \
252 ${DESTDIR}${INCLUDEDIR}/altq; \
254 .if ${MK_IPFILTER} != "no"
255 cd ${.CURDIR}/../sys/contrib/ipfilter/netinet; \
257 ln -fs ../../../sys/contrib/ipfilter/netinet/$$h \
258 ${DESTDIR}${INCLUDEDIR}/netinet; \
261 cd ${.CURDIR}/../sys/contrib/pf/net; \
263 ln -fs ../../../sys/contrib/pf/net/$$h \
264 ${DESTDIR}${INCLUDEDIR}/net; \
266 cd ${.CURDIR}/../sys/crypto; \
267 for h in rijndael/rijndael.h; do \
268 ln -fs ../../../sys/crypto/$$h \
269 ${DESTDIR}${INCLUDEDIR}/crypto; \
271 cd ${.CURDIR}/../sys/opencrypto; \
273 ln -fs ../../../sys/opencrypto/$$h \
274 ${DESTDIR}${INCLUDEDIR}/crypto; \
276 cd ${.CURDIR}/../sys/${MACHINE}/include; \
278 ln -fs ../../../sys/${MACHINE}/include/$$h \
279 ${DESTDIR}${INCLUDEDIR}/machine; \
281 .if exists(${.CURDIR}/../sys/${MACHINE}/include/pc)
282 cd ${.CURDIR}/../sys/${MACHINE}/include/pc; \
284 ln -fs ../../../../sys/${MACHINE}/include/pc/$$h \
285 ${DESTDIR}${INCLUDEDIR}/machine/pc; \
288 .for _MARCH in ${_MARCHS}
289 .if exists(${.CURDIR}/../sys/${_MARCH}/include)
290 ${INSTALL} -d -o ${BINOWN} -g ${BINGRP} -m 755 \
291 ${DESTDIR}${INCLUDEDIR}/${_MARCH}; \
292 cd ${.CURDIR}/../sys/${_MARCH}/include; \
294 ln -fs ../../../sys/${_MARCH}/include/$$h \
295 ${DESTDIR}${INCLUDEDIR}/${_MARCH}; \
297 .if exists(${.CURDIR}/../sys/${_MARCH}/include/pc)
298 ${INSTALL} -d -o ${BINOWN} -g ${BINGRP} -m 755 \
299 ${DESTDIR}${INCLUDEDIR}/${_MARCH}/pc; \
300 cd ${.CURDIR}/../sys/${_MARCH}/include/pc; \
302 ln -fs ../../../../sys/${_MARCH}/include/pc/$$h \
303 ${DESTDIR}${INCLUDEDIR}/${_MARCH}/pc; \
308 cd ${.CURDIR}/../sys/fs/cd9660; \
310 ln -fs ../../../../sys/fs/cd9660/$$h \
311 ${DESTDIR}${INCLUDEDIR}/isofs/cd9660; \
313 cd ${.CURDIR}/../sys/rpc; \
314 for h in types.h; do \
315 ln -fs ../../../sys/rpc/$$h \
316 ${DESTDIR}${INCLUDEDIR}/rpc; \