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