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 11FILES= 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 ifaddrs.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 \ 18 search.h setjmp.h sgtty.h \ 19 signal.h stab.h stddef.h stdio.h stdlib.h string.h stringlist.h \ 20 strings.h struct.h sysexits.h tar.h time.h timers.h \ 21 ttyent.h unistd.h utime.h utmp.h vis.h 22.if defined(WANT_CSRG_LIBM) 23FILES+= math.h 24.endif 25 26ARPAFILES= ftp.h inet.h nameser.h nameser_compat.h telnet.h tftp.h 27 28PROTOFILES= dumprestore.h routed.h rwhod.h talkd.h timed.h 29 30RPCFILES= auth.h auth_unix.h clnt.h pmap_clnt.h pmap_prot.h pmap_rmt.h \ 31 rpc.h rpc_com.h rpc_msg.h svc.h svc_auth.h types.h xdr.h \ 32 auth_des.h des.h des_crypt.h 33 34MFILES= float.h floatingpoint.h stdarg.h varargs.h 35 36# posix4/aio.h conflicts with dysons and isn't installed: 37PFILES= mqueue.h sched.h semaphore.h # aio.h 38 39# Only for default SHARED=copies case 40SFILES= soundcard.h joystick.h 41 42LFILES= aio.h errno.h fcntl.h inttypes.h linker_set.h \ 43 poll.h syslog.h termios.h ucontext.h 44 45LDIRS= cam msdosfs net netatalk netatm netgraph netinet netinet6 \ 46 netipx netkey netncp netns nfs ntfs nwfs pccard posix4 sys vm 47 48LNOHEADERDIRS= isofs ufs dev 49LSUBDIRS= isofs/cd9660 ufs/ffs ufs/mfs ufs/ufs cam/scsi dev/ppbus dev/usb 50 51# For SHARED=symlinks, cam is a symlink, so cam/scsi is taken care of 52LSYMSUBDIRS= isofs/cd9660 ufs/ffs ufs/mfs ufs/ufs dev/ppbus dev/usb 53 54# Define SHARED to indicate whether you want symbolic links to the system 55# source (``symlinks''), or a separate copy (``copies''). ``symlinks'' is 56# probably only useful for developers and should be avoided if you do not 57# wish to tie your /usr/include and /usr/src together. 58#SHARED= symlinks 59SHARED?= copies 60 61all: osreldate.h 62 63osreldate.h: ${.CURDIR}/../sys/conf/newvers.sh \ 64 ${.CURDIR}/../sys/sys/param.h 65 @${ECHO} creating osreldate.h from newvers.sh 66 setvar PARAMFILE ${.CURDIR}/../sys/sys/param.h; \ 67 . ${.CURDIR}/../sys/conf/newvers.sh; \ 68 echo "$$COPYRIGHT" > osreldate.h; \ 69 echo \#'undef __FreeBSD_version' >> osreldate.h; \ 70 echo \#'define __FreeBSD_version' $$RELDATE >> osreldate.h 71 72beforeinstall: ${SHARED} 73 @rm -f ${DESTDIR}/usr/include/timepps.h 74 cd ${.CURDIR}; \ 75 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 \ 76 ${FILES} ${DESTDIR}/usr/include 77 cd ${.CURDIR}/arpa; \ 78 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 \ 79 ${ARPAFILES} ${DESTDIR}/usr/include/arpa 80 cd ${.CURDIR}/protocols; \ 81 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 \ 82 ${PROTOFILES} ${DESTDIR}/usr/include/protocols 83 cd ${.CURDIR}/rpc; \ 84 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 \ 85 ${RPCFILES} ${DESTDIR}/usr/include/rpc 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.for i in ${LNOHEADERDIRS} 106 rm -rf ${DESTDIR}/usr/include/$i 107.endfor 108 mtree -deLU -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 114.endfor 115.if exists(${.CURDIR}/../sys/${MACHINE_ARCH}/include) 116 cd ${.CURDIR}/../sys/${MACHINE_ARCH}/include; \ 117 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \ 118 ${DESTDIR}/usr/include/machine 119.endif 120.for i in ${SFILES} 121 ln -sf ../sys/$i ${DESTDIR}/usr/include/machine/$i 122.endfor 123 124symlinks: 125 @${ECHO} "Setting up symlinks to kernel source tree..." 126.for i in ${LDIRS} 127 rm -rf ${DESTDIR}/usr/include/$i 128 ln -s ../../sys/$i ${DESTDIR}/usr/include/$i 129.endfor 130.for i in ${LNOHEADERDIRS} 131 rm -rf ${DESTDIR}/usr/include/$i 132 mkdir ${DESTDIR}/usr/include/$i 133.endfor 134.for i in ${LSYMSUBDIRS} 135 ln -s ../../../sys/$i ${DESTDIR}/usr/include/$i 136.endfor 137 rm -rf ${DESTDIR}/usr/include/machine 138 ln -s ../../sys/${MACHINE_ARCH}/include ${DESTDIR}/usr/include/machine 139 140.include <bsd.prog.mk> 141