Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/distrib/common move default PARSELISTENV and related goop in...



details:   https://anonhg.NetBSD.org/src/rev/87616f88b605
branches:  trunk
changeset: 525469:87616f88b605
user:      lukem <lukem%NetBSD.org@localhost>
date:      Fri Apr 12 01:59:45 2002 +0000

description:
move default PARSELISTENV and related goop into separate Makefile.parselist,
and add DISTRIBDIR to PARSELISTENV.

diffstat:

 distrib/common/Makefile.crunch    |  17 ++++-------------
 distrib/common/Makefile.image     |  23 +++++++----------------
 distrib/common/Makefile.parselist |  26 ++++++++++++++++++++++++++
 3 files changed, 37 insertions(+), 29 deletions(-)

diffs (120 lines):

diff -r 6e4393889eba -r 87616f88b605 distrib/common/Makefile.crunch
--- a/distrib/common/Makefile.crunch    Fri Apr 12 01:15:14 2002 +0000
+++ b/distrib/common/Makefile.crunch    Fri Apr 12 01:59:45 2002 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile.crunch,v 1.6 2002/04/02 05:36:23 lukem Exp $
+#      $NetBSD: Makefile.crunch,v 1.7 2002/04/12 01:59:45 lukem Exp $
 #
 # Makefile snippet to build a crunchgen(1)ed binary from the provided lists
 #
@@ -15,15 +15,7 @@
 #      PARSELISTENV    environment variables to set for parselist.awk
 #
 
-PARSELISTENV+= _SRC_TOP_=${_SRC_TOP_:Q} \
-               CRUNCHBIN=${CRUNCHBIN:Q} \
-               CURDIR=${.CURDIR:Q} \
-               DESTDIR=${DESTDIR:Q} \
-               MACHINE=${MACHINE:Q} \
-               MACHINE_ARCH=${MACHINE_ARCH:Q} \
-               OBJDIR=${.OBJDIR:Q}
-
-_PARSELIST=    ${_SRC_TOP_}/distrib/common/parselist.awk
+.include "${DISTRIBDIR}/common/Makefile.parselist"
 
 ${CRUNCHBIN}: ${CRUNCHBIN}.mk ${CRUNCHBIN}.cache ${CRUNCHBIN}.c
        env SMALLPROG=1 ${MAKE} -f ${CRUNCHBIN}.mk all
@@ -33,10 +25,9 @@
            ${CRUNCHGEN} -f -D ${_SRC_TOP_} -L ${DESTDIR}/usr/lib \
                        ${CRUNCHGEN_FLAGS} ${.ALLSRC}
 
-${CRUNCHBIN}.conf: ${LISTS} ${_PARSELIST}
+${CRUNCHBIN}.conf: ${LISTS} ${PARSELISTDEP}
        -rm -f ${.TARGET} ${.TARGET}.tmp
-       ${PARSELISTENV} awk -f ${_PARSELIST} -v mode=crunch \
-           ${LISTS} > ${.TARGET}.tmp \
+       ${PARSELIST} -v mode=crunch ${LISTS} > ${.TARGET}.tmp \
        && mv ${.TARGET}.tmp ${.TARGET}
 
 CLEANFILES+=   ${CRUNCHBIN} ${CRUNCHBIN}.conf ${CRUNCHBIN}.conf.tmp \
diff -r 6e4393889eba -r 87616f88b605 distrib/common/Makefile.image
--- a/distrib/common/Makefile.image     Fri Apr 12 01:15:14 2002 +0000
+++ b/distrib/common/Makefile.image     Fri Apr 12 01:59:45 2002 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile.image,v 1.6 2002/03/14 22:26:09 lukem Exp $
+#      $NetBSD: Makefile.image,v 1.7 2002/04/12 01:59:45 lukem Exp $
 #
 # Makefile snippet to build a tree from the provided lists,
 # and make an ffs file system image from that tree
@@ -26,35 +26,26 @@
 WORKSPEC?=     work.spec
 WORKBUILT?=    work.built
 
-PARSELISTENV+= _SRC_TOP_=${_SRC_TOP_:Q} \
-               CRUNCHBIN=${CRUNCHBIN:Q} \
-               CURDIR=${.CURDIR:Q} \
-               DESTDIR=${DESTDIR:Q} \
-               MACHINE=${MACHINE:Q} \
-               MACHINE_ARCH=${MACHINE_ARCH:Q} \
-               OBJDIR=${.OBJDIR:Q} \
-               TARGETDIR=${.OBJDIR}/${WORKDIR:Q}
+.include "${DISTRIBDIR}/common/Makefile.parselist"
 
-_PARSELIST=    ${_SRC_TOP_}/distrib/common/parselist.awk
+PARSELISTENV+= TARGETDIR=${.OBJDIR}/${WORKDIR:Q}
 
 
-${WORKBUILT}: ${IMAGEDEPENDS} ${WORKSPEC} ${_PARSELIST} ${LISTS}
+${WORKBUILT}: ${IMAGEDEPENDS} ${WORKSPEC} ${PARSELISTDEP} ${LISTS}
        @echo "Building tree into ${WORKDIR}"
        -rm -rf ${WORKDIR} ${WORKBUILT}
        mkdir -m 755 ${WORKDIR}
        ${MTREE} -def ${WORKSPEC} -p ${WORKDIR}/ -UW
-       ${PARSELISTENV} awk -f ${_PARSELIST} -v mode=populate \
-           ${LISTS} | sh -e ${POPULATE_DEBUG} \
+       ${PARSELIST} -v mode=populate ${LISTS} | sh -e ${POPULATE_DEBUG} \
        && touch ${WORKBUILT}
 
-${WORKSPEC}: ${MTREECONF} ${LISTS} ${_PARSELIST}
+${WORKSPEC}: ${MTREECONF} ${LISTS} ${PARSELISTDEP}
        -rm -f ${.TARGET} ${.TARGET}.tmp
        ( for i in ${MTREECONF}; do     \
                cat $$i ;               \
                echo "/unset all" ;     \
        done ) >> ${.TARGET}.tmp
-       ${PARSELISTENV} awk -f ${_PARSELIST} -v mode=mtree \
-           ${LISTS} >> ${.TARGET}.tmp \
+       ${PARSELIST} -v mode=mtree ${LISTS} >> ${.TARGET}.tmp \
        && mv ${.TARGET}.tmp ${.TARGET}
 
 ${IMAGE}: ${WORKBUILT} ${WORKSPEC} ${IMAGEDEPENDS}
diff -r 6e4393889eba -r 87616f88b605 distrib/common/Makefile.parselist
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/distrib/common/Makefile.parselist Fri Apr 12 01:59:45 2002 +0000
@@ -0,0 +1,26 @@
+#      $NetBSD: Makefile.parselist,v 1.1 2002/04/12 01:59:45 lukem Exp $
+#
+# Makefile snippet to setup parselist.awk related variables:
+#      PARSELISTENV    environment variables to pass to parselist.awk
+#                      (may be appended to by caller)
+#      PARSELISTDEP    dependency on parselist.awk
+#      PARSELIST       run  ${PARSELISTENV} awk -f ${PARSELISTDEP}
+#
+
+.if !defined(_PARSELIST_MK_)
+_PARSELIST_MK_=1
+
+
+PARSELISTENV+= _SRC_TOP_=${_SRC_TOP_:Q} \
+               CRUNCHBIN=${CRUNCHBIN:Q} \
+               CURDIR=${.CURDIR:Q} \
+               DESTDIR=${DESTDIR:Q} \
+               DISTRIBDIR=${DISTRIBDIR:Q} \
+               MACHINE=${MACHINE:Q} \
+               MACHINE_ARCH=${MACHINE_ARCH:Q} \
+               OBJDIR=${.OBJDIR:Q}
+
+PARSELISTDEP=  ${DISTRIBDIR}/common/parselist.awk
+PARSELIST=     ${PARSELISTENV} awk -f ${PARSELISTDEP}
+
+.endif # _PARSELIST_MK_



Home | Main Index | Thread Index | Old Index