1 1.20 cjs # $NetBSD: Makefile,v 1.20 1997/05/26 03:59:14 cjs Exp $ 2 1.6 mrg 3 1.6 mrg # The ``rm -rf''s used below are safe because rm doesn't follow symbolic 4 1.6 mrg # links. 5 1.1 cgd 6 1.20 cjs .include <bsd.own.mk> # for BUILDDIR 7 1.20 cjs 8 1.5 pk SUBDIR+= arch/${MACHINE} 9 1.10 mrg 10 1.16 veego .if (${MACHINE_ARCH} != "alpha" && ${MACHINE_ARCH} != "mips" && \ 11 1.15 thorpej ${MACHINE_ARCH} != "powerpc") 12 1.13 veego SUBDIR+= lkm 13 1.10 mrg .endif 14 1.1 cgd 15 1.17 thorpej LFILES= errno.h fcntl.h md5.h poll.h syslog.h termios.h 16 1.8 mrg MFILES= float.h frame.h stdarg.h varargs.h 17 1.19 pk LDIRS= dev net netatalk netinet netccitt netiso netns netnatm nfs miscfs \ 18 1.19 pk sys ufs vm 19 1.6 mrg 20 1.6 mrg # Change SYS_INCLUDE in bsd.own.mk or /etc/mk.conf to "symlinks" if you 21 1.6 mrg # don't want copies 22 1.6 mrg .include <bsd.own.mk> 23 1.6 mrg SYS_INCLUDE?= copies 24 1.6 mrg 25 1.20 cjs .PHONY: includes 26 1.20 cjs .if defined(BUILDDIR) 27 1.20 cjs includes: build_${SYS_INCLUDE} 28 1.20 cjs @echo installing ${LFILES} 29 1.20 cjs @-for i in ${LFILES}; do \ 30 1.20 cjs rm -f ${BUILDDIR}/usr/include/$$i; \ 31 1.20 cjs ln -s sys/$$i ${BUILDDIR}/usr/include/$$i; \ 32 1.20 cjs done 33 1.20 cjs @echo installing ${MFILES} 34 1.20 cjs @-for i in ${MFILES}; do \ 35 1.20 cjs rm -f ${BUILDDIR}/usr/include/$$i; \ 36 1.20 cjs ln -s machine/$$i ${BUILDDIR}/usr/include/$$i; \ 37 1.20 cjs done 38 1.20 cjs .else 39 1.20 cjs includes: install_${SYS_INCLUDE} 40 1.20 cjs .endif 41 1.20 cjs 42 1.20 cjs build_copies: 43 1.20 cjs @echo copies: ${LDIRS} 44 1.20 cjs @-for i in ${LDIRS}; do \ 45 1.20 cjs rm -rf ${BUILDDIR}/usr/include/$$i; \ 46 1.20 cjs ${INSTALL} -d -m 755 ${BUILDDIR}/usr/include/$$i ; \ 47 1.20 cjs done 48 1.20 cjs pax -rw -pa -L \ 49 1.20 cjs `find ${LDIRS} -follow -type f -name '*.h' '!' -path \ 50 1.20 cjs 'netiso/xebec/*' -print` ${BUILDDIR}/usr/include 51 1.20 cjs rm -rf ${BUILDDIR}/usr/include/machine 52 1.20 cjs ${INSTALL} -d -m 755 ${BUILDDIR}/usr/include/machine 53 1.20 cjs pax -rw -pa -s "|arch/${MACHINE}/include||" \ 54 1.20 cjs arch/${MACHINE}/include/*.h \ 55 1.20 cjs ${BUILDDIR}/usr/include/machine 56 1.20 cjs rm -rf ${BUILDDIR}/usr/include/${MACHINE_ARCH} 57 1.20 cjs if test ${MACHINE} != ${MACHINE_ARCH} -a \ 58 1.20 cjs -d arch/${MACHINE_ARCH}/include; then \ 59 1.20 cjs ${INSTALL} -d -m 755 ${BUILDDIR}/usr/include/${MACHINE_ARCH}; \ 60 1.20 cjs pax -rw -pa -s "|arch/${MACHINE_ARCH}/include||" \ 61 1.20 cjs arch/${MACHINE_ARCH}/include/*.h \ 62 1.20 cjs ${BUILDDIR}/usr/include/${MACHINE_ARCH}; \ 63 1.20 cjs else \ 64 1.20 cjs ln -s machine ${BUILDDIR}/usr/include/${MACHINE_ARCH}; \ 65 1.20 cjs fi 66 1.20 cjs 67 1.20 cjs build_symlinks: 68 1.20 cjs @echo symlinks: ${LDIRS} 69 1.20 cjs @for i in ${LDIRS}; do \ 70 1.20 cjs rm -rf ${BUILDDIR}/usr/include/$$i; \ 71 1.20 cjs ln -s /sys/$$i ${BUILDDIR}/usr/include/$$i; \ 72 1.20 cjs done 73 1.20 cjs rm -rf ${BUILDDIR}/usr/include/machine 74 1.20 cjs ln -s /sys/arch/${MACHINE}/include ${BUILDDIR}/usr/include/machine 75 1.20 cjs rm -rf ${BUILDDIR}/usr/include/${MACHINE_ARCH} 76 1.20 cjs if test ${MACHINE} != ${MACHINE_ARCH} -a \ 77 1.20 cjs -d arch/${MACHINE_ARCH}/include ; then \ 78 1.20 cjs ln -s /sys/arch/${MACHINE_ARCH}/include \ 79 1.20 cjs ${BUILDDIR}/usr/include/${MACHINE_ARCH} ; \ 80 1.20 cjs else \ 81 1.20 cjs ln -s machine ${BUILDDIR}/usr/include/${MACHINE_ARCH} ; \ 82 1.20 cjs fi 83 1.20 cjs 84 1.20 cjs install: install_${SYS_INCLUDE} 85 1.6 mrg @echo installing ${LFILES} 86 1.6 mrg @-for i in ${LFILES}; do \ 87 1.6 mrg rm -f ${DESTDIR}/usr/include/$$i; \ 88 1.6 mrg ln -s sys/$$i ${DESTDIR}/usr/include/$$i; \ 89 1.6 mrg done 90 1.6 mrg @echo installing ${MFILES} 91 1.6 mrg @-for i in ${MFILES}; do \ 92 1.6 mrg rm -f ${DESTDIR}/usr/include/$$i; \ 93 1.6 mrg ln -s machine/$$i ${DESTDIR}/usr/include/$$i; \ 94 1.6 mrg done 95 1.6 mrg 96 1.20 cjs .PHONY: install_copies 97 1.20 cjs install_copies: 98 1.6 mrg @echo copies: ${LDIRS} 99 1.6 mrg @-for i in ${LDIRS}; do \ 100 1.6 mrg rm -rf ${DESTDIR}/usr/include/$$i; \ 101 1.9 thorpej ${INSTALL} -d -o ${BINOWN} -g ${BINGRP} -m 755 \ 102 1.6 mrg ${DESTDIR}/usr/include/$$i ; \ 103 1.6 mrg done 104 1.6 mrg pax -rw -pa -L \ 105 1.6 mrg `find ${LDIRS} -follow -type f -name '*.h' '!' -path \ 106 1.6 mrg 'netiso/xebec/*' -print` ${DESTDIR}/usr/include 107 1.6 mrg rm -rf ${DESTDIR}/usr/include/machine 108 1.9 thorpej ${INSTALL} -d -o ${BINOWN} -g ${BINGRP} -m 755 \ 109 1.6 mrg ${DESTDIR}/usr/include/machine 110 1.6 mrg pax -rw -pa -s "|arch/${MACHINE}/include||" \ 111 1.6 mrg arch/${MACHINE}/include/*.h \ 112 1.6 mrg ${DESTDIR}/usr/include/machine 113 1.6 mrg rm -rf ${DESTDIR}/usr/include/${MACHINE_ARCH} 114 1.6 mrg if test ${MACHINE} != ${MACHINE_ARCH} -a \ 115 1.6 mrg -d arch/${MACHINE_ARCH}/include; then \ 116 1.9 thorpej ${INSTALL} -d -o ${BINOWN} -g ${BINGRP} -m 755 \ 117 1.11 chuck ${DESTDIR}/usr/include/${MACHINE_ARCH}; \ 118 1.6 mrg pax -rw -pa -s "|arch/${MACHINE_ARCH}/include||" \ 119 1.6 mrg arch/${MACHINE_ARCH}/include/*.h \ 120 1.6 mrg ${DESTDIR}/usr/include/${MACHINE_ARCH}; \ 121 1.6 mrg else \ 122 1.6 mrg ln -s machine ${DESTDIR}/usr/include/${MACHINE_ARCH}; \ 123 1.6 mrg fi 124 1.6 mrg 125 1.20 cjs .PHONY: install_symlinks 126 1.20 cjs install_symlinks: 127 1.6 mrg @echo symlinks: ${LDIRS} 128 1.6 mrg @for i in ${LDIRS}; do \ 129 1.6 mrg rm -rf ${DESTDIR}/usr/include/$$i; \ 130 1.6 mrg ln -s /sys/$$i ${DESTDIR}/usr/include/$$i; \ 131 1.6 mrg done 132 1.6 mrg rm -rf ${DESTDIR}/usr/include/machine 133 1.6 mrg ln -s /sys/arch/${MACHINE}/include ${DESTDIR}/usr/include/machine 134 1.6 mrg rm -rf ${DESTDIR}/usr/include/${MACHINE_ARCH} 135 1.6 mrg if test ${MACHINE} != ${MACHINE_ARCH} -a \ 136 1.6 mrg -d arch/${MACHINE_ARCH}/include ; then \ 137 1.6 mrg ln -s /sys/arch/${MACHINE_ARCH}/include \ 138 1.6 mrg ${DESTDIR}/usr/include/${MACHINE_ARCH} ; \ 139 1.6 mrg else \ 140 1.6 mrg ln -s machine ${DESTDIR}/usr/include/${MACHINE_ARCH} ; \ 141 1.6 mrg fi 142 1.6 mrg 143 1.1 cgd .include <bsd.subdir.mk> 144