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 FILES= a.out.h ar.h assert.h bitstring.h ctype.h db.h dirent.h disktab.h \
12 dlfcn.h elf.h err.h fnmatch.h fstab.h \
13 fts.h glob.h grp.h strhash.h histedit.h ieeefp.h iso646.h \
14 limits.h link.h locale.h malloc.h memory.h mpool.h \
15 ndbm.h netdb.h nl_types.h nlist.h objformat.h \
16 paths.h pthread.h pthread_np.h pwd.h \
17 ranlib.h regex.h regexp.h resolv.h rune.h runetype.h setjmp.h sgtty.h \
18 signal.h stab.h stddef.h stdio.h stdlib.h string.h stringlist.h \
19 strings.h struct.h sysexits.h tar.h time.h timers.h \
20 ttyent.h unistd.h utime.h utmp.h vis.h
21 .if defined(WANT_CSRG_LIBM)
25 ARPAFILES= ftp.h inet.h nameser.h nameser_compat.h telnet.h tftp.h
27 PROTOFILES= dumprestore.h routed.h rwhod.h talkd.h timed.h
29 RPCFILES= auth.h auth_unix.h clnt.h pmap_clnt.h pmap_prot.h pmap_rmt.h \
30 rpc.h rpc_com.h rpc_msg.h svc.h svc_auth.h types.h xdr.h \
31 auth_des.h des.h des_crypt.h
33 MFILES= float.h floatingpoint.h stdarg.h varargs.h
35 # posix4/aio.h conflicts with dysons and isn't installed:
36 PFILES= mqueue.h sched.h semaphore.h # aio.h
38 # Only for default SHARED=copies case
41 LFILES= aio.h errno.h fcntl.h inttypes.h linker_set.h poll.h syslog.h \
44 LDIRS= cam msdosfs net netatalk netatm netgraph netinet netinet6 \
45 netipx netkey netncp netns nfs nwfs pccard posix4 sys vm
47 LNOHEADERDIRS= isofs ufs
48 LSUBDIRS= isofs/cd9660 ufs/ffs ufs/mfs ufs/ufs cam/scsi
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
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 \#'undef __FreeBSD_version' >> osreldate.h; \
66 echo \#'define __FreeBSD_version' $$RELDATE >> osreldate.h
68 beforeinstall: ${SHARED}
69 @rm -f ${DESTDIR}/usr/include/timepps.h
71 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 \
72 ${FILES} ${DESTDIR}/usr/include
74 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 \
75 ${ARPAFILES} ${DESTDIR}/usr/include/arpa
76 cd ${.CURDIR}/protocols; \
77 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 \
78 ${PROTOFILES} ${DESTDIR}/usr/include/protocols
80 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 \
81 ${RPCFILES} ${DESTDIR}/usr/include/rpc
82 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 \
83 ${.OBJDIR}/osreldate.h \
84 ${DESTDIR}/usr/include
86 ln -sf sys/$i ${DESTDIR}/usr/include/$i
89 ln -sf machine/$i ${DESTDIR}/usr/include/$i
92 ln -sf posix4/$i ${DESTDIR}/usr/include/$i
96 .for i in ${LDIRS} ${LNOHEADERDIRS} machine
97 if [ -h ${DESTDIR}/usr/include/$i ]; then \
98 rm -f ${DESTDIR}/usr/include/$i; \
101 mtree -deU -f ${.CURDIR}/../etc/mtree/BSD.include.dist \
102 -p ${DESTDIR}/usr/include
103 .for i in ${LDIRS} ${LSUBDIRS}
104 cd ${.CURDIR}/../sys; \
105 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 $i/*.h \
106 ${DESTDIR}/usr/include/$i
108 .if exists(${.CURDIR}/../sys/${MACHINE_ARCH}/include)
109 cd ${.CURDIR}/../sys/${MACHINE_ARCH}/include; \
110 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
111 ${DESTDIR}/usr/include/machine
114 ln -sf ../sys/$i ${DESTDIR}/usr/include/machine/$i
118 @${ECHO} "Setting up symlinks to kernel source tree..."
119 .for i in ${LDIRS} ${LNOHEADERDIRS}
120 rm -rf ${DESTDIR}/usr/include/$i
121 ln -s ../../sys/$i ${DESTDIR}/usr/include/$i
123 rm -rf ${DESTDIR}/usr/include/machine
124 ln -s ../../sys/${MACHINE_ARCH}/include ${DESTDIR}/usr/include/machine
126 .include <bsd.prog.mk>