Makefile revision 26924
1#	From: @(#)Makefile	8.2 (Berkeley) 1/4/94
2#	$Id: Makefile,v 1.58 1997/06/05 21:20:58 jkh Exp $
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#
9depend lint tags:
10
11CLEANFILES= osreldate.h version vers.c
12SUBDIR= rpcsvc
13FILES=	a.out.h ar.h assert.h bitstring.h ctype.h db.h dirent.h disktab.h \
14	elf.h err.h fnmatch.h fstab.h fts.h glob.h grp.h strhash.h histedit.h \
15	kvm.h limits.h link.h locale.h malloc.h memory.h mpool.h \
16	ndbm.h netdb.h nl_types.h nlist.h 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 ttyent.h unistd.h \
20	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 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 key_prot.h
32
33MFILES=	float.h floatingpoint.h stdarg.h varargs.h
34LFILES=	errno.h fcntl.h syslog.h termios.h
35
36LDIRS=	msdosfs net netns netatalk netinet netipx netkey nfs pccard sys vm \
37		# netccitt netiso
38
39LNOHEADERDIRS=	isofs ufs
40LSUBDIRS=	isofs/cd9660 ufs/ffs ufs/lfs ufs/mfs ufs/ufs
41
42# Define SHARED to indicate whether you want symbolic links to the system
43# source (``symlinks''), or a separate copy (``copies'').  ``symlinks'' is
44# probably only useful for developers and should be avoided if you do not
45# wish to tie your /usr/include and /usr/src together.
46#SHARED=	symlinks
47SHARED?=	copies
48
49
50.if exists (${.CURDIR}/../sys/conf/newvers.sh)
51all:	osreldate.h
52
53osreldate.h:	${.CURDIR}/../sys/conf/newvers.sh
54	@${ECHO} creating osreldate.h from newvers.sh
55	. ${.CURDIR}/../sys/conf/newvers.sh;			\
56	echo "$$COPYRIGHT" > osreldate.h;			\
57	echo \#'undef __FreeBSD_version' >> osreldate.h;	\
58	echo \#'define __FreeBSD_version' $$RELDATE >> osreldate.h
59.else
60all:
61	@${ECHO} creating osreldate.h from sysctl info
62	echo \#'undef __FreeBSD_version' > osreldate.h
63	echo \#'define __FreeBSD_version '`sysctl -n kern.osreldate` \
64		>> osreldate.h
65.endif
66
67beforeinstall: ${SHARED}
68	cd ${.CURDIR}; \
69		${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 \
70		${FILES} ${DESTDIR}/usr/include
71	cd ${.CURDIR}/arpa; \
72		${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 \
73		${ARPAFILES} ${DESTDIR}/usr/include/arpa
74	cd ${.CURDIR}/protocols; \
75		${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 \
76		${PROTOFILES} ${DESTDIR}/usr/include/protocols
77	cd ${.CURDIR}/rpc; \
78		${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 \
79		${RPCFILES} ${DESTDIR}/usr/include/rpc
80	${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 osreldate.h \
81		${DESTDIR}/usr/include
82.for i in ${LFILES}
83	ln -sf sys/$i ${DESTDIR}/usr/include/$i
84.endfor
85.for i in ${MFILES}
86	ln -sf machine/$i ${DESTDIR}/usr/include/$i
87.endfor
88
89copies:
90.for i in ${LDIRS} ${LNOHEADERDIRS} machine
91	if [ -h ${DESTDIR}/usr/include/$i ]; then \
92		rm -f ${DESTDIR}/usr/include/$i; \
93	fi
94.endfor
95	mtree -deU -f ${.CURDIR}/../etc/mtree/BSD.include.dist \
96		-p ${DESTDIR}/usr/include
97.for i in ${LDIRS} ${LSUBDIRS}
98	cd ${.CURDIR}/../sys; \
99		${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 $i/*.h \
100		${DESTDIR}/usr/include/$i
101.endfor
102.if exists(${.CURDIR}/../sys/${MACHINE}/include)
103	cd ${.CURDIR}/../sys/${MACHINE}/include; \
104		${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
105		${DESTDIR}/usr/include/machine
106.endif
107
108symlinks:
109	@${ECHO} "Setting up symlinks to kernel source tree..."
110.for i in ${LDIRS} ${LNOHEADERDIRS}
111	rm -rf ${DESTDIR}/usr/include/$i
112	ln -s /sys/$i ${DESTDIR}/usr/include/$i
113.endfor
114	rm -rf ${DESTDIR}/usr/include/machine
115	ln -s /sys/${MACHINE}/include ${DESTDIR}/usr/include/machine
116
117.include <bsd.prog.mk>
118