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