Home | History | Annotate | Line # | Download | only in mtree
Makefile revision 1.26
      1  1.26      matt #	$NetBSD: Makefile,v 1.26 2015/06/24 22:20:25 matt 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.6       mrg . if ${X11FLAVOUR} == "Xorg"
      7  1.12       mrg EXTRA_DIST_FILES=	${.CURDIR}/NetBSD.dist.Xorg
      8   1.6       mrg . else
      9  1.12       mrg EXTRA_DIST_FILES=	${.CURDIR}/NetBSD.dist.XFree86
     10   1.6       mrg . endif
     11   1.6       mrg .endif
     12   1.6       mrg 
     13  1.19       mrg # XXX these are only used by compat currently, but they could be used
     14  1.19       mrg # by something else; this may need to be fixed properly in the future.
     15  1.19       mrg .if ${MKCOMPAT} != "no"
     16  1.25      matt .include "${NETBSDSRCDIR}/compat/archdirs.mk"
     17  1.13       mrg .if exists(NetBSD.dist.${MACHINE_ARCH})
     18  1.13       mrg EXTRA_DIST_FILES+=	${.CURDIR}/NetBSD.dist.${MACHINE_ARCH}
     19  1.23      matt .elif !empty(MACHINE_ARCH:Mearm*)
     20  1.23      matt EXTRA_DIST_FILES+=	${.CURDIR}/NetBSD.dist.earm
     21  1.13       mrg .endif
     22  1.25      matt EXTRA_DIST_FILES+=	NetBSD.dist.compat	# autogenerated
     23  1.26      matt .if ${MKX11} != no && ${X11FLAVOUR} == "Xorg"
     24  1.26      matt EXTRA_DIST_FILES+=	NetBSD.dist.xcompat	# autogenerated
     25  1.26      matt .endif
     26  1.19       mrg .endif
     27  1.13       mrg 
     28  1.18     njoly .if ${MKATF} != "no"
     29  1.18     njoly EXTRA_DIST_FILES+=	${.CURDIR}/NetBSD.dist.tests
     30  1.25      matt .if ${MKCOMPATTESTS} != "no"
     31  1.25      matt EXTRA_DIST_FILES+=	NetBSD.dist.tests.compat
     32  1.25      matt .endif
     33  1.18     njoly .endif
     34  1.18     njoly 
     35  1.11  uebayasi .if ${MKEXTSRC} != "no"
     36  1.12       mrg EXTRA_DIST_FILES+=	${.CURDIR}/NetBSD.dist.extsrc
     37  1.11  uebayasi .endif
     38  1.11  uebayasi 
     39  1.22       apb NetBSD.dist:	NetBSD.dist.tmp
     40  1.22       apb 	cmp -s NetBSD.dist.tmp NetBSD.dist || { \
     41  1.14  uebayasi 		echo "Updating NetBSD.dist"; \
     42  1.22       apb 		mv NetBSD.dist.tmp NetBSD.dist; \
     43  1.14  uebayasi 	}
     44  1.25      matt NetBSD.dist.tmp:: ${.CURDIR}/NetBSD.dist.base ${EXTRA_DIST_FILES}
     45  1.12       mrg 	${TOOL_CAT} ${.CURDIR}/NetBSD.dist.base ${EXTRA_DIST_FILES} > \
     46   1.9  stacktic 	    ${.TARGET}
     47   1.1       mrg 
     48  1.25      matt NetBSD.dist.compat: ${.CURDIR}/NetBSD.dist.compat.in ${.CURDIR}/mkcompat.awk
     49  1.25      matt 	${MKCREATE}
     50  1.25      matt 	${TOOL_AWK} -f ${.CURDIR}/mkcompat.awk \
     51  1.25      matt 	    -v COMPATDIRS=${ARCHDIR_SUBDIR:T:Q} \
     52  1.25      matt 		${.CURDIR}/NetBSD.dist.compat.in \
     53  1.25      matt 	     > ${.TARGET}
     54  1.25      matt 
     55  1.26      matt NetBSD.dist.xcompat: ${.CURDIR}/NetBSD.dist.xcompat.in ${.CURDIR}/mkcompat.awk
     56  1.26      matt 	${MKCREATE}
     57  1.26      matt 	${TOOL_AWK} -f ${.CURDIR}/mkcompat.awk \
     58  1.26      matt 	    -v COMPATDIRS=${ARCHDIR_SUBDIR:T:Q} \
     59  1.26      matt 		${.CURDIR}/NetBSD.dist.xcompat.in \
     60  1.26      matt 	     > ${.TARGET}
     61  1.26      matt 
     62  1.25      matt NetBSD.dist.tests.compat: ${.CURDIR}/NetBSD.dist.tests \
     63  1.25      matt 		${.CURDIR}/mkcompattree.awk 
     64  1.25      matt 	${MKCREATE}
     65  1.25      matt 	${TOOL_AWK} -f ${.CURDIR}/mkcompattree.awk \
     66  1.25      matt 	    -v COMPATDIRS=${ARCHDIR_SUBDIR:T:Q} -v S="usr/tests" \
     67  1.25      matt 		${.CURDIR}/NetBSD.dist.tests \
     68  1.25      matt 	     > ${.TARGET}
     69  1.25      matt 
     70   1.5     lukem CONFIGFILES=	NetBSD.dist special
     71   1.1       mrg FILESDIR=	/etc/mtree
     72   1.1       mrg 
     73   1.6       mrg # distrib-dirs --
     74   1.6       mrg #	Populate $DESTDIR with directories needed by NetBSD
     75   1.6       mrg #
     76   1.6       mrg .if ${MKUNPRIVED} == "no"
     77   1.6       mrg TOOL_MTREE.unpriv=
     78   1.6       mrg .else
     79   1.6       mrg TOOL_MTREE.unpriv=	-W
     80   1.6       mrg .endif
     81   1.6       mrg 
     82  1.17    dyoung # postinstall(8) invokes this target to produce the right
     83  1.17    dyoung # /etc/mtree/NetBSD.dist content without duplicating logic from
     84  1.17    dyoung # the Makefile.
     85  1.17    dyoung #
     86  1.16    dyoung emit_dist_file:
     87  1.24  christos 	@cat ${.CURDIR}/NetBSD.dist.base ${EXTRA_DIST_FILES}
     88  1.16    dyoung 
     89  1.10  drochner distrib-dirs: .PHONY check_DESTDIR NetBSD.dist
     90   1.6       mrg .if !defined(DISTRIBUTION_DONE)						# {
     91   1.6       mrg # Create DESTDIR using HOST_INSTALL_DIR, not INSTALL_DIR, because
     92   1.6       mrg # INSTALL_DIR would want to write to the metalog, and it can't do that
     93   1.6       mrg # if the metalog is inside DESTDIR but DESTDIR doesn't yet exist.
     94   1.6       mrg 	${HOST_INSTALL_DIR} -m 755 ${DESTDIR}
     95  1.20       jym # Invoke mtree to create the directories listed in NetBSD.dist;
     96   1.6       mrg # then invoke mtree again to register those directories in the metalog.
     97   1.6       mrg 	${TOOL_MTREE} -def ${.OBJDIR}/NetBSD.dist -N ${.CURDIR}/.. \
     98   1.6       mrg 	    -p ${DESTDIR}/ -U ${TOOL_MTREE.unpriv}
     99   1.6       mrg .if ${MKUNPRIVED} != "no"						# {
    100   1.6       mrg 	${TOOL_MTREE} -def ${.OBJDIR}/NetBSD.dist -N ${.CURDIR}/.. \
    101   1.6       mrg 	    -p ${DESTDIR}/ -C -k all | \
    102   1.6       mrg 	    ${TOOL_AWK} '/ optional/ {next} // {print}' | ${METALOG.add}
    103   1.6       mrg .endif	# MKUNPRIVED							# }
    104   1.6       mrg .endif	# DISTRIBUTION_DONE						# }
    105   1.6       mrg 
    106  1.22       apb CLEANFILES+=	NetBSD.dist NetBSD.dist.tmp
    107  1.25      matt CLEANFILES+=	NetBSD.dist.compat
    108  1.25      matt CLEANFILES+=	NetBSD.dist.tests.compat
    109  1.10  drochner 
    110   1.1       mrg .include <bsd.prog.mk>
    111