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 db.h \
9 dirent.h dlfcn.h elf.h elf-hints.h err.h fmtmsg.h fnmatch.h fstab.h \
10 fts.h ftw.h getopt.h glob.h grp.h \
11 hesiod.h histedit.h ieeefp.h ifaddrs.h \
12 inttypes.h iso646.h kenv.h langinfo.h libgen.h limits.h link.h \
13 locale.h malloc.h memory.h monetary.h mpool.h ndbm.h netconfig.h \
14 netdb.h nl_types.h nlist.h nss.h nsswitch.h objformat.h paths.h \
15 proc_service.h pthread.h \
16 pthread_np.h pwd.h ranlib.h readpassphrase.h regex.h regexp.h \
17 resolv.h rune.h runetype.h search.h setjmp.h sgtty.h signal.h stab.h \
18 stdbool.h stddef.h stdio.h stdlib.h string.h stringlist.h \
19 strings.h sysexits.h tar.h tgmath.h \
20 time.h timeconv.h timers.h ttyent.h \
21 ulimit.h unistd.h utime.h utmp.h uuid.h varargs.h vis.h wchar.h \
24 MHDRS= float.h floatingpoint.h stdarg.h
26 # posix4/mqueue.h is useless without an implementation and isn't installed:
27 PHDRS= sched.h semaphore.h _semaphore.h # mqueue.h
29 LHDRS= aio.h errno.h fcntl.h linker_set.h poll.h stdint.h syslog.h \
32 LDIRS= cam geom net net80211 netatalk netatm netgraph netinet netinet6 \
33 netipsec netipx netkey netnatm netncp netsmb nfs nfsclient nfsserver \
36 LSUBDIRS= cam/scsi dev/an dev/bktr dev/firewire dev/ic dev/iicbus \
37 dev/ofw dev/ppbus dev/smbus dev/usb dev/wi dev/utopia fs/devfs \
38 fs/fdescfs fs/fifofs fs/msdosfs fs/ntfs fs/nullfs fs/nwfs fs/portalfs \
39 fs/procfs fs/smbfs fs/udf fs/umapfs fs/unionfs \
40 geom/concat geom/gate geom/label geom/mirror geom/nop geom/stripe \
41 isofs/cd9660 netatm/ipatm netatm/sigpvc netatm/spans netatm/uni \
42 netgraph/atm security/mac_biba security/mac_bsdextended \
43 security/mac_lomac security/mac_mls security/mac_partition \
46 .if !defined(NO_BLUETOOTH)
47 LSUBSUBDIRS= netgraph/bluetooth/include
50 # Define SHARED to indicate whether you want symbolic links to the system
51 # source (``symlinks''), or a separate copy (``copies''). ``symlinks'' is
52 # probably only useful for developers and should be avoided if you do not
53 # wish to tie your /usr/include and /usr/src together.
59 osreldate.h: ${.CURDIR}/../sys/conf/newvers.sh \
60 ${.CURDIR}/../sys/sys/param.h \
62 @${ECHO} creating osreldate.h from newvers.sh
63 @setvar PARAMFILE ${.CURDIR}/../sys/sys/param.h; \
64 . ${.CURDIR}/../sys/conf/newvers.sh; \
65 echo "$$COPYRIGHT" > osreldate.h; \
66 echo "#ifdef _KERNEL" >> osreldate.h; \
67 echo '#error "<osreldate.h> cannot be used in the kernel, use <sys/param.h>"' >> osreldate.h; \
68 echo "#else" >> osreldate.h; \
69 echo \#'undef __FreeBSD_version' >> osreldate.h; \
70 echo \#'define __FreeBSD_version' $$RELDATE >> osreldate.h; \
71 echo "#endif" >> osreldate.h
74 INCSLINKS+= sys/$i ${INCLUDEDIR}/$i
77 INCSLINKS+= machine/$i ${INCLUDEDIR}/$i
80 INCSLINKS+= posix4/$i ${INCLUDEDIR}/$i
83 .include <bsd.prog.mk>
85 installincludes: ${SHARED}
88 # Take care of stale directory-level symlinks.
90 .for i in ${LDIRS} ${LSUBDIRS} machine crypto
91 if [ -L ${DESTDIR}${INCLUDEDIR}/$i ]; then \
92 rm -f ${DESTDIR}${INCLUDEDIR}/$i; \
95 mtree -deU ${MTREE_FOLLOWS_SYMLINKS} \
96 -f ${.CURDIR}/../etc/mtree/BSD.include.dist \
97 -p ${DESTDIR}${INCLUDEDIR}
100 .for i in ${LDIRS} ${LSUBDIRS} crypto machine machine/pc
101 .if exists(${DESTDIR}${INCLUDEDIR}/$i)
102 cd ${DESTDIR}${INCLUDEDIR}/$i; \
104 if [ -L $$h ]; then rm -f $$h; fi; \
108 .for i in ${LDIRS} ${LSUBDIRS:Ndev/bktr} ${LSUBSUBDIRS}
109 cd ${.CURDIR}/../sys; \
110 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 $i/*.h \
111 ${DESTDIR}${INCLUDEDIR}/$i
113 cd ${.CURDIR}/../sys/dev/bktr; \
114 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 ioctl_*.h \
115 ${DESTDIR}${INCLUDEDIR}/dev/bktr
116 cd ${.CURDIR}/../sys/contrib/altq/altq; \
117 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
118 ${DESTDIR}${INCLUDEDIR}/altq
119 cd ${.CURDIR}/../sys/contrib/ipfilter/netinet; \
120 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
121 ${DESTDIR}${INCLUDEDIR}/netinet
122 cd ${.CURDIR}/../sys/contrib/pf/net; \
123 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
124 ${DESTDIR}${INCLUDEDIR}/net
125 cd ${.CURDIR}/../sys/opencrypto; \
126 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
127 ${DESTDIR}${INCLUDEDIR}/crypto
128 cd ${.CURDIR}/../sys/${MACHINE_ARCH}/include; \
129 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
130 ${DESTDIR}${INCLUDEDIR}/machine
131 .if exists(${.CURDIR}/../sys/${MACHINE_ARCH}/include/pc)
132 cd ${.CURDIR}/../sys/${MACHINE_ARCH}/include/pc; \
133 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
134 ${DESTDIR}${INCLUDEDIR}/machine/pc
138 @${ECHO} "Setting up symlinks to kernel source tree..."
140 cd ${.CURDIR}/../sys/$i; \
142 ln -fs ../../../sys/$i/$$h ${DESTDIR}${INCLUDEDIR}/$i; \
145 .for i in ${LSUBDIRS}
146 cd ${.CURDIR}/../sys/$i; \
148 ln -fs ../../../../sys/$i/$$h ${DESTDIR}${INCLUDEDIR}/$i; \
151 .for i in ${LSUBSUBDIRS}
152 cd ${.CURDIR}/../sys/$i; \
154 ln -fs ../../../../../sys/$i/$$h ${DESTDIR}${INCLUDEDIR}/$i; \
157 cd ${.CURDIR}/../sys/contrib/altq/altq; \
159 ln -fs ../../../sys/contrib/altq/altq/$$h \
160 ${DESTDIR}${INCLUDEDIR}/altq; \
162 cd ${.CURDIR}/../sys/contrib/ipfilter/netinet; \
164 ln -fs ../../../sys/contrib/ipfilter/netinet/$$h \
165 ${DESTDIR}${INCLUDEDIR}/netinet; \
167 cd ${.CURDIR}/../sys/contrib/pf/net; \
169 ln -fs ../../../sys/contrib/pf/net/$$h \
170 ${DESTDIR}${INCLUDEDIR}/net; \
172 cd ${.CURDIR}/../sys/opencrypto; \
174 ln -fs ../../../sys/opencrypto/$$h \
175 ${DESTDIR}${INCLUDEDIR}/crypto; \
177 cd ${.CURDIR}/../sys/${MACHINE_ARCH}/include; \
179 ln -fs ../../../sys/${MACHINE_ARCH}/include/$$h \
180 ${DESTDIR}${INCLUDEDIR}/machine; \
182 .if exists(${.CURDIR}/../sys/${MACHINE_ARCH}/include/pc)
183 cd ${.CURDIR}/../sys/${MACHINE_ARCH}/include/pc; \
185 ln -fs ../../../../sys/${MACHINE_ARCH}/include/pc/$$h \
186 ${DESTDIR}${INCLUDEDIR}/machine/pc; \