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 regexp.h \
21 res_update.h resolv.h runetype.h search.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 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 MHDRS= float.h floatingpoint.h stdarg.h
31 PHDRS= sched.h semaphore.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/agp dev/an dev/bktr dev/ciss \
43 dev/filemon dev/firewire dev/hwpmc \
44 dev/ic dev/iicbus ${_dev_ieee488} dev/io dev/lmc dev/mfi dev/ofw \
45 dev/pbio dev/pci ${_dev_powermac_nvram} dev/ppbus dev/smbus \
46 dev/speaker dev/usb dev/utopia dev/vkbd dev/wi \
47 fs/devfs fs/fdescfs fs/fifofs fs/msdosfs fs/nfs fs/ntfs fs/nullfs \
48 ${_fs_nwfs} fs/portalfs fs/procfs fs/smbfs fs/udf fs/unionfs \
49 geom/cache geom/concat geom/eli geom/gate geom/journal geom/label \
50 geom/mirror geom/multipath geom/nop \
51 geom/raid geom/raid3 geom/shsec geom/stripe geom/virstor \
52 netgraph/atm netgraph/netflow \
54 security/mac_biba security/mac_bsdextended security/mac_lomac \
55 security/mac_mls security/mac_partition \
58 LSUBSUBDIRS= dev/mpt/mpilib
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/agp:Ndev/acpica:Ndev/bktr:Ndev/pci} ${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/agp; \
163 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 agpreg.h \
164 ${DESTDIR}${INCLUDEDIR}/dev/agp
165 cd ${.CURDIR}/../sys/dev/bktr; \
166 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 ioctl_*.h \
167 ${DESTDIR}${INCLUDEDIR}/dev/bktr
168 cd ${.CURDIR}/../sys/dev/pci; \
169 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 pcireg.h \
170 ${DESTDIR}${INCLUDEDIR}/dev/pci
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
200 ${INSTALL} -d -o ${BINOWN} -g ${BINGRP} -m 755 \
201 ${DESTDIR}${INCLUDEDIR}/${_MARCH}; \
202 cd ${.CURDIR}/../sys/${_MARCH}/include; \
203 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
204 ${DESTDIR}${INCLUDEDIR}/${_MARCH}
205 .if exists(${.CURDIR}/../sys/${_MARCH}/include/pc)
206 ${INSTALL} -d -o ${BINOWN} -g ${BINGRP} -m 755 \
207 ${DESTDIR}${INCLUDEDIR}/${_MARCH}/pc; \
208 cd ${.CURDIR}/../sys/${_MARCH}/include/pc; \
209 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
210 ${DESTDIR}${INCLUDEDIR}/${_MARCH}/pc
213 cd ${.CURDIR}/../sys/rpc; \
214 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 types.h \
215 ${DESTDIR}${INCLUDEDIR}/rpc
218 @${ECHO} "Setting up symlinks to kernel source tree..."
220 cd ${.CURDIR}/../sys/$i; \
222 ln -fs ../../../sys/$i/$$h ${DESTDIR}${INCLUDEDIR}/$i; \
225 .for i in ${LSUBDIRS:Ndev/agp:Ndev/acpica:Ndev/bktr:Ndev/pci}
226 cd ${.CURDIR}/../sys/$i; \
228 ln -fs ../../../../sys/$i/$$h ${DESTDIR}${INCLUDEDIR}/$i; \
231 cd ${.CURDIR}/../sys/dev/acpica; \
232 for h in acpiio.h; do \
233 ln -fs ../../../../sys/dev/acpica/$$h \
234 ${DESTDIR}${INCLUDEDIR}/dev/acpica; \
236 cd ${.CURDIR}/../sys/dev/agp; \
237 for h in agpreg.h; do \
238 ln -fs ../../../../sys/dev/agp/$$h \
239 ${DESTDIR}${INCLUDEDIR}/dev/agp; \
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 cd ${.CURDIR}/../sys/dev/pci; \
247 for h in pcireg.h; do \
248 ln -fs ../../../../sys/dev/pci/$$h \
249 ${DESTDIR}${INCLUDEDIR}/dev/pci; \
251 .for i in ${LSUBSUBDIRS}
252 cd ${.CURDIR}/../sys/$i; \
254 ln -fs ../../../../../sys/$i/$$h ${DESTDIR}${INCLUDEDIR}/$i; \
257 cd ${.CURDIR}/../sys/contrib/altq/altq; \
259 ln -fs ../../../sys/contrib/altq/altq/$$h \
260 ${DESTDIR}${INCLUDEDIR}/altq; \
262 .if ${MK_IPFILTER} != "no"
263 cd ${.CURDIR}/../sys/contrib/ipfilter/netinet; \
265 ln -fs ../../../sys/contrib/ipfilter/netinet/$$h \
266 ${DESTDIR}${INCLUDEDIR}/netinet; \
269 cd ${.CURDIR}/../sys/contrib/pf/net; \
271 ln -fs ../../../sys/contrib/pf/net/$$h \
272 ${DESTDIR}${INCLUDEDIR}/net; \
274 cd ${.CURDIR}/../sys/crypto; \
275 for h in rijndael/rijndael.h; do \
276 ln -fs ../../../sys/crypto/$$h \
277 ${DESTDIR}${INCLUDEDIR}/crypto; \
279 cd ${.CURDIR}/../sys/opencrypto; \
281 ln -fs ../../../sys/opencrypto/$$h \
282 ${DESTDIR}${INCLUDEDIR}/crypto; \
284 cd ${.CURDIR}/../sys/${MACHINE}/include; \
286 ln -fs ../../../sys/${MACHINE}/include/$$h \
287 ${DESTDIR}${INCLUDEDIR}/machine; \
289 .if exists(${.CURDIR}/../sys/${MACHINE}/include/pc)
290 cd ${.CURDIR}/../sys/${MACHINE}/include/pc; \
292 ln -fs ../../../../sys/${MACHINE}/include/pc/$$h \
293 ${DESTDIR}${INCLUDEDIR}/machine/pc; \
297 ${INSTALL} -d -o ${BINOWN} -g ${BINGRP} -m 755 \
298 ${DESTDIR}${INCLUDEDIR}/${_MARCH}; \
299 cd ${.CURDIR}/../sys/${_MARCH}/include; \
301 ln -fs ../../../sys/${_MARCH}/include/$$h \
302 ${DESTDIR}${INCLUDEDIR}/${_MARCH}; \
304 .if exists(${.CURDIR}/../sys/${_MARCH}/include/pc)
305 ${INSTALL} -d -o ${BINOWN} -g ${BINGRP} -m 755 \
306 ${DESTDIR}${INCLUDEDIR}/${_MARCH}/pc; \
307 cd ${.CURDIR}/../sys/${_MARCH}/include/pc; \
309 ln -fs ../../../../sys/${_MARCH}/include/pc/$$h \
310 ${DESTDIR}${INCLUDEDIR}/${_MARCH}/pc; \
314 cd ${.CURDIR}/../sys/fs/cd9660; \
316 ln -fs ../../../../sys/fs/cd9660/$$h \
317 ${DESTDIR}${INCLUDEDIR}/isofs/cd9660; \
319 cd ${.CURDIR}/../sys/rpc; \
320 for h in types.h; do \
321 ln -fs ../../../sys/rpc/$$h \
322 ${DESTDIR}${INCLUDEDIR}/rpc; \