Makefile revision 1.23
1#	from: @(#)Makefile	5.45.1.1 (Berkeley) 5/6/91
2#	$Id: Makefile,v 1.23 1993/08/16 00:26:07 mycroft 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
9SUBDIR= rpcsvc
10
11# Missing: mp.h
12
13FILES=	a.out.h ar.h assert.h bitstring.h ctype.h db.h dirent.h disktab.h \
14	err.h fnmatch.h fstab.h fts.h glob.h grp.h kvm.h limits.h locale.h \
15	math.h memory.h mpool.h ndbm.h netdb.h nlist.h paths.h pwd.h ranlib.h \
16	regexp.h resolv.h setjmp.h sgtty.h stab.h stdarg.h stddef.h stdio.h \
17	stdlib.h string.h strings.h struct.h sysexits.h time.h ttyent.h \
18	tzfile.h unistd.h utime.h utmp.h varargs.h vis.h malloc.h
19
20MFILES=	float.h frame.h
21LFILES=	errno.h fcntl.h signal.h syslog.h termios.h
22
23DIRS=	arpa protocols rpc
24LDIRS=	net netinet netccitt netiso netns nfs sys ufs vm 
25
26NOOBJ=	noobj
27
28# Change SYS_INCLUDE in bsd.own.mk to "symlinks" if you don't want copies
29.if !defined(SYS_INCLUDE)
30SYS_INCLUDE=	copies
31.endif
32
33realinstall:
34	@echo installing ${FILES}
35	@-for i in ${FILES}; do \
36		cmp -s $$i ${DESTDIR}/usr/include/$$i || \
37		    install -c -m 644 $$i ${DESTDIR}/usr/include/$$i; \
38	done
39	@echo installing ${DIRS}
40	@-for i in ${DIRS}; do \
41		if [ ! -d ${DESTDIR}/usr/include/$$i ]; \
42		then \
43			mkdir ${DESTDIR}/usr/include/$$i; \
44		fi; \
45		(cd $$i; for j in *.[ih]; do \
46			cmp -s $$j ${DESTDIR}/usr/include/$$i/$$j || \
47			install -c -m 644 $$j ${DESTDIR}/usr/include/$$i/$$j; \
48		done); \
49	done
50	@echo installing ${LFILES}
51	@-for i in ${LFILES}; do \
52		rm -f ${DESTDIR}/usr/include/$$i; \
53		ln -s sys/$$i ${DESTDIR}/usr/include/$$i; \
54	done
55	@echo installing ${MFILES}
56	@-for i in ${MFILES}; do \
57		rm -f ${DESTDIR}/usr/include/$$i; \
58		ln -s machine/$$i ${DESTDIR}/usr/include/$$i; \
59	done
60	@chown -R ${BINOWN}.${BINGRP} ${DESTDIR}/usr/include
61	@chmod -R a-w ${DESTDIR}/usr/include
62
63beforeinstall:
64	@install -d -o root -g wheel -m 755 ${DESTDIR}/usr/include
65
66copies:
67	@echo copies: ${LDIRS}
68	@-for i in ${LDIRS}; do \
69		rm -rf ${DESTDIR}/usr/include/$$i; \
70		cd ../sys; \
71		tar cf - $$i/*.h | (cd ${DESTDIR}/usr/include; tar xpfB -); \
72	done
73	rm -rf ${DESTDIR}/usr/include/machine
74	mkdir ${DESTDIR}/usr/include/machine
75	cd ../sys/arch/${MACHINE}/include; \
76	tar cf - *.h | (cd ${DESTDIR}/usr/include/machine; tar xpfB -); \
77
78symlinks:
79	@echo symlinks: ${LDIRS}
80	@for i in ${LDIRS}; do \
81		rm -rf ${DESTDIR}/usr/include/$$i; \
82		ln -s /sys/$$i ${DESTDIR}/usr/include/$$i; \
83	done
84	rm -rf ${DESTDIR}/usr/include/machine
85	ln -s /sys/arch/${MACHINE}/include ${DESTDIR}/usr/include/machine
86
87.include <bsd.prog.mk>
88
89realinstall: ${SYS_INCLUDE}
90