Makefile revision 1.24
11.24Schristos#	$NetBSD: Makefile,v 1.24 2013/10/16 14:50:43 christos Exp $
21.6Smrg
31.6Smrg.include <bsd.own.mk>
41.6Smrg
51.6Smrg.if ${MKX11} != "no"
61.6Smrg. if ${X11FLAVOUR} == "Xorg"
71.12SmrgEXTRA_DIST_FILES=	${.CURDIR}/NetBSD.dist.Xorg
81.6Smrg. else
91.12SmrgEXTRA_DIST_FILES=	${.CURDIR}/NetBSD.dist.XFree86
101.6Smrg. endif
111.6Smrg.endif
121.6Smrg
131.19Smrg# XXX these are only used by compat currently, but they could be used
141.19Smrg# by something else; this may need to be fixed properly in the future.
151.19Smrg.if ${MKCOMPAT} != "no"
161.13Smrg.if exists(NetBSD.dist.${MACHINE_ARCH})
171.13SmrgEXTRA_DIST_FILES+=	${.CURDIR}/NetBSD.dist.${MACHINE_ARCH}
181.23Smatt.elif !empty(MACHINE_ARCH:Mearm*)
191.23SmattEXTRA_DIST_FILES+=	${.CURDIR}/NetBSD.dist.earm
201.13Smrg.endif
211.19Smrg.endif
221.13Smrg
231.18Snjoly.if ${MKATF} != "no"
241.18SnjolyEXTRA_DIST_FILES+=	${.CURDIR}/NetBSD.dist.tests
251.18Snjoly.endif
261.18Snjoly
271.11Suebayasi.if ${MKEXTSRC} != "no"
281.12SmrgEXTRA_DIST_FILES+=	${.CURDIR}/NetBSD.dist.extsrc
291.11Suebayasi.endif
301.11Suebayasi
311.22SapbNetBSD.dist:	NetBSD.dist.tmp
321.22Sapb	cmp -s NetBSD.dist.tmp NetBSD.dist || { \
331.14Suebayasi		echo "Updating NetBSD.dist"; \
341.22Sapb		mv NetBSD.dist.tmp NetBSD.dist; \
351.14Suebayasi	}
361.22SapbNetBSD.dist.tmp::
371.12Smrg	${TOOL_CAT} ${.CURDIR}/NetBSD.dist.base ${EXTRA_DIST_FILES} > \
381.9Sstacktic	    ${.TARGET}
391.1Smrg
401.5SlukemCONFIGFILES=	NetBSD.dist special
411.1SmrgFILESDIR=	/etc/mtree
421.1Smrg
431.6Smrg# distrib-dirs --
441.6Smrg#	Populate $DESTDIR with directories needed by NetBSD
451.6Smrg#
461.6Smrg.if ${MKUNPRIVED} == "no"
471.6SmrgTOOL_MTREE.unpriv=
481.6Smrg.else
491.6SmrgTOOL_MTREE.unpriv=	-W
501.6Smrg.endif
511.6Smrg
521.17Sdyoung# postinstall(8) invokes this target to produce the right
531.17Sdyoung# /etc/mtree/NetBSD.dist content without duplicating logic from
541.17Sdyoung# the Makefile.
551.17Sdyoung#
561.16Sdyoungemit_dist_file:
571.24Schristos	@cat ${.CURDIR}/NetBSD.dist.base ${EXTRA_DIST_FILES}
581.16Sdyoung
591.10Sdrochnerdistrib-dirs: .PHONY check_DESTDIR NetBSD.dist
601.6Smrg.if !defined(DISTRIBUTION_DONE)						# {
611.6Smrg# Create DESTDIR using HOST_INSTALL_DIR, not INSTALL_DIR, because
621.6Smrg# INSTALL_DIR would want to write to the metalog, and it can't do that
631.6Smrg# if the metalog is inside DESTDIR but DESTDIR doesn't yet exist.
641.6Smrg	${HOST_INSTALL_DIR} -m 755 ${DESTDIR}
651.20Sjym# Invoke mtree to create the directories listed in NetBSD.dist;
661.6Smrg# then invoke mtree again to register those directories in the metalog.
671.6Smrg	${TOOL_MTREE} -def ${.OBJDIR}/NetBSD.dist -N ${.CURDIR}/.. \
681.6Smrg	    -p ${DESTDIR}/ -U ${TOOL_MTREE.unpriv}
691.6Smrg.if ${MKUNPRIVED} != "no"						# {
701.6Smrg	${TOOL_MTREE} -def ${.OBJDIR}/NetBSD.dist -N ${.CURDIR}/.. \
711.6Smrg	    -p ${DESTDIR}/ -C -k all | \
721.6Smrg	    ${TOOL_AWK} '/ optional/ {next} // {print}' | ${METALOG.add}
731.6Smrg.endif	# MKUNPRIVED							# }
741.6Smrg.endif	# DISTRIBUTION_DONE						# }
751.6Smrg
761.22SapbCLEANFILES+=	NetBSD.dist NetBSD.dist.tmp
771.10Sdrochner
781.1Smrg.include <bsd.prog.mk>
79