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