1 1.27 fvdl # $NetBSD: Makefile,v 1.27 1998/03/01 02:15:35 fvdl 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.27 fvdl LDIRS= adosfs dev isofs miscfs msdosfs net netatalk netccitt netinet netiso \ 16 1.27 fvdl netnatm netns nfs sys ufs uvm 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.23 thorpej 23 1.23 thorpej # If DESTDIR is set, we're probably building a release, so force "copies". 24 1.23 thorpej .if defined(DESTDIR) && (${DESTDIR} != "/" && !empty(DESTDIR)) 25 1.23 thorpej SYS_INCLUDE= copies 26 1.23 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.24 cgd (cd ${DESTDIR}/usr/include; find ${LDIRS} -type f | \ 53 1.24 cgd xargs chmod a=r) 54 1.24 cgd (cd ${DESTDIR}/usr/include; find ${LDIRS} -type d | \ 55 1.24 cgd xargs chmod u=rwx,go=rx) 56 1.6 mrg rm -rf ${DESTDIR}/usr/include/machine 57 1.9 thorpej ${INSTALL} -d -o ${BINOWN} -g ${BINGRP} -m 755 \ 58 1.6 mrg ${DESTDIR}/usr/include/machine 59 1.6 mrg pax -rw -pa -s "|arch/${MACHINE}/include||" \ 60 1.6 mrg arch/${MACHINE}/include/*.h \ 61 1.6 mrg ${DESTDIR}/usr/include/machine 62 1.24 cgd (cd ${DESTDIR}/usr/include; find machine -type f | \ 63 1.24 cgd xargs chmod a=r) 64 1.24 cgd (cd ${DESTDIR}/usr/include; find machine -type d | \ 65 1.24 cgd xargs chmod u=rwx,go=rx) 66 1.6 mrg rm -rf ${DESTDIR}/usr/include/${MACHINE_ARCH} 67 1.6 mrg if test ${MACHINE} != ${MACHINE_ARCH} -a \ 68 1.6 mrg -d arch/${MACHINE_ARCH}/include; then \ 69 1.9 thorpej ${INSTALL} -d -o ${BINOWN} -g ${BINGRP} -m 755 \ 70 1.11 chuck ${DESTDIR}/usr/include/${MACHINE_ARCH}; \ 71 1.6 mrg pax -rw -pa -s "|arch/${MACHINE_ARCH}/include||" \ 72 1.6 mrg arch/${MACHINE_ARCH}/include/*.h \ 73 1.6 mrg ${DESTDIR}/usr/include/${MACHINE_ARCH}; \ 74 1.24 cgd (cd ${DESTDIR}/usr/include; find ${MACHINE_ARCH} -type f | \ 75 1.24 cgd xargs chmod a=r); \ 76 1.24 cgd (cd ${DESTDIR}/usr/include; find ${MACHINE_ARCH} -type d | \ 77 1.24 cgd xargs chmod u=rwx,go=rx); \ 78 1.6 mrg else \ 79 1.6 mrg ln -s machine ${DESTDIR}/usr/include/${MACHINE_ARCH}; \ 80 1.6 mrg fi 81 1.6 mrg 82 1.21 cjs .PHONY: symlinks 83 1.21 cjs symlinks: 84 1.6 mrg @echo symlinks: ${LDIRS} 85 1.6 mrg @for i in ${LDIRS}; do \ 86 1.6 mrg rm -rf ${DESTDIR}/usr/include/$$i; \ 87 1.6 mrg ln -s /sys/$$i ${DESTDIR}/usr/include/$$i; \ 88 1.6 mrg done 89 1.6 mrg rm -rf ${DESTDIR}/usr/include/machine 90 1.6 mrg ln -s /sys/arch/${MACHINE}/include ${DESTDIR}/usr/include/machine 91 1.6 mrg rm -rf ${DESTDIR}/usr/include/${MACHINE_ARCH} 92 1.6 mrg if test ${MACHINE} != ${MACHINE_ARCH} -a \ 93 1.6 mrg -d arch/${MACHINE_ARCH}/include ; then \ 94 1.6 mrg ln -s /sys/arch/${MACHINE_ARCH}/include \ 95 1.6 mrg ${DESTDIR}/usr/include/${MACHINE_ARCH} ; \ 96 1.6 mrg else \ 97 1.6 mrg ln -s machine ${DESTDIR}/usr/include/${MACHINE_ARCH} ; \ 98 1.6 mrg fi 99 1.6 mrg 100 1.1 cgd .include <bsd.subdir.mk> 101