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 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 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/ppbus dev/smbus dev/speaker dev/usb dev/wi dev/utopia \
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/concat geom/eli geom/gate geom/label geom/mirror geom/nop \
49 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 ${MK_GPIB} != "no"
59 _dev_ieee488= dev/ieee488
62 .if ${MK_HESIOD} != "no"
66 .if ${MK_BLUETOOTH} != "no"
67 LSUBSUBDIRS= netgraph/bluetooth/include
70 # XXX unconditionally needed by <netsmb/netbios.h>
71 #.if ${MK_IPX} != "no"
80 # Define SHARED to indicate whether you want symbolic links to the system
81 # source (``symlinks''), or a separate copy (``copies''). ``symlinks'' is
82 # probably only useful for developers and should be avoided if you do not
83 # wish to tie your /usr/include and /usr/src together.
89 osreldate.h: ${.CURDIR}/../sys/conf/newvers.sh ${.CURDIR}/../sys/sys/param.h \
91 @${ECHO} creating osreldate.h from newvers.sh
93 PARAMFILE=${.CURDIR}/../sys/sys/param.h; \
94 . ${.CURDIR}/../sys/conf/newvers.sh; \
95 echo "$$COPYRIGHT" > osreldate.h; \
96 echo "#ifdef _KERNEL" >> osreldate.h; \
97 echo "#error \"<osreldate.h> cannot be used in the kernel, use <sys/param.h>\"" >> osreldate.h; \
98 echo "#else" >> osreldate.h; \
99 echo "#undef __FreeBSD_version" >> osreldate.h; \
100 echo "#define __FreeBSD_version $$RELDATE" >> osreldate.h; \
101 echo "#endif" >> osreldate.h
104 INCSLINKS+= sys/$i ${INCLUDEDIR}/$i
107 INCSLINKS+= machine/$i ${INCLUDEDIR}/$i
110 INCSLINKS+= posix4/$i ${INCLUDEDIR}/$i
113 .if ${MACHINE} != ${MACHINE_ARCH}
114 _MARCH=${MACHINE_ARCH}
117 .include <bsd.prog.mk>
119 installincludes: ${SHARED}
122 # Take care of stale directory-level symlinks.
124 .for i in ${LDIRS} ${LSUBDIRS} machine ${_MARCH} crypto
125 if [ -L ${DESTDIR}${INCLUDEDIR}/$i ]; then \
126 rm -f ${DESTDIR}${INCLUDEDIR}/$i; \
129 mtree -deU ${MTREE_FOLLOWS_SYMLINKS} \
130 -f ${.CURDIR}/../etc/mtree/BSD.include.dist \
131 -p ${DESTDIR}${INCLUDEDIR}
132 .if ${MK_BIND_LIBS} != "no"
133 mtree -deU ${MTREE_FOLLOWS_SYMLINKS} \
134 -f ${.CURDIR}/../etc/mtree/BIND.include.dist \
135 -p ${DESTDIR}${INCLUDEDIR}
139 .for i in ${LDIRS} ${LSUBDIRS} ${LSUBSUBDIRS} altq crypto machine machine/pc \
141 .if exists(${DESTDIR}${INCLUDEDIR}/$i)
142 cd ${DESTDIR}${INCLUDEDIR}/$i; \
144 if [ -L $$h ]; then rm -f $$h; fi; \
148 .for i in ${LDIRS} ${LSUBDIRS:Ndev/acpica:Ndev/bktr} ${LSUBSUBDIRS}
149 cd ${.CURDIR}/../sys; \
150 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 $i/*.h \
151 ${DESTDIR}${INCLUDEDIR}/$i
153 cd ${.CURDIR}/../sys/dev/acpica; \
154 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 acpiio.h \
155 ${DESTDIR}${INCLUDEDIR}/dev/acpica
156 cd ${.CURDIR}/../sys/dev/bktr; \
157 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 ioctl_*.h \
158 ${DESTDIR}${INCLUDEDIR}/dev/bktr
159 cd ${.CURDIR}/../sys/contrib/altq/altq; \
160 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
161 ${DESTDIR}${INCLUDEDIR}/altq
162 .if ${MK_IPFILTER} != "no"
163 cd ${.CURDIR}/../sys/contrib/ipfilter/netinet; \
164 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
165 ${DESTDIR}${INCLUDEDIR}/netinet
167 cd ${.CURDIR}/../sys/contrib/pf/net; \
168 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
169 ${DESTDIR}${INCLUDEDIR}/net
170 cd ${.CURDIR}/../sys/crypto; \
171 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 rijndael/rijndael.h \
172 ${DESTDIR}${INCLUDEDIR}/crypto
173 cd ${.CURDIR}/../sys/opencrypto; \
174 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
175 ${DESTDIR}${INCLUDEDIR}/crypto
176 cd ${.CURDIR}/../sys/${MACHINE}/include; \
177 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
178 ${DESTDIR}${INCLUDEDIR}/machine
179 .if exists(${.CURDIR}/../sys/${MACHINE}/include/pc)
180 cd ${.CURDIR}/../sys/${MACHINE}/include/pc; \
181 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
182 ${DESTDIR}${INCLUDEDIR}/machine/pc
185 ${INSTALL} -d -o ${BINOWN} -g ${BINGRP} -m 755 \
186 ${DESTDIR}${INCLUDEDIR}/${_MARCH}; \
187 cd ${.CURDIR}/../sys/${_MARCH}/include; \
188 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
189 ${DESTDIR}${INCLUDEDIR}/${_MARCH}
190 .if exists(${.CURDIR}/../sys/${_MARCH}/include/pc)
191 ${INSTALL} -d -o ${BINOWN} -g ${BINGRP} -m 755 \
192 ${DESTDIR}${INCLUDEDIR}/${_MARCH}/pc; \
193 cd ${.CURDIR}/../sys/${_MARCH}/include/pc; \
194 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
195 ${DESTDIR}${INCLUDEDIR}/${_MARCH}/pc
200 @${ECHO} "Setting up symlinks to kernel source tree..."
202 cd ${.CURDIR}/../sys/$i; \
204 ln -fs ../../../sys/$i/$$h ${DESTDIR}${INCLUDEDIR}/$i; \
207 .for i in ${LSUBDIRS:Ndev/acpica:Ndev/bktr}
208 cd ${.CURDIR}/../sys/$i; \
210 ln -fs ../../../../sys/$i/$$h ${DESTDIR}${INCLUDEDIR}/$i; \
213 cd ${.CURDIR}/../sys/dev/acpica; \
214 for h in acpiio.h; do \
215 ln -fs ../../../../sys/dev/acpica/$$h \
216 ${DESTDIR}${INCLUDEDIR}/dev/acpica; \
218 cd ${.CURDIR}/../sys/dev/bktr; \
219 for h in ioctl_*.h; do \
220 ln -fs ../../../../sys/dev/bktr/$$h \
221 ${DESTDIR}${INCLUDEDIR}/dev/bktr; \
223 .for i in ${LSUBSUBDIRS}
224 cd ${.CURDIR}/../sys/$i; \
226 ln -fs ../../../../../sys/$i/$$h ${DESTDIR}${INCLUDEDIR}/$i; \
229 cd ${.CURDIR}/../sys/contrib/altq/altq; \
231 ln -fs ../../../sys/contrib/altq/altq/$$h \
232 ${DESTDIR}${INCLUDEDIR}/altq; \
234 .if ${MK_IPFILTER} != "no"
235 cd ${.CURDIR}/../sys/contrib/ipfilter/netinet; \
237 ln -fs ../../../sys/contrib/ipfilter/netinet/$$h \
238 ${DESTDIR}${INCLUDEDIR}/netinet; \
241 cd ${.CURDIR}/../sys/contrib/pf/net; \
243 ln -fs ../../../sys/contrib/pf/net/$$h \
244 ${DESTDIR}${INCLUDEDIR}/net; \
246 cd ${.CURDIR}/../sys/crypto; \
247 for h in rijndael/rijndael.h; do \
248 ln -fs ../../../sys/crypto/$$h \
249 ${DESTDIR}${INCLUDEDIR}/crypto; \
251 cd ${.CURDIR}/../sys/opencrypto; \
253 ln -fs ../../../sys/opencrypto/$$h \
254 ${DESTDIR}${INCLUDEDIR}/crypto; \
256 cd ${.CURDIR}/../sys/${MACHINE}/include; \
258 ln -fs ../../../sys/${MACHINE}/include/$$h \
259 ${DESTDIR}${INCLUDEDIR}/machine; \
261 .if exists(${.CURDIR}/../sys/${MACHINE}/include/pc)
262 cd ${.CURDIR}/../sys/${MACHINE}/include/pc; \
264 ln -fs ../../../../sys/${MACHINE}/include/pc/$$h \
265 ${DESTDIR}${INCLUDEDIR}/machine/pc; \
269 ${INSTALL} -d -o ${BINOWN} -g ${BINGRP} -m 755 \
270 ${DESTDIR}${INCLUDEDIR}/${_MARCH}; \
271 cd ${.CURDIR}/../sys/${_MARCH}/include; \
273 ln -fs ../../../sys/${_MARCH}/include/$$h \
274 ${DESTDIR}${INCLUDEDIR}/${_MARCH}; \
276 .if exists(${.CURDIR}/../sys/${_MARCH}/include/pc)
277 ${INSTALL} -d -o ${BINOWN} -g ${BINGRP} -m 755 \
278 ${DESTDIR}${INCLUDEDIR}/${_MARCH}/pc; \
279 cd ${.CURDIR}/../sys/${_MARCH}/include/pc; \
281 ln -fs ../../../../sys/${_MARCH}/include/pc/$$h \
282 ${DESTDIR}${INCLUDEDIR}/${_MARCH}/pc; \