Makefile revision 70632
1#	@(#)Makefile	8.2 (Berkeley) 1/4/94
2# $FreeBSD: head/include/Makefile 70632 2001-01-03 12:35:39Z sheldonh $
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 \
14	hesiod.h histedit.h ieeefp.h ifaddrs.h iso646.h \
15	libgen.h limits.h link.h locale.h malloc.h memory.h mpool.h \
16	ndbm.h netdb.h nl_types.h nlist.h nsswitch.h objformat.h \
17	paths.h pthread.h pthread_np.h pwd.h \
18	ranlib.h regex.h regexp.h resolv.h rune.h runetype.h \
19	search.h setjmp.h sgtty.h \
20	signal.h stab.h stdbool.h stddef.h stdio.h stdlib.h string.h \
21	stringlist.h strings.h sysexits.h tar.h time.h timers.h \
22	ttyent.h unistd.h utime.h utmp.h vis.h
23.if defined(WANT_CSRG_LIBM)
24FILES+=	math.h
25.endif
26
27ARPAFILES=	ftp.h inet.h nameser.h nameser_compat.h telnet.h tftp.h
28
29PROTOFILES=	dumprestore.h routed.h rwhod.h talkd.h timed.h
30
31RPCFILES=	auth.h auth_unix.h clnt.h pmap_clnt.h pmap_prot.h pmap_rmt.h \
32		rpc.h rpc_com.h rpc_msg.h svc.h svc_auth.h types.h xdr.h \
33		auth_des.h des.h des_crypt.h
34
35MFILES=	float.h floatingpoint.h stdarg.h varargs.h
36
37# posix4/aio.h conflicts with dysons and isn't installed:
38PFILES=	mqueue.h sched.h semaphore.h # aio.h
39
40# Only for default SHARED=copies case
41SFILES=	soundcard.h joystick.h
42
43LFILES=	aio.h errno.h fcntl.h inttypes.h linker_set.h poll.h syslog.h \
44	termios.h ucontext.h
45
46LDIRS=	cam msdosfs net netatalk netatm netgraph netinet netinet6 \
47	netipx netkey netnatm netncp netns nfs ntfs nwfs pccard posix4 sys vm
48
49LNOHEADERDIRS=	isofs ufs dev
50LSUBDIRS=	isofs/cd9660 ufs/ffs ufs/mfs ufs/ufs cam/scsi dev/ppbus dev/usb
51
52# For SHARED=symlinks, cam is a symlink, so cam/scsi is taken care of
53LSYMSUBDIRS=	isofs/cd9660 ufs/ffs ufs/mfs ufs/ufs dev/ppbus dev/usb
54
55# Define SHARED to indicate whether you want symbolic links to the system
56# source (``symlinks''), or a separate copy (``copies'').  ``symlinks'' is
57# probably only useful for developers and should be avoided if you do not
58# wish to tie your /usr/include and /usr/src together.
59#SHARED=	symlinks
60SHARED?=	copies
61
62all:	osreldate.h
63
64osreldate.h:	${.CURDIR}/../sys/conf/newvers.sh \
65		${.CURDIR}/../sys/sys/param.h
66	@${ECHO} creating osreldate.h from newvers.sh
67	setvar PARAMFILE ${.CURDIR}/../sys/sys/param.h; \
68	. ${.CURDIR}/../sys/conf/newvers.sh;			\
69	echo "$$COPYRIGHT" > osreldate.h;			\
70	echo \#'undef __FreeBSD_version' >> osreldate.h;	\
71	echo \#'define __FreeBSD_version' $$RELDATE >> osreldate.h
72
73beforeinstall: ${SHARED}
74	@rm -f ${DESTDIR}/usr/include/timepps.h
75	cd ${.CURDIR}; \
76		${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 \
77		${FILES} ${DESTDIR}/usr/include
78	cd ${.CURDIR}/arpa; \
79		${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 \
80		${ARPAFILES} ${DESTDIR}/usr/include/arpa
81	cd ${.CURDIR}/protocols; \
82		${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 \
83		${PROTOFILES} ${DESTDIR}/usr/include/protocols
84	cd ${.CURDIR}/rpc; \
85		${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 \
86		${RPCFILES} ${DESTDIR}/usr/include/rpc
87	${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 \
88		${.OBJDIR}/osreldate.h \
89		${DESTDIR}/usr/include
90.for i in ${LFILES}
91	ln -sf sys/$i ${DESTDIR}/usr/include/$i
92.endfor
93.for i in ${MFILES}
94	ln -sf machine/$i ${DESTDIR}/usr/include/$i
95.endfor
96.for i in ${PFILES}
97	ln -sf posix4/$i ${DESTDIR}/usr/include/$i
98.endfor
99
100copies:
101.for i in ${LDIRS} ${LSYMSUBDIRS} machine
102	if [ -h ${DESTDIR}/usr/include/$i ]; then \
103		rm -f ${DESTDIR}/usr/include/$i; \
104	fi
105.endfor
106	mtree -deU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/../etc/mtree/BSD.include.dist \
107		-p ${DESTDIR}/usr/include
108.for i in ${LDIRS} ${LSUBDIRS}
109	cd ${.CURDIR}/../sys; \
110		${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 $i/*.h \
111		${DESTDIR}/usr/include/$i
112.endfor
113.if exists(${.CURDIR}/../sys/${MACHINE_ARCH}/include)
114	cd ${.CURDIR}/../sys/${MACHINE_ARCH}/include; \
115		${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
116		${DESTDIR}/usr/include/machine
117.endif
118.for i in ${SFILES}
119	ln -sf ../sys/$i ${DESTDIR}/usr/include/machine/$i
120.endfor
121
122symlinks:
123	@${ECHO} "Setting up symlinks to kernel source tree..."
124.for i in ${LDIRS}
125	rm -rf ${DESTDIR}/usr/include/$i
126	ln -s ../../sys/$i ${DESTDIR}/usr/include/$i
127.endfor
128.for i in ${LNOHEADERDIRS}
129	rm -rf ${DESTDIR}/usr/include/$i
130	mkdir ${DESTDIR}/usr/include/$i
131.endfor
132.for i in ${LSYMSUBDIRS}
133	ln -s ../../../sys/$i ${DESTDIR}/usr/include/$i
134.endfor
135	rm -rf ${DESTDIR}/usr/include/machine
136	ln -s ../../sys/${MACHINE_ARCH}/include ${DESTDIR}/usr/include/machine
137
138.include <bsd.prog.mk>
139