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 ctype.h \ 9 db.h \ 10 dirent.h dlfcn.h elf.h elf-hints.h err.h fmtmsg.h fnmatch.h fstab.h \ 11 fts.h ftw.h getopt.h glob.h grp.h \ 12 hesiod.h histedit.h ieeefp.h ifaddrs.h \ 13 inttypes.h iso646.h kenv.h langinfo.h libgen.h limits.h link.h \ 14 locale.h malloc.h memory.h monetary.h mpool.h ndbm.h netconfig.h \ 15 netdb.h nl_types.h nlist.h nss.h nsswitch.h objformat.h paths.h \ 16 proc_service.h pthread.h \ 17 pthread_np.h pwd.h ranlib.h readpassphrase.h regex.h regexp.h \ 18 resolv.h runefile.h runetype.h search.h setjmp.h sgtty.h \ 19 signal.h stab.h \ 20 stdbool.h stddef.h stdio.h stdlib.h string.h stringlist.h \ 21 strings.h sysexits.h tar.h tgmath.h \ 22 time.h timeconv.h timers.h ttyent.h \ 23 ulimit.h unistd.h utime.h utmp.h uuid.h varargs.h vis.h wchar.h \ 24 wctype.h wordexp.h 25 26MHDRS= float.h floatingpoint.h stdarg.h 27 28# posix4/mqueue.h is useless without an implementation and isn't installed: 29PHDRS= sched.h semaphore.h _semaphore.h # mqueue.h 30 31LHDRS= aio.h errno.h fcntl.h linker_set.h poll.h stdint.h syslog.h \ 32 termios.h ucontext.h 33 34LDIRS= cam geom net net80211 netatalk netatm netgraph netinet netinet6 \ 35 netipsec netipx netkey netnatm netncp netsmb nfs nfsclient nfsserver \ 36 pccard posix4 sys vm 37 38LSUBDIRS= cam/scsi \ 39 dev/acpica dev/an dev/bktr dev/firewire \ 40 dev/ic dev/iicbus ${_dev_ieee488} dev/ofw \ 41 dev/pbio dev/ppbus dev/smbus dev/usb dev/wi dev/utopia \ 42 fs/devfs fs/fdescfs fs/fifofs fs/msdosfs fs/ntfs fs/nullfs \ 43 fs/nwfs fs/portalfs fs/procfs fs/smbfs fs/udf fs/umapfs \ 44 fs/unionfs \ 45 geom/concat geom/gate geom/label geom/mirror geom/nop geom/raid3 \ 46 geom/shsec geom/stripe \ 47 isofs/cd9660 \ 48 netatm/ipatm netatm/sigpvc netatm/spans netatm/uni \ 49 netgraph/atm netgraph/netflow \ 50 security/mac_biba security/mac_bsdextended security/mac_lomac \ 51 security/mac_mls security/mac_partition \ 52 ufs/ffs ufs/ufs 53 54.if !defined(NO_GPIB) 55_dev_ieee488= dev/ieee488 56.endif 57 58.if !defined(NO_BLUETOOTH) 59LSUBSUBDIRS= netgraph/bluetooth/include 60.endif 61 62# Define SHARED to indicate whether you want symbolic links to the system 63# source (``symlinks''), or a separate copy (``copies''). ``symlinks'' is 64# probably only useful for developers and should be avoided if you do not 65# wish to tie your /usr/include and /usr/src together. 66#SHARED= symlinks 67SHARED?= copies 68 69INCS+= osreldate.h 70 71osreldate.h: ${.CURDIR}/../sys/conf/newvers.sh \ 72 ${.CURDIR}/../sys/sys/param.h \ 73 ${.CURDIR}/Makefile 74 @${ECHO} creating osreldate.h from newvers.sh 75 @setvar PARAMFILE ${.CURDIR}/../sys/sys/param.h; \ 76 MAKE=${MAKE} . ${.CURDIR}/../sys/conf/newvers.sh; \ 77 echo "$$COPYRIGHT" > osreldate.h; \ 78 echo "#ifdef _KERNEL" >> osreldate.h; \ 79 echo '#error "<osreldate.h> cannot be used in the kernel, use <sys/param.h>"' >> osreldate.h; \ 80 echo "#else" >> osreldate.h; \ 81 echo \#'undef __FreeBSD_version' >> osreldate.h; \ 82 echo \#'define __FreeBSD_version' $$RELDATE >> osreldate.h; \ 83 echo "#endif" >> osreldate.h 84 85.for i in ${LHDRS} 86INCSLINKS+= sys/$i ${INCLUDEDIR}/$i 87.endfor 88.for i in ${MHDRS} 89INCSLINKS+= machine/$i ${INCLUDEDIR}/$i 90.endfor 91.for i in ${PHDRS} 92INCSLINKS+= posix4/$i ${INCLUDEDIR}/$i 93.endfor 94 95.if ${MACHINE} != ${MACHINE_ARCH} 96_MARCH=${MACHINE_ARCH} 97.endif 98 99.include <bsd.prog.mk> 100 101installincludes: ${SHARED} 102${SHARED}: compat 103 104# Take care of stale directory-level symlinks. 105compat: 106.for i in ${LDIRS} ${LSUBDIRS} machine ${_MARCH} crypto 107 if [ -L ${DESTDIR}${INCLUDEDIR}/$i ]; then \ 108 rm -f ${DESTDIR}${INCLUDEDIR}/$i; \ 109 fi 110.endfor 111 mtree -deU ${MTREE_FOLLOWS_SYMLINKS} \ 112 -f ${.CURDIR}/../etc/mtree/BSD.include.dist \ 113 -p ${DESTDIR}${INCLUDEDIR} 114.if defined(WITH_BIND_LIBS) && !defined(NO_BIND) 115 mtree -deU ${MTREE_FOLLOWS_SYMLINKS} \ 116 -f ${.CURDIR}/../etc/mtree/BIND.include.dist \ 117 -p ${DESTDIR}${INCLUDEDIR} 118.endif 119 120copies: 121.for i in ${LDIRS} ${LSUBDIRS} ${LSUBSUBDIRS} altq crypto machine machine/pc \ 122 ${_MARCH} 123.if exists(${DESTDIR}${INCLUDEDIR}/$i) 124 cd ${DESTDIR}${INCLUDEDIR}/$i; \ 125 for h in *.h; do \ 126 if [ -L $$h ]; then rm -f $$h; fi; \ 127 done 128.endif 129.endfor 130.for i in ${LDIRS} ${LSUBDIRS:Ndev/acpica:Ndev/bktr} ${LSUBSUBDIRS} 131 cd ${.CURDIR}/../sys; \ 132 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 $i/*.h \ 133 ${DESTDIR}${INCLUDEDIR}/$i 134.endfor 135 cd ${.CURDIR}/../sys/dev/acpica; \ 136 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 acpiio.h \ 137 ${DESTDIR}${INCLUDEDIR}/dev/acpica 138 cd ${.CURDIR}/../sys/dev/bktr; \ 139 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 ioctl_*.h \ 140 ${DESTDIR}${INCLUDEDIR}/dev/bktr 141 cd ${.CURDIR}/../sys/contrib/altq/altq; \ 142 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \ 143 ${DESTDIR}${INCLUDEDIR}/altq 144 cd ${.CURDIR}/../sys/contrib/ipfilter/netinet; \ 145 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \ 146 ${DESTDIR}${INCLUDEDIR}/netinet 147 cd ${.CURDIR}/../sys/contrib/pf/net; \ 148 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \ 149 ${DESTDIR}${INCLUDEDIR}/net 150 cd ${.CURDIR}/../sys/crypto; \ 151 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 rijndael/rijndael.h \ 152 ${DESTDIR}${INCLUDEDIR}/crypto 153 cd ${.CURDIR}/../sys/opencrypto; \ 154 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \ 155 ${DESTDIR}${INCLUDEDIR}/crypto 156 cd ${.CURDIR}/../sys/${MACHINE}/include; \ 157 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \ 158 ${DESTDIR}${INCLUDEDIR}/machine 159.if exists(${.CURDIR}/../sys/${MACHINE}/include/pc) 160 cd ${.CURDIR}/../sys/${MACHINE}/include/pc; \ 161 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \ 162 ${DESTDIR}${INCLUDEDIR}/machine/pc 163.endif 164.if defined(_MARCH) 165 ${INSTALL} -d -o ${BINOWN} -g ${BINGRP} -m 755 \ 166 ${DESTDIR}${INCLUDEDIR}/${_MARCH}; \ 167 cd ${.CURDIR}/../sys/${_MARCH}/include; \ 168 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \ 169 ${DESTDIR}${INCLUDEDIR}/${_MARCH} 170.if exists(${.CURDIR}/../sys/${_MARCH}/include/pc) 171 ${INSTALL} -d -o ${BINOWN} -g ${BINGRP} -m 755 \ 172 ${DESTDIR}${INCLUDEDIR}/${_MARCH}/pc; \ 173 cd ${.CURDIR}/../sys/${_MARCH}/include/pc; \ 174 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \ 175 ${DESTDIR}${INCLUDEDIR}/${_MARCH}/pc 176.endif 177.endif 178 179symlinks: 180 @${ECHO} "Setting up symlinks to kernel source tree..." 181.for i in ${LDIRS} 182 cd ${.CURDIR}/../sys/$i; \ 183 for h in *.h; do \ 184 ln -fs ../../../sys/$i/$$h ${DESTDIR}${INCLUDEDIR}/$i; \ 185 done 186.endfor 187.for i in ${LSUBDIRS:Ndev/acpica:Ndev/bktr} 188 cd ${.CURDIR}/../sys/$i; \ 189 for h in *.h; do \ 190 ln -fs ../../../../sys/$i/$$h ${DESTDIR}${INCLUDEDIR}/$i; \ 191 done 192.endfor 193 cd ${.CURDIR}/../sys/dev/acpica; \ 194 for h in acpiio.h; do \ 195 ln -fs ../../../../sys/dev/acpica/$$h \ 196 ${DESTDIR}${INCLUDEDIR}/dev/acpica; \ 197 done 198 cd ${.CURDIR}/../sys/dev/bktr; \ 199 for h in ioctl_*.h; do \ 200 ln -fs ../../../../sys/dev/bktr/$$h \ 201 ${DESTDIR}${INCLUDEDIR}/dev/bktr; \ 202 done 203.for i in ${LSUBSUBDIRS} 204 cd ${.CURDIR}/../sys/$i; \ 205 for h in *.h; do \ 206 ln -fs ../../../../../sys/$i/$$h ${DESTDIR}${INCLUDEDIR}/$i; \ 207 done 208.endfor 209 cd ${.CURDIR}/../sys/contrib/altq/altq; \ 210 for h in *.h; do \ 211 ln -fs ../../../sys/contrib/altq/altq/$$h \ 212 ${DESTDIR}${INCLUDEDIR}/altq; \ 213 done 214 cd ${.CURDIR}/../sys/contrib/ipfilter/netinet; \ 215 for h in *.h; do \ 216 ln -fs ../../../sys/contrib/ipfilter/netinet/$$h \ 217 ${DESTDIR}${INCLUDEDIR}/netinet; \ 218 done 219 cd ${.CURDIR}/../sys/contrib/pf/net; \ 220 for h in *.h; do \ 221 ln -fs ../../../sys/contrib/pf/net/$$h \ 222 ${DESTDIR}${INCLUDEDIR}/net; \ 223 done 224 cd ${.CURDIR}/../sys/crypto; \ 225 for h in rijndael/rijndael.h; do \ 226 ln -fs ../../../sys/crypto/$$h \ 227 ${DESTDIR}${INCLUDEDIR}/crypto; \ 228 done 229 cd ${.CURDIR}/../sys/opencrypto; \ 230 for h in *.h; do \ 231 ln -fs ../../../sys/opencrypto/$$h \ 232 ${DESTDIR}${INCLUDEDIR}/crypto; \ 233 done 234 cd ${.CURDIR}/../sys/${MACHINE}/include; \ 235 for h in *.h; do \ 236 ln -fs ../../../sys/${MACHINE}/include/$$h \ 237 ${DESTDIR}${INCLUDEDIR}/machine; \ 238 done 239.if exists(${.CURDIR}/../sys/${MACHINE}/include/pc) 240 cd ${.CURDIR}/../sys/${MACHINE}/include/pc; \ 241 for h in *.h; do \ 242 ln -fs ../../../../sys/${MACHINE}/include/pc/$$h \ 243 ${DESTDIR}${INCLUDEDIR}/machine/pc; \ 244 done 245.endif 246.if defined(_MARCH) 247 ${INSTALL} -d -o ${BINOWN} -g ${BINGRP} -m 755 \ 248 ${DESTDIR}${INCLUDEDIR}/${_MARCH}; \ 249 cd ${.CURDIR}/../sys/${_MARCH}/include; \ 250 for h in *.h; do \ 251 ln -fs ../../../sys/${_MARCH}/include/$$h \ 252 ${DESTDIR}${INCLUDEDIR}/${_MARCH}; \ 253 done 254.if exists(${.CURDIR}/../sys/${_MARCH}/include/pc) 255 ${INSTALL} -d -o ${BINOWN} -g ${BINGRP} -m 755 \ 256 ${DESTDIR}${INCLUDEDIR}/${_MARCH}/pc; \ 257 cd ${.CURDIR}/../sys/${_MARCH}/include/pc; \ 258 for h in *.h; do \ 259 ln -fs ../../../../sys/${_MARCH}/include/pc/$$h \ 260 ${DESTDIR}${INCLUDEDIR}/${_MARCH}/pc; \ 261 done 262.endif 263.endif 264