2010-04-27 07:01:25 +04:00
|
|
|
# $NetBSD: Makefile,v 1.17 2010/04/27 03:01:25 dyoung Exp $
|
2009-09-07 23:34:29 +04:00
|
|
|
|
|
|
|
.include <bsd.own.mk>
|
|
|
|
|
|
|
|
.if ${MKX11} != "no"
|
|
|
|
. if ${X11FLAVOUR} == "Xorg"
|
2009-12-12 04:32:10 +03:00
|
|
|
EXTRA_DIST_FILES= ${.CURDIR}/NetBSD.dist.Xorg
|
2009-09-07 23:34:29 +04:00
|
|
|
. else
|
2009-12-12 04:32:10 +03:00
|
|
|
EXTRA_DIST_FILES= ${.CURDIR}/NetBSD.dist.XFree86
|
2009-09-07 23:34:29 +04:00
|
|
|
. endif
|
|
|
|
.endif
|
|
|
|
|
2009-12-13 04:02:25 +03:00
|
|
|
.if exists(NetBSD.dist.${MACHINE_ARCH})
|
|
|
|
EXTRA_DIST_FILES+= ${.CURDIR}/NetBSD.dist.${MACHINE_ARCH}
|
|
|
|
.endif
|
|
|
|
|
2009-11-30 19:13:22 +03:00
|
|
|
.if ${MKEXTSRC} != "no"
|
2009-12-12 04:32:10 +03:00
|
|
|
EXTRA_DIST_FILES+= ${.CURDIR}/NetBSD.dist.extsrc
|
2009-11-30 19:13:22 +03:00
|
|
|
.endif
|
|
|
|
|
2009-12-18 07:12:36 +03:00
|
|
|
NetBSD.dist: NetBSD.dist.tmp
|
|
|
|
cmp -s NetBSD.dist.tmp NetBSD.dist || { \
|
|
|
|
echo "Updating NetBSD.dist"; \
|
|
|
|
mv NetBSD.dist.tmp NetBSD.dist; \
|
|
|
|
}
|
|
|
|
NetBSD.dist.tmp::
|
2009-12-12 04:32:10 +03:00
|
|
|
${TOOL_CAT} ${.CURDIR}/NetBSD.dist.base ${EXTRA_DIST_FILES} > \
|
2009-11-02 13:23:40 +03:00
|
|
|
${.TARGET}
|
1997-12-02 09:52:14 +03:00
|
|
|
|
2004-05-16 13:53:09 +04:00
|
|
|
CONFIGFILES= NetBSD.dist special
|
1997-12-02 09:52:14 +03:00
|
|
|
FILESDIR= /etc/mtree
|
|
|
|
|
2009-09-07 23:34:29 +04:00
|
|
|
# distrib-dirs --
|
|
|
|
# Populate $DESTDIR with directories needed by NetBSD
|
|
|
|
#
|
|
|
|
.if ${MKUNPRIVED} == "no"
|
|
|
|
TOOL_MTREE.unpriv=
|
|
|
|
.else
|
|
|
|
TOOL_MTREE.unpriv= -W
|
|
|
|
.endif
|
|
|
|
|
2010-04-27 07:01:25 +04:00
|
|
|
# postinstall(8) invokes this target to produce the right
|
|
|
|
# /etc/mtree/NetBSD.dist content without duplicating logic from
|
|
|
|
# the Makefile.
|
|
|
|
#
|
2010-04-23 23:21:08 +04:00
|
|
|
emit_dist_file:
|
2010-04-27 07:01:25 +04:00
|
|
|
cat ${.CURDIR}/NetBSD.dist.base ${EXTRA_DIST_FILES}
|
2010-04-23 23:21:08 +04:00
|
|
|
|
2009-11-19 22:57:40 +03:00
|
|
|
distrib-dirs: .PHONY check_DESTDIR NetBSD.dist
|
2009-09-07 23:34:29 +04:00
|
|
|
.if !defined(DISTRIBUTION_DONE) # {
|
|
|
|
# Create DESTDIR using HOST_INSTALL_DIR, not INSTALL_DIR, because
|
|
|
|
# INSTALL_DIR would want to write to the metalog, and it can't do that
|
|
|
|
# if the metalog is inside DESTDIR but DESTDIR doesn't yet exist.
|
|
|
|
${HOST_INSTALL_DIR} -m 755 ${DESTDIR}
|
|
|
|
# Inkoke mtree to create the directories listed in NetBSD.dist;
|
|
|
|
# then invoke mtree again to register those directories in the metalog.
|
|
|
|
${TOOL_MTREE} -def ${.OBJDIR}/NetBSD.dist -N ${.CURDIR}/.. \
|
|
|
|
-p ${DESTDIR}/ -U ${TOOL_MTREE.unpriv}
|
|
|
|
.if ${MKUNPRIVED} != "no" # {
|
|
|
|
${TOOL_MTREE} -def ${.OBJDIR}/NetBSD.dist -N ${.CURDIR}/.. \
|
|
|
|
-p ${DESTDIR}/ -C -k all | \
|
|
|
|
${TOOL_AWK} '/ optional/ {next} // {print}' | ${METALOG.add}
|
|
|
|
.endif # MKUNPRIVED # }
|
|
|
|
.endif # DISTRIBUTION_DONE # }
|
|
|
|
|
2010-01-18 13:25:29 +03:00
|
|
|
CLEANFILES+= NetBSD.dist NetBSD.dist.tmp
|
2009-11-19 22:57:40 +03:00
|
|
|
|
1997-12-02 09:52:14 +03:00
|
|
|
.include <bsd.prog.mk>
|