summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpsmith <>2011-09-12 05:29:58 +0000
committerpsmith <>2011-09-12 05:29:58 +0000
commit0f6e87f12bcc73af2a22331e656268b9afe91468 (patch)
tree6ff69b5ccbf663a0d7784e982104415dd1233329
parent6fd575f266838f7ac6e910e8a7154b9923999c92 (diff)
downloadmake-0f6e87f12bcc73af2a22331e656268b9afe91468.tar.gz
Ensure variables defined in $(call ...) have global scope
Add a note about using #!/usr/bin/make -f to the manual. Clean up the w32 subdirectory in the dist tarball.
-rw-r--r--ChangeLog13
-rw-r--r--Makefile.am2
-rw-r--r--doc/make.texi6
-rw-r--r--read.c2
-rw-r--r--tests/ChangeLog5
-rw-r--r--tests/scripts/functions/call11
6 files changed, 35 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 34411cf4..53ea4816 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2011-09-12 Paul Smith <psmith@gnu.org>
+
+ * read.c (eval): Ensure exported variables are defined in the
+ global scope. Fixes Savannah bug #32498.
+
+2011-09-11 Paul Smith <psmith@gnu.org>
+
+ * Makefile.am (dist-hook): Remove w32/Makefile and .deps/ from the
+ dist file. Fixes Savannah bug #31489.
+
+ * doc/make.texi (Complex Makefile): Add a hint about using
+ #!/usr/bin/make (for Savannah support request #106459)
+
2011-09-02 Paul Smith <psmith@gnu.org>
* remake.c (touch_file): If we have both -n and -t, -n takes
diff --git a/Makefile.am b/Makefile.am
index 92acdc28..c747ada9 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -129,7 +129,7 @@ install-exec-local:
#
dist-hook:
(cd $(srcdir); \
- sub=`find w32 tests -follow \( -name CVS -prune -o -name .cvsignore -o -name work -prune \) -o \( -name \*.orig -o -name \*.rej -o -name \*~ -prune \) -o -type f -print`; \
+ sub=`find w32 tests -follow \( -name CVS -o -name .deps -o -name work -o -name .cvsignore -o -name \*.orig -o -name \*.rej -o -name \*~ -o -name Makefile \) -prune -o -type f -print`; \
tar chf - $$sub) \
| (cd $(distdir); tar xfBp -)
diff --git a/doc/make.texi b/doc/make.texi
index c1ffb073..edd8f620 100644
--- a/doc/make.texi
+++ b/doc/make.texi
@@ -4,7 +4,7 @@
@include version.texi
@set EDITION 0.71
-@set RCSID $Id: make.texi,v 1.72 2011/05/02 15:11:23 psmith Exp $
+@set RCSID $Id: make.texi,v 1.73 2011/09/12 05:29:59 psmith Exp $
@settitle GNU @code{make}
@setchapternewpage odd
@@ -11246,7 +11246,8 @@ sequential manner.
@appendix Complex Makefile Example
Here is the makefile for the GNU @code{tar} program. This is a
-moderately complex makefile.
+moderately complex makefile. The first line uses a @code{#!} setting
+to allow the makefile to be executed directly.
Because it is the first target, the default goal is @samp{all}. An
interesting feature of this makefile is that @file{testpad.h} is a
@@ -11282,6 +11283,7 @@ distribution kits.
@example
@group
+#!/usr/bin/make -f
# Generated automatically from Makefile.in by configure.
# Un*x Makefile for GNU tar program.
# Copyright (C) 1991 Free Software Foundation, Inc.
diff --git a/read.c b/read.c
index b0120942..58423f52 100644
--- a/read.c
+++ b/read.c
@@ -782,7 +782,7 @@ eval (struct ebuffer *ebuf, int set_default)
{
struct variable *v = lookup_variable (p, l);
if (v == 0)
- v = define_variable_loc (p, l, "", o_file, 0, fstart);
+ v = define_variable_global (p, l, "", o_file, 0, fstart);
v->export = exporting ? v_export : v_noexport;
}
diff --git a/tests/ChangeLog b/tests/ChangeLog
index 03983ec0..a5747248 100644
--- a/tests/ChangeLog
+++ b/tests/ChangeLog
@@ -1,3 +1,8 @@
+2011-09-12 Paul Smith <psmith@gnu.org>
+
+ * scripts/functions/call: Verify that using export in a $(call ...)
+ context creates a global variable. See Savannah bug #32498.
+
2011-09-02 Paul Smith <psmith@gnu.org>
* scripts/options/dash-n: Verify that in "-n -t", the -n takes
diff --git a/tests/scripts/functions/call b/tests/scripts/functions/call
index 6dd48b13..98f1d921 100644
--- a/tests/scripts/functions/call
+++ b/tests/scripts/functions/call
@@ -96,4 +96,15 @@ close(MAKEFILE);
$answer = "1 2 3 4 5 6 7 8 9\n1 2 3 4 5\n1 2 3\n1 2 3\n";
&compare_output($answer,&get_logfile(1));
+# Ensure that variables are defined in global scope even in a $(call ...)
+
+delete $ENV{X123};
+
+run_make_test('
+tst = $(eval export X123)
+$(call tst)
+all: ; @echo "$${X123-not set}"
+',
+ '', "\n");
+
1;