1 # From: @(#)Makefile 8.2 (Berkeley) 1/4/94
2 # $Id: Makefile,v 1.74 1998/03/08 02:17:25 jb Exp $
4 # Doing a make install builds /usr/include
6 # The ``rm -rf''s used below are safe because rm doesn't follow symbolic
11 CLEANFILES= osreldate.h version vers.c
13 FILES= a.out.h ar.h assert.h bitstring.h ctype.h db.h dirent.h disktab.h \
14 dlfcn.h elf.h err.h fnmatch.h fstab.h \
15 fts.h glob.h grp.h strhash.h histedit.h \
16 kvm.h limits.h link.h locale.h malloc.h memory.h mpool.h \
17 ndbm.h netdb.h nl_types.h nlist.h \
18 paths.h pthread.h pthread_np.h pwd.h \
19 ranlib.h regex.h regexp.h resolv.h rune.h runetype.h setjmp.h sgtty.h \
20 signal.h stab.h stddef.h stdio.h stdlib.h string.h stringlist.h \
21 strings.h struct.h sysexits.h tar.h time.h timers.h ttyent.h unistd.h \
23 .if defined(WANT_CSRG_LIBM)
27 ARPAFILES= ftp.h inet.h nameser.h telnet.h tftp.h
29 PROTOFILES= dumprestore.h routed.h rwhod.h talkd.h timed.h
31 RPCFILES= auth.h auth_unix.h clnt.h pmap_clnt.h pmap_prot.h pmap_rmt.h \
32 rpc.h rpc_com.h rpc_msg.h svc.h svc_auth.h types.h xdr.h \
33 auth_des.h des.h des_crypt.h
35 MFILES= float.h floatingpoint.h stdarg.h varargs.h
37 # posix4/aio.h conflicts with dysons and isn't installed:
38 PFILES= mqueue.h posix4.h sched.h semaphore.h \
41 LFILES= errno.h fcntl.h poll.h syslog.h termios.h
43 LDIRS= msdosfs net netns netatalk netinet netipx netkey nfs \
44 pccard posix4 sys vm \
47 LNOHEADERDIRS= isofs ufs
48 LSUBDIRS= isofs/cd9660 ufs/ffs ufs/mfs ufs/ufs
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.
58 .if exists (${.CURDIR}/../sys/conf/newvers.sh)
61 osreldate.h: ${.CURDIR}/../sys/conf/newvers.sh
62 @${ECHO} creating osreldate.h from newvers.sh
63 . ${.CURDIR}/../sys/conf/newvers.sh; \
64 echo "$$COPYRIGHT" > osreldate.h; \
65 echo \#'undef __FreeBSD_version' >> osreldate.h; \
66 echo \#'define __FreeBSD_version' $$RELDATE >> osreldate.h
69 @${ECHO} creating osreldate.h from sysctl info
70 echo \#'undef __FreeBSD_version' > osreldate.h
71 echo \#'define __FreeBSD_version '`sysctl -n kern.osreldate` \
75 beforeinstall: ${SHARED}
77 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 \
78 ${FILES} ${DESTDIR}/usr/include
80 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 \
81 ${ARPAFILES} ${DESTDIR}/usr/include/arpa
82 cd ${.CURDIR}/protocols; \
83 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 \
84 ${PROTOFILES} ${DESTDIR}/usr/include/protocols
86 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 \
87 ${RPCFILES} ${DESTDIR}/usr/include/rpc
88 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 \
89 ${.OBJDIR}/osreldate.h \
90 ${DESTDIR}/usr/include
92 ln -sf sys/$i ${DESTDIR}/usr/include/$i
95 ln -sf machine/$i ${DESTDIR}/usr/include/$i
98 ln -sf posix4/$i ${DESTDIR}/usr/include/$i
103 .for i in ${LDIRS} ${LNOHEADERDIRS} machine
104 if [ -h ${DESTDIR}/usr/include/$i ]; then \
105 rm -f ${DESTDIR}/usr/include/$i; \
108 mtree -deU -f ${.CURDIR}/../etc/mtree/BSD.include.dist \
109 -p ${DESTDIR}/usr/include
110 .for i in ${LDIRS} ${LSUBDIRS}
111 cd ${.CURDIR}/../sys; \
112 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 $i/*.h \
113 ${DESTDIR}/usr/include/$i
115 .if exists(${.CURDIR}/../sys/${MACHINE}/include)
116 cd ${.CURDIR}/../sys/${MACHINE}/include; \
117 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
118 ${DESTDIR}/usr/include/machine
122 @${ECHO} "Setting up symlinks to kernel source tree..."
123 .for i in ${LDIRS} ${LNOHEADERDIRS}
124 rm -rf ${DESTDIR}/usr/include/$i
125 ln -s ../../sys/$i ${DESTDIR}/usr/include/$i
127 rm -rf ${DESTDIR}/usr/include/machine
128 ln -s ../../sys/${MACHINE}/include ${DESTDIR}/usr/include/machine
130 .include <bsd.prog.mk>