Makefile revision 145539
140496Sbde#	@(#)Makefile	8.2 (Berkeley) 1/4/94
250473Speter# $FreeBSD: head/include/Makefile 145539 2005-04-26 02:01:39Z scottl $
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 \
12131661Sdas	hesiod.h 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 \
18142582Sru	resolv.h runefile.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
34116948SsamLDIRS=	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
38140246SddsLSUBDIRS=	cam/scsi \
39142744Snjl	dev/acpica dev/an dev/bktr dev/firewire \
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 \
45133812Spjd	geom/concat geom/gate geom/label geom/mirror geom/nop geom/raid3 \
46140084Spjd	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
58125123Semax.if !defined(NO_BLUETOOTH)
59114731SbdeLSUBSUBDIRS=	netgraph/bluetooth/include
60125123Semax.endif
61107139Sjulian
6254351Smarcel# Define SHARED to indicate whether you want symbolic links to the system
6354351Smarcel# source (``symlinks''), or a separate copy (``copies'').  ``symlinks'' is
6454351Smarcel# probably only useful for developers and should be avoided if you do not
6554351Smarcel# wish to tie your /usr/include and /usr/src together.
6654351Smarcel#SHARED=	symlinks
6754351SmarcelSHARED?=	copies
6854351Smarcel
6996462SruINCS+=	osreldate.h
7025734Speter
7136283Seivindosreldate.h:	${.CURDIR}/../sys/conf/newvers.sh \
7278376Speter		${.CURDIR}/../sys/sys/param.h \
7378376Speter		${.CURDIR}/Makefile
7425734Speter	@${ECHO} creating osreldate.h from newvers.sh
75117236Sru	@setvar PARAMFILE ${.CURDIR}/../sys/sys/param.h; \
76135371Sru	MAKE=${MAKE} . ${.CURDIR}/../sys/conf/newvers.sh;	\
7725734Speter	echo "$$COPYRIGHT" > osreldate.h;			\
7872673Speter	echo "#ifdef _KERNEL" >> osreldate.h;			\
79114731Sbde	echo '#error "<osreldate.h> cannot be used in the kernel, use <sys/param.h>"' >> osreldate.h; \
8072673Speter	echo "#else" >> osreldate.h;				\
8125734Speter	echo \#'undef __FreeBSD_version' >> osreldate.h;	\
8272673Speter	echo \#'define __FreeBSD_version' $$RELDATE >> osreldate.h; \
8372673Speter	echo "#endif" >> osreldate.h
8425734Speter
8588055Sru.for i in ${LHDRS}
8696462SruINCSLINKS+=	sys/$i ${INCLUDEDIR}/$i
8717900Speter.endfor
8888055Sru.for i in ${MHDRS}
8996462SruINCSLINKS+=	machine/$i ${INCLUDEDIR}/$i
9017900Speter.endfor
9188055Sru.for i in ${PHDRS}
9296462SruINCSLINKS+=	posix4/$i ${INCLUDEDIR}/$i
9334030Sdufault.endfor
9454351Smarcel
95144514Simp.if ${MACHINE} != ${MACHINE_ARCH}
96144514Simp_MARCH=${MACHINE_ARCH}
97144514Simp.endif
98144514Simp
99114731Sbde.include <bsd.prog.mk>
100114731Sbde
101114731Sbdeinstallincludes: ${SHARED}
102114731Sbde${SHARED}: compat
103114731Sbde
104114731Sbde# Take care of stale directory-level symlinks.
105114731Sbdecompat:
106144514Simp.for i in ${LDIRS} ${LSUBDIRS} machine ${_MARCH} crypto
107114731Sbde	if [ -L ${DESTDIR}${INCLUDEDIR}/$i ]; then \
108114731Sbde		rm -f ${DESTDIR}${INCLUDEDIR}/$i; \
10954351Smarcel	fi
11054351Smarcel.endfor
111114731Sbde	mtree -deU ${MTREE_FOLLOWS_SYMLINKS} \
112114731Sbde	    -f ${.CURDIR}/../etc/mtree/BSD.include.dist \
113114731Sbde	    -p ${DESTDIR}${INCLUDEDIR}
114135851Sdougb.if defined(WITH_BIND_LIBS) && !defined(NO_BIND)
115135851Sdougb	mtree -deU ${MTREE_FOLLOWS_SYMLINKS} \
116135851Sdougb	    -f ${.CURDIR}/../etc/mtree/BIND.include.dist \
117135851Sdougb	    -p ${DESTDIR}${INCLUDEDIR}
118135851Sdougb.endif
119114731Sbde
120114731Sbdecopies:
121144514Simp.for i in ${LDIRS} ${LSUBDIRS} ${LSUBSUBDIRS} altq crypto machine machine/pc \
122144514Simp	${_MARCH}
123114731Sbde.if exists(${DESTDIR}${INCLUDEDIR}/$i)
124114731Sbde	cd ${DESTDIR}${INCLUDEDIR}/$i; \
125114731Sbde	for h in *.h; do \
126114731Sbde		if [ -L $$h ]; then rm -f $$h; fi; \
127114731Sbde	done
128114731Sbde.endif
129114731Sbde.endfor
130143013Snjl.for i in ${LDIRS} ${LSUBDIRS:Ndev/acpica:Ndev/bktr} ${LSUBSUBDIRS}
13154351Smarcel	cd ${.CURDIR}/../sys; \
132114731Sbde	${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 $i/*.h \
133114731Sbde	    ${DESTDIR}${INCLUDEDIR}/$i
13454351Smarcel.endfor
135143013Snjl	cd ${.CURDIR}/../sys/dev/acpica; \
136143013Snjl	${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 acpiio.h \
137143013Snjl	    ${DESTDIR}${INCLUDEDIR}/dev/acpica
138123288Sobrien	cd ${.CURDIR}/../sys/dev/bktr; \
139123288Sobrien	${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 ioctl_*.h \
140123288Sobrien	    ${DESTDIR}${INCLUDEDIR}/dev/bktr
141130416Smlaier	cd ${.CURDIR}/../sys/contrib/altq/altq; \
142130416Smlaier	${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
143130416Smlaier	    ${DESTDIR}${INCLUDEDIR}/altq
144145539Sscottl.if !defined(NO_IPFILTER)
145116734Sru	cd ${.CURDIR}/../sys/contrib/ipfilter/netinet; \
146116734Sru	${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
147116734Sru	    ${DESTDIR}${INCLUDEDIR}/netinet
148145539Sscottl.endif
149126385Smlaier	cd ${.CURDIR}/../sys/contrib/pf/net; \
150126385Smlaier	${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
151126385Smlaier	    ${DESTDIR}${INCLUDEDIR}/net
152143423Sume	cd ${.CURDIR}/../sys/crypto; \
153143423Sume	${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 rijndael/rijndael.h \
154143423Sume	    ${DESTDIR}${INCLUDEDIR}/crypto
155116734Sru	cd ${.CURDIR}/../sys/opencrypto; \
156116734Sru	${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
157114731Sbde	    ${DESTDIR}${INCLUDEDIR}/crypto
158144514Simp	cd ${.CURDIR}/../sys/${MACHINE}/include; \
159114731Sbde	${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
160114731Sbde	    ${DESTDIR}${INCLUDEDIR}/machine
161144514Simp.if exists(${.CURDIR}/../sys/${MACHINE}/include/pc)
162144514Simp	cd ${.CURDIR}/../sys/${MACHINE}/include/pc; \
163114731Sbde	${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
164114731Sbde	    ${DESTDIR}${INCLUDEDIR}/machine/pc
16577857Sjlemon.endif
166144514Simp.if defined(_MARCH)
167144561Simp	${INSTALL} -d -o ${BINOWN} -g ${BINGRP} -m 755 \
168144561Simp	    ${DESTDIR}${INCLUDEDIR}/${_MARCH}; \
169144514Simp	cd ${.CURDIR}/../sys/${_MARCH}/include; \
170144514Simp	${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
171144514Simp	    ${DESTDIR}${INCLUDEDIR}/${_MARCH}
172144514Simp.if exists(${.CURDIR}/../sys/${_MARCH}/include/pc)
173144561Simp	${INSTALL} -d -o ${BINOWN} -g ${BINGRP} -m 755 \
174144561Simp	    ${DESTDIR}${INCLUDEDIR}/${_MARCH}/pc; \
175144514Simp	cd ${.CURDIR}/../sys/${_MARCH}/include/pc; \
176144514Simp	${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
177144514Simp	    ${DESTDIR}${INCLUDEDIR}/${_MARCH}/pc
178144514Simp.endif
179144514Simp.endif
1801539Srgrimes
18154351Smarcelsymlinks:
18254351Smarcel	@${ECHO} "Setting up symlinks to kernel source tree..."
18356645Speter.for i in ${LDIRS}
184114731Sbde	cd ${.CURDIR}/../sys/$i; \
185114731Sbde	for h in *.h; do \
186114731Sbde		ln -fs ../../../sys/$i/$$h ${DESTDIR}${INCLUDEDIR}/$i; \
187114731Sbde	done
18854351Smarcel.endfor
189143013Snjl.for i in ${LSUBDIRS:Ndev/acpica:Ndev/bktr}
190114731Sbde	cd ${.CURDIR}/../sys/$i; \
191114731Sbde	for h in *.h; do \
192114731Sbde		ln -fs ../../../../sys/$i/$$h ${DESTDIR}${INCLUDEDIR}/$i; \
193114731Sbde	done
19477046Sru.endfor
195143013Snjl	cd ${.CURDIR}/../sys/dev/acpica; \
196143013Snjl	for h in acpiio.h; do \
197143013Snjl		ln -fs ../../../../sys/dev/acpica/$$h \
198143013Snjl		    ${DESTDIR}${INCLUDEDIR}/dev/acpica; \
199143013Snjl	done
200142992Sru	cd ${.CURDIR}/../sys/dev/bktr; \
201142992Sru	for h in ioctl_*.h; do \
202142992Sru		ln -fs ../../../../sys/dev/bktr/$$h \
203142992Sru		    ${DESTDIR}${INCLUDEDIR}/dev/bktr; \
204142992Sru	done
205114731Sbde.for i in ${LSUBSUBDIRS}
206114731Sbde	cd ${.CURDIR}/../sys/$i; \
207114731Sbde	for h in *.h; do \
208114731Sbde		ln -fs ../../../../../sys/$i/$$h ${DESTDIR}${INCLUDEDIR}/$i; \
209114731Sbde	done
210114731Sbde.endfor
211130416Smlaier	cd ${.CURDIR}/../sys/contrib/altq/altq; \
212130416Smlaier	for h in *.h; do \
213130416Smlaier		ln -fs ../../../sys/contrib/altq/altq/$$h \
214130416Smlaier		    ${DESTDIR}${INCLUDEDIR}/altq; \
215130416Smlaier	done
216145539Sscottl.if !defined(NO_IPFILTER)
217116734Sru	cd ${.CURDIR}/../sys/contrib/ipfilter/netinet; \
218116734Sru	for h in *.h; do \
219116734Sru		ln -fs ../../../sys/contrib/ipfilter/netinet/$$h \
220116734Sru		    ${DESTDIR}${INCLUDEDIR}/netinet; \
221116734Sru	done
222145539Sscottl.endif
223126385Smlaier	cd ${.CURDIR}/../sys/contrib/pf/net; \
224126385Smlaier	for h in *.h; do \
225126385Smlaier		ln -fs ../../../sys/contrib/pf/net/$$h \
226126385Smlaier		    ${DESTDIR}${INCLUDEDIR}/net; \
227126385Smlaier	done
228143423Sume	cd ${.CURDIR}/../sys/crypto; \
229143423Sume	for h in rijndael/rijndael.h; do \
230143423Sume		ln -fs ../../../sys/crypto/$$h \
231143423Sume		    ${DESTDIR}${INCLUDEDIR}/crypto; \
232143423Sume	done
233114731Sbde	cd ${.CURDIR}/../sys/opencrypto; \
234114731Sbde	for h in *.h; do \
235114731Sbde		ln -fs ../../../sys/opencrypto/$$h \
236114731Sbde		    ${DESTDIR}${INCLUDEDIR}/crypto; \
237114731Sbde	done
238144514Simp	cd ${.CURDIR}/../sys/${MACHINE}/include; \
239114731Sbde	for h in *.h; do \
240144514Simp		ln -fs ../../../sys/${MACHINE}/include/$$h \
241114731Sbde		    ${DESTDIR}${INCLUDEDIR}/machine; \
242114731Sbde	done
243144514Simp.if exists(${.CURDIR}/../sys/${MACHINE}/include/pc)
244144514Simp	cd ${.CURDIR}/../sys/${MACHINE}/include/pc; \
245114731Sbde	for h in *.h; do \
246144514Simp		ln -fs ../../../../sys/${MACHINE}/include/pc/$$h \
247114731Sbde		    ${DESTDIR}${INCLUDEDIR}/machine/pc; \
248114731Sbde	done
249114731Sbde.endif
250144514Simp.if defined(_MARCH)
251144561Simp	${INSTALL} -d -o ${BINOWN} -g ${BINGRP} -m 755 \
252144561Simp	    ${DESTDIR}${INCLUDEDIR}/${_MARCH}; \
253144514Simp	cd ${.CURDIR}/../sys/${_MARCH}/include; \
254144514Simp	for h in *.h; do \
255144514Simp		ln -fs ../../../sys/${_MARCH}/include/$$h \
256144514Simp		    ${DESTDIR}${INCLUDEDIR}/${_MARCH}; \
257144514Simp	done
258144514Simp.if exists(${.CURDIR}/../sys/${_MARCH}/include/pc)
259144561Simp	${INSTALL} -d -o ${BINOWN} -g ${BINGRP} -m 755 \
260144561Simp	    ${DESTDIR}${INCLUDEDIR}/${_MARCH}/pc; \
261144514Simp	cd ${.CURDIR}/../sys/${_MARCH}/include/pc; \
262144514Simp	for h in *.h; do \
263144514Simp		ln -fs ../../../../sys/${_MARCH}/include/pc/$$h \
264144514Simp		    ${DESTDIR}${INCLUDEDIR}/${_MARCH}/pc; \
265144514Simp	done
266144514Simp.endif
267144514Simp.endif
268