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 \
13 dlfcn.h elf.h elf-hints.h err.h fnmatch.h fmtmsg.h fstab.h \
15 hesiod.h histedit.h ieeefp.h ifaddrs.h inttypes.h iso646.h kenv.h \
17 libgen.h limits.h link.h locale.h malloc.h memory.h monetary.h mpool.h \
18 ndbm.h netconfig.h netdb.h nl_types.h nlist.h nsswitch.h objformat.h \
19 paths.h pthread.h pthread_np.h pwd.h \
20 ranlib.h readpassphrase.h regex.h regexp.h resolv.h rune.h runetype.h \
21 search.h setjmp.h sgtty.h \
22 signal.h stab.h stdbool.h stddef.h stdio.h stdlib.h strhash.h \
23 string.h stringlist.h strings.h sysexits.h tar.h time.h timeconv.h \
24 timers.h ttyent.h ulimit.h unistd.h utime.h utmp.h vis.h wchar.h \
27 MHDRS= float.h floatingpoint.h stdarg.h varargs.h
29 # posix4/aio.h conflicts with dysons and isn't installed:
30 PHDRS= mqueue.h sched.h semaphore.h _semaphore.h # aio.h
32 LHDRS= aio.h errno.h fcntl.h linker_set.h poll.h stdint.h syslog.h \
35 LDIRS= cam net netatalk netatm netgraph netinet netinet6 \
36 netipx netkey netnatm netncp netns netsmb nfs nfsclient nfsserver \
39 LSUBDIRS= cam/scsi dev/ic dev/ppbus dev/usb dev/wi dev/an fs/devfs \
40 fs/fdescfs fs/fifofs fs/msdosfs fs/ntfs fs/nullfs fs/nwfs fs/portalfs \
41 fs/procfs fs/smbfs fs/umapfs fs/unionfs isofs/cd9660 \
42 netatm/ipatm netatm/sigpvc netatm/spans netatm/uni \
43 security/lomac security/mac_biba security/mac_bsdextended \
44 security/mac_mls ufs/ffs ufs/ufs
46 # For SHARED=symlinks, cam and netatm are symlinks, so cam/scsi and netatm/*
48 LSYMSUBDIRS= ${LSUBDIRS:Ncam/scsi:Nnetatm/*}
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 "/usr/include/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
84 .for i in ${LDIRS} ${LSYMSUBDIRS} machine
85 if [ -h ${DESTDIR}/usr/include/$i ]; then \
86 rm -f ${DESTDIR}/usr/include/$i; \
89 mtree -deU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/../etc/mtree/BSD.include.dist \
90 -p ${DESTDIR}/usr/include
91 .for i in ${LDIRS} ${LSUBDIRS}
92 cd ${.CURDIR}/../sys; \
93 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 $i/*.h \
94 ${DESTDIR}/usr/include/$i
96 .if exists(${.CURDIR}/../sys/${MACHINE_ARCH}/include)
97 cd ${.CURDIR}/../sys/${MACHINE_ARCH}/include; \
98 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
99 ${DESTDIR}/usr/include/machine
100 .if exists(${.CURDIR}/../sys/${MACHINE_ARCH}/include/pc)
101 cd ${.CURDIR}/../sys/${MACHINE_ARCH}/include/pc; \
102 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
103 ${DESTDIR}/usr/include/machine/pc
108 @${ECHO} "Setting up symlinks to kernel source tree..."
110 rm -rf ${DESTDIR}/usr/include/$i
111 ln -s ../../sys/$i ${DESTDIR}/usr/include/$i
113 .for i in ${LSYMSUBDIRS}
114 rm -rf ${DESTDIR}/usr/include/$i
115 ln -s ../../../sys/$i ${DESTDIR}/usr/include/$i
117 rm -rf ${DESTDIR}/usr/include/machine
118 ln -s ../../sys/${MACHINE_ARCH}/include ${DESTDIR}/usr/include/machine
120 .include <bsd.prog.mk>
122 installincludes: ${SHARED}