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 strhash.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 vis.h wchar.h wctype.h \ 20 wordexp.h 21 22MHDRS= float.h floatingpoint.h stdarg.h varargs.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 netatalk netatm netgraph netinet netinet6 netipsec \ 31 netipx netkey netnatm netncp netsmb nfs nfsclient nfsserver \ 32 pccard posix4 sys vm 33 34LSUBDIRS= cam/scsi dev/an dev/ic dev/iicbus dev/firewire dev/ofw \ 35 dev/ppbus dev/smbus dev/usb dev/wi fs/devfs \ 36 fs/fdescfs fs/fifofs fs/msdosfs fs/ntfs fs/nullfs fs/nwfs fs/portalfs \ 37 fs/procfs fs/smbfs fs/umapfs fs/unionfs isofs/cd9660 \ 38 netatm/ipatm netatm/sigpvc netatm/spans netatm/uni \ 39 security/mac_biba security/mac_bsdextended security/mac_lomac\ 40 security/mac_mls security/mac_partition ufs/ffs ufs/ufs 41 42LSUBSUBDIRS= netgraph/bluetooth/include 43 44# Define SHARED to indicate whether you want symbolic links to the system 45# source (``symlinks''), or a separate copy (``copies''). ``symlinks'' is 46# probably only useful for developers and should be avoided if you do not 47# wish to tie your /usr/include and /usr/src together. 48#SHARED= symlinks 49SHARED?= copies 50 51INCS+= osreldate.h 52 53osreldate.h: ${.CURDIR}/../sys/conf/newvers.sh \ 54 ${.CURDIR}/../sys/sys/param.h \ 55 ${.CURDIR}/Makefile 56 @${ECHO} creating osreldate.h from newvers.sh 57 setvar PARAMFILE ${.CURDIR}/../sys/sys/param.h; \ 58 . ${.CURDIR}/../sys/conf/newvers.sh; \ 59 echo "$$COPYRIGHT" > osreldate.h; \ 60 echo "#ifdef _KERNEL" >> osreldate.h; \ 61 echo '#error "<osreldate.h> cannot be used in the kernel, use <sys/param.h>"' >> osreldate.h; \ 62 echo "#else" >> osreldate.h; \ 63 echo \#'undef __FreeBSD_version' >> osreldate.h; \ 64 echo \#'define __FreeBSD_version' $$RELDATE >> osreldate.h; \ 65 echo "#endif" >> osreldate.h 66 67.for i in ${LHDRS} 68INCSLINKS+= sys/$i ${INCLUDEDIR}/$i 69.endfor 70.for i in ${MHDRS} 71INCSLINKS+= machine/$i ${INCLUDEDIR}/$i 72.endfor 73.for i in ${PHDRS} 74INCSLINKS+= posix4/$i ${INCLUDEDIR}/$i 75.endfor 76 77.include <bsd.prog.mk> 78 79installincludes: ${SHARED} 80${SHARED}: compat 81 82# Take care of stale directory-level symlinks. 83compat: 84.for i in ${LDIRS} ${LSUBDIRS} machine crypto 85 if [ -L ${DESTDIR}${INCLUDEDIR}/$i ]; then \ 86 rm -f ${DESTDIR}${INCLUDEDIR}/$i; \ 87 fi 88.endfor 89 mtree -deU ${MTREE_FOLLOWS_SYMLINKS} \ 90 -f ${.CURDIR}/../etc/mtree/BSD.include.dist \ 91 -p ${DESTDIR}${INCLUDEDIR} 92 93copies: 94.for i in ${LDIRS} ${LSUBDIRS} crypto machine machine/pc 95.if exists(${DESTDIR}${INCLUDEDIR}/$i) 96 cd ${DESTDIR}${INCLUDEDIR}/$i; \ 97 for h in *.h; do \ 98 if [ -L $$h ]; then rm -f $$h; fi; \ 99 done 100.endif 101.endfor 102.for i in ${LDIRS} ${LSUBDIRS} ${LSUBSUBDIRS} 103 cd ${.CURDIR}/../sys; \ 104 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 $i/*.h \ 105 ${DESTDIR}${INCLUDEDIR}/$i 106.endfor 107 cd ${.CURDIR}/../sys; \ 108 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 opencrypto/*.h \ 109 ${DESTDIR}${INCLUDEDIR}/crypto 110 cd ${.CURDIR}/../sys/${MACHINE_ARCH}/include; \ 111 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \ 112 ${DESTDIR}${INCLUDEDIR}/machine 113.if exists(${.CURDIR}/../sys/${MACHINE_ARCH}/include/pc) 114 cd ${.CURDIR}/../sys/${MACHINE_ARCH}/include/pc; \ 115 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \ 116 ${DESTDIR}${INCLUDEDIR}/machine/pc 117.endif 118 119symlinks: 120 @${ECHO} "Setting up symlinks to kernel source tree..." 121.for i in ${LDIRS} 122 cd ${.CURDIR}/../sys/$i; \ 123 for h in *.h; do \ 124 ln -fs ../../../sys/$i/$$h ${DESTDIR}${INCLUDEDIR}/$i; \ 125 done 126.endfor 127.for i in ${LSUBDIRS} 128 cd ${.CURDIR}/../sys/$i; \ 129 for h in *.h; do \ 130 ln -fs ../../../../sys/$i/$$h ${DESTDIR}${INCLUDEDIR}/$i; \ 131 done 132.endfor 133.for i in ${LSUBSUBDIRS} 134 cd ${.CURDIR}/../sys/$i; \ 135 for h in *.h; do \ 136 ln -fs ../../../../../sys/$i/$$h ${DESTDIR}${INCLUDEDIR}/$i; \ 137 done 138.endfor 139 cd ${.CURDIR}/../sys/opencrypto; \ 140 for h in *.h; do \ 141 ln -fs ../../../sys/opencrypto/$$h \ 142 ${DESTDIR}${INCLUDEDIR}/crypto; \ 143 done 144 cd ${.CURDIR}/../sys/${MACHINE_ARCH}/include; \ 145 for h in *.h; do \ 146 ln -fs ../../../sys/${MACHINE_ARCH}/include/$$h \ 147 ${DESTDIR}${INCLUDEDIR}/machine; \ 148 done 149.if exists(${.CURDIR}/../sys/${MACHINE_ARCH}/include/pc) 150 cd ${.CURDIR}/../sys/${MACHINE_ARCH}/include/pc; \ 151 for h in *.h; do \ 152 ln -fs ../../../../sys/${MACHINE_ARCH}/include/pc/$$h \ 153 ${DESTDIR}${INCLUDEDIR}/machine/pc; \ 154 done 155.endif 156