Makefile revision 1.8
1#	$NetBSD: Makefile,v 1.8 1996/10/15 06:50:26 mrg Exp $
2
3# The ``rm -rf''s used below are safe because rm doesn't follow symbolic
4# links.
5
6SUBDIR+= arch/${MACHINE}
7
8LFILES=	errno.h fcntl.h poll.h syslog.h termios.h
9MFILES=	float.h frame.h stdarg.h varargs.h
10LDIRS=	dev net netinet netccitt netiso netns nfs sys ufs vm 
11
12# Change SYS_INCLUDE in bsd.own.mk or /etc/mk.conf to "symlinks" if you
13# don't want copies
14.include <bsd.own.mk>
15SYS_INCLUDE?=	copies
16
17includes: ${SYS_INCLUDE}
18	@echo installing ${LFILES}
19	@-for i in ${LFILES}; do \
20		rm -f ${DESTDIR}/usr/include/$$i; \
21		ln -s sys/$$i ${DESTDIR}/usr/include/$$i; \
22	done
23	@echo installing ${MFILES}
24	@-for i in ${MFILES}; do \
25		rm -f ${DESTDIR}/usr/include/$$i; \
26		ln -s machine/$$i ${DESTDIR}/usr/include/$$i; \
27	done
28
29copies:
30	@echo copies: ${LDIRS}
31	@-for i in ${LDIRS}; do \
32		rm -rf ${DESTDIR}/usr/include/$$i; \
33		install -d -o ${BINOWN} -g ${BINGRP} -m 755 \
34			${DESTDIR}/usr/include/$$i ; \
35	done
36	pax -rw -pa -L \
37	    `find ${LDIRS} -follow -type f -name '*.h' '!' -path \
38	    'netiso/xebec/*' -print` ${DESTDIR}/usr/include
39	rm -rf ${DESTDIR}/usr/include/machine
40	install -d -o ${BINOWN} -g ${BINGRP} -m 755 \
41		${DESTDIR}/usr/include/machine
42	pax -rw -pa -s "|arch/${MACHINE}/include||" \
43	    arch/${MACHINE}/include/*.h \
44	    ${DESTDIR}/usr/include/machine   
45	rm -rf ${DESTDIR}/usr/include/${MACHINE_ARCH}
46	if test ${MACHINE} != ${MACHINE_ARCH} -a \
47	    -d arch/${MACHINE_ARCH}/include; then \
48		install -d -o ${BINOWN} -g ${BINGRP} -m 755 \
49    	    	    ${DESTDIR}/usr/include/${MACHINE_ARCH}; \
50		pax -rw -pa -s "|arch/${MACHINE_ARCH}/include||" \
51		    arch/${MACHINE_ARCH}/include/*.h \
52		    ${DESTDIR}/usr/include/${MACHINE_ARCH}; \
53	else \
54		ln -s machine ${DESTDIR}/usr/include/${MACHINE_ARCH}; \
55	fi
56
57symlinks:
58	@echo symlinks: ${LDIRS}
59	@for i in ${LDIRS}; do \
60		rm -rf ${DESTDIR}/usr/include/$$i; \
61		ln -s /sys/$$i ${DESTDIR}/usr/include/$$i; \
62	done
63	rm -rf ${DESTDIR}/usr/include/machine
64	ln -s /sys/arch/${MACHINE}/include ${DESTDIR}/usr/include/machine
65	rm -rf ${DESTDIR}/usr/include/${MACHINE_ARCH}
66	if test ${MACHINE} != ${MACHINE_ARCH} -a \
67	    -d arch/${MACHINE_ARCH}/include ; then \
68		ln -s /sys/arch/${MACHINE_ARCH}/include \
69		    ${DESTDIR}/usr/include/${MACHINE_ARCH} ; \
70	else \
71		ln -s machine ${DESTDIR}/usr/include/${MACHINE_ARCH} ; \
72	fi
73
74.include <bsd.subdir.mk>
75