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 dev/firewire dev/hwpmc \
43 dev/ic dev/iicbus ${_dev_ieee488} dev/io dev/lmc dev/mfi dev/ofw \
44 dev/pbio dev/pci ${_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/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"
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_BLUETOOTH} != "no"
72 LSUBSUBDIRS+= netgraph/bluetooth/include
75 # XXX unconditionally needed by <netsmb/netbios.h>
76 #.if ${MK_IPX} != "no"
85 # Define SHARED to indicate whether you want symbolic links to the system
86 # source (``symlinks''), or a separate copy (``copies''). ``symlinks'' is
87 # probably only useful for developers and should be avoided if you do not
88 # wish to tie your /usr/include and /usr/src together.
94 osreldate.h: ${.CURDIR}/../sys/conf/newvers.sh ${.CURDIR}/../sys/sys/param.h \
96 @${ECHO} creating osreldate.h from newvers.sh
98 PARAMFILE=${.CURDIR}/../sys/sys/param.h; \
99 . ${.CURDIR}/../sys/conf/newvers.sh; \
100 echo "$$COPYRIGHT" > osreldate.h; \
101 echo "#ifdef _KERNEL" >> osreldate.h; \
102 echo "#error \"<osreldate.h> cannot be used in the kernel, use <sys/param.h>\"" >> osreldate.h; \
103 echo "#else" >> osreldate.h; \
104 echo "#undef __FreeBSD_version" >> osreldate.h; \
105 echo "#define __FreeBSD_version $$RELDATE" >> osreldate.h; \
106 echo "#endif" >> osreldate.h
109 INCSLINKS+= sys/$i ${INCLUDEDIR}/$i
112 INCSLINKS+= machine/$i ${INCLUDEDIR}/$i
115 INCSLINKS+= sys/$i ${INCLUDEDIR}/$i
118 .if ${MACHINE} != ${MACHINE_ARCH}
119 _MARCH=${MACHINE_ARCH}
122 .include <bsd.prog.mk>
124 installincludes: ${SHARED}
127 # Take care of stale directory-level symlinks.
129 .for i in ${LDIRS} ${LSUBDIRS} machine ${_MARCH} crypto
130 if [ -L ${DESTDIR}${INCLUDEDIR}/$i ]; then \
131 rm -f ${DESTDIR}${INCLUDEDIR}/$i; \
134 mtree -deU ${MTREE_FOLLOWS_SYMLINKS} \
135 -f ${.CURDIR}/../etc/mtree/BSD.include.dist \
136 -p ${DESTDIR}${INCLUDEDIR}
137 .if ${MK_BIND_LIBS} != "no"
138 mtree -deU ${MTREE_FOLLOWS_SYMLINKS} \
139 -f ${.CURDIR}/../etc/mtree/BIND.include.dist \
140 -p ${DESTDIR}${INCLUDEDIR}
144 .for i in ${LDIRS} ${LSUBDIRS} ${LSUBSUBDIRS} altq crypto machine machine/pc \
146 .if exists(${DESTDIR}${INCLUDEDIR}/$i)
147 cd ${DESTDIR}${INCLUDEDIR}/$i; \
149 if [ -L $$h ]; then rm -f $$h; fi; \
153 .for i in ${LDIRS} ${LSUBDIRS:Ndev/agp:Ndev/acpica:Ndev/bktr:Ndev/pci} ${LSUBSUBDIRS}
154 cd ${.CURDIR}/../sys; \
155 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 $i/*.h \
156 ${DESTDIR}${INCLUDEDIR}/$i
158 cd ${.CURDIR}/../sys/dev/acpica; \
159 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 acpiio.h \
160 ${DESTDIR}${INCLUDEDIR}/dev/acpica
161 cd ${.CURDIR}/../sys/dev/agp; \
162 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 agpreg.h \
163 ${DESTDIR}${INCLUDEDIR}/dev/agp
164 cd ${.CURDIR}/../sys/dev/bktr; \
165 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 ioctl_*.h \
166 ${DESTDIR}${INCLUDEDIR}/dev/bktr
167 cd ${.CURDIR}/../sys/dev/pci; \
168 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 pcireg.h \
169 ${DESTDIR}${INCLUDEDIR}/dev/pci
170 cd ${.CURDIR}/../sys/contrib/altq/altq; \
171 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
172 ${DESTDIR}${INCLUDEDIR}/altq
173 cd ${.CURDIR}/../sys/fs/cd9660/; \
174 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
175 ${DESTDIR}${INCLUDEDIR}/isofs/cd9660
176 .if ${MK_IPFILTER} != "no"
177 cd ${.CURDIR}/../sys/contrib/ipfilter/netinet; \
178 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
179 ${DESTDIR}${INCLUDEDIR}/netinet
181 cd ${.CURDIR}/../sys/contrib/pf/net; \
182 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
183 ${DESTDIR}${INCLUDEDIR}/net
184 cd ${.CURDIR}/../sys/crypto; \
185 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 rijndael/rijndael.h \
186 ${DESTDIR}${INCLUDEDIR}/crypto
187 cd ${.CURDIR}/../sys/opencrypto; \
188 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
189 ${DESTDIR}${INCLUDEDIR}/crypto
190 cd ${.CURDIR}/../sys/${MACHINE}/include; \
191 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
192 ${DESTDIR}${INCLUDEDIR}/machine
193 .if exists(${.CURDIR}/../sys/${MACHINE}/include/pc)
194 cd ${.CURDIR}/../sys/${MACHINE}/include/pc; \
195 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
196 ${DESTDIR}${INCLUDEDIR}/machine/pc
199 ${INSTALL} -d -o ${BINOWN} -g ${BINGRP} -m 755 \
200 ${DESTDIR}${INCLUDEDIR}/${_MARCH}; \
201 cd ${.CURDIR}/../sys/${_MARCH}/include; \
202 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
203 ${DESTDIR}${INCLUDEDIR}/${_MARCH}
204 .if exists(${.CURDIR}/../sys/${_MARCH}/include/pc)
205 ${INSTALL} -d -o ${BINOWN} -g ${BINGRP} -m 755 \
206 ${DESTDIR}${INCLUDEDIR}/${_MARCH}/pc; \
207 cd ${.CURDIR}/../sys/${_MARCH}/include/pc; \
208 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
209 ${DESTDIR}${INCLUDEDIR}/${_MARCH}/pc
212 cd ${.CURDIR}/../sys/rpc; \
213 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 types.h \
214 ${DESTDIR}${INCLUDEDIR}/rpc
217 @${ECHO} "Setting up symlinks to kernel source tree..."
219 cd ${.CURDIR}/../sys/$i; \
221 ln -fs ../../../sys/$i/$$h ${DESTDIR}${INCLUDEDIR}/$i; \
224 .for i in ${LSUBDIRS:Ndev/agp:Ndev/acpica:Ndev/bktr:Ndev/pci}
225 cd ${.CURDIR}/../sys/$i; \
227 ln -fs ../../../../sys/$i/$$h ${DESTDIR}${INCLUDEDIR}/$i; \
230 cd ${.CURDIR}/../sys/dev/acpica; \
231 for h in acpiio.h; do \
232 ln -fs ../../../../sys/dev/acpica/$$h \
233 ${DESTDIR}${INCLUDEDIR}/dev/acpica; \
235 cd ${.CURDIR}/../sys/dev/agp; \
236 for h in agpreg.h; do \
237 ln -fs ../../../../sys/dev/agp/$$h \
238 ${DESTDIR}${INCLUDEDIR}/dev/agp; \
240 cd ${.CURDIR}/../sys/dev/bktr; \
241 for h in ioctl_*.h; do \
242 ln -fs ../../../../sys/dev/bktr/$$h \
243 ${DESTDIR}${INCLUDEDIR}/dev/bktr; \
245 cd ${.CURDIR}/../sys/dev/pci; \
246 for h in pcireg.h; do \
247 ln -fs ../../../../sys/dev/pci/$$h \
248 ${DESTDIR}${INCLUDEDIR}/dev/pci; \
250 .for i in ${LSUBSUBDIRS}
251 cd ${.CURDIR}/../sys/$i; \
253 ln -fs ../../../../../sys/$i/$$h ${DESTDIR}${INCLUDEDIR}/$i; \
256 cd ${.CURDIR}/../sys/contrib/altq/altq; \
258 ln -fs ../../../sys/contrib/altq/altq/$$h \
259 ${DESTDIR}${INCLUDEDIR}/altq; \
261 .if ${MK_IPFILTER} != "no"
262 cd ${.CURDIR}/../sys/contrib/ipfilter/netinet; \
264 ln -fs ../../../sys/contrib/ipfilter/netinet/$$h \
265 ${DESTDIR}${INCLUDEDIR}/netinet; \
268 cd ${.CURDIR}/../sys/contrib/pf/net; \
270 ln -fs ../../../sys/contrib/pf/net/$$h \
271 ${DESTDIR}${INCLUDEDIR}/net; \
273 cd ${.CURDIR}/../sys/crypto; \
274 for h in rijndael/rijndael.h; do \
275 ln -fs ../../../sys/crypto/$$h \
276 ${DESTDIR}${INCLUDEDIR}/crypto; \
278 cd ${.CURDIR}/../sys/opencrypto; \
280 ln -fs ../../../sys/opencrypto/$$h \
281 ${DESTDIR}${INCLUDEDIR}/crypto; \
283 cd ${.CURDIR}/../sys/${MACHINE}/include; \
285 ln -fs ../../../sys/${MACHINE}/include/$$h \
286 ${DESTDIR}${INCLUDEDIR}/machine; \
288 .if exists(${.CURDIR}/../sys/${MACHINE}/include/pc)
289 cd ${.CURDIR}/../sys/${MACHINE}/include/pc; \
291 ln -fs ../../../../sys/${MACHINE}/include/pc/$$h \
292 ${DESTDIR}${INCLUDEDIR}/machine/pc; \
296 ${INSTALL} -d -o ${BINOWN} -g ${BINGRP} -m 755 \
297 ${DESTDIR}${INCLUDEDIR}/${_MARCH}; \
298 cd ${.CURDIR}/../sys/${_MARCH}/include; \
300 ln -fs ../../../sys/${_MARCH}/include/$$h \
301 ${DESTDIR}${INCLUDEDIR}/${_MARCH}; \
303 .if exists(${.CURDIR}/../sys/${_MARCH}/include/pc)
304 ${INSTALL} -d -o ${BINOWN} -g ${BINGRP} -m 755 \
305 ${DESTDIR}${INCLUDEDIR}/${_MARCH}/pc; \
306 cd ${.CURDIR}/../sys/${_MARCH}/include/pc; \
308 ln -fs ../../../../sys/${_MARCH}/include/pc/$$h \
309 ${DESTDIR}${INCLUDEDIR}/${_MARCH}/pc; \
313 cd ${.CURDIR}/../sys/fs/cd9660; \
315 ln -fs ../../../../sys/fs/cd9660/$$h \
316 ${DESTDIR}${INCLUDEDIR}/isofs/cd9660; \
318 cd ${.CURDIR}/../sys/rpc; \
319 for h in types.h; do \
320 ln -fs ../../../sys/rpc/$$h \
321 ${DESTDIR}${INCLUDEDIR}/rpc; \