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