Makefile revision 148796
140496Sbde# @(#)Makefile 8.2 (Berkeley) 1/4/94 250473Speter# $FreeBSD: head/include/Makefile 148796 2005-08-06 16:53:55Z phk $ 31539Srgrimes# 4114731Sbde# Doing a "make install" builds /usr/include. 51539Srgrimes 618420SbdeCLEANFILES= osreldate.h version vers.c 796462SruSUBDIR= arpa protocols rpcsvc rpc 8133567StjrINCS= a.out.h ar.h assert.h bitstring.h complex.h cpio.h _ctype.h ctype.h \ 9133559Stjr db.h \ 10107046Smarcel dirent.h dlfcn.h elf.h elf-hints.h err.h fmtmsg.h fnmatch.h fstab.h \ 11131661Sdas fts.h ftw.h getopt.h glob.h grp.h \ 12148796Sphk histedit.h ieeefp.h ifaddrs.h \ 13107046Smarcel inttypes.h iso646.h kenv.h langinfo.h libgen.h limits.h link.h \ 14107046Smarcel locale.h malloc.h memory.h monetary.h mpool.h ndbm.h netconfig.h \ 15113595Snectar netdb.h nl_types.h nlist.h nss.h nsswitch.h objformat.h paths.h \ 16132173Sdavidxu proc_service.h pthread.h \ 17107046Smarcel pthread_np.h pwd.h ranlib.h readpassphrase.h regex.h regexp.h \ 18146261Sru resolv.h runetype.h search.h setjmp.h sgtty.h \ 19142582Sru signal.h stab.h \ 20121640Speter stdbool.h stddef.h stdio.h stdlib.h string.h stringlist.h \ 21133333Sstefanf strings.h sysexits.h tar.h tgmath.h \ 22133333Sstefanf time.h timeconv.h timers.h ttyent.h \ 23119630Skan ulimit.h unistd.h utime.h utmp.h uuid.h varargs.h vis.h wchar.h \ 24119630Skan wctype.h wordexp.h 251539Srgrimes 26119630SkanMHDRS= float.h floatingpoint.h stdarg.h 2734030Sdufault 28104219Smike# posix4/mqueue.h is useless without an implementation and isn't installed: 29104634SmikePHDRS= sched.h semaphore.h _semaphore.h # mqueue.h 3034030Sdufault 3188055SruLHDRS= aio.h errno.h fcntl.h linker_set.h poll.h stdint.h syslog.h \ 3264767Sjhb termios.h ucontext.h 331539Srgrimes 34146795SrwatsonLDIRS= bsm cam geom net net80211 netatalk netatm netgraph netinet netinet6 \ 35116948Ssam netipsec netipx netkey netnatm netncp netsmb nfs nfsclient nfsserver \ 3683653Speter pccard posix4 sys vm 3717900Speter 38146795SrwatsonLSUBDIRS= cam/scsi \ 39147191Sjkoshy dev/acpica dev/an dev/bktr dev/firewire dev/hwpmc \ 40142744Snjl dev/ic dev/iicbus ${_dev_ieee488} dev/ofw \ 41141397Sphk dev/pbio dev/ppbus dev/smbus dev/usb dev/wi dev/utopia \ 42140246Sdds fs/devfs fs/fdescfs fs/fifofs fs/msdosfs fs/ntfs fs/nullfs \ 43140246Sdds fs/nwfs fs/portalfs fs/procfs fs/smbfs fs/udf fs/umapfs \ 44140246Sdds fs/unionfs \ 45148457Spjd geom/concat geom/eli geom/gate geom/label geom/mirror geom/nop \ 46148457Spjd geom/raid3 geom/shsec geom/stripe \ 47140246Sdds isofs/cd9660 \ 48140246Sdds netatm/ipatm netatm/sigpvc netatm/spans netatm/uni \ 49135339Sglebius netgraph/atm netgraph/netflow \ 50135339Sglebius security/mac_biba security/mac_bsdextended security/mac_lomac \ 51135339Sglebius security/mac_mls security/mac_partition \ 52137556Smarkm ufs/ffs ufs/ufs 5377031Sru 54141397Sphk.if !defined(NO_GPIB) 55141397Sphk_dev_ieee488= dev/ieee488 56141397Sphk.endif 57141397Sphk 58148796Sphk.if defined(YES_HESIOD) 59148796SphkINCS+= hesiod.h 60148796Sphk.endif 61148796Sphk 62125123Semax.if !defined(NO_BLUETOOTH) 63114731SbdeLSUBSUBDIRS= netgraph/bluetooth/include 64125123Semax.endif 65107139Sjulian 6654351Smarcel# Define SHARED to indicate whether you want symbolic links to the system 6754351Smarcel# source (``symlinks''), or a separate copy (``copies''). ``symlinks'' is 6854351Smarcel# probably only useful for developers and should be avoided if you do not 6954351Smarcel# wish to tie your /usr/include and /usr/src together. 7054351Smarcel#SHARED= symlinks 7154351SmarcelSHARED?= copies 7254351Smarcel 7396462SruINCS+= osreldate.h 7425734Speter 7536283Seivindosreldate.h: ${.CURDIR}/../sys/conf/newvers.sh \ 7678376Speter ${.CURDIR}/../sys/sys/param.h \ 7778376Speter ${.CURDIR}/Makefile 7825734Speter @${ECHO} creating osreldate.h from newvers.sh 79117236Sru @setvar PARAMFILE ${.CURDIR}/../sys/sys/param.h; \ 80135371Sru MAKE=${MAKE} . ${.CURDIR}/../sys/conf/newvers.sh; \ 8125734Speter echo "$$COPYRIGHT" > osreldate.h; \ 8272673Speter echo "#ifdef _KERNEL" >> osreldate.h; \ 83114731Sbde echo '#error "<osreldate.h> cannot be used in the kernel, use <sys/param.h>"' >> osreldate.h; \ 8472673Speter echo "#else" >> osreldate.h; \ 8525734Speter echo \#'undef __FreeBSD_version' >> osreldate.h; \ 8672673Speter echo \#'define __FreeBSD_version' $$RELDATE >> osreldate.h; \ 8772673Speter echo "#endif" >> osreldate.h 8825734Speter 8988055Sru.for i in ${LHDRS} 9096462SruINCSLINKS+= sys/$i ${INCLUDEDIR}/$i 9117900Speter.endfor 9288055Sru.for i in ${MHDRS} 9396462SruINCSLINKS+= machine/$i ${INCLUDEDIR}/$i 9417900Speter.endfor 9588055Sru.for i in ${PHDRS} 9696462SruINCSLINKS+= posix4/$i ${INCLUDEDIR}/$i 9734030Sdufault.endfor 9854351Smarcel 99144514Simp.if ${MACHINE} != ${MACHINE_ARCH} 100144514Simp_MARCH=${MACHINE_ARCH} 101144514Simp.endif 102144514Simp 103114731Sbde.include <bsd.prog.mk> 104114731Sbde 105114731Sbdeinstallincludes: ${SHARED} 106114731Sbde${SHARED}: compat 107114731Sbde 108114731Sbde# Take care of stale directory-level symlinks. 109114731Sbdecompat: 110144514Simp.for i in ${LDIRS} ${LSUBDIRS} machine ${_MARCH} crypto 111114731Sbde if [ -L ${DESTDIR}${INCLUDEDIR}/$i ]; then \ 112114731Sbde rm -f ${DESTDIR}${INCLUDEDIR}/$i; \ 11354351Smarcel fi 11454351Smarcel.endfor 115114731Sbde mtree -deU ${MTREE_FOLLOWS_SYMLINKS} \ 116114731Sbde -f ${.CURDIR}/../etc/mtree/BSD.include.dist \ 117114731Sbde -p ${DESTDIR}${INCLUDEDIR} 118135851Sdougb.if defined(WITH_BIND_LIBS) && !defined(NO_BIND) 119135851Sdougb mtree -deU ${MTREE_FOLLOWS_SYMLINKS} \ 120135851Sdougb -f ${.CURDIR}/../etc/mtree/BIND.include.dist \ 121135851Sdougb -p ${DESTDIR}${INCLUDEDIR} 122135851Sdougb.endif 123114731Sbde 124114731Sbdecopies: 125144514Simp.for i in ${LDIRS} ${LSUBDIRS} ${LSUBSUBDIRS} altq crypto machine machine/pc \ 126144514Simp ${_MARCH} 127114731Sbde.if exists(${DESTDIR}${INCLUDEDIR}/$i) 128114731Sbde cd ${DESTDIR}${INCLUDEDIR}/$i; \ 129114731Sbde for h in *.h; do \ 130114731Sbde if [ -L $$h ]; then rm -f $$h; fi; \ 131114731Sbde done 132114731Sbde.endif 133114731Sbde.endfor 134143013Snjl.for i in ${LDIRS} ${LSUBDIRS:Ndev/acpica:Ndev/bktr} ${LSUBSUBDIRS} 13554351Smarcel cd ${.CURDIR}/../sys; \ 136114731Sbde ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 $i/*.h \ 137114731Sbde ${DESTDIR}${INCLUDEDIR}/$i 13854351Smarcel.endfor 139143013Snjl cd ${.CURDIR}/../sys/dev/acpica; \ 140143013Snjl ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 acpiio.h \ 141143013Snjl ${DESTDIR}${INCLUDEDIR}/dev/acpica 142123288Sobrien cd ${.CURDIR}/../sys/dev/bktr; \ 143123288Sobrien ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 ioctl_*.h \ 144123288Sobrien ${DESTDIR}${INCLUDEDIR}/dev/bktr 145130416Smlaier cd ${.CURDIR}/../sys/contrib/altq/altq; \ 146130416Smlaier ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \ 147130416Smlaier ${DESTDIR}${INCLUDEDIR}/altq 148145539Sscottl.if !defined(NO_IPFILTER) 149116734Sru cd ${.CURDIR}/../sys/contrib/ipfilter/netinet; \ 150116734Sru ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \ 151116734Sru ${DESTDIR}${INCLUDEDIR}/netinet 152145539Sscottl.endif 153126385Smlaier cd ${.CURDIR}/../sys/contrib/pf/net; \ 154126385Smlaier ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \ 155126385Smlaier ${DESTDIR}${INCLUDEDIR}/net 156143423Sume cd ${.CURDIR}/../sys/crypto; \ 157143423Sume ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 rijndael/rijndael.h \ 158143423Sume ${DESTDIR}${INCLUDEDIR}/crypto 159116734Sru cd ${.CURDIR}/../sys/opencrypto; \ 160116734Sru ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \ 161114731Sbde ${DESTDIR}${INCLUDEDIR}/crypto 162144514Simp cd ${.CURDIR}/../sys/${MACHINE}/include; \ 163114731Sbde ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \ 164114731Sbde ${DESTDIR}${INCLUDEDIR}/machine 165144514Simp.if exists(${.CURDIR}/../sys/${MACHINE}/include/pc) 166144514Simp cd ${.CURDIR}/../sys/${MACHINE}/include/pc; \ 167114731Sbde ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \ 168114731Sbde ${DESTDIR}${INCLUDEDIR}/machine/pc 16977857Sjlemon.endif 170144514Simp.if defined(_MARCH) 171144561Simp ${INSTALL} -d -o ${BINOWN} -g ${BINGRP} -m 755 \ 172144561Simp ${DESTDIR}${INCLUDEDIR}/${_MARCH}; \ 173144514Simp cd ${.CURDIR}/../sys/${_MARCH}/include; \ 174144514Simp ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \ 175144514Simp ${DESTDIR}${INCLUDEDIR}/${_MARCH} 176144514Simp.if exists(${.CURDIR}/../sys/${_MARCH}/include/pc) 177144561Simp ${INSTALL} -d -o ${BINOWN} -g ${BINGRP} -m 755 \ 178144561Simp ${DESTDIR}${INCLUDEDIR}/${_MARCH}/pc; \ 179144514Simp cd ${.CURDIR}/../sys/${_MARCH}/include/pc; \ 180144514Simp ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \ 181144514Simp ${DESTDIR}${INCLUDEDIR}/${_MARCH}/pc 182144514Simp.endif 183144514Simp.endif 1841539Srgrimes 18554351Smarcelsymlinks: 18654351Smarcel @${ECHO} "Setting up symlinks to kernel source tree..." 18756645Speter.for i in ${LDIRS} 188114731Sbde cd ${.CURDIR}/../sys/$i; \ 189114731Sbde for h in *.h; do \ 190114731Sbde ln -fs ../../../sys/$i/$$h ${DESTDIR}${INCLUDEDIR}/$i; \ 191114731Sbde done 19254351Smarcel.endfor 193143013Snjl.for i in ${LSUBDIRS:Ndev/acpica:Ndev/bktr} 194114731Sbde cd ${.CURDIR}/../sys/$i; \ 195114731Sbde for h in *.h; do \ 196114731Sbde ln -fs ../../../../sys/$i/$$h ${DESTDIR}${INCLUDEDIR}/$i; \ 197114731Sbde done 19877046Sru.endfor 199143013Snjl cd ${.CURDIR}/../sys/dev/acpica; \ 200143013Snjl for h in acpiio.h; do \ 201143013Snjl ln -fs ../../../../sys/dev/acpica/$$h \ 202143013Snjl ${DESTDIR}${INCLUDEDIR}/dev/acpica; \ 203143013Snjl done 204142992Sru cd ${.CURDIR}/../sys/dev/bktr; \ 205142992Sru for h in ioctl_*.h; do \ 206142992Sru ln -fs ../../../../sys/dev/bktr/$$h \ 207142992Sru ${DESTDIR}${INCLUDEDIR}/dev/bktr; \ 208142992Sru done 209114731Sbde.for i in ${LSUBSUBDIRS} 210114731Sbde cd ${.CURDIR}/../sys/$i; \ 211114731Sbde for h in *.h; do \ 212114731Sbde ln -fs ../../../../../sys/$i/$$h ${DESTDIR}${INCLUDEDIR}/$i; \ 213114731Sbde done 214114731Sbde.endfor 215130416Smlaier cd ${.CURDIR}/../sys/contrib/altq/altq; \ 216130416Smlaier for h in *.h; do \ 217130416Smlaier ln -fs ../../../sys/contrib/altq/altq/$$h \ 218130416Smlaier ${DESTDIR}${INCLUDEDIR}/altq; \ 219130416Smlaier done 220145539Sscottl.if !defined(NO_IPFILTER) 221116734Sru cd ${.CURDIR}/../sys/contrib/ipfilter/netinet; \ 222116734Sru for h in *.h; do \ 223116734Sru ln -fs ../../../sys/contrib/ipfilter/netinet/$$h \ 224116734Sru ${DESTDIR}${INCLUDEDIR}/netinet; \ 225116734Sru done 226145539Sscottl.endif 227126385Smlaier cd ${.CURDIR}/../sys/contrib/pf/net; \ 228126385Smlaier for h in *.h; do \ 229126385Smlaier ln -fs ../../../sys/contrib/pf/net/$$h \ 230126385Smlaier ${DESTDIR}${INCLUDEDIR}/net; \ 231126385Smlaier done 232143423Sume cd ${.CURDIR}/../sys/crypto; \ 233143423Sume for h in rijndael/rijndael.h; do \ 234143423Sume ln -fs ../../../sys/crypto/$$h \ 235143423Sume ${DESTDIR}${INCLUDEDIR}/crypto; \ 236143423Sume done 237114731Sbde cd ${.CURDIR}/../sys/opencrypto; \ 238114731Sbde for h in *.h; do \ 239114731Sbde ln -fs ../../../sys/opencrypto/$$h \ 240114731Sbde ${DESTDIR}${INCLUDEDIR}/crypto; \ 241114731Sbde done 242144514Simp cd ${.CURDIR}/../sys/${MACHINE}/include; \ 243114731Sbde for h in *.h; do \ 244144514Simp ln -fs ../../../sys/${MACHINE}/include/$$h \ 245114731Sbde ${DESTDIR}${INCLUDEDIR}/machine; \ 246114731Sbde done 247144514Simp.if exists(${.CURDIR}/../sys/${MACHINE}/include/pc) 248144514Simp cd ${.CURDIR}/../sys/${MACHINE}/include/pc; \ 249114731Sbde for h in *.h; do \ 250144514Simp ln -fs ../../../../sys/${MACHINE}/include/pc/$$h \ 251114731Sbde ${DESTDIR}${INCLUDEDIR}/machine/pc; \ 252114731Sbde done 253114731Sbde.endif 254144514Simp.if defined(_MARCH) 255144561Simp ${INSTALL} -d -o ${BINOWN} -g ${BINGRP} -m 755 \ 256144561Simp ${DESTDIR}${INCLUDEDIR}/${_MARCH}; \ 257144514Simp cd ${.CURDIR}/../sys/${_MARCH}/include; \ 258144514Simp for h in *.h; do \ 259144514Simp ln -fs ../../../sys/${_MARCH}/include/$$h \ 260144514Simp ${DESTDIR}${INCLUDEDIR}/${_MARCH}; \ 261144514Simp done 262144514Simp.if exists(${.CURDIR}/../sys/${_MARCH}/include/pc) 263144561Simp ${INSTALL} -d -o ${BINOWN} -g ${BINGRP} -m 755 \ 264144561Simp ${DESTDIR}${INCLUDEDIR}/${_MARCH}/pc; \ 265144514Simp cd ${.CURDIR}/../sys/${_MARCH}/include/pc; \ 266144514Simp for h in *.h; do \ 267144514Simp ln -fs ../../../../sys/${_MARCH}/include/pc/$$h \ 268144514Simp ${DESTDIR}${INCLUDEDIR}/${_MARCH}/pc; \ 269144514Simp done 270144514Simp.endif 271144514Simp.endif 272