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 objformat.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/label geom/mirror \
49 geom/nop geom/raid3 geom/shsec geom/stripe \
51 netatm/ipatm netatm/sigpvc netatm/spans netatm/uni \
52 netgraph/atm netgraph/netflow \
54 security/mac_biba security/mac_bsdextended security/mac_lomac \
55 security/mac_mls security/mac_partition \
58 .if ${MACHINE_ARCH} == "powerpc"
59 _dev_powermac_nvram= dev/powermac_nvram
62 .if ${MK_GPIB} != "no"
63 _dev_ieee488= dev/ieee488
66 .if ${MK_HESIOD} != "no"
70 .if ${MK_BLUETOOTH} != "no"
71 LSUBSUBDIRS= netgraph/bluetooth/include
74 # XXX unconditionally needed by <netsmb/netbios.h>
75 #.if ${MK_IPX} != "no"
84 # Define SHARED to indicate whether you want symbolic links to the system
85 # source (``symlinks''), or a separate copy (``copies''). ``symlinks'' is
86 # probably only useful for developers and should be avoided if you do not
87 # wish to tie your /usr/include and /usr/src together.
93 osreldate.h: ${.CURDIR}/../sys/conf/newvers.sh ${.CURDIR}/../sys/sys/param.h \
95 @${ECHO} creating osreldate.h from newvers.sh
97 PARAMFILE=${.CURDIR}/../sys/sys/param.h; \
98 . ${.CURDIR}/../sys/conf/newvers.sh; \
99 echo "$$COPYRIGHT" > osreldate.h; \
100 echo "#ifdef _KERNEL" >> osreldate.h; \
101 echo "#error \"<osreldate.h> cannot be used in the kernel, use <sys/param.h>\"" >> osreldate.h; \
102 echo "#else" >> osreldate.h; \
103 echo "#undef __FreeBSD_version" >> osreldate.h; \
104 echo "#define __FreeBSD_version $$RELDATE" >> osreldate.h; \
105 echo "#endif" >> osreldate.h
108 INCSLINKS+= sys/$i ${INCLUDEDIR}/$i
111 INCSLINKS+= machine/$i ${INCLUDEDIR}/$i
114 INCSLINKS+= posix4/$i ${INCLUDEDIR}/$i
117 .if ${MACHINE} != ${MACHINE_ARCH}
118 _MARCH=${MACHINE_ARCH}
121 .include <bsd.prog.mk>
123 installincludes: ${SHARED}
126 # Take care of stale directory-level symlinks.
128 .for i in ${LDIRS} ${LSUBDIRS} machine ${_MARCH} crypto
129 if [ -L ${DESTDIR}${INCLUDEDIR}/$i ]; then \
130 rm -f ${DESTDIR}${INCLUDEDIR}/$i; \
133 mtree -deU ${MTREE_FOLLOWS_SYMLINKS} \
134 -f ${.CURDIR}/../etc/mtree/BSD.include.dist \
135 -p ${DESTDIR}${INCLUDEDIR}
136 .if ${MK_BIND_LIBS} != "no"
137 mtree -deU ${MTREE_FOLLOWS_SYMLINKS} \
138 -f ${.CURDIR}/../etc/mtree/BIND.include.dist \
139 -p ${DESTDIR}${INCLUDEDIR}
143 .for i in ${LDIRS} ${LSUBDIRS} ${LSUBSUBDIRS} altq crypto machine machine/pc \
145 .if exists(${DESTDIR}${INCLUDEDIR}/$i)
146 cd ${DESTDIR}${INCLUDEDIR}/$i; \
148 if [ -L $$h ]; then rm -f $$h; fi; \
152 .for i in ${LDIRS} ${LSUBDIRS:Ndev/acpica:Ndev/bktr} ${LSUBSUBDIRS}
153 cd ${.CURDIR}/../sys; \
154 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 $i/*.h \
155 ${DESTDIR}${INCLUDEDIR}/$i
157 cd ${.CURDIR}/../sys/dev/acpica; \
158 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 acpiio.h \
159 ${DESTDIR}${INCLUDEDIR}/dev/acpica
160 cd ${.CURDIR}/../sys/dev/bktr; \
161 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 ioctl_*.h \
162 ${DESTDIR}${INCLUDEDIR}/dev/bktr
163 cd ${.CURDIR}/../sys/contrib/altq/altq; \
164 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
165 ${DESTDIR}${INCLUDEDIR}/altq
166 .if ${MK_IPFILTER} != "no"
167 cd ${.CURDIR}/../sys/contrib/ipfilter/netinet; \
168 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
169 ${DESTDIR}${INCLUDEDIR}/netinet
171 cd ${.CURDIR}/../sys/contrib/pf/net; \
172 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
173 ${DESTDIR}${INCLUDEDIR}/net
174 cd ${.CURDIR}/../sys/crypto; \
175 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 rijndael/rijndael.h \
176 ${DESTDIR}${INCLUDEDIR}/crypto
177 cd ${.CURDIR}/../sys/opencrypto; \
178 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
179 ${DESTDIR}${INCLUDEDIR}/crypto
180 cd ${.CURDIR}/../sys/${MACHINE}/include; \
181 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
182 ${DESTDIR}${INCLUDEDIR}/machine
183 .if exists(${.CURDIR}/../sys/${MACHINE}/include/pc)
184 cd ${.CURDIR}/../sys/${MACHINE}/include/pc; \
185 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
186 ${DESTDIR}${INCLUDEDIR}/machine/pc
189 ${INSTALL} -d -o ${BINOWN} -g ${BINGRP} -m 755 \
190 ${DESTDIR}${INCLUDEDIR}/${_MARCH}; \
191 cd ${.CURDIR}/../sys/${_MARCH}/include; \
192 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
193 ${DESTDIR}${INCLUDEDIR}/${_MARCH}
194 .if exists(${.CURDIR}/../sys/${_MARCH}/include/pc)
195 ${INSTALL} -d -o ${BINOWN} -g ${BINGRP} -m 755 \
196 ${DESTDIR}${INCLUDEDIR}/${_MARCH}/pc; \
197 cd ${.CURDIR}/../sys/${_MARCH}/include/pc; \
198 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
199 ${DESTDIR}${INCLUDEDIR}/${_MARCH}/pc
204 @${ECHO} "Setting up symlinks to kernel source tree..."
206 cd ${.CURDIR}/../sys/$i; \
208 ln -fs ../../../sys/$i/$$h ${DESTDIR}${INCLUDEDIR}/$i; \
211 .for i in ${LSUBDIRS:Ndev/acpica:Ndev/bktr}
212 cd ${.CURDIR}/../sys/$i; \
214 ln -fs ../../../../sys/$i/$$h ${DESTDIR}${INCLUDEDIR}/$i; \
217 cd ${.CURDIR}/../sys/dev/acpica; \
218 for h in acpiio.h; do \
219 ln -fs ../../../../sys/dev/acpica/$$h \
220 ${DESTDIR}${INCLUDEDIR}/dev/acpica; \
222 cd ${.CURDIR}/../sys/dev/bktr; \
223 for h in ioctl_*.h; do \
224 ln -fs ../../../../sys/dev/bktr/$$h \
225 ${DESTDIR}${INCLUDEDIR}/dev/bktr; \
227 .for i in ${LSUBSUBDIRS}
228 cd ${.CURDIR}/../sys/$i; \
230 ln -fs ../../../../../sys/$i/$$h ${DESTDIR}${INCLUDEDIR}/$i; \
233 cd ${.CURDIR}/../sys/contrib/altq/altq; \
235 ln -fs ../../../sys/contrib/altq/altq/$$h \
236 ${DESTDIR}${INCLUDEDIR}/altq; \
238 .if ${MK_IPFILTER} != "no"
239 cd ${.CURDIR}/../sys/contrib/ipfilter/netinet; \
241 ln -fs ../../../sys/contrib/ipfilter/netinet/$$h \
242 ${DESTDIR}${INCLUDEDIR}/netinet; \
245 cd ${.CURDIR}/../sys/contrib/pf/net; \
247 ln -fs ../../../sys/contrib/pf/net/$$h \
248 ${DESTDIR}${INCLUDEDIR}/net; \
250 cd ${.CURDIR}/../sys/crypto; \
251 for h in rijndael/rijndael.h; do \
252 ln -fs ../../../sys/crypto/$$h \
253 ${DESTDIR}${INCLUDEDIR}/crypto; \
255 cd ${.CURDIR}/../sys/opencrypto; \
257 ln -fs ../../../sys/opencrypto/$$h \
258 ${DESTDIR}${INCLUDEDIR}/crypto; \
260 cd ${.CURDIR}/../sys/${MACHINE}/include; \
262 ln -fs ../../../sys/${MACHINE}/include/$$h \
263 ${DESTDIR}${INCLUDEDIR}/machine; \
265 .if exists(${.CURDIR}/../sys/${MACHINE}/include/pc)
266 cd ${.CURDIR}/../sys/${MACHINE}/include/pc; \
268 ln -fs ../../../../sys/${MACHINE}/include/pc/$$h \
269 ${DESTDIR}${INCLUDEDIR}/machine/pc; \
273 ${INSTALL} -d -o ${BINOWN} -g ${BINGRP} -m 755 \
274 ${DESTDIR}${INCLUDEDIR}/${_MARCH}; \
275 cd ${.CURDIR}/../sys/${_MARCH}/include; \
277 ln -fs ../../../sys/${_MARCH}/include/$$h \
278 ${DESTDIR}${INCLUDEDIR}/${_MARCH}; \
280 .if exists(${.CURDIR}/../sys/${_MARCH}/include/pc)
281 ${INSTALL} -d -o ${BINOWN} -g ${BINGRP} -m 755 \
282 ${DESTDIR}${INCLUDEDIR}/${_MARCH}/pc; \
283 cd ${.CURDIR}/../sys/${_MARCH}/include/pc; \
285 ln -fs ../../../../sys/${_MARCH}/include/pc/$$h \
286 ${DESTDIR}${INCLUDEDIR}/${_MARCH}/pc; \