1# @(#)Makefile 8.2 (Berkeley) 1/4/94 2# $FreeBSD$ 3# 4# Doing a "make install" builds /usr/include. 5 6CLEANFILES= osreldate.h version vers.c 7SUBDIR= arpa protocols rpcsvc rpc 8INCS= a.out.h ar.h assert.h bitstring.h complex.h cpio.h ctype.h db.h \ 9 dirent.h dlfcn.h elf.h elf-hints.h err.h fmtmsg.h fnmatch.h fstab.h \ 10 fts.h getopt.h glob.h grp.h hesiod.h histedit.h ieeefp.h ifaddrs.h \ 11 inttypes.h iso646.h kenv.h langinfo.h libgen.h limits.h link.h \ 12 locale.h malloc.h memory.h monetary.h mpool.h ndbm.h netconfig.h \ 13 netdb.h nl_types.h nlist.h nss.h nsswitch.h objformat.h paths.h \ 14 pthread.h \ 15 pthread_np.h pwd.h ranlib.h readpassphrase.h regex.h regexp.h \ 16 resolv.h rune.h runetype.h search.h setjmp.h sgtty.h signal.h stab.h \ 17 stdbool.h stddef.h stdio.h stdlib.h string.h stringlist.h \ 18 strings.h sysexits.h tar.h time.h timeconv.h timers.h ttyent.h \ 19 ulimit.h unistd.h utime.h utmp.h uuid.h varargs.h vis.h wchar.h \ 20 wctype.h wordexp.h 21 22MHDRS= float.h floatingpoint.h stdarg.h 23 24# posix4/mqueue.h is useless without an implementation and isn't installed: 25PHDRS= sched.h semaphore.h _semaphore.h # mqueue.h 26 27LHDRS= aio.h errno.h fcntl.h linker_set.h poll.h stdint.h syslog.h \ 28 termios.h ucontext.h 29 30LDIRS= cam geom net net80211 netatalk netatm netgraph netinet netinet6 \ 31 netipsec netipx netkey netnatm netncp netsmb nfs nfsclient nfsserver \ 32 pccard posix4 sys vm 33 34LSUBDIRS= cam/scsi dev/an dev/bktr dev/firewire dev/ic dev/iicbus \ 35 dev/ofw dev/ppbus dev/smbus dev/usb dev/wi dev/utopia fs/devfs \ 36 fs/fdescfs fs/fifofs fs/msdosfs fs/ntfs fs/nullfs fs/nwfs fs/portalfs \ 37 fs/procfs fs/smbfs fs/udf fs/umapfs fs/unionfs isofs/cd9660 \ 38 netatm/ipatm netatm/sigpvc netatm/spans netatm/uni \ 39 netgraph/atm security/mac_biba security/mac_bsdextended \ 40 security/mac_lomac security/mac_mls security/mac_partition \ 41 ufs/ffs ufs/ufs 42 43LSUBSUBDIRS= netgraph/bluetooth/include 44 45# Define SHARED to indicate whether you want symbolic links to the system 46# source (``symlinks''), or a separate copy (``copies''). ``symlinks'' is 47# probably only useful for developers and should be avoided if you do not 48# wish to tie your /usr/include and /usr/src together. 49#SHARED= symlinks 50SHARED?= copies 51 52INCS+= osreldate.h 53 54osreldate.h: ${.CURDIR}/../sys/conf/newvers.sh \ 55 ${.CURDIR}/../sys/sys/param.h \ 56 ${.CURDIR}/Makefile 57 @${ECHO} creating osreldate.h from newvers.sh 58 @setvar PARAMFILE ${.CURDIR}/../sys/sys/param.h; \ 59 . ${.CURDIR}/../sys/conf/newvers.sh; \ 60 echo "$$COPYRIGHT" > osreldate.h; \ 61 echo "#ifdef _KERNEL" >> osreldate.h; \ 62 echo '#error "<osreldate.h> cannot be used in the kernel, use <sys/param.h>"' >> osreldate.h; \ 63 echo "#else" >> osreldate.h; \ 64 echo \#'undef __FreeBSD_version' >> osreldate.h; \ 65 echo \#'define __FreeBSD_version' $$RELDATE >> osreldate.h; \ 66 echo "#endif" >> osreldate.h 67 68.for i in ${LHDRS} 69INCSLINKS+= sys/$i ${INCLUDEDIR}/$i 70.endfor 71.for i in ${MHDRS} 72INCSLINKS+= machine/$i ${INCLUDEDIR}/$i 73.endfor 74.for i in ${PHDRS} 75INCSLINKS+= posix4/$i ${INCLUDEDIR}/$i 76.endfor 77 78.include <bsd.prog.mk> 79 80installincludes: ${SHARED} 81${SHARED}: compat 82 83# Take care of stale directory-level symlinks. 84compat: 85.for i in ${LDIRS} ${LSUBDIRS} machine crypto 86 if [ -L ${DESTDIR}${INCLUDEDIR}/$i ]; then \ 87 rm -f ${DESTDIR}${INCLUDEDIR}/$i; \ 88 fi 89.endfor 90 mtree -deU ${MTREE_FOLLOWS_SYMLINKS} \ 91 -f ${.CURDIR}/../etc/mtree/BSD.include.dist \ 92 -p ${DESTDIR}${INCLUDEDIR} 93 94copies: 95.for i in ${LDIRS} ${LSUBDIRS} crypto machine machine/pc 96.if exists(${DESTDIR}${INCLUDEDIR}/$i) 97 cd ${DESTDIR}${INCLUDEDIR}/$i; \ 98 for h in *.h; do \ 99 if [ -L $$h ]; then rm -f $$h; fi; \ 100 done 101.endif 102.endfor 103.for i in ${LDIRS} ${LSUBDIRS:Ndev/bktr} ${LSUBSUBDIRS} 104 cd ${.CURDIR}/../sys; \ 105 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 $i/*.h \ 106 ${DESTDIR}${INCLUDEDIR}/$i 107.endfor 108 cd ${.CURDIR}/../sys/dev/bktr; \ 109 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 ioctl_*.h \ 110 ${DESTDIR}${INCLUDEDIR}/dev/bktr 111 cd ${.CURDIR}/../sys/contrib/ipfilter/netinet; \ 112 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \ 113 ${DESTDIR}${INCLUDEDIR}/netinet 114 cd ${.CURDIR}/../sys/opencrypto; \ 115 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \ 116 ${DESTDIR}${INCLUDEDIR}/crypto 117 cd ${.CURDIR}/../sys/${MACHINE_ARCH}/include; \ 118 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \ 119 ${DESTDIR}${INCLUDEDIR}/machine 120.if exists(${.CURDIR}/../sys/${MACHINE_ARCH}/include/pc) 121 cd ${.CURDIR}/../sys/${MACHINE_ARCH}/include/pc; \ 122 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \ 123 ${DESTDIR}${INCLUDEDIR}/machine/pc 124.endif 125 126symlinks: 127 @${ECHO} "Setting up symlinks to kernel source tree..." 128.for i in ${LDIRS} 129 cd ${.CURDIR}/../sys/$i; \ 130 for h in *.h; do \ 131 ln -fs ../../../sys/$i/$$h ${DESTDIR}${INCLUDEDIR}/$i; \ 132 done 133.endfor 134.for i in ${LSUBDIRS} 135 cd ${.CURDIR}/../sys/$i; \ 136 for h in *.h; do \ 137 ln -fs ../../../../sys/$i/$$h ${DESTDIR}${INCLUDEDIR}/$i; \ 138 done 139.endfor 140.for i in ${LSUBSUBDIRS} 141 cd ${.CURDIR}/../sys/$i; \ 142 for h in *.h; do \ 143 ln -fs ../../../../../sys/$i/$$h ${DESTDIR}${INCLUDEDIR}/$i; \ 144 done 145.endfor 146 cd ${.CURDIR}/../sys/contrib/ipfilter/netinet; \ 147 for h in *.h; do \ 148 ln -fs ../../../sys/contrib/ipfilter/netinet/$$h \ 149 ${DESTDIR}${INCLUDEDIR}/netinet; \ 150 done 151 cd ${.CURDIR}/../sys/opencrypto; \ 152 for h in *.h; do \ 153 ln -fs ../../../sys/opencrypto/$$h \ 154 ${DESTDIR}${INCLUDEDIR}/crypto; \ 155 done 156 cd ${.CURDIR}/../sys/${MACHINE_ARCH}/include; \ 157 for h in *.h; do \ 158 ln -fs ../../../sys/${MACHINE_ARCH}/include/$$h \ 159 ${DESTDIR}${INCLUDEDIR}/machine; \ 160 done 161.if exists(${.CURDIR}/../sys/${MACHINE_ARCH}/include/pc) 162 cd ${.CURDIR}/../sys/${MACHINE_ARCH}/include/pc; \ 163 for h in *.h; do \ 164 ln -fs ../../../../sys/${MACHINE_ARCH}/include/pc/$$h \ 165 ${DESTDIR}${INCLUDEDIR}/machine/pc; \ 166 done 167.endif 168