1 # $NetBSD: Makefile,v 1.16 2010/04/23 19:21:08 dyoung Exp $ 2 3 .include <bsd.own.mk> 4 5 .if ${MKX11} != "no" 6 . if ${X11FLAVOUR} == "Xorg" 7 EXTRA_DIST_FILES= ${.CURDIR}/NetBSD.dist.Xorg 8 . else 9 EXTRA_DIST_FILES= ${.CURDIR}/NetBSD.dist.XFree86 10 . endif 11 .endif 12 13 .if exists(NetBSD.dist.${MACHINE_ARCH}) 14 EXTRA_DIST_FILES+= ${.CURDIR}/NetBSD.dist.${MACHINE_ARCH} 15 .endif 16 17 .if ${MKEXTSRC} != "no" 18 EXTRA_DIST_FILES+= ${.CURDIR}/NetBSD.dist.extsrc 19 .endif 20 21 NetBSD.dist: NetBSD.dist.tmp 22 cmp -s NetBSD.dist.tmp NetBSD.dist || { \ 23 echo "Updating NetBSD.dist"; \ 24 mv NetBSD.dist.tmp NetBSD.dist; \ 25 } 26 NetBSD.dist.tmp:: 27 ${TOOL_CAT} ${.CURDIR}/NetBSD.dist.base ${EXTRA_DIST_FILES} > \ 28 ${.TARGET} 29 30 CONFIGFILES= NetBSD.dist special 31 FILESDIR= /etc/mtree 32 33 # distrib-dirs -- 34 # Populate $DESTDIR with directories needed by NetBSD 35 # 36 .if ${MKUNPRIVED} == "no" 37 TOOL_MTREE.unpriv= 38 .else 39 TOOL_MTREE.unpriv= -W 40 .endif 41 42 emit_dist_file: 43 ${TOOL_CAT} ${.CURDIR}/NetBSD.dist.base ${EXTRA_DIST_FILES} 44 45 distrib-dirs: .PHONY check_DESTDIR NetBSD.dist 46 .if !defined(DISTRIBUTION_DONE) # { 47 # Create DESTDIR using HOST_INSTALL_DIR, not INSTALL_DIR, because 48 # INSTALL_DIR would want to write to the metalog, and it can't do that 49 # if the metalog is inside DESTDIR but DESTDIR doesn't yet exist. 50 ${HOST_INSTALL_DIR} -m 755 ${DESTDIR} 51 # Inkoke mtree to create the directories listed in NetBSD.dist; 52 # then invoke mtree again to register those directories in the metalog. 53 ${TOOL_MTREE} -def ${.OBJDIR}/NetBSD.dist -N ${.CURDIR}/.. \ 54 -p ${DESTDIR}/ -U ${TOOL_MTREE.unpriv} 55 .if ${MKUNPRIVED} != "no" # { 56 ${TOOL_MTREE} -def ${.OBJDIR}/NetBSD.dist -N ${.CURDIR}/.. \ 57 -p ${DESTDIR}/ -C -k all | \ 58 ${TOOL_AWK} '/ optional/ {next} // {print}' | ${METALOG.add} 59 .endif # MKUNPRIVED # } 60 .endif # DISTRIBUTION_DONE # } 61 62 CLEANFILES+= NetBSD.dist NetBSD.dist.tmp 63 64 .include <bsd.prog.mk> 65