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
11 HDRS= 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 langinfo.h \
16 libgen.h limits.h link.h locale.h malloc.h memory.h monetary.h mpool.h \
17 ndbm.h netconfig.h netdb.h nl_types.h nlist.h nsswitch.h objformat.h \
18 paths.h pthread.h pthread_np.h pwd.h \
19 ranlib.h readpassphrase.h regex.h regexp.h resolv.h rune.h runetype.h \
20 search.h setjmp.h sgtty.h \
21 signal.h stab.h stdbool.h stddef.h stdio.h stdlib.h strhash.h \
22 string.h stringlist.h strings.h sysexits.h tar.h time.h timers.h \
23 ttyent.h unistd.h utime.h utmp.h vis.h wchar.h wctype.h
25 ARPAHDRS= ftp.h inet.h nameser.h nameser_compat.h telnet.h tftp.h
27 PROTOHDRS= dumprestore.h routed.h rwhod.h talkd.h timed.h
29 MHDRS= float.h floatingpoint.h stdarg.h varargs.h
31 # posix4/aio.h conflicts with dysons and isn't installed:
32 PHDRS= mqueue.h sched.h semaphore.h # aio.h
34 LHDRS= aio.h errno.h fcntl.h linker_set.h poll.h stdint.h syslog.h \
37 LDIRS= cam net netatalk netatm netgraph netinet netinet6 \
38 netipx netkey netnatm netncp netns netsmb nfs nfsclient nfsserver \
41 LSUBDIRS= cam/scsi dev/ic dev/ppbus dev/usb dev/wi dev/an fs/devfs \
42 fs/fdescfs fs/fifofs fs/msdosfs fs/ntfs fs/nullfs fs/nwfs fs/portalfs \
43 fs/procfs fs/smbfs fs/umapfs fs/unionfs isofs/cd9660 \
44 netatm/ipatm netatm/sigpvc netatm/spans netatm/uni \
48 # For SHARED=symlinks, cam and netatm are symlinks, so cam/scsi and netatm/*
50 LSYMSUBDIRS= ${LSUBDIRS:Ncam/scsi:Nnetatm/*}
52 # Define SHARED to indicate whether you want symbolic links to the system
53 # source (``symlinks''), or a separate copy (``copies''). ``symlinks'' is
54 # probably only useful for developers and should be avoided if you do not
55 # wish to tie your /usr/include and /usr/src together.
61 osreldate.h: ${.CURDIR}/../sys/conf/newvers.sh \
62 ${.CURDIR}/../sys/sys/param.h \
64 @${ECHO} creating osreldate.h from newvers.sh
65 setvar PARAMFILE ${.CURDIR}/../sys/sys/param.h; \
66 . ${.CURDIR}/../sys/conf/newvers.sh; \
67 echo "$$COPYRIGHT" > osreldate.h; \
68 echo "#ifdef _KERNEL" >> osreldate.h; \
69 echo '#error "/usr/include/osreldate.h cannot be used in the kernel, use sys/param.h"' >> osreldate.h; \
70 echo "#else" >> osreldate.h; \
71 echo \#'undef __FreeBSD_version' >> osreldate.h; \
72 echo \#'define __FreeBSD_version' $$RELDATE >> osreldate.h; \
73 echo "#endif" >> osreldate.h
75 beforeinstall: ${SHARED}
76 @rm -f ${DESTDIR}/usr/include/timepps.h
78 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 \
79 ${HDRS} ${DESTDIR}/usr/include
81 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 \
82 ${ARPAHDRS} ${DESTDIR}/usr/include/arpa
83 cd ${.CURDIR}/protocols; \
84 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 \
85 ${PROTOHDRS} ${DESTDIR}/usr/include/protocols
86 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 \
87 ${.OBJDIR}/osreldate.h \
88 ${DESTDIR}/usr/include
90 ln -sf sys/$i ${DESTDIR}/usr/include/$i
93 ln -sf machine/$i ${DESTDIR}/usr/include/$i
96 ln -sf posix4/$i ${DESTDIR}/usr/include/$i
100 .for i in ${LDIRS} ${LSYMSUBDIRS} machine
101 if [ -h ${DESTDIR}/usr/include/$i ]; then \
102 rm -f ${DESTDIR}/usr/include/$i; \
105 mtree -deU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/../etc/mtree/BSD.include.dist \
106 -p ${DESTDIR}/usr/include
107 .for i in ${LDIRS} ${LSUBDIRS}
108 cd ${.CURDIR}/../sys; \
109 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 $i/*.h \
110 ${DESTDIR}/usr/include/$i
112 .if exists(${.CURDIR}/../sys/${MACHINE_ARCH}/include)
113 cd ${.CURDIR}/../sys/${MACHINE_ARCH}/include; \
114 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
115 ${DESTDIR}/usr/include/machine
116 .if exists(${.CURDIR}/../sys/${MACHINE_ARCH}/include/pc)
117 cd ${.CURDIR}/../sys/${MACHINE_ARCH}/include/pc; \
118 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
119 ${DESTDIR}/usr/include/machine/pc
124 @${ECHO} "Setting up symlinks to kernel source tree..."
126 rm -rf ${DESTDIR}/usr/include/$i
127 ln -s ../../sys/$i ${DESTDIR}/usr/include/$i
129 .for i in ${LSYMSUBDIRS}
130 rm -rf ${DESTDIR}/usr/include/$i
131 ln -s ../../../sys/$i ${DESTDIR}/usr/include/$i
133 rm -rf ${DESTDIR}/usr/include/machine
134 ln -s ../../sys/${MACHINE_ARCH}/include ${DESTDIR}/usr/include/machine
136 .include <bsd.prog.mk>