1 1.32 mrg # $NetBSD: Makefile,v 1.32 2016/06/09 00:19:31 mrg Exp $ 2 1.6 mrg 3 1.6 mrg .include <bsd.own.mk> 4 1.6 mrg 5 1.6 mrg .if ${MKX11} != "no" 6 1.12 mrg EXTRA_DIST_FILES= ${.CURDIR}/NetBSD.dist.Xorg 7 1.6 mrg .endif 8 1.6 mrg 9 1.19 mrg # XXX these are only used by compat currently, but they could be used 10 1.19 mrg # by something else; this may need to be fixed properly in the future. 11 1.28 martin .if defined(MKCOMPAT) && ${MKCOMPAT} != "no" 12 1.25 matt .include "${NETBSDSRCDIR}/compat/archdirs.mk" 13 1.13 mrg .if exists(NetBSD.dist.${MACHINE_ARCH}) 14 1.13 mrg EXTRA_DIST_FILES+= ${.CURDIR}/NetBSD.dist.${MACHINE_ARCH} 15 1.23 matt .elif !empty(MACHINE_ARCH:Mearm*) 16 1.23 matt EXTRA_DIST_FILES+= ${.CURDIR}/NetBSD.dist.earm 17 1.13 mrg .endif 18 1.25 matt EXTRA_DIST_FILES+= NetBSD.dist.compat # autogenerated 19 1.29 mrg .if defined(MKCOMPATX11) && ${MKCOMPATX11} != "no" && ${MKX11} != "no" 20 1.26 matt EXTRA_DIST_FILES+= NetBSD.dist.xcompat # autogenerated 21 1.26 matt .endif 22 1.19 mrg .endif 23 1.13 mrg 24 1.18 njoly .if ${MKATF} != "no" 25 1.18 njoly EXTRA_DIST_FILES+= ${.CURDIR}/NetBSD.dist.tests 26 1.28 martin .if defined(MKCOMPATTESTS) && ${MKCOMPATTESTS} != "no" 27 1.25 matt EXTRA_DIST_FILES+= NetBSD.dist.tests.compat 28 1.25 matt .endif 29 1.18 njoly .endif 30 1.18 njoly 31 1.30 riz .if ${MKDTRACE} != "no" 32 1.30 riz EXTRA_DIST_FILES+= ${.CURDIR}/NetBSD.dist.dtrace 33 1.30 riz .endif 34 1.30 riz 35 1.11 uebayasi .if ${MKEXTSRC} != "no" 36 1.12 mrg EXTRA_DIST_FILES+= ${.CURDIR}/NetBSD.dist.extsrc 37 1.11 uebayasi .endif 38 1.11 uebayasi 39 1.32 mrg # 40 1.32 mrg # The NetBSD.dist.base and ${EXTRA_DIST_FILES} should really be part 41 1.32 mrg # of the NetBSD.dist.tmp rule, but that needs to have no dependencies 42 1.32 mrg # so that it is re-run every time, yet it depends upon files existing. 43 1.32 mrg # 44 1.32 mrg .BEGIN: ${.CURDIR}/NetBSD.dist.base ${EXTRA_DIST_FILES} 45 1.22 apb NetBSD.dist: NetBSD.dist.tmp 46 1.22 apb cmp -s NetBSD.dist.tmp NetBSD.dist || { \ 47 1.14 uebayasi echo "Updating NetBSD.dist"; \ 48 1.22 apb mv NetBSD.dist.tmp NetBSD.dist; \ 49 1.14 uebayasi } 50 1.31 mrg NetBSD.dist.tmp:: 51 1.12 mrg ${TOOL_CAT} ${.CURDIR}/NetBSD.dist.base ${EXTRA_DIST_FILES} > \ 52 1.9 stacktic ${.TARGET} 53 1.1 mrg 54 1.25 matt NetBSD.dist.compat: ${.CURDIR}/NetBSD.dist.compat.in ${.CURDIR}/mkcompat.awk 55 1.25 matt ${MKCREATE} 56 1.25 matt ${TOOL_AWK} -f ${.CURDIR}/mkcompat.awk \ 57 1.25 matt -v COMPATDIRS=${ARCHDIR_SUBDIR:T:Q} \ 58 1.25 matt ${.CURDIR}/NetBSD.dist.compat.in \ 59 1.25 matt > ${.TARGET} 60 1.25 matt 61 1.26 matt NetBSD.dist.xcompat: ${.CURDIR}/NetBSD.dist.xcompat.in ${.CURDIR}/mkcompat.awk 62 1.26 matt ${MKCREATE} 63 1.26 matt ${TOOL_AWK} -f ${.CURDIR}/mkcompat.awk \ 64 1.26 matt -v COMPATDIRS=${ARCHDIR_SUBDIR:T:Q} \ 65 1.26 matt ${.CURDIR}/NetBSD.dist.xcompat.in \ 66 1.26 matt > ${.TARGET} 67 1.26 matt 68 1.25 matt NetBSD.dist.tests.compat: ${.CURDIR}/NetBSD.dist.tests \ 69 1.25 matt ${.CURDIR}/mkcompattree.awk 70 1.25 matt ${MKCREATE} 71 1.25 matt ${TOOL_AWK} -f ${.CURDIR}/mkcompattree.awk \ 72 1.25 matt -v COMPATDIRS=${ARCHDIR_SUBDIR:T:Q} -v S="usr/tests" \ 73 1.25 matt ${.CURDIR}/NetBSD.dist.tests \ 74 1.25 matt > ${.TARGET} 75 1.25 matt 76 1.5 lukem CONFIGFILES= NetBSD.dist special 77 1.1 mrg FILESDIR= /etc/mtree 78 1.1 mrg 79 1.6 mrg # distrib-dirs -- 80 1.6 mrg # Populate $DESTDIR with directories needed by NetBSD 81 1.6 mrg # 82 1.6 mrg .if ${MKUNPRIVED} == "no" 83 1.6 mrg TOOL_MTREE.unpriv= 84 1.6 mrg .else 85 1.6 mrg TOOL_MTREE.unpriv= -W 86 1.6 mrg .endif 87 1.6 mrg 88 1.17 dyoung # postinstall(8) invokes this target to produce the right 89 1.17 dyoung # /etc/mtree/NetBSD.dist content without duplicating logic from 90 1.17 dyoung # the Makefile. 91 1.17 dyoung # 92 1.28 martin emit_dist_file: ${EXTRA_DIST_FILES} 93 1.24 christos @cat ${.CURDIR}/NetBSD.dist.base ${EXTRA_DIST_FILES} 94 1.16 dyoung 95 1.10 drochner distrib-dirs: .PHONY check_DESTDIR NetBSD.dist 96 1.6 mrg .if !defined(DISTRIBUTION_DONE) # { 97 1.6 mrg # Create DESTDIR using HOST_INSTALL_DIR, not INSTALL_DIR, because 98 1.6 mrg # INSTALL_DIR would want to write to the metalog, and it can't do that 99 1.6 mrg # if the metalog is inside DESTDIR but DESTDIR doesn't yet exist. 100 1.6 mrg ${HOST_INSTALL_DIR} -m 755 ${DESTDIR} 101 1.20 jym # Invoke mtree to create the directories listed in NetBSD.dist; 102 1.6 mrg # then invoke mtree again to register those directories in the metalog. 103 1.6 mrg ${TOOL_MTREE} -def ${.OBJDIR}/NetBSD.dist -N ${.CURDIR}/.. \ 104 1.6 mrg -p ${DESTDIR}/ -U ${TOOL_MTREE.unpriv} 105 1.6 mrg .if ${MKUNPRIVED} != "no" # { 106 1.6 mrg ${TOOL_MTREE} -def ${.OBJDIR}/NetBSD.dist -N ${.CURDIR}/.. \ 107 1.6 mrg -p ${DESTDIR}/ -C -k all | \ 108 1.6 mrg ${TOOL_AWK} '/ optional/ {next} // {print}' | ${METALOG.add} 109 1.6 mrg .endif # MKUNPRIVED # } 110 1.6 mrg .endif # DISTRIBUTION_DONE # } 111 1.6 mrg 112 1.22 apb CLEANFILES+= NetBSD.dist NetBSD.dist.tmp 113 1.25 matt CLEANFILES+= NetBSD.dist.compat 114 1.25 matt CLEANFILES+= NetBSD.dist.tests.compat 115 1.10 drochner 116 1.1 mrg .include <bsd.prog.mk> 117