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 ctype.h db.h \
13 dlfcn.h elf.h elf-hints.h err.h fnmatch.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 unistd.h utime.h utmp.h vis.h wchar.h wctype.h
26 MHDRS= float.h floatingpoint.h stdarg.h varargs.h
28 # posix4/aio.h conflicts with dysons and isn't installed:
29 PHDRS= mqueue.h sched.h semaphore.h # aio.h
31 LHDRS= aio.h errno.h fcntl.h linker_set.h poll.h stdint.h syslog.h \
34 LDIRS= cam net netatalk netatm netgraph netinet netinet6 \
35 netipx netkey netnatm netncp netns netsmb nfs nfsclient nfsserver \
38 LSUBDIRS= cam/scsi dev/ic dev/ppbus dev/usb dev/wi dev/an fs/devfs \
39 fs/fdescfs fs/fifofs fs/msdosfs fs/ntfs fs/nullfs fs/nwfs fs/portalfs \
40 fs/procfs fs/smbfs fs/umapfs fs/unionfs isofs/cd9660 \
41 netatm/ipatm netatm/sigpvc netatm/spans netatm/uni \
45 # For SHARED=symlinks, cam and netatm are symlinks, so cam/scsi and netatm/*
47 LSYMSUBDIRS= ${LSUBDIRS:Ncam/scsi:Nnetatm/*}
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
84 if [ -h ${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 .if exists(${.CURDIR}/../sys/${MACHINE_ARCH}/include)
96 cd ${.CURDIR}/../sys/${MACHINE_ARCH}/include; \
97 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
98 ${DESTDIR}/usr/include/machine
99 .if exists(${.CURDIR}/../sys/${MACHINE_ARCH}/include/pc)
100 cd ${.CURDIR}/../sys/${MACHINE_ARCH}/include/pc; \
101 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
102 ${DESTDIR}/usr/include/machine/pc
107 @${ECHO} "Setting up symlinks to kernel source tree..."
109 rm -rf ${DESTDIR}/usr/include/$i
110 ln -s ../../sys/$i ${DESTDIR}/usr/include/$i
112 .for i in ${LSYMSUBDIRS}
113 rm -rf ${DESTDIR}/usr/include/$i
114 ln -s ../../../sys/$i ${DESTDIR}/usr/include/$i
116 rm -rf ${DESTDIR}/usr/include/machine
117 ln -s ../../sys/${MACHINE_ARCH}/include ${DESTDIR}/usr/include/machine
119 .include <bsd.prog.mk>
121 installincludes: ${SHARED}