1 1.40 mrg # $NetBSD: Makefile,v 1.40 2019/02/17 05:29:08 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.33 christos EXTRA_DIST_FILES= NetBSD.dist.Xorg 7 1.6 mrg .endif 8 1.6 mrg 9 1.40 mrg # Derived from MACHINE_CPU, but keeping 32/64bit for most. 10 1.40 mrg MTREE_MACHINE_ARCH=${MACHINE_ARCH:C/mipse[bl]/mips/:C/mips64e[bl]/mips64/:C/sh3e[bl]/sh3/:S/coldfire/m68k/:S/m68000/m68k/:C/arm.*/arm/:C/earm.*/arm/:S/earm/arm/:S/aarch64eb/aarch64/:S/or1knd/or1k/} 11 1.40 mrg 12 1.40 mrg # The compat specific files 13 1.40 mrg 14 1.28 martin .if defined(MKCOMPAT) && ${MKCOMPAT} != "no" 15 1.25 matt .include "${NETBSDSRCDIR}/compat/archdirs.mk" 16 1.40 mrg .if exists(NetBSD.compat.${MTREE_MACHINE_ARCH}) 17 1.40 mrg EXTRA_DIST_FILES+= NetBSD.compat.${MTREE_MACHINE_ARCH} 18 1.13 mrg .endif 19 1.25 matt EXTRA_DIST_FILES+= NetBSD.dist.compat # autogenerated 20 1.29 mrg .if defined(MKCOMPATX11) && ${MKCOMPATX11} != "no" && ${MKX11} != "no" 21 1.26 matt EXTRA_DIST_FILES+= NetBSD.dist.xcompat # autogenerated 22 1.26 matt .endif 23 1.19 mrg .endif 24 1.13 mrg 25 1.40 mrg 26 1.40 mrg # Platform specific files. 27 1.40 mrg # First we grab the mtree-specific, then either the MACHINE_ARCH or 28 1.40 mrg # MACHINE_CPU files, and finally the MACHINE files, as long as they 29 1.40 mrg # aren't the same files. 30 1.40 mrg 31 1.40 mrg .if exists(NetBSD.dist.${MTREE_MACHINE_ARCH}) 32 1.40 mrg EXTRA_DIST_FILES+= NetBSD.dist.${MTREE_MACHINE_ARCH} 33 1.40 mrg .endif 34 1.40 mrg 35 1.40 mrg .if empty(MTREE_MACHINE_ARCH:M${MACHINE_ARCH}) && \ 36 1.40 mrg exists(NetBSD.dist.${MACHINE_ARCH}) 37 1.39 mrg EXTRA_DIST_FILES+= NetBSD.dist.${MACHINE_ARCH} 38 1.40 mrg .elif empty(MTREE_MACHINE_ARCH:M${MACHINE_CPU}) && \ 39 1.40 mrg exists(NetBSD.dist.${MACHINE_CPU}) 40 1.40 mrg EXTRA_DIST_FILES+= NetBSD.dist.${MACHINE_CPU} 41 1.39 mrg .endif 42 1.39 mrg 43 1.40 mrg .if empty(MTREE_MACHINE_ARCH:M${MACHINE}) && \ 44 1.40 mrg exists(NetBSD.dist.${MACHINE}) 45 1.37 mrg EXTRA_DIST_FILES+= NetBSD.dist.${MACHINE} 46 1.37 mrg .endif 47 1.37 mrg 48 1.40 mrg 49 1.40 mrg # The build specific files. 50 1.40 mrg 51 1.18 njoly .if ${MKATF} != "no" 52 1.33 christos EXTRA_DIST_FILES+= NetBSD.dist.tests 53 1.28 martin .if defined(MKCOMPATTESTS) && ${MKCOMPATTESTS} != "no" 54 1.25 matt EXTRA_DIST_FILES+= NetBSD.dist.tests.compat 55 1.25 matt .endif 56 1.18 njoly .endif 57 1.18 njoly 58 1.30 riz .if ${MKDTRACE} != "no" 59 1.33 christos EXTRA_DIST_FILES+= NetBSD.dist.dtrace 60 1.30 riz .endif 61 1.30 riz 62 1.11 uebayasi .if ${MKEXTSRC} != "no" 63 1.33 christos EXTRA_DIST_FILES+= NetBSD.dist.extsrc 64 1.11 uebayasi .endif 65 1.11 uebayasi 66 1.38 mrg .if ${MKISCSI} != "no" 67 1.38 mrg EXTRA_DIST_FILES+= NetBSD.dist.iscsi 68 1.38 mrg .endif 69 1.38 mrg 70 1.22 apb NetBSD.dist: NetBSD.dist.tmp 71 1.22 apb cmp -s NetBSD.dist.tmp NetBSD.dist || { \ 72 1.14 uebayasi echo "Updating NetBSD.dist"; \ 73 1.22 apb mv NetBSD.dist.tmp NetBSD.dist; \ 74 1.14 uebayasi } 75 1.35 christos # Rebuild every time 76 1.35 christos .PHONY: NetBSD.dist.tmp 77 1.33 christos NetBSD.dist.tmp: NetBSD.dist.base ${EXTRA_DIST_FILES} 78 1.33 christos ${TOOL_CAT} ${.ALLSRC} > ${.TARGET} 79 1.1 mrg 80 1.33 christos NetBSD.dist.compat: NetBSD.dist.compat.in mkcompat.awk 81 1.25 matt ${MKCREATE} 82 1.33 christos ${TOOL_AWK} -f ${.ALLSRC:M*.awk} -v COMPATDIRS=${ARCHDIR_SUBDIR:T:Q} \ 83 1.33 christos ${.ALLSRC:M*.in} > ${.TARGET} 84 1.25 matt 85 1.33 christos NetBSD.dist.xcompat: NetBSD.dist.xcompat.in mkcompat.awk 86 1.26 matt ${MKCREATE} 87 1.33 christos ${TOOL_AWK} -f ${.ALLSRC:M*.awk} -v COMPATDIRS=${ARCHDIR_SUBDIR:T:Q} \ 88 1.33 christos ${.ALLSRC:M*.in} > ${.TARGET} 89 1.26 matt 90 1.33 christos NetBSD.dist.tests.compat: NetBSD.dist.tests mkcompattree.awk 91 1.25 matt ${MKCREATE} 92 1.36 matt ${TOOL_AWK} -f ${.ALLSRC:M*.awk} \ 93 1.25 matt -v COMPATDIRS=${ARCHDIR_SUBDIR:T:Q} -v S="usr/tests" \ 94 1.33 christos ${.ALLSRC:M*.tests} > ${.TARGET} 95 1.25 matt 96 1.5 lukem CONFIGFILES= NetBSD.dist special 97 1.1 mrg FILESDIR= /etc/mtree 98 1.1 mrg 99 1.6 mrg # distrib-dirs -- 100 1.6 mrg # Populate $DESTDIR with directories needed by NetBSD 101 1.6 mrg # 102 1.6 mrg .if ${MKUNPRIVED} == "no" 103 1.6 mrg TOOL_MTREE.unpriv= 104 1.6 mrg .else 105 1.6 mrg TOOL_MTREE.unpriv= -W 106 1.6 mrg .endif 107 1.6 mrg 108 1.17 dyoung # postinstall(8) invokes this target to produce the right 109 1.17 dyoung # /etc/mtree/NetBSD.dist content without duplicating logic from 110 1.17 dyoung # the Makefile. 111 1.17 dyoung # 112 1.33 christos emit_dist_file: NetBSD.dist.base ${EXTRA_DIST_FILES} 113 1.33 christos @cat ${.ALLSRC} 114 1.16 dyoung 115 1.10 drochner distrib-dirs: .PHONY check_DESTDIR NetBSD.dist 116 1.6 mrg .if !defined(DISTRIBUTION_DONE) # { 117 1.6 mrg # Create DESTDIR using HOST_INSTALL_DIR, not INSTALL_DIR, because 118 1.6 mrg # INSTALL_DIR would want to write to the metalog, and it can't do that 119 1.6 mrg # if the metalog is inside DESTDIR but DESTDIR doesn't yet exist. 120 1.6 mrg ${HOST_INSTALL_DIR} -m 755 ${DESTDIR} 121 1.20 jym # Invoke mtree to create the directories listed in NetBSD.dist; 122 1.6 mrg # then invoke mtree again to register those directories in the metalog. 123 1.6 mrg ${TOOL_MTREE} -def ${.OBJDIR}/NetBSD.dist -N ${.CURDIR}/.. \ 124 1.6 mrg -p ${DESTDIR}/ -U ${TOOL_MTREE.unpriv} 125 1.6 mrg .if ${MKUNPRIVED} != "no" # { 126 1.6 mrg ${TOOL_MTREE} -def ${.OBJDIR}/NetBSD.dist -N ${.CURDIR}/.. \ 127 1.6 mrg -p ${DESTDIR}/ -C -k all | \ 128 1.6 mrg ${TOOL_AWK} '/ optional/ {next} // {print}' | ${METALOG.add} 129 1.6 mrg .endif # MKUNPRIVED # } 130 1.6 mrg .endif # DISTRIBUTION_DONE # } 131 1.6 mrg 132 1.22 apb CLEANFILES+= NetBSD.dist NetBSD.dist.tmp 133 1.25 matt CLEANFILES+= NetBSD.dist.compat 134 1.25 matt CLEANFILES+= NetBSD.dist.tests.compat 135 1.10 drochner 136 1.1 mrg .include <bsd.prog.mk> 137