1 # @(#)Makefile 8.2 (Berkeley) 1/4/94
4 # Doing a make install builds /usr/include
6 # The ``rm -rf''s used below are safe because rm doesn't follow symbolic
9 CLEANFILES= osreldate.h version vers.c
10 SUBDIR= arpa protocols rpcsvc rpc
11 INCS= a.out.h ar.h assert.h bitstring.h complex.h cpio.h ctype.h db.h \
12 dirent.h dlfcn.h elf.h elf-hints.h err.h fmtmsg.h fnmatch.h fstab.h \
13 fts.h getopt.h glob.h grp.h hesiod.h histedit.h ieeefp.h ifaddrs.h \
14 inttypes.h iso646.h kenv.h langinfo.h libgen.h limits.h link.h \
15 locale.h malloc.h memory.h monetary.h mpool.h ndbm.h netconfig.h \
16 netdb.h nl_types.h nlist.h nsswitch.h objformat.h paths.h pthread.h \
17 pthread_np.h pwd.h ranlib.h readpassphrase.h regex.h regexp.h \
18 resolv.h rune.h runetype.h search.h setjmp.h sgtty.h signal.h stab.h \
19 stdbool.h stddef.h stdio.h stdlib.h strhash.h string.h stringlist.h \
20 strings.h sysexits.h tar.h time.h timeconv.h timers.h ttyent.h \
21 ulimit.h unistd.h utime.h utmp.h uuid.h vis.h wchar.h wctype.h \
24 MHDRS= float.h floatingpoint.h stdarg.h varargs.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 net netatalk netatm netgraph netinet netinet6 netipsec \
33 netipx netkey netnatm netncp netns netsmb nfs nfsclient nfsserver \
36 LSUBDIRS= cam/scsi dev/an dev/ic dev/iicbus dev/firewire dev/ofw \
37 dev/ppbus dev/smbus dev/usb dev/wi fs/devfs \
38 fs/fdescfs fs/fifofs fs/msdosfs fs/ntfs fs/nullfs fs/nwfs fs/portalfs \
39 fs/procfs fs/smbfs fs/umapfs fs/unionfs isofs/cd9660 \
40 netatm/ipatm netatm/sigpvc netatm/spans netatm/uni \
41 netgraph/bluetooth/include \
42 security/mac_biba security/mac_bsdextended security/mac_lomac\
43 security/mac_mls security/mac_partition ufs/ffs ufs/ufs
45 # For SHARED=symlinks, cam, netatm, and netgraph are symlinks, so cam/scsi,
46 # netatm/*, and netgraph/* are taken care of
47 LSYMSUBDIRS= ${LSUBDIRS:Ncam/scsi:Nnetatm/*:Nnetgraph/*}
49 # Define SHARED to indicate whether you want symbolic links to the system
50 # source (``symlinks''), or a separate copy (``copies''). ``symlinks'' is
51 # probably only useful for developers and should be avoided if you do not
52 # wish to tie your /usr/include and /usr/src together.
58 osreldate.h: ${.CURDIR}/../sys/conf/newvers.sh \
59 ${.CURDIR}/../sys/sys/param.h \
61 @${ECHO} creating osreldate.h from newvers.sh
62 setvar PARAMFILE ${.CURDIR}/../sys/sys/param.h; \
63 . ${.CURDIR}/../sys/conf/newvers.sh; \
64 echo "$$COPYRIGHT" > osreldate.h; \
65 echo "#ifdef _KERNEL" >> osreldate.h; \
66 echo '#error "/usr/include/osreldate.h cannot be used in the kernel, use sys/param.h"' >> osreldate.h; \
67 echo "#else" >> osreldate.h; \
68 echo \#'undef __FreeBSD_version' >> osreldate.h; \
69 echo \#'define __FreeBSD_version' $$RELDATE >> osreldate.h; \
70 echo "#endif" >> osreldate.h
73 INCSLINKS+= sys/$i ${INCLUDEDIR}/$i
76 INCSLINKS+= machine/$i ${INCLUDEDIR}/$i
79 INCSLINKS+= posix4/$i ${INCLUDEDIR}/$i
83 .for i in ${LDIRS} ${LSYMSUBDIRS} machine crypto
84 if [ -L ${DESTDIR}/usr/include/$i ]; then \
85 rm -f ${DESTDIR}/usr/include/$i; \
88 mtree -deU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/../etc/mtree/BSD.include.dist \
89 -p ${DESTDIR}/usr/include
90 .for i in ${LDIRS} ${LSUBDIRS}
91 cd ${.CURDIR}/../sys; \
92 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 $i/*.h \
93 ${DESTDIR}/usr/include/$i
95 cd ${.CURDIR}/../sys; \
96 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 opencrypto/*.h \
97 ${DESTDIR}/usr/include/crypto
98 .if exists(${.CURDIR}/../sys/${MACHINE_ARCH}/include)
99 cd ${.CURDIR}/../sys/${MACHINE_ARCH}/include; \
100 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
101 ${DESTDIR}/usr/include/machine
102 .if exists(${.CURDIR}/../sys/${MACHINE_ARCH}/include/pc)
103 cd ${.CURDIR}/../sys/${MACHINE_ARCH}/include/pc; \
104 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
105 ${DESTDIR}/usr/include/machine/pc
110 @${ECHO} "Setting up symlinks to kernel source tree..."
112 rm -rf ${DESTDIR}/usr/include/$i
113 ln -s ../../sys/$i ${DESTDIR}/usr/include/$i
115 rm -rf ${DESTDIR}/usr/include/crypto
116 ln -s ../../sys/opencrypto ${DESTDIR}/usr/include/crypto
117 .for i in ${LSYMSUBDIRS}
118 rm -rf ${DESTDIR}/usr/include/$i
119 ln -s ../../../sys/$i ${DESTDIR}/usr/include/$i
121 rm -rf ${DESTDIR}/usr/include/machine
122 ln -s ../../sys/${MACHINE_ARCH}/include ${DESTDIR}/usr/include/machine
124 .include <bsd.prog.mk>
126 installincludes: ${SHARED}