1 1.22.8.3 cgd # $NetBSD: Makefile,v 1.22.8.3 1998/11/04 20:27:28 cgd 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.5 pk SUBDIR+= arch/${MACHINE} 7 1.10 mrg 8 1.16 veego .if (${MACHINE_ARCH} != "alpha" && ${MACHINE_ARCH} != "mips" && \ 9 1.15 thorpej ${MACHINE_ARCH} != "powerpc") 10 1.13 veego SUBDIR+= lkm 11 1.10 mrg .endif 12 1.1 cgd 13 1.17 thorpej LFILES= errno.h fcntl.h md5.h poll.h syslog.h termios.h 14 1.8 mrg MFILES= float.h frame.h stdarg.h varargs.h 15 1.22 drochner LDIRS= dev isofs net netatalk netinet netccitt netiso netns netnatm nfs miscfs \ 16 1.19 pk sys ufs vm 17 1.6 mrg 18 1.6 mrg # Change SYS_INCLUDE in bsd.own.mk or /etc/mk.conf to "symlinks" if you 19 1.6 mrg # don't want copies 20 1.6 mrg .include <bsd.own.mk> 21 1.6 mrg SYS_INCLUDE?= copies 22 1.22.8.1 thorpej 23 1.22.8.1 thorpej # If DESTDIR is set, we're probably building a release, so force "copies". 24 1.22.8.1 thorpej .if defined(DESTDIR) && (${DESTDIR} != "/" && !empty(DESTDIR)) 25 1.22.8.1 thorpej SYS_INCLUDE= copies 26 1.22.8.1 thorpej .endif 27 1.6 mrg 28 1.21 cjs .PHONY: includes 29 1.21 cjs includes: ${SYS_INCLUDE} 30 1.6 mrg @echo installing ${LFILES} 31 1.6 mrg @-for i in ${LFILES}; do \ 32 1.6 mrg rm -f ${DESTDIR}/usr/include/$$i; \ 33 1.6 mrg ln -s sys/$$i ${DESTDIR}/usr/include/$$i; \ 34 1.6 mrg done 35 1.6 mrg @echo installing ${MFILES} 36 1.6 mrg @-for i in ${MFILES}; do \ 37 1.6 mrg rm -f ${DESTDIR}/usr/include/$$i; \ 38 1.6 mrg ln -s machine/$$i ${DESTDIR}/usr/include/$$i; \ 39 1.6 mrg done 40 1.6 mrg 41 1.21 cjs .PHONY: copies 42 1.21 cjs copies: 43 1.6 mrg @echo copies: ${LDIRS} 44 1.6 mrg @-for i in ${LDIRS}; do \ 45 1.6 mrg rm -rf ${DESTDIR}/usr/include/$$i; \ 46 1.9 thorpej ${INSTALL} -d -o ${BINOWN} -g ${BINGRP} -m 755 \ 47 1.6 mrg ${DESTDIR}/usr/include/$$i ; \ 48 1.6 mrg done 49 1.6 mrg pax -rw -pa -L \ 50 1.6 mrg `find ${LDIRS} -follow -type f -name '*.h' '!' -path \ 51 1.6 mrg 'netiso/xebec/*' -print` ${DESTDIR}/usr/include 52 1.22.8.2 mellon (cd ${DESTDIR}/usr/include; find ${LDIRS} -type f | \ 53 1.22.8.2 mellon xargs chmod a=r) 54 1.22.8.3 cgd (cd ${DESTDIR}/usr/include; find ${LDIRS} -type f | \ 55 1.22.8.3 cgd xargs chown ${BINOWN}:${BINGRP}) 56 1.22.8.2 mellon (cd ${DESTDIR}/usr/include; find ${LDIRS} -type d | \ 57 1.22.8.2 mellon xargs chmod u=rwx,go=rx) 58 1.22.8.3 cgd (cd ${DESTDIR}/usr/include; find ${LDIRS} -type d | \ 59 1.22.8.3 cgd xargs chown ${BINOWN}:${BINGRP}) 60 1.6 mrg rm -rf ${DESTDIR}/usr/include/machine 61 1.9 thorpej ${INSTALL} -d -o ${BINOWN} -g ${BINGRP} -m 755 \ 62 1.6 mrg ${DESTDIR}/usr/include/machine 63 1.6 mrg pax -rw -pa -s "|arch/${MACHINE}/include||" \ 64 1.6 mrg arch/${MACHINE}/include/*.h \ 65 1.6 mrg ${DESTDIR}/usr/include/machine 66 1.22.8.2 mellon (cd ${DESTDIR}/usr/include; find machine -type f | \ 67 1.22.8.2 mellon xargs chmod a=r) 68 1.22.8.3 cgd (cd ${DESTDIR}/usr/include; find machine -type f | \ 69 1.22.8.3 cgd xargs chown ${BINOWN}:${BINGRP}) 70 1.22.8.2 mellon (cd ${DESTDIR}/usr/include; find machine -type d | \ 71 1.22.8.2 mellon xargs chmod u=rwx,go=rx) 72 1.22.8.3 cgd (cd ${DESTDIR}/usr/include; find machine -type d | \ 73 1.22.8.3 cgd xargs chown ${BINOWN}:${BINGRP}) 74 1.6 mrg rm -rf ${DESTDIR}/usr/include/${MACHINE_ARCH} 75 1.6 mrg if test ${MACHINE} != ${MACHINE_ARCH} -a \ 76 1.6 mrg -d arch/${MACHINE_ARCH}/include; then \ 77 1.9 thorpej ${INSTALL} -d -o ${BINOWN} -g ${BINGRP} -m 755 \ 78 1.11 chuck ${DESTDIR}/usr/include/${MACHINE_ARCH}; \ 79 1.6 mrg pax -rw -pa -s "|arch/${MACHINE_ARCH}/include||" \ 80 1.6 mrg arch/${MACHINE_ARCH}/include/*.h \ 81 1.6 mrg ${DESTDIR}/usr/include/${MACHINE_ARCH}; \ 82 1.22.8.2 mellon (cd ${DESTDIR}/usr/include; find ${MACHINE_ARCH} -type f | \ 83 1.22.8.2 mellon xargs chmod a=r); \ 84 1.22.8.3 cgd (cd ${DESTDIR}/usr/include; find ${MACHINE_ARCH} -type f | \ 85 1.22.8.3 cgd xargs chown ${BINOWN}:${BINGRP}); \ 86 1.22.8.2 mellon (cd ${DESTDIR}/usr/include; find ${MACHINE_ARCH} -type d | \ 87 1.22.8.2 mellon xargs chmod u=rwx,go=rx); \ 88 1.22.8.3 cgd (cd ${DESTDIR}/usr/include; find ${MACHINE_ARCH} -type d | \ 89 1.22.8.3 cgd xargs chown ${BINOWN}:${BINGRP}); \ 90 1.6 mrg else \ 91 1.6 mrg ln -s machine ${DESTDIR}/usr/include/${MACHINE_ARCH}; \ 92 1.6 mrg fi 93 1.6 mrg 94 1.21 cjs .PHONY: symlinks 95 1.21 cjs symlinks: 96 1.6 mrg @echo symlinks: ${LDIRS} 97 1.6 mrg @for i in ${LDIRS}; do \ 98 1.6 mrg rm -rf ${DESTDIR}/usr/include/$$i; \ 99 1.6 mrg ln -s /sys/$$i ${DESTDIR}/usr/include/$$i; \ 100 1.6 mrg done 101 1.6 mrg rm -rf ${DESTDIR}/usr/include/machine 102 1.6 mrg ln -s /sys/arch/${MACHINE}/include ${DESTDIR}/usr/include/machine 103 1.6 mrg rm -rf ${DESTDIR}/usr/include/${MACHINE_ARCH} 104 1.6 mrg if test ${MACHINE} != ${MACHINE_ARCH} -a \ 105 1.6 mrg -d arch/${MACHINE_ARCH}/include ; then \ 106 1.6 mrg ln -s /sys/arch/${MACHINE_ARCH}/include \ 107 1.6 mrg ${DESTDIR}/usr/include/${MACHINE_ARCH} ; \ 108 1.6 mrg else \ 109 1.6 mrg ln -s machine ${DESTDIR}/usr/include/${MACHINE_ARCH} ; \ 110 1.6 mrg fi 111 1.6 mrg 112 1.1 cgd .include <bsd.subdir.mk> 113