1# @(#)Makefile 8.2 (Berkeley) 1/4/94 2# $FreeBSD$ 3# 4# Doing a make install builds /usr/include 5# 6# The ``rm -rf''s used below are safe because rm doesn't follow symbolic 7# links. 8 9CLEANFILES= osreldate.h version vers.c 10SUBDIR= rpcsvc rpc 11FILES= a.out.h ar.h assert.h bitstring.h ctype.h db.h dirent.h disktab.h \ 12 dlfcn.h elf.h elf-hints.h err.h fnmatch.h fstab.h \ 13 fts.h glob.h grp.h strhash.h \ 14 hesiod.h histedit.h ieeefp.h ifaddrs.h iso646.h langinfo.h \ 15 libgen.h limits.h link.h locale.h malloc.h memory.h mpool.h \ 16 netconfig.h ndbm.h netdb.h nl_types.h nlist.h nsswitch.h objformat.h \ 17 paths.h pthread.h pthread_np.h pwd.h \ 18 ranlib.h regex.h regexp.h resolv.h rune.h runetype.h \ 19 search.h setjmp.h sgtty.h \ 20 signal.h stab.h stdbool.h stddef.h stdio.h stdlib.h string.h \ 21 stringlist.h strings.h sysexits.h tar.h time.h timers.h \ 22 ttyent.h unistd.h utime.h utmp.h vis.h 23.if defined(WANT_CSRG_LIBM) 24FILES+= math.h 25.endif 26 27ARPAFILES= ftp.h inet.h nameser.h nameser_compat.h telnet.h tftp.h 28 29PROTOFILES= dumprestore.h routed.h rwhod.h talkd.h timed.h 30 31MFILES= float.h floatingpoint.h stdarg.h varargs.h 32 33# posix4/aio.h conflicts with dysons and isn't installed: 34PFILES= mqueue.h sched.h semaphore.h # aio.h 35 36# Only for default SHARED=copies case 37SFILES= soundcard.h joystick.h 38 39LFILES= aio.h errno.h fcntl.h inttypes.h linker_set.h poll.h syslog.h \ 40 termios.h ucontext.h 41 42LDIRS= cam msdosfs net netatalk netatm netgraph netinet netinet6 \ 43 netipx netkey netnatm netncp netns netsmb nfs ntfs nwfs pccard posix4 \ 44 sys vm 45 46LNOHEADERDIRS= fs isofs ufs dev 47LSUBDIRS= fs/smbfs isofs/cd9660 ufs/ffs ufs/mfs ufs/ufs \ 48 cam/scsi dev/ppbus dev/usb dev/wi 49 50# For SHARED=symlinks, cam is a symlink, so cam/scsi is taken care of 51LSYMSUBDIRS= fs/smbfs isofs/cd9660 ufs/ffs ufs/mfs ufs/ufs dev/ppbus dev/usb dev/wi 52 53# Define SHARED to indicate whether you want symbolic links to the system 54# source (``symlinks''), or a separate copy (``copies''). ``symlinks'' is 55# probably only useful for developers and should be avoided if you do not 56# wish to tie your /usr/include and /usr/src together. 57#SHARED= symlinks 58SHARED?= copies 59 60all: osreldate.h 61 62osreldate.h: ${.CURDIR}/../sys/conf/newvers.sh \ 63 ${.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 "osreldate.h must not 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 74 75beforeinstall: ${SHARED} 76 @rm -f ${DESTDIR}/usr/include/timepps.h 77 cd ${.CURDIR}; \ 78 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 \ 79 ${FILES} ${DESTDIR}/usr/include 80 cd ${.CURDIR}/arpa; \ 81 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 \ 82 ${ARPAFILES} ${DESTDIR}/usr/include/arpa 83 cd ${.CURDIR}/protocols; \ 84 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 \ 85 ${PROTOFILES} ${DESTDIR}/usr/include/protocols 86 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 \ 87 ${.OBJDIR}/osreldate.h \ 88 ${DESTDIR}/usr/include 89.for i in ${LFILES} 90 ln -sf sys/$i ${DESTDIR}/usr/include/$i 91.endfor 92.for i in ${MFILES} 93 ln -sf machine/$i ${DESTDIR}/usr/include/$i 94.endfor 95.for i in ${PFILES} 96 ln -sf posix4/$i ${DESTDIR}/usr/include/$i 97.endfor 98 99copies: 100.for i in ${LDIRS} ${LSYMSUBDIRS} machine 101 if [ -h ${DESTDIR}/usr/include/$i ]; then \ 102 rm -f ${DESTDIR}/usr/include/$i; \ 103 fi 104.endfor 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 111.endfor 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.endif 117.for i in ${SFILES} 118 ln -sf ../sys/$i ${DESTDIR}/usr/include/machine/$i 119.endfor 120 121symlinks: 122 @${ECHO} "Setting up symlinks to kernel source tree..." 123.for i in ${LDIRS} 124 rm -rf ${DESTDIR}/usr/include/$i 125 ln -s ../../sys/$i ${DESTDIR}/usr/include/$i 126.endfor 127.for i in ${LNOHEADERDIRS} 128 rm -rf ${DESTDIR}/usr/include/$i 129 mkdir ${DESTDIR}/usr/include/$i 130.endfor 131.for i in ${LSYMSUBDIRS} 132 ln -s ../../../sys/$i ${DESTDIR}/usr/include/$i 133.endfor 134 rm -rf ${DESTDIR}/usr/include/machine 135 ln -s ../../sys/${MACHINE_ARCH}/include ${DESTDIR}/usr/include/machine 136 137.include <bsd.prog.mk> 138