Expand PMF_FN_* macros.
[netbsd-mini2440.git] / etc / mtree / Makefile
blobcf1ad434b84e654ad60e3f1a3355aef95114be98
1 # $NetBSD$
3 .include <bsd.own.mk>
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
13 .if exists(NetBSD.dist.${MACHINE_ARCH})
14 EXTRA_DIST_FILES+= ${.CURDIR}/NetBSD.dist.${MACHINE_ARCH}
15 .endif
17 .if ${MKEXTSRC} != "no"
18 EXTRA_DIST_FILES+= ${.CURDIR}/NetBSD.dist.extsrc
19 .endif
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; \
26 NetBSD.dist.tmp::
27 ${TOOL_CAT} ${.CURDIR}/NetBSD.dist.base ${EXTRA_DIST_FILES} > \
28 ${.TARGET}
30 CONFIGFILES= NetBSD.dist special
31 FILESDIR= /etc/mtree
33 # distrib-dirs --
34 # Populate $DESTDIR with directories needed by NetBSD
36 .if ${MKUNPRIVED} == "no"
37 TOOL_MTREE.unpriv=
38 .else
39 TOOL_MTREE.unpriv= -W
40 .endif
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 # }
59 CLEANFILES+= NetBSD.dist
61 .include <bsd.prog.mk>