Makefile revision 156885
140496Sbde#	@(#)Makefile	8.2 (Berkeley) 1/4/94
250473Speter# $FreeBSD: head/include/Makefile 156885 2006-03-19 15:44:53Z rwatson $
31539Srgrimes#
4114731Sbde# Doing a "make install" builds /usr/include.
51539Srgrimes
6156813Sru.include <bsd.own.mk>
7156813Sru
818420SbdeCLEANFILES= osreldate.h version vers.c
9153838SdfrSUBDIR= arpa gssapi protocols rpcsvc rpc
10133567StjrINCS=	a.out.h ar.h assert.h bitstring.h complex.h cpio.h _ctype.h ctype.h \
11133559Stjr	db.h \
12107046Smarcel	dirent.h dlfcn.h elf.h elf-hints.h err.h fmtmsg.h fnmatch.h fstab.h \
13153838Sdfr	fts.h ftw.h getopt.h glob.h grp.h gssapi.h \
14148796Sphk	histedit.h ieeefp.h ifaddrs.h \
15107046Smarcel	inttypes.h iso646.h kenv.h langinfo.h libgen.h limits.h link.h \
16152994Sru	locale.h malloc.h memory.h monetary.h mpool.h mqueue.h \
17152994Sru	ndbm.h netconfig.h \
18113595Snectar	netdb.h nl_types.h nlist.h nss.h nsswitch.h objformat.h paths.h \
19153486Sphk	printf.h proc_service.h pthread.h \
20107046Smarcel	pthread_np.h pwd.h ranlib.h readpassphrase.h regex.h regexp.h \
21146261Sru	resolv.h runetype.h search.h setjmp.h sgtty.h \
22142582Sru	signal.h stab.h \
23121640Speter	stdbool.h stddef.h stdio.h stdlib.h string.h stringlist.h \
24133333Sstefanf	strings.h sysexits.h tar.h tgmath.h \
25133333Sstefanf	time.h timeconv.h timers.h ttyent.h \
26119630Skan	ulimit.h unistd.h utime.h utmp.h uuid.h varargs.h vis.h wchar.h \
27119630Skan	wctype.h wordexp.h
281539Srgrimes
29119630SkanMHDRS=	float.h floatingpoint.h stdarg.h
3034030Sdufault
31152868SrodrigcPHDRS=	sched.h semaphore.h _semaphore.h
3234030Sdufault
3388055SruLHDRS=	aio.h errno.h fcntl.h linker_set.h poll.h stdint.h syslog.h \
3464767Sjhb	termios.h ucontext.h
351539Srgrimes
36146795SrwatsonLDIRS=	bsm cam geom net net80211 netatalk netatm netgraph netinet netinet6 \
37116948Ssam	netipsec netipx netkey netnatm netncp netsmb nfs nfsclient nfsserver \
3883653Speter	pccard posix4 sys vm
3917900Speter
40146795SrwatsonLSUBDIRS=	cam/scsi \
41147191Sjkoshy	dev/acpica dev/an dev/bktr dev/firewire dev/hwpmc \
42150850Sscottl	dev/ic dev/iicbus ${_dev_ieee488} dev/lmc dev/ofw \
43152317Sdelphij	dev/pbio dev/ppbus dev/smbus dev/speaker dev/usb dev/wi dev/utopia \
44140246Sdds	fs/devfs fs/fdescfs fs/fifofs fs/msdosfs fs/ntfs fs/nullfs \
45140246Sdds	fs/nwfs fs/portalfs fs/procfs fs/smbfs fs/udf fs/umapfs \
46140246Sdds	fs/unionfs \
47148457Spjd	geom/concat geom/eli geom/gate geom/label geom/mirror geom/nop \
48148457Spjd	geom/raid3 geom/shsec geom/stripe \
49140246Sdds	isofs/cd9660 \
50140246Sdds	netatm/ipatm netatm/sigpvc netatm/spans netatm/uni \
51135339Sglebius	netgraph/atm netgraph/netflow \
52156885Srwatson	security/audit \
53135339Sglebius	security/mac_biba security/mac_bsdextended security/mac_lomac \
54135339Sglebius	security/mac_mls security/mac_partition \
55137556Smarkm	ufs/ffs ufs/ufs
5677031Sru
57156813Sru.if ${MK_GPIB} != "no"
58141397Sphk_dev_ieee488=	dev/ieee488
59141397Sphk.endif
60141397Sphk
61156813Sru.if ${MK_HESIOD} != "no"
62148796SphkINCS+=	hesiod.h
63148796Sphk.endif
64148796Sphk
65156813Sru.if ${MK_BLUETOOTH} != "no"
66114731SbdeLSUBSUBDIRS=	netgraph/bluetooth/include
67125123Semax.endif
68107139Sjulian
6954351Smarcel# Define SHARED to indicate whether you want symbolic links to the system
7054351Smarcel# source (``symlinks''), or a separate copy (``copies'').  ``symlinks'' is
7154351Smarcel# probably only useful for developers and should be avoided if you do not
7254351Smarcel# wish to tie your /usr/include and /usr/src together.
7354351Smarcel#SHARED=	symlinks
7454351SmarcelSHARED?=	copies
7554351Smarcel
7696462SruINCS+=	osreldate.h
7725734Speter
78156532Sruosreldate.h: ${.CURDIR}/../sys/conf/newvers.sh ${.CURDIR}/../sys/sys/param.h \
79156532Sru    ${.CURDIR}/Makefile
8025734Speter	@${ECHO} creating osreldate.h from newvers.sh
81156532Sru	@MAKE=${MAKE}; \
82156532Sru	PARAMFILE=${.CURDIR}/../sys/sys/param.h; \
83156532Sru	. ${.CURDIR}/../sys/conf/newvers.sh; \
84156531Sru	echo "$$COPYRIGHT" > osreldate.h; \
85156531Sru	echo "#ifdef _KERNEL" >> osreldate.h; \
86156532Sru	echo "#error \"<osreldate.h> cannot be used in the kernel, use <sys/param.h>\"" >> osreldate.h; \
87156531Sru	echo "#else" >> osreldate.h; \
88156532Sru	echo "#undef __FreeBSD_version" >> osreldate.h; \
89156532Sru	echo "#define __FreeBSD_version $$RELDATE" >> osreldate.h; \
9072673Speter	echo "#endif" >> osreldate.h
9125734Speter
9288055Sru.for i in ${LHDRS}
9396462SruINCSLINKS+=	sys/$i ${INCLUDEDIR}/$i
9417900Speter.endfor
9588055Sru.for i in ${MHDRS}
9696462SruINCSLINKS+=	machine/$i ${INCLUDEDIR}/$i
9717900Speter.endfor
9888055Sru.for i in ${PHDRS}
9996462SruINCSLINKS+=	posix4/$i ${INCLUDEDIR}/$i
10034030Sdufault.endfor
10154351Smarcel
102144514Simp.if ${MACHINE} != ${MACHINE_ARCH}
103144514Simp_MARCH=${MACHINE_ARCH}
104144514Simp.endif
105144514Simp
106114731Sbde.include <bsd.prog.mk>
107114731Sbde
108114731Sbdeinstallincludes: ${SHARED}
109114731Sbde${SHARED}: compat
110114731Sbde
111114731Sbde# Take care of stale directory-level symlinks.
112114731Sbdecompat:
113144514Simp.for i in ${LDIRS} ${LSUBDIRS} machine ${_MARCH} crypto
114114731Sbde	if [ -L ${DESTDIR}${INCLUDEDIR}/$i ]; then \
115114731Sbde		rm -f ${DESTDIR}${INCLUDEDIR}/$i; \
11654351Smarcel	fi
11754351Smarcel.endfor
118114731Sbde	mtree -deU ${MTREE_FOLLOWS_SYMLINKS} \
119114731Sbde	    -f ${.CURDIR}/../etc/mtree/BSD.include.dist \
120114731Sbde	    -p ${DESTDIR}${INCLUDEDIR}
121156813Sru.if ${MK_BIND_LIBS} != "no"
122135851Sdougb	mtree -deU ${MTREE_FOLLOWS_SYMLINKS} \
123135851Sdougb	    -f ${.CURDIR}/../etc/mtree/BIND.include.dist \
124135851Sdougb	    -p ${DESTDIR}${INCLUDEDIR}
125135851Sdougb.endif
126114731Sbde
127114731Sbdecopies:
128144514Simp.for i in ${LDIRS} ${LSUBDIRS} ${LSUBSUBDIRS} altq crypto machine machine/pc \
129144514Simp	${_MARCH}
130114731Sbde.if exists(${DESTDIR}${INCLUDEDIR}/$i)
131114731Sbde	cd ${DESTDIR}${INCLUDEDIR}/$i; \
132114731Sbde	for h in *.h; do \
133114731Sbde		if [ -L $$h ]; then rm -f $$h; fi; \
134114731Sbde	done
135114731Sbde.endif
136114731Sbde.endfor
137143013Snjl.for i in ${LDIRS} ${LSUBDIRS:Ndev/acpica:Ndev/bktr} ${LSUBSUBDIRS}
13854351Smarcel	cd ${.CURDIR}/../sys; \
139114731Sbde	${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 $i/*.h \
140114731Sbde	    ${DESTDIR}${INCLUDEDIR}/$i
14154351Smarcel.endfor
142143013Snjl	cd ${.CURDIR}/../sys/dev/acpica; \
143143013Snjl	${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 acpiio.h \
144143013Snjl	    ${DESTDIR}${INCLUDEDIR}/dev/acpica
145123288Sobrien	cd ${.CURDIR}/../sys/dev/bktr; \
146123288Sobrien	${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 ioctl_*.h \
147123288Sobrien	    ${DESTDIR}${INCLUDEDIR}/dev/bktr
148130416Smlaier	cd ${.CURDIR}/../sys/contrib/altq/altq; \
149130416Smlaier	${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
150130416Smlaier	    ${DESTDIR}${INCLUDEDIR}/altq
151156813Sru.if ${MK_IPFILTER} != "no"
152116734Sru	cd ${.CURDIR}/../sys/contrib/ipfilter/netinet; \
153116734Sru	${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
154116734Sru	    ${DESTDIR}${INCLUDEDIR}/netinet
155145539Sscottl.endif
156126385Smlaier	cd ${.CURDIR}/../sys/contrib/pf/net; \
157126385Smlaier	${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
158126385Smlaier	    ${DESTDIR}${INCLUDEDIR}/net
159143423Sume	cd ${.CURDIR}/../sys/crypto; \
160143423Sume	${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 rijndael/rijndael.h \
161143423Sume	    ${DESTDIR}${INCLUDEDIR}/crypto
162116734Sru	cd ${.CURDIR}/../sys/opencrypto; \
163116734Sru	${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
164114731Sbde	    ${DESTDIR}${INCLUDEDIR}/crypto
165144514Simp	cd ${.CURDIR}/../sys/${MACHINE}/include; \
166114731Sbde	${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
167114731Sbde	    ${DESTDIR}${INCLUDEDIR}/machine
168144514Simp.if exists(${.CURDIR}/../sys/${MACHINE}/include/pc)
169144514Simp	cd ${.CURDIR}/../sys/${MACHINE}/include/pc; \
170114731Sbde	${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
171114731Sbde	    ${DESTDIR}${INCLUDEDIR}/machine/pc
17277857Sjlemon.endif
173144514Simp.if defined(_MARCH)
174144561Simp	${INSTALL} -d -o ${BINOWN} -g ${BINGRP} -m 755 \
175144561Simp	    ${DESTDIR}${INCLUDEDIR}/${_MARCH}; \
176144514Simp	cd ${.CURDIR}/../sys/${_MARCH}/include; \
177144514Simp	${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
178144514Simp	    ${DESTDIR}${INCLUDEDIR}/${_MARCH}
179144514Simp.if exists(${.CURDIR}/../sys/${_MARCH}/include/pc)
180144561Simp	${INSTALL} -d -o ${BINOWN} -g ${BINGRP} -m 755 \
181144561Simp	    ${DESTDIR}${INCLUDEDIR}/${_MARCH}/pc; \
182144514Simp	cd ${.CURDIR}/../sys/${_MARCH}/include/pc; \
183144514Simp	${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
184144514Simp	    ${DESTDIR}${INCLUDEDIR}/${_MARCH}/pc
185144514Simp.endif
186144514Simp.endif
1871539Srgrimes
18854351Smarcelsymlinks:
18954351Smarcel	@${ECHO} "Setting up symlinks to kernel source tree..."
19056645Speter.for i in ${LDIRS}
191114731Sbde	cd ${.CURDIR}/../sys/$i; \
192114731Sbde	for h in *.h; do \
193114731Sbde		ln -fs ../../../sys/$i/$$h ${DESTDIR}${INCLUDEDIR}/$i; \
194114731Sbde	done
19554351Smarcel.endfor
196143013Snjl.for i in ${LSUBDIRS:Ndev/acpica:Ndev/bktr}
197114731Sbde	cd ${.CURDIR}/../sys/$i; \
198114731Sbde	for h in *.h; do \
199114731Sbde		ln -fs ../../../../sys/$i/$$h ${DESTDIR}${INCLUDEDIR}/$i; \
200114731Sbde	done
20177046Sru.endfor
202143013Snjl	cd ${.CURDIR}/../sys/dev/acpica; \
203143013Snjl	for h in acpiio.h; do \
204143013Snjl		ln -fs ../../../../sys/dev/acpica/$$h \
205143013Snjl		    ${DESTDIR}${INCLUDEDIR}/dev/acpica; \
206143013Snjl	done
207142992Sru	cd ${.CURDIR}/../sys/dev/bktr; \
208142992Sru	for h in ioctl_*.h; do \
209142992Sru		ln -fs ../../../../sys/dev/bktr/$$h \
210142992Sru		    ${DESTDIR}${INCLUDEDIR}/dev/bktr; \
211142992Sru	done
212114731Sbde.for i in ${LSUBSUBDIRS}
213114731Sbde	cd ${.CURDIR}/../sys/$i; \
214114731Sbde	for h in *.h; do \
215114731Sbde		ln -fs ../../../../../sys/$i/$$h ${DESTDIR}${INCLUDEDIR}/$i; \
216114731Sbde	done
217114731Sbde.endfor
218130416Smlaier	cd ${.CURDIR}/../sys/contrib/altq/altq; \
219130416Smlaier	for h in *.h; do \
220130416Smlaier		ln -fs ../../../sys/contrib/altq/altq/$$h \
221130416Smlaier		    ${DESTDIR}${INCLUDEDIR}/altq; \
222130416Smlaier	done
223156813Sru.if ${MK_IPFILTER} != "no"
224116734Sru	cd ${.CURDIR}/../sys/contrib/ipfilter/netinet; \
225116734Sru	for h in *.h; do \
226116734Sru		ln -fs ../../../sys/contrib/ipfilter/netinet/$$h \
227116734Sru		    ${DESTDIR}${INCLUDEDIR}/netinet; \
228116734Sru	done
229145539Sscottl.endif
230126385Smlaier	cd ${.CURDIR}/../sys/contrib/pf/net; \
231126385Smlaier	for h in *.h; do \
232126385Smlaier		ln -fs ../../../sys/contrib/pf/net/$$h \
233126385Smlaier		    ${DESTDIR}${INCLUDEDIR}/net; \
234126385Smlaier	done
235143423Sume	cd ${.CURDIR}/../sys/crypto; \
236143423Sume	for h in rijndael/rijndael.h; do \
237143423Sume		ln -fs ../../../sys/crypto/$$h \
238143423Sume		    ${DESTDIR}${INCLUDEDIR}/crypto; \
239143423Sume	done
240114731Sbde	cd ${.CURDIR}/../sys/opencrypto; \
241114731Sbde	for h in *.h; do \
242114731Sbde		ln -fs ../../../sys/opencrypto/$$h \
243114731Sbde		    ${DESTDIR}${INCLUDEDIR}/crypto; \
244114731Sbde	done
245144514Simp	cd ${.CURDIR}/../sys/${MACHINE}/include; \
246114731Sbde	for h in *.h; do \
247144514Simp		ln -fs ../../../sys/${MACHINE}/include/$$h \
248114731Sbde		    ${DESTDIR}${INCLUDEDIR}/machine; \
249114731Sbde	done
250144514Simp.if exists(${.CURDIR}/../sys/${MACHINE}/include/pc)
251144514Simp	cd ${.CURDIR}/../sys/${MACHINE}/include/pc; \
252114731Sbde	for h in *.h; do \
253144514Simp		ln -fs ../../../../sys/${MACHINE}/include/pc/$$h \
254114731Sbde		    ${DESTDIR}${INCLUDEDIR}/machine/pc; \
255114731Sbde	done
256114731Sbde.endif
257144514Simp.if defined(_MARCH)
258144561Simp	${INSTALL} -d -o ${BINOWN} -g ${BINGRP} -m 755 \
259144561Simp	    ${DESTDIR}${INCLUDEDIR}/${_MARCH}; \
260144514Simp	cd ${.CURDIR}/../sys/${_MARCH}/include; \
261144514Simp	for h in *.h; do \
262144514Simp		ln -fs ../../../sys/${_MARCH}/include/$$h \
263144514Simp		    ${DESTDIR}${INCLUDEDIR}/${_MARCH}; \
264144514Simp	done
265144514Simp.if exists(${.CURDIR}/../sys/${_MARCH}/include/pc)
266144561Simp	${INSTALL} -d -o ${BINOWN} -g ${BINGRP} -m 755 \
267144561Simp	    ${DESTDIR}${INCLUDEDIR}/${_MARCH}/pc; \
268144514Simp	cd ${.CURDIR}/../sys/${_MARCH}/include/pc; \
269144514Simp	for h in *.h; do \
270144514Simp		ln -fs ../../../../sys/${_MARCH}/include/pc/$$h \
271144514Simp		    ${DESTDIR}${INCLUDEDIR}/${_MARCH}/pc; \
272144514Simp	done
273144514Simp.endif
274144514Simp.endif
275