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 runetype.h search.h setjmp.h sgtty.h signal.h stab.h \
19 stdbool.h stddef.h stdio.h stdlib.h string.h stringlist.h \
20 strings.h sysexits.h tar.h tgmath.h \
21 time.h timeconv.h timers.h ttyent.h \
22 ulimit.h unistd.h utime.h utmp.h uuid.h varargs.h vis.h wchar.h \
25 MHDRS= float.h floatingpoint.h stdarg.h
27 # posix4/mqueue.h is useless without an implementation and isn't installed:
28 PHDRS= sched.h semaphore.h _semaphore.h # mqueue.h
30 LHDRS= aio.h errno.h fcntl.h linker_set.h poll.h stdint.h syslog.h \
33 LDIRS= cam geom net net80211 netatalk netatm netgraph netinet netinet6 \
34 netipsec netipx netkey netnatm netncp netsmb nfs nfsclient nfsserver \
37 LSUBDIRS= cam/scsi dev/an dev/bktr dev/firewire dev/ic dev/iicbus \
38 dev/ofw dev/ppbus dev/smbus dev/usb dev/wi dev/utopia fs/devfs \
39 fs/fdescfs fs/fifofs fs/msdosfs fs/ntfs fs/nullfs fs/nwfs fs/portalfs \
40 fs/procfs fs/smbfs fs/udf fs/umapfs fs/unionfs \
41 geom/concat geom/gate geom/label geom/mirror geom/nop geom/raid3 \
43 isofs/cd9660 netatm/ipatm netatm/sigpvc netatm/spans netatm/uni \
44 netgraph/atm netgraph/netflow \
45 security/mac_biba security/mac_bsdextended security/mac_lomac \
46 security/mac_mls security/mac_partition \
47 ufs/ffs ufs/ufs fs/autofs
49 .if !defined(NO_BLUETOOTH)
50 LSUBSUBDIRS= netgraph/bluetooth/include
53 # Define SHARED to indicate whether you want symbolic links to the system
54 # source (``symlinks''), or a separate copy (``copies''). ``symlinks'' is
55 # probably only useful for developers and should be avoided if you do not
56 # wish to tie your /usr/include and /usr/src together.
62 osreldate.h: ${.CURDIR}/../sys/conf/newvers.sh \
63 ${.CURDIR}/../sys/sys/param.h \
65 @${ECHO} creating osreldate.h from newvers.sh
66 @setvar PARAMFILE ${.CURDIR}/../sys/sys/param.h; \
67 MAKE=${MAKE} . ${.CURDIR}/../sys/conf/newvers.sh; \
68 echo "$$COPYRIGHT" > osreldate.h; \
69 echo "#ifdef _KERNEL" >> osreldate.h; \
70 echo '#error "<osreldate.h> cannot be used in the kernel, use <sys/param.h>"' >> osreldate.h; \
71 echo "#else" >> osreldate.h; \
72 echo \#'undef __FreeBSD_version' >> osreldate.h; \
73 echo \#'define __FreeBSD_version' $$RELDATE >> osreldate.h; \
74 echo "#endif" >> osreldate.h
77 INCSLINKS+= sys/$i ${INCLUDEDIR}/$i
80 INCSLINKS+= machine/$i ${INCLUDEDIR}/$i
83 INCSLINKS+= posix4/$i ${INCLUDEDIR}/$i
86 .include <bsd.prog.mk>
88 installincludes: ${SHARED}
91 # Take care of stale directory-level symlinks.
93 .for i in ${LDIRS} ${LSUBDIRS} machine crypto
94 if [ -L ${DESTDIR}${INCLUDEDIR}/$i ]; then \
95 rm -f ${DESTDIR}${INCLUDEDIR}/$i; \
98 mtree -deU ${MTREE_FOLLOWS_SYMLINKS} \
99 -f ${.CURDIR}/../etc/mtree/BSD.include.dist \
100 -p ${DESTDIR}${INCLUDEDIR}
101 .if defined(WITH_BIND_LIBS) && !defined(NO_BIND)
102 mtree -deU ${MTREE_FOLLOWS_SYMLINKS} \
103 -f ${.CURDIR}/../etc/mtree/BIND.include.dist \
104 -p ${DESTDIR}${INCLUDEDIR}
108 .for i in ${LDIRS} ${LSUBDIRS} crypto machine machine/pc
109 .if exists(${DESTDIR}${INCLUDEDIR}/$i)
110 cd ${DESTDIR}${INCLUDEDIR}/$i; \
112 if [ -L $$h ]; then rm -f $$h; fi; \
116 .for i in ${LDIRS} ${LSUBDIRS:Ndev/bktr} ${LSUBSUBDIRS}
117 cd ${.CURDIR}/../sys; \
118 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 $i/*.h \
119 ${DESTDIR}${INCLUDEDIR}/$i
121 cd ${.CURDIR}/../sys/dev/bktr; \
122 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 ioctl_*.h \
123 ${DESTDIR}${INCLUDEDIR}/dev/bktr
124 cd ${.CURDIR}/../sys/contrib/altq/altq; \
125 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
126 ${DESTDIR}${INCLUDEDIR}/altq
127 cd ${.CURDIR}/../sys/contrib/ipfilter/netinet; \
128 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
129 ${DESTDIR}${INCLUDEDIR}/netinet
130 cd ${.CURDIR}/../sys/contrib/pf/net; \
131 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
132 ${DESTDIR}${INCLUDEDIR}/net
133 cd ${.CURDIR}/../sys/opencrypto; \
134 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
135 ${DESTDIR}${INCLUDEDIR}/crypto
136 cd ${.CURDIR}/../sys/${MACHINE_ARCH}/include; \
137 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
138 ${DESTDIR}${INCLUDEDIR}/machine
139 .if exists(${.CURDIR}/../sys/${MACHINE_ARCH}/include/pc)
140 cd ${.CURDIR}/../sys/${MACHINE_ARCH}/include/pc; \
141 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
142 ${DESTDIR}${INCLUDEDIR}/machine/pc
146 @${ECHO} "Setting up symlinks to kernel source tree..."
148 cd ${.CURDIR}/../sys/$i; \
150 ln -fs ../../../sys/$i/$$h ${DESTDIR}${INCLUDEDIR}/$i; \
153 .for i in ${LSUBDIRS}
154 cd ${.CURDIR}/../sys/$i; \
156 ln -fs ../../../../sys/$i/$$h ${DESTDIR}${INCLUDEDIR}/$i; \
159 .for i in ${LSUBSUBDIRS}
160 cd ${.CURDIR}/../sys/$i; \
162 ln -fs ../../../../../sys/$i/$$h ${DESTDIR}${INCLUDEDIR}/$i; \
165 cd ${.CURDIR}/../sys/contrib/altq/altq; \
167 ln -fs ../../../sys/contrib/altq/altq/$$h \
168 ${DESTDIR}${INCLUDEDIR}/altq; \
170 cd ${.CURDIR}/../sys/contrib/ipfilter/netinet; \
172 ln -fs ../../../sys/contrib/ipfilter/netinet/$$h \
173 ${DESTDIR}${INCLUDEDIR}/netinet; \
175 cd ${.CURDIR}/../sys/contrib/pf/net; \
177 ln -fs ../../../sys/contrib/pf/net/$$h \
178 ${DESTDIR}${INCLUDEDIR}/net; \
180 cd ${.CURDIR}/../sys/opencrypto; \
182 ln -fs ../../../sys/opencrypto/$$h \
183 ${DESTDIR}${INCLUDEDIR}/crypto; \
185 cd ${.CURDIR}/../sys/${MACHINE_ARCH}/include; \
187 ln -fs ../../../sys/${MACHINE_ARCH}/include/$$h \
188 ${DESTDIR}${INCLUDEDIR}/machine; \
190 .if exists(${.CURDIR}/../sys/${MACHINE_ARCH}/include/pc)
191 cd ${.CURDIR}/../sys/${MACHINE_ARCH}/include/pc; \
193 ln -fs ../../../../sys/${MACHINE_ARCH}/include/pc/$$h \
194 ${DESTDIR}${INCLUDEDIR}/machine/pc; \