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 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 netatm netgraph netinet netinet6 \
37 netipsec ${_netipx} netkey netnatm ${_netncp} netsmb \
38 nfs nfsclient nfsserver \
42 dev/acpica dev/an dev/bktr dev/firewire dev/hwpmc \
43 dev/ic dev/iicbus ${_dev_ieee488} dev/lmc dev/ofw \
44 dev/pbio ${_dev_powermac_nvram} dev/ppbus dev/smbus dev/speaker dev/usb dev/utopia dev/vkbd dev/wi \
45 fs/devfs fs/fdescfs fs/fifofs fs/msdosfs fs/ntfs fs/nullfs \
46 ${_fs_nwfs} fs/portalfs fs/procfs fs/smbfs fs/udf fs/umapfs \
48 geom/cache geom/concat geom/eli geom/gate geom/journal geom/label \
49 geom/mirror geom/nop geom/raid3 geom/shsec geom/stripe \
50 netatm/ipatm netatm/sigpvc netatm/spans netatm/uni \
51 netgraph/atm netgraph/netflow \
53 security/mac_biba security/mac_bsdextended security/mac_lomac \
54 security/mac_mls security/mac_partition \
57 .if ${MACHINE_ARCH} == "powerpc"
58 _dev_powermac_nvram= dev/powermac_nvram
61 .if ${MK_GPIB} != "no"
62 _dev_ieee488= dev/ieee488
65 .if ${MK_HESIOD} != "no"
69 .if ${MK_BLUETOOTH} != "no"
70 LSUBSUBDIRS= netgraph/bluetooth/include
73 # XXX unconditionally needed by <netsmb/netbios.h>
74 #.if ${MK_IPX} != "no"
83 # Define SHARED to indicate whether you want symbolic links to the system
84 # source (``symlinks''), or a separate copy (``copies''). ``symlinks'' is
85 # probably only useful for developers and should be avoided if you do not
86 # wish to tie your /usr/include and /usr/src together.
92 osreldate.h: ${.CURDIR}/../sys/conf/newvers.sh ${.CURDIR}/../sys/sys/param.h \
94 @${ECHO} creating osreldate.h from newvers.sh
96 PARAMFILE=${.CURDIR}/../sys/sys/param.h; \
97 . ${.CURDIR}/../sys/conf/newvers.sh; \
98 echo "$$COPYRIGHT" > osreldate.h; \
99 echo "#ifdef _KERNEL" >> osreldate.h; \
100 echo "#error \"<osreldate.h> cannot be used in the kernel, use <sys/param.h>\"" >> osreldate.h; \
101 echo "#else" >> osreldate.h; \
102 echo "#undef __FreeBSD_version" >> osreldate.h; \
103 echo "#define __FreeBSD_version $$RELDATE" >> osreldate.h; \
104 echo "#endif" >> osreldate.h
107 INCSLINKS+= sys/$i ${INCLUDEDIR}/$i
110 INCSLINKS+= machine/$i ${INCLUDEDIR}/$i
113 INCSLINKS+= sys/$i ${INCLUDEDIR}/$i
116 .if ${MACHINE} != ${MACHINE_ARCH}
117 _MARCH=${MACHINE_ARCH}
120 .include <bsd.prog.mk>
122 installincludes: ${SHARED}
125 # Take care of stale directory-level symlinks.
127 .for i in ${LDIRS} ${LSUBDIRS} machine ${_MARCH} crypto
128 if [ -L ${DESTDIR}${INCLUDEDIR}/$i ]; then \
129 rm -f ${DESTDIR}${INCLUDEDIR}/$i; \
132 mtree -deU ${MTREE_FOLLOWS_SYMLINKS} \
133 -f ${.CURDIR}/../etc/mtree/BSD.include.dist \
134 -p ${DESTDIR}${INCLUDEDIR}
135 .if ${MK_BIND_LIBS} != "no"
136 mtree -deU ${MTREE_FOLLOWS_SYMLINKS} \
137 -f ${.CURDIR}/../etc/mtree/BIND.include.dist \
138 -p ${DESTDIR}${INCLUDEDIR}
142 .for i in ${LDIRS} ${LSUBDIRS} ${LSUBSUBDIRS} altq crypto machine machine/pc \
144 .if exists(${DESTDIR}${INCLUDEDIR}/$i)
145 cd ${DESTDIR}${INCLUDEDIR}/$i; \
147 if [ -L $$h ]; then rm -f $$h; fi; \
151 .for i in ${LDIRS} ${LSUBDIRS:Ndev/acpica:Ndev/bktr} ${LSUBSUBDIRS}
152 cd ${.CURDIR}/../sys; \
153 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 $i/*.h \
154 ${DESTDIR}${INCLUDEDIR}/$i
156 cd ${.CURDIR}/../sys/dev/acpica; \
157 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 acpiio.h \
158 ${DESTDIR}${INCLUDEDIR}/dev/acpica
159 cd ${.CURDIR}/../sys/dev/bktr; \
160 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 ioctl_*.h \
161 ${DESTDIR}${INCLUDEDIR}/dev/bktr
162 cd ${.CURDIR}/../sys/contrib/altq/altq; \
163 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
164 ${DESTDIR}${INCLUDEDIR}/altq
165 cd ${.CURDIR}/../sys/fs/cd9660/; \
166 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
167 ${DESTDIR}${INCLUDEDIR}/isofs/cd9660
168 .if ${MK_IPFILTER} != "no"
169 cd ${.CURDIR}/../sys/contrib/ipfilter/netinet; \
170 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
171 ${DESTDIR}${INCLUDEDIR}/netinet
173 cd ${.CURDIR}/../sys/contrib/pf/net; \
174 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
175 ${DESTDIR}${INCLUDEDIR}/net
176 cd ${.CURDIR}/../sys/crypto; \
177 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 rijndael/rijndael.h \
178 ${DESTDIR}${INCLUDEDIR}/crypto
179 cd ${.CURDIR}/../sys/opencrypto; \
180 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
181 ${DESTDIR}${INCLUDEDIR}/crypto
182 cd ${.CURDIR}/../sys/${MACHINE}/include; \
183 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
184 ${DESTDIR}${INCLUDEDIR}/machine
185 .if exists(${.CURDIR}/../sys/${MACHINE}/include/pc)
186 cd ${.CURDIR}/../sys/${MACHINE}/include/pc; \
187 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
188 ${DESTDIR}${INCLUDEDIR}/machine/pc
191 ${INSTALL} -d -o ${BINOWN} -g ${BINGRP} -m 755 \
192 ${DESTDIR}${INCLUDEDIR}/${_MARCH}; \
193 cd ${.CURDIR}/../sys/${_MARCH}/include; \
194 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
195 ${DESTDIR}${INCLUDEDIR}/${_MARCH}
196 .if exists(${.CURDIR}/../sys/${_MARCH}/include/pc)
197 ${INSTALL} -d -o ${BINOWN} -g ${BINGRP} -m 755 \
198 ${DESTDIR}${INCLUDEDIR}/${_MARCH}/pc; \
199 cd ${.CURDIR}/../sys/${_MARCH}/include/pc; \
200 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
201 ${DESTDIR}${INCLUDEDIR}/${_MARCH}/pc
204 cd ${.CURDIR}/../sys/rpc; \
205 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 types.h \
206 ${DESTDIR}${INCLUDEDIR}/rpc
209 @${ECHO} "Setting up symlinks to kernel source tree..."
211 cd ${.CURDIR}/../sys/$i; \
213 ln -fs ../../../sys/$i/$$h ${DESTDIR}${INCLUDEDIR}/$i; \
216 .for i in ${LSUBDIRS:Ndev/acpica:Ndev/bktr}
217 cd ${.CURDIR}/../sys/$i; \
219 ln -fs ../../../../sys/$i/$$h ${DESTDIR}${INCLUDEDIR}/$i; \
222 cd ${.CURDIR}/../sys/dev/acpica; \
223 for h in acpiio.h; do \
224 ln -fs ../../../../sys/dev/acpica/$$h \
225 ${DESTDIR}${INCLUDEDIR}/dev/acpica; \
227 cd ${.CURDIR}/../sys/dev/bktr; \
228 for h in ioctl_*.h; do \
229 ln -fs ../../../../sys/dev/bktr/$$h \
230 ${DESTDIR}${INCLUDEDIR}/dev/bktr; \
232 .for i in ${LSUBSUBDIRS}
233 cd ${.CURDIR}/../sys/$i; \
235 ln -fs ../../../../../sys/$i/$$h ${DESTDIR}${INCLUDEDIR}/$i; \
238 cd ${.CURDIR}/../sys/contrib/altq/altq; \
240 ln -fs ../../../sys/contrib/altq/altq/$$h \
241 ${DESTDIR}${INCLUDEDIR}/altq; \
243 .if ${MK_IPFILTER} != "no"
244 cd ${.CURDIR}/../sys/contrib/ipfilter/netinet; \
246 ln -fs ../../../sys/contrib/ipfilter/netinet/$$h \
247 ${DESTDIR}${INCLUDEDIR}/netinet; \
250 cd ${.CURDIR}/../sys/contrib/pf/net; \
252 ln -fs ../../../sys/contrib/pf/net/$$h \
253 ${DESTDIR}${INCLUDEDIR}/net; \
255 cd ${.CURDIR}/../sys/crypto; \
256 for h in rijndael/rijndael.h; do \
257 ln -fs ../../../sys/crypto/$$h \
258 ${DESTDIR}${INCLUDEDIR}/crypto; \
260 cd ${.CURDIR}/../sys/opencrypto; \
262 ln -fs ../../../sys/opencrypto/$$h \
263 ${DESTDIR}${INCLUDEDIR}/crypto; \
265 cd ${.CURDIR}/../sys/${MACHINE}/include; \
267 ln -fs ../../../sys/${MACHINE}/include/$$h \
268 ${DESTDIR}${INCLUDEDIR}/machine; \
270 .if exists(${.CURDIR}/../sys/${MACHINE}/include/pc)
271 cd ${.CURDIR}/../sys/${MACHINE}/include/pc; \
273 ln -fs ../../../../sys/${MACHINE}/include/pc/$$h \
274 ${DESTDIR}${INCLUDEDIR}/machine/pc; \
278 ${INSTALL} -d -o ${BINOWN} -g ${BINGRP} -m 755 \
279 ${DESTDIR}${INCLUDEDIR}/${_MARCH}; \
280 cd ${.CURDIR}/../sys/${_MARCH}/include; \
282 ln -fs ../../../sys/${_MARCH}/include/$$h \
283 ${DESTDIR}${INCLUDEDIR}/${_MARCH}; \
285 .if exists(${.CURDIR}/../sys/${_MARCH}/include/pc)
286 ${INSTALL} -d -o ${BINOWN} -g ${BINGRP} -m 755 \
287 ${DESTDIR}${INCLUDEDIR}/${_MARCH}/pc; \
288 cd ${.CURDIR}/../sys/${_MARCH}/include/pc; \
290 ln -fs ../../../../sys/${_MARCH}/include/pc/$$h \
291 ${DESTDIR}${INCLUDEDIR}/${_MARCH}/pc; \
295 cd ${.CURDIR}/../sys/fs/cd9660; \
297 ln -fs ../../../../sys/fs/cd9660/$$h \
298 ${DESTDIR}${INCLUDEDIR}/isofs/cd9660; \
300 cd ${.CURDIR}/../sys/rpc; \
301 for h in types.h; do \
302 ln -fs ../../../sys/rpc/$$h \
303 ${DESTDIR}${INCLUDEDIR}/rpc; \