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