Makefile revision 56645
140496Sbde#	@(#)Makefile	8.2 (Berkeley) 1/4/94
250473Speter# $FreeBSD: head/include/Makefile 56645 2000-01-26 17:12:09Z peter $
31539Srgrimes#
41539Srgrimes# Doing a make install builds /usr/include
554351Smarcel#
654351Smarcel# The ``rm -rf''s used below are safe because rm doesn't follow symbolic
754351Smarcel# links.
81539Srgrimes
918420SbdeCLEANFILES= osreldate.h version vers.c
101833SwollmanSUBDIR= rpcsvc
111539SrgrimesFILES=	a.out.h ar.h assert.h bitstring.h ctype.h db.h dirent.h disktab.h \
1233236Sjdp	dlfcn.h elf.h err.h fnmatch.h fstab.h \
1342029Sdfr	fts.h glob.h grp.h strhash.h histedit.h ieeefp.h iso646.h \
1451935Speter	limits.h link.h locale.h malloc.h memory.h mpool.h \
1538960Sjdp	ndbm.h netdb.h nl_types.h nlist.h objformat.h \
1634030Sdufault	paths.h pthread.h pthread_np.h pwd.h \
1734326Sjb	ranlib.h regex.h regexp.h resolv.h rune.h runetype.h setjmp.h sgtty.h \
1826924Smsmith	signal.h stab.h stddef.h stdio.h stdlib.h string.h stringlist.h \
1944667Sphk	strings.h struct.h sysexits.h tar.h time.h timers.h \
2036739Sphk	ttyent.h unistd.h utime.h utmp.h vis.h
217242Sphk.if defined(WANT_CSRG_LIBM)
222573SbdeFILES+=	math.h
232573Sbde.endif
241539Srgrimes
2536890SpeterARPAFILES=	ftp.h inet.h nameser.h nameser_compat.h telnet.h tftp.h
2617900Speter
2717900SpeterPROTOFILES=	dumprestore.h routed.h rwhod.h talkd.h timed.h
2817900Speter
2917900SpeterRPCFILES=	auth.h auth_unix.h clnt.h pmap_clnt.h pmap_prot.h pmap_rmt.h \
3026212Swpaul		rpc.h rpc_com.h rpc_msg.h svc.h svc_auth.h types.h xdr.h \
3133298Sbde		auth_des.h des.h des_crypt.h
3217900Speter
333329SbdeMFILES=	float.h floatingpoint.h stdarg.h varargs.h
3434030Sdufault
3534030Sdufault# posix4/aio.h conflicts with dysons and isn't installed:
3650949SpeterPFILES=	mqueue.h sched.h semaphore.h # aio.h
3734030Sdufault
3854351Smarcel# Only for default SHARED=copies case
3954351SmarcelSFILES=	soundcard.h joystick.h
4050914Speter
4151910SmarcelLFILES=	aio.h errno.h fcntl.h inttypes.h linker_set.h poll.h syslog.h \
4251910Smarcel	termios.h ucontext.h
431539Srgrimes
4454351SmarcelLDIRS=	cam msdosfs net netatalk netatm netgraph netinet netinet6 \
4554351Smarcel	netipx netkey netncp netns nfs ntfs nwfs pccard posix4 sys vm
4617900Speter
4756583Sn_hibmaLNOHEADERDIRS=	isofs ufs dev
4856583Sn_hibmaLSUBDIRS=	isofs/cd9660 ufs/ffs ufs/mfs ufs/ufs cam/scsi dev/usb
4954351Smarcel
5054351Smarcel# Define SHARED to indicate whether you want symbolic links to the system
5154351Smarcel# source (``symlinks''), or a separate copy (``copies'').  ``symlinks'' is
5254351Smarcel# probably only useful for developers and should be avoided if you do not
5354351Smarcel# wish to tie your /usr/include and /usr/src together.
5454351Smarcel#SHARED=	symlinks
5554351SmarcelSHARED?=	copies
5654351Smarcel
5725734Speterall:	osreldate.h
5825734Speter
5936283Seivindosreldate.h:	${.CURDIR}/../sys/conf/newvers.sh \
6036283Seivind		${.CURDIR}/../sys/sys/param.h
6125734Speter	@${ECHO} creating osreldate.h from newvers.sh
6236283Seivind	setvar PARAMFILE ${.CURDIR}/../sys/sys/param.h; \
6325734Speter	. ${.CURDIR}/../sys/conf/newvers.sh;			\
6425734Speter	echo "$$COPYRIGHT" > osreldate.h;			\
6525734Speter	echo \#'undef __FreeBSD_version' >> osreldate.h;	\
6625734Speter	echo \#'define __FreeBSD_version' $$RELDATE >> osreldate.h
6725734Speter
6854351Smarcelbeforeinstall: ${SHARED}
6954351Smarcel	@rm -f ${DESTDIR}/usr/include/timepps.h
7017900Speter	cd ${.CURDIR}; \
7154351Smarcel		${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 \
7254351Smarcel		${FILES} ${DESTDIR}/usr/include
7317900Speter	cd ${.CURDIR}/arpa; \
7454351Smarcel		${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 \
7554351Smarcel		${ARPAFILES} ${DESTDIR}/usr/include/arpa
7617900Speter	cd ${.CURDIR}/protocols; \
7754351Smarcel		${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 \
7854351Smarcel		${PROTOFILES} ${DESTDIR}/usr/include/protocols
7917992Sadam	cd ${.CURDIR}/rpc; \
8054351Smarcel		${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 \
8154351Smarcel		${RPCFILES} ${DESTDIR}/usr/include/rpc
8254351Smarcel	${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 \
8354351Smarcel		${.OBJDIR}/osreldate.h \
8454351Smarcel		${DESTDIR}/usr/include
8517900Speter.for i in ${LFILES}
8617900Speter	ln -sf sys/$i ${DESTDIR}/usr/include/$i
8717900Speter.endfor
8817900Speter.for i in ${MFILES}
8917900Speter	ln -sf machine/$i ${DESTDIR}/usr/include/$i
9017900Speter.endfor
9134030Sdufault.for i in ${PFILES}
9234030Sdufault	ln -sf posix4/$i ${DESTDIR}/usr/include/$i
9334030Sdufault.endfor
9454351Smarcel
9554351Smarcelcopies:
9654351Smarcel.for i in ${LDIRS} ${LNOHEADERDIRS} machine
9754351Smarcel	if [ -h ${DESTDIR}/usr/include/$i ]; then \
9854351Smarcel		rm -f ${DESTDIR}/usr/include/$i; \
9954351Smarcel	fi
10054351Smarcel.endfor
10154351Smarcel	mtree -deU -f ${.CURDIR}/../etc/mtree/BSD.include.dist \
10254351Smarcel		-p ${DESTDIR}/usr/include
10354351Smarcel.for i in ${LDIRS} ${LSUBDIRS}
10454351Smarcel	cd ${.CURDIR}/../sys; \
10554351Smarcel		${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 $i/*.h \
10654351Smarcel		${DESTDIR}/usr/include/$i
10754351Smarcel.endfor
10854351Smarcel.if exists(${.CURDIR}/../sys/${MACHINE_ARCH}/include)
10954351Smarcel	cd ${.CURDIR}/../sys/${MACHINE_ARCH}/include; \
11054351Smarcel		${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
11154351Smarcel		${DESTDIR}/usr/include/machine
11254351Smarcel.endif
11350949Speter.for i in ${SFILES}
11450949Speter	ln -sf ../sys/$i ${DESTDIR}/usr/include/machine/$i
11550949Speter.endfor
1161539Srgrimes
11754351Smarcelsymlinks:
11854351Smarcel	@${ECHO} "Setting up symlinks to kernel source tree..."
11956645Speter.for i in ${LDIRS}
12054351Smarcel	rm -rf ${DESTDIR}/usr/include/$i
12154351Smarcel	ln -s ../../sys/$i ${DESTDIR}/usr/include/$i
12254351Smarcel.endfor
12356645Speter.for i in ${LNOHEADERDIRS}
12456645Speter	rm -rf ${DESTDIR}/usr/include/$i
12556645Speter	mkdir ${DESTDIR}/usr/include/$i
12656645Speter.endfor
12756645Speter.for i in ${LSUBDIRS}
12856645Speter	ln -s ../../../sys/$i ${DESTDIR}/usr/include/$i
12956645Speter.endfor
13054351Smarcel	rm -rf ${DESTDIR}/usr/include/machine
13154351Smarcel	ln -s ../../sys/${MACHINE_ARCH}/include ${DESTDIR}/usr/include/machine
13254351Smarcel
1331539Srgrimes.include <bsd.prog.mk>
134