1 # @(#)Makefile 8.2 (Berkeley) 1/4/94
4 # Doing a "make install" builds /usr/include.
6 CLEANFILES= osreldate.h version vers.c
7 SUBDIR= arpa protocols rpcsvc rpc
8 INCS= a.out.h ar.h assert.h bitstring.h complex.h cpio.h _ctype.h ctype.h \
10 dirent.h dlfcn.h elf.h elf-hints.h err.h fmtmsg.h fnmatch.h fstab.h \
11 fts.h ftw.h getopt.h glob.h grp.h \
12 hesiod.h histedit.h ieeefp.h ifaddrs.h \
13 inttypes.h iso646.h kenv.h langinfo.h libgen.h limits.h link.h \
14 locale.h malloc.h memory.h monetary.h mpool.h ndbm.h netconfig.h \
15 netdb.h nl_types.h nlist.h nss.h nsswitch.h objformat.h paths.h \
16 proc_service.h pthread.h \
17 pthread_np.h pwd.h ranlib.h readpassphrase.h regex.h regexp.h \
18 resolv.h runefile.h runetype.h search.h setjmp.h sgtty.h \
20 stdbool.h stddef.h stdio.h stdlib.h string.h stringlist.h \
21 strings.h sysexits.h tar.h tgmath.h \
22 time.h timeconv.h timers.h ttyent.h \
23 ulimit.h unistd.h utime.h utmp.h uuid.h varargs.h vis.h wchar.h \
26 MHDRS= float.h floatingpoint.h stdarg.h
28 # posix4/mqueue.h is useless without an implementation and isn't installed:
29 PHDRS= sched.h semaphore.h _semaphore.h # mqueue.h
31 LHDRS= aio.h errno.h fcntl.h linker_set.h poll.h stdint.h syslog.h \
34 LDIRS= cam geom net net80211 netatalk netatm netgraph netinet netinet6 \
35 netipsec netipx netkey netnatm netncp netsmb nfs nfsclient nfsserver \
39 dev/acpica dev/an dev/bktr dev/firewire \
40 dev/ic dev/iicbus ${_dev_ieee488} dev/ofw \
41 dev/pbio dev/ppbus dev/smbus dev/usb dev/wi dev/utopia \
42 fs/devfs fs/fdescfs fs/fifofs fs/msdosfs fs/ntfs fs/nullfs \
43 fs/nwfs fs/portalfs fs/procfs fs/smbfs fs/udf fs/umapfs \
45 geom/concat geom/gate geom/label geom/mirror geom/nop geom/raid3 \
46 geom/shsec geom/stripe \
48 netatm/ipatm netatm/sigpvc netatm/spans netatm/uni \
49 netgraph/atm netgraph/netflow \
50 security/mac_biba security/mac_bsdextended security/mac_lomac \
51 security/mac_mls security/mac_partition \
55 _dev_ieee488= dev/ieee488
58 .if !defined(NO_BLUETOOTH)
59 LSUBSUBDIRS= netgraph/bluetooth/include
62 # Define SHARED to indicate whether you want symbolic links to the system
63 # source (``symlinks''), or a separate copy (``copies''). ``symlinks'' is
64 # probably only useful for developers and should be avoided if you do not
65 # wish to tie your /usr/include and /usr/src together.
71 osreldate.h: ${.CURDIR}/../sys/conf/newvers.sh \
72 ${.CURDIR}/../sys/sys/param.h \
74 @${ECHO} creating osreldate.h from newvers.sh
75 @setvar PARAMFILE ${.CURDIR}/../sys/sys/param.h; \
76 MAKE=${MAKE} . ${.CURDIR}/../sys/conf/newvers.sh; \
77 echo "$$COPYRIGHT" > osreldate.h; \
78 echo "#ifdef _KERNEL" >> osreldate.h; \
79 echo '#error "<osreldate.h> cannot be used in the kernel, use <sys/param.h>"' >> osreldate.h; \
80 echo "#else" >> osreldate.h; \
81 echo \#'undef __FreeBSD_version' >> osreldate.h; \
82 echo \#'define __FreeBSD_version' $$RELDATE >> osreldate.h; \
83 echo "#endif" >> osreldate.h
86 INCSLINKS+= sys/$i ${INCLUDEDIR}/$i
89 INCSLINKS+= machine/$i ${INCLUDEDIR}/$i
92 INCSLINKS+= posix4/$i ${INCLUDEDIR}/$i
95 .include <bsd.prog.mk>
97 installincludes: ${SHARED}
100 # Take care of stale directory-level symlinks.
102 .for i in ${LDIRS} ${LSUBDIRS} machine crypto
103 if [ -L ${DESTDIR}${INCLUDEDIR}/$i ]; then \
104 rm -f ${DESTDIR}${INCLUDEDIR}/$i; \
107 mtree -deU ${MTREE_FOLLOWS_SYMLINKS} \
108 -f ${.CURDIR}/../etc/mtree/BSD.include.dist \
109 -p ${DESTDIR}${INCLUDEDIR}
110 .if defined(WITH_BIND_LIBS) && !defined(NO_BIND)
111 mtree -deU ${MTREE_FOLLOWS_SYMLINKS} \
112 -f ${.CURDIR}/../etc/mtree/BIND.include.dist \
113 -p ${DESTDIR}${INCLUDEDIR}
117 .for i in ${LDIRS} ${LSUBDIRS} ${LSUBSUBDIRS} altq crypto machine machine/pc
118 .if exists(${DESTDIR}${INCLUDEDIR}/$i)
119 cd ${DESTDIR}${INCLUDEDIR}/$i; \
121 if [ -L $$h ]; then rm -f $$h; fi; \
125 .for i in ${LDIRS} ${LSUBDIRS:Ndev/bktr} ${LSUBSUBDIRS}
126 cd ${.CURDIR}/../sys; \
127 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 $i/*.h \
128 ${DESTDIR}${INCLUDEDIR}/$i
130 cd ${.CURDIR}/../sys/dev/bktr; \
131 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 ioctl_*.h \
132 ${DESTDIR}${INCLUDEDIR}/dev/bktr
133 cd ${.CURDIR}/../sys/contrib/altq/altq; \
134 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
135 ${DESTDIR}${INCLUDEDIR}/altq
136 cd ${.CURDIR}/../sys/contrib/ipfilter/netinet; \
137 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
138 ${DESTDIR}${INCLUDEDIR}/netinet
139 cd ${.CURDIR}/../sys/contrib/pf/net; \
140 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
141 ${DESTDIR}${INCLUDEDIR}/net
142 cd ${.CURDIR}/../sys/opencrypto; \
143 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
144 ${DESTDIR}${INCLUDEDIR}/crypto
145 cd ${.CURDIR}/../sys/${MACHINE_ARCH}/include; \
146 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
147 ${DESTDIR}${INCLUDEDIR}/machine
148 .if exists(${.CURDIR}/../sys/${MACHINE_ARCH}/include/pc)
149 cd ${.CURDIR}/../sys/${MACHINE_ARCH}/include/pc; \
150 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
151 ${DESTDIR}${INCLUDEDIR}/machine/pc
155 @${ECHO} "Setting up symlinks to kernel source tree..."
157 cd ${.CURDIR}/../sys/$i; \
159 ln -fs ../../../sys/$i/$$h ${DESTDIR}${INCLUDEDIR}/$i; \
162 .for i in ${LSUBDIRS:Ndev/bktr}
163 cd ${.CURDIR}/../sys/$i; \
165 ln -fs ../../../../sys/$i/$$h ${DESTDIR}${INCLUDEDIR}/$i; \
168 cd ${.CURDIR}/../sys/dev/bktr; \
169 for h in ioctl_*.h; do \
170 ln -fs ../../../../sys/dev/bktr/$$h \
171 ${DESTDIR}${INCLUDEDIR}/dev/bktr; \
173 .for i in ${LSUBSUBDIRS}
174 cd ${.CURDIR}/../sys/$i; \
176 ln -fs ../../../../../sys/$i/$$h ${DESTDIR}${INCLUDEDIR}/$i; \
179 cd ${.CURDIR}/../sys/contrib/altq/altq; \
181 ln -fs ../../../sys/contrib/altq/altq/$$h \
182 ${DESTDIR}${INCLUDEDIR}/altq; \
184 cd ${.CURDIR}/../sys/contrib/ipfilter/netinet; \
186 ln -fs ../../../sys/contrib/ipfilter/netinet/$$h \
187 ${DESTDIR}${INCLUDEDIR}/netinet; \
189 cd ${.CURDIR}/../sys/contrib/pf/net; \
191 ln -fs ../../../sys/contrib/pf/net/$$h \
192 ${DESTDIR}${INCLUDEDIR}/net; \
194 cd ${.CURDIR}/../sys/opencrypto; \
196 ln -fs ../../../sys/opencrypto/$$h \
197 ${DESTDIR}${INCLUDEDIR}/crypto; \
199 cd ${.CURDIR}/../sys/${MACHINE_ARCH}/include; \
201 ln -fs ../../../sys/${MACHINE_ARCH}/include/$$h \
202 ${DESTDIR}${INCLUDEDIR}/machine; \
204 .if exists(${.CURDIR}/../sys/${MACHINE_ARCH}/include/pc)
205 cd ${.CURDIR}/../sys/${MACHINE_ARCH}/include/pc; \
207 ln -fs ../../../../sys/${MACHINE_ARCH}/include/pc/$$h \
208 ${DESTDIR}${INCLUDEDIR}/machine/pc; \