xref: /original-bsd/include/Makefile (revision 63b2a11c)
1#	@(#)Makefile	5.54 (Berkeley) 08/05/92
2#
3# Doing a make install builds /usr/include
4#
5# The ``rm -rf''s used below are safe because rm doesn't follow symbolic
6# links.
7#
8all clean cleandir depend lint tags:
9
10FILES=	a.out.h ar.h assert.h bitstring.h ctype.h db.h dirent.h disktab.h \
11	fnmatch.h fstab.h fts.h glob.h grp.h kvm.h limits.h locale.h \
12	math.h memory.h mp.h mpool.h ndbm.h netdb.h nlist.h paths.h pwd.h \
13	ranlib.h regex.h regexp.h resolv.h setjmp.h sgtty.h signal.h \
14	stab.h stddef.h stdio.h stdlib.h string.h strings.h struct.h \
15	sysexits.h time.h ttyent.h tzfile.h unistd.h utime.h utmp.h vis.h
16
17MFILES=	float.h frame.h stdarg.h varargs.h
18LFILES=	errno.h fcntl.h syslog.h termios.h
19
20DIRS=arpa protocols
21LDIRS=	miscfs net netccitt netimp netinet netiso netns netrmp nfs sys ufs vm
22
23NOOBJ=	noobj
24
25# Define SHARED to indicate whether you want symbolic links to the system
26# source (``symlinks''), or a separate copy (``copies''); (latter useful
27# in environments where it's not possible to keep /sys publicly readable)
28# SHARED=	copies
29SHARED=	symlinks
30
31install: ${SHARED}
32	@echo installing ${FILES}
33	@-for i in ${FILES}; do \
34		cmp -s $$i ${DESTDIR}/usr/include/$$i > /dev/null 2>&1 || \
35		    install -c -o ${BINOWN} -g ${BINGRP} -m 444 $$i \
36		    ${DESTDIR}/usr/include/$$i; \
37	done
38	@echo installing ${DIRS}
39	@-for i in ${DIRS}; do \
40		if [ ! -d ${DESTDIR}/usr/include/$$i ]; \
41		then \
42			mkdir ${DESTDIR}/usr/include/$$i; \
43		fi; \
44		chown ${BINOWN}.${BINGRP} ${DESTDIR}/usr/include/$$i; \
45		chmod 755 ${DESTDIR}/usr/include/$$i; \
46		(cd $$i; for j in *.[ih]; do \
47			cmp -s $$j ${DESTDIR}/usr/include/$$i/$$j > \
48			    /dev/null 2>&1 || \
49			    install -c -o ${BINOWN} -g ${BINGRP} -m 444 $$j \
50			    ${DESTDIR}/usr/include/$$i/$$j; \
51		done); \
52	done
53	@echo installing ${LFILES}
54	@-for i in ${LFILES}; do \
55		rm -f ${DESTDIR}/usr/include/$$i; \
56		ln -s sys/$$i ${DESTDIR}/usr/include/$$i; \
57		chown ${BINOWN}.${BINGRP} ${DESTDIR}/usr/include/$$i; \
58	done
59	@echo installing ${MFILES}
60	@-for i in ${MFILES}; do \
61		rm -f ${DESTDIR}/usr/include/$$i; \
62		ln -s machine/$$i ${DESTDIR}/usr/include/$$i; \
63		chown ${BINOWN}.${BINGRP} ${DESTDIR}/usr/include/$$i; \
64	done
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 -f ${DESTDIR}/usr/include/machine
74	mkdir ${DESTDIR}/usr/include/machine
75	cd /sys/${MACHINE}/include && \
76	    tar cf - *.h | (cd ${DESTDIR}/usr/include/machine; tar xpfB -);
77	rm -f ${DESTDIR}/usr/include/X11
78	mkdir ${DESTDIR}/usr/include/X11
79	cd /usr/X11R4/include/X11 && \
80	    tar cf - *.h | (cd ${DESTDIR}/usr/include/X11; tar xpfB -);
81
82symlinks:
83	@echo symlinks: ${LDIRS}
84	@for i in ${LDIRS}; do \
85		rm -rf ${DESTDIR}/usr/include/$$i; \
86		ln -s /sys/$$i ${DESTDIR}/usr/include/$$i; \
87		chown ${BINOWN}.${BINGRP} ${DESTDIR}/usr/include/$$i; \
88	done
89	rm -f ${DESTDIR}/usr/include/machine
90	ln -s ${DESTDIR}/sys/${MACHINE}/include ${DESTDIR}/usr/include/machine
91	rm -f ${DESTDIR}/usr/include/X11
92	ln -s ${DESTDIR}/usr/X11R4/include/X11 ${DESTDIR}/usr/include/X11
93
94.include <bsd.prog.mk>
95