1 # $NetBSD: Makefile,v 1.14 2009/12/18 04:12:36 uebayasi 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 distrib-dirs: .PHONY check_DESTDIR NetBSD.dist 43 .if !defined(DISTRIBUTION_DONE) # { 44 # Create DESTDIR using HOST_INSTALL_DIR, not INSTALL_DIR, because 45 # INSTALL_DIR would want to write to the metalog, and it can't do that 46 # if the metalog is inside DESTDIR but DESTDIR doesn't yet exist. 47 ${HOST_INSTALL_DIR} -m 755 ${DESTDIR} 48 # Inkoke mtree to create the directories listed in NetBSD.dist; 49 # then invoke mtree again to register those directories in the metalog. 50 ${TOOL_MTREE} -def ${.OBJDIR}/NetBSD.dist -N ${.CURDIR}/.. \ 51 -p ${DESTDIR}/ -U ${TOOL_MTREE.unpriv} 52 .if ${MKUNPRIVED} != "no" # { 53 ${TOOL_MTREE} -def ${.OBJDIR}/NetBSD.dist -N ${.CURDIR}/.. \ 54 -p ${DESTDIR}/ -C -k all | \ 55 ${TOOL_AWK} '/ optional/ {next} // {print}' | ${METALOG.add} 56 .endif # MKUNPRIVED # } 57 .endif # DISTRIBUTION_DONE # } 58 59 CLEANFILES+= NetBSD.dist 60 61 .include <bsd.prog.mk> 62