xref: /original-bsd/include/Makefile (revision f955cb91)
1#	@(#)Makefile	5.46 (Berkeley) 08/02/91
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	fstab.h fts.h glob.h grp.h kvm.h limits.h locale.h math.h memory.h \
12	mp.h ndbm.h netdb.h nlist.h paths.h pwd.h ranlib.h regexp.h \
13	resolv.h setjmp.h sgtty.h signal.h stab.h stdarg.h stddef.h stdio.h \
14	stdlib.h string.h strings.h struct.h sysexits.h time.h ttyent.h \
15	tzfile.h unistd.h utime.h utmp.h varargs.h vis.h
16
17MFILES=	float.h frame.h
18LFILES=	errno.h fcntl.h syslog.h termios.h
19
20DIRS=arpa protocols
21LDIRS=	net netimp netinet netiso netns nfs sys ufs
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 || \
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			install -c -o ${BINOWN} -g ${BINGRP} -m 444 $$j \
49			    ${DESTDIR}/usr/include/$$i/$$j; \
50		done); \
51	done
52	@echo installing ${LFILES}
53	@-for i in ${LFILES}; do \
54		rm -f ${DESTDIR}/usr/include/$$i; \
55		ln -s sys/$$i ${DESTDIR}/usr/include/$$i; \
56		chown ${BINOWN}.${BINGRP} ${DESTDIR}/usr/include/$$i; \
57	done
58	@echo installing ${MFILES}
59	@-for i in ${MFILES}; do \
60		rm -f ${DESTDIR}/usr/include/$$i; \
61		ln -s machine/$$i ${DESTDIR}/usr/include/$$i; \
62		chown ${BINOWN}.${BINGRP} ${DESTDIR}/usr/include/$$i; \
63	done
64
65copies:
66	@echo copies: ${LDIRS}
67	@-for i in ${LDIRS}; do \
68		rm -rf ${DESTDIR}/usr/include/$$i; \
69		cd /sys; \
70		tar cf - $$i/*.h | (cd ${DESTDIR}/usr/include; tar xpfB -); \
71	done
72	rm -f ${DESTDIR}/usr/include/machine
73	mkdir ${DESTDIR}/usr/include/machine
74	cd /sys/${MACHINE}/include; \
75	tar cf - *.h | (cd ${DESTDIR}/usr/include/machine; tar xpfB -); \
76
77symlinks:
78	@echo symlinks: ${LDIRS}
79	@for i in ${LDIRS}; do \
80		rm -rf ${DESTDIR}/usr/include/$$i; \
81		ln -s /sys/$$i ${DESTDIR}/usr/include/$$i; \
82		chown ${BINOWN}.${BINGRP} ${DESTDIR}/usr/include/$$i; \
83	done
84	rm -f ${DESTDIR}/usr/include/machine
85	ln -s /sys/${MACHINE}/include ${DESTDIR}/usr/include/machine
86	chown ${BINOWN}.${BINGRP} ${DESTDIR}/usr/include/machine
87
88.include <bsd.prog.mk>
89