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