Source-Changes-HG archive

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

[src/trunk]: src/tools/gcc use make -C path/to -f Makefile instead of make -f...



details:   https://anonhg.NetBSD.org/src/rev/07956fe7fee5
branches:  trunk
changeset: 357813:07956fe7fee5
user:      christos <christos%NetBSD.org@localhost>
date:      Tue Nov 28 22:05:57 2017 +0000

description:
use make -C path/to -f Makefile instead of make -f path/to/Makefile
so that includes with relative paths work.

diffstat:

 tools/gcc/mknative.common |  12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)

diffs (42 lines):

diff -r 5827c60f816d -r 07956fe7fee5 tools/gcc/mknative.common
--- a/tools/gcc/mknative.common Tue Nov 28 22:04:52 2017 +0000
+++ b/tools/gcc/mknative.common Tue Nov 28 22:05:57 2017 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: mknative.common,v 1.11 2014/02/17 21:39:43 christos Exp $
+#      $NetBSD: mknative.common,v 1.12 2017/11/28 22:05:57 christos Exp $
 #
 # from: NetBSD: mknative,v 1.12 2003/03/05 06:17:17 mrg Exp
 #
@@ -21,10 +21,12 @@
 #
 getvars()
 {
-       _mf="$1"; shift
+       _mfp="$1"; shift
        case "$MAKE" in
        *gmake)
-       env MAKEFLAGS= $MAKE --quiet -f - -f "$_TMPDIR/$_mf" _x_ <<EOF || bomb "getvars $_mf $* failed"
+       _dir=$(dirname "$_TMPDIR/$_mfp")
+       _mf=$(basename "$_TMPDIR/$_mfp")
+       env MAKEFLAGS= $MAKE -C "$_dir" --quiet -f - -f "$_mf" _x_ <<EOF || bomb "getvars $_mf $* failed"
 define echo_var
        @echo G_\${var}="\${\${var}}" | sed -e 's,\([^\.]\)\./\([a-zA-Z0-9_-]*\.o\),\1\2,g' -e 's,$_VPATH,\$\${GNUHOSTDIST},g' -e 's,$_GNU_DIST,\$\${GNUHOSTDIST},g'
 
@@ -62,7 +64,7 @@
        echo '/* This file is automatically generated.  DO NOT EDIT! */' >$_TOP/$1.tmp || \
                bomb "cannot create $1"
        grep '$''NetBSD' $0 | sed 's,[  #$],,g;s,.*,/* Generated from: & */,' >>$_TOP/$1.tmp
-       echo '$NetBSD: mknative.common,v 1.11 2014/02/17 21:39:43 christos Exp $' | sed 's,[#$],,g;s,.*,/* Generated from: & */,' >>$_TOP/$1.tmp
+       echo '$NetBSD: mknative.common,v 1.12 2017/11/28 22:05:57 christos Exp $' | sed 's,[#$],,g;s,.*,/* Generated from: & */,' >>$_TOP/$1.tmp
        echo '' >>$_TOP/$1.tmp
        writefile $1
 }
@@ -74,7 +76,7 @@
        echo '# This file is automatically generated.  DO NOT EDIT!' >$_TOP/$1.tmp || \
                bomb "cannot create $1"
        grep '$''NetBSD' $0 | sed 's,[  #$],,g;s,.*,# Generated from: &,' >>$_TOP/$1.tmp
-       echo '$NetBSD: mknative.common,v 1.11 2014/02/17 21:39:43 christos Exp $' | sed 's,[#$],,g;s,.*,# Generated from: &,' >>$_TOP/$1.tmp
+       echo '$NetBSD: mknative.common,v 1.12 2017/11/28 22:05:57 christos Exp $' | sed 's,[#$],,g;s,.*,# Generated from: &,' >>$_TOP/$1.tmp
        echo '#' >>$_TOP/$1.tmp
        writefile $1
 }



Home | Main Index | Thread Index | Old Index