Makefile revision 50914
1#	@(#)Makefile	8.2 (Berkeley) 1/4/94
2# $FreeBSD: head/include/Makefile 50914 1999-09-04 15:44:44Z peter $
3#
4# Doing a make install builds /usr/include
5#
6# The ``rm -rf''s used below are safe because rm doesn't follow symbolic
7# links.
8
9CLEANFILES= osreldate.h version vers.c
10SUBDIR= rpcsvc
11FILES=	a.out.h ar.h assert.h bitstring.h ctype.h db.h dirent.h disktab.h \
12	dlfcn.h elf.h err.h fnmatch.h fstab.h \
13	fts.h glob.h grp.h strhash.h histedit.h ieeefp.h iso646.h \
14	kvm.h limits.h link.h locale.h malloc.h memory.h mpool.h \
15	ndbm.h netdb.h nl_types.h nlist.h objformat.h \
16	paths.h pthread.h pthread_np.h pwd.h \
17	ranlib.h regex.h regexp.h resolv.h rune.h runetype.h setjmp.h sgtty.h \
18	signal.h stab.h stddef.h stdio.h stdlib.h string.h stringlist.h \
19	strings.h struct.h sysexits.h tar.h time.h timers.h \
20	ttyent.h unistd.h utime.h utmp.h vis.h
21.if defined(WANT_CSRG_LIBM)
22FILES+=	math.h
23.endif
24
25ARPAFILES=	ftp.h inet.h nameser.h nameser_compat.h telnet.h tftp.h
26
27PROTOFILES=	dumprestore.h routed.h rwhod.h talkd.h timed.h
28
29RPCFILES=	auth.h auth_unix.h clnt.h pmap_clnt.h pmap_prot.h pmap_rmt.h \
30		rpc.h rpc_com.h rpc_msg.h svc.h svc_auth.h types.h xdr.h \
31		auth_des.h des.h des_crypt.h
32
33MFILES=	float.h floatingpoint.h stdarg.h varargs.h
34
35# posix4/aio.h conflicts with dysons and isn't installed:
36PFILES=	mqueue.h sched.h semaphore.h \
37		# aio.h
38
39SFILES=	soundcard.h
40
41LFILES=	aio.h errno.h fcntl.h inttypes.h linker_set.h poll.h syslog.h termios.h
42
43LDIRS=	cam msdosfs net netatalk netatm netinet netipx netkey netns nfs \
44	pccard posix4 sys vm
45
46LNOHEADERDIRS=	isofs ufs
47LSUBDIRS=	isofs/cd9660 ufs/ffs ufs/mfs ufs/ufs cam/scsi
48
49# Define SHARED to indicate whether you want symbolic links to the system
50# source (``symlinks''), or a separate copy (``copies'').  ``symlinks'' is
51# probably only useful for developers and should be avoided if you do not
52# wish to tie your /usr/include and /usr/src together.
53#SHARED=	symlinks
54SHARED?=	copies
55
56all:	osreldate.h
57
58osreldate.h:	${.CURDIR}/../sys/conf/newvers.sh \
59		${.CURDIR}/../sys/sys/param.h
60	@${ECHO} creating osreldate.h from newvers.sh
61	setvar PARAMFILE ${.CURDIR}/../sys/sys/param.h; \
62	. ${.CURDIR}/../sys/conf/newvers.sh;			\
63	echo "$$COPYRIGHT" > osreldate.h;			\
64	echo \#'undef __FreeBSD_version' >> osreldate.h;	\
65	echo \#'define __FreeBSD_version' $$RELDATE >> osreldate.h
66
67beforeinstall: ${SHARED}
68	@rm -f ${DESTDIR}/usr/include/timepps.h
69	cd ${.CURDIR}; \
70		${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 \
71		${FILES} ${DESTDIR}/usr/include
72	cd ${.CURDIR}/arpa; \
73		${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 \
74		${ARPAFILES} ${DESTDIR}/usr/include/arpa
75	cd ${.CURDIR}/protocols; \
76		${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 \
77		${PROTOFILES} ${DESTDIR}/usr/include/protocols
78	cd ${.CURDIR}/rpc; \
79		${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 \
80		${RPCFILES} ${DESTDIR}/usr/include/rpc
81	${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 \
82		${.OBJDIR}/osreldate.h \
83		${DESTDIR}/usr/include
84.for i in ${LFILES}
85	ln -sf sys/$i ${DESTDIR}/usr/include/$i
86.endfor
87.for i in ${MFILES}
88	ln -sf machine/$i ${DESTDIR}/usr/include/$i
89.endfor
90.for i in ${PFILES}
91	ln -sf posix4/$i ${DESTDIR}/usr/include/$i
92.endfor
93.for i in ${SFILES}
94	ln -sf ../sys/$i ${DESTDIR}/usr/include/machine/$i
95.endfor
96
97copies:
98.for i in ${LDIRS} ${LNOHEADERDIRS} machine
99	if [ -h ${DESTDIR}/usr/include/$i ]; then \
100		rm -f ${DESTDIR}/usr/include/$i; \
101	fi
102.endfor
103	mtree -deU -f ${.CURDIR}/../etc/mtree/BSD.include.dist \
104		-p ${DESTDIR}/usr/include
105.for i in ${LDIRS} ${LSUBDIRS}
106	cd ${.CURDIR}/../sys; \
107		${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 $i/*.h \
108		${DESTDIR}/usr/include/$i
109.endfor
110.if exists(${.CURDIR}/../sys/${MACHINE_ARCH}/include)
111	cd ${.CURDIR}/../sys/${MACHINE_ARCH}/include; \
112		${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
113		${DESTDIR}/usr/include/machine
114.endif
115
116symlinks:
117	@${ECHO} "Setting up symlinks to kernel source tree..."
118.for i in ${LDIRS} ${LNOHEADERDIRS}
119	rm -rf ${DESTDIR}/usr/include/$i
120	ln -s ../../sys/$i ${DESTDIR}/usr/include/$i
121.endfor
122	rm -rf ${DESTDIR}/usr/include/machine
123	ln -s ../../sys/${MACHINE_ARCH}/include ${DESTDIR}/usr/include/machine
124
125.include <bsd.prog.mk>
126