Index: /vendor/gnumake/current/.cvsignore
===================================================================
--- /vendor/gnumake/current/.cvsignore	(revision 2595)
+++ /vendor/gnumake/current/.cvsignore	(revision 2596)
@@ -8,4 +8,5 @@
 
 .*gdbinit
+.gdb_history
 
 *.dep *.dvi *.toc *.aux *.log
Index: /vendor/gnumake/current/AUTHORS
===================================================================
--- /vendor/gnumake/current/AUTHORS	(revision 2595)
+++ /vendor/gnumake/current/AUTHORS	(revision 2596)
@@ -67,6 +67,6 @@
 
 -------------------------------------------------------------------------------
-Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
-Free Software Foundation, Inc.
+Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
+2008, 2009, 2010 Free Software Foundation, Inc.
 This file is part of GNU Make.
 
Index: /vendor/gnumake/current/ChangeLog
===================================================================
--- /vendor/gnumake/current/ChangeLog	(revision 2595)
+++ /vendor/gnumake/current/ChangeLog	(revision 2596)
@@ -1,2 +1,841 @@
+2010-07-28  Paul Smith  <psmith@gnu.org>
+
+	Version 3.82 released.
+
+	* configure.in: Change release version.
+	* NEWS: Change the date.
+
+	* read.c (parse_file_seq): Remove GLOB_NOSORT for
+	backward-compatibility.  We'll add it back in next release.
+	* NEWS: Note it.
+
+2010-07-24  Eli Zaretskii  <eliz@gnu.org>
+
+	* job.c (pid2str) [WINDOWS32]: Fix CPP conditionals for using %Id
+	format.
+
+2010-07-18  Paul Smith  <psmith@gnu.org>
+
+	* configure.in: Switch bsd_signal to AC_CHECK_DECLS() to make sure
+	we have a declaration.  Fixes Savannah bug #25713 (maybe?)
+	* doc/make.texi (Complex Makefile): Cleanup variable assignments.
+	(One Shell): New subsection for the .ONESHELL special target.
+
+	Patches by Ozkan Sezer <sezeroz@gmail.com>:
+
+	* misc.c (strncasecmp): Local implementation for systems without.
+	* config.h.W32.template (HAVE_STRNICMP): Define on Windows.
+	* configure.in: Check for strncasecmp/strncmpi/strnicmp.
+	* job.c [WINDOWS32]: Don't define dup2 on Windows.
+	(pid2str): Use "%Id" even with MSVC
+	(exec_command): Cast to pid_t when calling pid2str().
+	* w32/subproc/sub_proc.c [WINDOWS32]: Include config.h first.
+	Use stddef.h on MSVC to get intptr_t.
+	* w32/subproc/misc.c [WINDOWS32]: Include config.h first.
+	* w32/compat/dirent.c [WINDOWS32]: Include config.h first.
+	(readdir): Cast -1 to correct type for d_ino.
+	* w32/pathstuff.c [WINDOWS32]: Ensure make.h is included first.
+	* make.h [WINDOWS32]: Don't prototype alloca() on Windows.
+	Add configuration for strncasecmp().
+	* main.c (ADD_SIG) [WINDOWS32]: Avoid warnings in MSVC.
+	* config.h.W32.template [WINDOWS32]: Don't warn on unsafe
+	functions or variables.
+	* NMakefile.template [WINDOWS32]: Remove /MACHINE:I386.
+	* main.c (clean_jobserver): Cast due to MSVC brokenness.
+	(decode_switches): Ditto.
+	* vpath.c (construct_vpath_list): Ditto.
+	* rule.c (freerule): Ditto.
+	* ar.c (ar_glob): Ditto.
+
+2010-07-16  Boris Kolpackov  <boris@codesynthesis.com>
+
+	* misc.c (concat): Fix buffer overrun.
+
+2010-07-12  Paul Smith  <psmith@gnu.org>
+
+	Update copyrights to add 2010.
+
+	* build_w32.bat: Support for MSVC Windows x86_64 builds.
+	* job.c: Don't define execve() on MSVC/64bit.
+	Patch by Viktor Szakats.  Fixes Savannah bug #27590.
+
+2010-07-12  Eli Zaretskii  <eliz@gnu.org>
+
+	* make.h (alloca) [!__GNUC__]: Don't define prototype.
+	(int w32_kill): Use pid_t for process ID argument.
+	Fixes Savannah bug #27809.
+
+2010-07-12  Paul Smith  <psmith@gnu.org>
+
+	Integrated new .ONESHELL feature.
+	Patch by David Boyce <dsb@boyski.com>.  Modified by me.
+
+	* NEWS: Add a note about the new feature.
+	* job.c (is_bourne_compatible_shell): Determine whether we're
+	using a standard POSIX shell or not.
+	(start_job_command): Accept '-ec' as POSIX shell flags.
+	(construct_command_argv_internal): If one_shell is set and we are
+	using a POSIX shell, remove "interior" prefix characters such as
+	"@", "+", "-".  Also treat "\n" as a special character when
+	choosing the slow path, if ONESHELL is set.
+	* job.h (is_bourne_compatible_argv): Define the new function.
+
+	* make.h (one_shell): New global variable to remember setting.
+	* main.c: Declare it.
+	* read.c (record_files): Set it.
+	* commands.c (chop_commands): If one_shell is set, don't chop
+	commands into multiple lines; just keep one line.
+
+2010-07-09  Eli Zaretskii  <eliz@gnu.org>
+
+	* w32/subproc/sub_proc.c: Include stdint.h.
+	(sub_process_t): Use intptr_t for file handles and pid_t for
+	process ID.
+	(process_pipes, process_init_fd, process_begin): Use intptr_t for
+	file handles and pid_t for process ID.  Fixes Savannah bug #27809.
+	Patch by Ozkan Sezer <sezeroz@gmail.com>
+
+	* function.c (abspath): Support absolute file names in UNC format.
+	Fixes Savannah bug #30312.
+
+	* job.c (pid2str) [WINDOWS32]: Don't use %Id with GCC < 4.x.
+	(exec_command) [WINDOWS32]: Use pid2str instead of non-portable
+	%Id.
+
+	* main.c (handle_runtime_exceptions): Use %p to print addresses,
+	to DTRT on both 32-bit and 64-bit hosts.  Savannah bug #27809.
+
+	* job.c (w32_kill, start_job_command, create_batch_file): Use
+	pid_t for process IDs and intptr_t for the 1st arg of
+	_open_osfhandle.
+	* function.c (windows32_openpipe): Use pid_t for process IDs and
+	intptr_t for the 1st arg of _open_osfhandle.
+	(func_shell): Use pid_t for process IDs.
+	* main.c (main) [WINDOWS32]: Pacify the compiler.
+	* config.h.W32.template (pid_t): Add a definition for 64-bit
+	Windows builds that don't use GCC.  Fixes Savannah bug #27809.
+	Patch by Ozkan Sezer <sezeroz@gmail.com>
+
+2010-07-07  Paul Smith  <psmith@gnu.org>
+
+	* configure.in: Bump to a new prerelease version 3.81.91.
+
+2010-07-06  Paul Smith  <psmith@gnu.org>
+
+	* main.c (main): Set a default value of "-c" for .SHELLFLAGS.
+	* NEWS: Mention the new behavior of .POSIX and the new .SHELLFLAGS
+	variable.
+	* job.c (construct_command_argv): Retrieve the .SHELLFLAGS value
+	and pass it to construct_command_argv_internal().
+	(construct_command_argv_internal): If .SHELLFLAGS is non-standard
+	use the slow path.  Use that value instead of hard-coded "-c".
+
+2010-07-05  Paul Smith  <psmith@gnu.org>
+
+	* implicit.c (pattern_search): lastslash can be const.
+	* dir.c (downcase): Remove unused variable.
+	* hash.c (hash_init): Cast sizeof for error message.
+	* arscan.c (ar_scan): Cast to char* for WINDOWS32.
+	(ar_member_touch): Ditto.
+	* ar.c (glob_pattern_p): Avoid symbol collision: open -> opened
+	* signame.c (strsignal): Ditto: signal -> sig
+	* job.c (create_batch_file): Ditto: error -> error_string
+	(pid2str): Portably convert a pid_t into a string
+	(reap_children): Use it.
+	(start_waiting_job): Use it.
+	Savannah bug #27809.  Patch by Ozkan Sezer <sezeroz@gmail.com>
+
+2010-07-03  Paul Smith  <psmith@gnu.org>
+
+	* read.c (parse_file_seq): All archive groups must end with ')' as
+	the LAST character in a word.  If there is no word ending in ')'
+	then it's not an archive group.  Fixes Savannah bug #28525.
+
+2010-07-01  Paul Smith  <psmith@gnu.org>
+
+	* main.c (main): Append optional features using separate calls.
+	Not as efficient but not all compilers allow conditionals inside
+	macro calls.  Fixes Savannah bug #29244.
+
+2010-01-10  Paul Smith  <psmith@gnu.org>
+
+	* make.h (patheq): Rename strieq() to patheq() for clarity.
+	* dir.c (dir_contents_file_exists_p): Use it.
+
+	* dir.c (file_impossible): Convert xmalloc/memset to xcalloc.
+	* file.c (enter_file): Ditto.
+	* job.c (new_job): Ditto.
+
+2009-12-11  Eli Zaretskii  <eliz@gnu.org>
+
+	* job.c (construct_command_argv_internal) <sh_cmds_dos>
+	[WINDOWS32]: Add "echo." and a few more commands that are built
+	into cmd.exe.  Fixes Savannah bug #28126.
+
+	* file.c (lookup_file) [HAVE_DOS_PATHS]: Treat '\\' like we do
+	with '/'.
+
+2009-11-15  Paul Smith  <psmith@gnu.org>
+
+	Patches for VMS provided by Hartmut Becker <Hartmut.Becker@hp.com>
+
+	* vmsjobs.c (ctrlYPressed) [VMS]: Deal with CTRL-Y.
+	(vmsHandleChildTerm) [VMS]: Ditto.
+	(astYHandler) [VMS]: Ditto.
+	(tryToSetupYAst) [VMS]: Ditto.
+	(child_execute_job) [VMS]: Ditto.
+
+	* vmsify.c (trnlog) [VMS]: Fix const errors.
+	(vmsify) [VMS]: Ditto.
+
+	* readme.vms [VMS]: Update with notes for 3.82.
+
+	* job.h (comname) [VMS]: Remember the temporary command filename
+
+	* dir.c (vmsify) [VMS]: Fix const errors.
+	(vms_hash) [VMS]: Ditto.
+	(vmsstat_dir) [VMS]: Ditto.
+	(find_directory) [VMS]: Fix case-insensitive option for VMS
+	(dir_contents_file_exists_p) [VMS]: Ditto.
+	(file_impossible) [VMS]: Ditto.
+
+	* config.h-vms.template (HAVE_FDOPEN) [VMS]: Have it.
+	(HAVE_STRCASECMP) [VMS]: Ditto.
+
+	* arscan.c (VMS_get_member_info) [VMS]: Fix timezone computation.
+	(ar_scan) [VMS]: Fix const error.
+
+2009-11-12  Boris Kolpackov  <boris@codesynthesis.com>
+
+	* vpath.c (vpath_search, selective_vpath_search): Add index arguments
+	which allows the caller to get the index of the matching directory.
+
+	* make.h (vpath_search): Update prototype.
+
+	* remake.c (library_search): Implement linker-compatible library
+	search. Use the new VPATH_SEARCH index functionality to keep track
+	of the directory index for each match. Select the match with the
+	lowest directory index.
+
+	* implicit.c (pattern_search): Pass NULL for the index arguments in
+	the VPATH_SEARCH call.
+
+	* doc/make.texi (Directory Search for Link Libraries): Describe the
+	new search behavior.
+
+	* NEWS: Add a note about the new behavior.
+
+2009-10-25  Paul Smith  <psmith@gnu.org>
+
+	* AUTHORS, et.al.: Update copyright years.
+
+	* implicit.c (stemlen_compare): Fix qsort() compare bug that
+	caused implicit rules with equal stem lengths to be sorted
+	indeterminately.
+
+2009-10-24  Paul Smith  <psmith@gnu.org>
+
+	* main.c (usage): Add --eval to the usage string.
+	(switches): Add the --eval switch.
+	(main): If --eval is given, add them to the simply-expanded variable
+	-*-eval-flags-*- (necessary to allow recursion to work properly).
+	(define_makeflags): Add -*-eval-flags-*- to MAKEFLAGS.
+
+	* NEWS: Describe the new --eval command line argument.
+	* doc/make.texi (Options Summary): Document --eval.
+
+	* dep.h: eval_buffer() returns void.
+	* read.c (eval_buffer): Ditto.
+	(eval): Ditto.
+
+	* variable.h (define_variable_cname): New macro for constant
+	variable names.
+	* default.c (set_default_suffixes): Use it.
+	* main.c (main): Ditto.
+	(handle_non_switch_argument): Ditto.
+	(define_makeflags): Ditto.
+	* read.c (read_all_makefiles): Ditto.
+	* variable.c (define_automatic_variables): Ditto.
+
+	* commands.c (dep_hash_cmp): Avoid casts.
+	(dep_hash_1): Ditto.
+	(dep_hash_2): Ditto.
+
+2009-10-22  Boris Kolpackov  <boris@codesynthesis.com>
+
+	* read.c (read_all_makefiles): Mark the default makefile dependency
+	dontcare.
+
+2009-10-07  Boris Kolpackov  <boris@codesynthesis.com>
+
+	* read.c (do_undefine): Free the expanded variable name.
+
+	* commands.c (dep_hash_cmp, set_file_variables): Move the order-only
+	to normal upgrade logic from  dep_hash_cmp to set_file_variables.
+
+2009-10-06  Boris Kolpackov  <boris@codesynthesis.com>
+
+	* dep.h (uniquize_deps): Remove.
+
+	* read.c (uniquize_deps): Merge into set_file_variables in
+	commands.c.
+	(dep_hash_1, dep_hash_2, dep_hash_cmp): Move to commands.c.
+
+	* commands.c (set_file_variables): Avoid modifying the dep
+	chain to achieve uniqueness. Fixes savannah bug 25780.
+
+	* implicit.c (pattern_search): Instead of re-setting all automatic
+	variables for each rule we try, just update $*.
+
+2009-10-06  Boris Kolpackov  <boris@codesynthesis.com>
+
+	* variable.h (undefine_variable_in_set): New function declaration.
+	(undefine_variable_global): New macro.
+
+	* variable.c (undefine_variable_in_set): New function implementation.
+
+	* read.c (vmodifiers): Add undefine_v modifier.
+	(parse_var_assignment): Parse undefine.
+	(do_undefine): Handle the undefine directive.
+	(eval): Call do_undefine if undefine_v is set.
+
+	* main.c (.FEATURES): Add a keyword to indicate the new feature.
+
+	* doc/make.texi (Undefine Directive): Describe the new directive.
+
+	* NEWS: Add a note about the new directive.
+
+2009-10-05  Boris Kolpackov  <boris@codesynthesis.com>
+
+	* implicit.c (pattern_search): Initialize file variables only
+	if we need to parse a rule that requires the second expansion.
+
+2009-10-03  Paul Smith  <psmith@gnu.org>
+
+	* make.h: Include <alloca.h> even on systems where __GNUC__ is
+	defined.  Not sure why it was done the other way.
+	Requested by David Boyce <dsb@boyski.com>.
+
+2009-09-30  Boris Kolpackov  <boris@codesynthesis.com>
+
+	* dep.h (dep): Add the DONTCARE bitfield.
+
+	* filedef.h (file):Add the NO_DIAG bitfield.
+
+        * read.c (eval_makefile): Set the DONTCARE flag in struct dep,
+	not struct file (a file can be a dependency of many targets,
+	some don't care, some do).
+
+	* remake.c (update_goal_chain): Propagate DONTCARE from struct
+	dep to struct file before updating the goal and restore it
+	afterwards.
+	(update_file): Don't prune the dependency graph if this target
+	has failed but the diagnostics hasn't been issued.
+	(complain): Scan the file's dependency graph to find the file
+	that caused the failure.
+	(update_file_1): Use NO_DIAG instead of DONTCARE to decide
+	whether to print diagnostics.
+
+	Fixes Savannah bugs #15110, #25493, #12686, and #17740.
+
+2009-09-28  Paul Smith  <psmith@gnu.org>
+
+	* doc/make.texi (Pattern Intro): Move the match algorithm
+	discussion into the "Pattern Match" node.
+	(Pattern Match): Expand on the pattern rule matching algorithm.
+
+2009-09-28  Andreas Buening  <andreas.buening@nexgo.de>
+
+	* job.c (construct_command_argv_internal) [OS2]: Don't eat too
+	much of the command line on a single pass.
+
+2009-09-28  Boris Kolpackov  <boris@codesynthesis.com>
+
+	* varible.c (create_pattern_var): Insert variables into the
+	PATTERN_VARS list in the shortest patterns first order.
+
+	* implicit.c (tryrule): Add STEMLEN and ORDER members. These are
+	used to sort the rules.
+	(stemlen_compare): Compare two tryrule elements.
+	(pattern_search): Sort the rules so that they are in the shortest
+	stem first order.
+
+	* main.c (.FEATURES): Add a keyword to indicate the new behavior.
+
+	* doc/make.texi (Pattern-specific Variable Values): Describe the
+	new pattern-specific variables application order.
+	(Introduction to Pattern Rules): Describe the new pattern rules
+	search order.
+
+	* NEWS: Add a note about the new behavior.
+
+2009-09-27  Paul Smith  <psmith@gnu.org>
+
+	* doc/make.texi (Double-Colon): Mention that pattern rules with
+	double-colons have a different meaning.  Savannah bug #27497.
+
+2009-09-27  Juan Manuel Guerrero  <juan.guerrero@gmx.de>
+
+	* configh.dos.template: Remove unconditional definition of
+	SYS_SIGLIST_DECLARED.
+	Include <sys/version.h> because ports of GCC 4.3.0 and later no
+	longer include it, so macros like __DJGPP_MINOR__ are no longer
+	defined automatically.
+
+	* Makefile.DOS.template (INCLUDES): Use $(prefix) and the
+	corresponding variables to define LIBDIR, INCLUDEDIR and LOCALEDIR
+	instead of using the hardcoded ones.
+	(SUBDIRS): doc subdir added.
+	(INFO_DEPS, DVIS): Values changed to 'make.info' and 'make.dvi'.
+	(TEXI2HTML, TEXI2HTML_FLAGS): Removed.  Use makeinfo --html to
+	create html formated docs.  texi2html may not be ported to DOS.
+	(make.info, make.dvi, make.ps, make.html): Make targets depend on
+	'make.texi'.
+	(.texi.info, .texi, .texi.dvi): Now invoked recursively.  Change
+	-I switch to look in ./ instead of ./doc.
+	(html): Target depend on html-recursive instead of make_1.html.
+	(make_1.html): Removed.
+	(mostlyclean-aminfo): Use $(srcdir)/doc instead of ./ as prefix.
+	(all-recursive): Allow for more than one subdir in the build
+	process.
+	(mostlyclean-recursive, clean-recursive, distclean-recursive)
+	(maintainer-clean-recursive, check-recursive): Enter in doc/ too.
+	(tags-recursive): Allow for more than one subdir in the build
+	process.
+	(info-recursive, dvi-recursive, ps-recursive, html-recursive): New
+	targets.  Enter into doc/ to produce the targets.
+	(all-am): $(INFO_DEPS) replaced by info.
+
+2009-09-26  Paul Smith  <psmith@gnu.org>
+
+	* read.c (record_files): Use free_ns() to free struct nameseq.
+	(eval): Ditto.
+
+	* rule.c (freerule): Use free_dep_chain().
+
+	* read.c (record_files): Free FILENAMES chain for implicit rules.
+	(eval): Static pattern targets go into the string cache.
+
+	* function.c (string_glob): Free NAME in the nameseq chain.
+
+2009-09-25  Boris Kolpackov  <boris@codesynthesis.com>
+
+	* implicit.c (pattern_search): Terminate early if we haven't
+	found any rules to try (performance improvement).
+
+2009-09-25  Boris Kolpackov  <boris@codesynthesis.com>
+
+	* implicit.c (pattern_search): Merge three parallel arrays,
+	TRYRULES, MATCHES, and CHECKED_LASTSLASH, into one array
+	of struct TRYRULE. In the old version the latter two arrays
+	had insufficient length.
+
+2009-09-24  Paul Smith  <psmith@gnu.org>
+
+	* implicit.c (pattern_search): Add back support for order-only
+	prerequisites for secondary expansion implicit rules, that were
+	accidentally dropped.  If we find a "|", enable order-only mode
+	and set IGNORE_MTIME on all deps that are seen afterward.
+	(pattern_search): Fix memory leaks: for intermediate files where
+	we've already set the file variable and pattern variable sets, be
+	sure to either save or free them as appropriate.
+
+2009-09-23  Paul Smith  <psmith@gnu.org>
+
+	Rework the way secondary expansion is stored, for efficiency.
+	This changes secondary expansion so that ONLY WHEN we know we have
+	a possibility of needing secondary expansion, do we defer the
+	secondary expansion.  This means more parsing the deps but we use
+	a lot less memory (due to the strcache).  Also, this fixes
+	Savannah bug #18622.
+
+	* read.c (eval): Don't parse the dep string here anymore.
+	(record_files): Take the dep argument as an unparsed string.  If
+	secondary expansion is enabled AND the prereq string has a '$' in
+	it, then set NEED_2ND_EXPANSION and keep the entire string.
+	Otherwise, parse the dep string here to construct the dep list
+	with the names in the strcache.
+
+	* misc.c (copy_dep_chain): For NEED_2ND_EXPANSION, we need to
+	duplicate the name string (others are in the strcache).
+
+	* implicit.c: Remove struct idep and free_idep_chain(): unused.
+	(struct patdeps): New structure to store prereq information.
+	(pattern_search): Use the NEED_2ND_EXPANSION flag to determine
+	which prerequisites need expansion, and expand only those.
+
+	* file.c (split_prereqs): Break parse_prereqs() into two parts: this
+	and enter_prereqs().  split_prereqs() takes a fully-expanded string
+	and splits it into a DEP list, handling order-only prereqs.
+	(enter_prereqs): This function enters a list of DEPs into the file
+	database.  If there's a stem defined, expand any pattern chars.
+	(expand_deps): Only try to expand DEPs which have NEED_2ND_EXPANSION
+	set.  Use the above functions.
+	(snap_deps): Only perform second expansion on prereqs that need it,
+	as defined by the NEED_2ND_EXPANSION flag.
+	(print_prereqs): New function to print the prereqs
+	(print_file): Call print_prereqs() rather than print inline.
+
+	* hash.h (STRING_COMPARE): Take advantage of strcache() by
+	comparing pointers.
+	(STRING_N_COMPARE): Ditto.
+	(ISTRING_COMPARE): Ditto.
+
+	* dep.h (PARSE_FILE_SEQ): New macro to reduce casts.
+	(parse_file_seq): Return void*
+	* read.c (parse_file_seq): Return void*.
+	(eval): Invoke macroized version of parse_file_seq()
+	* default.c (set_default_suffixes): Ditto.
+	* file.c (split_prereqs): Ditto.
+	* function.c (string_glob): Ditto.
+	* main.c (main): Ditto.
+	* rule.c (install_pattern_rule): Ditto.
+
+	* filedef.h: Add split_prereqs(), enter_prereqs(), etc.
+
+2009-09-16  Paul Smith  <psmith@gnu.org>
+
+	* misc.c (alloc_dep, free_dep): Now that we have xcalloc(),
+	convert to macros.
+	* dep.h: Create alloc_dep() / free_dep() macros.
+
+	* implicit.c (pattern_search): Take advantage of the new
+	parse_file_seq() to add the directory prefix to each prereq.
+
+	* dep.h: Remove multi_glob() and enhance parse_file_seq() to do it
+	all.  Avoid reversing chains.  Support adding prefixes.
+	* read.c (parse_file_seq): Rewrite to support globbing.  Allow for
+	cached/non-cached results.
+	(eval): Remove multi_glob() & invoke new parse_file_seq().
+	* rule.c (install_pattern_rule): Ditto.
+	* main.c (main): Ditto.
+	* implicit.c (pattern_search): Ditto.
+	* function.c (string_glob): Ditto.
+	* file.c (parse_prereqs): Ditto.
+	* default.c (set_default_suffixes): Ditto.
+
+	* variable.c (parse_variable_definition): Don't run off the end of
+	the string if it ends in whitespace (found with valgrind).
+
+	* commands.c (set_file_variables): Keep space for all targets in
+	$? if -B is given (found with valgrind).
+
+2009-09-15  Paul Smith  <psmith@gnu.org>
+
+	* misc.c (concat): Make concat() variadic so it takes >3 arguments.
+	(xcalloc): Add new function.
+	* make.h: New declarations.
+
+	* ar.c (ar_glob_match): New calling method for concat().
+	* main.c (main): Ditto.
+	(decode_env_switches): Ditto.
+	* read.c (eval_makefile): Ditto.
+	(tilde_expand): Ditto.
+	(parse_file_seq): Ditto.
+	* variable.c (target_environment): Ditto.
+	(sync_Path_environment): Ditto.
+
+	* ar.c (ar_glob_match): Use xcalloc().
+	* dir.c (file_impossible): Ditto.
+	* file.c (enter_file): Ditto.
+	* job.c (new_job): Ditto.
+	* read.c (parse_file_seq): Ditto.
+	* vmsfunctions.c (opendir): Ditto.
+
+2009-09-14  Rafi Einstein  <rafi.einstein@gmail.com>  (tiny patch)
+
+	* w32/subproc/sub_proc.c (process_begin): Check *ep non-NULL
+	inside the loop that looks up environment for PATH.
+
+2009-08-31  Eli Zaretskii  <eliz@gnu.org>
+
+	* function.c (windows32_openpipe): Update envp after calling
+	sync_Path_environment.
+
+2009-08-02  Paul Smith  <psmith@gnu.org>
+
+	* remake.c (notice_finished_file): Ensure file->cmds is not null
+	before looping through them.  Fixes Savannah bug #21824.
+
+	* doc/make.texi (Wildcard Examples): Clarify when objects is
+	wildcard-expanded.  Fixes Savannah bug #24509.  Patch by Martin Dorey.
+	(Include): Clarify the behavior of -include.
+	Fixes Savannah bug #18963.
+
+2009-08-01  Paul Smith  <psmith@gnu.org>
+
+	* doc/make.texi (Catalogue of Rules): Clarify where -c, -F,
+	etc. come on the command line.  Fixes Savannah bug #27093.
+
+	* expand.c (expand_argument): If the argument is large enough use
+	xmalloc() instead of alloca().  Fixes Savannah bug #27143.
+
+	* variable.c (do_variable_definition): Avoid using alloca() to
+	hold values, which can be large.  Fixes Savannah bug #23960.
+
+	* job.c (new_job): Use memmove() instead of strcpy() since both
+	pointers are in the same memory block.  Fixes Savannah bug #27148.
+	Patch by Petr Machata.
+
+2009-07-29  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
+
+        * job.c (construct_command_argv_internal): Add "ulimit" and
+        "unset" to the sh_cmds for Unixy shells.
+
+2009-07-29  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
+
+        * configure.in: Move side-effects outside AC_CACHE_VAL arguments
+        that set make_cv_sys_gnu_glob, so they are also correctly set
+        when the cache has been populated before.
+
+2009-07-04  Eli Zaretskii  <eliz@gnu.org>
+
+	* function.c (func_realpath) [!HAVE_REALPATH]: Require the file to
+	exist, as realpath(3) does where it's supported.
+
+2006-07-04  Eli Zaretskii  <eliz@gnu.org>
+
+	* function.c (IS_ABSOLUTE, ROOT_LEN): New macros.
+	(abspath): Support systems that define HAVE_DOS_PATHS (have
+	drive letters in their file names).  Use IS_PATHSEP instead of a
+	literal '/' comparison.  Fixes Savannah bug #26886.
+
+2009-06-14  Paul Smith  <psmith@gnu.org>
+
+	* remake.c (update_file_1): Remember the original file we marked
+	as updating, so we can clear that flag again.  If we find a target
+	via vpath, FILE might change.
+	(check_dep): Ditto.  Fixes Savannah bug #13529.
+	Patch by Reid Madsen <reid.madsen@tek.com>.
+
+2009-06-13  Paul Smith  <psmith@gnu.org>
+
+	* doc/make.texi (MAKEFILES Variable): Be explicit that files
+	included by MAKEFILES cannot give default goals.
+	* read.c (eval): If set_default is not set, pass the no-default-goal
+	value when we read included makefiles.  Fixes Savannah bug #13401.
+
+	* ar.c (ar_name): Ensure that targets with empty parens aren't
+	considered archive member references: archive members must have a
+	non-empty "member" string.  Fixes Savannah bug #18435.
+
+	* function.c (string_glob): Rely on multi_glob() to determine
+	whether files exist or not.  Remove call to file_exists_p() which
+	is not always correct.  Fixes Savannah bug #21231.
+	* read.c (multi_glob): Add a new argument EXISTS_ONLY; if true
+	then only files that really exist will be returned.
+	* dep.h: Add new argument to multi_glob().
+	* rule.c (install_pattern_rule): Ditto.
+	* read.c (eval): Ditto.
+	* main.c (main): Ditto.
+	* implicit.c (pattern_search): Ditto.
+	* file.c (parse_prereqs): Ditto.
+	* default.c (set_default_suffixes): Ditto.
+
+2009-06-09  Paul Smith  <psmith@gnu.org>
+
+	* commands.c (set_file_variables): If always_make_flag is set,
+	always add the prereq to $?.  Fixes Savannah bug #17825.
+
+	* remake.c (update_file_1): When rebuilding deps of FILE, also try
+	to rebuild the deps of all the also_make targets for that file.
+	Fixes Savannah bug #19108.
+
+	* implicit.c (pattern_search): Undo test for is_target, added by
+	BorisK on 21 Sep 2004.  This goes against step 5c in the "Implicit
+	Rule Search Algorithm".  Fixes Savannah bug #17752.
+
+	* main.c (clean_jobserver): Clear the jobserver_fds options and
+	set job_slots to the default when we clean up.
+	(define_makeflags): Return the new MAKEFLAGS value.
+	(main): Reset MAKEFLAGS in the environment when we re-exec.
+	Fixes Savannah bug #18124.
+
+2009-06-08  Paul Smith  <psmith@gnu.org>
+
+	* read.c (eval): Collapse continuations post-semicolon on target-
+	specific variables.  Fixes Savannah bug #17521.
+
+2009-06-07  Paul Smith  <psmith@gnu.org>
+
+	* job.c (reap_children): For older systems without waitpid() (are
+	there any of these left?) run wait(2) inside EINTRLOOP to handle
+	EINTR errors.  Fixes Savannah bug #16401.
+
+	* (various): Debug message cleanup.  Fixes Savannah bug #16469.
+
+	* main.c: Fix bsd_signal() typedef.  Fixes Savannah bug #16473.
+
+	* file.c (snap_deps): Set SNAPPED_DEPS at the start of snapping,
+	not the end, to catch second expansion $(eval ...) defining new
+	target/prereq relationships during snap_deps.
+	Fixes Savannah bug #24622.
+
+	* read.c (record_files): The second-expansion "f->updating" hack
+	was not completely correct: if assumed that the target with
+	commands always had prerequisites; if one didn't then the ordering
+	was messed up.  Fixed for now to use f->updating to decide whether
+	to preserve the last element in the deps list... but this whole
+	area of constructing and reversing the deps list is too confusing
+	and needs to be reworked.  Fixes Savannah bug #21198.
+
+2009-06-06  Paul Smith  <psmith@gnu.org>
+
+	* hash.c (hash_insert): Remove useless test for NULL.
+	Fixes Savannah bug #21823.
+
+	* make.h: Move SET_STACK_SIZE determination to make.h.
+	* main.c (main): New global variable, STACK_LIMIT, holds the
+	original stack limit when make was started.
+	* job.c (start_job_command): Reset the stack limit, if we changed it.
+	Fixes Savannah bug #22010.
+
+	* remake.c (check_dep): Only set the target's state to not-started
+	if it's not already running.  Found this while testing -j10 builds
+	of glibc: various targets were being rebuilt multiple times.
+	Fix from Knut St. Osmundsen; fixes a problem reported in Savannah
+	bug #15919.
+
+	* read.c (multi_glob): Don't pass GLOB_NOCHECK to glob(3); instead
+	handle the GLOB_NOMATCH error.  This is to work around Sourceware.org
+	Bugzilla bug 10246.
+
+2009-06-04  Paul Smith  <psmith@gnu.org>
+
+	* read.c (eval): Skip initial whitespace (ffeed, vtab, etc.)
+
+	* maintMakefile: Modify access of config and gnulib Savannah
+	modules to use GIT instead of CVS.
+
+	* main.c (main): Initialize the LENGTH field in SHELL_VAR.
+	Fixes Savannah bug #24655.
+
+	* read.c (eval_buffer): Don't dereference reading_file if it's NULL;
+	this can happen during some invocations of $(eval ...) for example.
+	Fixes Savannah bug #24588.  Patch by Lars Jessen <ljessen@ljessen.dk>
+
+2009-06-02  Paul Smith  <psmith@gnu.org>
+
+	* configure.in: Check for fileno()
+	* read.c (eval_makefile): If fileno() is available, set CLOSE_ON_EXEC
+	for the makefile file so invocations of $(shell ...) don't inherit it.
+	Fixes Savannah bug #24277.
+
+2009-06-01  Paul Smith  <psmith@gnu.org>
+
+	* main.c (main): The previous fix for .DEFAULT_GOAL had issues;
+	expansion was handled incorrectly.  Rework the default goal
+	handling to save the variable only.  Remove default_goal_file and
+	default_goal_name.
+	* read.c (eval): Check default_goal_var, not default_goal_name.
+	* read.c (record_target_var): Don't check default_goal_file here.
+
+2009-05-31  Paul Smith  <psmith@gnu.org>
+
+	* main.c (main): Expand the .DEFAULT_GOAL variable before using
+	it, and if the multi_glob() returns nothing (say it expanded to
+	nothing but spaces) then don't crash.  Fixes Savannah bug #25697.
+
+	* doc/make.texi (Quick Reference): Add $(if ..), $(or ..), and
+	$(and ..) to the reference.  Fixes Savannah bug #25694.
+
+	* make.1: Be clear that some recipes will be executed even with -n.
+	* doc/make.texi: Ditto.  Fixes Savannah bug #25460.
+
+	* doc/make.texi (Override Directive): Make more clear how
+	overrides and appends interact.
+	Elucidates part of Savannah bug #26207.
+
+	* read.c (record_target_var): Don't reset the origin on
+	target-specific variables; try_variable_definition() will handle
+	this correctly.  Fixes Savannah bug #26207.
+
+	* maintMakefile (do-po-update): Copy PO files into $(top_srcdir).
+	Fixes Savannah bug #25712.
+
+	* implicit.c (pattern_search): Keep a pointer to the beginning of
+	the filename and save that instead of the constructed pointer.
+	Fixes Savannah bug #26593.
+	Patch by Mark Seaborn <mrs@mythic-beasts.com>
+
+2009-05-30  Paul Smith  <psmith@gnu.org>
+
+	* doc/make.texi (Multi-Line): Add a description of the new abilities
+	of define/endef.  Rename "Sequences" to "Multi-Line" and fix some
+	"command sequence" vs. "recipe" syntax.
+	* read.c (do_define): Modify to allow assignment tokens (=, :=, etc.)
+	after a define, to create variables with those flavors.
+
+2009-05-25  Paul Smith  <psmith@gnu.org>
+
+	Reworked the parser for variable assignments to allow multiple
+	modifiers, and in any order.  Also allows variable and
+	prerequisites to be modifier names ('export', 'private', etc.)
+
+	* NEWS: Add notes about user-visible changes.
+
+	* read.c (struct vmodifiers): Remember what modifiers were seen.
+	(parse_var_assignment): New function to parse variable assignments.
+	(eval): Call the new function.  Handle variable assignments earlier.
+
+	* variable.c (parse_variable_definition): Only parse; don't create var.
+	(assign_variable_definition): Call parse, then create the var.
+
+2009-05-24  Paul Smith  <psmith@gnu.org>
+
+	* doc/make.texi: Fix the ISBN for the GNU make manual.  Incorrect
+	value noticed by Hans Stol <hans.stol@nc3a.nato.int>.
+
+2009-03-14  Eli Zaretskii  <eliz@gnu.org>
+
+	* w32/pathstuff.c (convert_Path_to_windows32): Fix last change.
+	Fixes Savannah bug #25412.
+
+	* w32/subproc/sub_proc.c <top level>: Update Copyright years.  Add
+	prototype for xmalloc.
+	(find_file): Accept 3 arguments PATH_VAR, FULL_FNAME, and FULL_LEN
+	instead of an LPOFSTRUCT pointer.  Use xmalloc instead of malloc.
+	Loop over an array of extensions, instead of duplicating the same
+	code inline.  Use SearchPath followed by CreateFile, instead of
+	the obsolete OpenFile.  Fixes Savannah bug #17277.
+	(process_begin): Find $(PATH) in `envp', and pass a pointer to it
+	to `find_file'.  Fixes Savannah bug #25662.
+
+2009-03-07  Eli Zaretskii  <eliz@gnu.org>
+
+	* function.c (func_shell): Don't close pipedes[1] if it is -1.
+	Fixes Savannah bug #20495.
+
+2009-02-28  Ralf Wildenhues  <address@hidden>
+
+        * doc/make.texi (Instead of Execution): Document interaction of
+        -t with phony targets.
+
+2009-02-23  Ramon Garcia  <ramon.garcia.f@gmail.com>
+
+	Introduce a new keyword "private" which applies to target-specific
+	variables and prevents their values from being inherited.
+
+	* variable.h (struct variable): Add private_var flag to each variable.
+	Add a flag to specify which list entry switches to the parent target.
+	* variable.c (define_variable_in_set): Initialize private_var flag.
+	(lookup_variable): Skip private variables in parent contexts.
+	(initialize_file_variables): Set next_is_parent appropriately.
+	(print_variable): Show the private_var flag.
+	* read.c (eval): Recognize the private keyword.
+	(record_target_var): Set private_var.
+	* doc/make.texi (Suppressing Inheritance): Add documentation.
+
+2008-10-26  Paul Smith  <psmith@gnu.org>
+
+	* configure.in: Check for strndup().
+	* misc.c (xstrndup): Rename savestring to xstrndup.  Use strndup
+	if it's available.
+	* make.h: Rename savestring to xstrndup.
+	* commands.c (chop_commands): Ditto.
+	* function.c (func_foreach): Ditto.
+	* read.c (eval, record_files): Ditto.
+	* variable.c (define_variable_in_set): Ditto.
+
 2008-09-30  Eli Zaretskii  <eliz@gnu.org>
 
@@ -816,5 +1655,5 @@
 
 	* make.1: Fix some display errors and document all existing options.
-	Patch provided by Mike Frysinger <vapier@gentoo.org>.
+	Patch by Mike Frysinger <vapier@gentoo.org>.
 
 2005-12-11  Paul D. Smith  <psmith@gnu.org>
@@ -3164,6 +4003,6 @@
 
 
-Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software
-Foundation, Inc.
+Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free
+Software Foundation, Inc.
 This file is part of GNU Make.
 
Index: /vendor/gnumake/current/ChangeLog.1
===================================================================
--- /vendor/gnumake/current/ChangeLog.1	(revision 2595)
+++ /vendor/gnumake/current/ChangeLog.1	(revision 2596)
@@ -4984,6 +4984,6 @@
 
 Copyright (C) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
-1998, 1999, 2000, 2001, 2002, 2003, 2005, 2006, 2007 Free Software Foundation,
-Inc.
+1998, 1999, 2000, 2001, 2002, 2003, 2005, 2006, 2007, 2008, 2009 Free
+Software Foundation, Inc.
 This file is part of GNU Make.
 
Index: /vendor/gnumake/current/Makefile.DOS.template
===================================================================
--- /vendor/gnumake/current/Makefile.DOS.template	(revision 2595)
+++ /vendor/gnumake/current/Makefile.DOS.template	(revision 2596)
@@ -3,5 +3,5 @@
 #
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
-# 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
+# 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
 # This file is part of GNU Make.
 #
@@ -86,5 +86,5 @@
 man_MANS =	make.1
 
-INCLUDES =	-I$(srcdir)/glob -DLIBDIR=\"c:/djgpp/lib\" -DINCLUDEDIR=\"c:/djgpp/include\" -DLOCALEDIR=\"$(localedir)\"
+INCLUDES =	-I$(srcdir)/glob -DLIBDIR=\"$(prefix)$(libdir)\" -DINCLUDEDIR=\"$(prefix)$(includedir)\" -DLOCALEDIR=\"$(prefix)$(localedir)\"
 
 BUILT_SOURCES =	README build.sh-in
@@ -92,5 +92,5 @@
 EXTRA_DIST = 	$(BUILT_SOURCES) $(man_MANS) README.customs remote-cstms.c  make-stds.texi texinfo.tex SCOPTIONS SMakefile  Makefile.ami README.Amiga config.ami amiga.c amiga.h  NMakefile README.DOS configh.dos configure.bat makefile.com  README.W32 build_w32.bat config.h-W32 subproc.bat make.lnk  config.h-vms makefile.vms readme.vms vmsdir.h vmsfunctions.c  vmsify.c
 
-SUBDIRS =	glob
+SUBDIRS =	glob doc
 mkinstalldirs = ${exec_prefix}/bin/gmkdir -p
 CONFIG_HEADER = config.h
@@ -116,13 +116,10 @@
 TEXI2DVI = texi2dvi
 TEXINFO_TEX = $(srcdir)/config/texinfo.tex
-INFO_DEPS = make.info
-DVIS = make.dvi
+INFO_DEPS = doc/make.info
+DVIS = doc/make.dvi
 TEXINFOS = doc/make.texi
 noinst_TEXINFOS = doc/fdl.texi doc/make-stds.texi
 man1dir = $(mandir)/man1
 MANS = $(man_MANS)
-
-TEXI2HTML = texi2html
-TEXI2HTML_FLAGS = -split_chapter
 
 NROFF = nroff
@@ -192,6 +189,8 @@
 # Documentation
 
-make.info: doc/make.texi
-make.dvi: doc/make.texi
+make.info: make.texi
+make.dvi: make.texi
+make.ps: make.dvi make.texi
+make.html: make.texi
 
 
@@ -201,13 +200,13 @@
 	@command.com /c if exist make.info* del make.info*
 	@command.com /c if exist make.i* del make.i*
-	$(MAKEINFO) -I$(srcdir)/doc --no-split $< -o ./$@
+	$(MAKEINFO) -I$(srcdir) --no-split $< -o ./$@
 
 .texi:
 	@command.com /c if exist make.info* del make.info*
 	@command.com /c if exist make.i* del make.i*
-	$(MAKEINFO) -I$(srcdir)/doc --no-split $< -o ./$@
+	$(MAKEINFO) -I$(srcdir) --no-split $< -o ./$@
 
 .texi.dvi:
-	TEXINPUTS="$(srcdir)/doc;$$TEXINPUTS"    MAKEINFO='$(MAKEINFO) -I $(srcdir)/doc' $(TEXI2DVI) $<
+	TEXINPUTS="$(srcdir);$$TEXINPUTS"    MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $<
 
 .dvi.ps:
@@ -216,15 +215,16 @@
 # Other documentation formats
 
-html: make_1.html
-
-make_1.html: $(TEXINFOS) $(noinst_TEXINFOS)
-	$(TEXI2HTML) $(TEXI2HTML_FLAGS) $(srcdir)/doc/make.texi
+html: html-recursive
+
+.texi.html:
+	@command.com /c if exist make.html* del make.html*
+	$(MAKEINFO) --html -I$(srcdir) --no-split $< -o ./$@
 
 install-info-am: $(INFO_DEPS)
 	@$(NORMAL_INSTALL)
 	$(mkinstalldirs) $(DESTDIR)$(infodir)
-	@for file in $(INFO_DEPS); do    d=$(srcdir);    for ifile in `cd $$d && echo $$file`; do      if test -f $$d/$$ifile; then        echo " $(INSTALL_DATA) $$d/$$ifile $(DESTDIR)$(infodir)/$$ifile"; $(INSTALL_DATA) $$d/$$ifile $(DESTDIR)$(infodir)/$$ifile; else : ; fi;    done;  done
+	@for file in $(INFO_DEPS); do    iifile=`echo $$file | sed "s|doc/||"`;    d=$(srcdir);    for ifile in `cd $$d && echo $$file`; do      if test -f $$d/$$ifile; then        echo " $(INSTALL_DATA) $$d/$$ifile $(DESTDIR)$(infodir)/$$iifile"; $(INSTALL_DATA) $$d/$$ifile $(DESTDIR)$(infodir)/$$iifile; else : ; fi;    done;  done
 	@$(POST_INSTALL)
-	@if $(SHELL) -c 'install-info --version | sed 1q | fgrep -s -v -i debian' >/dev/null 2>&1; then    for file in $(INFO_DEPS); do      echo " install-info --info-dir=$(DESTDIR)$(infodir) $(DESTDIR)$(infodir)/$$file";     install-info --info-dir=$(DESTDIR)$(infodir) $(DESTDIR)$(infodir)/$$file || :;   done;  else : ; fi
+	@if $(SHELL) -c 'install-info --version | sed 1q | fgrep -s -v -i debian' >/dev/null 2>&1; then    for file in $(INFO_DEPS); do    iifile=`echo $$file | sed "s|doc/||"`;      echo " install-info --info-dir=$(DESTDIR)$(infodir) $(DESTDIR)$(infodir)/$$iifile";     install-info --info-dir=$(DESTDIR)$(infodir) $(DESTDIR)$(infodir)/$$iifile || :;   done;  else : ; fi
 
 uninstall-info:
@@ -238,7 +238,10 @@
 
 mostlyclean-aminfo:
-	-rm -f make.aux make.cp make.cps make.dvi make.fn make.fns make.ky \
-	  make.kys make.ps make.log make.pg make.toc make.tp make.tps \
-	  make.vr make.vrs make.op make.tr make.cv make.cn
+	-rm -f $(srcdir)/doc/make.aux $(srcdir)/doc/make.cp $(srcdir)/doc/make.cps $(srcdir)/doc/make.dvi \
+	  $(srcdir)/doc/make.fn $(srcdir)/doc/make.fns $(srcdir)/doc/make.ky $(srcdir)/doc/make.kys \
+	  $(srcdir)/doc/make.ps $(srcdir)/doc/make.log $(srcdir)/doc/make.pg $(srcdir)/doc/make.toc \
+	  $(srcdir)/doc/make.tp $(srcdir)/doc/make.tps $(srcdir)/doc/make.vr $(srcdir)/doc/make.vrs \
+	  $(srcdir)/doc/make.op $(srcdir)/doc/make.tr $(srcdir)/doc/make.cv $(srcdir)/doc/make.cn \
+	  $(srcdir)/doc/make.html
 
 clean-aminfo:
@@ -292,11 +295,8 @@
 # a single directory, yell bloody murder.
 all-recursive:
-ifeq ($(words $(SUBDIRS)), 1)
+ifeq ($(findstring glob, $(SUBDIRS)), glob)
 	@command.com /c if not exist glob\\nul md glob
-	@echo Making all in $(SUBDIRS)
-	$(MAKE) -C $(SUBDIRS) -f ../Makefile INCLUDES='-I$(srcdir) -I$(srcdir)/glob' DEFS='-I.. -I$(srcdir)' VPATH=$(srcdir)/glob libglob.a
-else
-	@echo FATAL: There is more than one directory in "($(SUBDIRS))"
-	@$(EXIT_FAIL)
+	@echo Making all in glob
+	$(MAKE) -C glob -f ../Makefile INCLUDES='-I$(srcdir) -I$(srcdir)/glob' DEFS='-I.. -I$(srcdir)' VPATH=$(srcdir)/glob libglob.a
 endif
 
@@ -311,9 +311,11 @@
 mostlyclean-recursive clean-recursive distclean-recursive \
 maintainer-clean-recursive check-recursive:
-ifeq ($(words $(SUBDIRS)), 1)
-	@echo Making $(shell echo $@ | sed s/-recursive//) in $(SUBDIRS)
-	$(MAKE) -C $(SUBDIRS) -f ../Makefile $(shell echo $@ | sed s/-recursive//)-am
+ifeq ($(words $(SUBDIRS)), 2)
+	@echo Making $(shell echo $@ | sed s/-recursive//) in glob
+	$(MAKE) -C glob -f ../Makefile $(shell echo $@ | sed s/-recursive//)-am
+	@echo Making $(shell echo $@ | sed s/-recursive//) in doc
+	$(MAKE) -C doc -f ../Makefile $(shell echo $@ | sed s/-recursive//)-am
 else
-	@echo FATAL: There is more than one directory in "($(SUBDIRS))"
+	@echo FATAL: There is more than two directory in "($(SUBDIRS))"
 	@$(EXIT_FAIL)
 endif
@@ -323,8 +325,8 @@
 
 tags-recursive:
-ifeq ($(words $(SUBDIRS)), 1)
+ifeq ($(words $(SUBDIRS)), 2)
 	$(MAKE) tags-in-glob
 else
-	@echo FATAL: There is more than one directory in "($(SUBDIRS))"
+	@echo FATAL: There is more than two directory in "($(SUBDIRS))"
 	@$(EXIT_FAIL)
 endif
@@ -377,6 +379,35 @@
 	$(MAKE) top_distdir="$(top_distdir)" distdir="$(distdir)" dist-hook
 
-info: $(INFO_DEPS) info-recursive
-dvi: $(DVIS) dvi-recursive
+info: info-recursive
+info-recursive:
+ifeq ($(findstring doc, $(SUBDIRS)), doc)
+	@command.com /c if not exist doc\\nul md doc
+	@echo Making all in doc
+	$(MAKE) -C doc -f ../Makefile VPATH=$(srcdir)/doc make.info
+endif
+
+dvi: dvi-recursive
+dvi-recursive:
+ifeq ($(findstring doc, $(SUBDIRS)), doc)
+	@command.com /c if not exist doc\\nul md doc
+	@echo Making all in doc
+	$(MAKE) -C doc -f ../Makefile VPATH=$(srcdir)/doc make.dvi
+endif
+
+ps: ps-recursive
+ps-recursive:
+ifeq ($(findstring doc, $(SUBDIRS)), doc)
+	@command.com /c if not exist doc\\nul md doc
+	@echo Making all in doc
+	$(MAKE) -C doc -f ../Makefile VPATH=$(srcdir)/doc make.ps
+endif
+
+html-recursive:
+ifeq ($(findstring doc, $(SUBDIRS)), doc)
+	@command.com /c if not exist doc\\nul md doc
+	@echo Making all in doc
+	$(MAKE) -C doc -f ../Makefile VPATH=$(srcdir)/doc make.html
+endif
+
 check: all-am check-recursive check-local
 	@:
@@ -385,5 +416,5 @@
 	$(MAKE) all-recursive
 
-all-am: Makefile $(INFO_DEPS) $(PROGRAMS) config.h
+all-am: Makefile $(PROGRAMS) config.h info
 
 install-exec-am: install-binPROGRAMS
Index: /vendor/gnumake/current/Makefile.am
===================================================================
--- /vendor/gnumake/current/Makefile.am	(revision 2595)
+++ /vendor/gnumake/current/Makefile.am	(revision 2596)
@@ -2,5 +2,5 @@
 #
 # Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
-# 2007 Free Software Foundation, Inc.
+# 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
 # This file is part of GNU Make.
 #
Index: /vendor/gnumake/current/Makefile.ami
===================================================================
--- /vendor/gnumake/current/Makefile.ami	(revision 2595)
+++ /vendor/gnumake/current/Makefile.ami	(revision 2596)
@@ -5,5 +5,5 @@
 #
 # Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
-# 2005, 2006, 2007 Free Software Foundation, Inc.
+# 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
 # This file is part of GNU Make.
 #
Index: /vendor/gnumake/current/NEWS
===================================================================
--- /vendor/gnumake/current/NEWS	(revision 2595)
+++ /vendor/gnumake/current/NEWS	(revision 2596)
@@ -1,5 +1,5 @@
 GNU make NEWS                                               -*-indented-text-*-
   History of user-visible changes.
-  1 April 2006
+  28 July 2010
 
 See the end of this file for copyrights and conditions.
@@ -11,15 +11,108 @@
 
 
-Version 3.81.90
+Version 3.82
+
+A complete list of bugs fixed in this version is available here:
+
+http://sv.gnu.org/bugs/index.php?group=make&report_id=111&fix_release_id=104&set=custom
 
 * Compiling GNU make now requires a conforming ISO C 1989 compiler and
   standard runtime library.
+
+* WARNING: Future backward-incompatibility!
+  Wildcards are not documented as returning sorted values, but up to and
+  including this release the results have been sorted and some makefiles are
+  apparently depending on that.  In the next release of GNU make, for
+  performance reasons, we may remove that sorting.  If your makefiles
+  require sorted results from wildcard expansions, use the $(sort ...)
+  function to request it explicitly.
+
+* WARNING: Backward-incompatibility!
+  The POSIX standard for make was changed in the 2008 version in a
+  fundamentally incompatible way: make is required to invoke the shell as if
+  the '-e' flag were provided.  Because this would break many makefiles that
+  have been written to conform to the original text of the standard, the
+  default behavior of GNU make remains to invoke the shell with simply '-c'.
+  However, any makefile specifying the .POSIX special target will follow the
+  new POSIX standard and pass '-e' to the shell.  See also .SHELLFLAGS
+  below.
+
+* WARNING: Backward-incompatibility!
+  The '$?' variable now contains all prerequisites that caused the target to
+  be considered out of date, even if they do not exist (previously only
+  existing targets were provided in $?).
+
+* WARNING: Backward-incompatibility!
+  As a result of parser enhancements, three backward-compatibility issues
+  exist: first, a prerequisite containing an "=" cannot be escaped with a
+  backslash any longer.  You must create a variable containing an "=" and
+  use that variable in the prerequisite.  Second, variable names can no
+  longer contain whitespace, unless you put the whitespace in a variable and
+  use the variable.  Third, in previous versions of make it was sometimes
+  not flagged as an error for explicit and pattern targets to appear in the
+  same rule.  Now this is always reported as an error.
+
+* WARNING: Backward-incompatibility!
+  The pattern-specific variables and pattern rules are now applied in the
+  shortest stem first order instead of the definition order (variables
+  and rules with the same stem length are still applied in the definition
+  order). This produces the usually-desired behavior where more specific
+  patterns are preferred. To detect this feature search for 'shortest-stem'
+  in the .FEATURES special variable.
+
+* WARNING: Backward-incompatibility!
+  The library search behavior has changed to be compatible with the standard
+  linker behavior. Prior to this version for prerequisites specified using
+  the -lfoo syntax make first searched for libfoo.so in the current
+  directory, vpath directories, and system directories. If that didn't yield
+  a match, make then searched for libfoo.a in these directories. Starting
+  with this version make searches first for libfoo.so and then for libfoo.a
+  in each of these directories in order.
+
+* New command line option: --eval=STRING causes STRING to be evaluated as
+  makefile syntax (akin to using the $(eval ...) function).  The evaluation
+  is performed after all default rules and variables are defined, but before
+  any makefiles are read.
 
 * New special variable: .RECIPEPREFIX allows you to reset the recipe
   introduction character from the default (TAB) to something else.  The
   first character of this variable value is the new recipe introduction
-  character.  If the variable is set to the empty string, TAB is used
-  again.  It can be set and reset at will; rules will be parsed
-  according to the current value.
+  character.  If the variable is set to the empty string, TAB is used again.
+  It can be set and reset at will; recipes will use the value active when
+  they were first parsed.  To detect this feature check the value of
+  $(.RECIPEPREFIX).
+
+* New special variable: .SHELLFLAGS allows you to change the options passed
+  to the shell when it invokes recipes.  By default the value will be "-c"
+  (or "-ec" if .POSIX is set).
+
+* New special target: .ONESHELL instructs make to invoke a single instance
+  of the shell and provide it with the entire recipe, regardless of how many
+  lines it contains.  As a special feature to allow more straightforward
+  conversion of makefiles to use .ONESHELL, any recipe line control
+  characters ('@', '+', or '-') will be removed from the second and
+  subsequent recipe lines.  This happens _only_ if the SHELL value is deemed
+  to be a standard POSIX-style shell.  If not, then no interior line control
+  characters are removed (as they may be part of the scripting language used
+  with the alternate SHELL).
+
+* New variable modifier 'private': prefixing a variable assignment with the
+  modifier 'private' suppresses inheritance of that variable by
+  prerequisites.  This is most useful for target- and pattern-specific
+  variables.
+
+* New make directive: 'undefine' allows you to undefine a variable so that
+  it appears as if it was never set. Both $(flavor) and $(origin) functions
+  will return 'undefined' for such a variable. To detect this feature search
+  for 'undefine' in the .FEATURES special variable.
+
+* The parser for variable assignments has been enhanced to allow multiple
+  modifiers ('export', 'override', 'private') on the same line as variables,
+  including define/endef variables, and in any order.  Also, it is possible
+  to create variables and targets named as these modifiers.
+
+* The 'define' make directive now allows a variable assignment operator
+  after the variable name, to allow for simple, conditional, or appending
+  multi-line variable assignment.
 
 
@@ -60,5 +153,4 @@
 
 * WARNING: Backward-incompatibility!
-
   In order to comply with POSIX, the way in which GNU make processes
   backslash-newline sequences in recipes has changed.  If your makefiles
@@ -1059,7 +1151,6 @@
 -------------------------------------------------------------------------------
 Copyright (C) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
-1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software
-Foundation, Inc.
-This file is part of GNU Make.
+1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
+2010 Free Software Foundation, Inc.  This file is part of GNU Make.
 
 GNU Make is free software; you can redistribute it and/or modify it under the
Index: /vendor/gnumake/current/NMakefile.template
===================================================================
--- /vendor/gnumake/current/NMakefile.template	(revision 2595)
+++ /vendor/gnumake/current/NMakefile.template	(revision 2596)
@@ -5,5 +5,5 @@
 #
 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
-# 2006, 2007 Free Software Foundation, Inc.
+# 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
 # This file is part of GNU Make.
 #
@@ -34,8 +34,7 @@
 
 LDFLAGS_debug = w32\subproc\WinDebug\subproc.lib /NOLOGO /SUBSYSTEM:console\
-	/INCREMENTAL:no /PDB:WinDebug/make.pdb /MACHINE:I386 \
-	/OUT:WinDebug/make.exe /DEBUG
+	/INCREMENTAL:no /PDB:WinDebug/make.pdb /OUT:WinDebug/make.exe /DEBUG
 LDFLAGS_release = w32\subproc\WinRel\subproc.lib /NOLOGO /SUBSYSTEM:console\
-	/INCREMENTAL:no /MACHINE:I386 /OUT:WinRel/make.exe
+	/INCREMENTAL:no /OUT:WinRel/make.exe
 
 all: config.h subproc Release Debug
Index: /vendor/gnumake/current/README.Amiga
===================================================================
--- /vendor/gnumake/current/README.Amiga	(revision 2595)
+++ /vendor/gnumake/current/README.Amiga	(revision 2596)
@@ -64,5 +64,5 @@
 -------------------------------------------------------------------------------
 Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
-2005, 2006, 2007 Free Software Foundation, Inc.
+2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
 This file is part of GNU Make.
 
Index: /vendor/gnumake/current/README.DOS.template
===================================================================
--- /vendor/gnumake/current/README.DOS.template	(revision 2595)
+++ /vendor/gnumake/current/README.DOS.template	(revision 2596)
@@ -327,5 +327,5 @@
 -------------------------------------------------------------------------------
 Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
-2006, 2007 Free Software Foundation, Inc.
+2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
 This file is part of GNU Make.
 
Index: /vendor/gnumake/current/README.OS2.template
===================================================================
--- /vendor/gnumake/current/README.OS2.template	(revision 2595)
+++ /vendor/gnumake/current/README.OS2.template	(revision 2596)
@@ -162,5 +162,6 @@
 
 -------------------------------------------------------------------------------
-Copyright (C) 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
+Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software
+Foundation, Inc.
 This file is part of GNU Make.
 
Index: /vendor/gnumake/current/README.W32.template
===================================================================
--- /vendor/gnumake/current/README.W32.template	(revision 2595)
+++ /vendor/gnumake/current/README.W32.template	(revision 2596)
@@ -275,5 +275,5 @@
 -------------------------------------------------------------------------------
 Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
-2006, 2007, 2008 Free Software Foundation, Inc.
+2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
 This file is part of GNU Make.
 
Index: /vendor/gnumake/current/README.customs
===================================================================
--- /vendor/gnumake/current/README.customs	(revision 2595)
+++ /vendor/gnumake/current/README.customs	(revision 2596)
@@ -98,6 +98,6 @@
 
 -------------------------------------------------------------------------------
-Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free
-Software Foundation, Inc.
+Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
+2009, 2010 Free Software Foundation, Inc.
 This file is part of GNU Make.
 
Index: /vendor/gnumake/current/README.cvs
===================================================================
--- /vendor/gnumake/current/README.cvs	(revision 2595)
+++ /vendor/gnumake/current/README.cvs	(revision 2596)
@@ -2,6 +2,6 @@
 
 -------------------------------------------------------------------------------
-Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
-This file is part of GNU Make.
+Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free
+Software Foundation, Inc.  This file is part of GNU Make.
 
 GNU Make is free software; you can redistribute it and/or modify it under the
@@ -211,4 +211,8 @@
 make check
 
+Or, for a debugging version:
+
+autoreconf -i && ./configure CFLAGS=-g && make update && make && make check
+
 Or, all-in-one:
 
Index: /vendor/gnumake/current/README.template
===================================================================
--- /vendor/gnumake/current/README.template	(revision 2595)
+++ /vendor/gnumake/current/README.template	(revision 2596)
@@ -174,6 +174,6 @@
 -------------------------------------------------------------------------------
 Copyright (C) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
-1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software
-Foundation, Inc.
+1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
+2010 Free Software Foundation, Inc.
 This file is part of GNU Make.
 
Index: /vendor/gnumake/current/SMakefile.template
===================================================================
--- /vendor/gnumake/current/SMakefile.template	(revision 2595)
+++ /vendor/gnumake/current/SMakefile.template	(revision 2596)
@@ -5,5 +5,5 @@
 #
 # Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
-# 2005, 2006, 2007 Free Software Foundation, Inc.
+# 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
 # This file is part of GNU Make.
 #
Index: /vendor/gnumake/current/TODO.private
===================================================================
--- /vendor/gnumake/current/TODO.private	(revision 2595)
+++ /vendor/gnumake/current/TODO.private	(revision 2596)
@@ -66,8 +66,5 @@
 
  3) Multi-token pattern rule matching (allow %1/%2.c : %1/obj/%2.o,
-    etc., or something like that).  I have an implementation of this
-    already, it just needs some refinement... maybe.  Additionally I
-    think it only works for static pattern rules; it might need to be
-    fixed up to work with normal pattern rules, too.
+    etc., or something like that).  Maybe using regex?
 
  4) Provide a .TARGETS variable, containing the names of the targets
@@ -130,6 +127,6 @@
 
 -------------------------------------------------------------------------------
-Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
-Free Software Foundation, Inc.
+Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
+2007, 2008, 2009, 2010 Free Software Foundation, Inc.
 This file is part of GNU Make.
 
Index: /vendor/gnumake/current/acinclude.m4
===================================================================
--- /vendor/gnumake/current/acinclude.m4	(revision 2595)
+++ /vendor/gnumake/current/acinclude.m4	(revision 2596)
@@ -2,6 +2,6 @@
 dnl
 dnl Automake will incorporate this into its generated aclocal.m4.
-dnl Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
-dnl Free Software Foundation, Inc.
+dnl Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
+dnl 2008, 2009, 2010 Free Software Foundation, Inc.
 dnl This file is part of GNU Make.
 dnl
Index: /vendor/gnumake/current/amiga.c
===================================================================
--- /vendor/gnumake/current/amiga.c	(revision 2595)
+++ /vendor/gnumake/current/amiga.c	(revision 2596)
@@ -1,5 +1,5 @@
 /* Running commands on Amiga
 Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
-2005, 2006, 2007 Free Software Foundation, Inc.
+2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
 This file is part of GNU Make.
 
Index: /vendor/gnumake/current/amiga.h
===================================================================
--- /vendor/gnumake/current/amiga.h	(revision 2595)
+++ /vendor/gnumake/current/amiga.h	(revision 2596)
@@ -1,5 +1,5 @@
 /* Definitions for amiga specific things
 Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
-2005, 2006, 2007 Free Software Foundation, Inc.
+2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
 This file is part of GNU Make.
 
Index: /vendor/gnumake/current/ar.c
===================================================================
--- /vendor/gnumake/current/ar.c	(revision 2595)
+++ /vendor/gnumake/current/ar.c	(revision 2596)
@@ -1,6 +1,7 @@
 /* Interface to `ar' archives for GNU Make.
 Copyright (C) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
-1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software
-Foundation, Inc.
+1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
+2010 Free Software Foundation, Inc.
+
 This file is part of GNU Make.
 
@@ -25,6 +26,7 @@
 #include <fnmatch.h>
 
-/* Return nonzero if NAME is an archive-member reference, zero if not.
-   An archive-member reference is a name like `lib(member)'.
+/* Return nonzero if NAME is an archive-member reference, zero if not.  An
+   archive-member reference is a name like `lib(member)' where member is a
+   non-empty string.
    If a name like `lib((entry))' is used, a fatal error is signaled at
    the attempt to use this unsupported feature.  */
@@ -40,5 +42,5 @@
 
   end = p + strlen (p) - 1;
-  if (*end != ')')
+  if (*end != ')' || end == p + 1)
     return 0;
 
@@ -199,7 +201,6 @@
     {
       /* We have a match.  Add it to the chain.  */
-      struct nameseq *new = xmalloc (state->size);
-      memset (new, '\0', state->size);
-      new->name = strcache_add (concat (state->arname, mem, ")"));
+      struct nameseq *new = xcalloc (state->size);
+      new->name = strcache_add (concat (4, state->arname, "(", mem, ")"));
       new->next = state->chain;
       state->chain = new;
@@ -216,5 +217,5 @@
 {
   const char *p;
-  int open = 0;
+  int opened = 0;
 
   for (p = pattern; *p != '\0'; ++p)
@@ -231,9 +232,9 @@
 
       case '[':
-	open = 1;
+	opened = 1;
 	break;
 
       case ']':
-	if (open)
+	if (opened)
 	  return 1;
 	break;
@@ -252,5 +253,4 @@
   struct nameseq *n;
   const char **names;
-  char *name;
   unsigned int i;
 
@@ -260,10 +260,5 @@
   /* Scan the archive for matches.
      ar_glob_match will accumulate them in STATE.chain.  */
-  i = strlen (arname);
-  name = alloca (i + 2);
-  memcpy (name, arname, i);
-  name[i] = '(';
-  name[i + 1] = '\0';
-  state.arname = name;
+  state.arname = arname;
   state.pattern = member_pattern;
   state.size = size;
@@ -282,5 +277,6 @@
 
   /* Sort them alphabetically.  */
-  qsort (names, i, sizeof (*names), alpha_compare);
+  /* MSVC erroneously warns without a cast here.  */
+  qsort ((void *)names, i, sizeof (*names), alpha_compare);
 
   /* Put them back into the chain in the sorted order.  */
Index: /vendor/gnumake/current/arscan.c
===================================================================
--- /vendor/gnumake/current/arscan.c	(revision 2595)
+++ /vendor/gnumake/current/arscan.c	(revision 2596)
@@ -1,6 +1,6 @@
 /* Library function for scanning an archive file.
 Copyright (C) 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
-1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software
-Foundation, Inc.
+1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
+2010 Free Software Foundation, Inc.
 This file is part of GNU Make.
 
@@ -67,5 +67,5 @@
   if (! (status & 1))
     {
-      error (NILF, _("lbr$set_module failed to extract module info, status = %d"),
+      error (NILF, _("lbr$set_module() failed to extract module info, status = %d"),
 	     status);
 
@@ -82,5 +82,26 @@
    * know if this causes problems in other VMS environments.
    */
-  val = decc$fix_time (&mhd->mhd$l_datim) + timezone - daylight*3600;
+  {
+    /* Modified by M. Gehre at 11-JAN-2008 because old formula is wrong:
+     * val = decc$fix_time (&mhd->mhd$l_datim) + timezone - daylight*3600;
+     * a) daylight specifies, if the timezone has daylight saving enabled, not
+     *    if it is active
+     * b) what we need is the information, if daylight saving was active, if
+     *    the library module was replaced. This information we get using the
+     *    localtime function
+     */
+
+    struct tm *tmp;
+
+    /* Conversion from VMS time to C time */
+    val = decc$fix_time (&mhd->mhd$l_datim);
+
+    /*
+     * Conversion from local time (stored in library) to GMT (needed for gmake)
+     * Note: The tm_gmtoff element is a VMS extension to the ANSI standard.
+     */
+    tmp = localtime (&val);
+    val -= tmp->tm_gmtoff;
+  }
 #endif
 
@@ -152,9 +173,10 @@
   if (! (status & 1))
     {
-      error (NILF, _("lbr$ini_control failed with status = %d"),status);
+      error (NILF, _("lbr$ini_control() failed with status = %d"), status);
       return -2;
     }
 
-  libdesc.dsc$a_pointer = archive;
+  /* there is no such descriptor with "const char *dsc$a_pointer" */
+  libdesc.dsc$a_pointer = (char *)archive;
   libdesc.dsc$w_length = strlen (archive);
 
@@ -251,4 +273,5 @@
   };
 # endif
+# define TOCHAR(_m)     (_m)
 #else
 /* These should allow us to read Windows (VC++) libraries (according to Frank
@@ -267,4 +290,6 @@
 # define ar_uid     UserID
 # define ar_gid     GroupID
+/* In Windows the member names have type BYTE so we must cast them.  */
+# define TOCHAR(_m)     ((char *)(_m))
 #endif
 
@@ -610,6 +635,6 @@
 
 #ifndef	M_XENIX
-	sscanf (member_header.ar_mode, "%o", &eltmode);
-	eltsize = atol (member_header.ar_size);
+	sscanf (TOCHAR (member_header.ar_mode), "%o", &eltmode);
+	eltsize = atol (TOCHAR (member_header.ar_size));
 #else	/* Xenix.  */
 	eltmode = (unsigned short int) member_header.ar_mode;
@@ -621,7 +646,7 @@
 		       member_offset + AR_HDR_SIZE, eltsize,
 #ifndef	M_XENIX
-		       atol (member_header.ar_date),
-		       atoi (member_header.ar_uid),
-		       atoi (member_header.ar_gid),
+		       atol (TOCHAR (member_header.ar_date)),
+		       atoi (TOCHAR (member_header.ar_uid)),
+		       atoi (TOCHAR (member_header.ar_gid)),
 #else	/* Xenix.  */
 		       member_header.ar_date,
@@ -794,5 +819,5 @@
   for (ui = 0; ui < sizeof ar_hdr.ar_date; ui++)
     ar_hdr.ar_date[ui] = ' ';
-  sprintf (ar_hdr.ar_date, "%ld", (long int) statbuf.st_mtime);
+  sprintf (TOCHAR (ar_hdr.ar_date), "%ld", (long int) statbuf.st_mtime);
 #ifdef AIAMAG
   ar_hdr.ar_date[strlen(ar_hdr.ar_date)] = ' ';
Index: /vendor/gnumake/current/build.template
===================================================================
--- /vendor/gnumake/current/build.template	(revision 2595)
+++ /vendor/gnumake/current/build.template	(revision 2596)
@@ -4,5 +4,5 @@
 
 # Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
 # This file is part of GNU Make.
 #
Index: /vendor/gnumake/current/build_w32.bat
===================================================================
--- /vendor/gnumake/current/build_w32.bat	(revision 2595)
+++ /vendor/gnumake/current/build_w32.bat	(revision 2596)
@@ -1,5 +1,5 @@
 @echo off
 rem Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
-rem 2006, 2007 Free Software Foundation, Inc.
+rem 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
 rem This file is part of GNU Make.
 rem
@@ -95,7 +95,7 @@
 echo off
 echo "Linking WinDebug/%make%.exe"
-rem link.exe kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib w32\subproc\windebug\subproc.lib /NOLOGO /SUBSYSTEM:console /INCREMENTAL:yes /PDB:.\WinDebug/%make%.pdb /DEBUG /MACHINE:I386 /OUT:.\WinDebug/%make%.exe .\WinDebug/variable.obj  .\WinDebug/rule.obj  .\WinDebug/remote-stub.obj  .\WinDebug/commands.obj  .\WinDebug/file.obj  .\WinDebug/getloadavg.obj  .\WinDebug/default.obj  .\WinDebug/signame.obj  .\WinDebug/expand.obj  .\WinDebug/dir.obj  .\WinDebug/main.obj  .\WinDebug/getopt1.obj  .\WinDebug/job.obj  .\WinDebug/read.obj  .\WinDebug/version.obj  .\WinDebug/getopt.obj  .\WinDebug/arscan.obj  .\WinDebug/remake.obj  .\WinDebug/hash.obj  .\WinDebug/strcache.obj  .\WinDebug/misc.obj  .\WinDebug/ar.obj  .\WinDebug/function.obj  .\WinDebug/vpath.obj  .\WinDebug/implicit.obj  .\WinDebug/dirent.obj  .\WinDebug/glob.obj  .\WinDebug/fnmatch.obj  .\WinDebug/pathstuff.obj
+rem link.exe kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib w32\subproc\windebug\subproc.lib /NOLOGO /SUBSYSTEM:console /INCREMENTAL:yes /PDB:.\WinDebug/%make%.pdb /DEBUG /OUT:.\WinDebug/%make%.exe .\WinDebug/variable.obj  .\WinDebug/rule.obj  .\WinDebug/remote-stub.obj  .\WinDebug/commands.obj  .\WinDebug/file.obj  .\WinDebug/getloadavg.obj  .\WinDebug/default.obj  .\WinDebug/signame.obj  .\WinDebug/expand.obj  .\WinDebug/dir.obj  .\WinDebug/main.obj  .\WinDebug/getopt1.obj  .\WinDebug/job.obj  .\WinDebug/read.obj  .\WinDebug/version.obj  .\WinDebug/getopt.obj  .\WinDebug/arscan.obj  .\WinDebug/remake.obj  .\WinDebug/hash.obj  .\WinDebug/strcache.obj  .\WinDebug/misc.obj  .\WinDebug/ar.obj  .\WinDebug/function.obj  .\WinDebug/vpath.obj  .\WinDebug/implicit.obj  .\WinDebug/dirent.obj  .\WinDebug/glob.obj  .\WinDebug/fnmatch.obj  .\WinDebug/pathstuff.obj
 echo kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib w32\subproc\windebug\subproc.lib >>link.dbg
-link.exe /NOLOGO /SUBSYSTEM:console /INCREMENTAL:yes /PDB:.\WinDebug/%make%.pdb /DEBUG /MACHINE:I386 /OUT:.\WinDebug/%make%.exe @link.dbg
+link.exe /NOLOGO /SUBSYSTEM:console /INCREMENTAL:yes /PDB:.\WinDebug/%make%.pdb /DEBUG /OUT:.\WinDebug/%make%.exe @link.dbg
 if not exist .\WinDebug/%make%.exe echo "WinDebug build failed"
 if exist .\WinDebug/%make%.exe echo "WinDebug build succeeded!"
@@ -162,7 +162,7 @@
 echo off
 echo "Linking WinRel/%make%.exe"
-rem link.exe kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib w32\subproc\winrel\subproc.lib /NOLOGO /SUBSYSTEM:console /INCREMENTAL:no /PDB:.\WinRel/%make%.pdb /MACHINE:I386 /OUT:.\WinRel/%make%.exe .\WinRel/variable.obj  .\WinRel/rule.obj  .\WinRel/remote-stub.obj  .\WinRel/commands.obj  .\WinRel/file.obj  .\WinRel/getloadavg.obj  .\WinRel/default.obj  .\WinRel/signame.obj  .\WinRel/expand.obj  .\WinRel/dir.obj  .\WinRel/main.obj  .\WinRel/getopt1.obj  .\WinRel/job.obj  .\WinRel/read.obj  .\WinRel/version.obj  .\WinRel/getopt.obj  .\WinRel/arscan.obj  .\WinRel/remake.obj  .\WinRel/misc.obj  .\WinRel/hash.obj  .\WinRel/strcache.obj  .\WinRel/ar.obj  .\WinRel/function.obj  .\WinRel/vpath.obj  .\WinRel/implicit.obj  .\WinRel/dirent.obj  .\WinRel/glob.obj  .\WinRel/fnmatch.obj  .\WinRel/pathstuff.obj
+rem link.exe kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib w32\subproc\winrel\subproc.lib /NOLOGO /SUBSYSTEM:console /INCREMENTAL:no /PDB:.\WinRel/%make%.pdb /OUT:.\WinRel/%make%.exe .\WinRel/variable.obj  .\WinRel/rule.obj  .\WinRel/remote-stub.obj  .\WinRel/commands.obj  .\WinRel/file.obj  .\WinRel/getloadavg.obj  .\WinRel/default.obj  .\WinRel/signame.obj  .\WinRel/expand.obj  .\WinRel/dir.obj  .\WinRel/main.obj  .\WinRel/getopt1.obj  .\WinRel/job.obj  .\WinRel/read.obj  .\WinRel/version.obj  .\WinRel/getopt.obj  .\WinRel/arscan.obj  .\WinRel/remake.obj  .\WinRel/misc.obj  .\WinRel/hash.obj  .\WinRel/strcache.obj  .\WinRel/ar.obj  .\WinRel/function.obj  .\WinRel/vpath.obj  .\WinRel/implicit.obj  .\WinRel/dirent.obj  .\WinRel/glob.obj  .\WinRel/fnmatch.obj  .\WinRel/pathstuff.obj
 echo kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib w32\subproc\winrel\subproc.lib >>link.rel
-link.exe /NOLOGO /SUBSYSTEM:console /INCREMENTAL:no /PDB:.\WinRel/%make%.pdb /MACHINE:I386 /OUT:.\WinRel/%make%.exe @link.rel
+link.exe /NOLOGO /SUBSYSTEM:console /INCREMENTAL:no /PDB:.\WinRel/%make%.pdb /OUT:.\WinRel/%make%.exe @link.rel
 if not exist .\WinRel/%make%.exe echo "WinRel build failed"
 if exist .\WinRel/%make%.exe echo "WinRel build succeeded!"
Index: /vendor/gnumake/current/commands.c
===================================================================
--- /vendor/gnumake/current/commands.c	(revision 2595)
+++ /vendor/gnumake/current/commands.c	(revision 2596)
@@ -1,6 +1,6 @@
 /* Command processing for GNU Make.
 Copyright (C) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
-1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software
-Foundation, Inc.
+1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
+2010 Free Software Foundation, Inc.
 This file is part of GNU Make.
 
@@ -41,4 +41,27 @@
 
 
+
+static unsigned long
+dep_hash_1 (const void *key)
+{
+  const struct dep *d = key;
+  return_STRING_HASH_1 (dep_name (d));
+}
+
+static unsigned long
+dep_hash_2 (const void *key)
+{
+  const struct dep *d = key;
+  return_STRING_HASH_2 (dep_name (d));
+}
+
+static int
+dep_hash_cmp (const void *x, const void *y)
+{
+  const struct dep *dx = x;
+  const struct dep *dy = y;
+  return strcmp (dep_name (dx), dep_name (dy));
+}
+
 /* Set FILE's automatic variables up.  */
 
@@ -46,5 +69,5 @@
 set_file_variables (struct file *file)
 {
-  const struct dep *d;
+  struct dep *d;
   const char *at, *percent, *star, *less;
 
@@ -118,5 +141,6 @@
     if (!d->ignore_mtime)
       {
-        less = dep_name (d);
+        if (!d->need_2nd_expansion)
+          less = dep_name (d);
         break;
       }
@@ -150,11 +174,26 @@
     unsigned int len;
 
+    struct hash_table dep_hash;
+    void **slot;
+
     /* Compute first the value for $+, which is supposed to contain
        duplicate dependencies as they were listed in the makefile.  */
 
     plus_len = 0;
+    bar_len = 0;
     for (d = file->deps; d != 0; d = d->next)
-      if (! d->ignore_mtime)
-	plus_len += strlen (dep_name (d)) + 1;
+      {
+        if (!d->need_2nd_expansion)
+          {
+            if (d->ignore_mtime)
+              bar_len += strlen (dep_name (d)) + 1;
+            else
+              plus_len += strlen (dep_name (d)) + 1;
+          }
+      }
+
+    if (bar_len == 0)
+      bar_len++;
+
     if (plus_len == 0)
       plus_len++;
@@ -162,9 +201,10 @@
     if (plus_len > plus_max)
       plus_value = xrealloc (plus_value, plus_max = plus_len);
+
     cp = plus_value;
 
     qmark_len = plus_len + 1;	/* Will be this or less.  */
     for (d = file->deps; d != 0; d = d->next)
-      if (! d->ignore_mtime)
+      if (! d->ignore_mtime && ! d->need_2nd_expansion)
         {
           const char *c = dep_name (d);
@@ -183,5 +223,5 @@
           cp += len;
           *cp++ = FILE_LIST_SEPARATOR;
-          if (! d->changed)
+          if (! (d->changed || always_make_flag))
             qmark_len -= len + 1;	/* Don't space in $? for this one.  */
         }
@@ -191,17 +231,4 @@
     cp[cp > plus_value ? -1 : 0] = '\0';
     DEFINE_VARIABLE ("+", 1, plus_value);
-
-    /* Make sure that no dependencies are repeated.  This does not
-       really matter for the purpose of updating targets, but it
-       might make some names be listed twice for $^ and $?.  */
-
-    uniquize_deps (file->deps);
-
-    bar_len = 0;
-    for (d = file->deps; d != 0; d = d->next)
-      if (d->ignore_mtime)
-	bar_len += strlen (dep_name (d)) + 1;
-    if (bar_len == 0)
-      bar_len++;
 
     /* Compute the values for $^, $?, and $|.  */
@@ -217,10 +244,41 @@
     bp = bar_value;
 
+    /* Make sure that no dependencies are repeated in $^, $?, and $|.  It
+       would be natural to combine the next two loops but we can't do it
+       because of a situation where we have two dep entries, the first
+       is order-only and the second is normal (see below).  */
+
+    hash_init (&dep_hash, 500, dep_hash_1, dep_hash_2, dep_hash_cmp);
+
     for (d = file->deps; d != 0; d = d->next)
       {
-	const char *c = dep_name (d);
-
+        if (d->need_2nd_expansion)
+          continue;
+
+        slot = hash_find_slot (&dep_hash, d);
+        if (HASH_VACANT (*slot))
+          hash_insert_at (&dep_hash, d, slot);
+        else
+          {
+            /* Check if the two prerequisites have different ignore_mtime.
+               If so then we need to "upgrade" one that is order-only.  */
+
+            struct dep* hd = (struct dep*) *slot;
+
+            if (d->ignore_mtime != hd->ignore_mtime)
+              d->ignore_mtime = hd->ignore_mtime = 0;
+          }
+      }
+
+    for (d = file->deps; d != 0; d = d->next)
+      {
+        const char *c;
+
+        if (d->need_2nd_expansion || hash_find_item (&dep_hash, d) != d)
+          continue;
+
+        c = dep_name (d);
 #ifndef	NO_ARCHIVES
-	if (ar_name (c))
+        if (ar_name (c))
 	  {
 	    c = strchr (c, '(') + 1;
@@ -233,14 +291,14 @@
         if (d->ignore_mtime)
           {
-	    memcpy (bp, c, len);
+            memcpy (bp, c, len);
 	    bp += len;
 	    *bp++ = FILE_LIST_SEPARATOR;
 	  }
 	else
-	  {
+          {
             memcpy (cp, c, len);
             cp += len;
             *cp++ = FILE_LIST_SEPARATOR;
-            if (d->changed)
+            if (d->changed || always_make_flag)
               {
                 memcpy (qp, c, len);
@@ -251,4 +309,6 @@
       }
 
+    hash_free (&dep_hash, 0);
+
     /* Kill the last spaces and define the variables.  */
 
@@ -273,5 +333,4 @@
 chop_commands (struct commands *cmds)
 {
-  const char *p;
   unsigned int nlines, idx;
   char **lines;
@@ -283,48 +342,66 @@
     return;
 
-  /* Chop CMDS->commands up into lines in CMDS->command_lines.
-	 Also set the corresponding CMDS->lines_flags elements,
-	 and the CMDS->any_recurse flag.  */
-
-  nlines = 5;
-  lines = xmalloc (5 * sizeof (char *));
-  idx = 0;
-  p = cmds->commands;
-  while (*p != '\0')
-    {
-      const char *end = p;
-    find_end:;
-      end = strchr (end, '\n');
-      if (end == 0)
-        end = p + strlen (p);
-      else if (end > p && end[-1] == '\\')
+  /* Chop CMDS->commands up into lines in CMDS->command_lines.  */
+
+  if (one_shell)
+    {
+      int l = strlen (cmds->commands);
+
+      nlines = 1;
+      lines = xmalloc (nlines * sizeof (char *));
+      lines[0] = xstrdup (cmds->commands);
+
+      /* Strip the trailing newline.  */
+      if (l > 0 && lines[0][l-1] == '\n')
+        lines[0][l-1] = '\0';
+    }
+  else
+    {
+      const char *p;
+
+      nlines = 5;
+      lines = xmalloc (nlines * sizeof (char *));
+      idx = 0;
+      p = cmds->commands;
+      while (*p != '\0')
         {
-          int backslash = 1;
-          const char *b;
-          for (b = end - 2; b >= p && *b == '\\'; --b)
-            backslash = !backslash;
-          if (backslash)
+          const char *end = p;
+        find_end:;
+          end = strchr (end, '\n');
+          if (end == 0)
+            end = p + strlen (p);
+          else if (end > p && end[-1] == '\\')
             {
-              ++end;
-              goto find_end;
+              int backslash = 1;
+              const char *b;
+              for (b = end - 2; b >= p && *b == '\\'; --b)
+                backslash = !backslash;
+              if (backslash)
+                {
+                  ++end;
+                  goto find_end;
+                }
             }
+
+          if (idx == nlines)
+            {
+              nlines += 2;
+              lines = xrealloc (lines, nlines * sizeof (char *));
+            }
+          lines[idx++] = xstrndup (p, end - p);
+          p = end;
+          if (*p != '\0')
+            ++p;
         }
 
-      if (idx == nlines)
+      if (idx != nlines)
         {
-          nlines += 2;
+          nlines = idx;
           lines = xrealloc (lines, nlines * sizeof (char *));
         }
-      lines[idx++] = savestring (p, end - p);
-      p = end;
-      if (*p != '\0')
-        ++p;
-    }
-
-  if (idx != nlines)
-    {
-      nlines = idx;
-      lines = xrealloc (lines, nlines * sizeof (char *));
-    }
+    }
+
+  /* Finally, set the corresponding CMDS->lines_flags elements and the
+     CMDS->any_recurse flag.  */
 
   cmds->ncommand_lines = nlines;
@@ -333,12 +410,12 @@
   cmds->any_recurse = 0;
   cmds->lines_flags = xmalloc (nlines);
+
   for (idx = 0; idx < nlines; ++idx)
     {
       int flags = 0;
-
-      for (p = lines[idx];
-           isblank ((unsigned char)*p) || *p == '-' || *p == '@' || *p == '+';
-           ++p)
-        switch (*p)
+      const char *p = lines[idx];
+
+      while (isblank (*p) || *p == '-' || *p == '@' || *p == '+')
+        switch (*(p++))
           {
           case '+':
Index: /vendor/gnumake/current/commands.h
===================================================================
--- /vendor/gnumake/current/commands.h	(revision 2595)
+++ /vendor/gnumake/current/commands.h	(revision 2596)
@@ -1,6 +1,6 @@
 /* Definition of data structures describing shell commands for GNU Make.
 Copyright (C) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
-1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software
-Foundation, Inc.
+1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
+2010 Free Software Foundation, Inc.
 This file is part of GNU Make.
 
Index: /vendor/gnumake/current/config.ami.template
===================================================================
--- /vendor/gnumake/current/config.ami.template	(revision 2595)
+++ /vendor/gnumake/current/config.ami.template	(revision 2596)
@@ -1,5 +1,5 @@
 /* config.h -- hand-massaged for Amiga                                  -*-C-*-
 Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
-2005, 2006, 2007 Free Software Foundation, Inc.
+2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
 This file is part of GNU Make.
 
Index: /vendor/gnumake/current/config.h-vms.template
===================================================================
--- /vendor/gnumake/current/config.h-vms.template	(revision 2595)
+++ /vendor/gnumake/current/config.h-vms.template	(revision 2596)
@@ -2,5 +2,5 @@
 
 Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
-2006, 2007 Free Software Foundation, Inc.
+2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
 This file is part of GNU Make.
 
@@ -76,4 +76,7 @@
 /* Define to 1 if you don't have vprintf but do have _doprnt.  */
 /* #undef HAVE_DOPRNT */
+
+/* Define to 1 if you have the fdopen function.  */
+#define HAVE_FDOPEN 1
 
 /* Define to 1 if your system has a working fnmatch function.  */
@@ -290,5 +293,5 @@
 
 /* Define to 1 if you have the strcasecmp function.  */
-/* #undef HAVE_STRCASECMP */
+#define HAVE_STRCASECMP 1
 
 /* Define to 1 if you have the strcmpi function.  */
Index: /vendor/gnumake/current/config.h.W32.template
===================================================================
--- /vendor/gnumake/current/config.h.W32.template	(revision 2595)
+++ /vendor/gnumake/current/config.h.W32.template	(revision 2596)
@@ -2,5 +2,5 @@
 
 Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
-2006, 2007 Free Software Foundation, Inc.
+2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
 This file is part of GNU Make.
 
@@ -25,4 +25,6 @@
 # pragma warning(disable:4131) /* uses old-style declarator */
 # pragma warning(disable:4702) /* unreachable code */
+# define _CRT_SECURE_NO_WARNINGS  /* function or variable may be unsafe */
+# define _CRT_NONSTDC_NO_WARNINGS /* functions w/o a leading underscore */
 #endif
 
@@ -228,8 +230,17 @@
 
 /* Define to 1 if you have the `strcmpi' function. */
-#define HAVE_STRCMPI 1
+/* #undef HAVE_STRCMPI */
 
 /* Define to 1 if you have the `stricmp' function. */
-/* #undef HAVE_STRICMP */
+#define HAVE_STRICMP 1
+
+/* Define to 1 if you have the `strncasecmp' function. */
+/* #undef HAVE_STRNCASECMP */
+
+/* Define to 1 if you have the `strncmpi' function. */
+/* #undef HAVE_STRNCMPI */
+
+/* Define to 1 if you have the `strnicmp' function. */
+#define HAVE_STRNICMP 1
 
 /* Define to 1 if you have the `strchr' function. */
@@ -427,5 +438,9 @@
 /* GCC 4.x reportedly defines pid_t.  */
 #ifndef _PID_T_
+#ifdef _WIN64
+#define pid_t __int64
+#else
 #define pid_t int
+#endif
 #endif
 
Index: /vendor/gnumake/current/config/ChangeLog
===================================================================
--- /vendor/gnumake/current/config/ChangeLog	(revision 2595)
+++ /vendor/gnumake/current/config/ChangeLog	(revision 2596)
@@ -30,5 +30,6 @@
 
 
-Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
+Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software
+Foundation, Inc.
 This file is part of GNU Make.
 
Index: /vendor/gnumake/current/config/Makefile.am
===================================================================
--- /vendor/gnumake/current/config/Makefile.am	(revision 2595)
+++ /vendor/gnumake/current/config/Makefile.am	(revision 2596)
@@ -1,5 +1,5 @@
 # -*-Makefile-*-, or close enough
-# Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation,
-# Inc.
+# Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free
+# Software Foundation, Inc.
 # This file is part of GNU Make.
 #
Index: /vendor/gnumake/current/config/dospaths.m4
===================================================================
--- /vendor/gnumake/current/config/dospaths.m4	(revision 2595)
+++ /vendor/gnumake/current/config/dospaths.m4	(revision 2596)
@@ -3,5 +3,5 @@
 #
 # Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
 # This file is part of GNU Make.
 #
Index: /vendor/gnumake/current/configh.dos.template
===================================================================
--- /vendor/gnumake/current/configh.dos.template	(revision 2595)
+++ /vendor/gnumake/current/configh.dos.template	(revision 2596)
@@ -2,5 +2,5 @@
 
 Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
-2004, 2005, 2006, 2007 Free Software Foundation, Inc.
+2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
 This file is part of GNU Make.
 
@@ -17,4 +17,8 @@
 this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
+/* Include this header to make __DJGPP_MINOR__ available because DJGPP ports
+   of GCC 4.3.0 and later no longer do it automatically.  */
+#include <sys/version.h>
+
 /* Many things are defined already by a system header.  */
 #include <sys/config.h>
@@ -22,5 +26,5 @@
 #if __DJGPP__ > 2 || __DJGPP_MINOR__ > 1
 
-/* Define to 1 if `sys_siglist' is declared by <signal.h>.  */
+/* Define to 1 if `sys_siglist' is declared by <signal.h> or <unistd.h>. */
 # define SYS_SIGLIST_DECLARED 1
 
@@ -108,7 +112,4 @@
 #define PROTOTYPES 1
 
-/* Define to 1 if `sys_siglist' is declared by <signal.h> or <unistd.h>. */
-#define SYS_SIGLIST_DECLARED 1
-
 /* Version number of package */
 #define VERSION "%VERSION%"
Index: /vendor/gnumake/current/configure.bat
===================================================================
--- /vendor/gnumake/current/configure.bat	(revision 2595)
+++ /vendor/gnumake/current/configure.bat	(revision 2596)
@@ -1,5 +1,5 @@
 @echo off
 rem Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
-rem 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
+rem 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
 rem This file is part of GNU Make.
 rem
Index: /vendor/gnumake/current/configure.in
===================================================================
--- /vendor/gnumake/current/configure.in	(revision 2595)
+++ /vendor/gnumake/current/configure.in	(revision 2596)
@@ -2,5 +2,5 @@
 #
 # Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
 # This file is part of GNU Make.
 #
@@ -18,8 +18,8 @@
 # this program.  If not, see <http://www.gnu.org/licenses/>.
 
-AC_INIT([GNU make],[3.81.90],[bug-make@gnu.org])
+AC_INIT([GNU make],[3.82],[bug-make@gnu.org])
 
 AC_PREREQ(2.59)
-AC_REVISION([[$Id: configure.in,v 1.148 2007/07/04 19:35:17 psmith Exp $]])
+AC_REVISION([[$Id: configure.in,v 1.156 2010/07/28 05:39:50 psmith Exp $]])
 
 # Autoconf setup
@@ -148,10 +148,15 @@
 fi
 
-AC_CHECK_FUNCS( strdup mkstemp mktemp fdopen \
-	        bsd_signal dup2 getcwd realpath sigsetmask sigaction \
+AC_CHECK_FUNCS( strdup strndup mkstemp mktemp fdopen fileno \
+	        dup2 getcwd realpath sigsetmask sigaction \
                 getgroups seteuid setegid setlinebuf setreuid setregid \
                 getrlimit setrlimit setvbuf pipe strerror strsignal \
 		lstat readlink atexit)
 
+# We need to check declarations, not just existence, because on Tru64 this
+# function is not declared without special flags, which themselves cause
+# other problems.  We'll just use our own.
+AC_CHECK_DECLS([bsd_signal], [], [], [[#include <signal.h>]])
+
 AC_FUNC_SETVBUF_REVERSED
 
@@ -159,5 +164,5 @@
 # It doesn't hurt much to use our own if we can't find it so I don't
 # make the effort here.
-AC_CHECK_FUNCS(strcasecmp strcmpi stricmp)
+AC_CHECK_FUNCS(strcasecmp strncasecmp strcmpi strncmpi stricmp strnicmp)
 
 # strcoll() is used by the GNU glob library
@@ -348,5 +353,4 @@
 # Check the system to see if it provides GNU glob.  If not, use our
 # local version.
-
 AC_MSG_CHECKING(if system libc has GNU glob)
 AC_CACHE_VAL(make_cv_sys_gnu_glob, [
@@ -365,7 +369,12 @@
  ], [AC_MSG_RESULT(yes)
 make_cv_sys_gnu_glob=yes], [AC_MSG_RESULT([no; using local copy])
-AC_SUBST(GLOBINC) GLOBINC='-I$(srcdir)/glob'
-AC_SUBST(GLOBLIB) GLOBLIB=glob/libglob.a
 make_cv_sys_gnu_glob=no])])
+if test "$make_cv_sys_gnu_glob" = no; then
+  GLOBINC='-I$(srcdir)/glob'
+  GLOBLIB=glob/libglob.a
+fi
+AC_SUBST(GLOBINC)
+AC_SUBST(GLOBLIB)
+
 # Tell automake about this, so it can build the right .c files.
 AM_CONDITIONAL(USE_LOCAL_GLOB, test "$make_cv_sys_gnu_glob" = no)
Index: /vendor/gnumake/current/debug.h
===================================================================
--- /vendor/gnumake/current/debug.h	(revision 2595)
+++ /vendor/gnumake/current/debug.h	(revision 2596)
@@ -1,5 +1,5 @@
 /* Debugging macros and interface.
-Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free
-Software Foundation, Inc.
+Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
+2009, 2010 Free Software Foundation, Inc.
 This file is part of GNU Make.
 
Index: /vendor/gnumake/current/default.c
===================================================================
--- /vendor/gnumake/current/default.c	(revision 2595)
+++ /vendor/gnumake/current/default.c	(revision 2596)
@@ -1,6 +1,6 @@
 /* Data base of default implicit rules for GNU Make.
 Copyright (C) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
-1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software
-Foundation, Inc.
+1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
+2010 Free Software Foundation, Inc.
 This file is part of GNU Make.
 
@@ -540,12 +540,12 @@
 
   if (no_builtin_rules_flag)
-    define_variable ("SUFFIXES", 8, "", o_default, 0);
+    define_variable_cname ("SUFFIXES", "", o_default, 0);
   else
     {
       char *p = default_suffixes;
-      suffix_file->deps = (struct dep *)
-	multi_glob (parse_file_seq (&p, '\0', sizeof (struct dep), 1),
-		    sizeof (struct dep));
-      define_variable ("SUFFIXES", 8, default_suffixes, o_default, 0);
+      suffix_file->deps = enter_prereqs(PARSE_FILE_SEQ (&p, struct dep, '\0',
+                                                        NULL, 0),
+                                        NULL);
+      define_variable_cname ("SUFFIXES", default_suffixes, o_default, 0);
     }
 }
Index: /vendor/gnumake/current/dep.h
===================================================================
--- /vendor/gnumake/current/dep.h	(revision 2595)
+++ /vendor/gnumake/current/dep.h	(revision 2596)
@@ -1,6 +1,6 @@
 /* Definitions of dependency data structures for GNU Make.
 Copyright (C) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
-1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software
-Foundation, Inc.
+1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
+2010 Free Software Foundation, Inc.
 This file is part of GNU Make.
 
@@ -44,4 +44,5 @@
     unsigned int staticpattern : 1;
     unsigned int need_2nd_expansion : 1;
+    unsigned int dontcare : 1;
   };
 
@@ -56,10 +57,21 @@
 
 
-struct nameseq *multi_glob (struct nameseq *chain, unsigned int size);
+#define PARSEFS_NONE    (0x0000)
+#define PARSEFS_NOSTRIP (0x0001)
+#define PARSEFS_NOAR    (0x0002)
+#define PARSEFS_NOGLOB  (0x0004)
+#define PARSEFS_EXISTS  (0x0008)
+#define PARSEFS_NOCACHE (0x0010)
+
+#define PARSE_FILE_SEQ(_s,_t,_c,_p,_f) \
+            (_t *)parse_file_seq ((_s),sizeof (_t),(_c),(_p),(_f))
+
 #ifdef VMS
-struct nameseq *parse_file_seq ();
+void *parse_file_seq ();
 #else
-struct nameseq *parse_file_seq (char **stringp, int stopchar, unsigned int size, int strip);
+void *parse_file_seq (char **stringp, unsigned int size,
+                      int stopchar, const char *prefix, int flags);
 #endif
+
 char *tilde_expand (const char *name);
 
@@ -68,13 +80,14 @@
 #endif
 
-#define dep_name(d) ((d)->name == 0 ? (d)->file->name : (d)->name)
+#define dep_name(d)     ((d)->name == 0 ? (d)->file->name : (d)->name)
 
-struct dep *alloc_dep (void);
-void free_dep (struct dep *d);
+#define alloc_dep()     (xcalloc (sizeof (struct dep)))
+#define free_ns(_n)     free (_n)
+#define free_dep(_d)    free_ns (_d)
+
 struct dep *copy_dep_chain (const struct dep *d);
 void free_dep_chain (struct dep *d);
 void free_ns_chain (struct nameseq *n);
 struct dep *read_all_makefiles (const char **makefiles);
-int eval_buffer (char *buffer);
+void eval_buffer (char *buffer);
 int update_goal_chain (struct dep *goals);
-void uniquize_deps (struct dep *);
Index: /vendor/gnumake/current/dir.c
===================================================================
--- /vendor/gnumake/current/dir.c	(revision 2595)
+++ /vendor/gnumake/current/dir.c	(revision 2596)
@@ -1,6 +1,6 @@
 /* Directory hashing for GNU Make.
 Copyright (C) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
-1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software
-Foundation, Inc.
+1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
+2010 Free Software Foundation, Inc.
 This file is part of GNU Make.
 
@@ -24,5 +24,6 @@
 # define NAMLEN(dirent) strlen((dirent)->d_name)
 # ifdef VMS
-char *vmsify (char *name, int type);
+/* its prototype is in vmsdir.h, which is not needed for HAVE_DIRENT_H */
+const char *vmsify (const char *name, int type);
 # endif
 #else
@@ -124,5 +125,4 @@
   static PATH_VAR (new_filename);
   char *df;
-  int i;
 
   if (filename == 0)
@@ -130,6 +130,4 @@
 
   df = new_filename;
-
-  /* First, transform the name part.  */
   while (*filename != '\0')
     {
@@ -147,5 +145,5 @@
 
 static int
-vms_hash (char *name)
+vms_hash (const char *name)
 {
   int h = 0;
@@ -173,5 +171,5 @@
 /* fake stat entry for a directory */
 static int
-vmsstat_dir (char *name, struct stat *st)
+vmsstat_dir (const char *name, struct stat *st)
 {
   char *s;
@@ -186,4 +184,5 @@
   if (s)
     {
+      /* to keep the compiler happy we said "const char *name", now we cheat */
       *s++ = 0;
       st->st_dev = (char *)vms_hash (name);
@@ -194,6 +193,5 @@
     {
       st->st_dev = 0;
-      s = name;
-      h = vms_hash (s);
+      h = vms_hash (name);
     }
 
@@ -453,5 +451,9 @@
       p = name + strlen (name);
       dir = xmalloc (sizeof (struct directory));
+#if defined(HAVE_CASE_INSENSITIVE_FS) && defined(VMS)
+      dir->name = strcache_add_len (downcase(name), p - name);
+#else
       dir->name = strcache_add_len (name, p - name);
+#endif
       hash_insert_at (&directories, dir, dir_slot);
       /* The directory is not in the name hash table.
@@ -711,5 +713,9 @@
 	{
 	  df = xmalloc (sizeof (struct dirfile));
+#if defined(HAVE_CASE_INSENSITIVE_FS) && defined(VMS)
+          df->name = strcache_add_len (downcase(d->d_name), len);
+#else
 	  df->name = strcache_add_len (d->d_name, len);
+#endif
 	  df->length = len;
 	  df->impossible = 0;
@@ -717,5 +723,5 @@
 	}
       /* Check if the name matches the one we're searching for.  */
-      if (filename != 0 && strieq (d->d_name, filename))
+      if (filename != 0 && patheq (d->d_name, filename))
         return 1;
     }
@@ -870,10 +876,7 @@
 
   if (dir->contents == 0)
-    {
-      /* The directory could not be stat'd.  We allocate a contents
-	 structure for it, but leave it out of the contents hash table.  */
-      dir->contents = xmalloc (sizeof (struct directory_contents));
-      memset (dir->contents, '\0', sizeof (struct directory_contents));
-    }
+    /* The directory could not be stat'd.  We allocate a contents
+       structure for it, but leave it out of the contents hash table.  */
+    dir->contents = xcalloc (sizeof (struct directory_contents));
 
   if (dir->contents->dirfiles.ht_vec == 0)
@@ -887,5 +890,9 @@
   new = xmalloc (sizeof (struct dirfile));
   new->length = strlen (filename);
+#if defined(HAVE_CASE_INSENSITIVE_FS) && defined(VMS)
+  new->name = strcache_add_len (downcase(filename), new->length);
+#else
   new->name = strcache_add_len (filename, new->length);
+#endif
   new->impossible = 1;
   hash_insert (&dir->contents->dirfiles, new);
Index: /vendor/gnumake/current/doc/Makefile.am
===================================================================
--- /vendor/gnumake/current/doc/Makefile.am	(revision 2595)
+++ /vendor/gnumake/current/doc/Makefile.am	(revision 2596)
@@ -1,5 +1,5 @@
 # -*-Makefile-*-, or close enough
-# Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software
-# Foundation, Inc.
+# Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
+# 2010 Free Software Foundation, Inc.
 # This file is part of GNU Make.
 #
Index: /vendor/gnumake/current/doc/make.texi
===================================================================
--- /vendor/gnumake/current/doc/make.texi	(revision 2595)
+++ /vendor/gnumake/current/doc/make.texi	(revision 2596)
@@ -4,6 +4,6 @@
 
 @include version.texi
-@set EDITION 0.70
-@set RCSID $Id: make.texi,v 1.52 2008/05/18 15:11:40 psmith Exp $
+@set EDITION 0.71
+@set RCSID $Id: make.texi,v 1.66 2010/07/19 07:10:54 psmith Exp $
 
 @settitle GNU @code{make}
@@ -14,6 +14,6 @@
 @syncodeindex pg cp
 @c FSF publishers: format makebook.texi instead of using this file directly.
-@c ISBN provided by Lisa M. Opus Goldstein <opus@gnu.org>, 5 May 2004
-@set ISBN 1-882114-83-5
+@c ISBN confirmed by Jasimin Huang <jasimin@fsf.org> on 25 Mar 2009
+@set ISBN 1-882114-83-3
 @c %**end of header
 
@@ -27,6 +27,6 @@
 
 Copyright @copyright{} 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995,
-1996, 1997, 1998, 1999, 2000, 2002, 2003, 2004, 2005, 2006, 2007
-Free Software Foundation, Inc.
+1996, 1997, 1998, 1999, 2000, 2002, 2003, 2004, 2005, 2006, 2007,
+2008, 2009, 2010 Free Software Foundation, Inc.
 
 @quotation
@@ -39,6 +39,6 @@
 License.''
 
-(a) The FSF's Back-Cover Text is: ``You are free to copy and modify
-this GNU Manual. Buying copies from GNU Press supports the FSF in
+(a) The FSF's Back-Cover Text is: ``You have the freedom to copy and
+modify this GNU manual.  Buying copies from the FSF supports it in
 developing GNU and promoting software freedom.''
 @end quotation
@@ -202,5 +202,5 @@
 * Interrupts::                  What happens when a recipe is interrupted.
 * Recursion::                   Invoking @code{make} from makefiles.
-* Sequences::                   Defining canned recipes.
+* Canned Recipes::              Defining canned recipes.
 * Empty Recipes::               Defining useful, do-nothing recipes.
 
@@ -234,6 +234,6 @@
 * Override Directive::          How to set a variable in the makefile even if
                                   the user has set it with a command argument.
-* Defining::                    An alternate way to set a variable
-                                  to a verbatim string.
+* Multi-Line::                  An alternate way to set a variable
+                                  to a multi-line string.
 * Environment::                 Variable values can come from the environment.
 * Target-specific::             Variable values can be defined on a per-target
@@ -241,4 +241,5 @@
 * Pattern-specific::            Target-specific variable values can be applied
                                   to a group of targets that match a pattern.
+* Suppressing Inheritance::     Suppress inheritance of variables.
 * Special Variables::           Variables with special meaning or behavior.
 
@@ -524,11 +525,11 @@
 
 @cindex tabs in rules
-A @dfn{recipe} is an action that @code{make} carries out.
-A recipe may have more than one command, each on its own line.
-@strong{Please note:} you need to put a tab character at the beginning of
-every command line!  This is an obscurity that catches the unwary.  If
-you prefer to prefix your recipes with a character other than tab,
-you can set the @code{.CMDPREFIX} variable to an alternate character
-(@pxref{Special Variables}).
+A @dfn{recipe} is an action that @code{make} carries out.  A recipe
+may have more than one command, either on the same line or each on its
+own line.  @strong{Please note:} you need to put a tab character at
+the beginning of every recipe line!  This is an obscurity that catches
+the unwary.  If you prefer to prefix your recipes with a character
+other than tab, you can set the @code{.RECIPEPREFIX} variable to an
+alternate character (@pxref{Special Variables}).
 
 Usually a recipe is in a rule with prerequisites and serves to create a
@@ -629,11 +630,11 @@
 prerequisites.  These recipes say how to update the target file.  A
 tab character (or whatever character is specified by the
-@code{.CMDPREFIX} variable; @pxref{Special Variables}) must come at
+@code{.RECIPEPREFIX} variable; @pxref{Special Variables}) must come at
 the beginning of every line in the recipe to distinguish recipes from
 other lines in the makefile.  (Bear in mind that @code{make} does not
 know anything about how the recipes work.  It is up to you to supply
 recipes that will update the target file properly.  All @code{make}
-does is execute the commands in the recipe you have specified when the
-target file needs to be updated.)@refill
+does is execute the recipe you have specified when the target file
+needs to be updated.)@refill
 @cindex recipe
 
@@ -996,5 +997,5 @@
 @item
 Defining a variable from a verbatim string containing multiple lines
-(@pxref{Defining, ,Defining Variables Verbatim}).
+(@pxref{Multi-Line, ,Defining Multi-Line Variables}).
 @end itemize
 
@@ -1097,5 +1098,5 @@
 Extra spaces are allowed and ignored at the beginning of the line, but
 the first character must not be a tab (or the value of
-@code{.CMDPREFIX})---if the line begins with a tab, it will be
+@code{.RECIPEPREFIX})---if the line begins with a tab, it will be
 considered a recipe line.  Whitespace is required between
 @code{include} and the file names, and between file names; extra
@@ -1171,5 +1172,5 @@
 
 If you want @code{make} to simply ignore a makefile which does not exist
-and cannot be remade, with no error message, use the @w{@code{-include}}
+or cannot be remade, with no error message, use the @w{@code{-include}}
 directive instead of @code{include}, like this:
 
@@ -1179,5 +1180,8 @@
 
 This acts like @code{include} in every way except that there is no
-error (not even a warning) if any of the @var{filenames} do not exist.
+error (not even a warning) if any of the @var{filenames} (or any
+prerequisites of any of the @var{filenames}) do not exist or cannot be
+remade.
+
 For compatibility with some other @code{make} implementations,
 @code{sinclude} is another name for @w{@code{-include}}.
@@ -1191,9 +1195,10 @@
 If the environment variable @code{MAKEFILES} is defined, @code{make}
 considers its value as a list of names (separated by whitespace) of
-additional makefiles to be read before the others.  This works much like
-the @code{include} directive: various directories are searched for those
-files (@pxref{Include, ,Including Other Makefiles}).  In addition, the
-default goal is never taken from one of these makefiles and it is not an
-error if the files listed in @code{MAKEFILES} are not found.@refill
+additional makefiles to be read before the others.  This works much
+like the @code{include} directive: various directories are searched
+for those files (@pxref{Include, ,Including Other Makefiles}).  In
+addition, the default goal is never taken from one of these makefiles
+(or any makefile included by them) and it is not an error if the files
+listed in @code{MAKEFILES} are not found.@refill
 
 @cindex recursion, and @code{MAKEFILES} variable
@@ -1269,5 +1274,5 @@
 
 When you use the @samp{-t} or @samp{--touch} option
-(@pxref{Instead of Execution, ,Instead of Executing the Recipe}),
+(@pxref{Instead of Execution, ,Instead of Executing Recipes}),
 you would not want to use an out-of-date makefile to decide which
 targets to touch.  So the @samp{-t} option has no effect on updating
@@ -1387,4 +1392,20 @@
 define @var{immediate}
   @var{deferred}
+endef
+
+define @var{immediate} =
+  @var{deferred}
+endef
+
+define @var{immediate} ?=
+  @var{deferred}
+endef
+
+define @var{immediate} :=
+  @var{immediate}
+endef
+
+define @var{immediate} +=
+  @var{deferred} or @var{immediate}
 endef
 @end example
@@ -1748,5 +1769,5 @@
 @cindex tab character (in commands)
 The @var{recipe} lines start with a tab character (or the first
-character in the value of the @code{.CMDPREFIX} variable;
+character in the value of the @code{.RECIPEPREFIX} variable;
 @pxref{Special Variables}).  The first recipe line may appear on the line
 after the prerequisites, with a tab character, or may appear on the
@@ -1802,10 +1823,10 @@
 GNU @code{make}: normal prerequisites such as described in the
 previous section, and @dfn{order-only} prerequisites.  A normal
-prerequisite makes two statements: first, it imposes an order of
-execution of recipes: any recipes necessary to build any of a
-target's prerequisites will be fully executed before any recipe
-necessary to build the target.  Second, it imposes a dependency
-relationship: if any prerequisite is newer than the target, then the
-target is considered out-of-date and must be rebuilt.
+prerequisite makes two statements: first, it imposes an order in which
+recipes will be invoked: the recipes for all prerequisites of a target
+will be completed before the recipe for the target is run.  Second, it
+imposes a dependency relationship: if any prerequisite is newer than
+the target, then the target is considered out-of-date and must be
+rebuilt.
 
 Normally, this is exactly what you want: if a target's prerequisite is
@@ -1949,7 +1970,9 @@
 @noindent
 then the value of the variable @code{objects} is the actual string
-@samp{*.o}.  However, if you use the value of @code{objects} in a target,
-prerequisite, or recipe, wildcard expansion will take place at that time.
-To set @code{objects} to the expansion, instead use:
+@samp{*.o}.  However, if you use the value of @code{objects} in a
+target or prerequisite, wildcard expansion will take place there.  If
+you use the value of @code{objects} in a recipe, the shell may perform
+wildcard expansion when the recipe runs.  To set @code{objects} to the
+expansion, instead use:
 
 @example
@@ -2403,6 +2426,7 @@
 
 When a prerequisite's name has the form @samp{-l@var{name}}, @code{make}
-handles it specially by searching for the file @file{lib@var{name}.so} in
-the current directory, in directories specified by matching @code{vpath}
+handles it specially by searching for the file @file{lib@var{name}.so},
+and, if it is not found, for the file @file{lib@var{name}.a} in the current
+directory, in directories specified by matching @code{vpath}
 search paths and the @code{VPATH} search path, and then in the
 directories @file{/lib}, @file{/usr/lib}, and @file{@var{prefix}/lib}
@@ -2410,7 +2434,4 @@
 @code{make} behave as if @var{prefix} is defined to be the root of the
 DJGPP installation tree).
-
-If that file is not found, then the file @file{lib@var{name}.a} is
-searched for, in the same directories as above.
 
 For example, if there is a @file{/usr/lib/libcurses.a} library on your
@@ -2435,6 +2456,5 @@
 @samp{-l@var{name}} is seen, @code{make} will replace the percent in
 each pattern in the list with @var{name} and perform the above directory
-searches using that library filename.  If no library is found, the next
-word in the list will be used.
+searches using each library filename.
 
 The default value for @code{.LIBPATTERNS} is @samp{lib%.so lib%.a},
@@ -2854,4 +2874,28 @@
 recipes in parallel (unless its makefile also contains this target).
 Any prerequisites on this target are ignored.
+
+@findex .ONESHELL
+@item .ONESHELL
+@cindex recipe execution, single invocation
+
+If @code{.ONESHELL} is mentioned as a target, then when a target is
+built all lines of the recipe will be given to a single invocation of
+the shell rather than each line being invoked separately
+(@pxref{Execution, ,Recipe Execution}).
+
+@findex .POSIX
+@item .POSIX
+@cindex POSIX-conforming mode, setting
+
+If @code{.POSIX} is mentioned as a target, then the makefile will be
+parsed and run in POSIX-conforming mode.  This does @emph{not} mean
+that only POSIX-conforming makefiles will be accepted: all advanced
+GNU @code{make} features are still available.  Rather, this target
+causes @code{make} to behave as required by POSIX in those areas
+where @code{make}'s default behavior differs.
+
+In particular, if this target is mentioned then recipes will be
+invoked as if the shell had been passed the @code{-e} flag: the first
+failing command in a recipe will cause the recipe to fail immediately.
 @end table
 
@@ -3168,7 +3212,9 @@
 @cindex @code{::} rules (double-colon)
 
-@dfn{Double-colon} rules are rules written with @samp{::} instead of
-@samp{:} after the target names.  They are handled differently from
-ordinary rules when the same target appears in more than one rule.
+@dfn{Double-colon} rules are explicit rules written with @samp{::}
+instead of @samp{:} after the target names.  They are handled
+differently from ordinary rules when the same target appears in more
+than one rule.  Pattern rules with double-colons have an entirely
+different meaning (@pxref{Match-Anything Rules}).
 
 When a target appears in multiple rules, all the rules must be the same
@@ -3351,5 +3397,5 @@
 Users use many different shell programs, but recipes in makefiles are
 always interpreted by @file{/bin/sh} unless the makefile specifies
-otherwise.  @xref{Execution, ,Command Execution}.
+otherwise.  @xref{Execution, ,Recipe Execution}.
 
 @menu
@@ -3361,5 +3407,5 @@
 * Interrupts::                  What happens when a recipe is interrupted.
 * Recursion::                   Invoking @code{make} from makefiles.
-* Sequences::                   Defining canned recipes.
+* Canned Recipes::              Defining canned recipes.
 * Empty Recipes::               Defining useful, do-nothing recipes.
 @end menu
@@ -3379,5 +3425,5 @@
 
 Each line in the recipe must start with a tab (or the first character
-in the value of the @code{.CMDPREFIX} variable; @pxref{Special
+in the value of the @code{.RECIPEPREFIX} variable; @pxref{Special
 Variables}), except that the first recipe line may be attached to the
 target-and-prerequisites line with a semicolon in between.  @emph{Any}
@@ -3629,10 +3675,10 @@
 @cindex @code{--dry-run}
 @cindex @code{--recon}
-When @code{make} is given the flag @samp{-n} or @samp{--just-print}
-it only echoes recipes, it won't execute them.  @xref{Options Summary,
-,Summary of Options}.  In this case and only this case, even the
-recipe lines starting with @samp{@@} are printed.  This flag is useful for
-finding out which recipes @code{make} thinks are necessary without
-actually doing them.
+When @code{make} is given the flag @samp{-n} or @samp{--just-print} it
+only echoes most recipes, without executing them.  @xref{Options
+Summary, ,Summary of Options}.  In this case even the recipe lines
+starting with @samp{@@} are printed.  This flag is useful for finding
+out which recipes @code{make} thinks are necessary without actually
+doing them.
 
 @cindex @code{-s}
@@ -3654,7 +3700,8 @@
 
 When it is time to execute recipes to update a target, they are
-executed by invoking a new subshell for each line of the recipe.  (In
-practice, @code{make} may take shortcuts that do not affect the
-results.)
+executed by invoking a new subshell for each line of the recipe,
+unless the @code{.ONESHELL} special target is in effect
+(@pxref{One Shell, ,Using One Shell})  (In practice, @code{make} may
+take shortcuts that do not affect the results.)
 
 @cindex @code{cd} (shell command)
@@ -3684,17 +3731,124 @@
 
 @menu
+* One Shell::                   One shell for all lines in a recipe
 * Choosing the Shell::          How @code{make} chooses the shell used
                                   to run recipes.
 @end menu
 
-@node Choosing the Shell,  , Execution, Execution
+@node One Shell, Choosing the Shell, Execution, Execution
+@subsection Using One Shell
+@cindex recipe lines, single shell
+@cindex @code{.ONESHELL}, use of
+@findex .ONESHELL
+
+Sometimes you would prefer that all the lines in the recipe be passed
+to a single invocation of the shell.  There are generally two
+situations where this is useful: first, it can improve performance in
+makefiles where recipes consist of many command lines, by avoiding
+extra processes.  Second, you might want newlines to be included in
+your recipe command (for example perhaps you are using a very
+different interpreter as your @code{SHELL}).  If the @code{.ONESHELL}
+special target appears anywhere in the makefile then @emph{all}
+recipe lines for each target will be provided to a single invocation
+of the shell.  Newlines between recipe lines will be preserved.  For
+example:
+
+@example
+.ONESHELL:
+foo : bar/lose
+        cd $(@@D)
+        gobble $(@@F) > ../$@@
+@end example
+
+@noindent
+would now work as expected even though the commands are on different
+recipe lines.
+
+If @code{.ONESHELL} is provided, then only the first line of the
+recipe will be checked for the special prefix characters (@samp{@@},
+@samp{-}, and @samp{+}).  Subsequent lines will include the special
+characters in the recipe line when the @code{SHELL} is invoked.  If
+you want your recipe to start with one of these special characters
+you'll need to arrange for them to not be the first characters on the
+first line, perhaps by adding a comment or similar.  For example, this
+would be a syntax error in Perl because the first @samp{@@} is removed
+by make:
+
+@example
+.ONESHELL:
+SHELL = /usr/bin/perl
+.SHELLFLAGS = -e
+show :
+        @@f = qw(a b c);
+        print "@@f\n";
+@end example
+
+@noindent
+However, either of these alternatives would work properly:
+
+@example
+.ONESHELL:
+SHELL = /usr/bin/perl
+.SHELLFLAGS = -e
+show :
+        # Make sure "@@" is not the first character on the first line
+        @@f = qw(a b c);
+        print "@@f\n";
+@end example
+
+@noindent
+or
+
+@example
+.ONESHELL:
+SHELL = /usr/bin/perl
+.SHELLFLAGS = -e
+show :
+        my @@f = qw(a b c);
+        print "@@f\n";
+@end example
+
+As a special feature, if @code{SHELL} is determined to be a
+POSIX-style shell, the special prefix characters in ``internal''
+recipe lines will @emph{removed} before the recipe is processed.  This
+feature is intended to allow existing makefiles to add the
+@code{.ONESHELL} special target and still run properly without
+extensive modifications.  Since the special prefix characters are not
+legal at the beginning of a line in a POSIX shell script this is not a
+loss in functionality.  For example, this works as expected:
+
+@example
+.ONESHELL:
+foo : bar/lose
+        @@cd $(@@D)
+        @@gobble $(@@F) > ../$@@
+@end example
+
+Even with this special feature, however, makefiles with
+@code{.ONESHELL} will behave differently in ways that could be
+noticeable.  For example, normally if any line in the recipe fails,
+that causes the rule to fail and no more recipe lines are processed.
+Under @code{.ONESHELL} a failure of any but the final recipe line will
+not be noticed by @code{make}.  You can modify @code{.SHELLFLAGS} to
+add the @code{-e} option to the shell which will cause any failure
+anywhere in the command line to cause the shell to fail, but this
+could itself cause your recipe to behave differently.  Ultimately you
+may need to harden your recipe lines to allow them to work with
+@code{.ONESHELL}.
+
+@node Choosing the Shell,  , One Shell, Execution
 @subsection Choosing the Shell
 @cindex shell, choosing the
 @cindex @code{SHELL}, value of
+@cindex @code{.SHELLFLAGS}, value of
 
 @vindex SHELL
+@vindex .SHELLFLAGS
 The program used as the shell is taken from the variable @code{SHELL}.
 If this variable is not set in your makefile, the program
-@file{/bin/sh} is used as the shell.
+@file{/bin/sh} is used as the shell.  The argument(s) passed to the
+shell are taken from the variable @code{.SHELLFLAGS}.  The default
+value of @code{.SHELLFLAGS} is @code{-c} normally, or @code{-ec} in
+POSIX-conforming mode.
 
 @cindex environment, @code{SHELL} in
@@ -3786,4 +3940,7 @@
 on MS-DOS unaltered if you have e.g.@: @file{sh.exe} installed in some
 directory along your @code{PATH}.
+
+@vindex SHELL
+@vindex .SHELLFLAGS
 
 @node Parallel, Errors, Execution, Recipes
@@ -4014,5 +4171,5 @@
 times to prevent other sorts of trouble.
 
-@node Recursion, Sequences, Interrupts, Recipes
+@node Recursion, Canned Recipes, Interrupts, Recipes
 @section Recursive Use of @code{make}
 @cindex recursion
@@ -4360,5 +4517,5 @@
 ensure that there are only @samp{N} jobs running at the same time
 between them all.  Note that any job that is marked recursive
-(@pxref{Instead of Execution, ,Instead of Executing the Recipes})
+(@pxref{Instead of Execution, ,Instead of Executing Recipes})
 doesn't count against the total jobs (otherwise we could get @samp{N}
 sub-@code{make}s running and have no slots left over for any real work!)
@@ -4496,5 +4653,5 @@
 disable it.
 
-@node Sequences, Empty Recipes, Recursion, Recipes
+@node Canned Recipes, Empty Recipes, Recursion, Recipes
 @section Defining Canned Recipes
 @cindex canned recipes
@@ -4509,8 +4666,8 @@
 not conflict with other variable names.
 
-Here is an example of defining a canned recipes:
-
-@example
-define run-yacc
+Here is an example of defining a canned recipe:
+
+@example
+define run-yacc =
 yacc $(firstword $^)
 mv y.tab.c $@@
@@ -4526,5 +4683,5 @@
 parentheses, variable names, and so on, all become part of the value of the
 variable you are defining.
-@xref{Defining, ,Defining Variables Verbatim},
+@xref{Multi-Line, ,Defining Multi-Line Variables},
 for a complete explanation of @code{define}.
 
@@ -4567,5 +4724,5 @@
 
 @example
-define frobnicate
+define frobnicate =
 @@echo "frobnicating target $@@"
 frob-step-1 $< -o $@@-step-1
@@ -4590,5 +4747,5 @@
 (@xref{Echoing, ,Recipe Echoing}, for a full explanation of @samp{@@}.)
 
-@node Empty Recipes,  , Sequences, Recipes
+@node Empty Recipes,  , Canned Recipes, Recipes
 @section Using Empty Recipes
 @cindex empty recipes
@@ -4685,6 +4842,8 @@
 * Override Directive::          How to set a variable in the makefile even if
                                   the user has set it with a command argument.
-* Defining::                    An alternate way to set a variable
-                                  to a verbatim string.
+* Multi-Line::                  An alternate way to set a variable
+                                  to a multi-line string.
+* Undefine Directive::          How to undefine a variable so that it appears
+                                  as if it was never set.
 * Environment::                 Variable values can come from the environment.
 * Target-specific::             Variable values can be defined on a per-target
@@ -4692,4 +4851,5 @@
 * Pattern-specific::            Target-specific variable values can be applied
                                   to a group of targets that match a pattern.
+* Suppressing Inheritance::     Suppress inheritance of variables.
 * Special Variables::           Variables with special meaning or behavior.
 @end menu
@@ -4761,5 +4921,5 @@
 Variables of this sort are defined by lines using @samp{=}
 (@pxref{Setting, ,Setting Variables}) or by the @code{define} directive
-(@pxref{Defining, ,Defining Variables Verbatim}).  The value you specify
+(@pxref{Multi-Line, ,Defining Multi-Line Variables}).  The value you specify
 is installed verbatim; if it contains references to other variables,
 these references are expanded whenever this variable is substituted (in
@@ -5188,5 +5348,5 @@
 dir = foo
 $(dir)_sources := $(wildcard $(dir)/*.c)
-define $(dir)_print
+define $(dir)_print =
 lpr $($(dir)_sources)
 endef
@@ -5217,5 +5377,5 @@
 You can specify a value in the makefile, either
 with an assignment (@pxref{Setting, ,Setting Variables}) or with a
-verbatim definition (@pxref{Defining, ,Defining Variables Verbatim}).@refill
+verbatim definition (@pxref{Multi-Line, ,Defining Multi-Line Variables}).@refill
 
 @item
@@ -5425,5 +5585,5 @@
 value.
 
-@node Override Directive, Defining, Appending, Using Variables
+@node Override Directive, Multi-Line, Appending, Using Variables
 @section The @code{override} Directive
 @findex override
@@ -5458,4 +5618,9 @@
 @xref{Appending, ,Appending More Text to Variables}.
 
+Variable assignments marked with the @code{override} flag have a
+higher priority than all other assignments, except another
+@code{override}.  Subsequent assignments or appends to this variable
+which are not marked @code{override} will be ignored.
+
 The @code{override} directive was not invented for escalation in the war
 between makefiles and command arguments.  It was invented so you can alter
@@ -5475,5 +5640,5 @@
 
 @example
-override define foo
+override define foo =
 bar
 endef
@@ -5485,11 +5650,13 @@
 @end iftex
 @ifnottex
-@xref{Defining, ,Defining Variables Verbatim}.
+@xref{Multi-Line, ,Defining Multi-Line Variables}.
 @end ifnottex
 
-@node Defining, Environment, Override Directive, Using Variables
-@section Defining Variables Verbatim
+@node Multi-Line, Undefine Directive, Override Directive, Using Variables
+@section Defining Multi-Line Variables
 @findex define
 @findex endef
+@cindex multi-line variable definition
+@cindex variables, multi-line
 @cindex verbatim variable definition
 @cindex defining variables verbatim
@@ -5498,18 +5665,25 @@
 Another way to set the value of a variable is to use the @code{define}
 directive.  This directive has an unusual syntax which allows newline
-characters to be included in the value, which is convenient for defining
-both canned sequences of commands
-(@pxref{Sequences, ,Defining Canned Command Sequences}), and also
-sections of makefile syntax to use with @code{eval} (@pxref{Eval Function}).
-
-The @code{define} directive is followed on the same line by the name of the
-variable and nothing more.  The value to give the variable appears on the
-following lines.  The end of the value is marked by a line containing just
-the word @code{endef}.  Aside from this difference in syntax, @code{define}
-works just like @samp{=}: it creates a recursively-expanded variable
-(@pxref{Flavors, ,The Two Flavors of Variables}).
-The variable name may contain function and variable references, which
-are expanded when the directive is read to find the actual variable name
+characters to be included in the value, which is convenient for
+defining both canned sequences of commands (@pxref{Canned Recipes,
+,Defining Canned Recipes}), and also sections of makefile syntax to
+use with @code{eval} (@pxref{Eval Function}).@refill
+
+The @code{define} directive is followed on the same line by the name
+of the variable being defined and an (optional) assignment operator,
+and nothing more.  The value to give the variable appears on the
+following lines.  The end of the value is marked by a line containing
+just the word @code{endef}.  Aside from this difference in syntax,
+@code{define} works just like any other variable definition.  The
+variable name may contain function and variable references, which are
+expanded when the directive is read to find the actual variable name
 to use.
+
+You may omit the variable assignment operator if you prefer.  If
+omitted, @code{make} assumes it to be @samp{=} and creates a
+recursively-expanded variable (@pxref{Flavors, ,The Two Flavors of Variables}).
+When using a @samp{+=} operator, the value is appended to the previous
+value as with any other append operation: with a single space
+separating the old and new values.
 
 You may nest @code{define} directives: @code{make} will keep track of
@@ -5518,8 +5692,8 @@
 prefix character are considered part of a recipe, so any @code{define}
 or @code{endef} strings appearing on such a line will not be
-considered @code{make} operators.
-
-@example
-define two-lines
+considered @code{make} directives.
+
+@example
+define two-lines =
 echo foo
 echo $(bar)
@@ -5551,5 +5725,5 @@
 
 @example
-override define two-lines
+override define two-lines =
 foo
 $(bar)
@@ -5560,5 +5734,40 @@
 @xref{Override Directive, ,The @code{override} Directive}.
 
-@node Environment, Target-specific, Defining, Using Variables
+@node Undefine Directive, Environment, Multi-Line, Using Variables
+@section Undefining Variables
+@findex undefine
+@cindex undefining variable
+
+If you want to clear a variable, setting its value to empty is usually
+sufficient. Expanding such a variable will yield the same result (empty
+string) regardless of whether it was set or not. However, if you are
+using the @code{flavor} (@pxref{Flavor Function}) and
+@code{origin} (@pxref{Origin Function}) functions, there is a difference
+between a variable that was never set and a variable with an empty value.
+In such situations you may want to use the @code{undefine} directive to
+make a variable appear as if it was never set. For example:
+
+@example
+foo := foo
+bar = bar
+
+undefine foo
+undefine bar
+
+$(info $(origin foo))
+$(info $(flavor bar))
+@end example
+
+This example will print ``undefined'' for both variables.
+
+If you want to undefine a command-line variable definition, you can use
+the @code{override} directive together with @code{undefine}, similar to
+how this is done for variable definitions:
+
+@example
+override undefine CFLAGS
+@end example
+
+@node Environment, Target-specific, Undefine Directive, Using Variables
 @section Variables from the Environment
 
@@ -5626,17 +5835,7 @@
 @end example
 
-@noindent
-or like this:
-
-@example
-@var{target} @dots{} : override @var{variable-assignment}
-@end example
-
-@noindent
-or like this:
-
-@example
-@var{target} @dots{} : export @var{variable-assignment}
-@end example
+Target-specific variable assignments can be prefixed with any or all of the
+special keywords @code{export}, @code{override}, or @code{private};
+these apply their normal behavior to this instance of the variable only.
 
 Multiple @var{target} values create a target-specific variable value for
@@ -5684,5 +5883,5 @@
 ignore the target-specific values from any other targets.
 
-@node Pattern-specific, Special Variables, Target-specific, Using Variables
+@node Pattern-specific, Suppressing Inheritance, Target-specific, Using Variables
 @section Pattern-specific Variable Values
 @cindex pattern-specific variables
@@ -5693,10 +5892,5 @@
 @code{make} supports pattern-specific variable values.  In this form,
 the variable is defined for any target that matches the pattern
-specified.  If a target matches more than one pattern, all the
-matching pattern-specific variables are interpreted in the order in
-which they were defined in the makefile, and collected together into
-one set.  Variables defined in this way are searched after any
-target-specific variables defined explicitly for that target, and
-before target-specific variables defined for the parent target.
+specified.
 
 Set a pattern-specific variable value like this:
@@ -5705,13 +5899,4 @@
 @var{pattern} @dots{} : @var{variable-assignment}
 @end example
-
-@noindent
-or like this:
-
-@example
-@var{pattern} @dots{} : override @var{variable-assignment}
-@end example
-
-@noindent
 where @var{pattern} is a %-pattern.  As with target-specific variable
 values, multiple @var{pattern} values create a pattern-specific variable
@@ -5730,5 +5915,66 @@
 matching the pattern @code{%.o}.
 
-@node Special Variables,  , Pattern-specific, Using Variables
+If a target matches more than one pattern, the matching pattern-specific
+variables with longer stems are interpreted first. This results in more
+specific variables taking precedence over the more generic ones, for
+example:
+
+@example
+%.o: %.c
+        $(CC) -c $(CFLAGS) $(CPPFLAGS) $< -o $@@
+
+lib/%.o: CFLAGS := -fPIC -g
+%.o: CFLAGS := -g
+
+all: foo.o lib/bar.o
+@end example
+
+In this example the first definition of the @code{CFLAGS} variable
+will be used to update @file{lib/bar.o} even though the second one
+also applies to this target. Pattern-specific variables which result
+in the same stem length are considered in the order in which they
+were defined in the makefile.
+
+Pattern-specific variables are searched after any target-specific
+variables defined explicitly for that target, and before target-specific
+variables defined for the parent target.
+
+@node Suppressing Inheritance, Special Variables, Pattern-specific, Using Variables
+@section Suppressing Inheritance
+@findex private
+@cindex suppressing inheritance
+@cindex inheritance, suppressing
+
+As described in previous sections, @code{make} variables are inherited
+by prerequisites.  This capability allows you to modify the behavior
+of a prerequisite based on which targets caused it to be rebuilt.  For
+example, you might set a target-specific variable on a @code{debug}
+target, then running @samp{make debug} will cause that variable to be
+inherited by all prerequisites of @code{debug}, while just running
+@samp{make all} (for example) would not have that assignment.
+
+Sometimes, however, you may not want a variable to be inherited.  For
+these situations, @code{make} provides the @code{private} modifier.
+Although this modifier can be used with any variable assignment, it
+makes the most sense with target- and pattern-specific variables.  Any
+variable marked @code{private} will be visible to its local target but
+will not be inherited by prerequisites of that target.  A global
+variable marked @code{private} will be visible in the global scope but
+will not be inherited by any target, and hence will not be visible
+in any recipe.
+
+As an example, consider this makefile:
+@example
+EXTRA_CFLAGS =
+
+prog: private EXTRA_CFLAGS = -L/usr/local/lib
+prog: a.o b.o
+@end example
+
+Due to the @code{private} modifier, @code{a.o} and @code{b.o} will not
+inherit the @code{EXTRA_CFLAGS} variable assignment from the
+@code{progs} target.
+
+@node Special Variables,  , Suppressing Inheritance, Using Variables
 @comment  node-name,  next,  previous,  up
 @section Other Special Variables
@@ -5834,6 +6080,6 @@
 variable).  You should not set, modify, or export this variable.
 
-@vindex .CMDPREFIX @r{(change the recipe prefix character)}
-@item .CMDPREFIX
+@vindex .RECIPEPREFIX @r{(change the recipe prefix character)}
+@item .RECIPEPREFIX
 The first character of the value of this variable is used as the
 character make assumes is introducing a recipe line.  If the variable
@@ -5843,5 +6089,5 @@
 @example
 @group
-.CMDPREFIX = >
+.RECIPEPREFIX = >
 all:
 > @@echo Hello, world
@@ -5849,5 +6095,5 @@
 @end example
 
-The value of @code{.CMDPREFIX} can be changed multiple times; once set
+The value of @code{.RECIPEPREFIX} can be changed multiple times; once set
 it stays in effect for all rules parsed until it is modified.
 
@@ -7175,5 +7421,5 @@
 all: $(PROGRAMS)
 
-define PROGRAM_template
+define PROGRAM_template =
  $(1): $$($(1)_OBJS) $$($(1)_LIBS:%=-l%)
  ALL_OBJS   += $$($(1)_OBJS)
@@ -7228,12 +7474,13 @@
 @item environment
 
-if @var{variable} was defined as an environment variable and the
-@samp{-e} option is @emph{not} turned on (@pxref{Options Summary, ,Summary of Options}).
+if @var{variable} was inherited from the environment provided to
+@code{make}.
 
 @item environment override
 
-if @var{variable} was defined as an environment variable and the
-@w{@samp{-e}} option @emph{is} turned on (@pxref{Options Summary,
-,Summary of Options}).@refill
+if @var{variable} was inherited from the environment provided to
+@code{make}, and is overriding a setting for @var{variable} in the
+makefile as a result of the @w{@samp{-e}} option (@pxref{Options
+Summary, ,Summary of Options}).@refill
 
 @item file
@@ -7476,5 +7723,5 @@
 The exit status is one if you use the @samp{-q} flag and @code{make}
 determines that some target is not already up to date.
-@xref{Instead of Execution, ,Instead of Executing the Recipes}.
+@xref{Instead of Execution, ,Instead of Executing Recipes}.
 @end table
 
@@ -7653,5 +7900,5 @@
 
 @node Instead of Execution, Avoiding Compilation, Goals, Running
-@section Instead of Executing the Recipes
+@section Instead of Executing Recipes
 @cindex execution, instead of
 @cindex recipes, instead of executing
@@ -7673,5 +7920,6 @@
 
 ``No-op''.  The activity is to print what recipe would be used to make
-the targets up to date, but not actually execute it.
+the targets up to date, but not actually execute it.  Some recipes are
+still executed, even with this flag (@pxref{MAKE Variable, ,How the @code{MAKE} Variable Works}).
 
 @item -t
@@ -7715,5 +7963,5 @@
 
 With the @samp{-n} flag, @code{make} prints the recipe that it would
-normally execute but does not execute it.
+normally execute but usually does not execute it.
 
 With the @samp{-t} flag, @code{make} ignores the recipes in the rules
@@ -7741,4 +7989,9 @@
 not run unless they too begin with @samp{+} or contain @samp{$(MAKE)} or
 @samp{$@{MAKE@}} (@xref{MAKE Variable, ,How the @code{MAKE} Variable Works}.)
+
+@cindex phony targets and recipe execution
+The @samp{-t} flag prevents phony targets (@pxref{Phony Targets}) from
+being updated, unless there are recipe lines beginning with @samp{+}
+or containing @samp{$(MAKE)} or @samp{$@{MAKE@}}.
 
 The @samp{-W} flag provides two features:
@@ -8007,4 +8260,13 @@
 @xref{Environment, ,Variables from the Environment}.
 
+@item --eval=@var{string}
+@cindex @code{--eval}
+@c Extra blank line here makes the table look better.
+
+Evaluate @var{string} as makefile syntax.  This is a command-line
+version of the @code{eval} function (@pxref{Eval Function}).  The
+evaluation is performed after the default rules and variables have
+been defined, but before any makefiles are read.
+
 @item -f @var{file}
 @cindex @code{-f}
@@ -8090,6 +8352,7 @@
 @c Extra blank line here makes the table look better.
 
-Print the recipe that would be executed, but do not execute it.
-@xref{Instead of Execution, ,Instead of Executing the Recipes}.
+Print the recipe that would be executed, but do not execute it (except
+in certain circumstances).
+@xref{Instead of Execution, ,Instead of Executing Recipes}.
 
 @item -o @var{file}
@@ -8128,5 +8391,5 @@
 return an exit status that is zero if the specified targets are already
 up to date, one if any remaking is required, or two if an error is
-encountered.  @xref{Instead of Execution, ,Instead of Executing the
+encountered.  @xref{Instead of Execution, ,Instead of Executing
 Recipes}.@refill
 
@@ -8190,5 +8453,5 @@
 instead of running their recipes.  This is used to pretend that the
 recipes were done, in order to fool future invocations of
-@code{make}.  @xref{Instead of Execution, ,Instead of Executing the Recipes}.
+@code{make}.  @xref{Instead of Execution, ,Instead of Executing Recipes}.
 
 @item -v
@@ -8231,5 +8494,5 @@
 @code{make}, except that the modification time is changed only in the
 imagination of @code{make}.
-@xref{Instead of Execution, ,Instead of Executing the Recipes}.
+@xref{Instead of Execution, ,Instead of Executing Recipes}.
 
 @item --warn-undefined-variables
@@ -8421,5 +8684,5 @@
 @pindex .c
 @file{@var{n}.o} is made automatically from @file{@var{n}.c} with
-a recipe of the form @samp{$(CC) -c $(CPPFLAGS) $(CFLAGS)}.@refill
+a recipe of the form @samp{$(CC) $(CPPFLAGS) $(CFLAGS) -c}.@refill
 
 @item Compiling C++ programs
@@ -8431,5 +8694,5 @@
 @file{@var{n}.o} is made automatically from @file{@var{n}.cc},
 @file{@var{n}.cpp}, or @file{@var{n}.C} with a recipe of the form
-@samp{$(CXX) -c $(CPPFLAGS) $(CXXFLAGS)}.  We encourage you to use the
+@samp{$(CXX) $(CPPFLAGS) $(CXXFLAGS) -c}.  We encourage you to use the
 suffix @samp{.cc} for C++ source files instead of @samp{.C}.@refill
 
@@ -8439,5 +8702,5 @@
 @pindex .p
 @file{@var{n}.o} is made automatically from @file{@var{n}.p}
-with the recipe @samp{$(PC) -c $(PFLAGS)}.@refill
+with the recipe @samp{$(PC) $(PFLAGS) -c}.@refill
 
 @item Compiling Fortran and Ratfor programs
@@ -8454,9 +8717,9 @@
 @table @samp
 @item .f
-@samp{$(FC) -c $(FFLAGS)}.
+@samp{$(FC) $(FFLAGS) -c}.
 @item .F
-@samp{$(FC) -c $(FFLAGS) $(CPPFLAGS)}.
+@samp{$(FC) $(FFLAGS) $(CPPFLAGS) -c}.
 @item .r
-@samp{$(FC) -c $(FFLAGS) $(RFLAGS)}.
+@samp{$(FC) $(FFLAGS) $(RFLAGS) -c}.
 @end table
 
@@ -8469,7 +8732,7 @@
 @table @samp
 @item .F
-@samp{$(FC) -F $(CPPFLAGS) $(FFLAGS)}.
+@samp{$(FC) $(CPPFLAGS) $(FFLAGS) -F}.
 @item .r
-@samp{$(FC) -F $(FFLAGS) $(RFLAGS)}.
+@samp{$(FC) $(FFLAGS) $(RFLAGS) -F}.
 @end table
 
@@ -9066,4 +9329,8 @@
 pattern.  @xref{Last Resort}.
 
+More than one pattern rule may match a target.  In this case
+@code{make} will choose the ``best fit'' rule.  @xref{Pattern Match,
+,How Patterns Match}.
+
 @c !!! The end of of this paragraph should be rewritten.  --bob
 Pattern rules may have more than one target.  Unlike normal rules,
@@ -9081,14 +9348,4 @@
 @cindex target, multiple in pattern rule
 
-The order in which pattern rules appear in the makefile is important
-since this is the order in which they are considered.
-Of equally applicable
-rules, only the first one found is used.  The rules you write take precedence
-over those that are built in.  Note however, that a rule whose
-prerequisites actually exist or are mentioned always takes priority over a
-rule with prerequisites that must be made by chaining other implicit rules.
-@cindex pattern rules, order of
-@cindex order of pattern rules
-
 @node Pattern Examples, Automatic Variables, Pattern Intro, Pattern Rules
 @subsection Pattern Rule Examples
@@ -9403,4 +9660,48 @@
 @file{src/car}.@refill
 
+@cindex pattern rules, order of
+@cindex order of pattern rules
+A pattern rule can be used to build a given file only if there is a
+target pattern that matches the file name, @emph{and} all
+prerequisites in that rule either exist or can be built.  The rules
+you write take precedence over those that are built in. Note however,
+that a rule whose prerequisites actually exist or are mentioned always
+takes priority over a rule with prerequisites that must be made by
+chaining other implicit rules.
+
+@cindex stem, shortest
+It is possible that more than one pattern rule will meet these
+criteria.  In that case, @code{make} will choose the rule with the
+shortest stem (that is, the pattern that matches most specifically).
+If more than one pattern rule has the shortest stem, @code{make} will
+choose the first one found in the makefile.
+
+This algorithm results in more specific rules being preferred over
+more generic ones; for example:
+
+@example
+%.o: %.c
+        $(CC) -c $(CFLAGS) $(CPPFLAGS) $< -o $@@
+
+%.o : %.f
+        $(COMPILE.F) $(OUTPUT_OPTION) $<
+
+lib/%.o: lib/%.c
+        $(CC) -fPIC -c $(CFLAGS) $(CPPFLAGS) $< -o $@@
+@end example
+
+Given these rules and asked to build @file{bar.o} where both
+@file{bar.c} and @file{bar.f} exist, @code{make} will choose the first
+rule and compile @file{bar.c} into @file{bar.o}.  In the same
+situation where @file{bar.c} does not exist, then @code{make} will
+choose the second rule and compile @file{bar.f} into @file{bar.o}.
+
+If @code{make} is asked to build @file{lib/bar.o} and both
+@file{lib/bar.c} and @file{lib/bar.f} exist, then the third rule will
+be chosen since the stem for this rule (@samp{bar}) is shorter than
+the stem for the first rule (@samp{lib/bar}).  If @file{lib/bar.c}
+does not exist then the third rule is not eligible and the second rule
+will be used, even though the stem is longer.
+
 @node Match-Anything Rules, Canceling Rules, Pattern Match, Pattern Rules
 @subsection Match-Anything Pattern Rules
@@ -10084,5 +10385,5 @@
 The ``what if'' flag (@samp{-W} in GNU @code{make}) was (as far as we know)
 invented by Andrew Hume in @code{mk}.
-@xref{Instead of Execution, ,Instead of Executing the Recipes}.
+@xref{Instead of Execution, ,Instead of Executing Recipes}.
 
 @item
@@ -10102,5 +10403,5 @@
 @item
 The special significance of @samp{+} characters preceding recipe lines
-(@pxref{Instead of Execution, ,Instead of Executing the Recipes}) is
+(@pxref{Instead of Execution, ,Instead of Executing Recipes}) is
 mandated by @cite{IEEE Standard 1003.2-1992} (POSIX.2).
 
@@ -10147,5 +10448,5 @@
 @item
 Make verbatim variable definitions with @code{define}.
-@xref{Defining, ,Defining Variables Verbatim}.
+@xref{Multi-Line, ,Defining Multi-Line Variables}.
 
 @item
@@ -10355,8 +10656,15 @@
 @table @code
 @item define @var{variable}
+@itemx define @var{variable} =
+@itemx define @var{variable} :=
+@itemx define @var{variable} +=
+@itemx define @var{variable} ?=
 @itemx endef
-
-Define a multi-line, recursively-expanded variable.@*
-@xref{Sequences}.
+Define multi-line variables.@*
+@xref{Multi-Line}.
+
+@item undefine @var{variable}
+Undefining variables.@*
+@xref{Undefine Directive}.
 
 @item ifdef @var{variable}
@@ -10370,5 +10678,4 @@
 @itemx else
 @itemx endif
-
 Conditionally evaluate part of the makefile.@*
 @xref{Conditionals}.
@@ -10377,15 +10684,8 @@
 @itemx -include @var{file}
 @itemx sinclude @var{file}
-
 Include another makefile.@*
 @xref{Include, ,Including Other Makefiles}.
 
-@item override @var{variable} = @var{value}
-@itemx override @var{variable} := @var{value}
-@itemx override @var{variable} += @var{value}
-@itemx override @var{variable} ?= @var{value}
-@itemx override define @var{variable}
-@itemx endef
-
+@item override @var{variable-assignment}
 Define a variable, overriding any previous definition, even one from
 the command line.@*
@@ -10393,17 +10693,17 @@
 
 @item export
-
 Tell @code{make} to export all variables to child processes by default.@*
 @xref{Variables/Recursion, , Communicating Variables to a Sub-@code{make}}.
 
 @item export @var{variable}
-@itemx export @var{variable} = @var{value}
-@itemx export @var{variable} := @var{value}
-@itemx export @var{variable} += @var{value}
-@itemx export @var{variable} ?= @var{value}
+@itemx export @var{variable-assignment}
 @itemx unexport @var{variable}
 Tell @code{make} whether or not to export a particular variable to child
 processes.@*
 @xref{Variables/Recursion, , Communicating Variables to a Sub-@code{make}}.
+
+@item private @var{variable-assignment}
+Do not allow this variable assignment to be inherited by prerequisites.@*
+@xref{Suppressing Inheritance}.
 
 @item vpath @var{pattern} @var{path}
@@ -10515,5 +10815,4 @@
 
 @item $(error @var{text}@dots{})
-
 When this function is evaluated, @code{make} generates a fatal error
 with the message @var{text}.@*
@@ -10521,5 +10820,4 @@
 
 @item $(warning @var{text}@dots{})
-
 When this function is evaluated, @code{make} generates a warning with
 the message @var{text}.@*
@@ -10527,10 +10825,8 @@
 
 @item $(shell @var{command})
-
 Execute a shell command and return its output.@*
 @xref{Shell Function, , The @code{shell} Function}.
 
 @item $(origin @var{variable})
-
 Return a string describing how the @code{make} variable @var{variable} was
 defined.@*
@@ -10538,5 +10834,4 @@
 
 @item $(flavor @var{variable})
-
 Return a string describing the flavor of the @code{make} variable
 @var{variable}.@*
@@ -10544,11 +10839,28 @@
 
 @item $(foreach @var{var},@var{words},@var{text})
-
 Evaluate @var{text} with @var{var} bound to each word in @var{words},
 and concatenate the results.@*
 @xref{Foreach Function, ,The @code{foreach} Function}.
 
+@item $(if @var{condition},@var{then-part}[,@var{else-part}])
+Evaluate the condition @var{condition}; if it's non-empty substitute
+the expansion of the @var{then-part} otherwise substitute the
+expansion of the @var{else-part}.@*
+@xref{Conditional Functions, ,Functions for Conditionals}.
+
+@item $(or @var{condition1}[,@var{condition2}[,@var{condition3}@dots{}]])
+Evaluate each condition @var{conditionN} one at a time; substitute the
+first non-empty expansion.  If all expansions are empty, substitute
+the empty string.@*
+@xref{Conditional Functions, ,Functions for Conditionals}.
+
+@item $(and @var{condition1}[,@var{condition2}[,@var{condition3}@dots{}]])
+Evaluate each condition @var{conditionN} one at a time; if any
+expansion results in the empty string substitute the empty string.  If
+all expansions result in a non-empty string, substitute the expansion
+of the last @var{condition}.@*
+@xref{Conditional Functions, ,Functions for Conditionals}.
+
 @item $(call @var{var},@var{param},@dots{})
-
 Evaluate the variable @var{var} replacing any references to @code{$(1)},
 @code{$(2)} with the first, second, etc.@: @var{param} values.@*
@@ -10556,5 +10868,4 @@
 
 @item $(eval @var{text})
-
 Evaluate @var{text} then read the results as makefile commands.
 Expands to the empty string.@*
@@ -10562,5 +10873,4 @@
 
 @item $(value @var{var})
-
 Evaluates to the contents of the variable @var{var}, with no expansion
 performed on it.@*
@@ -10747,5 +11057,5 @@
 second form of the error above.  Remember that every line in the
 recipe must begin with a tab character (unless you set
-@code{.CMDPREFIX}; @pxref{Special Variables}).  Eight spaces do not
+@code{.RECIPEPREFIX}; @pxref{Special Variables}).  Eight spaces do not
 count.  @xref{Rule Syntax}.
 
@@ -11007,16 +11317,14 @@
 #### End of system configuration section. ####
 
-SRC1 =  tar.c create.c extract.c buffer.c \
-        getoldopt.c update.c gnu.c mangle.c
-SRC2 =  version.c list.c names.c diffarch.c \
-        port.c wildmat.c getopt.c
-SRC3 =  getopt1.c regex.c getdate.y
-SRCS =  $(SRC1) $(SRC2) $(SRC3)
-OBJ1 =  tar.o create.o extract.o buffer.o \
-        getoldopt.o update.o gnu.o mangle.o
-OBJ2 =  version.o list.o names.o diffarch.o \
-        port.o wildmat.o getopt.o
-OBJ3 =  getopt1.o regex.o getdate.o $(RTAPELIB)
-OBJS =  $(OBJ1) $(OBJ2) $(OBJ3)
+@group
+SRCS_C  = tar.c create.c extract.c buffer.c   \
+          getoldopt.c update.c gnu.c mangle.c \
+          version.c list.c names.c diffarch.c \
+          port.c wildmat.c getopt.c getopt1.c \
+          regex.c
+SRCS_Y  = getdate.y
+SRCS    = $(SRCS_C) $(SRCS_Y)
+OBJS    = $(SRCS_C:.c=.o) $(SRCS_Y:.y=.o) $(RTAPELIB)
+@end group
 @group
 AUX =   README COPYING ChangeLog Makefile.in  \
Index: /vendor/gnumake/current/dosbuild.bat
===================================================================
--- /vendor/gnumake/current/dosbuild.bat	(revision 2595)
+++ /vendor/gnumake/current/dosbuild.bat	(revision 2596)
@@ -1,5 +1,5 @@
 @echo off
-rem Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
-rem Free Software Foundation, Inc.
+rem Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
+rem 2008, 2009, 2010 Free Software Foundation, Inc.
 rem This file is part of GNU Make.
 rem
Index: /vendor/gnumake/current/expand.c
===================================================================
--- /vendor/gnumake/current/expand.c	(revision 2595)
+++ /vendor/gnumake/current/expand.c	(revision 2596)
@@ -1,6 +1,6 @@
 /* Variable expansion functions for GNU Make.
 Copyright (C) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
-1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software
-Foundation, Inc.
+1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
+2010 Free Software Foundation, Inc.
 This file is part of GNU Make.
 
@@ -410,6 +410,6 @@
       if (*p == '\0')
 	break;
-      else
-	++p;
+
+      ++p;
     }
 
@@ -443,5 +443,6 @@
 expand_argument (const char *str, const char *end)
 {
-  char *tmp;
+  char *tmp, *alloc = NULL;
+  char *r;
 
   if (str == end)
@@ -451,9 +452,18 @@
     return allocated_variable_expand (str);
 
-  tmp = alloca (end - str + 1);
+  if (end - str + 1 > 1000)
+    tmp = alloc = xmalloc (end - str + 1);
+  else
+    tmp = alloca (end - str + 1);
+
   memcpy (tmp, str, end - str);
   tmp[end - str] = '\0';
 
-  return allocated_variable_expand (tmp);
+  r = allocated_variable_expand (tmp);
+
+  if (alloc)
+    free (alloc);
+
+  return r;
 }
 
@@ -570,9 +580,4 @@
   value = variable_expand_for_file (line, file);
 
-#if 0
-  /* Waste a little memory and save time.  */
-  value = xrealloc (value, strlen (value))
-#endif
-
   variable_buffer = obuf;
   variable_buffer_length = olen;
Index: /vendor/gnumake/current/file.c
===================================================================
--- /vendor/gnumake/current/file.c	(revision 2595)
+++ /vendor/gnumake/current/file.c	(revision 2596)
@@ -1,6 +1,6 @@
 /* Target file management for GNU Make.
 Copyright (C) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
-1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software
-Foundation, Inc.
+1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
+2010 Free Software Foundation, Inc.
 This file is part of GNU Make.
 
@@ -104,8 +104,18 @@
       name += 2;
 #endif
-  while (name[0] == '.' && name[1] == '/' && name[2] != '\0')
+  while (name[0] == '.'
+#ifdef HAVE_DOS_PATHS
+	 && (name[1] == '/' || name[1] == '\\')
+#else
+	 && name[1] == '/'
+#endif
+	 && name[2] != '\0')
     {
       name += 2;
-      while (*name == '/')
+      while (*name == '/'
+#ifdef HAVE_DOS_PATHS
+	     || *name == '\\'
+#endif
+	     )
 	/* Skip following slashes: ".//foo" is "foo", not "/foo".  */
 	++name;
@@ -172,6 +182,5 @@
     return f;
 
-  new = xmalloc (sizeof (struct file));
-  memset (new, '\0', sizeof (struct file));
+  new = xcalloc (sizeof (struct file));
   new->name = new->hname = name;
   new->update_status = -1;
@@ -415,10 +424,11 @@
 
 
+/* Given a string containing prerequisites (fully expanded), break it up into
+   a struct dep list.  Enter each of these prereqs into the file database.
+ */
 struct dep *
-parse_prereqs (char *p)
-{
-  struct dep *new = (struct dep *)
-    multi_glob (parse_file_seq (&p, '|', sizeof (struct dep), 1),
-                sizeof (struct dep));
+split_prereqs (char *p)
+{
+  struct dep *new = PARSE_FILE_SEQ (&p, struct dep, '|', NULL, 0);
 
   if (*p)
@@ -429,7 +439,5 @@
 
       ++p;
-      ood = (struct dep *)
-        multi_glob (parse_file_seq (&p, '\0', sizeof (struct dep), 1),
-                    sizeof (struct dep));
+      ood = PARSE_FILE_SEQ (&p, struct dep, '\0', NULL, 0);
 
       if (! new)
@@ -450,4 +458,83 @@
 }
 
+/* Given a list of prerequisites, enter them into the file database.
+   If STEM is set then first expand patterns using STEM.  */
+struct dep *
+enter_prereqs (struct dep *deps, const char *stem)
+{
+  struct dep *d1;
+
+  if (deps == 0)
+    return 0;
+
+  /* If we have a stem, expand the %'s.  We use patsubst_expand to translate
+     the prerequisites' patterns into plain prerequisite names.  */
+  if (stem)
+    {
+      const char *pattern = "%";
+      char *buffer = variable_expand ("");
+      struct dep *dp = deps, *dl = 0;
+
+      while (dp != 0)
+        {
+          char *percent;
+          int nl = strlen (dp->name) + 1;
+          char *nm = alloca (nl);
+          memcpy (nm, dp->name, nl);
+          percent = find_percent (nm);
+          if (percent)
+            {
+              char *o;
+
+              /* We have to handle empty stems specially, because that
+                 would be equivalent to $(patsubst %,dp->name,) which
+                 will always be empty.  */
+              if (stem[0] == '\0')
+                {
+                  memmove (percent, percent+1, strlen (percent));
+                  o = variable_buffer_output (buffer, nm, strlen (nm) + 1);
+                }
+              else
+                o = patsubst_expand_pat (buffer, stem, pattern, nm,
+                                         pattern+1, percent+1);
+
+              /* If the name expanded to the empty string, ignore it.  */
+              if (buffer[0] == '\0')
+                {
+                  struct dep *df = dp;
+                  if (dp == deps)
+                    dp = deps = deps->next;
+                  else
+                    dp = dl->next = dp->next;
+                  free_dep (df);
+                  continue;
+                }
+
+              /* Save the name.  */
+              dp->name = strcache_add_len (buffer, o - buffer);
+            }
+          dp->stem = stem;
+          dp->staticpattern = 1;
+          dl = dp;
+          dp = dp->next;
+        }
+    }
+
+  /* Enter them as files, unless they need a 2nd expansion.  */
+  for (d1 = deps; d1 != 0; d1 = d1->next)
+    {
+      if (d1->need_2nd_expansion)
+        continue;
+
+      d1->file = lookup_file (d1->name);
+      if (d1->file == 0)
+        d1->file = enter_file (d1->name);
+      d1->staticpattern = 0;
+      d1->name = 0;
+    }
+
+  return deps;
+}
+
 /* Set the intermediate flag.  */
 
@@ -464,164 +551,92 @@
 {
   struct dep *d;
-  struct dep *old = f->deps;
+  struct dep **dp;
   const char *file_stem = f->stem;
-  unsigned int last_dep_has_cmds = f->updating;
   int initialized = 0;
 
   f->updating = 0;
-  f->deps = 0;
-
-  for (d = old; d != 0; d = d->next)
-    {
-      struct dep *new, *d1;
+
+  /* Walk through the dependencies.  For any dependency that needs 2nd
+     expansion, expand it then insert the result into the list.  */
+  dp = &f->deps;
+  d = f->deps;
+  while (d != 0)
+    {
       char *p;
-
-      if (! d->name)
-        continue;
-
-      /* Create the dependency list.
-         If we're not doing 2nd expansion, then it's just the name.  We will
-         still need to massage it though.  */
-      if (! d->need_2nd_expansion)
+      struct dep *new, *next;
+      char *name = (char *)d->name;
+
+      if (! d->name || ! d->need_2nd_expansion)
         {
-          p = variable_expand ("");
-          variable_buffer_output (p, d->name, strlen (d->name) + 1);
-          p = variable_buffer;
+          /* This one is all set already.  */
+          dp = &d->next;
+          d = d->next;
+          continue;
         }
-      else
+
+      /* If it's from a static pattern rule, convert the patterns into
+         "$*" so they'll expand properly.  */
+      if (d->staticpattern)
         {
-          /* If it's from a static pattern rule, convert the patterns into
-             "$*" so they'll expand properly.  */
-          if (d->staticpattern)
-            {
-              char *o;
-              char *buffer = variable_expand ("");
-
-              o = subst_expand (buffer, d->name, "%", "$*", 1, 2, 0);
-
-              d->name = strcache_add_len (variable_buffer,
-                                          o - variable_buffer);
-              d->staticpattern = 0; /* Clear staticpattern so that we don't
-                                       re-expand %s below. */
-            }
-
-          /* We are going to do second expansion so initialize file variables
-             for the file. Since the stem for static pattern rules comes from
-             individual dep lines, we will temporarily set f->stem to d->stem.
-          */
-          if (!initialized)
-            {
-              initialize_file_variables (f, 0);
-              initialized = 1;
-            }
-
-          if (d->stem != 0)
-            f->stem = d->stem;
-
-          set_file_variables (f);
-
-          p = variable_expand_for_file (d->name, f);
-
-          if (d->stem != 0)
-            f->stem = file_stem;
+          char *o;
+          d->name = o = variable_expand ("");
+          o = subst_expand (o, name, "%", "$*", 1, 2, 0);
+          *o = '\0';
+          free (name);
+          d->name = name = xstrdup (d->name);
+          d->staticpattern = 0;
         }
 
-      /* Parse the prerequisites.  */
-      new = parse_prereqs (p);
-
-      /* If this dep list was from a static pattern rule, expand the %s.  We
-         use patsubst_expand to translate the prerequisites' patterns into
-         plain prerequisite names.  */
-      if (new && d->staticpattern)
+      /* We're going to do second expansion so initialize file variables for
+         the file. Since the stem for static pattern rules comes from
+         individual dep lines, we will temporarily set f->stem to d->stem.  */
+      if (!initialized)
         {
-          const char *pattern = "%";
-          char *buffer = variable_expand ("");
-          struct dep *dp = new, *dl = 0;
-
-          while (dp != 0)
-            {
-              char *percent;
-              int nl = strlen (dp->name) + 1;
-              char *nm = alloca (nl);
-              memcpy (nm, dp->name, nl);
-              percent = find_percent (nm);
-              if (percent)
-                {
-                  char *o;
-
-                  /* We have to handle empty stems specially, because that
-                     would be equivalent to $(patsubst %,dp->name,) which
-                     will always be empty.  */
-                  if (d->stem[0] == '\0')
-                    {
-                      memmove (percent, percent+1, strlen (percent));
-                      o = variable_buffer_output (buffer, nm, strlen (nm) + 1);
-                    }
-                  else
-                    o = patsubst_expand_pat (buffer, d->stem, pattern, nm,
-                                             pattern+1, percent+1);
-
-                  /* If the name expanded to the empty string, ignore it.  */
-                  if (buffer[0] == '\0')
-                    {
-                      struct dep *df = dp;
-                      if (dp == new)
-                        dp = new = new->next;
-                      else
-                        dp = dl->next = dp->next;
-                      free_dep (df);
-                      continue;
-                    }
-
-                  /* Save the name.  */
-                  dp->name = strcache_add_len (buffer, o - buffer);
-                }
-              dl = dp;
-              dp = dp->next;
-            }
+          initialize_file_variables (f, 0);
+          initialized = 1;
         }
 
-      /* Enter them as files. */
-      for (d1 = new; d1 != 0; d1 = d1->next)
+      if (d->stem != 0)
+        f->stem = d->stem;
+
+      set_file_variables (f);
+
+      p = variable_expand_for_file (d->name, f);
+
+      if (d->stem != 0)
+        f->stem = file_stem;
+
+      /* At this point we don't need the name anymore: free it.  */
+      free (name);
+
+      /* Parse the prerequisites and enter them into the file database.  */
+      new = enter_prereqs (split_prereqs (p), d->stem);
+
+      /* If there were no prereqs here (blank!) then throw this one out.  */
+      if (new == 0)
         {
-          d1->file = lookup_file (d1->name);
-          if (d1->file == 0)
-            d1->file = enter_file (d1->name);
-          d1->name = 0;
-          d1->staticpattern = 0;
-          d1->need_2nd_expansion = 0;
+          *dp = d->next;
+          free_dep (d);
+          d = *dp;
+          continue;
         }
 
-      /* Add newly parsed deps to f->deps. If this is the last dependency
-         line and this target has commands then put it in front so the
-         last dependency line (the one with commands) ends up being the
-         first. This is important because people expect $< to hold first
-         prerequisite from the rule with commands. If it is not the last
-         dependency line or the rule does not have commands then link it
-         at the end so it appears in makefile order.  */
-
-      if (new != 0)
-        {
-          if (d->next == 0 && last_dep_has_cmds)
-            {
-              struct dep **d_ptr;
-              for (d_ptr = &new; *d_ptr; d_ptr = &(*d_ptr)->next)
-                ;
-
-              *d_ptr = f->deps;
-              f->deps = new;
-            }
-          else
-            {
-              struct dep **d_ptr;
-              for (d_ptr = &f->deps; *d_ptr; d_ptr = &(*d_ptr)->next)
-                ;
-
-              *d_ptr = new;
-            }
-        }
-    }
-
-  free_dep_chain (old);
+      /* Add newly parsed prerequisites.  */
+      next = d->next;
+      *dp = new;
+      for (dp = &new->next, d = new->next; d != 0; dp = &d->next, d = d->next)
+        ;
+      *dp = next;
+      d = *dp;
+    }
+}
+
+/* Reset the updating flag.  */
+
+static void
+reset_updating (const void *item)
+{
+  struct file *f = (struct file *) item;
+  f->updating = 0;
 }
 
@@ -638,24 +653,42 @@
   struct file *f2;
   struct dep *d;
-  struct file **file_slot_0;
-  struct file **file_slot;
-  struct file **file_end;
-
-  /* Perform second expansion and enter each dependency name as a file. */
-
-  /* Expand .SUFFIXES first; it's dependencies are used for $$* calculation. */
-  for (f = lookup_file (".SUFFIXES"); f != 0; f = f->prev)
-    expand_deps (f);
-
-  /* For every target that's not .SUFFIXES, expand its dependencies.
-     We must use hash_dump (), because within this loop we might add new files
-     to the table, possibly causing an in-situ table expansion.  */
-  file_slot_0 = (struct file **) hash_dump (&files, 0, 0);
-  file_end = file_slot_0 + files.ht_fill;
-  for (file_slot = file_slot_0; file_slot < file_end; file_slot++)
-    for (f = *file_slot; f != 0; f = f->prev)
-      if (strcmp (f->name, ".SUFFIXES") != 0)
+
+  /* Remember that we've done this.  Once we start snapping deps we can no
+     longer define new targets.  */
+  snapped_deps = 1;
+
+  /* Perform second expansion and enter each dependency name as a file.  We
+     must use hash_dump() here because within these loops we likely add new
+     files to the table, possibly causing an in-situ table expansion.
+
+     We only need to do this if second_expansion has been defined; if it
+     hasn't then all deps were expanded as the makefile was read in.  If we
+     ever change make to be able to unset .SECONDARY_EXPANSION this will have
+     to change.  */
+
+  if (second_expansion)
+    {
+      struct file **file_slot_0 = (struct file **) hash_dump (&files, 0, 0);
+      struct file **file_end = file_slot_0 + files.ht_fill;
+      struct file **file_slot;
+      const char *suffixes;
+
+      /* Expand .SUFFIXES: its prerequisites are used for $$* calc.  */
+      f = lookup_file (".SUFFIXES");
+      suffixes = f ? f->name : 0;
+      for (; f != 0; f = f->prev)
         expand_deps (f);
-  free (file_slot_0);
+
+      /* For every target that's not .SUFFIXES, expand its prerequisites.  */
+
+      for (file_slot = file_slot_0; file_slot < file_end; file_slot++)
+        for (f = *file_slot; f != 0; f = f->prev)
+          if (f->name != suffixes)
+            expand_deps (f);
+      free (file_slot_0);
+    }
+  else
+    /* We're not doing second expansion, so reset updating.  */
+    hash_map (&files, reset_updating);
 
   /* Now manage all the special targets.  */
@@ -738,10 +771,7 @@
   /* This needs more work: what if the user sets this in the makefile?
   if (posix_pedantic)
-    define_variable (STRING_SIZE_TUPLE("OUTPUT_OPTION"), "", o_default, 1);
+    define_variable_cname ("OUTPUT_OPTION", "", o_default, 1);
   */
 #endif
-
-  /* Remember that we've done this. */
-  snapped_deps = 1;
 }
 
@@ -868,10 +898,32 @@
 /* Print the data base of files.  */
 
+void
+print_prereqs (const struct dep *deps)
+{
+  const struct dep *ood = 0;
+
+  /* Print all normal dependencies; note any order-only deps.  */
+  for (; deps != 0; deps = deps->next)
+    if (! deps->ignore_mtime)
+      printf (" %s", dep_name (deps));
+    else if (! ood)
+      ood = deps;
+
+  /* Print order-only deps, if we have any.  */
+  if (ood)
+    {
+      printf (" | %s", dep_name (ood));
+      for (ood = ood->next; ood != 0; ood = ood->next)
+        if (ood->ignore_mtime)
+          printf (" %s", dep_name (ood));
+    }
+
+  putchar ('\n');
+}
+
 static void
 print_file (const void *item)
 {
   const struct file *f = item;
-  struct dep *d;
-  struct dep *ood = 0;
 
   putchar ('\n');
@@ -879,22 +931,5 @@
     puts (_("# Not a target:"));
   printf ("%s:%s", f->name, f->double_colon ? ":" : "");
-
-  /* Print all normal dependencies; note any order-only deps.  */
-  for (d = f->deps; d != 0; d = d->next)
-    if (! d->ignore_mtime)
-      printf (" %s", dep_name (d));
-    else if (! ood)
-      ood = d;
-
-  /* Print order-only deps, if we have any.  */
-  if (ood)
-    {
-      printf (" | %s", dep_name (ood));
-      for (d = ood->next; d != 0; d = d->next)
-        if (d->ignore_mtime)
-          printf (" %s", dep_name (d));
-    }
-
-  putchar ('\n');
+  print_prereqs (f->deps);
 
   if (f->precious)
@@ -915,4 +950,5 @@
   if (f->also_make != 0)
     {
+      const struct dep *d;
       fputs (_("#  Also makes:"), stdout);
       for (d = f->also_make; d != 0; d = d->next)
@@ -999,5 +1035,5 @@
     do{\
         if (_p->_n && _p->_n[0] && !strcache_iscached (_p->_n)) \
-          printf ("%s: Field %s not cached: %s\n", _p->name, # _n, _p->_n); \
+          error (NULL, "%s: Field '%s' not cached: %s\n", _p->name, # _n, _p->_n); \
     }while(0)
 
@@ -1016,5 +1052,6 @@
   for (d = f->deps; d != 0; d = d->next)
     {
-      VERIFY_CACHED (d, name);
+      if (! d->need_2nd_expansion)
+        VERIFY_CACHED (d, name);
       VERIFY_CACHED (d, stem);
     }
Index: /vendor/gnumake/current/filedef.h
===================================================================
--- /vendor/gnumake/current/filedef.h	(revision 2595)
+++ /vendor/gnumake/current/filedef.h	(revision 2596)
@@ -1,6 +1,6 @@
 /* Definition of target file data structures for GNU Make.
 Copyright (C) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
-1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software
-Foundation, Inc.
+1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
+2010 Free Software Foundation, Inc.
 This file is part of GNU Make.
 
@@ -95,14 +95,16 @@
     unsigned int considered:1;  /* equal to 'considered' if file has been
                                    considered on current scan of goal chain */
+    unsigned int no_diag:1;     /* True if the file failed to update and no
+                                   diagnostics has been issued (dontcare). */
   };
 
 
-extern struct file *default_goal_file, *suffix_file, *default_file;
-extern char **default_goal_name;
+extern struct file *suffix_file, *default_file;
 
 
 struct file *lookup_file (const char *name);
 struct file *enter_file (const char *name);
-struct dep *parse_prereqs (char *prereqs);
+struct dep *split_prereqs (char *prereqstr);
+struct dep *enter_prereqs (struct dep *prereqs, const char *stem);
 void remove_intermediates (int sig);
 void snap_deps (void);
@@ -113,4 +115,6 @@
 void init_hash_files (void);
 char *build_target_list (char *old_list);
+void print_prereqs (const struct dep *deps);
+void print_file_data_base (void);
 
 #if FILE_TIMESTAMP_HI_RES
Index: /vendor/gnumake/current/function.c
===================================================================
--- /vendor/gnumake/current/function.c	(revision 2595)
+++ /vendor/gnumake/current/function.c	(revision 2596)
@@ -1,6 +1,6 @@
 /* Builtin function expansion for GNU Make.
 Copyright (C) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
-1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software
-Foundation, Inc.
+1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
+2010 Free Software Foundation, Inc.
 This file is part of GNU Make.
 
@@ -362,11 +362,9 @@
   unsigned int idx;
 
-  chain = multi_glob (parse_file_seq
-		      (&line, '\0', sizeof (struct nameseq),
-		       /* We do not want parse_file_seq to strip `./'s.
-			  That would break examples like:
-			  $(patsubst ./%.c,obj/%.o,$(wildcard ./?*.c)).  */
-		       0),
-		      sizeof (struct nameseq));
+  chain = PARSE_FILE_SEQ (&line, struct nameseq, '\0', NULL,
+                          /* We do not want parse_file_seq to strip `./'s.
+                             That would break examples like:
+                             $(patsubst ./%.c,obj/%.o,$(wildcard ./?*.c)).  */
+                          PARSEFS_NOSTRIP|PARSEFS_NOCACHE|PARSEFS_EXISTS);
 
   if (result == 0)
@@ -379,24 +377,20 @@
   while (chain != 0)
     {
-      const char *name = chain->name;
-      unsigned int len = strlen (name);
-
       struct nameseq *next = chain->next;
+      unsigned int len = strlen (chain->name);
+
+      if (idx + len + 1 > length)
+        {
+          length += (len + 1) * 2;
+          result = xrealloc (result, length);
+        }
+      memcpy (&result[idx], chain->name, len);
+      idx += len;
+      result[idx++] = ' ';
+
+      /* Because we used PARSEFS_NOCACHE above, we have to free() NAME.  */
+      free ((char *)chain->name);
       free (chain);
       chain = next;
-
-      /* multi_glob will pass names without globbing metacharacters
-	 through as is, but we want only files that actually exist.  */
-      if (file_exists_p (name))
-	{
-	  if (idx + len + 1 > length)
-	    {
-	      length += (len + 1) * 2;
-	      result = xrealloc (result, length);
-	    }
-	  memcpy (&result[idx], name, len);
-	  idx += len;
-	  result[idx++] = ' ';
-	}
     }
 
@@ -861,5 +855,5 @@
 
       free (var->value);
-      var->value = savestring (p, len);
+      var->value = xstrndup (p, len);
 
       result = allocated_variable_expand (body);
@@ -1448,5 +1442,5 @@
 
 void
-windows32_openpipe (int *pipedes, int *pid_p, char **command_argv, char **envp)
+windows32_openpipe (int *pipedes, pid_t *pid_p, char **command_argv, char **envp)
 {
   SECURITY_ATTRIBUTES saAttr;
@@ -1469,5 +1463,5 @@
 		      TRUE,
 		      DUPLICATE_SAME_ACCESS) == FALSE) {
-    fatal (NILF, _("create_child_process: DuplicateHandle(In) failed (e=%ld)\n"),
+    fatal (NILF, _("windows32_openpipe(): DuplicateHandle(In) failed (e=%ld)\n"),
 	   GetLastError());
 
@@ -1480,5 +1474,5 @@
 		      TRUE,
 		      DUPLICATE_SAME_ACCESS) == FALSE) {
-    fatal (NILF, _("create_child_process: DuplicateHandle(Err) failed (e=%ld)\n"),
+    fatal (NILF, _("windows32_open_pipe(): DuplicateHandle(Err) failed (e=%ld)\n"),
 	   GetLastError());
   }
@@ -1490,8 +1484,11 @@
 
   if (!hProcess)
-    fatal (NILF, _("windows32_openpipe (): process_init_fd() failed\n"));
+    fatal (NILF, _("windows32_openpipe(): process_init_fd() failed\n"));
 
   /* make sure that CreateProcess() has Path it needs */
   sync_Path_environment();
+  /* `sync_Path_environment' may realloc `environ', so take note of
+     the new value.  */
+  envp = environ;
 
   if (!process_begin(hProcess, command_argv, envp, command_argv[0], NULL)) {
@@ -1500,11 +1497,11 @@
 
     /* set the pid for returning to caller */
-    *pid_p = (int) hProcess;
+    *pid_p = (pid_t) hProcess;
 
   /* set up to read data from child */
-  pipedes[0] = _open_osfhandle((long) hChildOutRd, O_RDONLY);
+  pipedes[0] = _open_osfhandle((intptr_t) hChildOutRd, O_RDONLY);
 
   /* this will be closed almost right away */
-  pipedes[1] = _open_osfhandle((long) hChildOutWr, O_APPEND);
+  pipedes[1] = _open_osfhandle((intptr_t) hChildOutWr, O_APPEND);
   } else {
     /* reap/cleanup the failed process */
@@ -1521,5 +1518,5 @@
     /* set status for return */
     pipedes[0] = pipedes[1] = -1;
-    *pid_p = -1;
+    *pid_p = (pid_t)-1;
   }
 }
@@ -1605,5 +1602,5 @@
   char **envp;
   int pipedes[2];
-  int pid;
+  pid_t pid;
 
 #ifndef __MSDOS__
@@ -1695,6 +1692,9 @@
       free (command_argv);
 
-      /* Close the write side of the pipe.  */
-      close (pipedes[1]);
+      /* Close the write side of the pipe.  We test for -1, since
+	 pipedes[1] is -1 on MS-Windows, and some versions of MS
+	 libraries barf when `close' is called with -1.  */
+      if (pipedes[1] >= 0)
+	close (pipedes[1]);
 #endif
 
@@ -1887,4 +1887,12 @@
 
 
+#ifdef HAVE_DOS_PATHS
+#define IS_ABSOLUTE(n) (n[0] && n[1] == ':')
+#define ROOT_LEN 3
+#else
+#define IS_ABSOLUTE(n) (n[0] == '/')
+#define ROOT_LEN 1
+#endif
+
 /* Return the absolute name of file NAME which does not contain any `.',
    `..' components nor any repeated path separators ('/').   */
@@ -1895,4 +1903,5 @@
   char *dest;
   const char *start, *end, *apath_limit;
+  unsigned long root_len = ROOT_LEN;
 
   if (name[0] == '\0' || apath == NULL)
@@ -1901,5 +1910,5 @@
   apath_limit = apath + GET_PATH_MAX;
 
-  if (name[0] != '/')
+  if (!IS_ABSOLUTE(name))
     {
       /* It is unlikely we would make it until here but just to make sure. */
@@ -1909,10 +1918,45 @@
       strcpy (apath, starting_directory);
 
+#ifdef HAVE_DOS_PATHS
+      if (IS_PATHSEP(name[0]))
+	{
+	  if (IS_PATHSEP(name[1]))
+	    {
+	      /* A UNC.  Don't prepend a drive letter.  */
+	      apath[0] = name[0];
+	      apath[1] = name[1];
+	      root_len = 2;
+	    }
+	  /* We have /foo, an absolute file name except for the drive
+	     letter.  Assume the missing drive letter is the current
+	     drive, which we can get if we remove from starting_directory
+	     everything past the root directory.  */
+	  apath[root_len] = '\0';
+	}
+#endif
+
       dest = strchr (apath, '\0');
     }
   else
     {
-      apath[0] = '/';
-      dest = apath + 1;
+      strncpy (apath, name, root_len);
+      apath[root_len] = '\0';
+      dest = apath + root_len;
+      /* Get past the root, since we already copied it.  */
+      name += root_len;
+#ifdef HAVE_DOS_PATHS
+      if (!IS_PATHSEP(apath[2]))
+	{
+	  /* Convert d:foo into d:./foo and increase root_len.  */
+	  apath[2] = '.';
+	  apath[3] = '/';
+	  dest++;
+	  root_len++;
+	  /* strncpy above copied one character too many.  */
+	  name--;
+	}
+      else
+	apath[2] = '/';	/* make sure it's a forward slash */
+#endif
     }
 
@@ -1922,9 +1966,9 @@
 
       /* Skip sequence of multiple path-separators.  */
-      while (*start == '/')
+      while (IS_PATHSEP(*start))
 	++start;
 
       /* Find end of path component.  */
-      for (end = start; *end != '\0' && *end != '/'; ++end)
+      for (end = start; *end != '\0' && !IS_PATHSEP(*end); ++end)
         ;
 
@@ -1938,10 +1982,10 @@
 	{
 	  /* Back up to previous component, ignore if at root already.  */
-	  if (dest > apath + 1)
-	    while ((--dest)[-1] != '/');
+	  if (dest > apath + root_len)
+	    for (--dest; !IS_PATHSEP(dest[-1]); --dest);
 	}
       else
 	{
-	  if (dest[-1] != '/')
+	  if (!IS_PATHSEP(dest[-1]))
             *dest++ = '/';
 
@@ -1956,5 +2000,5 @@
 
   /* Unless it is root strip trailing separator.  */
-  if (dest > apath + 1 && dest[-1] == '/')
+  if (dest > apath + root_len && IS_PATHSEP(dest[-1]))
     --dest;
 
@@ -1973,4 +2017,7 @@
   int doneany = 0;
   unsigned int len = 0;
+#ifndef HAVE_REALPATH
+  struct stat st;
+#endif
   PATH_VAR (in);
   PATH_VAR (out);
@@ -1987,5 +2034,5 @@
               realpath (in, out)
 #else
-              abspath (in, out)
+              abspath (in, out) && stat (out, &st) == 0
 #endif
              )
Index: /vendor/gnumake/current/getloadavg.c
===================================================================
--- /vendor/gnumake/current/getloadavg.c	(revision 2595)
+++ /vendor/gnumake/current/getloadavg.c	(revision 2596)
@@ -1,6 +1,6 @@
 /* Get the system load averages.
 Copyright (C) 1985, 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994,
-1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
-Free Software Foundation, Inc.
+1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
+2008, 2009, 2010 Free Software Foundation, Inc.
 
 GNU Make is free software; you can redistribute it and/or modify it under the
Index: /vendor/gnumake/current/getopt.c
===================================================================
--- /vendor/gnumake/current/getopt.c	(revision 2595)
+++ /vendor/gnumake/current/getopt.c	(revision 2596)
@@ -5,6 +5,6 @@
 
 Copyright (C) 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996,
-1997, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software
-Foundation, Inc.
+1997, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
+2010 Free Software Foundation, Inc.
 
 NOTE: The canonical source of this file is maintained with the GNU C Library.
Index: /vendor/gnumake/current/getopt.h
===================================================================
--- /vendor/gnumake/current/getopt.h	(revision 2595)
+++ /vendor/gnumake/current/getopt.h	(revision 2596)
@@ -1,6 +1,6 @@
 /* Declarations for getopt.
 Copyright (C) 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
-1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation,
-Inc.
+1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free
+Software Foundation, Inc.
 
 NOTE: The canonical source of this file is maintained with the GNU C Library.
Index: /vendor/gnumake/current/getopt1.c
===================================================================
--- /vendor/gnumake/current/getopt1.c	(revision 2595)
+++ /vendor/gnumake/current/getopt1.c	(revision 2596)
@@ -1,6 +1,6 @@
 /* getopt_long and getopt_long_only entry points for GNU getopt.
 Copyright (C) 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1996, 1997,
-1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software
-Foundation, Inc.
+1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
+2010 Free Software Foundation, Inc.
 
 NOTE: The canonical source of this file is maintained with the GNU C Library.
Index: /vendor/gnumake/current/gettext.h
===================================================================
--- /vendor/gnumake/current/gettext.h	(revision 2595)
+++ /vendor/gnumake/current/gettext.h	(revision 2596)
@@ -1,5 +1,5 @@
 /* Convenience header for conditional use of GNU <libintl.h>.
 Copyright (C) 1995, 1996, 1997, 1998, 2000, 2001, 2002, 2003, 2004, 2005,
-2006, 2007 Free Software Foundation, Inc.
+2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
 This file is part of GNU Make.
 
Index: /vendor/gnumake/current/glob/ChangeLog
===================================================================
--- /vendor/gnumake/current/glob/ChangeLog	(revision 2595)
+++ /vendor/gnumake/current/glob/ChangeLog	(revision 2596)
@@ -1,5 +1,11 @@
+2008-09-28  Juan Manuel Guerrero  <juan.guerrero@gmx.de>
+
+	* glob.c (my_realloc) [__DJGPP__]: Don't define, and don't
+	redefine realloc to call it, since the DJGPP's realloc handles
+	NULL pointers correctly.
+
 2007-12-22  Juan Manuel Guerrero  <juan.guerrero@gmx.de>  (tiny change)
 
-	* glob/glob.c [__GNU_LIBRARY__ && __DJGPP__]: Add a realloc
+	* glob.c [__GNU_LIBRARY__ && __DJGPP__]: Add a realloc
 	declaration that matches the one in the DJGPP libc.
 
Index: /vendor/gnumake/current/glob/glob.c
===================================================================
--- /vendor/gnumake/current/glob/glob.c	(revision 2595)
+++ /vendor/gnumake/current/glob/glob.c	(revision 2596)
@@ -183,5 +183,5 @@
 #endif
 
-#ifndef	__GNU_LIBRARY__
+#if !defined __GNU_LIBRARY__ && !defined __DJGPP__
 # ifdef	__GNUC__
 __inline
@@ -191,7 +191,4 @@
 static void *
 my_realloc (void *p, unsigned int n)
-#  elif defined(__DJGPP__)
-static void *
-my_realloc (void *p, size_t n)
 #  else
 static char *
@@ -209,5 +206,5 @@
 # define	realloc	my_realloc
 # endif /* __SASC */
-#endif /* __GNU_LIBRARY__ */
+#endif /* __GNU_LIBRARY__ || __DJGPP__ */
 
 
Index: /vendor/gnumake/current/hash.c
===================================================================
--- /vendor/gnumake/current/hash.c	(revision 2595)
+++ /vendor/gnumake/current/hash.c	(revision 2596)
@@ -1,4 +1,4 @@
 /* hash.c -- hash table maintenance
-Copyright (C) 1995, 1999, 2002 Free Software Foundation, Inc.
+Copyright (C) 1995, 1999, 2002, 2010 Free Software Foundation, Inc.
 Written by Greg McGary <gkm@gnu.org> <greg@mcgary.org>
 
@@ -47,6 +47,6 @@
   if (ht->ht_vec == 0)
     {
-      fprintf (stderr, _("can't allocate %ld bytes for hash table: memory exhausted"),
-	       ht->ht_size * sizeof(struct token *));
+      fprintf (stderr, _("can't allocate %lu bytes for hash table: memory exhausted"),
+	       ht->ht_size * (unsigned long) sizeof (struct token *));
       exit (1);
     }
@@ -127,5 +127,5 @@
 {
   void **slot = hash_find_slot (ht, item);
-  const void *old_item = slot ? *slot : 0;
+  const void *old_item = *slot;
   hash_insert_at (ht, item, slot);
   return (void *)((HASH_VACANT (old_item)) ? 0 : old_item);
Index: /vendor/gnumake/current/hash.h
===================================================================
--- /vendor/gnumake/current/hash.h	(revision 2595)
+++ /vendor/gnumake/current/hash.h	(revision 2596)
@@ -1,4 +1,4 @@
 /* hash.h -- decls for hash table
-Copyright (C) 1995, 1999, 2002 Free Software Foundation, Inc.
+Copyright (C) 1995, 1999, 2002, 2010 Free Software Foundation, Inc.
 Written by Greg McGary <gkm@gnu.org> <greg@mcgary.org>
 
@@ -81,4 +81,7 @@
 /* hash and comparison macros for case-sensitive string keys. */
 
+/* Due to the strcache, it's not uncommon for the string pointers to
+   be identical.  Take advantage of that to short-circuit string compares.  */
+
 #define STRING_HASH_1(KEY, RESULT) do { \
   unsigned char const *_key_ = (unsigned char const *) (KEY) - 1; \
@@ -104,8 +107,8 @@
 
 #define STRING_COMPARE(X, Y, RESULT) do { \
-  RESULT = strcmp ((X), (Y)); \
+    RESULT = (X) == (Y) ? 0 : strcmp ((X), (Y)); \
 } while (0)
 #define return_STRING_COMPARE(X, Y) do { \
-  return strcmp ((X), (Y)); \
+  return (X) == (Y) ? 0 : strcmp ((X), (Y)); \
 } while (0)
 
@@ -140,8 +143,8 @@
 
 #define STRING_N_COMPARE(X, Y, N, RESULT) do { \
-  RESULT = strncmp ((X), (Y), (N)); \
+  RESULT = (X) == (Y) ? 0 : strncmp ((X), (Y), (N)); \
 } while (0)
 #define return_STRING_N_COMPARE(X, Y, N) do { \
-  return strncmp ((X), (Y), (N)); \
+  return (X) == (Y) ? 0 : strncmp ((X), (Y), (N)); \
 } while (0)
 
@@ -173,8 +176,8 @@
 
 #define ISTRING_COMPARE(X, Y, RESULT) do { \
-  RESULT = strcasecmp ((X), (Y)); \
+  RESULT = (X) == (Y) ? 0 : strcasecmp ((X), (Y)); \
 } while (0)
 #define return_ISTRING_COMPARE(X, Y) do { \
-  return strcasecmp ((X), (Y)); \
+  return (X) == (Y) ? 0 : strcasecmp ((X), (Y)); \
 } while (0)
 
Index: /vendor/gnumake/current/implicit.c
===================================================================
--- /vendor/gnumake/current/implicit.c	(revision 2595)
+++ /vendor/gnumake/current/implicit.c	(revision 2596)
@@ -1,6 +1,6 @@
 /* Implicit rule searching for GNU Make.
 Copyright (C) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
-1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software
-Foundation, Inc.
+1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
+2010 Free Software Foundation, Inc.
 This file is part of GNU Make.
 
@@ -49,5 +49,5 @@
     return 1;
 
-#ifndef	NO_ARCHIVES
+#ifndef NO_ARCHIVES
   /* If this is an archive member reference, use just the
      archive member name to search for implicit rules.  */
@@ -57,5 +57,5 @@
            _("Looking for archive-member implicit rule for `%s'.\n"));
       if (pattern_search (file, 1, depth, 0))
-	return 1;
+        return 1;
     }
 #endif
@@ -64,29 +64,4 @@
 }
 
-
-
-/* Struct idep captures information about implicit prerequisites
-   that come from implicit rules. */
-struct idep
-{
-  struct idep *next;              /* struct dep -compatible interface */
-  const char *name;               /* name of the prerequisite */
-  struct file *intermediate_file; /* intermediate file, 0 otherwise */
-  const char *intermediate_pattern; /* pattern for intermediate file */
-  unsigned char had_stem;         /* had % substituted with stem */
-  unsigned char ignore_mtime;     /* ignore_mtime flag */
-};
-
-static void
-free_idep_chain (struct idep *p)
-{
-  struct idep *n;
-
-  for (; p != 0; p = n)
-    {
-      n = p->next;
-      free (p);
-    }
-}
 
 
@@ -95,5 +70,5 @@
    length of the word.  */
 
-static char *
+static const char *
 get_next_word (const char *buffer, unsigned int *length)
 {
@@ -169,5 +144,47 @@
     *length = p - beg;
 
-  return (char *)beg;
+  return beg;
+}
+
+/* This structure stores information about the expanded prerequisites for a
+   pattern rule.  NAME is always set to the strcache'd name of the prereq.
+   FILE and PATTERN will be set for intermediate files only.  IGNORE_MTIME is
+   copied from the prerequisite we expanded.
+ */
+struct patdeps
+  {
+    const char *name;
+    const char *pattern;
+    struct file *file;
+    unsigned int ignore_mtime : 1;
+  };
+
+/* This structure stores information about pattern rules that we need
+   to try.
+*/
+struct tryrule
+  {
+    struct rule *rule;
+
+    /* Index of the target in this rule that matched the file. */
+    unsigned int matches;
+
+    /* Stem length for this match. */
+    unsigned int stemlen;
+
+    /* Definition order of this rule. Used to implement stable sort.*/
+    unsigned int order;
+
+    /* Nonzero if the LASTSLASH logic was used in matching this rule. */
+    char checked_lastslash;
+  };
+
+int
+stemlen_compare (const void *v1, const void *v2)
+{
+  const struct tryrule *r1 = v1;
+  const struct tryrule *r2 = v2;
+  int r = r1->stemlen - r2->stemlen;
+  return r != 0 ? r : (int)(r1->order - r2->order);
 }
 
@@ -197,18 +214,18 @@
 
   /* The last slash in FILENAME (or nil if there is none).  */
-  char *lastslash;
+  const char *lastslash;
 
   /* This is a file-object used as an argument in
      recursive calls.  It never contains any data
      except during a recursive call.  */
-  struct file *intermediate_file = 0;
-
-  /* This linked list records all the prerequisites actually
-     found for a rule along with some other useful information
-     (see struct idep for details). */
-  struct idep* deps = 0;
-
-  /* 1 if we need to remove explicit prerequisites, 0 otherwise. */
-  unsigned int remove_explicit_deps = 0;
+  struct file *int_file = 0;
+
+  /* List of dependencies found recursively.  */
+  struct patdeps *deplist
+    = xmalloc (max_pattern_deps * sizeof (struct patdeps));
+  struct patdeps *pat = deplist;
+
+  /* All the prerequisites actually found for a rule, after expansion.  */
+  struct dep *deps;
 
   /* Names of possible dependencies are constructed in this buffer.  */
@@ -221,18 +238,10 @@
 
   /* Buffer in which we store all the rules that are possibly applicable.  */
-  struct rule **tryrules = xmalloc (num_pattern_rules * max_pattern_targets
-                                    * sizeof (struct rule *));
+  struct tryrule *tryrules = xmalloc (num_pattern_rules * max_pattern_targets
+                                      * sizeof (struct tryrule));
 
   /* Number of valid elements in TRYRULES.  */
   unsigned int nrules;
 
-  /* The numbers of the rule targets of each rule
-     in TRYRULES that matched the target file.  */
-  unsigned int *matches = alloca (num_pattern_rules * sizeof (unsigned int));
-
-  /* Each element is nonzero if LASTSLASH was used in
-     matching the corresponding element of TRYRULES.  */
-  char *checked_lastslash = alloca (num_pattern_rules * sizeof (char));
-
   /* The index in TRYRULES of the rule we found.  */
   unsigned int foundrule;
@@ -240,4 +249,7 @@
   /* Nonzero if should consider intermediate files as dependencies.  */
   int intermed_ok;
+
+  /* Nonzero if we have initialized file variables for this target.  */
+  int file_vars_initialized = 0;
 
   /* Nonzero if we have matched a pattern-rule target
@@ -245,15 +257,15 @@
   int specific_rule_matched = 0;
 
+  struct dep dep_simple;
+
   unsigned int ri;  /* uninit checks OK */
   struct rule *rule;
-  struct dep *dep, *expl_d;
-
-  struct idep *d;
-  struct idep **id_ptr;
-  struct dep **d_ptr;
+
+  char *pathdir = NULL;
+  unsigned long pathlen;
 
   PATH_VAR (stem_str); /* @@ Need to get rid of stem, stemlen, etc. */
 
-#ifndef	NO_ARCHIVES
+#ifndef NO_ARCHIVES
   if (archive || ar_name (filename))
     lastslash = 0;
@@ -262,30 +274,32 @@
     {
       /* Set LASTSLASH to point at the last slash in FILENAME
-	 but not counting any slash at the end.  (foo/bar/ counts as
-	 bar/ in directory foo/, not empty in directory foo/bar/.)  */
+         but not counting any slash at the end.  (foo/bar/ counts as
+         bar/ in directory foo/, not empty in directory foo/bar/.)  */
 #ifdef VMS
       lastslash = strrchr (filename, ']');
       if (lastslash == 0)
-	lastslash = strrchr (filename, ':');
+        lastslash = strrchr (filename, ':');
 #else
       lastslash = strrchr (filename, '/');
 #ifdef HAVE_DOS_PATHS
       /* Handle backslashes (possibly mixed with forward slashes)
-	 and the case of "d:file".  */
+         and the case of "d:file".  */
       {
-	char *bslash = strrchr (filename, '\\');
-	if (lastslash == 0 || bslash > lastslash)
-	  lastslash = bslash;
-	if (lastslash == 0 && filename[0] && filename[1] == ':')
-	  lastslash = filename + 1;
+        char *bslash = strrchr (filename, '\\');
+        if (lastslash == 0 || bslash > lastslash)
+          lastslash = bslash;
+        if (lastslash == 0 && filename[0] && filename[1] == ':')
+          lastslash = filename + 1;
       }
 #endif
 #endif
       if (lastslash != 0 && lastslash[1] == '\0')
-	lastslash = 0;
+        lastslash = 0;
     }
 
-  /* First see which pattern rules match this target
-     and may be considered.  Put them in TRYRULES.  */
+  pathlen = lastslash - filename + 1;
+
+  /* First see which pattern rules match this target and may be considered.
+     Put them in TRYRULES.  */
 
   nrules = 0;
@@ -295,39 +309,39 @@
 
       /* If the pattern rule has deps but no commands, ignore it.
-	 Users cancel built-in rules by redefining them without commands.  */
+         Users cancel built-in rules by redefining them without commands.  */
       if (rule->deps != 0 && rule->cmds == 0)
-	continue;
+        continue;
 
       /* If this rule is in use by a parent pattern_search,
-	 don't use it here.  */
+         don't use it here.  */
       if (rule->in_use)
-	{
-	  DBS (DB_IMPLICIT, (_("Avoiding implicit rule recursion.\n")));
-	  continue;
-	}
+        {
+          DBS (DB_IMPLICIT, (_("Avoiding implicit rule recursion.\n")));
+          continue;
+        }
 
       for (ti = 0; ti < rule->num; ++ti)
-	{
-	  const char *target = rule->targets[ti];
-	  const char *suffix = rule->suffixes[ti];
-	  int check_lastslash;
-
-	  /* Rules that can match any filename and are not terminal
-	     are ignored if we're recursing, so that they cannot be
-	     intermediate files.  */
-	  if (recursions > 0 && target[1] == '\0' && !rule->terminal)
-	    continue;
-
-	  if (rule->lens[ti] > namelen)
-	    /* It can't possibly match.  */
-	    continue;
-
-	  /* From the lengths of the filename and the pattern parts,
-	     find the stem: the part of the filename that matches the %.  */
-	  stem = filename + (suffix - target - 1);
-	  stemlen = namelen - rule->lens[ti] + 1;
-
-	  /* Set CHECK_LASTSLASH if FILENAME contains a directory
-	     prefix and the target pattern does not contain a slash.  */
+        {
+          const char *target = rule->targets[ti];
+          const char *suffix = rule->suffixes[ti];
+          int check_lastslash;
+
+          /* Rules that can match any filename and are not terminal
+             are ignored if we're recursing, so that they cannot be
+             intermediate files.  */
+          if (recursions > 0 && target[1] == '\0' && !rule->terminal)
+            continue;
+
+          if (rule->lens[ti] > namelen)
+            /* It can't possibly match.  */
+            continue;
+
+          /* From the lengths of the filename and the pattern parts,
+             find the stem: the part of the filename that matches the %.  */
+          stem = filename + (suffix - target - 1);
+          stemlen = namelen - rule->lens[ti] + 1;
+
+          /* Set CHECK_LASTSLASH if FILENAME contains a directory
+             prefix and the target pattern does not contain a slash.  */
 
           check_lastslash = 0;
@@ -349,52 +363,62 @@
 #endif
             }
-	  if (check_lastslash)
-	    {
-	      /* If so, don't include the directory prefix in STEM here.  */
-	      unsigned int difference = lastslash - filename + 1;
-	      if (difference > stemlen)
-		continue;
-	      stemlen -= difference;
-	      stem += difference;
-	    }
-
-	  /* Check that the rule pattern matches the text before the stem.  */
-	  if (check_lastslash)
-	    {
-	      if (stem > (lastslash + 1)
-		  && !strneq (target, lastslash + 1, stem - lastslash - 1))
-		continue;
-	    }
-	  else if (stem > filename
-		   && !strneq (target, filename, stem - filename))
-	    continue;
-
-	  /* Check that the rule pattern matches the text after the stem.
-	     We could test simply use streq, but this way we compare the
-	     first two characters immediately.  This saves time in the very
-	     common case where the first character matches because it is a
-	     period.  */
-	  if (*suffix != stem[stemlen]
-	      || (*suffix != '\0' && !streq (&suffix[1], &stem[stemlen + 1])))
-	    continue;
-
-	  /* Record if we match a rule that not all filenames will match.  */
-	  if (target[1] != '\0')
-	    specific_rule_matched = 1;
-
-	  /* A rule with no dependencies and no commands exists solely to set
-	     specific_rule_matched when it matches.  Don't try to use it.  */
-	  if (rule->deps == 0 && rule->cmds == 0)
-	    continue;
-
-	  /* Record this rule in TRYRULES and the index of the matching
-	     target in MATCHES.  If several targets of the same rule match,
-	     that rule will be in TRYRULES more than once.  */
-	  tryrules[nrules] = rule;
-	  matches[nrules] = ti;
-	  checked_lastslash[nrules] = check_lastslash;
-	  ++nrules;
-	}
+          if (check_lastslash)
+            {
+              /* If so, don't include the directory prefix in STEM here.  */
+              if (pathlen > stemlen)
+                continue;
+              stemlen -= pathlen;
+              stem += pathlen;
+            }
+
+          /* Check that the rule pattern matches the text before the stem.  */
+          if (check_lastslash)
+            {
+              if (stem > (lastslash + 1)
+                  && !strneq (target, lastslash + 1, stem - lastslash - 1))
+                continue;
+            }
+          else if (stem > filename
+                   && !strneq (target, filename, stem - filename))
+            continue;
+
+          /* Check that the rule pattern matches the text after the stem.
+             We could test simply use streq, but this way we compare the
+             first two characters immediately.  This saves time in the very
+             common case where the first character matches because it is a
+             period.  */
+          if (*suffix != stem[stemlen]
+              || (*suffix != '\0' && !streq (&suffix[1], &stem[stemlen + 1])))
+            continue;
+
+          /* Record if we match a rule that not all filenames will match.  */
+          if (target[1] != '\0')
+            specific_rule_matched = 1;
+
+          /* A rule with no dependencies and no commands exists solely to set
+             specific_rule_matched when it matches.  Don't try to use it.  */
+          if (rule->deps == 0 && rule->cmds == 0)
+            continue;
+
+          /* Record this rule in TRYRULES and the index of the matching
+             target in MATCHES.  If several targets of the same rule match,
+             that rule will be in TRYRULES more than once.  */
+          tryrules[nrules].rule = rule;
+	  tryrules[nrules].matches = ti;
+          tryrules[nrules].stemlen = stemlen + (check_lastslash ? pathlen : 0);
+          tryrules[nrules].order = nrules;
+	  tryrules[nrules].checked_lastslash = check_lastslash;
+          ++nrules;
+        }
     }
+
+  /* Bail out early if we haven't found any rules. */
+  if (nrules == 0)
+    goto done;
+
+  /* Sort the rules to place matches with the shortest stem first. This
+     way the most specific rules will be tried first. */
+  if (nrules > 1)
+    qsort (tryrules, nrules, sizeof (struct tryrule), stemlen_compare);
 
   /* If we have found a matching rule that won't match all filenames,
@@ -402,68 +426,78 @@
   if (specific_rule_matched)
     for (ri = 0; ri < nrules; ++ri)
-      if (!tryrules[ri]->terminal)
-	{
-	  unsigned int j;
-	  for (j = 0; j < tryrules[ri]->num; ++j)
-	    if (tryrules[ri]->targets[j][1] == '\0')
+      if (!tryrules[ri].rule->terminal)
+        {
+          unsigned int j;
+          for (j = 0; j < tryrules[ri].rule->num; ++j)
+            if (tryrules[ri].rule->targets[j][1] == '\0')
               {
-                tryrules[ri] = 0;
+                tryrules[ri].rule = 0;
                 break;
               }
-	}
-
-  /* We are going to do second expansion so initialize file variables
-     for the rule. */
-  initialize_file_variables (file, 0);
+        }
 
   /* Try each rule once without intermediate files, then once with them.  */
-  for (intermed_ok = 0; intermed_ok == !!intermed_ok; ++intermed_ok)
+  for (intermed_ok = 0; intermed_ok < 2; ++intermed_ok)
     {
-      /* Try each pattern rule till we find one that applies.
-	 If it does, expand its dependencies (as substituted)
-	 and chain them in DEPS.  */
-
+      pat = deplist;
+
+      /* Try each pattern rule till we find one that applies.  If it does,
+         expand its dependencies (as substituted) and chain them in DEPS.  */
       for (ri = 0; ri < nrules; ri++)
-	{
-          struct file *f;
+        {
+          struct dep *dep;
+          int check_lastslash;
           unsigned int failed = 0;
-	  int check_lastslash;
           int file_variables_set = 0;
-
-	  rule = tryrules[ri];
-
-          remove_explicit_deps = 0;
-
-	  /* RULE is nil when we discover that a rule,
-	     already placed in TRYRULES, should not be applied.  */
-	  if (rule == 0)
-	    continue;
-
-	  /* Reject any terminal rules if we're
-	     looking to make intermediate files.  */
-	  if (intermed_ok && rule->terminal)
-	    continue;
-
-	  /* Mark this rule as in use so a recursive
-	     pattern_search won't try to use it.  */
-	  rule->in_use = 1;
-
-	  /* From the lengths of the filename and the matching pattern parts,
-	     find the stem: the part of the filename that matches the %.  */
-	  stem = filename
-	    + (rule->suffixes[matches[ri]] - rule->targets[matches[ri]]) - 1;
-	  stemlen = namelen - rule->lens[matches[ri]] + 1;
-	  check_lastslash = checked_lastslash[ri];
-	  if (check_lastslash)
-	    {
-	      stem += lastslash - filename + 1;
-	      stemlen -= (lastslash - filename) + 1;
-	    }
-
-	  DBS (DB_IMPLICIT, (_("Trying pattern rule with stem `%.*s'.\n"),
+          unsigned int deps_found = 0;
+          /* NPTR points to the part of the prereq we haven't processed.  */
+          const char *nptr = 0;
+          const char *dir = NULL;
+          int order_only = 0;
+          unsigned int matches;
+
+          rule = tryrules[ri].rule;
+
+          /* RULE is nil when we discover that a rule, already placed in
+             TRYRULES, should not be applied.  */
+          if (rule == 0)
+            continue;
+
+          /* Reject any terminal rules if we're looking to make intermediate
+             files.  */
+          if (intermed_ok && rule->terminal)
+            continue;
+
+          /* From the lengths of the filename and the matching pattern parts,
+             find the stem: the part of the filename that matches the %.  */
+          matches = tryrules[ri].matches;
+          stem = filename + (rule->suffixes[matches]
+                             - rule->targets[matches]) - 1;
+          stemlen = (namelen - rule->lens[matches]) + 1;
+          check_lastslash = tryrules[ri].checked_lastslash;
+          if (check_lastslash)
+            {
+              stem += pathlen;
+              stemlen -= pathlen;
+
+              /* We need to add the directory prefix, so set it up.  */
+              if (! pathdir)
+                {
+                  pathdir = alloca (pathlen + 1);
+                  memcpy (pathdir, filename, pathlen);
+                  pathdir[pathlen] = '\0';
+                }
+              dir = pathdir;
+            }
+
+          DBS (DB_IMPLICIT, (_("Trying pattern rule with stem `%.*s'.\n"),
                              (int) stemlen, stem));
 
           strncpy (stem_str, stem, stemlen);
           stem_str[stemlen] = '\0';
+
+          /* If there are no prerequisites, then this rule matches.  */
+          if (rule->deps == 0)
+            break;
 
           /* Temporary assign STEM to file->stem (needed to set file
@@ -471,301 +505,312 @@
           file->stem = stem_str;
 
-	  /* Try each dependency; see if it "exists".  */
-
-	  for (dep = rule->deps; dep != 0; dep = dep->next)
-	    {
-              unsigned int len;
+          /* Mark this rule as in use so a recursive pattern_search won't try
+             to use it.  */
+          rule->in_use = 1;
+
+          /* Try each prerequisite; see if it exists or can be created.  We'll
+             build a list of prereq info in DEPLIST.  Due to 2nd expansion we
+             may have to process multiple prereqs for a single dep entry.  */
+
+          pat = deplist;
+          dep = rule->deps;
+          nptr = dep_name (dep);
+          while (1)
+            {
+              struct dep *dl, *d;
               char *p;
-              char *p2;
-              unsigned int order_only = 0; /* Set if '|' was seen. */
-
-              /* In an ideal world we would take the dependency line,
-                 substitute the stem, re-expand the whole line and chop it
-                 into individual prerequisites. Unfortunately this won't work
-                 because of the "check_lastslash" twist.  Instead, we will
-                 have to go word by word, taking $()'s into account, for each
-                 word we will substitute the stem, re-expand, chop it up, and,
-                 if check_lastslash != 0, add the directory part to each
+
+              /* If we're out of name to parse, start the next prereq.  */
+              if (! nptr)
+                {
+                  dep = dep->next;
+                  if (dep == 0)
+                    break;
+                  nptr = dep_name (dep);
+                }
+
+              /* If we don't need a second expansion, just replace the %.  */
+              if (! dep->need_2nd_expansion)
+                {
+                  dep_simple = *dep;
+                  dep_simple.next = 0;
+                  p = strchr (nptr, '%');
+                  if (p == 0)
+                    dep_simple.name = nptr;
+                  else
+                    {
+                      char *o = depname;
+                      if (check_lastslash)
+                        {
+                          memcpy (o, filename, pathlen);
+                          o += pathlen;
+                        }
+                      memcpy (o, nptr, p - nptr);
+                      o += p - nptr;
+                      memcpy (o, stem_str, stemlen);
+                      o += stemlen;
+                      strcpy (o, p + 1);
+                      dep_simple.name = strcache_add (depname);
+                    }
+                  dl = &dep_simple;
+
+                  /* We've used up this dep, so next time get a new one.  */
+                  nptr = 0;
+                  ++deps_found;
+                }
+
+              /* We have to perform second expansion on this prereq.  In an
+                 ideal world we would take the dependency line, substitute the
+                 stem, re-expand the whole line and chop it into individual
+                 prerequisites.  Unfortunately this won't work because of the
+                 "check_lastslash" twist.  Instead, we will have to go word by
+                 word, taking $()'s into account.  For each word we will
+                 substitute the stem, re-expand, chop it up, and, if
+                 check_lastslash != 0, add the directory part to each
                  resulting prerequisite.  */
-
-              p = get_next_word (dep->name, &len);
-
-              while (1)
+              else
                 {
                   int add_dir = 0;
-                  int had_stem = 0;
-
+                  unsigned int len;
+
+                  nptr = get_next_word (nptr, &len);
+                  if (nptr == 0)
+                    continue;
+
+                  /* See this is a transition to order-only prereqs.  */
+                  if (! order_only && len == 1 && nptr[0] == '|')
+                    {
+                      order_only = 1;
+                      nptr += len;
+                      continue;
+                    }
+
+                  /* If the dependency name has %, substitute the stem.  If we
+                     just replace % with the stem value then later, when we do
+                     the 2nd expansion, we will re-expand this stem value
+                     again.  This is not good if you have certain characters
+                     in your stem (like $).
+
+                     Instead, we will replace % with $* and allow the second
+                     expansion to take care of it for us.  This way (since $*
+                     is a simple variable) there won't be additional
+                     re-expansion of the stem.  */
+
+                  p = lindex (nptr, nptr + len, '%');
                   if (p == 0)
-                    break; /* No more words */
-
-                  /* Is there a pattern in this prerequisite?  */
-
-                  for (p2 = p; p2 < p + len && *p2 != '%'; ++p2)
-                    ;
-
-                  if (dep->need_2nd_expansion)
-                    {
-                      /* If the dependency name has %, substitute the stem.
-
-                         Watch out, we are going to do something tricky
-                         here. If we just replace % with the stem value,
-                         later, when we do the second expansion, we will
-                         re-expand this stem value once again. This is not
-                         good especially if you have certain characters in
-                         your stem (like $).
-
-                         Instead, we will replace % with $* and allow the
-                         second expansion to take care of it for us. This way
-                         (since $* is a simple variable) there won't be
-                         additional re-expansion of the stem.  */
-
-                      if (p2 < p + len)
-                        {
-                          unsigned int i = p2 - p;
-                          memcpy (depname, p, i);
-                          memcpy (depname + i, "$*", 2);
-                          memcpy (depname + i + 2, p2 + 1, len - i - 1);
-                          depname[len + 2 - 1] = '\0';
-
-                          if (check_lastslash)
-                            add_dir = 1;
-
-                          had_stem = 1;
-                        }
-                      else
-                        {
-                          memcpy (depname, p, len);
-                          depname[len] = '\0';
-                        }
-
-                      /* Set file variables. Note that we cannot do it once
-                         at the beginning of the function because of the stem
-                         value.  */
-                      if (!file_variables_set)
-                        {
-                          set_file_variables (file);
-                          file_variables_set = 1;
-                        }
-
-                      p2 = variable_expand_for_file (depname, file);
+                    {
+                      memcpy (depname, nptr, len);
+                      depname[len] = '\0';
                     }
                   else
                     {
-                       if (p2 < p + len)
-                        {
-                          unsigned int i = p2 - p;
-                          memcpy (depname, p, i);
-                          memcpy (depname + i, stem_str, stemlen);
-                          memcpy (depname + i + stemlen, p2 + 1, len - i - 1);
-                          depname[len + stemlen - 1] = '\0';
-
-                          if (check_lastslash)
-                            add_dir = 1;
-
-                          had_stem = 1;
-                        }
-                      else
-                        {
-                          memcpy (depname, p, len);
-                          depname[len] = '\0';
-                        }
-
-                       p2 = depname;
-                    }
-
-                  /* Parse the dependencies. */
-
-                  while (1)
-                    {
-                      id_ptr = &deps;
-
-                      for (; *id_ptr; id_ptr = &(*id_ptr)->next)
-                        ;
-
-                      *id_ptr = (struct idep *)
-                        multi_glob (
-                          parse_file_seq (&p2,
-                                          order_only ? '\0' : '|',
-                                          sizeof (struct idep),
-                                          1), sizeof (struct idep));
-
-                      /* @@ It would be nice to teach parse_file_seq or
-                         multi_glob to add prefix. This would save us some
-                         reallocations. */
-
-                      if (order_only || add_dir || had_stem)
-                        {
-                          unsigned long l = lastslash - filename + 1;
-
-                          for (d = *id_ptr; d != 0; d = d->next)
-                            {
-                              if (order_only)
-                                d->ignore_mtime = 1;
-
-                              if (add_dir)
-                                {
-                                  char *n = alloca (strlen (d->name) + l + 1);
-                                  memcpy (n, filename, l);
-                                  memcpy (n+l, d->name, strlen (d->name) + 1);
-                                  d->name = strcache_add (n);
-                                }
-
-                              if (had_stem)
-                                d->had_stem = 1;
-                            }
-                        }
-
-                      if (!order_only && *p2)
+                      unsigned int i = p - nptr;
+                      memcpy (depname, nptr, i);
+                      memcpy (depname + i, "$*", 2);
+                      memcpy (depname + i + 2, p + 1, len - i - 1);
+                      depname[len + 2 - 1] = '\0';
+
+                      if (check_lastslash)
+                        add_dir = 1;
+                    }
+
+                  /* Initialize and set file variables if we haven't already
+                     done so. */
+                  if (!file_vars_initialized)
+                    {
+                      initialize_file_variables (file, 0);
+                      set_file_variables (file);
+                      file_vars_initialized = 1;
+                    }
+                  /* Update the stem value in $* for this rule.  */
+                  else if (!file_variables_set)
+                    {
+                      define_variable_for_file (
+                        "*", 1, file->stem, o_automatic, 0, file);
+                      file_variables_set = 1;
+                    }
+
+                  /* Perform the 2nd expansion.  */
+                  p = variable_expand_for_file (depname, file);
+
+                  /* Parse the expanded string. */
+                  dl = PARSE_FILE_SEQ (&p, struct dep, order_only ? '\0' : '|',
+                                       add_dir ? dir : NULL, 0);
+
+                  for (d = dl; d != NULL; d = d->next)
+                    {
+                      ++deps_found;
+                      if (order_only)
+                        d->ignore_mtime = 1;
+                    }
+
+                  /* Set up for the next word.  */
+                  nptr += len;
+                }
+
+              /* If there are more than max_pattern_deps prerequisites (due to
+                 2nd expansion), reset it and realloc the arrays.  */
+
+              if (deps_found > max_pattern_deps)
+                {
+                  unsigned int l = pat - deplist;
+                  deplist = xrealloc (deplist,
+                                      deps_found * sizeof (struct patdeps));
+                  pat = deplist + l;
+                  max_pattern_deps = deps_found;
+                }
+
+              /* Go through the nameseq and handle each as a prereq name.  */
+              for (d = dl; d != 0; d = d->next)
+                {
+                  struct dep *expl_d;
+                  int is_rule = d->name == dep_name (dep);
+
+                  if (file_impossible_p (d->name))
+                    {
+                      /* If this prereq has already been ruled "impossible",
+                         then the rule fails.  Don't bother trying it on the
+                         second pass either since we know that will fail.  */
+                      DBS (DB_IMPLICIT,
+                           (is_rule
+                            ? _("Rejecting impossible rule prerequisite `%s'.\n")
+                            : _("Rejecting impossible implicit prerequisite `%s'.\n"),
+                            d->name));
+                      tryrules[ri].rule = 0;
+
+                      failed = 1;
+                      break;
+                    }
+
+                  memset (pat, '\0', sizeof (struct patdeps));
+                  pat->ignore_mtime = d->ignore_mtime;
+
+                  DBS (DB_IMPLICIT,
+                       (is_rule
+                        ? _("Trying rule prerequisite `%s'.\n")
+                        : _("Trying implicit prerequisite `%s'.\n"), d->name));
+
+                  /* If this prereq is also explicitly mentioned for FILE,
+                     skip all tests below since it must be built no matter
+                     which implicit rule we choose. */
+
+                  for (expl_d = file->deps; expl_d != 0; expl_d = expl_d->next)
+                    if (streq (dep_name (expl_d), d->name))
+                      break;
+                  if (expl_d != 0)
+                    {
+                      (pat++)->name = d->name;
+                      continue;
+                    }
+
+                  /* The DEP->changed flag says that this dependency resides
+                     in a nonexistent directory.  So we normally can skip
+                     looking for the file.  However, if CHECK_LASTSLASH is
+                     set, then the dependency file we are actually looking for
+                     is in a different directory (the one gotten by prepending
+                     FILENAME's directory), so it might actually exist.  */
+
+                  /* @@ dep->changed check is disabled. */
+                  if (lookup_file (d->name) != 0
+                      /*|| ((!dep->changed || check_lastslash) && */
+                      || file_exists_p (d->name))
+                    {
+                      (pat++)->name = d->name;
+                      continue;
+                    }
+
+                  /* This code, given FILENAME = "lib/foo.o", dependency name
+                     "lib/foo.c", and VPATH=src, searches for
+                     "src/lib/foo.c".  */
+                  {
+                    const char *vname = vpath_search (d->name, 0, NULL, NULL);
+                    if (vname)
                       {
-                        ++p2;
-                        order_only = 1;
+                        DBS (DB_IMPLICIT,
+                             (_("Found prerequisite `%s' as VPATH `%s'\n"),
+                              d->name, vname));
+                        (pat++)->name = d->name;
                         continue;
                       }
-
-                      break;
-                    }
-
-                  p += len;
-                  p = get_next_word (p, &len);
-                }
-	    }
-
-          /* Reset the stem in FILE. */
-
-          file->stem = 0;
-
-          /* @@ This loop can be combined with the previous one. I do
-             it separately for now for transparency.*/
-
-          for (d = deps; d != 0; d = d->next)
-            {
-              const char *name = d->name;
-
-              if (file_impossible_p (name))
-                {
-                  /* If this dependency has already been ruled "impossible",
-                     then the rule fails and don't bother trying it on the
-                     second pass either since we know that will fail too.  */
-                  DBS (DB_IMPLICIT,
-                       (d->had_stem
-                        ? _("Rejecting impossible implicit prerequisite `%s'.\n")
-                        : _("Rejecting impossible rule prerequisite `%s'.\n"),
-                        name));
-                  tryrules[ri] = 0;
-
+                  }
+
+                  /* We could not find the file in any place we should look.
+                     Try to make this dependency as an intermediate file, but
+                     only on the second pass.  */
+
+                  if (intermed_ok)
+                    {
+                      DBS (DB_IMPLICIT,
+                           (_("Looking for a rule with intermediate file `%s'.\n"),
+                            d->name));
+
+                      if (int_file == 0)
+                        int_file = alloca (sizeof (struct file));
+                      memset (int_file, '\0', sizeof (struct file));
+                      int_file->name = d->name;
+
+                      if (pattern_search (int_file,
+                                          0,
+                                          depth + 1,
+                                          recursions + 1))
+                        {
+                          pat->pattern = int_file->name;
+                          int_file->name = d->name;
+                          pat->file = int_file;
+                          (pat++)->name = d->name;
+                          int_file = 0;
+                          continue;
+                        }
+
+                      /* If we have tried to find P as an intermediate file
+                         and failed, mark that name as impossible so we won't
+                         go through the search again later.  */
+                      if (int_file->variables)
+                        free_variable_set (int_file->variables);
+                      if (int_file->pat_variables)
+                        free_variable_set (int_file->pat_variables);
+                      file_impossible (d->name);
+                    }
+
+                  /* A dependency of this rule does not exist. Therefore, this
+                     rule fails.  */
                   failed = 1;
                   break;
                 }
 
-              DBS (DB_IMPLICIT,
-                   (d->had_stem
-                    ? _("Trying implicit prerequisite `%s'.\n")
-                    : _("Trying rule prerequisite `%s'.\n"), name));
-
-              /* If this prerequisite also happened to be explicitly mentioned
-                 for FILE skip all the test below since it it has to be built
-                 anyway, no matter which implicit rule we choose. */
-
-              for (expl_d = file->deps; expl_d != 0; expl_d = expl_d->next)
-                if (streq (dep_name (expl_d), name))
-                  break;
-              if (expl_d != 0)
-                continue;
-
-              /* The DEP->changed flag says that this dependency resides in a
-                 nonexistent directory.  So we normally can skip looking for
-                 the file.  However, if CHECK_LASTSLASH is set, then the
-                 dependency file we are actually looking for is in a different
-                 directory (the one gotten by prepending FILENAME's directory),
-                 so it might actually exist.  */
-
-              /* @@ dep->changed check is disabled. */
-              if (((f = lookup_file (name)) != 0 && f->is_target)
-                  /*|| ((!dep->changed || check_lastslash) && */
-                  || file_exists_p (name))
-                continue;
-
-              /* This code, given FILENAME = "lib/foo.o", dependency name
-                 "lib/foo.c", and VPATH=src, searches for "src/lib/foo.c".  */
-              {
-                const char *vname = vpath_search (name, 0);
-                if (vname)
-                  {
-                    DBS (DB_IMPLICIT,
-                         (_("Found prerequisite `%s' as VPATH `%s'\n"),
-                          name, vname));
-                    continue;
-                  }
-              }
-
-
-              /* We could not find the file in any place we should look.  Try
-                 to make this dependency as an intermediate file, but only on
-                 the second pass.  */
-
-              if (intermed_ok)
-                {
-                  if (intermediate_file == 0)
-                    intermediate_file = alloca (sizeof (struct file));
-
-                  DBS (DB_IMPLICIT,
-                       (_("Looking for a rule with intermediate file `%s'.\n"),
-                        name));
-
-                  memset (intermediate_file, '\0', sizeof (struct file));
-                  intermediate_file->name = name;
-                  if (pattern_search (intermediate_file,
-                                      0,
-                                      depth + 1,
-                                      recursions + 1))
-                    {
-                      d->intermediate_pattern = intermediate_file->name;
-                      intermediate_file->name = strcache_add (name);
-                      d->intermediate_file = intermediate_file;
-                      intermediate_file = 0;
-
-                      continue;
-                    }
-
-                  /* If we have tried to find P as an intermediate
-                     file and failed, mark that name as impossible
-                     so we won't go through the search again later.  */
-                  if (intermediate_file->variables)
-                    free_variable_set (intermediate_file->variables);
-                  file_impossible (name);
-                }
-
-              /* A dependency of this rule does not exist. Therefore,
-                 this rule fails.  */
-              failed = 1;
-              break;
+              /* Free the ns chain.  */
+              if (dl != &dep_simple)
+                free_dep_chain (dl);
+
+              if (failed)
+                break;
             }
 
+          /* Reset the stem in FILE. */
+
+          file->stem = 0;
+
           /* This rule is no longer `in use' for recursive searches.  */
-	  rule->in_use = 0;
-
-          if (failed)
-            {
-              /* This pattern rule does not apply. If some of its
-                 dependencies succeeded, free the data structure
-                 describing them.  */
-              free_idep_chain (deps);
-              deps = 0;
-            }
-	  else
-	    /* This pattern rule does apply.  Stop looking for one.  */
-	    break;
-	}
-
-      /* If we found an applicable rule without
-	 intermediate files, don't try with them.  */
+          rule->in_use = 0;
+
+          if (! failed)
+            /* This pattern rule does apply.  Stop looking for one.  */
+            break;
+
+          /* This pattern rule does not apply. If some of its dependencies
+             succeeded, free the data structure describing them.  */
+          /* free_idep_chain (deps); */
+          deps = 0;
+        }
+
+      /* If we found an applicable rule without intermediate files, don't try
+         with them.  */
       if (ri < nrules)
-	break;
+        break;
 
       rule = 0;
     }
 
-  /* RULE is nil if the loop went all the way
-     through the list and everything failed.  */
+  /* RULE is nil if the loop went through the list but everything failed.  */
   if (rule == 0)
     goto done;
@@ -773,48 +818,30 @@
   foundrule = ri;
 
-  /* If we are recursing, store the pattern that matched
-     FILENAME in FILE->name for use in upper levels.  */
+  /* If we are recursing, store the pattern that matched FILENAME in
+     FILE->name for use in upper levels.  */
 
   if (recursions > 0)
     /* Kludge-o-matic */
-    file->name = rule->targets[matches[foundrule]];
-
-  /* FOUND_FILES lists the dependencies for the rule we found.
-     This includes the intermediate files, if any.
-     Convert them into entries on the deps-chain of FILE.  */
-
-  if (remove_explicit_deps)
+    file->name = rule->targets[tryrules[foundrule].matches];
+
+  /* DEPLIST lists the prerequisites for the rule we found.  This includes the
+     intermediate files, if any.  Convert them into entries on the deps-chain
+     of FILE.  */
+
+  while (pat-- > deplist)
     {
-      /* Remove all the dependencies that didn't come from
-         this implicit rule. */
-
-      dep = file->deps;
-      while (dep != 0)
+      struct dep *dep;
+      const char *s;
+
+      if (pat->file != 0)
         {
-          struct dep *next = dep->next;
-          free_dep (dep);
-          dep = next;
-        }
-      file->deps = 0;
-  }
-
-  expl_d = file->deps; /* We will add them at the end. */
-  d_ptr = &file->deps;
-
-  for (d = deps; d != 0; d = d->next)
-    {
-      const char *s;
-
-      if (d->intermediate_file != 0)
-	{
-	  /* If we need to use an intermediate file,
-	     make sure it is entered as a target, with the info that was
-	     found for it in the recursive pattern_search call.
-	     We know that the intermediate file did not already exist as
-	     a target; therefore we can assume that the deps and cmds
-	     of F below are null before we change them.  */
-
-	  struct file *imf = d->intermediate_file;
-	  register struct file *f = lookup_file (imf->name);
+          /* If we need to use an intermediate file, make sure it is entered
+             as a target, with the info that was found for it in the recursive
+             pattern_search call.  We know that the intermediate file did not
+             already exist as a target; therefore we can assume that the deps
+             and cmds of F below are null before we change them.  */
+
+          struct file *imf = pat->file;
+          struct file *f = lookup_file (imf->name);
 
           /* We don't want to delete an intermediate file that happened
@@ -824,65 +851,62 @@
             f->precious = 1;
           else
-            f = enter_file (strcache_add (imf->name));
-
-	  f->deps = imf->deps;
-	  f->cmds = imf->cmds;
-	  f->stem = imf->stem;
+            f = enter_file (imf->name);
+
+          f->deps = imf->deps;
+          f->cmds = imf->cmds;
+          f->stem = imf->stem;
+          f->variables = imf->variables;
+          f->pat_variables = imf->pat_variables;
+          f->pat_searched = imf->pat_searched;
           f->also_make = imf->also_make;
           f->is_target = 1;
-
-          if (!f->precious)
+          f->intermediate = 1;
+          f->tried_implicit = 1;
+
+          imf = lookup_file (pat->pattern);
+          if (imf != 0 && imf->precious)
+            f->precious = 1;
+
+          for (dep = f->deps; dep != 0; dep = dep->next)
             {
-              imf = lookup_file (d->intermediate_pattern);
-              if (imf != 0 && imf->precious)
-                f->precious = 1;
+              dep->file = enter_file (dep->name);
+              dep->name = 0;
+              dep->file->tried_implicit |= dep->changed;
             }
-
-	  f->intermediate = 1;
-	  f->tried_implicit = 1;
-	  for (dep = f->deps; dep != 0; dep = dep->next)
-	    {
-	      dep->file = enter_file (dep->name);
-	      dep->name = 0;
-	      dep->file->tried_implicit |= dep->changed;
-	    }
-	}
+        }
 
       dep = alloc_dep ();
-      dep->ignore_mtime = d->ignore_mtime;
-      s = d->name; /* Hijacking the name. */
-      d->name = 0;
-      if (recursions == 0)
-	{
-	  dep->file = lookup_file (s);
-	  if (dep->file == 0)
-	    dep->file = enter_file (s);
-	}
+      dep->ignore_mtime = pat->ignore_mtime;
+      s = strcache_add (pat->name);
+      if (recursions)
+        dep->name = s;
       else
-        dep->name = s;
-
-      if (d->intermediate_file == 0 && tryrules[foundrule]->terminal)
-	{
-	  /* If the file actually existed (was not an intermediate file),
-	     and the rule that found it was a terminal one, then we want
-	     to mark the found file so that it will not have implicit rule
-	     search done for it.  If we are not entering a `struct file' for
-	     it now, we indicate this with the `changed' flag.  */
-	  if (dep->file == 0)
-	    dep->changed = 1;
-	  else
-	    dep->file->tried_implicit = 1;
-	}
-
-      *d_ptr = dep;
-      d_ptr = &dep->next;
+        {
+          dep->file = lookup_file (s);
+          if (dep->file == 0)
+            dep->file = enter_file (s);
+        }
+
+      if (pat->file == 0 && tryrules[foundrule].rule->terminal)
+        {
+          /* If the file actually existed (was not an intermediate file), and
+             the rule that found it was a terminal one, then we want to mark
+             the found file so that it will not have implicit rule search done
+             for it.  If we are not entering a `struct file' for it now, we
+             indicate this with the `changed' flag.  */
+          if (dep->file == 0)
+            dep->changed = 1;
+          else
+            dep->file->tried_implicit = 1;
+        }
+
+      dep->next = file->deps;
+      file->deps = dep;
     }
 
-  *d_ptr = expl_d;
-
-  if (!checked_lastslash[foundrule])
+  if (!tryrules[foundrule].checked_lastslash)
     {
-      /* Always allocate new storage, since STEM might be
-         on the stack for an intermediate file.  */
+      /* Always allocate new storage, since STEM might be on the stack for an
+         intermediate file.  */
       file->stem = strcache_add_len (stem, stemlen);
       fullstemlen = stemlen;
@@ -894,5 +918,5 @@
 
       /* We want to prepend the directory from
-	 the original FILENAME onto the stem.  */
+         the original FILENAME onto the stem.  */
       fullstemlen = dirlen + stemlen;
       sp = alloca (fullstemlen + 1);
@@ -908,5 +932,5 @@
   /* Set precious flag. */
   {
-    struct file *f = lookup_file (rule->targets[matches[foundrule]]);
+    struct file *f = lookup_file (rule->targets[tryrules[foundrule].matches]);
     if (f && f->precious)
       file->precious = 1;
@@ -918,38 +942,39 @@
   if (rule->num > 1)
     for (ri = 0; ri < rule->num; ++ri)
-      if (ri != matches[foundrule])
-	{
-          char *p = alloca (rule->lens[ri] + fullstemlen + 1);
-	  struct file *f;
-	  struct dep *new = alloc_dep ();
-
-	  /* GKM FIMXE: handle '|' here too */
-	  memcpy (p, rule->targets[ri],
+      if (ri != tryrules[foundrule].matches)
+        {
+          char *nm = alloca (rule->lens[ri] + fullstemlen + 1);
+          char *p = nm;
+          struct file *f;
+          struct dep *new = alloc_dep ();
+
+          /* GKM FIMXE: handle '|' here too */
+          memcpy (p, rule->targets[ri],
                   rule->suffixes[ri] - rule->targets[ri] - 1);
-	  p += rule->suffixes[ri] - rule->targets[ri] - 1;
-	  memcpy (p, file->stem, fullstemlen);
-	  p += fullstemlen;
-	  memcpy (p, rule->suffixes[ri],
+          p += rule->suffixes[ri] - rule->targets[ri] - 1;
+          memcpy (p, file->stem, fullstemlen);
+          p += fullstemlen;
+          memcpy (p, rule->suffixes[ri],
                   rule->lens[ri] - (rule->suffixes[ri] - rule->targets[ri])+1);
-          new->name = strcache_add (p);
-	  new->file = enter_file (new->name);
-	  new->next = file->also_make;
-
-	  /* Set precious flag. */
-	  f = lookup_file (rule->targets[ri]);
-	  if (f && f->precious)
+          new->name = strcache_add (nm);
+          new->file = enter_file (new->name);
+          new->next = file->also_make;
+
+          /* Set precious flag. */
+          f = lookup_file (rule->targets[ri]);
+          if (f && f->precious)
             new->file->precious = 1;
 
-          /* Set the is_target flag so that this file is not treated
-             as intermediate by the pattern rule search algorithm and
+          /* Set the is_target flag so that this file is not treated as
+             intermediate by the pattern rule search algorithm and
              file_exists_p cannot pick it up yet.  */
           new->file->is_target = 1;
 
-	  file->also_make = new;
-	}
+          file->also_make = new;
+        }
 
  done:
-  free_idep_chain (deps);
   free (tryrules);
+  free (deplist);
 
   return rule != 0;
Index: /vendor/gnumake/current/job.c
===================================================================
--- /vendor/gnumake/current/job.c	(revision 2595)
+++ /vendor/gnumake/current/job.c	(revision 2596)
@@ -1,6 +1,6 @@
 /* Job execution and handling for GNU Make.
 Copyright (C) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
-1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software
-Foundation, Inc.
+1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
+2010 Free Software Foundation, Inc.
 This file is part of GNU Make.
 
@@ -175,5 +175,5 @@
 #endif	/* Don't have `union wait'.  */
 
-#ifndef	HAVE_UNISTD_H
+#if !defined(HAVE_UNISTD_H) && !defined(WINDOWS32)
 int dup2 ();
 int execve ();
@@ -187,4 +187,20 @@
 #endif
 
+/* Different systems have different requirements for pid_t.
+   Plus we have to support gettext string translation... Argh.  */
+static const char *
+pid2str (pid_t pid)
+{
+  static char pidstring[100];
+#if defined(WINDOWS32) && (__GNUC__ > 3 || _MSC_VER > 1300)
+  /* %Id is only needed for 64-builds, which were not supported by
+      older versions of Windows compilers.  */
+  sprintf (pidstring, "%Id", pid);
+#else
+  sprintf (pidstring, "%lu", (unsigned long) pid);
+#endif
+  return pidstring;
+}
+
 int getloadavg (double loadavg[], int nelem);
 int start_remote_job (char **argv, char **envp, int stdin_fd, int *is_remote,
@@ -236,5 +252,5 @@
  */
 int
-w32_kill(int pid, int sig)
+w32_kill(pid_t pid, int sig)
 {
   return ((process_kill((HANDLE)pid, sig) == TRUE) ? 0 : -1);
@@ -249,5 +265,5 @@
 {
   const char *const ext = unixy ? "sh" : "bat";
-  const char *error = NULL;
+  const char *error_string = NULL;
   char temp_path[MAXPATHLEN]; /* need to know its length */
   unsigned path_size = GetTempPath(sizeof temp_path, temp_path);
@@ -295,5 +311,5 @@
           else
             {
-              error = map_windows32_error_to_string (er);
+              error_string = map_windows32_error_to_string (er);
               break;
             }
@@ -304,5 +320,5 @@
           char *const path = xmalloc (final_size);
           memcpy (path, temp_path, final_size);
-          *fd = _open_osfhandle ((long)h, 0);
+          *fd = _open_osfhandle ((intptr_t)h, 0);
           if (unixy)
             {
@@ -318,7 +334,7 @@
 
   *fd = -1;
-  if (error == NULL)
-    error = _("Cannot create a temporary file\n");
-  fatal (NILF, error);
+  if (error_string == NULL)
+    error_string = _("Cannot create a temporary file\n");
+  fatal (NILF, error_string);
 
   /* not reached */
@@ -371,4 +387,51 @@
 #endif /* __EMX__ */
 
+/* determines whether path looks to be a Bourne-like shell. */
+int
+is_bourne_compatible_shell (const char *path)
+{
+  /* list of known unix (Bourne-like) shells */
+  const char *unix_shells[] = {
+    "sh",
+    "bash",
+    "ksh",
+    "rksh",
+    "zsh",
+    "ash",
+    "dash",
+    NULL
+  };
+  unsigned i, len;
+
+  /* find the rightmost '/' or '\\' */
+  const char *name = strrchr (path, '/');
+  char *p = strrchr (path, '\\');
+
+  if (name && p)    /* take the max */
+    name = (name > p) ? name : p;
+  else if (p)       /* name must be 0 */
+    name = p;
+  else if (!name)   /* name and p must be 0 */
+    name = path;
+
+  if (*name == '/' || *name == '\\') name++;
+
+  /* this should be able to deal with extensions on Windows-like systems */
+  for (i = 0; unix_shells[i] != NULL; i++) {
+    len = strlen(unix_shells[i]);
+#if defined(WINDOWS32) || defined(__MSDOS__)
+    if ((strncasecmp (name, unix_shells[i], len) == 0) &&
+      (strlen(name) >= len && (name[len] == '\0' || name[len] == '.')))
+#else
+    if ((strncmp (name, unix_shells[i], len) == 0) &&
+      (strlen(name) >= len && name[len] == '\0'))
+#endif
+	return 1; /* a known unix-style shell */
+  }
+
+  /* if not on the list, assume it's not a Bourne-like shell */
+  return 0;
+}
+
 
 
@@ -518,7 +581,7 @@
 	  any_remote |= c->remote;
 	  any_local |= ! c->remote;
-	  DB (DB_JOBS, (_("Live child 0x%08lx (%s) PID %ld %s\n"),
-                        (unsigned long int) c, c->file->name,
-                        (long) c->pid, c->remote ? _(" (remote)") : ""));
+	  DB (DB_JOBS, (_("Live child %p (%s) PID %s %s\n"),
+                        c, c->file->name, pid2str (c->pid),
+                        c->remote ? _(" (remote)") : ""));
 #ifdef VMS
 	  break;
@@ -556,5 +619,5 @@
 	      else
 #endif
-		pid = wait (&status);
+		EINTRLOOP(pid, wait (&status));
 #endif /* !VMS */
 	    }
@@ -641,6 +704,5 @@
                   }
                 else
-                  DB (DB_VERBOSE, ("Main thread handle = 0x%08lx\n",
-                                   (unsigned long)main_thread));
+                  DB (DB_VERBOSE, ("Main thread handle = %p\n", main_thread));
               }
 
@@ -698,8 +760,7 @@
 
       DB (DB_JOBS, (child_failed
-                    ? _("Reaping losing child 0x%08lx PID %ld %s\n")
-                    : _("Reaping winning child 0x%08lx PID %ld %s\n"),
-                    (unsigned long int) c, (long) c->pid,
-                    c->remote ? _(" (remote)") : ""));
+                    ? _("Reaping losing child %p PID %s %s\n")
+                    : _("Reaping winning child %p PID %s %s\n"),
+                    c, pid2str (c->pid), c->remote ? _(" (remote)") : ""));
 
       if (c->sh_batch_file) {
@@ -802,7 +863,6 @@
         notice_finished_file (c->file);
 
-      DB (DB_JOBS, (_("Removing child 0x%08lx PID %ld%s from chain.\n"),
-                    (unsigned long int) c, (long) c->pid,
-                    c->remote ? _(" (remote)") : ""));
+      DB (DB_JOBS, (_("Removing child %p PID %s%s from chain.\n"),
+                    c, pid2str (c->pid), c->remote ? _(" (remote)") : ""));
 
       /* Block fatal signals while frobnicating the list, so that
@@ -848,6 +908,6 @@
 {
   if (!jobserver_tokens)
-    fatal (NILF, "INTERNAL: Freeing child 0x%08lx (%s) but no tokens left!\n",
-           (unsigned long int) child, child->file->name);
+    fatal (NILF, "INTERNAL: Freeing child %p (%s) but no tokens left!\n",
+           child, child->file->name);
 
   /* If we're using the jobserver and this child is not the only outstanding
@@ -865,6 +925,6 @@
 	pfatal_with_name (_("write jobserver"));
 
-      DB (DB_JOBS, (_("Released token for child 0x%08lx (%s).\n"),
-                    (unsigned long int) child, child->file->name));
+      DB (DB_JOBS, (_("Released token for child %p (%s).\n"),
+                    child, child->file->name));
     }
 
@@ -974,6 +1034,7 @@
   static int bad_stdin = -1;
 #endif
-  register char *p;
-  int flags;
+  char *p;
+  /* Must be volatile to silence bogus GCC warning about longjmp/vfork.  */
+  volatile int flags;
 #ifdef VMS
   char *argv;
@@ -1112,8 +1173,11 @@
       unixy_shell	/* the test is complicated and we already did it */
 #else
-      (argv[0] && !strcmp (argv[0], "/bin/sh"))
-#endif
-      && (argv[1]
-          && argv[1][0] == '-' && argv[1][1] == 'c' && argv[1][2] == '\0')
+      (argv[0] && is_bourne_compatible_shell(argv[0]))
+#endif
+      && (argv[1] && argv[1][0] == '-'
+	&&
+	    ((argv[1][1] == 'c' && argv[1][2] == '\0')
+	  ||
+	     (argv[1][1] == 'e' && argv[1][2] == 'c' && argv[1][3] == '\0')))
       && (argv[2] && argv[2][0] == ':' && argv[2][1] == '\0')
       && argv[3] == NULL)
@@ -1282,4 +1346,10 @@
             close (job_rfd);
 
+#ifdef SET_STACK_SIZE
+          /* Reset limits, if necessary.  */
+          if (stack_limit.rlim_cur)
+            setrlimit (RLIMIT_STACK, &stack_limit);
+#endif
+
 	  child_execute_job (child->good_stdin ? 0 : bad_stdin, 1,
                              argv, child->environment);
@@ -1382,5 +1452,5 @@
 
       if (hPID != INVALID_HANDLE_VALUE)
-        child->pid = (int) hPID;
+        child->pid = (pid_t) hPID;
       else {
         int i;
@@ -1459,7 +1529,7 @@
     case cs_running:
       c->next = children;
-      DB (DB_JOBS, (_("Putting child 0x%08lx (%s) PID %ld%s on the chain.\n"),
-                    (unsigned long int) c, c->file->name,
-                    (long) c->pid, c->remote ? _(" (remote)") : ""));
+      DB (DB_JOBS, (_("Putting child %p (%s) PID %s%s on the chain.\n"),
+                    c, c->file->name, pid2str (c->pid),
+                    c->remote ? _(" (remote)") : ""));
       children = c;
       /* One more job slot is in use.  */
@@ -1601,5 +1671,5 @@
 	 Copy the remaining uninteresting text to the output.  */
       if (out != in)
-	strcpy (out, in);
+	memmove (out, in, strlen (in) + 1);
 
       /* Finally, expand the line.  */
@@ -1611,6 +1681,5 @@
      `struct child', and add that to the chain.  */
 
-  c = xmalloc (sizeof (struct child));
-  memset (c, '\0', sizeof (struct child));
+  c = xcalloc (sizeof (struct child));
   c->file = file;
   c->command_lines = lines;
@@ -1713,6 +1782,6 @@
 	if (got_token == 1)
           {
-            DB (DB_JOBS, (_("Obtained token for child 0x%08lx (%s).\n"),
-                          (unsigned long int) c, c->file->name));
+            DB (DB_JOBS, (_("Obtained token for child %p (%s).\n"),
+                          c, c->file->name));
             break;
           }
@@ -2032,5 +2101,5 @@
       int i;
       fprintf(stderr,
-              _("process_easy() failed failed to launch process (e=%ld)\n"),
+              _("process_easy() failed to launch process (e=%ld)\n"),
               process_last_err(hPID));
       for (i = 0; argv[i]; i++)
@@ -2061,7 +2130,12 @@
           break;
       else
+	{
+	  char *pidstr = xstrdup (pid2str ((pid_t)hWaitPID));
+
           fprintf(stderr,
-                  _("make reaped child pid %ld, still waiting for pid %ld\n"),
-                  (DWORD)hWaitPID, (DWORD)hPID);
+                  _("make reaped child pid %s, still waiting for pid %s\n"),
+		  pidstr, pid2str ((pid_t)hPID));
+	  free (pidstr);
+	}
     }
 
@@ -2222,5 +2296,5 @@
 static char **
 construct_command_argv_internal (char *line, char **restp, char *shell,
-                                 char *ifs, int flags,
+                                 char *shellflags, char *ifs, int flags,
 				 char **batch_filename_ptr)
 {
@@ -2263,5 +2337,5 @@
 				 "continue", "export", "read", "readonly",
 				 "shift", "times", "trap", "switch", "unset",
-                                 0 };
+                                 "ulimit", 0 };
 
   char *sh_chars;
@@ -2305,10 +2379,13 @@
 #elif defined (WINDOWS32)
   static char sh_chars_dos[] = "\"|&<>";
-  static char *sh_cmds_dos[] = { "break", "call", "cd", "chcp", "chdir", "cls",
-			     "copy", "ctty", "date", "del", "dir", "echo",
-			     "erase", "exit", "for", "goto", "if", "if", "md",
-			     "mkdir", "path", "pause", "prompt", "rd", "rem",
-                             "ren", "rename", "rmdir", "set", "shift", "time",
-                             "type", "ver", "verify", "vol", ":", 0 };
+  static char *sh_cmds_dos[] = { "assoc", "break", "call", "cd", "chcp",
+				 "chdir", "cls", "color", "copy", "ctty",
+				 "date", "del", "dir", "echo", "echo.",
+				 "endlocal", "erase", "exit", "for", "ftype",
+				 "goto", "if", "if", "md", "mkdir", "path",
+				 "pause", "prompt", "rd", "rem", "ren",
+				 "rename", "rmdir", "set", "setlocal",
+				 "shift", "time", "title", "type", "ver",
+				 "verify", "vol", ":", 0 };
   static char sh_chars_sh[] = "#;\"*?[]&|<>(){}$`^";
   static char *sh_cmds_sh[] = { "cd", "eval", "exec", "exit", "login",
@@ -2332,5 +2409,5 @@
                              "login", "logout", "read", "readonly", "set",
                              "shift", "switch", "test", "times", "trap",
-                             "umask", "wait", "while", 0 };
+                             "ulimit", "umask", "unset", "wait", "while", 0 };
 # ifdef HAVE_DOS_PATHS
   /* This is required if the MSYS/Cygwin ports (which do not define
@@ -2426,4 +2503,10 @@
       if (*ap != ' ' && *ap != '\t' && *ap != '\n')
 	goto slow;
+
+  if (shellflags != 0)
+    if (shellflags[0] != '-'
+        || ((shellflags[1] != 'c' || shellflags[2] != '\0')
+            && (shellflags[1] != 'e' || shellflags[2] != 'c' || shellflags[3] != '\0')))
+      goto slow;
 
   i = strlen (line) + 1;
@@ -2491,4 +2574,7 @@
 	/* Not inside a string, but it's a special char.  */
 	goto slow;
+      else if (one_shell && *p == '\n')
+	/* In .ONESHELL mode \n is a separator like ; or && */
+	goto slow;
 #ifdef  __MSDOS__
       else if (*p == '.' && p[1] == '.' && p[2] == '.' && p[3] != '.')
@@ -2708,32 +2794,95 @@
     return 0;
 #endif /* WINDOWS32 */
+
   {
     /* SHELL may be a multi-word command.  Construct a command line
-       "SHELL -c LINE", with all special chars in LINE escaped.
+       "$(SHELL) $(.SHELLFLAGS) LINE", with all special chars in LINE escaped.
        Then recurse, expanding this command line to get the final
        argument list.  */
 
     unsigned int shell_len = strlen (shell);
-#ifndef VMS
-    static char minus_c[] = " -c ";
-#else
-    static char minus_c[] = "";
-#endif
     unsigned int line_len = strlen (line);
-
-    char *new_line = alloca (shell_len + (sizeof (minus_c)-1)
-                             + (line_len*2) + 1);
+    unsigned int sflags_len = strlen (shellflags);
     char *command_ptr = NULL; /* used for batch_mode_shell mode */
+    char *new_line;
 
 # ifdef __EMX__ /* is this necessary? */
     if (!unixy_shell)
-      minus_c[1] = '/'; /* " /c " */
+      shellflags[0] = '/'; /* "/c" */
 # endif
 
+    /* In .ONESHELL mode we are allowed to throw the entire current
+	recipe string at a single shell and trust that the user
+	has configured the shell and shell flags, and formatted
+	the string, appropriately. */
+    if (one_shell)
+      {
+	/* If the shell is Bourne compatible, we must remove and ignore
+	   interior special chars [@+-] because they're meaningless to
+	   the shell itself. If, however, we're in .ONESHELL mode and
+	   have changed SHELL to something non-standard, we should
+	   leave those alone because they could be part of the
+	   script. In this case we must also leave in place
+	   any leading [@+-] for the same reason.  */
+
+	/* Remove and ignore interior prefix chars [@+-] because they're
+	     meaningless given a single shell. */
+#if defined __MSDOS__ || defined (__EMX__)
+	if (unixy_shell)     /* the test is complicated and we already did it */
+#else
+	if (is_bourne_compatible_shell(shell))
+#endif
+          {
+            const char *f = line;
+            char *t = line;
+
+            /* Copy the recipe, removing and ignoring interior prefix chars
+               [@+-]: they're meaningless in .ONESHELL mode.  */
+            while (f[0] != '\0')
+              {
+                int esc = 0;
+
+                /* This is the start of a new recipe line.
+                   Skip whitespace and prefix characters.  */
+                while (isblank (*f) || *f == '-' || *f == '@' || *f == '+')
+                  ++f;
+
+                /* Copy until we get to the next logical recipe line.  */
+                while (*f != '\0')
+                  {
+                    *(t++) = *(f++);
+                    if (f[-1] == '\\')
+                      esc = !esc;
+                    else
+                      {
+                        /* On unescaped newline, we're done with this line.  */
+                        if (f[-1] == '\n' && ! esc)
+                          break;
+
+                        /* Something else: reset the escape sequence.  */
+                        esc = 0;
+                      }
+                  }
+              }
+            *t = '\0';
+          }
+
+	new_argv = xmalloc (4 * sizeof (char *));
+	new_argv[0] = xstrdup(shell);
+	new_argv[1] = xstrdup(shellflags);
+	new_argv[2] = line;
+	new_argv[3] = NULL;
+	return new_argv;
+      }
+
+    new_line = alloca (shell_len + 1 + sflags_len + 1
+                             + (line_len*2) + 1);
     ap = new_line;
     memcpy (ap, shell, shell_len);
     ap += shell_len;
-    memcpy (ap, minus_c, sizeof (minus_c) - 1);
-    ap += sizeof (minus_c) - 1;
+    *(ap++) = ' ';
+    memcpy (ap, shellflags, sflags_len);
+    ap += sflags_len;
+    *(ap++) = ' ';
     command_ptr = ap;
     for (p = line; *p != '\0'; ++p)
@@ -2785,5 +2934,5 @@
 	*ap++ = *p;
       }
-    if (ap == new_line + shell_len + sizeof (minus_c) - 1)
+    if (ap == new_line + shell_len + sflags_len + 2)
       /* Line was empty.  */
       return 0;
@@ -2837,6 +2986,8 @@
     } else
 #endif /* WINDOWS32 */
+
     if (unixy_shell)
-      new_argv = construct_command_argv_internal (new_line, 0, 0, 0, flags, 0);
+      new_argv = construct_command_argv_internal (new_line, 0, 0, 0, 0, flags, 0);
+
 #ifdef __EMX__
     else if (!unixy_shell)
@@ -2849,6 +3000,9 @@
         char *q = new_line;
         memcpy (new_line, line, line_len + 1);
-        /* replace all backslash-newline combination and also following tabs */
-        while (*q != '\0')
+        /* Replace all backslash-newline combination and also following tabs.
+           Important: stop at the first '\n' because that's what the loop above
+           did. The next line starting at restp[0] will be executed during the
+           next call of this function. */
+        while (*q != '\0' && *q != '\n')
           {
             if (q[0] == '\\' && q[1] == '\n')
@@ -2911,8 +3065,8 @@
            cannot backslash-escape the special characters (see above).  */
         new_argv = xmalloc (sizeof (char *));
-        line_len = strlen (new_line) - shell_len - sizeof (minus_c) + 1;
+        line_len = strlen (new_line) - shell_len - sflags_len - 2;
         new_argv[0] = xmalloc (line_len + 1);
         strncpy (new_argv[0],
-                 new_line + shell_len + sizeof (minus_c) - 1, line_len);
+                 new_line + shell_len + sflags_len + 2, line_len);
         new_argv[0][line_len] = '\0';
       }
@@ -2946,5 +3100,5 @@
                         int cmd_flags, char **batch_filename_ptr)
 {
-  char *shell, *ifs;
+  char *shell, *ifs, *shellflags;
   char **argv;
 
@@ -3051,4 +3205,5 @@
 #endif /* __EMX__ */
 
+    shellflags = allocated_variable_expand_for_file ("$(.SHELLFLAGS)", file);
     ifs = allocated_variable_expand_for_file ("$(IFS)", file);
 
@@ -3056,8 +3211,9 @@
   }
 
-  argv = construct_command_argv_internal (line, restp, shell, ifs,
+  argv = construct_command_argv_internal (line, restp, shell, shellflags, ifs,
                                           cmd_flags, batch_filename_ptr);
 
   free (shell);
+  free (shellflags);
   free (ifs);
 #endif /* !VMS */
@@ -3083,5 +3239,5 @@
   return fd;
 }
-#endif /* !HAPE_DUP2 && !_AMIGA */
+#endif /* !HAVE_DUP2 && !_AMIGA */
 
 /* On VMS systems, include special VMS functions.  */
Index: /vendor/gnumake/current/job.h
===================================================================
--- /vendor/gnumake/current/job.h	(revision 2595)
+++ /vendor/gnumake/current/job.h	(revision 2596)
@@ -1,5 +1,6 @@
 /* Definitions for managing subprocesses in GNU Make.
 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
-2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
+2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software
+Foundation, Inc.
 This file is part of GNU Make.
 
@@ -54,4 +55,5 @@
     int efn;			/* Completion event flag number */
     int cstatus;		/* Completion status */
+    char *comname;              /* Temporary command file name */
 #endif
     char *sh_batch_file;        /* Script file for shell commands */
@@ -67,4 +69,5 @@
 extern struct child *children;
 
+int is_bourne_compatible_shell(const char *path);
 void new_job (struct file *file);
 void reap_children (int block, int err);
Index: /vendor/gnumake/current/main.c
===================================================================
--- /vendor/gnumake/current/main.c	(revision 2595)
+++ /vendor/gnumake/current/main.c	(revision 2596)
@@ -1,6 +1,6 @@
 /* Argument parsing and main program of GNU Make.
 Copyright (C) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
-1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software
-Foundation, Inc.
+1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
+2010 Free Software Foundation, Inc.
 This file is part of GNU Make.
 
@@ -45,12 +45,4 @@
 #endif
 
-#if defined(HAVE_SYS_RESOURCE_H) && defined(HAVE_GETRLIMIT) && defined(HAVE_SETRLIMIT)
-# define SET_STACK_SIZE
-#endif
-
-#ifdef SET_STACK_SIZE
-# include <sys/resource.h>
-#endif
-
 #ifdef _AMIGA
 int __stack = 20000; /* Make sure we have 20K of stack space */
@@ -65,5 +57,4 @@
 void print_dir_data_base (void);
 void print_rule_data_base (void);
-void print_file_data_base (void);
 void print_vpath_data_base (void);
 
@@ -89,5 +80,5 @@
 static void decode_switches (int argc, char **argv, int env);
 static void decode_env_switches (char *envar, unsigned int len);
-static void define_makeflags (int all, int makefile);
+static const char *define_makeflags (int all, int makefile);
 static char *quote_for_env (char *out, const char *in);
 static void initialize_global_hash_tables (void);
@@ -222,4 +213,11 @@
 static struct stringlist *makefiles = 0;
 
+/* Size of the stack when we started.  */
+
+#ifdef SET_STACK_SIZE
+struct rlimit stack_limit;
+#endif
+
+
 /* Number of job slots (commands that can be run at once).  */
 
@@ -266,4 +264,7 @@
 
 static struct stringlist *new_files = 0;
+
+/* List of strings to be eval'd.  */
+static struct stringlist *eval_strings = 0;
 
 /* If nonzero, we should just print usage and exit.  */
@@ -317,4 +318,6 @@
   -e, --environment-overrides\n\
                               Environment variables override makefiles.\n"),
+    N_("\
+  --eval=STRING               Evaluate STRING as a makefile statement.\n"),
     N_("\
   -f FILE, --file=FILE, --makefile=FILE\n\
@@ -423,4 +426,5 @@
     { CHAR_MAX+5, flag, &warn_undefined_variables_flag, 1, 1, 0, 0, 0,
       "warn-undefined-variables" },
+    { CHAR_MAX+6, string, &eval_strings, 1, 0, 0, 0, 0, "eval" },
     { 0, 0, 0, 0, 0, 0, 0, 0, 0 }
   };
@@ -472,13 +476,11 @@
 unsigned int makelevel;
 
-/* First file defined in the makefile whose name does not
-   start with `.'.  This is the default to remake if the
-   command line does not specify.  */
-
-struct file *default_goal_file;
-
-/* Pointer to the value of the .DEFAULT_GOAL special
-   variable.  */
-char ** default_goal_name;
+/* Pointer to the value of the .DEFAULT_GOAL special variable.
+   The value will be the name of the goal to remake if the command line
+   does not override it.  It can be set by the makefile, or else it's
+   the first target defined in the makefile whose name does not start
+   with '.'.  */
+
+struct variable * default_goal_var;
 
 /* Pointer to structure for the file .DEFAULT
@@ -497,4 +499,10 @@
 
 int second_expansion;
+
+/* Nonzero if we have seen the '.ONESHELL' target.
+   This causes the entire recipe to be handed to SHELL
+   as a single string, potentially containing newlines.  */
+
+int one_shell;
 
 /* Nonzero if we have seen the `.NOTPARALLEL' target.
@@ -520,9 +528,9 @@
 #endif
 
-#if !defined HAVE_BSD_SIGNAL && !defined bsd_signal
+#if !HAVE_DECL_BSD_SIGNAL && !defined bsd_signal
 # if !defined HAVE_SIGACTION
 #  define bsd_signal signal
 # else
-typedef RETSIGTYPE (*bsd_signal_ret_t) ();
+typedef RETSIGTYPE (*bsd_signal_ret_t) (int);
 
 static bsd_signal_ret_t
@@ -684,6 +692,6 @@
     {
       sprintf(errmsg,
-              _("%s: Interrupt/Exception caught (code = 0x%lx, addr = 0x%lx)\n"),
-              prg, exrec->ExceptionCode, (DWORD)exrec->ExceptionAddress);
+              _("%s: Interrupt/Exception caught (code = 0x%lx, addr = 0x%p)\n"),
+              prg, exrec->ExceptionCode, exrec->ExceptionAddress);
       fprintf(stderr, errmsg);
       exit(255);
@@ -691,7 +699,7 @@
 
   sprintf(errmsg,
-          _("\nUnhandled exception filter called from program %s\nExceptionCode = %lx\nExceptionFlags = %lx\nExceptionAddress = %lx\n"),
+          _("\nUnhandled exception filter called from program %s\nExceptionCode = %lx\nExceptionFlags = %lx\nExceptionAddress = 0x%p\n"),
           prg, exrec->ExceptionCode, exrec->ExceptionFlags,
-          (DWORD)exrec->ExceptionAddress);
+          exrec->ExceptionAddress);
 
   if (exrec->ExceptionCode == EXCEPTION_ACCESS_VIOLATION
@@ -699,7 +707,7 @@
     sprintf(&errmsg[strlen(errmsg)],
             (exrec->ExceptionInformation[0]
-             ? _("Access violation: write operation at address %lx\n")
-             : _("Access violation: read operation at address %lx\n")),
-            exrec->ExceptionInformation[1]);
+             ? _("Access violation: write operation at address 0x%p\n")
+             : _("Access violation: read operation at address 0x%p\n")),
+            (PVOID)exrec->ExceptionInformation[1]);
 
   /* turn this on if we want to put stuff in the event log too */
@@ -775,6 +783,6 @@
     sprintf (sh_path, "%s", search_token);
     default_shell = xstrdup (w32ify (sh_path, 0));
-    DB (DB_VERBOSE,
-        (_("find_and_set_shell setting default_shell = %s\n"), default_shell));
+    DB (DB_VERBOSE, (_("find_and_set_shell() setting default_shell = %s\n"),
+                     default_shell));
     sh_found = 1;
   } else if (!no_default_sh_exe &&
@@ -786,6 +794,6 @@
     sprintf (sh_path, "%s", search_token);
     default_shell = xstrdup (w32ify (sh_path, 0));
-    DB (DB_VERBOSE,
-        (_("find_and_set_shell setting default_shell = %s\n"), default_shell));
+    DB (DB_VERBOSE, (_("find_and_set_shell() setting default_shell = %s\n"),
+                     default_shell));
     sh_found = 1;
   } else {
@@ -828,5 +836,5 @@
       if (sh_found)
         DB (DB_VERBOSE,
-            (_("find_and_set_shell path search set default_shell = %s\n"),
+            (_("find_and_set_shell() path search set default_shell = %s\n"),
              default_shell));
     }
@@ -935,9 +943,13 @@
 
     /* Set the stack limit huge so that alloca does not fail.  */
-    if (getrlimit (RLIMIT_STACK, &rlim) == 0)
+    if (getrlimit (RLIMIT_STACK, &rlim) == 0
+        && rlim.rlim_cur > 0 && rlim.rlim_cur < rlim.rlim_max)
       {
+        stack_limit = rlim;
         rlim.rlim_cur = rlim.rlim_max;
         setrlimit (RLIMIT_STACK, &rlim);
       }
+    else
+      stack_limit.rlim_cur = 0;
   }
 #endif
@@ -950,5 +962,4 @@
   initialize_main(&argc, &argv);
 
-  default_goal_file = 0;
   reading_file = 0;
 
@@ -967,6 +978,8 @@
   /* Set up gettext/internationalization support.  */
   setlocale (LC_ALL, "");
-  bindtextdomain (PACKAGE, LOCALEDIR);
-  textdomain (PACKAGE);
+  /* The cast to void shuts up compiler warnings on systems that
+     disable NLS.  */
+  (void)bindtextdomain (PACKAGE, LOCALEDIR);
+  (void)textdomain (PACKAGE);
 
 #ifdef	POSIX
@@ -978,5 +991,5 @@
 #define	ADD_SIG(sig)	fatal_signal_mask |= sigmask (sig)
 #else
-#define	ADD_SIG(sig)
+#define	ADD_SIG(sig)    (void)sig      /* Needed to avoid warnings in MSVC.  */
 #endif
 #endif
@@ -1120,24 +1133,28 @@
 
   /* Initialize the special variables.  */
-  define_variable (".VARIABLES", 10, "", o_default, 0)->special = 1;
-  /* define_variable (".TARGETS", 8, "", o_default, 0)->special = 1; */
-  define_variable (".RECIPEPREFIX", 13, "", o_default, 0)->special = 1;
-
-  /* Set up .FEATURES */
-  define_variable (".FEATURES", 9,
-                   "target-specific order-only second-expansion else-if",
-                   o_default, 0);
+  define_variable_cname (".VARIABLES", "", o_default, 0)->special = 1;
+  /* define_variable_cname (".TARGETS", "", o_default, 0)->special = 1; */
+  define_variable_cname (".RECIPEPREFIX", "", o_default, 0)->special = 1;
+  define_variable_cname (".SHELLFLAGS", "-c", o_default, 0);
+
+  /* Set up .FEATURES
+     We must do this in multiple calls because define_variable_cname() is
+     a macro and some compilers (MSVC) don't like conditionals in macros.  */
+  {
+    const char *features = "target-specific order-only second-expansion"
+                           " else-if shortest-stem undefine"
 #ifndef NO_ARCHIVES
-  do_variable_definition (NILF, ".FEATURES", "archives",
-                          o_default, f_append, 0);
+                           " archives"
 #endif
 #ifdef MAKE_JOBSERVER
-  do_variable_definition (NILF, ".FEATURES", "jobserver",
-                          o_default, f_append, 0);
+                           " jobserver"
 #endif
 #ifdef MAKE_SYMLINKS
-  do_variable_definition (NILF, ".FEATURES", "check-symlink",
-                          o_default, f_append, 0);
-#endif
+                           " check-symlink"
+#endif
+                           ;
+
+    define_variable_cname (".FEATURES", features, o_default, 0);
+  }
 
   /* Read in variables from the environment.  It is important that this be
@@ -1191,4 +1208,5 @@
 #endif
                 shell_var.name = "SHELL";
+                shell_var.length = 5;
                 shell_var.value = xstrdup (ep + 1);
               }
@@ -1208,7 +1226,6 @@
      */
     if (!unix_path)
-      define_variable("PATH", 4,
-                      windows32_path ? windows32_path : "",
-                      o_env, 1)->export = v_export;
+      define_variable_cname ("PATH", windows32_path ? windows32_path : "",
+                             o_env, 1)->export = v_export;
 #endif
 #else /* For Amiga, read the ENV: device, ignoring all dirs */
@@ -1252,5 +1269,7 @@
   decode_env_switches (STRING_SIZE_TUPLE ("MFLAGS"));
 #endif
+
   decode_switches (argc, argv, 0);
+
 #ifdef WINDOWS32
   if (suspend_flag) {
@@ -1316,5 +1335,5 @@
 # endif
       )
-    argv[0] = xstrdup (concat (current_directory, "/", argv[0]));
+    argv[0] = xstrdup (concat (3, current_directory, "/", argv[0]));
 #else  /* !__MSDOS__ */
   if (current_directory[0] != '\0'
@@ -1325,5 +1344,5 @@
 #endif
       )
-    argv[0] = xstrdup (concat (current_directory, "/", argv[0]));
+    argv[0] = xstrdup (concat (3, current_directory, "/", argv[0]));
 #endif /* !__MSDOS__ */
 #endif /* WINDOWS32 */
@@ -1332,6 +1351,6 @@
   /* The extra indirection through $(MAKE_COMMAND) is done
      for hysterical raisins.  */
-  (void) define_variable ("MAKE_COMMAND", 12, argv[0], o_default, 0);
-  (void) define_variable ("MAKE", 4, "$(MAKE_COMMAND)", o_default, 1);
+  define_variable_cname ("MAKE_COMMAND", argv[0], o_default, 0);
+  define_variable_cname ("MAKE", "$(MAKE_COMMAND)", o_default, 1);
 
   if (command_variables != 0)
@@ -1371,6 +1390,5 @@
       /* Define an unchangeable variable with a name that no POSIX.2
 	 makefile could validly use for its own variable.  */
-      (void) define_variable ("-*-command-variables-*-", 23,
-			      value, o_automatic, 0);
+      define_variable_cname ("-*-command-variables-*-", value, o_automatic, 0);
 
       /* Define the variable; this will not override any user definition.
@@ -1380,6 +1398,6 @@
          allow the user's setting of MAKEOVERRIDES to affect MAKEFLAGS, so
          a reference to this hidden variable is written instead. */
-      (void) define_variable ("MAKEOVERRIDES", 13,
-			      "${-*-command-variables-*-}", o_env, 1);
+      define_variable_cname ("MAKEOVERRIDES", "${-*-command-variables-*-}",
+                             o_env, 1);
     }
 
@@ -1395,5 +1413,5 @@
              But allow -C/ just in case someone wants that.  */
           {
-            char *p = dir + strlen (dir) - 1;
+            char *p = (char *)dir + strlen (dir) - 1;
             while (p > dir && (p[0] == '/' || p[0] == '\\'))
               --p;
@@ -1468,5 +1486,5 @@
     }
 
-  (void) define_variable ("CURDIR", 6, current_directory, o_file, 0);
+  define_variable_cname ("CURDIR", current_directory, o_file, 0);
 
   /* Read any stdin makefiles into temporary files.  */
@@ -1608,8 +1626,35 @@
   default_file = enter_file (strcache_add (".DEFAULT"));
 
-  {
-    struct variable *v = define_variable (".DEFAULT_GOAL", 13, "", o_file, 0);
-    default_goal_name = &v->value;
-  }
+  default_goal_var = define_variable_cname (".DEFAULT_GOAL", "", o_file, 0);
+
+  /* Evaluate all strings provided with --eval.
+     Also set up the $(-*-eval-flags-*-) variable.  */
+
+  if (eval_strings)
+    {
+      char *p, *value;
+      unsigned int i;
+      unsigned int len = sizeof ("--eval=") * eval_strings->idx;
+
+      for (i = 0; i < eval_strings->idx; ++i)
+        {
+          p = xstrdup (eval_strings->list[i]);
+          len += 2 * strlen (p);
+          eval_buffer (p);
+          free (p);
+        }
+
+      p = value = alloca (len);
+      for (i = 0; i < eval_strings->idx; ++i)
+        {
+          strcpy (p, "--eval=");
+          p += strlen (p);
+          p = quote_for_env (p, eval_strings->list[i]);
+          *(p++) = ' ';
+        }
+      p[-1] = '\0';
+
+      define_variable_cname ("-*-eval-flags-*-", value, o_automatic, 0);
+    }
 
   /* Read all the makefiles.  */
@@ -1670,58 +1715,58 @@
 
   if (jobserver_fds)
-  {
-    const char *cp;
-    unsigned int ui;
-
-    for (ui=1; ui < jobserver_fds->idx; ++ui)
-      if (!streq (jobserver_fds->list[0], jobserver_fds->list[ui]))
-        fatal (NILF, _("internal error: multiple --jobserver-fds options"));
-
-    /* Now parse the fds string and make sure it has the proper format.  */
-
-    cp = jobserver_fds->list[0];
-
-    if (sscanf (cp, "%d,%d", &job_fds[0], &job_fds[1]) != 2)
-      fatal (NILF,
-             _("internal error: invalid --jobserver-fds string `%s'"), cp);
-
-    DB (DB_JOBS,
-	(_("Jobserver client (fds %d,%d)\n"), job_fds[0], job_fds[1]));
-
-    /* The combination of a pipe + !job_slots means we're using the
-       jobserver.  If !job_slots and we don't have a pipe, we can start
-       infinite jobs.  If we see both a pipe and job_slots >0 that means the
-       user set -j explicitly.  This is broken; in this case obey the user
-       (ignore the jobserver pipe for this make) but print a message.  */
-
-    if (job_slots > 0)
-      error (NILF,
-             _("warning: -jN forced in submake: disabling jobserver mode."));
-
-    /* Create a duplicate pipe, that will be closed in the SIGCHLD
-       handler.  If this fails with EBADF, the parent has closed the pipe
-       on us because it didn't think we were a submake.  If so, print a
-       warning then default to -j1.  */
-
-    else if ((job_rfd = dup (job_fds[0])) < 0)
-      {
-        if (errno != EBADF)
-          pfatal_with_name (_("dup jobserver"));
-
+    {
+      const char *cp;
+      unsigned int ui;
+
+      for (ui=1; ui < jobserver_fds->idx; ++ui)
+        if (!streq (jobserver_fds->list[0], jobserver_fds->list[ui]))
+          fatal (NILF, _("internal error: multiple --jobserver-fds options"));
+
+      /* Now parse the fds string and make sure it has the proper format.  */
+
+      cp = jobserver_fds->list[0];
+
+      if (sscanf (cp, "%d,%d", &job_fds[0], &job_fds[1]) != 2)
+        fatal (NILF,
+               _("internal error: invalid --jobserver-fds string `%s'"), cp);
+
+      DB (DB_JOBS,
+          (_("Jobserver client (fds %d,%d)\n"), job_fds[0], job_fds[1]));
+
+      /* The combination of a pipe + !job_slots means we're using the
+         jobserver.  If !job_slots and we don't have a pipe, we can start
+         infinite jobs.  If we see both a pipe and job_slots >0 that means the
+         user set -j explicitly.  This is broken; in this case obey the user
+         (ignore the jobserver pipe for this make) but print a message.  */
+
+      if (job_slots > 0)
         error (NILF,
-               _("warning: jobserver unavailable: using -j1.  Add `+' to parent make rule."));
-        job_slots = 1;
-      }
-
-    if (job_slots > 0)
-      {
-        close (job_fds[0]);
-        close (job_fds[1]);
-        job_fds[0] = job_fds[1] = -1;
-        free (jobserver_fds->list);
-        free (jobserver_fds);
-        jobserver_fds = 0;
-      }
-  }
+               _("warning: -jN forced in submake: disabling jobserver mode."));
+
+      /* Create a duplicate pipe, that will be closed in the SIGCHLD
+         handler.  If this fails with EBADF, the parent has closed the pipe
+         on us because it didn't think we were a submake.  If so, print a
+         warning then default to -j1.  */
+
+      else if ((job_rfd = dup (job_fds[0])) < 0)
+        {
+          if (errno != EBADF)
+            pfatal_with_name (_("dup jobserver"));
+
+          error (NILF,
+                 _("warning: jobserver unavailable: using -j1.  Add `+' to parent make rule."));
+          job_slots = 1;
+        }
+
+      if (job_slots > 0)
+        {
+          close (job_fds[0]);
+          close (job_fds[1]);
+          job_fds[0] = job_fds[1] = -1;
+          free (jobserver_fds->list);
+          free (jobserver_fds);
+          jobserver_fds = 0;
+        }
+    }
 
   /* If we have >1 slot but no jobserver-fds, then we're a top-level make.
@@ -1841,6 +1886,6 @@
       FILE_TIMESTAMP *makefile_mtimes = 0;
       unsigned int mm_idx = 0;
-      char **nargv = argv;
-      int nargc = argc;
+      char **nargv;
+      int nargc;
       int orig_db_level = db_level;
       int status;
@@ -2011,10 +2056,9 @@
 		if (strneq (argv[i], "-f", 2)) /* XXX */
 		  {
-		    char *p = &argv[i][2];
-		    if (*p == '\0')
+		    if (argv[i][2] == '\0')
                       /* This cast is OK since we never modify argv.  */
 		      argv[++i] = (char *) makefiles->list[j];
 		    else
-		      argv[i] = xstrdup (concat ("-f", makefiles->list[j], ""));
+		      argv[i] = xstrdup (concat (2, "-f", makefiles->list[j]));
 		    ++j;
 		  }
@@ -2022,11 +2066,14 @@
 
           /* Add -o option for the stdin temporary file, if necessary.  */
+          nargc = argc;
           if (stdin_nm)
             {
               nargv = xmalloc ((nargc + 2) * sizeof (char *));
               memcpy (nargv, argv, argc * sizeof (char *));
-              nargv[nargc++] = xstrdup (concat ("-o", stdin_nm, ""));
+              nargv[nargc++] = xstrdup (concat (2, "-o", stdin_nm));
               nargv[nargc] = 0;
             }
+          else
+            nargv = argv;
 
 	  if (directories != 0 && directories->idx > 0)
@@ -2045,4 +2092,12 @@
 
           ++restarts;
+
+          /* Reset makeflags in case they were changed.  */
+          {
+            const char *pv = define_makeflags (1, 1);
+            char *p = alloca (sizeof ("MAKEFLAGS=") + strlen (pv) + 1);
+            sprintf (p, "MAKEFLAGS=%s", pv);
+            putenv (p);
+          }
 
 	  if (ISDB (DB_BASIC))
@@ -2164,59 +2219,68 @@
     perror_with_name (_("unlink (temporary file): "), stdin_nm);
 
+  /* If there were no command-line goals, use the default.  */
+  if (goals == 0)
+    {
+      char *p;
+
+      if (default_goal_var->recursive)
+        p = variable_expand (default_goal_var->value);
+      else
+        {
+          p = variable_buffer_output (variable_buffer, default_goal_var->value,
+                                      strlen (default_goal_var->value));
+          *p = '\0';
+          p = variable_buffer;
+        }
+
+      if (*p != '\0')
+        {
+          struct file *f = lookup_file (p);
+
+          /* If .DEFAULT_GOAL is a non-existent target, enter it into the
+             table and let the standard logic sort it out. */
+          if (f == 0)
+            {
+              struct nameseq *ns;
+
+              ns = PARSE_FILE_SEQ (&p, struct nameseq, '\0', NULL, 0);
+              if (ns)
+                {
+                  /* .DEFAULT_GOAL should contain one target. */
+                  if (ns->next != 0)
+                    fatal (NILF, _(".DEFAULT_GOAL contains more than one target"));
+
+                  f = enter_file (strcache_add (ns->name));
+
+                  ns->name = 0; /* It was reused by enter_file(). */
+                  free_ns_chain (ns);
+                }
+            }
+
+          if (f)
+            {
+              goals = alloc_dep ();
+              goals->file = f;
+            }
+        }
+    }
+  else
+    lastgoal->next = 0;
+
+
+  if (!goals)
+    {
+      if (read_makefiles == 0)
+        fatal (NILF, _("No targets specified and no makefile found"));
+
+      fatal (NILF, _("No targets"));
+    }
+
+  /* Update the goals.  */
+
+  DB (DB_BASIC, (_("Updating goal targets....\n")));
+
   {
     int status;
-
-    /* If there were no command-line goals, use the default.  */
-    if (goals == 0)
-      {
-        if (**default_goal_name != '\0')
-          {
-            if (default_goal_file == 0 ||
-                strcmp (*default_goal_name, default_goal_file->name) != 0)
-              {
-                default_goal_file = lookup_file (*default_goal_name);
-
-                /* In case user set .DEFAULT_GOAL to a non-existent target
-                   name let's just enter this name into the table and let
-                   the standard logic sort it out. */
-                if (default_goal_file == 0)
-                  {
-                    struct nameseq *ns;
-                    char *p = *default_goal_name;
-
-                    ns = multi_glob (
-                      parse_file_seq (&p, '\0', sizeof (struct nameseq), 1),
-                      sizeof (struct nameseq));
-
-                    /* .DEFAULT_GOAL should contain one target. */
-                    if (ns->next != 0)
-                      fatal (NILF, _(".DEFAULT_GOAL contains more than one target"));
-
-                    default_goal_file = enter_file (strcache_add (ns->name));
-
-                    ns->name = 0; /* It was reused by enter_file(). */
-                    free_ns_chain (ns);
-                  }
-              }
-
-            goals = alloc_dep ();
-            goals->file = default_goal_file;
-          }
-      }
-    else
-      lastgoal->next = 0;
-
-
-    if (!goals)
-      {
-        if (read_makefiles == 0)
-          fatal (NILF, _("No targets specified and no makefile found"));
-
-        fatal (NILF, _("No targets"));
-      }
-
-    /* Update the goals.  */
-
-    DB (DB_BASIC, (_("Updating goal targets....\n")));
 
     switch (update_goal_chain (goals))
@@ -2391,5 +2455,5 @@
             value = vp;
           }
-        define_variable ("MAKECMDGOALS", 12, value, o_default, 0);
+        define_variable_cname ("MAKECMDGOALS", value, o_default, 0);
       }
     }
@@ -2493,6 +2557,14 @@
                   else if (*optarg == '\0')
                     {
-                      error (NILF, _("the `-%c' option requires a non-empty string argument"),
-                             cs->c);
+                      char opt[2] = "c";
+                      const char *op = opt;
+
+                      if (short_option (cs->c))
+                        opt[0] = cs->c;
+                      else
+                        op = cs->long_name;
+
+                      error (NILF, _("the `%s%s' option requires a non-empty string argument"),
+                             short_option (cs->c) ? "-" : "--", op);
                       bad = 1;
                     }
@@ -2511,5 +2583,6 @@
 		    {
 		      sl->max += 5;
-		      sl->list = xrealloc (sl->list,
+                      /* MSVC erroneously warns without a cast here.  */
+		      sl->list = xrealloc ((void *)sl->list,
                                            sl->max * sizeof (char *));
 		    }
@@ -2658,5 +2731,5 @@
        need permanent storage for this in case decode_switches saves
        pointers into the value.  */
-    argv[1] = xstrdup (concat ("-", argv[1], ""));
+    argv[1] = xstrdup (concat (2, "-", argv[1]));
 
   /* Parse those words.  */
@@ -2690,10 +2763,11 @@
    Don't include options with the `no_makefile' flag set if MAKEFILE.  */
 
-static void
+static const char *
 define_makeflags (int all, int makefile)
 {
-  static const char ref[] = "$(MAKEOVERRIDES)";
-  static const char posixref[] = "$(-*-command-variables-*-)";
-  register const struct command_switch *cs;
+  const char ref[] = "$(MAKEOVERRIDES)";
+  const char posixref[] = "$(-*-command-variables-*-)";
+  const char evalref[] = "$(-*-eval-flags-*-)";
+  const struct command_switch *cs;
   char *flagstring;
   register char *p;
@@ -2716,5 +2790,5 @@
 #define	ADD_FLAG(ARG, LEN) \
   do {									      \
-    struct flag *new = alloca (sizeof (struct flag));                         \
+    struct flag *new = alloca (sizeof (struct flag));			      \
     new->cs = cs;							      \
     new->arg = (ARG);							      \
@@ -2724,5 +2798,6 @@
       ++flagslen;		/* Just a single flag letter.  */	      \
     else								      \
-      flagslen += 1 + 1 + 1 + 1 + 3 * (LEN); /* " -x foo" */		      \
+      /* " -x foo", plus space to expand "foo".  */			      \
+      flagslen += 1 + 1 + 1 + 1 + (3 * (LEN));				      \
     if (!short_option (cs->c))						      \
       /* This switch has no single-letter version, so we use the long.  */    \
@@ -2811,5 +2886,6 @@
 	}
 
-  flagslen += 4 + sizeof posixref; /* Four more for the possible " -- ".  */
+  /* Four more for the possible " -- ".  */
+  flagslen += 4 + sizeof (posixref) + sizeof (evalref);
 
 #undef	ADD_FLAG
@@ -2883,5 +2959,18 @@
   /* Since MFLAGS is not parsed for flags, there is no reason to
      override any makefile redefinition.  */
-  (void) define_variable ("MFLAGS", 6, flagstring, o_env, 1);
+  define_variable_cname ("MFLAGS", flagstring, o_env, 1);
+
+  /* Write a reference to -*-eval-flags-*-, which contains all the --eval
+     flag options.  */
+  if (eval_strings)
+    {
+      if (p == &flagstring[1])
+	/* No flags written, so elide the leading dash already written.  */
+	p = flagstring;
+      else
+        *p++ = ' ';
+      memcpy (p, evalref, sizeof (evalref) - 1);
+      p += sizeof (evalref) - 1;
+    }
 
   if (all && command_variables != 0)
@@ -2910,11 +2999,11 @@
       if (posix_pedantic)
 	{
-	  memcpy (p, posixref, sizeof posixref - 1);
-	  p += sizeof posixref - 1;
+	  memcpy (p, posixref, sizeof (posixref) - 1);
+	  p += sizeof (posixref) - 1;
 	}
       else
 	{
-	  memcpy (p, ref, sizeof ref - 1);
-	  p += sizeof ref - 1;
+	  memcpy (p, ref, sizeof (ref) - 1);
+	  p += sizeof (ref) - 1;
 	}
     }
@@ -2930,18 +3019,18 @@
   *p = '\0';
 
-  v = define_variable ("MAKEFLAGS", 9,
-		       /* If there are switches, omit the leading dash
-			  unless it is a single long option with two
-			  leading dashes.  */
-		       &flagstring[(flagstring[0] == '-'
-				    && flagstring[1] != '-')
-				   ? 1 : 0],
-		       /* This used to use o_env, but that lost when a
-			  makefile defined MAKEFLAGS.  Makefiles set
-			  MAKEFLAGS to add switches, but we still want
-			  to redefine its value with the full set of
-			  switches.  Of course, an override or command
-			  definition will still take precedence.  */
-		       o_file, 1);
+  /* If there are switches, omit the leading dash unless it is a single long
+     option with two leading dashes.  */
+  if (flagstring[0] == '-' && flagstring[1] != '-')
+    ++flagstring;
+
+  v = define_variable_cname ("MAKEFLAGS", flagstring,
+                             /* This used to use o_env, but that lost when a
+                                makefile defined MAKEFLAGS.  Makefiles set
+                                MAKEFLAGS to add switches, but we still want
+                                to redefine its value with the full set of
+                                switches.  Of course, an override or command
+                                definition will still take precedence.  */
+                             o_file, 1);
+
   if (! all)
     /* The first time we are called, set MAKEFLAGS to always be exported.
@@ -2949,4 +3038,6 @@
        after reading makefiles which might have done `unexport MAKEFLAGS'. */
     v->export = v_export;
+
+  return v->value;
 }
 
@@ -2978,5 +3069,5 @@
      word "Copyright", so it hardly seems worth it.  */
 
-  printf ("%sCopyright (C) 2007  Free Software Foundation, Inc.\n", precede);
+  printf ("%sCopyright (C) 2010  Free Software Foundation, Inc.\n", precede);
 
   printf (_("%sLicense GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>\n\
@@ -3060,4 +3151,16 @@
 
       close (job_fds[0]);
+
+      /* Clean out jobserver_fds so we don't pass this information to any
+         sub-makes.  Also reset job_slots since it will be put on the command
+         line, not in MAKEFLAGS.  */
+      job_slots = default_job_slots;
+      if (jobserver_fds)
+        {
+          /* MSVC erroneously warns without a cast here.  */
+          free ((void *)jobserver_fds->list);
+          free (jobserver_fds);
+          jobserver_fds = 0;
+        }
     }
 }
@@ -3104,5 +3207,9 @@
          of relative pathnames fail.  */
       if (directory_before_chdir != 0)
-	chdir (directory_before_chdir);
+        {
+          /* If it fails we don't care: shut up GCC.  */
+          int _x;
+          _x = chdir (directory_before_chdir);
+        }
 
       log_working_directory (0);
Index: /vendor/gnumake/current/maintMakefile
===================================================================
--- /vendor/gnumake/current/maintMakefile	(revision 2595)
+++ /vendor/gnumake/current/maintMakefile	(revision 2596)
@@ -144,12 +144,10 @@
 	  && (cd "$$tmppo" \
 		&& $(WGET) -r -l1 -nd --no-parent -A '*.po' $(po_repo)) \
-	  && cp "$$tmppo"/*.po po && rm -rf "$$tmppo"
+	  && cp "$$tmppo"/*.po $(top_srcdir)/po && rm -rf "$$tmppo"
 	cd po && $(MAKE) update-po
 	$(MAKE) po-check
 
 po-update:
-	if test -d "po"; then \
-	  $(MAKE) do-po-update; \
-	fi
+	[ -d "po" ] && $(MAKE) do-po-update
 
 # -------------------------- #
@@ -161,8 +159,9 @@
 # regularly updated from the specified URL.
 
-savannah-url = http://savannah.gnu.org/cgi-bin/viewcvs/~checkout~
+cvs-url = http://savannah.gnu.org/cgi-bin/viewcvs/~checkout~
+git-url = http://git.savannah.gnu.org/cgit
 target = $(patsubst get-%,%,$@)
 
-config-url = $(savannah-url)/config/config/$(patsubst get-config/%,%,$@)
+config-url = $(git-url)/config.git/plain/$(patsubst get-config/%,%,$@)
 get-config/config.guess get-config/config.sub:
 	@echo $(WGET) $(config-url) -O $(target) \
@@ -170,5 +169,5 @@
 	  && $(move_if_change)
 
-gnulib-url = $(savannah-url)/gnulib/gnulib/build-aux/$(patsubst get-config/%,%,$@)
+gnulib-url = $(git-url)/gnulib.git/plain/build-aux/$(patsubst get-config/%,%,$@)
 get-config/texinfo.tex:
 	@echo $(WGET) $(gnulib-url) -O $(target) \
@@ -176,5 +175,5 @@
 	  && $(move_if_change)
 
-gnustandards-url = $(savannah-url)/gnustandards/gnustandards/$(patsubst get-doc/%,%,$@)
+gnustandards-url = $(cvs-url)/gnustandards/gnustandards/$(patsubst get-doc/%,%,$@)
 get-doc/make-stds.texi get-doc/fdl.texi:
 	@echo $(WGET) $(gnustandards-url) -O $(target) \
@@ -182,6 +181,6 @@
 	  && $(move_if_change)
 
-.PHONY: cvs-update
-cvs-update: get-config/texinfo.tex get-config/config.guess get-config/config.sub get-doc/make-stds.texi get-doc/fdl.texi
+.PHONY: scm-update
+scm-update: get-config/texinfo.tex get-config/config.guess get-config/config.sub get-doc/make-stds.texi get-doc/fdl.texi
 
 
@@ -191,5 +190,5 @@
 
 .PHONY: update
-update: po-update cvs-update
+update: po-update scm-update
 
 
@@ -205,5 +204,5 @@
 
 changelog-check:
-	if head ChangeLog | grep 'Version $(VERSION)' >/dev/null; then \
+	if head $(top_srcdir)/ChangeLog | grep 'Version $(VERSION)' >/dev/null; then \
 	  :; \
 	else \
@@ -247,5 +246,5 @@
 	@echo "Creating directive file '$@':"
 	@( \
-	   echo 'verstion: 1.1'; \
+	   echo 'version: 1.1'; \
 	   echo 'directory: make'; \
 	   echo 'filename: $*'; \
@@ -258,14 +257,16 @@
 
 FTPPUT = ncftpput
-gnu-url = ftp-upload.gnu.org /incoming
+gnu-upload-host = ftp-upload.gnu.org
+gnu-upload-dir  = /incoming
+
 
 UPLOADS = upload-alpha upload-ftp
 .PHONY: $(UPLOADS)
 $(UPLOADS): $(DIST_ARCHIVES) $(DIST_ARCHIVES_SIG) $(DIST_ARCHIVES_DIRECTIVE)
-	$(FTPPUT) "$(gnu-url)/$(@:upload-%=%)" $^
+	$(FTPPUT) "$(gnu-upload-host)" "$(gnu-upload-dir)/$(@:upload-%=%)" $^
 
 
 # Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
-# 2007 Free Software Foundation, Inc.
+# 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
 # This file is part of GNU Make.
 #
Index: /vendor/gnumake/current/make.1
===================================================================
--- /vendor/gnumake/current/make.1	(revision 2595)
+++ /vendor/gnumake/current/make.1	(revision 2596)
@@ -224,5 +224,6 @@
 .TP 0.5i
 .BR \-n , " \-\-just\-print" , " \-\-dry\-run" , " \-\-recon"
-Print the commands that would be executed, but do not execute them.
+Print the commands that would be executed, but do not execute them (except in
+certain circumstances).
 .TP 0.5i
 \fB\-o\fR \fIfile\fR, \fB\-\-old\-file\fR=\fIfile\fR, \fB\-\-assume\-old\fR=\fIfile\fR
Index: /vendor/gnumake/current/make.h
===================================================================
--- /vendor/gnumake/current/make.h	(revision 2595)
+++ /vendor/gnumake/current/make.h	(revision 2596)
@@ -1,6 +1,6 @@
 /* Miscellaneous global declarations and portability cruft for GNU Make.
 Copyright (C) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
-1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software
-Foundation, Inc.
+1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
+2010 Free Software Foundation, Inc.
 This file is part of GNU Make.
 
@@ -24,12 +24,17 @@
 #define HAVE_CONFIG_H 1
 
+/* Specify we want GNU source code.  This must be defined before any
+   system headers are included.  */
+
+#define _GNU_SOURCE 1
+
 /* AIX requires this to be the first thing in the file.  */
-#ifndef __GNUC__
-# if HAVE_ALLOCA_H
-#  include <alloca.h>
-# else
-#  ifdef _AIX
+#if HAVE_ALLOCA_H
+# include <alloca.h>
+#else
+# ifdef _AIX
  #pragma alloca
-#  else
+# else
+#  if !defined(__GNUC__) && !defined(WINDOWS32)
 #   ifndef alloca /* predefined by HP cc +Olibcalls */
 char *alloca ();
@@ -38,10 +43,4 @@
 # endif
 #endif
-
-
-/* Specify we want GNU source code.  This must be defined before any
-   system headers are included.  */
-
-#define _GNU_SOURCE 1
 
 
@@ -268,21 +267,21 @@
 #define ISDIGIT(c) ((unsigned) (c) - '0' <= 9)
 
-#ifndef iAPX286
-# define streq(a, b) \
+/* Test if two strings are equal. Is this worthwhile?  Should be profiled.  */
+#define streq(a, b) \
    ((a) == (b) || \
     (*(a) == *(b) && (*(a) == '\0' || !strcmp ((a) + 1, (b) + 1))))
-# ifdef HAVE_CASE_INSENSITIVE_FS
-#  define strieq(a, b) \
+
+/* Test if two strings are equal, but match case-insensitively on systems
+   which have case-insensitive filesystems.  Should only be used for
+   filenames!  */
+#ifdef HAVE_CASE_INSENSITIVE_FS
+# define patheq(a, b) \
     ((a) == (b) \
      || (tolower((unsigned char)*(a)) == tolower((unsigned char)*(b)) \
          && (*(a) == '\0' || !strcasecmp ((a) + 1, (b) + 1))))
-# else
-#  define strieq(a, b) streq(a, b)
-# endif
-#else
-/* Buggy compiler can't handle this.  */
-# define streq(a, b) (strcmp ((a), (b)) == 0)
-# define strieq(a, b) (strcmp ((a), (b)) == 0)
-#endif
+#else
+# define patheq(a, b) streq(a, b)
+#endif
+
 #define strneq(a, b, l) (strncmp ((a), (b), (l)) == 0)
 
@@ -330,5 +329,5 @@
 
 void sync_Path_environment (void);
-int w32_kill (int pid, int sig);
+int w32_kill (pid_t pid, int sig);
 char *end_of_token_w32 (const char *s, char stopchar);
 int find_and_set_default_shell (const char *token);
@@ -340,4 +339,12 @@
 extern int unixy_shell;
 #endif  /* WINDOWS32 */
+
+#if defined(HAVE_SYS_RESOURCE_H) && defined(HAVE_GETRLIMIT) && defined(HAVE_SETRLIMIT)
+# define SET_STACK_SIZE
+#endif
+#ifdef SET_STACK_SIZE
+# include <sys/resource.h>
+struct rlimit stack_limit;
+#endif
 
 struct floc
@@ -362,4 +369,5 @@
 
 #if HAVE_ANSI_COMPILER && USE_VARIADIC && HAVE_STDARG_H
+const char *concat (unsigned int, ...);
 void message (int prefix, const char *fmt, ...)
               __attribute__ ((__format__ (__printf__, 2, 3)));
@@ -369,4 +377,5 @@
                    __attribute__ ((noreturn, __format__ (__printf__, 2, 3)));
 #else
+const char *concat ();
 void message ();
 void error ();
@@ -378,9 +387,9 @@
 void pfatal_with_name (const char *) __attribute__ ((noreturn));
 void perror_with_name (const char *, const char *);
-char *savestring (const char *, unsigned int);
-char *concat (const char *, const char *, const char *);
 void *xmalloc (unsigned int);
+void *xcalloc (unsigned int);
 void *xrealloc (void *, unsigned int);
 char *xstrdup (const char *);
+char *xstrndup (const char *, unsigned int);
 char *find_next_token (const char **, unsigned int *);
 char *next_token (const char *);
@@ -426,5 +435,6 @@
 void build_vpath_lists (void);
 void construct_vpath_list (char *pattern, char *dirpath);
-const char *vpath_search (const char *file, FILE_TIMESTAMP *mtime_ptr);
+const char *vpath_search (const char *file, FILE_TIMESTAMP *mtime_ptr,
+                          unsigned int* vpath_index, unsigned int* path_index);
 int gpath_search (const char *file, unsigned int len);
 
@@ -483,4 +493,15 @@
 #endif
 
+#if !HAVE_STRNCASECMP
+# if HAVE_STRNICMP
+#  define strncasecmp strnicmp
+# elif HAVE_STRNCMPI
+#  define strncasecmp strncmpi
+# else
+/* Create our own, in misc.c */
+int strncasecmp (const char *s1, const char *s2, int n);
+# endif
+#endif
+
 extern const struct floc *reading_file;
 extern const struct floc **expanding_var;
@@ -494,4 +515,5 @@
 extern int warn_undefined_variables_flag, posix_pedantic, not_parallel;
 extern int second_expansion, clock_skew_detected, rebuilding_makefiles;
+extern int one_shell;
 
 /* can we run commands via 'sh -c xxx' or must we use batch files? */
Index: /vendor/gnumake/current/makefile.com
===================================================================
--- /vendor/gnumake/current/makefile.com	(revision 2595)
+++ /vendor/gnumake/current/makefile.com	(revision 2596)
@@ -140,5 +140,5 @@
 $!-----------------------------------------------------------------------------
 $!Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
-$!2006, 2007 Free Software Foundation, Inc.
+$!2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
 $!This file is part of GNU Make.
 $!
Index: /vendor/gnumake/current/makefile.vms
===================================================================
--- /vendor/gnumake/current/makefile.vms	(revision 2595)
+++ /vendor/gnumake/current/makefile.vms	(revision 2596)
@@ -2,5 +2,5 @@
 #
 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
-# 2006, 2007 Free Software Foundation, Inc.
+# 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
 # This file is part of GNU Make.
 #
Index: /vendor/gnumake/current/misc.c
===================================================================
--- /vendor/gnumake/current/misc.c	(revision 2595)
+++ /vendor/gnumake/current/misc.c	(revision 2596)
@@ -1,6 +1,6 @@
 /* Miscellaneous generic support functions for GNU Make.
 Copyright (C) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
-1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software
-Foundation, Inc.
+1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
+2010 Free Software Foundation, Inc.
 This file is part of GNU Make.
 
@@ -114,9 +114,11 @@
       ++in;
 
-      /* If the newline is quoted, discard following whitespace
-	 and any preceding whitespace; leave just one space.  */
+      /* If the newline is escaped, discard following whitespace leaving just
+	 one space.  POSIX requires that each backslash/newline/following
+	 whitespace sequence be reduced to a single space.  */
       if (backslash)
 	{
 	  in = next_token (in);
+          /* Removing this loop will fix Savannah bug #16670: do we want to? */
 	  while (out > line && isblank ((unsigned char)out[-1]))
 	    --out;
@@ -162,29 +164,55 @@
 
 
-/* Return a string whose contents concatenate those of s1, s2, s3.
+/* Return a string whose contents concatenate the NUM strings provided
    This string lives in static, re-used memory.  */
 
-char *
-concat (const char *s1, const char *s2, const char *s3)
-{
-  unsigned int len1, len2, len3;
+const char *
+#if HAVE_ANSI_COMPILER && USE_VARIADIC && HAVE_STDARG_H
+concat (unsigned int num, ...)
+#else
+concat (num, va_alist)
+     unsigned int num;
+     va_dcl
+#endif
+{
   static unsigned int rlen = 0;
   static char *result = NULL;
-
-  len1 = (s1 && *s1 != '\0') ? strlen (s1) : 0;
-  len2 = (s2 && *s2 != '\0') ? strlen (s2) : 0;
-  len3 = (s3 && *s3 != '\0') ? strlen (s3) : 0;
-
-  if (len1 + len2 + len3 + 1 > rlen)
-    result = xrealloc (result, (rlen = len1 + len2 + len3 + 10));
-
-  if (len1)
-    memcpy (result, s1, len1);
-  if (len2)
-    memcpy (result + len1, s2, len2);
-  if (len3)
-    memcpy (result + len1 + len2, s3, len3);
-
-  result[len1+len2+len3] = '\0';
+  int ri = 0;
+
+#if USE_VARIADIC
+  va_list args;
+#endif
+
+  VA_START (args, num);
+
+  while (num-- > 0)
+    {
+      const char *s = va_arg (args, const char *);
+      unsigned int l = s ? strlen (s) : 0;
+
+      if (l == 0)
+        continue;
+
+      if (ri + l > rlen)
+        {
+          rlen = ((rlen ? rlen : 60) + l) * 2;
+          result = xrealloc (result, rlen);
+        }
+
+      memcpy (result + ri, s, l);
+      ri += l;
+    }
+
+  VA_END (args);
+
+  /* Get some more memory if we don't have enough space for the
+     terminating '\0'.   */
+  if (ri == rlen)
+    {
+      rlen = (rlen ? rlen : 60) * 2;
+      result = xrealloc (result, rlen);
+    }
+
+  result[ri] = '\0';
 
   return result;
@@ -341,4 +369,5 @@
 
 #undef xmalloc
+#undef xcalloc
 #undef xrealloc
 #undef xstrdup
@@ -347,5 +376,5 @@
 xmalloc (unsigned int size)
 {
-  /* Make sure we don't allocate 0, for pre-ANSI libraries.  */
+  /* Make sure we don't allocate 0, for pre-ISO implementations.  */
   void *result = malloc (size ? size : 1);
   if (result == 0)
@@ -356,9 +385,20 @@
 
 void *
+xcalloc (unsigned int size)
+{
+  /* Make sure we don't allocate 0, for pre-ISO implementations.  */
+  void *result = calloc (size ? size : 1, 1);
+  if (result == 0)
+    fatal (NILF, _("virtual memory exhausted"));
+  return result;
+}
+
+
+void *
 xrealloc (void *ptr, unsigned int size)
 {
   void *result;
 
-  /* Some older implementations of realloc() don't conform to ANSI.  */
+  /* Some older implementations of realloc() don't conform to ISO.  */
   if (! size)
     size = 1;
@@ -394,11 +434,20 @@
 
 char *
-savestring (const char *str, unsigned int length)
-{
-  char *out = xmalloc (length + 1);
+xstrndup (const char *str, unsigned int length)
+{
+  char *result;
+
+#ifdef HAVE_STRNDUP
+  result = strndup (str, length);
+  if (result == 0)
+    fatal (NILF, _("virtual memory exhausted"));
+#else
+  result = xmalloc (length + 1);
   if (length > 0)
-    memcpy (out, str, length);
-  out[length] = '\0';
-  return out;
+    strncpy (result, str, length);
+  result[length] = '\0';
+#endif
+
+  return result;
 }
 
@@ -493,25 +542,5 @@
 
 
-/* Allocate a new `struct dep' with all fields initialized to 0.   */
-
-struct dep *
-alloc_dep ()
-{
-  struct dep *d = xmalloc (sizeof (struct dep));
-  memset (d, '\0', sizeof (struct dep));
-  return d;
-}
-
-
-/* Free `struct dep' along with `name' and `stem'.   */
-
-void
-free_dep (struct dep *d)
-{
-  free (d);
-}
-
-/* Copy a chain of `struct dep', making a new chain
-   with the same contents as the old one.  */
+/* Copy a chain of `struct dep'.  For 2nd expansion deps, dup the name.  */
 
 struct dep *
@@ -525,4 +554,7 @@
       struct dep *c = xmalloc (sizeof (struct dep));
       memcpy (c, d, sizeof (struct dep));
+
+      if (c->need_2nd_expansion)
+        c->name = xstrdup (c->name);
 
       c->next = 0;
@@ -590,4 +622,32 @@
       return (c1 - c2);
     }
+}
+#endif
+
+#if !HAVE_STRNCASECMP && !HAVE_STRNICMP && !HAVE_STRNCMPI
+
+/* If we don't have strncasecmp() (from POSIX), or anything that can
+   substitute for it, define our own version.  */
+
+int
+strncasecmp (const char *s1, const char *s2, int n)
+{
+  while (n-- > 0)
+    {
+      int c1 = (int) *(s1++);
+      int c2 = (int) *(s2++);
+
+      if (isalpha (c1))
+        c1 = tolower (c1);
+      if (isalpha (c2))
+        c2 = tolower (c2);
+
+      if (c1 != '\0' && c1 == c2)
+        continue;
+
+      return (c1 - c2);
+    }
+
+  return 0;
 }
 #endif
Index: /vendor/gnumake/current/po/ChangeLog
===================================================================
--- /vendor/gnumake/current/po/ChangeLog	(revision 2595)
+++ /vendor/gnumake/current/po/ChangeLog	(revision 2596)
@@ -1,2 +1,6 @@
+2009-09-16  Paul Smith  <psmith@gnu.org>
+
+	* LINGUAS: Added new translation for Italian (it).
+
 2008-05-17  Paul Smith  <psmith@gnu.org>
 
@@ -63,5 +67,6 @@
 
 
-Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
+Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software
+Foundation, Inc.
 This file is part of GNU Make.
 
Index: /vendor/gnumake/current/po/LINGUAS
===================================================================
--- /vendor/gnumake/current/po/LINGUAS	(revision 2595)
+++ /vendor/gnumake/current/po/LINGUAS	(revision 2596)
@@ -1,5 +1,5 @@
-# Set of available languages: 23 languages
+# Set of available languages: 24 languages
 
-be da de es fi fr ga gl he hr id ja ko lt nl pl pt_BR ru sv tr uk vi zh_CN
+be da de es fi fr ga gl he hr id it ja ko lt nl pl pt_BR ru sv tr uk vi zh_CN
 
 # Can't seem to get en@quot and en@boldquot to build properly?
Index: /vendor/gnumake/current/po/Makevars
===================================================================
--- /vendor/gnumake/current/po/Makevars	(revision 2595)
+++ /vendor/gnumake/current/po/Makevars	(revision 2596)
@@ -1,5 +1,5 @@
 # This is a -*-Makefile-*-
-# Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation,
-# Inc.
+# Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free
+# Software Foundation, Inc.
 # This file is part of GNU Make.
 #
Index: /vendor/gnumake/current/po/POTFILES.in
===================================================================
--- /vendor/gnumake/current/po/POTFILES.in	(revision 2595)
+++ /vendor/gnumake/current/po/POTFILES.in	(revision 2596)
@@ -1,5 +1,5 @@
 # List of source files containing translatable strings.
-# Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software
-# Foundation, Inc.
+# Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
+# 2010 Free Software Foundation, Inc.
 # This file is part of GNU Make.
 #
Index: /vendor/gnumake/current/read.c
===================================================================
--- /vendor/gnumake/current/read.c	(revision 2595)
+++ /vendor/gnumake/current/read.c	(revision 2596)
@@ -1,6 +1,6 @@
 /* Reading and parsing of makefiles for GNU Make.
 Copyright (C) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
-1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software
-Foundation, Inc.
+1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
+2010 Free Software Foundation, Inc.
 This file is part of GNU Make.
 
@@ -55,4 +55,16 @@
     FILE *fp;           /* File, or NULL if this is an internal buffer.  */
     struct floc floc;   /* Info on the file in fp (if any).  */
+  };
+
+/* Track the modifiers we can have on variable assignments */
+
+struct vmodifiers
+  {
+    unsigned int assign_v:1;
+    unsigned int define_v:1;
+    unsigned int undefine_v:1;
+    unsigned int export_v:1;
+    unsigned int override_v:1;
+    unsigned int private_v:1;
   };
 
@@ -123,17 +135,20 @@
 
 static int eval_makefile (const char *filename, int flags);
-static int eval (struct ebuffer *buffer, int flags);
+static void eval (struct ebuffer *buffer, int flags);
 
 static long readline (struct ebuffer *ebuf);
-static void do_define (char *name, unsigned int namelen,
-                       enum variable_origin origin, struct ebuffer *ebuf);
+static void do_undefine (char *name, enum variable_origin origin,
+                         struct ebuffer *ebuf);
+static struct variable *do_define (char *name, enum variable_origin origin,
+                                   struct ebuffer *ebuf);
 static int conditional_line (char *line, int len, const struct floc *flocp);
 static void record_files (struct nameseq *filenames, const char *pattern,
-                          const char *pattern_percent, struct dep *deps,
+                          const char *pattern_percent, char *depstr,
                           unsigned int cmds_started, char *commands,
                           unsigned int commands_idx, int two_colon,
                           const struct floc *flocp);
 static void record_target_var (struct nameseq *filenames, char *defn,
-                               enum variable_origin origin, int enabled,
+                               enum variable_origin origin,
+                               struct vmodifiers *vmod,
                                const struct floc *flocp);
 static enum make_word_type get_next_mword (char *buffer, char *delim,
@@ -144,4 +159,11 @@
 
 
+/* Compare a word, both length and contents.
+   P must point to the word to be tested, and WLEN must be the length.
+*/
+#define	word1eq(s)	(wlen == sizeof(s)-1 && strneq (s, p, sizeof(s)-1))
+
+
+
 /* Read in all the makefiles and return the chain of their names.  */
 
@@ -154,5 +176,5 @@
      we will be reading. */
 
-  define_variable ("MAKEFILE_LIST", sizeof ("MAKEFILE_LIST")-1, "", o_file, 0);
+  define_variable_cname ("MAKEFILE_LIST", "", o_file, 0);
 
   DB (DB_BASIC, (_("Reading makefiles...\n")));
@@ -249,5 +271,5 @@
 	      struct dep *d = alloc_dep ();
 	      d->file = enter_file (strcache_add (*p));
-	      d->file->dontcare = 1;
+	      d->dontcare = 1;
 	      /* Tell update_goal_chain to bail out as soon as this file is
 		 made, and main not to die if we can't make this file.  */
@@ -305,5 +327,4 @@
   char *expanded = 0;
   int makefile_errno;
-  int r;
 
   filename = strcache_add (filename);
@@ -348,5 +369,6 @@
       for (i = 0; include_directories[i] != 0; ++i)
 	{
-	  const char *included = concat (include_directories[i], "/", filename);
+	  const char *included = concat (3, include_directories[i],
+                                         "/", filename);
 	  ebuf.fp = fopen (included, "r");
 	  if (ebuf.fp)
@@ -368,5 +390,5 @@
   deps->changed = flags;
   if (flags & RM_DONTCARE)
-    deps->file->dontcare = 1;
+    deps->dontcare = 1;
 
   if (expanded)
@@ -384,4 +406,10 @@
     }
 
+  /* Set close-on-exec to avoid leaking the makefile to children, such as
+     $(shell ...).  */
+#ifdef HAVE_FILENO
+  CLOSE_ON_EXEC (fileno (ebuf.fp));
+#endif
+
   /* Add this makefile to the list. */
   do_variable_definition (&ebuf.floc, "MAKEFILE_LIST", filename, o_file,
@@ -396,5 +424,5 @@
   reading_file = &ebuf.floc;
 
-  r = eval (&ebuf, !(flags & RM_NO_DEFAULT_GOAL));
+  eval (&ebuf, !(flags & RM_NO_DEFAULT_GOAL));
 
   reading_file = curfile;
@@ -404,8 +432,9 @@
   free (ebuf.bufstart);
   alloca (0);
-  return r;
+
+  return 1;
 }
 
-int
+void
 eval_buffer (char *buffer)
 {
@@ -414,5 +443,4 @@
   struct conditionals new;
   const struct floc *curfile;
-  int r;
 
   /* Evaluate the buffer */
@@ -422,5 +450,8 @@
   ebuf.fp = NULL;
 
-  ebuf.floc = *reading_file;
+  if (reading_file)
+    ebuf.floc = *reading_file;
+  else
+    ebuf.floc.filenm = NULL;
 
   curfile = reading_file;
@@ -429,5 +460,5 @@
   saved = install_conditionals (&new);
 
-  r = eval (&ebuf, 1);
+  eval (&ebuf, 1);
 
   restore_conditionals (saved);
@@ -436,8 +467,82 @@
 
   alloca (0);
-  return r;
 }
 
 
+/* Check LINE to see if it's a variable assignment or undefine.
+
+   It might use one of the modifiers "export", "override", "private", or it
+   might be one of the conditional tokens like "ifdef", "include", etc.
+
+   If it's not a variable assignment or undefine, VMOD.V_ASSIGN is 0.
+   Returns LINE.
+
+   Returns a pointer to the first non-modifier character, and sets VMOD
+   based on the modifiers found if any, plus V_ASSIGN is 1.
+ */
+static char *
+parse_var_assignment (const char *line, struct vmodifiers *vmod)
+{
+  const char *p;
+  memset (vmod, '\0', sizeof (*vmod));
+
+  /* Find the start of the next token.  If there isn't one we're done.  */
+  line = next_token (line);
+  if (*line == '\0')
+    return (char *)line;
+
+  p = line;
+  while (1)
+    {
+      int wlen;
+      const char *p2;
+      enum variable_flavor flavor;
+
+      p2 = parse_variable_definition (p, &flavor);
+
+      /* If this is a variable assignment, we're done.  */
+      if (p2)
+        break;
+
+      /* It's not a variable; see if it's a modifier.  */
+      p2 = end_of_token (p);
+      wlen = p2 - p;
+
+      if (word1eq ("export"))
+        vmod->export_v = 1;
+      else if (word1eq ("override"))
+        vmod->override_v = 1;
+      else if (word1eq ("private"))
+        vmod->private_v = 1;
+      else if (word1eq ("define"))
+        {
+          /* We can't have modifiers after 'define' */
+          vmod->define_v = 1;
+          p = next_token (p2);
+          break;
+        }
+      else if (word1eq ("undefine"))
+        {
+          /* We can't have modifiers after 'undefine' */
+          vmod->undefine_v = 1;
+          p = next_token (p2);
+          break;
+        }
+      else
+        /* Not a variable or modifier: this is not a variable assignment.  */
+        return (char *)line;
+
+      /* It was a modifier.  Try the next word.  */
+      p = next_token (p2);
+      if (*p == '\0')
+        return (char *)line;
+    }
+
+  /* Found a variable assignment or undefine.  */
+  vmod->assign_v = 1;
+  return (char *)p;
+}
+
+
 
 /* Read file FILENAME as a makefile and add its contents to the data base.
@@ -445,6 +550,5 @@
    SET_DEFAULT is true if we are allowed to set the default goal.  */
 
-
-static int
+static void
 eval (struct ebuffer *ebuf, int set_default)
 {
@@ -458,5 +562,5 @@
   int no_targets = 0;		/* Set when reading a rule without targets.  */
   struct nameseq *filenames = 0;
-  struct dep *deps = 0;
+  char *depstr = 0;
   long nlines = 0;
   int two_colon = 0;
@@ -472,9 +576,9 @@
         {                                                                     \
 	  fi.lineno = tgts_started;                                           \
-	  record_files (filenames, pattern, pattern_percent, deps,            \
+	  record_files (filenames, pattern, pattern_percent, depstr,          \
                         cmds_started, commands, commands_idx, two_colon,      \
                         &fi);                                                 \
+          filenames = 0;						      \
         }                                                                     \
-      filenames = 0;							      \
       commands_idx = 0;							      \
       no_targets = 0;                                                         \
@@ -507,5 +611,7 @@
       char *p;
       char *p2;
-
+      struct vmodifiers vmod;
+
+      /* At the top of this loop, we are starting a brand new line.  */
       /* Grab the next line to be evaluated */
       ebuf->floc.lineno += nlines;
@@ -532,5 +638,5 @@
 
 	  /* If there is no preceding rule line, don't treat this line
-	     as a command, even though it begins with a tab character.
+	     as a command, even though it begins with a recipe prefix.
 	     SunOS 4 make appears to behave this way.  */
 
@@ -571,5 +677,5 @@
 	}
 
-      /* This line is not a shell command line.  Don't worry about tabs.
+      /* This line is not a shell command line.  Don't worry about whitespace.
          Get more space if we need it; we don't need to preserve the current
          contents of the buffer.  */
@@ -580,4 +686,5 @@
           if (collapsed)
             free (collapsed);
+          /* Don't need xrealloc: we don't need to preserve the content.  */
 	  collapsed = xmalloc (collapsed_length);
 	}
@@ -587,171 +694,100 @@
       remove_comments (collapsed);
 
-      /* Compare a word, both length and contents. */
-#define	word1eq(s)	(wlen == sizeof(s)-1 && strneq (s, p, sizeof(s)-1))
+      /* Get rid if starting space (including formfeed, vtab, etc.)  */
       p = collapsed;
       while (isspace ((unsigned char)*p))
-	++p;
-
-      if (*p == '\0')
-	/* This line is completely empty--ignore it.  */
-	continue;
-
-      /* Find the end of the first token.  Note we don't need to worry about
-       * ":" here since we compare tokens by length (so "export" will never
-       * be equal to "export:").
-       */
-      for (p2 = p+1; *p2 != '\0' && !isspace ((unsigned char)*p2); ++p2)
-        ;
-      wlen = p2 - p;
-
-      /* Find the start of the second token.  If it looks like a target or
-         variable definition it can't be a preprocessor token so skip
-         them--this allows variables/targets named `ifdef', `export', etc. */
-      while (isspace ((unsigned char)*p2))
-        ++p2;
-
-      if ((p2[0] == ':' || p2[0] == '+' || p2[0] == '=') && p2[1] == '\0')
+        ++p;
+
+      /* See if this is a variable assignment.  We need to do this early, to
+         allow variables with names like 'ifdef', 'export', 'private', etc.  */
+      p = parse_var_assignment(p, &vmod);
+      if (vmod.assign_v)
         {
-          /* It can't be a preprocessor token so skip it if we're ignoring */
-          if (ignoring)
-            continue;
-
-          goto skip_conditionals;
-        }
-
-      /* We must first check for conditional and `define' directives before
-	 ignoring anything, since they control what we will do with
-	 following lines.  */
-
-      if (!in_ignored_define)
-	{
-	  int i = conditional_line (p, wlen, fstart);
-          if (i != -2)
+          struct variable *v;
+          enum variable_origin origin = vmod.override_v ? o_override : o_file;
+
+          /* If we're ignoring then we're done now.  */
+	  if (ignoring)
             {
-              if (i == -1)
-                fatal (fstart, _("invalid syntax in conditional"));
-
-              ignoring = i;
+              if (vmod.define_v)
+                in_ignored_define = 1;
               continue;
             }
-	}
-
-      if (word1eq ("endef"))
+
+          if (vmod.undefine_v)
+          {
+            do_undefine (p, origin, ebuf);
+
+            /* This line has been dealt with.  */
+            goto rule_complete;
+          }
+          else if (vmod.define_v)
+            v = do_define (p, origin, ebuf);
+          else
+            v = try_variable_definition (fstart, p, origin, 0);
+
+          assert (v != NULL);
+
+          if (vmod.export_v)
+            v->export = v_export;
+          if (vmod.private_v)
+            v->private_var = 1;
+
+          /* This line has been dealt with.  */
+          goto rule_complete;
+        }
+
+      /* If this line is completely empty, ignore it.  */
+      if (*p == '\0')
+	continue;
+
+      p2 = end_of_token (p);
+      wlen = p2 - p;
+      p2 = next_token (p2);
+
+      /* If we're in an ignored define, skip this line (but maybe get out).  */
+      if (in_ignored_define)
 	{
-	  if (!in_ignored_define)
-	    fatal (fstart, _("extraneous `endef'"));
-          in_ignored_define = 0;
+          /* See if this is an endef line (plus optional comment).  */
+          if (word1eq ("endef") && (*p2 == '\0' || *p2 == '#'))
+            in_ignored_define = 0;
+
 	  continue;
 	}
 
-      if (word1eq ("define"))
+      /* Check for conditional state changes.  */
+      {
+        int i = conditional_line (p, wlen, fstart);
+        if (i != -2)
+          {
+            if (i == -1)
+              fatal (fstart, _("invalid syntax in conditional"));
+
+            ignoring = i;
+            continue;
+          }
+      }
+
+      /* Nothing to see here... move along.  */
+      if (ignoring)
+	continue;
+
+      /* Manage the "export" keyword used outside of variable assignment
+         as well as "unexport".  */
+      if (word1eq ("export") || word1eq ("unexport"))
 	{
-	  if (ignoring)
-	    in_ignored_define = 1;
-	  else
-	    {
-              if (*p2 == '\0')
-                fatal (fstart, _("empty variable name"));
-
-	      /* Let the variable name be the whole rest of the line,
-		 with trailing blanks stripped (comments have already been
-		 removed), so it could be a complex variable/function
-		 reference that might contain blanks.  */
-	      p = strchr (p2, '\0');
-	      while (isblank ((unsigned char)p[-1]))
-		--p;
-	      do_define (p2, p - p2, o_file, ebuf);
-	    }
-	  continue;
-	}
-
-      if (word1eq ("override"))
-        {
+          int exporting = *p == 'u' ? 0 : 1;
+
+          /* (un)export by itself causes everything to be (un)exported. */
 	  if (*p2 == '\0')
-	    error (fstart, _("empty `override' directive"));
-
-	  if (strneq (p2, "define", 6)
-	      && (isblank ((unsigned char)p2[6]) || p2[6] == '\0'))
-	    {
-	      if (ignoring)
-		in_ignored_define = 1;
-	      else
-		{
-		  p2 = next_token (p2 + 6);
-                  if (*p2 == '\0')
-                    fatal (fstart, _("empty variable name"));
-
-		  /* Let the variable name be the whole rest of the line,
-		     with trailing blanks stripped (comments have already been
-		     removed), so it could be a complex variable/function
-		     reference that might contain blanks.  */
-		  p = strchr (p2, '\0');
-		  while (isblank ((unsigned char)p[-1]))
-		    --p;
-		  do_define (p2, p - p2, o_override, ebuf);
-		}
-	    }
-	  else if (!ignoring
-		   && !try_variable_definition (fstart, p2, o_override, 0))
-	    error (fstart, _("invalid `override' directive"));
-
-	  continue;
-	}
-
-      if (ignoring)
-	/* Ignore the line.  We continue here so conditionals
-	   can appear in the middle of a rule.  */
-	continue;
-
-      if (word1eq ("export"))
-	{
-          /* 'export' by itself causes everything to be exported. */
-	  if (*p2 == '\0')
-            export_all_variables = 1;
-          else
-            {
-              struct variable *v;
-
-              v = try_variable_definition (fstart, p2, o_file, 0);
-              if (v != 0)
-                v->export = v_export;
-              else
-                {
-                  unsigned int l;
-                  const char *cp;
-                  char *ap;
-
-                  /* Expand the line so we can use indirect and constructed
-                     variable names in an export command.  */
-                  cp = ap = allocated_variable_expand (p2);
-
-                  for (p = find_next_token (&cp, &l); p != 0;
-                       p = find_next_token (&cp, &l))
-                    {
-                      v = lookup_variable (p, l);
-                      if (v == 0)
-                        v = define_variable_loc (p, l, "", o_file, 0, fstart);
-                      v->export = v_export;
-                    }
-
-                  free (ap);
-                }
-            }
-          goto rule_complete;
-	}
-
-      if (word1eq ("unexport"))
-	{
-	  if (*p2 == '\0')
-	    export_all_variables = 0;
+            export_all_variables = exporting;
           else
             {
               unsigned int l;
-              struct variable *v;
               const char *cp;
               char *ap;
 
               /* Expand the line so we can use indirect and constructed
-                 variable names in an unexport command.  */
+                 variable names in an (un)export command.  */
               cp = ap = allocated_variable_expand (p2);
 
@@ -759,9 +795,8 @@
                    p = find_next_token (&cp, &l))
                 {
-                  v = lookup_variable (p, l);
+                  struct variable *v = lookup_variable (p, l);
                   if (v == 0)
                     v = define_variable_loc (p, l, "", o_file, 0, fstart);
-
-                  v->export = v_noexport;
+                  v->export = exporting ? v_export : v_noexport;
                 }
 
@@ -771,5 +806,5 @@
 	}
 
- skip_conditionals:
+      /* Handle the special syntax for vpath.  */
       if (word1eq ("vpath"))
 	{
@@ -781,5 +816,5 @@
 	  if (p != 0)
 	    {
-	      vpat = savestring (p, l);
+	      vpat = xstrndup (p, l);
 	      p = find_next_token (&cp, &l);
 	      /* No searchpath means remove all previous
@@ -796,4 +831,5 @@
 	}
 
+      /* Handle include and variants.  */
       if (word1eq ("include") || word1eq ("-include") || word1eq ("sinclude"))
 	{
@@ -816,10 +852,8 @@
             }
 
-	  /* Parse the list of file names.  */
+	  /* Parse the list of file names.  Don't expand archive references!  */
 	  p2 = p;
-	  files = multi_glob (parse_file_seq (&p2, '\0',
-					      sizeof (struct nameseq),
-					      1),
-			      sizeof (struct nameseq));
+	  files = PARSE_FILE_SEQ (&p2, struct nameseq, '\0', NULL,
+                                  PARSEFS_NOAR);
 	  free (p);
 
@@ -839,9 +873,11 @@
               int r;
 
-	      free (files);
+	      free_ns (files);
 	      files = next;
 
-              r = eval_makefile (name, (RM_INCLUDED | RM_NO_TILDE
-                                        | (noerror ? RM_DONTCARE : 0)));
+              r = eval_makefile (name,
+                                 (RM_INCLUDED | RM_NO_TILDE
+                                  | (noerror ? RM_DONTCARE : 0)
+                                  | (set_default ? 0 : RM_NO_DEFAULT_GOAL)));
 	      if (!r && !noerror)
                 error (fstart, "%s: %s", name, strerror (errno));
@@ -853,8 +889,4 @@
           goto rule_complete;
 	}
-
-      if (try_variable_definition (fstart, p, o_file, 0))
-	/* This line has been dealt with.  */
-	goto rule_complete;
 
       /* This line starts with a tab but was not caught above because there
@@ -876,6 +908,4 @@
       {
         enum make_word_type wtype;
-        enum variable_origin v_origin;
-        int exported;
         char *cmdleft, *semip, *lb_next;
         unsigned int plen = 0;
@@ -1009,8 +1039,5 @@
            looking for targets.  */
         *colonp = '\0';
-        filenames = multi_glob (parse_file_seq (&p2, '\0',
-                                                sizeof (struct nameseq),
-                                                1),
-                                sizeof (struct nameseq));
+        filenames = PARSE_FILE_SEQ (&p2, struct nameseq, '\0', NULL, 0);
         *p2 = ':';
 
@@ -1043,29 +1070,6 @@
           }
 
-        /* See if it's an "override" or "export" keyword; if so see if what
-           comes after it looks like a variable definition.  */
-
-        wtype = get_next_mword (p2, NULL, &p, &wlen);
-
-        v_origin = o_file;
-        exported = 0;
-        if (wtype == w_static)
-          {
-            if (word1eq ("override"))
-              {
-                v_origin = o_override;
-                wtype = get_next_mword (p+wlen, NULL, &p, &wlen);
-              }
-            else if (word1eq ("export"))
-              {
-                exported = 1;
-                wtype = get_next_mword (p+wlen, NULL, &p, &wlen);
-              }
-          }
-
-        if (wtype != w_eol)
-          wtype = get_next_mword (p+wlen, NULL, NULL, NULL);
-
-        if (wtype == w_varassign)
+        p2 = parse_var_assignment (p2, &vmod);
+        if (vmod.assign_v)
           {
             /* If there was a semicolon found, add it back, plus anything
@@ -1075,9 +1079,12 @@
                 unsigned int l = p - variable_buffer;
                 *(--semip) = ';';
+                collapse_continuations (semip);
                 variable_buffer_output (p2 + strlen (p2),
                                         semip, strlen (semip)+1);
                 p = variable_buffer + l;
               }
-            record_target_var (filenames, p, v_origin, exported, fstart);
+            record_target_var (filenames, p2,
+                               vmod.override_v ? o_override : o_file,
+                               &vmod, fstart);
             filenames = 0;
             continue;
@@ -1111,6 +1118,6 @@
         while (p != 0 && p[-1] == '\\')
           {
-            register char *q = &p[-1];
-            register int backslash = 0;
+            char *q = &p[-1];
+            int backslash = 0;
             while (*q-- == '\\')
               backslash = !backslash;
@@ -1155,5 +1162,6 @@
           {
             struct nameseq *target;
-            target = parse_file_seq (&p2, ':', sizeof (struct nameseq), 1);
+            target = PARSE_FILE_SEQ (&p2, struct nameseq, ':', NULL,
+                                     PARSEFS_NOGLOB);
             ++p2;
             if (target == 0)
@@ -1165,5 +1173,5 @@
             if (pattern_percent == 0)
               fatal (fstart, _("target pattern contains no `%%'"));
-            free (target);
+            free_ns (target);
           }
         else
@@ -1175,12 +1183,9 @@
         strip_whitespace (&beg, &end);
 
+        /* Put all the prerequisites here; they'll be parsed later.  */
         if (beg <= end && *beg != '\0')
-          {
-            /* Put all the prerequisites here; they'll be parsed later.  */
-            deps = alloc_dep ();
-            deps->name = strcache_add_len (beg, end - beg + 1);
-          }
+          depstr = xstrndup (beg, end - beg + 1);
         else
-          deps = 0;
+          depstr = 0;
 
         commands_idx = 0;
@@ -1216,8 +1221,7 @@
            Because the target is not recorded until after ifeq directive is
            evaluated the .DEFAULT_GOAL does not contain foo yet as one
-           would expect. Because of this we have to move some of the logic
-           here.  */
-
-        if (**default_goal_name == '\0' && set_default)
+           would expect. Because of this we have to move the logic here.  */
+
+        if (set_default && default_goal_var->value[0] == '\0')
           {
             const char *name;
@@ -1300,6 +1304,4 @@
     free (collapsed);
   free (commands);
-
-  return 1;
 }
 
@@ -1321,40 +1323,80 @@
 }
 
+/* Execute a `undefine' directive.
+   The undefine line has already been read, and NAME is the name of
+   the variable to be undefined. */
+
+static void
+do_undefine (char *name, enum variable_origin origin, struct ebuffer *ebuf)
+{
+  char *p, *var;
+
+  /* Expand the variable name and find the beginning (NAME) and end.  */
+  var = allocated_variable_expand (name);
+  name = next_token (var);
+  if (*name == '\0')
+    fatal (&ebuf->floc, _("empty variable name"));
+  p = name + strlen (name) - 1;
+  while (p > name && isblank ((unsigned char)*p))
+    --p;
+  p[1] = '\0';
+
+  undefine_variable_global (name, p - name + 1, origin);
+  free (var);
+}
+
 /* Execute a `define' directive.
    The first line has already been read, and NAME is the name of
    the variable to be defined.  The following lines remain to be read.  */
 
-static void
-do_define (char *name, unsigned int namelen,
-           enum variable_origin origin, struct ebuffer *ebuf)
+static struct variable *
+do_define (char *name, enum variable_origin origin, struct ebuffer *ebuf)
 {
+  struct variable *v;
+  enum variable_flavor flavor;
   struct floc defstart;
-  long nlines = 0;
   int nlevels = 1;
   unsigned int length = 100;
   char *definition = xmalloc (length);
   unsigned int idx = 0;
-  char *p;
-
-  /* Expand the variable name.  */
-  char *var = alloca (namelen + 1);
-  memcpy (var, name, namelen);
-  var[namelen] = '\0';
-  var = variable_expand (var);
+  char *p, *var;
 
   defstart = ebuf->floc;
 
+  p = parse_variable_definition (name, &flavor);
+  if (p == NULL)
+    /* No assignment token, so assume recursive.  */
+    flavor = f_recursive;
+  else
+    {
+      if (*(next_token (p)) != '\0')
+        error (&defstart, _("extraneous text after `define' directive"));
+
+      /* Chop the string before the assignment token to get the name.  */
+      p[flavor == f_recursive ? -1 : -2] = '\0';
+    }
+
+  /* Expand the variable name and find the beginning (NAME) and end.  */
+  var = allocated_variable_expand (name);
+  name = next_token (var);
+  if (*name == '\0')
+    fatal (&defstart, _("empty variable name"));
+  p = name + strlen (name) - 1;
+  while (p > name && isblank ((unsigned char)*p))
+    --p;
+  p[1] = '\0';
+
+  /* Now read the value of the variable.  */
   while (1)
     {
       unsigned int len;
       char *line;
-
-      nlines = readline (ebuf);
+      long nlines = readline (ebuf);
+
+      /* If there is nothing left to be eval'd, there's no 'endef'!!  */
+      if (nlines < 0)
+        fatal (&defstart, _("missing `endef', unterminated `define'"));
+
       ebuf->floc.lineno += nlines;
-
-      /* If there is nothing left to eval, we're done. */
-      if (nlines < 0)
-        break;
-
       line = ebuf->buffer;
 
@@ -1362,7 +1404,5 @@
 
       /* If the line doesn't begin with a tab, test to see if it introduces
-         another define, or ends one.  */
-
-      /* Stop if we find an 'endef' */
+         another define, or ends one.  Stop if we find an 'endef' */
       if (line[0] != cmd_prefix)
         {
@@ -1382,26 +1422,14 @@
               p += 5;
               remove_comments (p);
-              if (*next_token (p) != '\0')
+              if (*(next_token (p)) != '\0')
                 error (&ebuf->floc,
-                       _("Extraneous text after `endef' directive"));
+                       _("extraneous text after `endef' directive"));
 
               if (--nlevels == 0)
-                {
-                  /* Define the variable.  */
-                  if (idx == 0)
-                    definition[0] = '\0';
-                  else
-                    definition[idx - 1] = '\0';
-
-                  /* Always define these variables in the global set.  */
-                  define_variable_global (var, strlen (var), definition,
-                                          origin, 1, &defstart);
-                  free (definition);
-                  return;
-                }
+                break;
             }
         }
 
-      /* Otherwise add this line to the variable definition.  */
+      /* Add this line to the variable definition.  */
       len = strlen (line);
       if (idx + len + 1 > length)
@@ -1417,9 +1445,14 @@
     }
 
-  /* No `endef'!!  */
-  fatal (&defstart, _("missing `endef', unterminated `define'"));
-
-  /* NOTREACHED */
-  return;
+  /* We've got what we need; define the variable.  */
+  if (idx == 0)
+    definition[0] = '\0';
+  else
+    definition[idx - 1] = '\0';
+
+  v = do_variable_definition (&defstart, name, definition, origin, flavor, 0);
+  free (definition);
+  free (var);
+  return (v);
 }
 
@@ -1695,69 +1728,4 @@
 
 
-/* Remove duplicate dependencies in CHAIN.  */
-
-static unsigned long
-dep_hash_1 (const void *key)
-{
-  return_STRING_HASH_1 (dep_name ((struct dep const *) key));
-}
-
-static unsigned long
-dep_hash_2 (const void *key)
-{
-  return_STRING_HASH_2 (dep_name ((struct dep const *) key));
-}
-
-static int
-dep_hash_cmp (const void *x, const void *y)
-{
-  struct dep *dx = (struct dep *) x;
-  struct dep *dy = (struct dep *) y;
-  int cmp = strcmp (dep_name (dx), dep_name (dy));
-
-  /* If the names are the same but ignore_mtimes are not equal, one of these
-     is an order-only prerequisite and one isn't.  That means that we should
-     remove the one that isn't and keep the one that is.  */
-
-  if (!cmp && dx->ignore_mtime != dy->ignore_mtime)
-    dx->ignore_mtime = dy->ignore_mtime = 0;
-
-  return cmp;
-}
-
-
-void
-uniquize_deps (struct dep *chain)
-{
-  struct hash_table deps;
-  register struct dep **depp;
-
-  hash_init (&deps, 500, dep_hash_1, dep_hash_2, dep_hash_cmp);
-
-  /* Make sure that no dependencies are repeated.  This does not
-     really matter for the purpose of updating targets, but it
-     might make some names be listed twice for $^ and $?.  */
-
-  depp = &chain;
-  while (*depp)
-    {
-      struct dep *dep = *depp;
-      struct dep **dep_slot = (struct dep **) hash_find_slot (&deps, dep);
-      if (HASH_VACANT (*dep_slot))
-	{
-	  hash_insert_at (&deps, dep, dep_slot);
-	  depp = &dep->next;
-	}
-      else
-	{
-	  /* Don't bother freeing duplicates.
-	     It's dangerous and little benefit accrues.  */
-	  *depp = dep->next;
-	}
-    }
-
-  hash_free (&deps, 0);
-}
-
 
 /* Record target-specific variable values for files FILENAMES.
@@ -1772,5 +1740,5 @@
 static void
 record_target_var (struct nameseq *filenames, char *defn,
-                   enum variable_origin origin, int exported,
+                   enum variable_origin origin, struct vmodifiers *vmod,
                    const struct floc *flocp)
 {
@@ -1792,5 +1760,5 @@
 
       nextf = filenames->next;
-      free (filenames);
+      free_ns (filenames);
 
       /* If it's a pattern target, then add it to the pattern-specific
@@ -1804,7 +1772,8 @@
           /* I don't think this can fail since we already determined it was a
              variable definition.  */
-          v = parse_variable_definition (&p->variable, defn);
+          v = assign_variable_definition (&p->variable, defn);
           assert (v != 0);
 
+          v->origin = origin;
           if (v->flavor == f_simple)
             v->value = allocated_variable_expand (v->value);
@@ -1834,16 +1803,16 @@
           v = try_variable_definition (flocp, defn, origin, 1);
           if (!v)
-            error (flocp, _("Malformed target-specific variable definition"));
+            fatal (flocp, _("Malformed target-specific variable definition"));
           current_variable_set_list = global;
         }
 
       /* Set up the variable to be *-specific.  */
-      v->origin = origin;
       v->per_target = 1;
-      v->export = exported ? v_export : v_default;
+      v->private_var = vmod->private_v;
+      v->export = vmod->export_v ? v_export : v_default;
 
       /* If it's not an override, check to see if there was a command-line
          setting.  If so, reset the value.  */
-      if (origin != o_override)
+      if (v->origin != o_override)
         {
           struct variable *gv;
@@ -1878,14 +1847,13 @@
 static void
 record_files (struct nameseq *filenames, const char *pattern,
-              const char *pattern_percent, struct dep *deps,
+              const char *pattern_percent, char *depstr,
               unsigned int cmds_started, char *commands,
               unsigned int commands_idx, int two_colon,
               const struct floc *flocp)
 {
-  struct nameseq *nextf;
-  int implicit = 0;
-  unsigned int max_targets = 0, target_idx = 0;
-  const char **targets = 0, **target_percents = 0;
   struct commands *cmds;
+  struct dep *deps;
+  const char *implicit_percent;
+  const char *name;
 
   /* If we've already snapped deps, that means we're in an eval being
@@ -1896,4 +1864,9 @@
     fatal (flocp, _("prerequisites cannot be defined in recipes"));
 
+  /* Determine if this is a pattern rule or not.  */
+  name = filenames->name;
+  implicit_percent = find_percent_cached (&name);
+
+  /* If there's a recipe, set up a struct for it.  */
   if (commands_idx > 0)
     {
@@ -1901,80 +1874,126 @@
       cmds->fileinfo.filenm = flocp->filenm;
       cmds->fileinfo.lineno = cmds_started;
-      cmds->commands = savestring (commands, commands_idx);
+      cmds->commands = xstrndup (commands, commands_idx);
       cmds->command_lines = 0;
     }
   else
-    cmds = 0;
-
-  for (; filenames != 0; filenames = nextf)
+     cmds = 0;
+
+  /* If there's a prereq string then parse it--unless it's eligible for 2nd
+     expansion: if so, snap_deps() will do it.  */
+  if (depstr == 0)
+    deps = 0;
+  else if (second_expansion && strchr (depstr, '$'))
     {
-      const char *name = filenames->name;
+      deps = alloc_dep ();
+      deps->name = depstr;
+      deps->need_2nd_expansion = 1;
+      deps->staticpattern = pattern != 0;
+    }
+  else
+    {
+      deps = split_prereqs (depstr);
+      free (depstr);
+
+      /* We'll enter static pattern prereqs later when we have the stem.  We
+         don't want to enter pattern rules at all so that we don't think that
+         they ought to exist (make manual "Implicit Rule Search Algorithm",
+         item 5c).  */
+      if (! pattern && ! implicit_percent)
+        deps = enter_prereqs (deps, NULL);
+    }
+
+  /* For implicit rules, _all_ the targets must have a pattern.  That means we
+     can test the first one to see if we're working with an implicit rule; if
+     so we handle it specially. */
+
+  if (implicit_percent)
+    {
+      struct nameseq *nextf;
+      const char **targets, **target_pats;
+      unsigned int c;
+
+      if (pattern != 0)
+        fatal (flocp, _("mixed implicit and static pattern rules"));
+
+      /* Count the targets to create an array of target names.
+         We already have the first one.  */
+      nextf = filenames->next;
+      free_ns (filenames);
+      filenames = nextf;
+
+      for (c = 1; nextf; ++c, nextf = nextf->next)
+        ;
+      targets = xmalloc (c * sizeof (const char *));
+      target_pats = xmalloc (c * sizeof (const char *));
+
+      targets[0] = name;
+      target_pats[0] = implicit_percent;
+
+      c = 1;
+      while (filenames)
+        {
+          name = filenames->name;
+          implicit_percent = find_percent_cached (&name);
+
+          if (implicit_percent == 0)
+            fatal (flocp, _("mixed implicit and normal rules"));
+
+	  targets[c] = name;
+	  target_pats[c] = implicit_percent;
+          ++c;
+
+          nextf = filenames->next;
+          free_ns (filenames);
+          filenames = nextf;
+        }
+
+      create_pattern_rule (targets, target_pats, c, two_colon, deps, cmds, 1);
+
+      return;
+    }
+
+
+  /* Walk through each target and create it in the database.
+     We already set up the first target, above.  */
+  while (1)
+    {
+      struct nameseq *nextf = filenames->next;
       struct file *f;
       struct dep *this = 0;
-      const char *implicit_percent;
-
-      nextf = filenames->next;
-      free (filenames);
+
+      free_ns (filenames);
 
       /* Check for special targets.  Do it here instead of, say, snap_deps()
          so that we can immediately use the value.  */
-
       if (streq (name, ".POSIX"))
-        posix_pedantic = 1;
+        {
+          posix_pedantic = 1;
+          define_variable_cname (".SHELLFLAGS", "-ec", o_default, 0);
+        }
       else if (streq (name, ".SECONDEXPANSION"))
         second_expansion = 1;
-
-      implicit_percent = find_percent_cached (&name);
-      implicit |= implicit_percent != 0;
-
-      if (implicit)
-        {
-          if (pattern != 0)
-            fatal (flocp, _("mixed implicit and static pattern rules"));
-
-          if (implicit_percent == 0)
-            fatal (flocp, _("mixed implicit and normal rules"));
-
-	  if (targets == 0)
-	    {
-	      max_targets = 5;
-	      targets = xmalloc (5 * sizeof (char *));
-	      target_percents = xmalloc (5 * sizeof (char *));
-	      target_idx = 0;
-	    }
-	  else if (target_idx == max_targets - 1)
-	    {
-	      max_targets += 5;
-	      targets = xrealloc (targets, max_targets * sizeof (char *));
-	      target_percents = xrealloc (target_percents,
-                                          max_targets * sizeof (char *));
-	    }
-	  targets[target_idx] = name;
-	  target_percents[target_idx] = implicit_percent;
-	  ++target_idx;
-	  continue;
-	}
+#if !defined(WINDOWS32) && !defined (__MSDOS__) && !defined (__EMX__)
+      else if (streq (name, ".ONESHELL"))
+        one_shell = 1;
+#endif
 
       /* If this is a static pattern rule:
-         `targets: target%pattern: dep%pattern; cmds',
+         `targets: target%pattern: prereq%pattern; recipe',
          make sure the pattern matches this target name.  */
       if (pattern && !pattern_matches (pattern, pattern_percent, name))
         error (flocp, _("target `%s' doesn't match the target pattern"), name);
       else if (deps)
-        {
-          /* If there are multiple filenames, copy the chain DEPS for all but
-             the last one.  It is not safe for the same deps to go in more
-             than one place in the database.  */
-          this = nextf != 0 ? copy_dep_chain (deps) : deps;
-          this->need_2nd_expansion = (second_expansion
-				      && strchr (this->name, '$'));
-        }
-
+        /* If there are multiple targets, copy the chain DEPS for all but the
+           last one.  It is not safe for the same deps to go in more than one
+           place in the database.  */
+        this = nextf != 0 ? copy_dep_chain (deps) : deps;
+
+      /* Find or create an entry in the file database for this target.  */
       if (!two_colon)
 	{
-	  /* Single-colon.  Combine these dependencies
-	     with others in file's existing record, if any.  */
+	  /* Single-colon.  Combine this rule with the file's existing record,
+	     if any.  */
 	  f = enter_file (strcache_add (name));
-
 	  if (f->double_colon)
 	    fatal (flocp,
@@ -2001,6 +2020,4 @@
 	    }
 
-	  f->is_target = 1;
-
 	  /* Defining .DEFAULT with no deps or cmds clears it.  */
 	  if (f == default_file && this == 0 && cmds == 0)
@@ -2016,58 +2033,4 @@
 	      f->deps = 0;
 	    }
-          else if (this != 0)
-	    {
-	      /* Add the file's old deps and the new ones in THIS together.  */
-
-              if (f->deps != 0)
-                {
-                  struct dep **d_ptr = &f->deps;
-
-                  while ((*d_ptr)->next != 0)
-                    d_ptr = &(*d_ptr)->next;
-
-                  if (cmds != 0)
-                    /* This is the rule with commands, so put its deps
-                       last. The rationale behind this is that $< expands to
-                       the first dep in the chain, and commands use $<
-                       expecting to get the dep that rule specifies.  However
-                       the second expansion algorithm reverses the order thus
-                       we need to make it last here.  */
-                    (*d_ptr)->next = this;
-                  else
-                    {
-                      /* This is the rule without commands. Put its
-                         dependencies at the end but before dependencies from
-                         the rule with commands (if any). This way everything
-                         appears in makefile order.  */
-
-                      if (f->cmds != 0)
-                        {
-                          this->next = *d_ptr;
-                          *d_ptr = this;
-                        }
-                      else
-                        (*d_ptr)->next = this;
-                    }
-                }
-              else
-                f->deps = this;
-
-              /* This is a hack. I need a way to communicate to snap_deps()
-                 that the last dependency line in this file came with commands
-                 (so that logic in snap_deps() can put it in front and all
-                 this $< -logic works). I cannot simply rely on file->cmds
-                 being not 0 because of the cases like the following:
-
-                 foo: bar
-                 foo:
-                     ...
-
-                 I am going to temporarily "borrow" UPDATING member in
-                 `struct file' for this.   */
-
-              if (cmds != 0)
-                f->updating = 1;
-	    }
 	}
       else
@@ -2076,9 +2039,10 @@
 	  f = lookup_file (name);
 
-	  /* Check for both : and :: rules.  Check is_target so
-	     we don't lose on default suffix rules or makefiles.  */
+	  /* Check for both : and :: rules.  Check is_target so we don't lose
+	     on default suffix rules or makefiles.  */
 	  if (f != 0 && f->is_target && !f->double_colon)
 	    fatal (flocp,
                    _("target file `%s' has both : and :: entries"), f->name);
+
 	  f = enter_file (strcache_add (name));
 	  /* If there was an existing entry and it was a double-colon entry,
@@ -2090,12 +2054,13 @@
 	       double_colon pointer to itself.  */
 	    f->double_colon = f;
-	  f->is_target = 1;
-	  f->deps = this;
+
 	  f->cmds = cmds;
 	}
 
+      f->is_target = 1;
+
       /* If this is a static pattern rule, set the stem to the part of its
          name that matched the `%' in the pattern, so you can use $* in the
-         commands.  */
+         commands.  If we didn't do it before, enter the prereqs now.  */
       if (pattern)
         {
@@ -2107,24 +2072,52 @@
           if (this)
             {
-              this->staticpattern = 1;
-              this->stem = f->stem;
+              if (! this->need_2nd_expansion)
+                this = enter_prereqs (this, f->stem);
+              else
+                this->stem = f->stem;
             }
         }
 
+      /* Add the dependencies to this file entry.  */
+      if (this != 0)
+        {
+          /* Add the file's old deps and the new ones in THIS together.  */
+          if (f->deps == 0)
+            f->deps = this;
+          else if (cmds != 0)
+            {
+              struct dep *d = this;
+
+              /* If this rule has commands, put these deps first.  */
+              while (d->next != 0)
+                d = d->next;
+
+              d->next = f->deps;
+              f->deps = this;
+            }
+          else
+            {
+              struct dep *d = f->deps;
+
+              /* A rule without commands: put its prereqs at the end.  */
+              while (d->next != 0)
+                d = d->next;
+
+              d->next = this;
+            }
+        }
+
       name = f->name;
 
-      /* If this target is a default target, update DEFAULT_GOAL_FILE.  */
-      if (streq (*default_goal_name, name)
-          && (default_goal_file == 0
-              || ! streq (default_goal_file->name, name)))
-        default_goal_file = f;
-    }
-
-  if (implicit)
-    {
-      if (deps)
-        deps->need_2nd_expansion = second_expansion;
-      create_pattern_rule (targets, target_percents, target_idx,
-                           two_colon, deps, cmds, 1);
+      /* All done!  Set up for the next one.  */
+      if (nextf == 0)
+        break;
+
+      filenames = nextf;
+
+      /* Reduce escaped percents.  If there are any unescaped it's an error  */
+      name = filenames->name;
+      if (find_percent_cached (&name))
+        fatal (flocp, _("mixed implicit and normal rules"));
     }
 }
@@ -2250,5 +2243,5 @@
   const char *p = *string;
   char *new = 0;
-  int slen;
+  int slen = 0;
 
   /* If the first char is a % return now.  This lets us avoid extra tests
@@ -2316,6 +2309,539 @@
 
 
-/* Parse a string into a sequence of filenames represented as a
-   chain of struct nameseq's in reverse order and return that chain.
+/* Find the next line of text in an eval buffer, combining continuation lines
+   into one line.
+   Return the number of actual lines read (> 1 if continuation lines).
+   Returns -1 if there's nothing left in the buffer.
+
+   After this function, ebuf->buffer points to the first character of the
+   line we just found.
+ */
+
+/* Read a line of text from a STRING.
+   Since we aren't really reading from a file, don't bother with linenumbers.
+ */
+
+static unsigned long
+readstring (struct ebuffer *ebuf)
+{
+  char *eol;
+
+  /* If there is nothing left in this buffer, return 0.  */
+  if (ebuf->bufnext >= ebuf->bufstart + ebuf->size)
+    return -1;
+
+  /* Set up a new starting point for the buffer, and find the end of the
+     next logical line (taking into account backslash/newline pairs).  */
+
+  eol = ebuf->buffer = ebuf->bufnext;
+
+  while (1)
+    {
+      int backslash = 0;
+      const char *bol = eol;
+      const char *p;
+
+      /* Find the next newline.  At EOS, stop.  */
+      p = eol = strchr (eol , '\n');
+      if (!eol)
+        {
+          ebuf->bufnext = ebuf->bufstart + ebuf->size + 1;
+          return 0;
+        }
+
+      /* Found a newline; if it's escaped continue; else we're done.  */
+      while (p > bol && *(--p) == '\\')
+        backslash = !backslash;
+      if (!backslash)
+        break;
+      ++eol;
+    }
+
+  /* Overwrite the newline char.  */
+  *eol = '\0';
+  ebuf->bufnext = eol+1;
+
+  return 0;
+}
+
+static long
+readline (struct ebuffer *ebuf)
+{
+  char *p;
+  char *end;
+  char *start;
+  long nlines = 0;
+
+  /* The behaviors between string and stream buffers are different enough to
+     warrant different functions.  Do the Right Thing.  */
+
+  if (!ebuf->fp)
+    return readstring (ebuf);
+
+  /* When reading from a file, we always start over at the beginning of the
+     buffer for each new line.  */
+
+  p = start = ebuf->bufstart;
+  end = p + ebuf->size;
+  *p = '\0';
+
+  while (fgets (p, end - p, ebuf->fp) != 0)
+    {
+      char *p2;
+      unsigned long len;
+      int backslash;
+
+      len = strlen (p);
+      if (len == 0)
+	{
+	  /* This only happens when the first thing on the line is a '\0'.
+	     It is a pretty hopeless case, but (wonder of wonders) Athena
+	     lossage strikes again!  (xmkmf puts NULs in its makefiles.)
+	     There is nothing really to be done; we synthesize a newline so
+	     the following line doesn't appear to be part of this line.  */
+	  error (&ebuf->floc,
+                 _("warning: NUL character seen; rest of line ignored"));
+	  p[0] = '\n';
+	  len = 1;
+	}
+
+      /* Jump past the text we just read.  */
+      p += len;
+
+      /* If the last char isn't a newline, the whole line didn't fit into the
+         buffer.  Get some more buffer and try again.  */
+      if (p[-1] != '\n')
+        goto more_buffer;
+
+      /* We got a newline, so add one to the count of lines.  */
+      ++nlines;
+
+#if !defined(WINDOWS32) && !defined(__MSDOS__) && !defined(__EMX__)
+      /* Check to see if the line was really ended with CRLF; if so ignore
+         the CR.  */
+      if ((p - start) > 1 && p[-2] == '\r')
+        {
+          --p;
+          p[-1] = '\n';
+        }
+#endif
+
+      backslash = 0;
+      for (p2 = p - 2; p2 >= start; --p2)
+	{
+	  if (*p2 != '\\')
+	    break;
+          backslash = !backslash;
+	}
+
+      if (!backslash)
+	{
+	  p[-1] = '\0';
+	  break;
+	}
+
+      /* It was a backslash/newline combo.  If we have more space, read
+         another line.  */
+      if (end - p >= 80)
+        continue;
+
+      /* We need more space at the end of our buffer, so realloc it.
+         Make sure to preserve the current offset of p.  */
+    more_buffer:
+      {
+        unsigned long off = p - start;
+        ebuf->size *= 2;
+        start = ebuf->buffer = ebuf->bufstart = xrealloc (start, ebuf->size);
+        p = start + off;
+        end = start + ebuf->size;
+        *p = '\0';
+      }
+    }
+
+  if (ferror (ebuf->fp))
+    pfatal_with_name (ebuf->floc.filenm);
+
+  /* If we found some lines, return how many.
+     If we didn't, but we did find _something_, that indicates we read the last
+     line of a file with no final newline; return 1.
+     If we read nothing, we're at EOF; return -1.  */
+
+  return nlines ? nlines : p == ebuf->bufstart ? -1 : 1;
+}
+
+
+/* Parse the next "makefile word" from the input buffer, and return info
+   about it.
+
+   A "makefile word" is one of:
+
+     w_bogus        Should never happen
+     w_eol          End of input
+     w_static       A static word; cannot be expanded
+     w_variable     A word containing one or more variables/functions
+     w_colon        A colon
+     w_dcolon       A double-colon
+     w_semicolon    A semicolon
+     w_varassign    A variable assignment operator (=, :=, +=, or ?=)
+
+   Note that this function is only used when reading certain parts of the
+   makefile.  Don't use it where special rules hold sway (RHS of a variable,
+   in a command list, etc.)  */
+
+static enum make_word_type
+get_next_mword (char *buffer, char *delim, char **startp, unsigned int *length)
+{
+  enum make_word_type wtype = w_bogus;
+  char *p = buffer, *beg;
+  char c;
+
+  /* Skip any leading whitespace.  */
+  while (isblank ((unsigned char)*p))
+    ++p;
+
+  beg = p;
+  c = *(p++);
+  switch (c)
+    {
+    case '\0':
+      wtype = w_eol;
+      break;
+
+    case ';':
+      wtype = w_semicolon;
+      break;
+
+    case '=':
+      wtype = w_varassign;
+      break;
+
+    case ':':
+      wtype = w_colon;
+      switch (*p)
+        {
+        case ':':
+          ++p;
+          wtype = w_dcolon;
+          break;
+
+        case '=':
+          ++p;
+          wtype = w_varassign;
+          break;
+        }
+      break;
+
+    case '+':
+    case '?':
+      if (*p == '=')
+        {
+          ++p;
+          wtype = w_varassign;
+          break;
+        }
+
+    default:
+      if (delim && strchr (delim, c))
+        wtype = w_static;
+      break;
+    }
+
+  /* Did we find something?  If so, return now.  */
+  if (wtype != w_bogus)
+    goto done;
+
+  /* This is some non-operator word.  A word consists of the longest
+     string of characters that doesn't contain whitespace, one of [:=#],
+     or [?+]=, or one of the chars in the DELIM string.  */
+
+  /* We start out assuming a static word; if we see a variable we'll
+     adjust our assumptions then.  */
+  wtype = w_static;
+
+  /* We already found the first value of "c", above.  */
+  while (1)
+    {
+      char closeparen;
+      int count;
+
+      switch (c)
+        {
+        case '\0':
+        case ' ':
+        case '\t':
+        case '=':
+          goto done_word;
+
+        case ':':
+#ifdef HAVE_DOS_PATHS
+	  /* A word CAN include a colon in its drive spec.  The drive
+	     spec is allowed either at the beginning of a word, or as part
+	     of the archive member name, like in "libfoo.a(d:/foo/bar.o)".  */
+	  if (!(p - beg >= 2
+		&& (*p == '/' || *p == '\\') && isalpha ((unsigned char)p[-2])
+		&& (p - beg == 2 || p[-3] == '(')))
+#endif
+	  goto done_word;
+
+        case '$':
+          c = *(p++);
+          if (c == '$')
+            break;
+
+          /* This is a variable reference, so note that it's expandable.
+             Then read it to the matching close paren.  */
+          wtype = w_variable;
+
+          if (c == '(')
+            closeparen = ')';
+          else if (c == '{')
+            closeparen = '}';
+          else
+            /* This is a single-letter variable reference.  */
+            break;
+
+          for (count=0; *p != '\0'; ++p)
+            {
+              if (*p == c)
+                ++count;
+              else if (*p == closeparen && --count < 0)
+                {
+                  ++p;
+                  break;
+                }
+            }
+          break;
+
+        case '?':
+        case '+':
+          if (*p == '=')
+            goto done_word;
+          break;
+
+        case '\\':
+          switch (*p)
+            {
+            case ':':
+            case ';':
+            case '=':
+            case '\\':
+              ++p;
+              break;
+            }
+          break;
+
+        default:
+          if (delim && strchr (delim, c))
+            goto done_word;
+          break;
+        }
+
+      c = *(p++);
+    }
+ done_word:
+  --p;
+
+ done:
+  if (startp)
+    *startp = beg;
+  if (length)
+    *length = p - beg;
+  return wtype;
+}
+
+
+/* Construct the list of include directories
+   from the arguments and the default list.  */
+
+void
+construct_include_path (const char **arg_dirs)
+{
+#ifdef VAXC		/* just don't ask ... */
+  stat_t stbuf;
+#else
+  struct stat stbuf;
+#endif
+  const char **dirs;
+  const char **cpp;
+  unsigned int idx;
+
+  /* Compute the number of pointers we need in the table.  */
+  idx = sizeof (default_include_directories) / sizeof (const char *);
+  if (arg_dirs)
+    for (cpp = arg_dirs; *cpp != 0; ++cpp)
+      ++idx;
+
+#ifdef  __MSDOS__
+  /* Add one for $DJDIR.  */
+  ++idx;
+#endif
+
+  dirs = xmalloc (idx * sizeof (const char *));
+
+  idx = 0;
+  max_incl_len = 0;
+
+  /* First consider any dirs specified with -I switches.
+     Ignore any that don't exist.  Remember the maximum string length.  */
+
+  if (arg_dirs)
+    while (*arg_dirs != 0)
+      {
+	const char *dir = *(arg_dirs++);
+        char *expanded = 0;
+        int e;
+
+	if (dir[0] == '~')
+	  {
+	    expanded = tilde_expand (dir);
+	    if (expanded != 0)
+	      dir = expanded;
+	  }
+
+        EINTRLOOP (e, stat (dir, &stbuf));
+	if (e == 0 && S_ISDIR (stbuf.st_mode))
+          {
+            unsigned int len = strlen (dir);
+            /* If dir name is written with trailing slashes, discard them.  */
+            while (len > 1 && dir[len - 1] == '/')
+              --len;
+            if (len > max_incl_len)
+              max_incl_len = len;
+            dirs[idx++] = strcache_add_len (dir, len);
+          }
+
+	if (expanded)
+	  free (expanded);
+      }
+
+  /* Now add the standard default dirs at the end.  */
+
+#ifdef  __MSDOS__
+  {
+    /* The environment variable $DJDIR holds the root of the DJGPP directory
+       tree; add ${DJDIR}/include.  */
+    struct variable *djdir = lookup_variable ("DJDIR", 5);
+
+    if (djdir)
+      {
+        unsigned int len = strlen (djdir->value) + 8;
+	char *defdir = alloca (len + 1);
+
+	strcat (strcpy (defdir, djdir->value), "/include");
+	dirs[idx++] = strcache_add (defdir);
+
+        if (len > max_incl_len)
+          max_incl_len = len;
+      }
+  }
+#endif
+
+  for (cpp = default_include_directories; *cpp != 0; ++cpp)
+    {
+      int e;
+
+      EINTRLOOP (e, stat (*cpp, &stbuf));
+      if (e == 0 && S_ISDIR (stbuf.st_mode))
+        {
+          unsigned int len = strlen (*cpp);
+          /* If dir name is written with trailing slashes, discard them.  */
+          while (len > 1 && (*cpp)[len - 1] == '/')
+            --len;
+          if (len > max_incl_len)
+            max_incl_len = len;
+          dirs[idx++] = strcache_add_len (*cpp, len);
+        }
+    }
+
+  dirs[idx] = 0;
+
+  /* Now add each dir to the .INCLUDE_DIRS variable.  */
+
+  for (cpp = dirs; *cpp != 0; ++cpp)
+    do_variable_definition (NILF, ".INCLUDE_DIRS", *cpp,
+                            o_default, f_append, 0);
+
+  include_directories = dirs;
+}
+
+
+/* Expand ~ or ~USER at the beginning of NAME.
+   Return a newly malloc'd string or 0.  */
+
+char *
+tilde_expand (const char *name)
+{
+#ifndef VMS
+  if (name[1] == '/' || name[1] == '\0')
+    {
+      extern char *getenv ();
+      char *home_dir;
+      int is_variable;
+
+      {
+	/* Turn off --warn-undefined-variables while we expand HOME.  */
+	int save = warn_undefined_variables_flag;
+	warn_undefined_variables_flag = 0;
+
+	home_dir = allocated_variable_expand ("$(HOME)");
+
+	warn_undefined_variables_flag = save;
+      }
+
+      is_variable = home_dir[0] != '\0';
+      if (!is_variable)
+	{
+	  free (home_dir);
+	  home_dir = getenv ("HOME");
+	}
+# if !defined(_AMIGA) && !defined(WINDOWS32)
+      if (home_dir == 0 || home_dir[0] == '\0')
+	{
+	  extern char *getlogin ();
+	  char *logname = getlogin ();
+	  home_dir = 0;
+	  if (logname != 0)
+	    {
+	      struct passwd *p = getpwnam (logname);
+	      if (p != 0)
+		home_dir = p->pw_dir;
+	    }
+	}
+# endif /* !AMIGA && !WINDOWS32 */
+      if (home_dir != 0)
+	{
+	  char *new = xstrdup (concat (2, home_dir, name + 1));
+	  if (is_variable)
+	    free (home_dir);
+	  return new;
+	}
+    }
+# if !defined(_AMIGA) && !defined(WINDOWS32)
+  else
+    {
+      struct passwd *pwent;
+      char *userend = strchr (name + 1, '/');
+      if (userend != 0)
+	*userend = '\0';
+      pwent = getpwnam (name + 1);
+      if (pwent != 0)
+	{
+	  if (userend == 0)
+	    return xstrdup (pwent->pw_dir);
+	  else
+	    return xstrdup (concat (3, pwent->pw_dir, "/", userend + 1));
+	}
+      else if (userend != 0)
+	*userend = '/';
+    }
+# endif /* !AMIGA && !WINDOWS32 */
+#endif /* !VMS */
+  return 0;
+}
+
+
+/* Parse a string into a sequence of filenames represented as a chain of
+   struct nameseq's and return that chain.  Optionally expand the strings via
+   glob().
 
    The string is passed as STRINGP, the address of a string pointer.
@@ -2327,12 +2853,40 @@
    that have room for additional info.
 
-   If STRIP is nonzero, strip `./'s off the beginning.  */
-
-struct nameseq *
-parse_file_seq (char **stringp, int stopchar, unsigned int size, int strip)
+   PREFIX, if non-null, is added to the beginning of each filename.
+
+   FLAGS allows one or more of the following bitflags to be set:
+        PARSEFS_NOSTRIP - Do no strip './'s off the beginning
+        PARSEFS_NOAR    - Do not check filenames for archive references
+        PARSEFS_NOGLOB  - Do not expand globbing characters
+        PARSEFS_EXISTS  - Only return globbed files that actually exist
+                          (cannot also set NOGLOB)
+        PARSEFS_NOCACHE - Do not add filenames to the strcache (caller frees)
+  */
+
+void *
+parse_file_seq (char **stringp, unsigned int size, int stopchar,
+                const char *prefix, int flags)
 {
+  extern void dir_setup_glob (glob_t *glob);
+
+  /* tmp points to tmpbuf after the prefix, if any.
+     tp is the end of the buffer. */
+  static char *tmpbuf = NULL;
+  static int tmpbuf_len = 0;
+
+  int cachep = (! (flags & PARSEFS_NOCACHE));
+
   struct nameseq *new = 0;
-  struct nameseq *new1, *lastnew1;
-  char *p = *stringp;
+  struct nameseq **newp = &new;
+#define NEWELT(_n)  do { \
+                        const char *__n = (_n); \
+                        *newp = xcalloc (size); \
+                        (*newp)->name = (cachep ? strcache_add (__n) : xstrdup (__n)); \
+                        newp = &(*newp)->next; \
+                    } while(0)
+
+  char *p;
+  glob_t gl;
+  char *tp;
 
 #ifdef VMS
@@ -2342,19 +2896,45 @@
 #endif
 
+  if (size < sizeof (struct nameseq))
+    size = sizeof (struct nameseq);
+
+  if (! (flags & PARSEFS_NOGLOB))
+    dir_setup_glob (&gl);
+
+  /* Get enough temporary space to construct the largest possible target.  */
+  {
+    int l = strlen (*stringp) + 1;
+    if (l > tmpbuf_len)
+      {
+        tmpbuf = xrealloc (tmpbuf, l);
+        tmpbuf_len = l;
+      }
+  }
+  tp = tmpbuf;
+
+  /* Parse STRING.  P will always point to the end of the parsed content.  */
+  p = *stringp;
   while (1)
     {
       const char *name;
-      char *q;
-
-      /* Skip whitespace; see if any more names are left.  */
+      const char **nlist = 0;
+      char *tildep = 0;
+#ifndef NO_ARCHIVES
+      char *arname = 0;
+      char *memname = 0;
+#endif
+      char *s;
+      int nlen;
+      int i;
+
+      /* Skip whitespace; at the end of the string or STOPCHAR we're done.  */
       p = next_token (p);
-      if (*p == '\0')
+      if (*p == '\0' || *p == stopchar)
 	break;
-      if (*p == stopchar)
-	break;
-
-      /* There are, so find the end of the next name.  */
-      q = p;
-      p = find_char_unquote (q, stopchar, VMS_COMMA, 1, 0);
+
+      /* There are names left, so find the end of the next name.
+         Throughout this iteration S points to the start.  */
+      s = p;
+      p = find_char_unquote (p, stopchar, VMS_COMMA, 1, 0);
 #ifdef VMS
 	/* convert comma separated list to space separated */
@@ -2379,824 +2959,236 @@
 #endif
       if (p == 0)
-	p = q + strlen (q);
-
-      if (strip)
+	p = s + strlen (s);
+
+      /* Strip leading "this directory" references.  */
+      if (! (flags & PARSEFS_NOSTRIP))
 #ifdef VMS
 	/* Skip leading `[]'s.  */
-	while (p - q > 2 && q[0] == '[' && q[1] == ']')
+	while (p - s > 2 && s[0] == '[' && s[1] == ']')
 #else
 	/* Skip leading `./'s.  */
-	while (p - q > 2 && q[0] == '.' && q[1] == '/')
+	while (p - s > 2 && s[0] == '.' && s[1] == '/')
 #endif
 	  {
-	    q += 2;		/* Skip "./".  */
-	    while (q < p && *q == '/')
-	      /* Skip following slashes: ".//foo" is "foo", not "/foo".  */
-	      ++q;
+            /* Skip "./" and all following slashes.  */
+	    s += 2;
+	    while (*s == '/')
+	      ++s;
 	  }
 
-      /* Extract the filename just found, and skip it.  */
-
-      if (q == p)
-	/* ".///" was stripped to "". */
+      /* Extract the filename just found, and skip it.
+         Set NAME to the string, and NLEN to its length.  */
+
+      if (s == p)
+        {
+	/* The name was stripped to empty ("./"). */
 #if defined(VMS)
-	continue;
+          continue;
 #elif defined(_AMIGA)
-        name = "";
+          /* PDS-- This cannot be right!! */
+          tp[0] = '\0';
+          nlen = 0;
 #else
-	name = "./";
+          tp[0] = '.';
+          tp[1] = '/';
+          tp[2] = '\0';
+          nlen = 2;
 #endif
+        }
       else
+	{
 #ifdef VMS
 /* VMS filenames can have a ':' in them but they have to be '\'ed but we need
  *  to remove this '\' before we can use the filename.
- * Savestring called because q may be read-only string constant.
+ * xstrdup called because S may be read-only string constant.
  */
-	{
-	  char *qbase = xstrdup (q);
-	  char *pbase = qbase + (p-q);
-	  char *q1 = qbase;
-	  char *q2 = q1;
-	  char *p1 = pbase;
-
-	  while (q1 != pbase)
+	  char *n = tp;
+	  while (s < p)
 	    {
-	      if (*q1 == '\\' && *(q1+1) == ':')
-		{
-		  q1++;
-		  p1--;
-		}
-	      *q2++ = *q1++;
+	      if (s[0] == '\\' && s[1] == ':')
+                ++s;
+	      *(n++) = *(s++);
 	    }
-	  name = strcache_add_len (qbase, p1 - qbase);
-	  free (qbase);
-	}
+          n[0] = '\0';
+          nlen = strlen (tp);
 #else
-	name = strcache_add_len (q, p - q);
+          nlen = p - s;
+          memcpy (tp, s, nlen);
+          tp[nlen] = '\0';
 #endif
-
-      /* Add it to the front of the chain.  */
-      new1 = xmalloc (size);
-      memset (new1, '\0', size);
-      new1->name = name;
-      new1->next = new;
-      new = new1;
-    }
+        }
+
+      /* At this point, TP points to the element and NLEN is its length.  */
 
 #ifndef NO_ARCHIVES
-
-  /* Look for multi-word archive references.
-     They are indicated by a elt ending with an unmatched `)' and
-     an elt further down the chain (i.e., previous in the file list)
-     with an unmatched `(' (e.g., "lib(mem").  */
-
-  new1 = new;
-  lastnew1 = 0;
-  while (new1 != 0)
-    if (new1->name[0] != '('	/* Don't catch "(%)" and suchlike.  */
-	&& new1->name[strlen (new1->name) - 1] == ')'
-	&& strchr (new1->name, '(') == 0)
-      {
-	/* NEW1 ends with a `)' but does not contain a `('.
-	   Look back for an elt with an opening `(' but no closing `)'.  */
-
-	struct nameseq *n = new1->next, *lastn = new1;
-	char *paren = 0;
-	while (n != 0 && (paren = strchr (n->name, '(')) == 0)
-	  {
-	    lastn = n;
-	    n = n->next;
-	  }
-	if (n != 0
-	    /* Ignore something starting with `(', as that cannot actually
-	       be an archive-member reference (and treating it as such
-	       results in an empty file name, which causes much lossage).  */
-	    && n->name[0] != '(')
-	  {
-	    /* N is the first element in the archive group.
-	       Its name looks like "lib(mem" (with no closing `)').  */
-
-	    char *libname;
-
-	    /* Copy "lib(" into LIBNAME.  */
-	    ++paren;
-	    libname = alloca (paren - n->name + 1);
-	    memcpy (libname, n->name, paren - n->name);
-	    libname[paren - n->name] = '\0';
-
-	    if (*paren == '\0')
-	      {
-		/* N was just "lib(", part of something like "lib( a b)".
-		   Edit it out of the chain and free its storage.  */
-		lastn->next = n->next;
-		free (n);
-		/* LASTN->next is the new stopping elt for the loop below.  */
-		n = lastn->next;
-	      }
-	    else
-	      {
-		/* Replace N's name with the full archive reference.  */
-		n->name = strcache_add (concat (libname, paren, ")"));
-	      }
-
-	    if (new1->name[1] == '\0')
-	      {
-		/* NEW1 is just ")", part of something like "lib(a b )".
-		   Omit it from the chain and free its storage.  */
-		if (lastnew1 == 0)
-		  new = new1->next;
-		else
-		  lastnew1->next = new1->next;
-		lastn = new1;
-		new1 = new1->next;
-		free (lastn);
-	      }
-	    else
-	      {
-		/* Replace also NEW1->name, which already has closing `)'.  */
-		new1->name = strcache_add (concat (libname, new1->name, ""));
-		new1 = new1->next;
-	      }
-
-	    /* Trace back from NEW1 (the end of the list) until N
-	       (the beginning of the list), rewriting each name
-	       with the full archive reference.  */
-
-	    while (new1 != n)
-	      {
-		new1->name = strcache_add (concat (libname, new1->name, ")"));
-		lastnew1 = new1;
-		new1 = new1->next;
-	      }
-	  }
-	else
-	  {
-	    /* No frobnication happening.  Just step down the list.  */
-	    lastnew1 = new1;
-	    new1 = new1->next;
-	  }
-      }
-    else
-      {
-	lastnew1 = new1;
-	new1 = new1->next;
-      }
-
-#endif
-
-  *stringp = p;
-  return new;
-}
-
-
-/* Find the next line of text in an eval buffer, combining continuation lines
-   into one line.
-   Return the number of actual lines read (> 1 if continuation lines).
-   Returns -1 if there's nothing left in the buffer.
-
-   After this function, ebuf->buffer points to the first character of the
-   line we just found.
- */
-
-/* Read a line of text from a STRING.
-   Since we aren't really reading from a file, don't bother with linenumbers.
- */
-
-static unsigned long
-readstring (struct ebuffer *ebuf)
-{
-  char *eol;
-
-  /* If there is nothing left in this buffer, return 0.  */
-  if (ebuf->bufnext >= ebuf->bufstart + ebuf->size)
-    return -1;
-
-  /* Set up a new starting point for the buffer, and find the end of the
-     next logical line (taking into account backslash/newline pairs).  */
-
-  eol = ebuf->buffer = ebuf->bufnext;
-
-  while (1)
-    {
-      int backslash = 0;
-      char *bol = eol;
-      char *p;
-
-      /* Find the next newline.  At EOS, stop.  */
-      eol = p = strchr (eol , '\n');
-      if (!eol)
+      /* If this is the start of an archive group that isn't complete, set up
+         to add the archive prefix for future files.  A file list like:
+         "libf.a(x.o y.o z.o)" needs to be expanded as:
+         "libf.a(x.o) libf.a(y.o) libf.a(z.o)"
+
+         TP == TMP means we're not already in an archive group.  Ignore
+         something starting with `(', as that cannot actually be an
+         archive-member reference (and treating it as such results in an empty
+         file name, which causes much lossage).  Also if it ends in ")" then
+         it's a complete reference so we don't need to treat it specially.
+
+         Finally, note that archive groups must end with ')' as the last
+         character, so ensure there's some word ending like that before
+         considering this an archive group.  */
+      if (! (flags & PARSEFS_NOAR)
+          && tp == tmpbuf && tp[0] != '(' && tp[nlen-1] != ')')
         {
-          ebuf->bufnext = ebuf->bufstart + ebuf->size + 1;
-          return 0;
+          char *n = strchr (tp, '(');
+          if (n)
+            {
+              /* This looks like the first element in an open archive group.
+                 A valid group MUST have ')' as the last character.  */
+              const char *e = p + nlen;
+              do
+                {
+                  e = next_token (e);
+                  /* Find the end of this word.  We don't want to unquote and
+                     we don't care about quoting since we're looking for the
+                     last char in the word. */
+                  while (*e != '\0' && *e != stopchar && *e != VMS_COMMA
+                         && ! isblank ((unsigned char) *e))
+                    ++e;
+                  if (e[-1] == ')')
+                    {
+                      /* Found the end, so this is the first element in an
+                         open archive group.  It looks like "lib(mem".
+                         Reset TP past the open paren.  */
+                      nlen -= (n + 1) - tp;
+                      tp = n + 1;
+
+                      /* If we have just "lib(", part of something like
+                         "lib( a b)", go to the next item.  */
+                      if (! nlen)
+                        continue;
+
+                      /* We can stop looking now.  */
+                      break;
+                    }
+                }
+              while (*e != '\0');
+            }
         }
 
-      /* Found a newline; if it's escaped continue; else we're done.  */
-      while (p > bol && *(--p) == '\\')
-        backslash = !backslash;
-      if (!backslash)
-        break;
-      ++eol;
-    }
-
-  /* Overwrite the newline char.  */
-  *eol = '\0';
-  ebuf->bufnext = eol+1;
-
-  return 0;
-}
-
-static long
-readline (struct ebuffer *ebuf)
-{
-  char *p;
-  char *end;
-  char *start;
-  long nlines = 0;
-
-  /* The behaviors between string and stream buffers are different enough to
-     warrant different functions.  Do the Right Thing.  */
-
-  if (!ebuf->fp)
-    return readstring (ebuf);
-
-  /* When reading from a file, we always start over at the beginning of the
-     buffer for each new line.  */
-
-  p = start = ebuf->bufstart;
-  end = p + ebuf->size;
-  *p = '\0';
-
-  while (fgets (p, end - p, ebuf->fp) != 0)
-    {
-      char *p2;
-      unsigned long len;
-      int backslash;
-
-      len = strlen (p);
-      if (len == 0)
-	{
-	  /* This only happens when the first thing on the line is a '\0'.
-	     It is a pretty hopeless case, but (wonder of wonders) Athena
-	     lossage strikes again!  (xmkmf puts NULs in its makefiles.)
-	     There is nothing really to be done; we synthesize a newline so
-	     the following line doesn't appear to be part of this line.  */
-	  error (&ebuf->floc,
-                 _("warning: NUL character seen; rest of line ignored"));
-	  p[0] = '\n';
-	  len = 1;
-	}
-
-      /* Jump past the text we just read.  */
-      p += len;
-
-      /* If the last char isn't a newline, the whole line didn't fit into the
-         buffer.  Get some more buffer and try again.  */
-      if (p[-1] != '\n')
-        goto more_buffer;
-
-      /* We got a newline, so add one to the count of lines.  */
-      ++nlines;
-
-#if !defined(WINDOWS32) && !defined(__MSDOS__) && !defined(__EMX__)
-      /* Check to see if the line was really ended with CRLF; if so ignore
-         the CR.  */
-      if ((p - start) > 1 && p[-2] == '\r')
+      /* If we are inside an archive group, make sure it has an end.  */
+      if (tp > tmpbuf)
         {
-          --p;
-          p[-1] = '\n';
+          if (tp[nlen-1] == ')')
+            {
+              /* This is the natural end; reset TP.  */
+              tp = tmpbuf;
+
+              /* This is just ")", something like "lib(a b )": skip it.  */
+              if (nlen == 1)
+                continue;
+            }
+          else
+            {
+              /* Not the end, so add a "fake" end.  */
+              tp[nlen++] = ')';
+              tp[nlen] = '\0';
+            }
         }
 #endif
 
-      backslash = 0;
-      for (p2 = p - 2; p2 >= start; --p2)
+      /* If we're not globbing we're done: add it to the end of the chain.
+         Go to the next item in the string.  */
+      if (flags & PARSEFS_NOGLOB)
+        {
+          NEWELT (concat (2, prefix, tp));
+          continue;
+        }
+
+      /* If we get here we know we're doing glob expansion.
+         TP is a string in tmpbuf.  NLEN is no longer used.
+         We may need to do more work: after this NAME will be set.  */
+      name = tp;
+
+      /* Expand tilde if applicable.  */
+      if (tp[0] == '~')
 	{
-	  if (*p2 != '\\')
-	    break;
-          backslash = !backslash;
+	  tildep = tilde_expand (tp);
+	  if (tildep != 0)
+            name = tildep;
 	}
 
-      if (!backslash)
+#ifndef NO_ARCHIVES
+      /* If NAME is an archive member reference replace it with the archive
+         file name, and save the member name in MEMNAME.  We will glob on the
+         archive name and then reattach MEMNAME later.  */
+      if (! (flags & PARSEFS_NOAR) && ar_name (name))
 	{
-	  p[-1] = '\0';
-	  break;
+	  ar_parse_name (name, &arname, &memname);
+	  name = arname;
 	}
-
-      /* It was a backslash/newline combo.  If we have more space, read
-         another line.  */
-      if (end - p >= 80)
-        continue;
-
-      /* We need more space at the end of our buffer, so realloc it.
-         Make sure to preserve the current offset of p.  */
-    more_buffer:
-      {
-        unsigned long off = p - start;
-        ebuf->size *= 2;
-        start = ebuf->buffer = ebuf->bufstart = xrealloc (start, ebuf->size);
-        p = start + off;
-        end = start + ebuf->size;
-        *p = '\0';
-      }
-    }
-
-  if (ferror (ebuf->fp))
-    pfatal_with_name (ebuf->floc.filenm);
-
-  /* If we found some lines, return how many.
-     If we didn't, but we did find _something_, that indicates we read the last
-     line of a file with no final newline; return 1.
-     If we read nothing, we're at EOF; return -1.  */
-
-  return nlines ? nlines : p == ebuf->bufstart ? -1 : 1;
-}
-
-
-/* Parse the next "makefile word" from the input buffer, and return info
-   about it.
-
-   A "makefile word" is one of:
-
-     w_bogus        Should never happen
-     w_eol          End of input
-     w_static       A static word; cannot be expanded
-     w_variable     A word containing one or more variables/functions
-     w_colon        A colon
-     w_dcolon       A double-colon
-     w_semicolon    A semicolon
-     w_varassign    A variable assignment operator (=, :=, +=, or ?=)
-
-   Note that this function is only used when reading certain parts of the
-   makefile.  Don't use it where special rules hold sway (RHS of a variable,
-   in a command list, etc.)  */
-
-static enum make_word_type
-get_next_mword (char *buffer, char *delim, char **startp, unsigned int *length)
-{
-  enum make_word_type wtype = w_bogus;
-  char *p = buffer, *beg;
-  char c;
-
-  /* Skip any leading whitespace.  */
-  while (isblank ((unsigned char)*p))
-    ++p;
-
-  beg = p;
-  c = *(p++);
-  switch (c)
-    {
-    case '\0':
-      wtype = w_eol;
-      break;
-
-    case ';':
-      wtype = w_semicolon;
-      break;
-
-    case '=':
-      wtype = w_varassign;
-      break;
-
-    case ':':
-      wtype = w_colon;
-      switch (*p)
-        {
-        case ':':
-          ++p;
-          wtype = w_dcolon;
+#endif /* !NO_ARCHIVES */
+
+      switch (glob (name, GLOB_NOSORT|GLOB_ALTDIRFUNC, NULL, &gl))
+	{
+	case GLOB_NOSPACE:
+	  fatal (NILF, _("virtual memory exhausted"));
+
+	case 0:
+          /* Success.  */
+          i = gl.gl_pathc;
+          nlist = (const char **)gl.gl_pathv;
           break;
 
-        case '=':
-          ++p;
-          wtype = w_varassign;
-          break;
-        }
-      break;
-
-    case '+':
-    case '?':
-      if (*p == '=')
-        {
-          ++p;
-          wtype = w_varassign;
-          break;
-        }
-
-    default:
-      if (delim && strchr (delim, c))
-        wtype = w_static;
-      break;
-    }
-
-  /* Did we find something?  If so, return now.  */
-  if (wtype != w_bogus)
-    goto done;
-
-  /* This is some non-operator word.  A word consists of the longest
-     string of characters that doesn't contain whitespace, one of [:=#],
-     or [?+]=, or one of the chars in the DELIM string.  */
-
-  /* We start out assuming a static word; if we see a variable we'll
-     adjust our assumptions then.  */
-  wtype = w_static;
-
-  /* We already found the first value of "c", above.  */
-  while (1)
-    {
-      char closeparen;
-      int count;
-
-      switch (c)
-        {
-        case '\0':
-        case ' ':
-        case '\t':
-        case '=':
-          goto done_word;
-
-        case ':':
-#ifdef HAVE_DOS_PATHS
-	  /* A word CAN include a colon in its drive spec.  The drive
-	     spec is allowed either at the beginning of a word, or as part
-	     of the archive member name, like in "libfoo.a(d:/foo/bar.o)".  */
-	  if (!(p - beg >= 2
-		&& (*p == '/' || *p == '\\') && isalpha ((unsigned char)p[-2])
-		&& (p - beg == 2 || p[-3] == '(')))
-#endif
-	  goto done_word;
-
-        case '$':
-          c = *(p++);
-          if (c == '$')
-            break;
-
-          /* This is a variable reference, so note that it's expandable.
-             Then read it to the matching close paren.  */
-          wtype = w_variable;
-
-          if (c == '(')
-            closeparen = ')';
-          else if (c == '{')
-            closeparen = '}';
-          else
-            /* This is a single-letter variable reference.  */
-            break;
-
-          for (count=0; *p != '\0'; ++p)
+        case GLOB_NOMATCH:
+          /* If we want only existing items, skip this one.  */
+          if (flags & PARSEFS_EXISTS)
             {
-              if (*p == c)
-                ++count;
-              else if (*p == closeparen && --count < 0)
-                {
-                  ++p;
-                  break;
-                }
-            }
-          break;
-
-        case '?':
-        case '+':
-          if (*p == '=')
-            goto done_word;
-          break;
-
-        case '\\':
-          switch (*p)
-            {
-            case ':':
-            case ';':
-            case '=':
-            case '\\':
-              ++p;
+              i = 0;
               break;
             }
+          /* FALLTHROUGH */
+
+	default:
+          /* By default keep this name.  */
+          i = 1;
+          nlist = &name;
           break;
-
-        default:
-          if (delim && strchr (delim, c))
-            goto done_word;
-          break;
-        }
-
-      c = *(p++);
-    }
- done_word:
-  --p;
-
- done:
-  if (startp)
-    *startp = beg;
-  if (length)
-    *length = p - beg;
-  return wtype;
-}
-
-
-/* Construct the list of include directories
-   from the arguments and the default list.  */
-
-void
-construct_include_path (const char **arg_dirs)
-{
-#ifdef VAXC		/* just don't ask ... */
-  stat_t stbuf;
-#else
-  struct stat stbuf;
-#endif
-  const char **dirs;
-  const char **cpp;
-  unsigned int idx;
-
-  /* Compute the number of pointers we need in the table.  */
-  idx = sizeof (default_include_directories) / sizeof (const char *);
-  if (arg_dirs)
-    for (cpp = arg_dirs; *cpp != 0; ++cpp)
-      ++idx;
-
-#ifdef  __MSDOS__
-  /* Add one for $DJDIR.  */
-  ++idx;
-#endif
-
-  dirs = xmalloc (idx * sizeof (const char *));
-
-  idx = 0;
-  max_incl_len = 0;
-
-  /* First consider any dirs specified with -I switches.
-     Ignore any that don't exist.  Remember the maximum string length.  */
-
-  if (arg_dirs)
-    while (*arg_dirs != 0)
-      {
-	const char *dir = *(arg_dirs++);
-        char *expanded = 0;
-        int e;
-
-	if (dir[0] == '~')
-	  {
-	    expanded = tilde_expand (dir);
-	    if (expanded != 0)
-	      dir = expanded;
-	  }
-
-        EINTRLOOP (e, stat (dir, &stbuf));
-	if (e == 0 && S_ISDIR (stbuf.st_mode))
+	}
+
+      /* For each matched element, add it to the list.  */
+      while (i-- > 0)
+#ifndef NO_ARCHIVES
+        if (memname != 0)
           {
-            unsigned int len = strlen (dir);
-            /* If dir name is written with trailing slashes, discard them.  */
-            while (len > 1 && dir[len - 1] == '/')
-              --len;
-            if (len > max_incl_len)
-              max_incl_len = len;
-            dirs[idx++] = strcache_add_len (dir, len);
+            /* Try to glob on MEMNAME within the archive.  */
+            struct nameseq *found = ar_glob (nlist[i], memname, size);
+            if (! found)
+              /* No matches.  Use MEMNAME as-is.  */
+              NEWELT (concat (5, prefix, nlist[i], "(", memname, ")"));
+            else
+              {
+                /* We got a chain of items.  Attach them.  */
+                (*newp)->next = found;
+
+                /* Find and set the new end.  Massage names if necessary.  */
+                while (1)
+                  {
+                    if (! cachep)
+                      found->name = xstrdup (concat (2, prefix, name));
+                    else if (prefix)
+                      found->name = strcache_add (concat (2, prefix, name));
+
+                    if (found->next == 0)
+                      break;
+
+                    found = found->next;
+                  }
+                newp = &found->next;
+              }
           }
-
-	if (expanded)
-	  free (expanded);
-      }
-
-  /* Now add the standard default dirs at the end.  */
-
-#ifdef  __MSDOS__
-  {
-    /* The environment variable $DJDIR holds the root of the DJGPP directory
-       tree; add ${DJDIR}/include.  */
-    struct variable *djdir = lookup_variable ("DJDIR", 5);
-
-    if (djdir)
-      {
-        unsigned int len = strlen (djdir->value) + 8;
-	char *defdir = alloca (len + 1);
-
-	strcat (strcpy (defdir, djdir->value), "/include");
-	dirs[idx++] = strcache_add (defdir);
-
-        if (len > max_incl_len)
-          max_incl_len = len;
-      }
-  }
-#endif
-
-  for (cpp = default_include_directories; *cpp != 0; ++cpp)
-    {
-      int e;
-
-      EINTRLOOP (e, stat (*cpp, &stbuf));
-      if (e == 0 && S_ISDIR (stbuf.st_mode))
-        {
-          unsigned int len = strlen (*cpp);
-          /* If dir name is written with trailing slashes, discard them.  */
-          while (len > 1 && (*cpp)[len - 1] == '/')
-            --len;
-          if (len > max_incl_len)
-            max_incl_len = len;
-          dirs[idx++] = strcache_add_len (*cpp, len);
-        }
-    }
-
-  dirs[idx] = 0;
-
-  /* Now add each dir to the .INCLUDE_DIRS variable.  */
-
-  for (cpp = dirs; *cpp != 0; ++cpp)
-    do_variable_definition (NILF, ".INCLUDE_DIRS", *cpp,
-                            o_default, f_append, 0);
-
-  include_directories = dirs;
-}
-
-
-/* Expand ~ or ~USER at the beginning of NAME.
-   Return a newly malloc'd string or 0.  */
-
-char *
-tilde_expand (const char *name)
-{
-#ifndef VMS
-  if (name[1] == '/' || name[1] == '\0')
-    {
-      extern char *getenv ();
-      char *home_dir;
-      int is_variable;
-
-      {
-	/* Turn off --warn-undefined-variables while we expand HOME.  */
-	int save = warn_undefined_variables_flag;
-	warn_undefined_variables_flag = 0;
-
-	home_dir = allocated_variable_expand ("$(HOME)");
-
-	warn_undefined_variables_flag = save;
-      }
-
-      is_variable = home_dir[0] != '\0';
-      if (!is_variable)
-	{
-	  free (home_dir);
-	  home_dir = getenv ("HOME");
-	}
-# if !defined(_AMIGA) && !defined(WINDOWS32)
-      if (home_dir == 0 || home_dir[0] == '\0')
-	{
-	  extern char *getlogin ();
-	  char *logname = getlogin ();
-	  home_dir = 0;
-	  if (logname != 0)
-	    {
-	      struct passwd *p = getpwnam (logname);
-	      if (p != 0)
-		home_dir = p->pw_dir;
-	    }
-	}
-# endif /* !AMIGA && !WINDOWS32 */
-      if (home_dir != 0)
-	{
-	  char *new = xstrdup (concat (home_dir, "", name + 1));
-	  if (is_variable)
-	    free (home_dir);
-	  return new;
-	}
-    }
-# if !defined(_AMIGA) && !defined(WINDOWS32)
-  else
-    {
-      struct passwd *pwent;
-      char *userend = strchr (name + 1, '/');
-      if (userend != 0)
-	*userend = '\0';
-      pwent = getpwnam (name + 1);
-      if (pwent != 0)
-	{
-	  if (userend == 0)
-	    return xstrdup (pwent->pw_dir);
-	  else
-	    return xstrdup (concat (pwent->pw_dir, "/", userend + 1));
-	}
-      else if (userend != 0)
-	*userend = '/';
-    }
-# endif /* !AMIGA && !WINDOWS32 */
-#endif /* !VMS */
-  return 0;
-}
-
-/* Given a chain of struct nameseq's describing a sequence of filenames,
-   in reverse of the intended order, return a new chain describing the
-   result of globbing the filenames.  The new chain is in forward order.
-   The links of the old chain are freed or used in the new chain.
-   Likewise for the names in the old chain.
-
-   SIZE is how big to construct chain elements.
-   This is useful if we want them actually to be other structures
-   that have room for additional info.  */
-
-struct nameseq *
-multi_glob (struct nameseq *chain, unsigned int size)
-{
-  void dir_setup_glob (glob_t *);
-  struct nameseq *new = 0;
-  struct nameseq *old;
-  struct nameseq *nexto;
-  glob_t gl;
-
-  dir_setup_glob (&gl);
-
-  for (old = chain; old != 0; old = nexto)
-    {
-      const char *gname;
-#ifndef NO_ARCHIVES
-      char *arname = 0;
-      char *memname = 0;
-#endif
-      nexto = old->next;
-      gname = old->name;
-
-      if (gname[0] == '~')
-	{
-	  char *newname = tilde_expand (old->name);
-	  if (newname != 0)
-            gname = newname;
-	}
-
-#ifndef NO_ARCHIVES
-      if (ar_name (gname))
-	{
-	  /* OLD->name is an archive member reference.  Replace it with the
-	     archive file name, and save the member name in MEMNAME.  We will
-	     glob on the archive name and then reattach MEMNAME later.  */
-	  ar_parse_name (gname, &arname, &memname);
-	  gname = arname;
-	}
+        else
 #endif /* !NO_ARCHIVES */
-
-      switch (glob (gname, GLOB_NOCHECK|GLOB_ALTDIRFUNC, NULL, &gl))
-	{
-	case 0:			/* Success.  */
-	  {
-	    int i = gl.gl_pathc;
-	    while (i-- > 0)
-	      {
-#ifndef NO_ARCHIVES
-		if (memname != 0)
-		  {
-		    /* Try to glob on MEMNAME within the archive.  */
-		    struct nameseq *found
-		      = ar_glob (gl.gl_pathv[i], memname, size);
-		    if (! found)
-		      {
-			/* No matches.  Use MEMNAME as-is.  */
-			unsigned int alen = strlen (gl.gl_pathv[i]);
-			unsigned int mlen = strlen (memname);
-                        char *name;
-			struct nameseq *elt = xmalloc (size);
-                        memset (elt, '\0', size);
-
-                        name = alloca (alen + 1 + mlen + 2);
-			memcpy (name, gl.gl_pathv[i], alen);
-			name[alen] = '(';
-			memcpy (name+alen+1, memname, mlen);
-			name[alen + 1 + mlen] = ')';
-			name[alen + 1 + mlen + 1] = '\0';
-                        elt->name = strcache_add (name);
-			elt->next = new;
-			new = elt;
-		      }
-		    else
-		      {
-			/* Find the end of the FOUND chain.  */
-			struct nameseq *f = found;
-			while (f->next != 0)
-			  f = f->next;
-
-			/* Attach the chain being built to the end of the FOUND
-			   chain, and make FOUND the new NEW chain.  */
-			f->next = new;
-			new = found;
-		      }
-		  }
-		else
-#endif /* !NO_ARCHIVES */
-		  {
-		    struct nameseq *elt = xmalloc (size);
-                    memset (elt, '\0', size);
-		    elt->name = strcache_add (gl.gl_pathv[i]);
-		    elt->next = new;
-		    new = elt;
-		  }
-	      }
-	    globfree (&gl);
-	    free (old);
-	    break;
-	  }
-
-	case GLOB_NOSPACE:
-	  fatal (NILF, _("virtual memory exhausted"));
-	  break;
-
-	default:
-	  old->next = new;
-	  new = old;
-	  break;
-	}
+          NEWELT (concat (2, prefix, nlist[i]));
+
+      globfree (&gl);
 
 #ifndef NO_ARCHIVES
@@ -3204,6 +3196,10 @@
         free (arname);
 #endif
+
+      if (tildep)
+        free (tildep);
     }
 
+  *stringp = p;
   return new;
 }
Index: /vendor/gnumake/current/readme.vms
===================================================================
--- /vendor/gnumake/current/readme.vms	(revision 2595)
+++ /vendor/gnumake/current/readme.vms	(revision 2596)
@@ -1,15 +1,12 @@
 This is the VMS version of GNU Make, updated by Hartmut Becker
 
-Changes are based on GNU make 3.80. Latest changes are for OpenVMS/I64
-and new VMS CRTLs.
-
-This version was tested on OpenVMS/I64 V8.2 (field test) with hp C
-X7.1-024 OpenVMS/Alpha V7.3-2 with Compaq C V6.5-001 and OpenVMS/VAX 7.1
-with Compaq C V6.2-003 There are still some warning and informational
-message issued by the compilers.
+Changes are based on GNU make 3.82.
+
+This version was built and tested on OpenVMS V7.3 (VAX), V7.3-2 (Alpha) and
+V8.3-1H1 (I64).
 
 Build instructions
 Make a 1st version
-       $ @makefile.com
+       $ @makefile.com  ! ignore any compiler and/or linker warning
        $ rena make.exe 1st-make.exe
 Use the 1st version to generate a 2nd version
@@ -21,5 +18,88 @@
        $ mc sys$disk:[]2nd-make
 
-Changes:
+Changes (3.81.90)
+
+Michael Gehre (at VISTEC-SEMI dot COM) supplied a fix for a problem with
+timestamps of object modules in OLBs. The timestamps were not correctly
+adjusted to GMT based time, if the local VMS time was using a daylight saving
+algorithm and if daylight saving was switched off.
+
+John Eisenbraun (at HP dot COM) supplied fixes and and an enhancement to append
+output redirection in action lines.
+
+Rework of ctrl+c and ctrl+y handling.
+
+Fix a problem with cached strings, which showed on case-insensitive file
+systems.
+
+Build fixes for const-ified code in VMS specific sources.
+
+Build notes:
+- Try to avoid HP C V7.2-001, which has an incompatible change
+how __STDC__ is defined. This results at least in compile time warnings.
+
+- On V8.3-1H1, if you press Ctrl+C you may see a traceback, starting with
+%SYSTEM-F-CONTROLC, operation completed under CTRL/C
+%TRACE-F-TRACEBACK, symbolic stack dump follows
+image     module    routine               line      rel PC           abs PC
+
+DECC$SHR  C$SIGNAL  gsignal              27991 0000000000001180
+FFFFFFFF84AB2DA0
+DECC$SHR  C$SIGNAL  raise                28048 0000000000001280
+FFFFFFFF84AB2EA0
+DECC$SHR  C$SIGPENDING  decc$$deliver_signals
+                                         12475 0000000000000890
+FFFFFFFF84C13690
+...
+This looks like an incompatibility to the Alpha and VAX behavior, so it looks
+like a problem in I64 VMS version(s).
+
+- There is no clean build on VAX. In the environment I tested, I had to use GNU
+make's alloca which produced a couple of compile time warnings. It seems too
+much effort to work on a clean build on VAX.
+
+A note on appending the redirected output. With this change, a simple mechanism
+is implemented to make ">>" work in action lines. In VMS there is no simple
+feature like ">>" to have DCL command or program output redirected and appended
+to a file. GNU make for VMS already implements the redirection of output. If
+such a redirection is detected, an ">" on the action line, GNU make creates a
+DCL command procedure to execute the action and to redirect its output. Based
+on that, now ">>" is also recognized and a similar but different command
+procedure is created to implement the append. The main idea here is to create a
+temporary file which collects the output and which is appended to the wanted
+output file. Then the temporary file is deleted. This is all done in the
+command procedure to keep changes in make small and simple. This obviously has
+some limitations but it seems good enough compared with the current ">"
+implementation. (And in my opinion, redirection is not really what GNU make has
+to do.) With this approach, it may happen that the temporary file is not yet
+appended and is left in SYS$SCRATCH. The temporary file names look like
+"CMDxxxxx.". Any time the created command procedure can not complete, this
+happens. Pressing Ctrl+Y to abort make is one case. In case of Ctrl+Y the
+associated command procedure is left in SYS$SCRATCH as well. Its name is
+CMDxxxxx.COM.
+
+Change in the Ctrl+Y handling
+
+Ctrl+Y was: The CtrlY handler called $forcex for the current child.
+
+Ctrl+Y changed: The CtrlY handler uses $delprc to delete all children. This way
+also actions with DCL commands will be stopped. As before Ctrl+Y then sends
+SIGQUIT to itself, which is handled in common code.
+
+Change in deleteing temporary command files
+
+Temporary command files were deleted in the main line, after returning from the
+vms child termination handler. If Ctrl+C was pressed, the handler is called but
+did not return to main line.
+
+Now, temporary command files are deleted in the vms child termination
+handler. That deletes the them even if a Ctrl+C was pressed.
+
+The behavior of pressing Ctrl+C is not changed. It still has only an effect,
+after the current action is terminated. If that doesn't happen or takes too
+long, Ctrl+Y should be used instead.
+
+
+Changes (3.80)
 
 . In default.c define variable ARCH as IA64 for VMS on Itanium systems.
@@ -300,5 +380,5 @@
 -------------------------------------------------------------------------------
 Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
-2006, 2007 Free Software Foundation, Inc.
+2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
 This file is part of GNU Make.
 
Index: /vendor/gnumake/current/remake.c
===================================================================
--- /vendor/gnumake/current/remake.c	(revision 2595)
+++ /vendor/gnumake/current/remake.c	(revision 2596)
@@ -1,6 +1,6 @@
 /* Basic dependency engine for GNU Make.
 Copyright (C) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
-1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software
-Foundation, Inc.
+1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
+2010 Free Software Foundation, Inc.
 This file is part of GNU Make.
 
@@ -84,5 +84,4 @@
 {
   int t = touch_flag, q = question_flag, n = just_print_flag;
-  unsigned int j = job_slots;
   int status = -1;
 
@@ -136,4 +135,7 @@
 	      unsigned int ocommands_started;
 	      int x;
+
+              file->dontcare = g->dontcare;
+
 	      check_renamed (file);
 	      if (rebuilding_makefiles)
@@ -209,4 +211,6 @@
 	      any_not_updated |= !file->updated;
 
+              file->dontcare = 0;
+
 	      if (stop)
 		break;
@@ -265,5 +269,4 @@
       question_flag = q;
       just_print_flag = n;
-      job_slots = j;
     }
 
@@ -298,6 +301,12 @@
   if (f->considered == considered)
     {
-      DBF (DB_VERBOSE, _("Pruning file `%s'.\n"));
-      return f->command_state == cs_finished ? f->update_status : 0;
+      /* Check for the case where a target has been tried and failed but
+         the diagnostics hasn't been issued. If we need the diagnostics
+         then we will have to continue. */
+      if (!(f->updated && f->update_status > 0 && !f->dontcare && f->no_diag))
+        {
+          DBF (DB_VERBOSE, _("Pruning file `%s'.\n"));
+          return f->command_state == cs_finished ? f->update_status : 0;
+        }
     }
 
@@ -316,5 +325,5 @@
       /* If we got an error, don't bother with double_colon etc.  */
       if (status != 0 && !keep_going_flag)
-	return status;
+        return status;
 
       if (f->command_state == cs_running
@@ -348,5 +357,5 @@
 
 static void
-complain (const struct file *file)
+complain (struct file *file)
 {
   const char *msg_noparent
@@ -355,16 +364,39 @@
     = _("%sNo rule to make target `%s', needed by `%s'%s");
 
-  if (!keep_going_flag)
-    {
+  /* If this file has no_diag set then it means we tried to update it
+     before in the dontcare mode and failed. The target that actually
+     failed is not necessarily this file but could be one of its direct
+     or indirect dependencies. So traverse this file's dependencies and
+     find the one that actually caused the failure. */
+
+  struct dep *d;
+
+  for (d = file->deps; d != 0; d = d->next)
+    {
+      if (d->file->updated && d->file->update_status > 0 && file->no_diag)
+        {
+          complain (d->file);
+          break;
+        }
+    }
+
+  if (d == 0)
+    {
+      /* Didn't find any dependencies to complain about. */
+      if (!keep_going_flag)
+        {
+          if (file->parent == 0)
+            fatal (NILF, msg_noparent, "", file->name, "");
+
+          fatal (NILF, msg_parent, "", file->name, file->parent->name, "");
+        }
+
       if (file->parent == 0)
-        fatal (NILF, msg_noparent, "", file->name, "");
-
-      fatal (NILF, msg_parent, "", file->name, file->parent->name, "");
-    }
-
-  if (file->parent == 0)
-    error (NILF, msg_noparent, "*** ", file->name, ".");
-  else
-    error (NILF, msg_parent, "*** ", file->name, file->parent->name, ".");
+        error (NILF, msg_noparent, "*** ", file->name, ".");
+      else
+        error (NILF, msg_parent, "*** ", file->name, file->parent->name, ".");
+
+      file->no_diag = 0;
+    }
 }
 
@@ -374,8 +406,10 @@
 update_file_1 (struct file *file, unsigned int depth)
 {
-  register FILE_TIMESTAMP this_mtime;
+  FILE_TIMESTAMP this_mtime;
   int noexist, must_make, deps_changed;
   int dep_status = 0;
-  register struct dep *d, *lastd;
+  struct file *ofile;
+  struct dep *d, *ad;
+  struct dep amake;
   int running = 0;
 
@@ -389,13 +423,10 @@
                _("Recently tried and failed to update file `%s'.\n"));
 
-          /* If the file we tried to make is marked dontcare then no message
+          /* If the file we tried to make is marked no_diag then no message
              was printed about it when it failed during the makefile rebuild.
              If we're trying to build it again in the normal rebuild, print a
              message now.  */
-          if (file->dontcare && !rebuilding_makefiles)
-            {
-              file->dontcare = 0;
+          if (file->no_diag && !file->dontcare)
               complain (file);
-            }
 
 	  return file->update_status;
@@ -421,8 +452,16 @@
     }
 
+  /* Determine whether the diagnostics will be issued should this update
+     fail. */
+  file->no_diag = file->dontcare;
+
   ++depth;
 
   /* Notice recursive update of the same file.  */
   start_updating (file);
+
+  /* We might change file if we find a different one via vpath;
+     remember this one to turn off updating.  */
+  ofile = file;
 
   /* Looking at the file's modtime beforehand allows the possibility
@@ -468,81 +507,92 @@
     }
 
-  /* Update all non-intermediate files we depend on, if necessary,
-     and see whether any of them is more recent than this file.  */
-
-  lastd = 0;
-  d = file->deps;
-  while (d != 0)
-    {
-      FILE_TIMESTAMP mtime;
-      int maybe_make;
-      int dontcare = 0;
-
-      check_renamed (d->file);
-
-      mtime = file_mtime (d->file);
-      check_renamed (d->file);
-
-      if (is_updating (d->file))
-	{
-	  error (NILF, _("Circular %s <- %s dependency dropped."),
-		 file->name, d->file->name);
-	  /* We cannot free D here because our the caller will still have
-	     a reference to it when we were called recursively via
-	     check_dep below.  */
-	  if (lastd == 0)
-	    file->deps = d->next;
-	  else
-	    lastd->next = d->next;
-	  d = d->next;
-	  continue;
-	}
-
-      d->file->parent = file;
-      maybe_make = must_make;
-
-      /* Inherit dontcare flag from our parent. */
-      if (rebuilding_makefiles)
+  /* Update all non-intermediate files we depend on, if necessary, and see
+     whether any of them is more recent than this file.  We need to walk our
+     deps, AND the deps of any also_make targets to ensure everything happens
+     in the correct order.  */
+
+  amake.file = file;
+  amake.next = file->also_make;
+  ad = &amake;
+  while (ad)
+    {
+      struct dep *lastd = 0;
+
+      /* Find the deps we're scanning */
+      d = ad->file->deps;
+      ad = ad->next;
+
+      while (d)
         {
-          dontcare = d->file->dontcare;
-          d->file->dontcare = file->dontcare;
+          FILE_TIMESTAMP mtime;
+          int maybe_make;
+          int dontcare = 0;
+
+          check_renamed (d->file);
+
+          mtime = file_mtime (d->file);
+          check_renamed (d->file);
+
+          if (is_updating (d->file))
+            {
+              error (NILF, _("Circular %s <- %s dependency dropped."),
+                     file->name, d->file->name);
+              /* We cannot free D here because our the caller will still have
+                 a reference to it when we were called recursively via
+                 check_dep below.  */
+              if (lastd == 0)
+                file->deps = d->next;
+              else
+                lastd->next = d->next;
+              d = d->next;
+              continue;
+            }
+
+          d->file->parent = file;
+          maybe_make = must_make;
+
+          /* Inherit dontcare flag from our parent. */
+          if (rebuilding_makefiles)
+            {
+              dontcare = d->file->dontcare;
+              d->file->dontcare = file->dontcare;
+            }
+
+          dep_status |= check_dep (d->file, depth, this_mtime, &maybe_make);
+
+          /* Restore original dontcare flag. */
+          if (rebuilding_makefiles)
+            d->file->dontcare = dontcare;
+
+          if (! d->ignore_mtime)
+            must_make = maybe_make;
+
+          check_renamed (d->file);
+
+          {
+            register struct file *f = d->file;
+            if (f->double_colon)
+              f = f->double_colon;
+            do
+              {
+                running |= (f->command_state == cs_running
+                            || f->command_state == cs_deps_running);
+                f = f->prev;
+              }
+            while (f != 0);
+          }
+
+          if (dep_status != 0 && !keep_going_flag)
+            break;
+
+          if (!running)
+            /* The prereq is considered changed if the timestamp has changed while
+               it was built, OR it doesn't exist.  */
+            d->changed = ((file_mtime (d->file) != mtime)
+                          || (mtime == NONEXISTENT_MTIME));
+
+          lastd = d;
+          d = d->next;
         }
-
-
-      dep_status |= check_dep (d->file, depth, this_mtime, &maybe_make);
-
-      /* Restore original dontcare flag. */
-      if (rebuilding_makefiles)
-        d->file->dontcare = dontcare;
-
-      if (! d->ignore_mtime)
-        must_make = maybe_make;
-
-      check_renamed (d->file);
-
-      {
-	register struct file *f = d->file;
-	if (f->double_colon)
-	  f = f->double_colon;
-	do
-	  {
-	    running |= (f->command_state == cs_running
-			|| f->command_state == cs_deps_running);
-	    f = f->prev;
-	  }
-	while (f != 0);
-      }
-
-      if (dep_status != 0 && !keep_going_flag)
-	break;
-
-      if (!running)
-        /* The prereq is considered changed if the timestamp has changed while
-           it was built, OR it doesn't exist.  */
-	d->changed = ((file_mtime (d->file) != mtime)
-                      || (mtime == NONEXISTENT_MTIME));
-
-      lastd = d;
-      d = d->next;
     }
 
@@ -600,4 +650,5 @@
 
   finish_updating (file);
+  finish_updating (ofile);
 
   DBF (DB_VERBOSE, _("Finished prerequisites of target file `%s'.\n"));
@@ -859,5 +910,5 @@
          would have been updated. */
 
-      if (question_flag || just_print_flag || touch_flag)
+      if ((question_flag || just_print_flag || touch_flag) && file->cmds)
         {
           for (i = file->cmds->ncommand_lines; i > 0; --i)
@@ -937,4 +988,5 @@
            FILE_TIMESTAMP this_mtime, int *must_make_ptr)
 {
+  struct file *ofile;
   struct dep *d;
   int dep_status = 0;
@@ -942,4 +994,8 @@
   ++depth;
   start_updating (file);
+
+  /* We might change file if we find a different one via vpath;
+     remember this one to turn off updating.  */
+  ofile = file;
 
   if (file->phony || !file->intermediate)
@@ -987,13 +1043,14 @@
              necessary, and see whether any of them is more recent than the
              file on whose behalf we are checking.  */
-	  struct dep *lastd;
+	  struct dep *ld;
           int deps_running = 0;
 
-          /* Reset this target's state so that we check it fresh.  It could be
-             that it's already been checked as part of an order-only
+          /* If this target is not running, set it's state so that we check it
+             fresh.  It could be it was checked as part of an order-only
              prerequisite and so wasn't rebuilt then, but should be now.  */
-          set_command_state (file, cs_not_started);
-
-	  lastd = 0;
+          if (file->command_state != cs_running)
+            set_command_state (file, cs_not_started);
+
+	  ld = 0;
 	  d = file->deps;
 	  while (d != 0)
@@ -1005,5 +1062,5 @@
 		  error (NILF, _("Circular %s <- %s dependency dropped."),
 			 file->name, d->file->name);
-		  if (lastd == 0)
+		  if (ld == 0)
 		    {
 		      file->deps = d->next;
@@ -1013,7 +1070,7 @@
 		  else
 		    {
-		      lastd->next = d->next;
+		      ld->next = d->next;
                       free_dep (d);
-		      d = lastd->next;
+		      d = ld->next;
 		    }
 		  continue;
@@ -1034,5 +1091,5 @@
 		deps_running = 1;
 
-	      lastd = d;
+	      ld = d;
 	      d = d->next;
 	    }
@@ -1047,4 +1104,6 @@
 
   finish_updating (file);
+  finish_updating (ofile);
+
   return dep_status;
 }
@@ -1230,5 +1289,5 @@
 	{
 	  /* If name_mtime failed, search VPATH.  */
-	  const char *name = vpath_search (file->name, &mtime);
+	  const char *name = vpath_search (file->name, &mtime, NULL, NULL);
 	  if (name
 	      /* Last resort, is it a library (-lxxx)?  */
@@ -1473,7 +1532,6 @@
     };
 
-  static char *libpatterns = NULL;
-
-  const char *libname = lib+2;	/* Name without the '-l'.  */
+  const char *file = 0;
+  char *libpatterns;
   FILE_TIMESTAMP mtime;
 
@@ -1482,19 +1540,21 @@
   const char *p2;
   unsigned int len;
+  unsigned int liblen;
+
+  /* Information about the earliest (in the vpath sequence) match.  */
+  unsigned int best_vpath, best_path;
+  unsigned int std_dirs = 0;
 
   char **dp;
 
-  /* If we don't have libpatterns, get it.  */
-  if (!libpatterns)
-    {
-      int save = warn_undefined_variables_flag;
-      warn_undefined_variables_flag = 0;
-
-      libpatterns = xstrdup (variable_expand ("$(strip $(.LIBPATTERNS))"));
-
-      warn_undefined_variables_flag = save;
-    }
-
-  /* Loop through all the patterns in .LIBPATTERNS, and search on each one.  */
+  libpatterns = xstrdup (variable_expand ("$(.LIBPATTERNS)"));
+
+  /* Skip the '-l'.  */
+  lib += 2;
+  liblen = strlen (lib);
+
+  /* Loop through all the patterns in .LIBPATTERNS, and search on each one.
+     To implement the linker-compatible behavior we have to search through
+     all entries in .LIBPATTERNS and choose the "earliest" one.  */
   p2 = libpatterns;
   while ((p = find_next_token (&p2, &len)) != 0)
@@ -1505,5 +1565,5 @@
       char *libbuf = variable_expand ("");
 
-      /* Expand the pattern using LIBNAME as a replacement.  */
+      /* Expand the pattern using LIB as a replacement.  */
       {
 	char c = p[len];
@@ -1514,14 +1574,11 @@
 	if (!p3)
 	  {
-	    /* Give a warning if there is no pattern, then remove the
-	       pattern so it's ignored next time.  */
+	    /* Give a warning if there is no pattern.  */
 	    error (NILF, _(".LIBPATTERNS element `%s' is not a pattern"), p);
-	    for (; len; --len, ++p)
-	      *p = ' ';
-	    *p = c;
+            p[len] = c;
 	    continue;
 	  }
 	p4 = variable_buffer_output (libbuf, p, p3-p);
-	p4 = variable_buffer_output (p4, libname, strlen (libname));
+	p4 = variable_buffer_output (p4, lib, liblen);
 	p4 = variable_buffer_output (p4, p3+1, len - (p3-p));
 	p[len] = c;
@@ -1534,5 +1591,7 @@
 	  if (mtime_ptr != 0)
 	    *mtime_ptr = mtime;
-	  return strcache_add (libbuf);
+	  file = strcache_add (libbuf);
+          /* This by definition will have the best index, so stop now.  */
+          break;
 	}
 
@@ -1540,7 +1599,22 @@
 
       {
-        const char *file = vpath_search (libbuf, mtime_ptr);
-        if (file)
-          return file;
+        unsigned int vpath_index, path_index;
+        const char* f = vpath_search (libbuf, mtime_ptr ? &mtime : NULL,
+                                      &vpath_index, &path_index);
+        if (f)
+          {
+            /* If we have a better match, record it.  */
+            if (file == 0 ||
+                vpath_index < best_vpath ||
+                (vpath_index == best_vpath && path_index < best_path))
+              {
+                file = f;
+                best_vpath = vpath_index;
+                best_path = path_index;
+
+                if (mtime_ptr != 0)
+                  *mtime_ptr = mtime;
+              }
+          }
       }
 
@@ -1548,33 +1622,49 @@
 
       if (!buflen)
-	{
-	  for (dp = dirs; *dp != 0; ++dp)
-	    {
-	      int l = strlen (*dp);
-	      if (l > libdir_maxlen)
-		libdir_maxlen = l;
-	    }
-	  buflen = strlen (libbuf);
-	  buf = xmalloc(libdir_maxlen + buflen + 2);
-	}
+        {
+          for (dp = dirs; *dp != 0; ++dp)
+            {
+              int l = strlen (*dp);
+              if (l > libdir_maxlen)
+                libdir_maxlen = l;
+              std_dirs++;
+            }
+          buflen = strlen (libbuf);
+          buf = xmalloc(libdir_maxlen + buflen + 2);
+        }
       else if (buflen < strlen (libbuf))
-	{
-	  buflen = strlen (libbuf);
-	  buf = xrealloc (buf, libdir_maxlen + buflen + 2);
-	}
-
-      for (dp = dirs; *dp != 0; ++dp)
-	{
-	  sprintf (buf, "%s/%s", *dp, libbuf);
-	  mtime = name_mtime (buf);
-	  if (mtime != NONEXISTENT_MTIME)
-	    {
-	      if (mtime_ptr != 0)
-		*mtime_ptr = mtime;
-	      return strcache_add (buf);
-	    }
-	}
-    }
-
-  return 0;
+        {
+          buflen = strlen (libbuf);
+          buf = xrealloc (buf, libdir_maxlen + buflen + 2);
+        }
+
+      {
+        /* Use the last std_dirs index for standard directories. This
+           was it will always be greater than the VPATH index.  */
+        unsigned int vpath_index = ~((unsigned int)0) - std_dirs;
+
+        for (dp = dirs; *dp != 0; ++dp)
+	  {
+            sprintf (buf, "%s/%s", *dp, libbuf);
+            mtime = name_mtime (buf);
+            if (mtime != NONEXISTENT_MTIME)
+	      {
+                if (file == 0 || vpath_index < best_vpath)
+                  {
+                    file = strcache_add (buf);
+                    best_vpath = vpath_index;
+
+                    if (mtime_ptr != 0)
+                      *mtime_ptr = mtime;
+                  }
+              }
+
+            vpath_index++;
+          }
+      }
+
+    }
+
+  free (libpatterns);
+  return file;
 }
Index: /vendor/gnumake/current/remote-cstms.c
===================================================================
--- /vendor/gnumake/current/remote-cstms.c	(revision 2595)
+++ /vendor/gnumake/current/remote-cstms.c	(revision 2596)
@@ -5,6 +5,6 @@
 
 Copyright (C) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
-1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software
-Foundation, Inc.
+1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
+2010 Free Software Foundation, Inc.
 This file is part of GNU Make.
 
Index: /vendor/gnumake/current/remote-stub.c
===================================================================
--- /vendor/gnumake/current/remote-stub.c	(revision 2595)
+++ /vendor/gnumake/current/remote-stub.c	(revision 2596)
@@ -1,6 +1,6 @@
 /* Template for the remote job exportation interface to GNU Make.
 Copyright (C) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
-1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software
-Foundation, Inc.
+1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
+2010 Free Software Foundation, Inc.
 This file is part of GNU Make.
 
Index: /vendor/gnumake/current/rule.c
===================================================================
--- /vendor/gnumake/current/rule.c	(revision 2595)
+++ /vendor/gnumake/current/rule.c	(revision 2596)
@@ -1,6 +1,6 @@
 /* Pattern and suffix rule internals for GNU Make.
 Copyright (C) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
-1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software
-Foundation, Inc.
+1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
+2010 Free Software Foundation, Inc.
 This file is part of GNU Make.
 
@@ -97,17 +97,18 @@
       for (dep = rule->deps; dep != 0; dep = dep->next)
 	{
-	  unsigned int len = strlen (dep->name);
+          const char *dname = dep_name (dep);
+          unsigned int len = strlen (dname);
 
 #ifdef VMS
-	  const char *p = strrchr (dep->name, ']');
+          const char *p = strrchr (dname, ']');
           const char *p2;
           if (p == 0)
-            p = strrchr (dep->name, ':');
-          p2 = p != 0 ? strchr (dep->name, '%') : 0;
+            p = strrchr (dname, ':');
+          p2 = p != 0 ? strchr (dname, '%') : 0;
 #else
-	  const char *p = strrchr (dep->name, '/');
-	  const char *p2 = p != 0 ? strchr (dep->name, '%') : 0;
+          const char *p = strrchr (dname, '/');
+          const char *p2 = p != 0 ? strchr (dname, '%') : 0;
 #endif
-	  ndeps++;
+          ndeps++;
 
 	  if (len > max_pattern_dep_length)
@@ -118,13 +119,13 @@
 	      /* There is a slash before the % in the dep name.
 		 Extract the directory name.  */
-	      if (p == dep->name)
+	      if (p == dname)
 		++p;
-	      if (p - dep->name > namelen)
+	      if (p - dname > namelen)
 		{
-		  namelen = p - dep->name;
+		  namelen = p - dname;
 		  name = xrealloc (name, namelen + 1);
 		}
-	      memcpy (name, dep->name, p - dep->name);
-	      name[p - dep->name] = '\0';
+	      memcpy (name, dname, p - dname);
+	      name[p - dname] = '\0';
 
 	      /* In the deps of an implicit rule the `changed' flag
@@ -380,7 +381,5 @@
 
   ptr = p->dep;
-  r->deps = (struct dep *) multi_glob (parse_file_seq (&ptr, '\0',
-                                                       sizeof (struct dep), 1),
-				       sizeof (struct dep));
+  r->deps = PARSE_FILE_SEQ (&ptr, struct dep, '\0', NULL, 0);
 
   if (new_pattern_rule (r, 0))
@@ -406,16 +405,10 @@
 {
   struct rule *next = rule->next;
-  struct dep *dep;
-
-  dep = rule->deps;
-  while (dep)
-    {
-      struct dep *t = dep->next;
-      free_dep (dep);
-      dep = t;
-    }
-
-  free (rule->targets);
-  free (rule->suffixes);
+
+  free_dep_chain (rule->deps);
+
+  /* MSVC erroneously warns without a cast here.  */
+  free ((void *)rule->targets);
+  free ((void *)rule->suffixes);
   free (rule->lens);
 
@@ -488,5 +481,4 @@
 {
   unsigned int i;
-  struct dep *d;
 
   for (i = 0; i < r->num; ++i)
@@ -498,7 +490,5 @@
     putchar (':');
 
-  for (d = r->deps; d != 0; d = d->next)
-    printf (" %s", dep_name (d));
-  putchar ('\n');
+  print_prereqs (r->deps);
 
   if (r->cmds != 0)
@@ -547,5 +537,5 @@
          makefiles and thus count_implicit_rule_limits wasn't called yet.  */
       if (num_pattern_rules != 0)
-        fatal (NILF, _("BUG: num_pattern_rules wrong!  %u != %u"),
+        fatal (NILF, _("BUG: num_pattern_rules is wrong!  %u != %u"),
                num_pattern_rules, rules);
     }
Index: /vendor/gnumake/current/rule.h
===================================================================
--- /vendor/gnumake/current/rule.h	(revision 2595)
+++ /vendor/gnumake/current/rule.h	(revision 2596)
@@ -1,6 +1,6 @@
 /* Definitions for using pattern rules in GNU Make.
 Copyright (C) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
-1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software
-Foundation, Inc.
+1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
+2010 Free Software Foundation, Inc.
 This file is part of GNU Make.
 
Index: /vendor/gnumake/current/signame.c
===================================================================
--- /vendor/gnumake/current/signame.c	(revision 2595)
+++ /vendor/gnumake/current/signame.c	(revision 2596)
@@ -1,5 +1,6 @@
 /* Convert between signal names and numbers.
 Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
+2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software
+Foundation, Inc.
 This file is part of GNU Make.
 
@@ -229,5 +230,5 @@
 
 char *
-strsignal (int signal)
+strsignal (int sig)
 {
   static char buf[] = "Signal 12345678901234567890";
@@ -246,8 +247,8 @@
 #endif
 
-  if (signal > 0 || signal < NSIG)
-    return (char *) sys_siglist[signal];
-
-  sprintf (buf, "Signal %d", signal);
+  if (sig > 0 || sig < NSIG)
+    return (char *) sys_siglist[sig];
+
+  sprintf (buf, "Signal %d", sig);
   return buf;
 }
Index: /vendor/gnumake/current/strcache.c
===================================================================
--- /vendor/gnumake/current/strcache.c	(revision 2595)
+++ /vendor/gnumake/current/strcache.c	(revision 2596)
@@ -1,4 +1,4 @@
 /* Constant string caching for GNU Make.
-Copyright (C) 2006, 2007 Free Software Foundation, Inc.
+Copyright (C) 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
 This file is part of GNU Make.
 
Index: /vendor/gnumake/current/subproc.bat
===================================================================
--- /vendor/gnumake/current/subproc.bat	(revision 2595)
+++ /vendor/gnumake/current/subproc.bat	(revision 2596)
@@ -1,5 +1,5 @@
 @echo off
 rem Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
-rem 2005, 2006, 2007 Free Software Foundation, Inc.
+rem 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
 rem This file is part of GNU Make.
 rem
Index: /vendor/gnumake/current/tests/ChangeLog
===================================================================
--- /vendor/gnumake/current/tests/ChangeLog	(revision 2595)
+++ /vendor/gnumake/current/tests/ChangeLog	(revision 2596)
@@ -1,2 +1,186 @@
+2010-07-28  Paul Smith  <psmith@gnu.org>
+
+	* scripts/targets/POSIX: Compatibility issues with Solaris (and
+	Tru64?); "false" returns different exit codes, and set -x shows
+	output with extra whitespace.  Run the commands by hand first to
+	find out what the real shell would do, then compare what make does.
+	* scripts/variables/SHELL: Ditto.
+
+2010-07-12  Paul Smith  <psmith@gnu.org>
+
+	* test_driver.pl: Add a new $perl_name containing the path to Perl.
+	* run_make_tests.pl (run_make_test): Replace the special string
+	#PERL# in a makefile etc. with the path the Perl executable so
+	makefiles can use it.
+
+	* scripts/targets/ONESHELL: Add a new set of regression tests for
+	the .ONESHELL feature.
+
+2010-07-06  Paul Smith  <psmith@gnu.org>
+
+	* scripts/variables/SHELL: Test the new .SHELLFLAGS variable.
+
+	* scripts/targets/POSIX: New file.  Test the .POSIX special target.
+	Verify that enabling .POSIX changes the shell flags to set -e.
+
+2010-07-01  Paul Smith  <psmith@gnu.org>
+
+	* scripts/features/recursion: Add a space to separate command-line
+	args.  Fixes Savannah bug #29968.
+
+2009-11-12  Boris Kolpackov  <boris@codesynthesis.com>
+
+	* scripts/features/vpath3: Test for the new library search
+	behavior.
+
+2009-10-06  Boris Kolpackov  <boris@codesynthesis.com>
+
+	* scripts/features/se_explicit: Enable the test for now fixed
+	Savannah bug 25780.
+
+2009-10-06  Boris Kolpackov  <boris@codesynthesis.com>
+
+	* scripts/variables/undefine: Tests for the new undefine feature.
+
+2009-10-03  Paul Smith  <psmith@gnu.org>
+
+	* scripts/features/parallelism: Test for open Savannah bug #26846.
+
+	* scripts/variables/MAKE: Rewrite for new run_make_test() format.
+
+	* scripts/variables/MAKEFLAGS: Created.
+	Add test for Savannah bug #2216 (still open).
+
+	* scripts/features/include: Test for Savannah bug #102 (still open).
+
+2009-09-30  Boris Kolpackov  <boris@codesynthesis.com>
+
+	* scripts/features/include: Add diagnostics issuing tests for
+	cases where targets have been updated and failed with the
+	dontcare flag. Savannah bugs #15110, #25493, #12686, #17740.
+
+2009-09-28  Paul Smith  <psmith@gnu.org>
+
+	* scripts/functions/shell: Add regression test for Savannah bug
+	#20513 (still open).
+
+	* scripts/features/se_explicit: Add regression tests for Savannah
+	bug #25780 (still open).
+
+	* run_make_tests.pl (valid_option): Add a new flag, -all([-_]?tests)?
+	that runs tests we know will fail.  This allows us to add
+	regression tests to the test suite for bugs that haven't been
+	fixed yet.
+
+2009-09-28  Boris Kolpackov  <boris@codesynthesis.com>
+
+	* scripts/features/patspecific_vars: Add a test for the shortest
+	stem first order.
+
+	* scripts/features/patternrules: Add a test for the shortest stem
+	first order.
+
+2009-09-24  Paul Smith  <psmith@gnu.org>
+
+	* scripts/features/se_implicit: Add a test for order-only
+	secondary expansion prerequisites.
+
+2009-09-23  Paul Smith  <psmith@gnu.org>
+
+	* scripts/features/patternrules: Test that we can remove pattern
+	rules, both single and multiple prerequisites.  Savannah bug #18622.
+
+	* scripts/features/echoing: Rework for run_make_test().
+
+2009-06-14  Paul Smith  <psmith@gnu.org>
+
+	* scripts/features/vpath: Verify we don't get bogus circular
+	dependency warnings if we choose a different file via vpath during
+	update.  Savannah bug #13529.
+
+2009-06-13  Paul Smith  <psmith@gnu.org>
+
+	* scripts/variables/MAKEFILES: Verify that MAKEFILES included
+	files (and files included by them) don't set the default goal.
+	Savannah bug #13401.
+
+	* scripts/functions/wildcard: Test that wildcards with
+	non-existent glob matchers return empty.
+
+2009-06-09  Paul Smith  <psmith@gnu.org>
+
+	* scripts/options/dash-B: Test the $? works correctly with -B.
+	Savannah bug #17825.
+
+	* scripts/features/patternrules: Test that dependencies of
+	"also_make" targets are created properly.  Savannah bug #19108.
+
+	* test_driver.pl (compare_output): Create a "run" file for failed
+	tests containing the command that was run.
+	(get_runfile): New function.
+
+	* run_make_tests.pl (valid_option): Enhanced support for valgrind:
+	allow memcheck and massif tools.
+
+	* scripts/features/patternrules: Have to comment out a line in the
+	first test due to backing out a change that broke the implicit
+	rule search algorithm.  Savannah bug #17752.
+	* scripts/misc/general4: Remove a test that is redundant with
+	patternrules.
+
+	* scripts/features/parallelism: Add a test for re-exec with
+	jobserver master override.  Savannah bug #18124.
+
+2009-06-08  Paul Smith  <psmith@gnu.org>
+
+	* scripts/features/targetvars: Add a test for continued target
+	vars after a semicolon.  Savannah bug #17521.
+
+2009-06-07  Paul Smith  <psmith@gnu.org>
+
+	* scripts/features/se_explicit: Make sure we catch defining
+	prereqs during snap_deps().  Savannah bug #24622.
+
+	* scripts/variables/automatic: Check prereq ordering when the
+	target with the recipe has no prereqs.  Savannah bug #21198.
+
+	* scripts/variables/LIBPATTERNS: Add a new set of test for
+	$(.LIBPATTERNS) (previously untested!)
+
+2009-06-04  Paul Smith  <psmith@gnu.org>
+
+	* scripts/variables/SHELL: The export target-specific SHELL test
+	has an incorrect known-good-value.
+
+	* scripts/misc/general4: Check for whitespace (ffeed, vtab, etc.)
+
+	* scripts/features/se_explicit: Add tests for Savannah bug #24588.
+
+2009-05-31  Paul Smith  <psmith@gnu.org>
+
+	* scripts/variables/DEFAULT_GOAL: Add tests for Savannah bug #25697.
+
+	* scripts/features/targetvars: Add tests of overrides for Savannah
+	bug #26207.
+	* scripts/features/patspecific_vars: Ditto.
+
+	* scripts/features/patternrules: Add a test for Savannah bug #26593.
+
+2009-05-30  Paul Smith  <psmith@gnu.org>
+
+	* scripts/variables/flavors: Update with new variable flavor tests.
+	* scripts/variables/define: Create a new set of tests for
+	define/endef and move those aspects of the flavors suite here.
+
+2009-05-25  Paul Smith  <psmith@gnu.org>
+
+	* scripts/features/targetvars: Ditto.
+
+	* scripts/features/export: Test new variable parsing abilities.
+
+2009-02-23  Ramon Garcia  <ramon.garcia.f@gmail.com>
+
+	* scripts/variables/private: Create a new suite of tests for 'private'.
+
 2007-11-04  Paul Smith  <psmith@gnu.org>
 
@@ -881,5 +1065,5 @@
 
 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
-2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
+2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
 This file is part of GNU Make.
 
Index: /vendor/gnumake/current/tests/NEWS
===================================================================
--- /vendor/gnumake/current/tests/NEWS	(revision 2595)
+++ /vendor/gnumake/current/tests/NEWS	(revision 2596)
@@ -165,5 +165,5 @@
 -------------------------------------------------------------------------------
 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
-2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
+2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
 This file is part of GNU Make.
 
Index: /vendor/gnumake/current/tests/README
===================================================================
--- /vendor/gnumake/current/tests/README	(revision 2595)
+++ /vendor/gnumake/current/tests/README	(revision 2596)
@@ -9,5 +9,5 @@
  -----------------------------------------------------------------------------
  Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
- 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
+ 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
  This file is part of GNU Make.
 
Index: /vendor/gnumake/current/tests/mkshadow
===================================================================
--- /vendor/gnumake/current/tests/mkshadow	(revision 2595)
+++ /vendor/gnumake/current/tests/mkshadow	(revision 2596)
@@ -5,5 +5,6 @@
 #
 # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
-# 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
+# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software
+# Foundation, Inc.
 # This file is part of GNU Make.
 #
Index: /vendor/gnumake/current/tests/run_make_tests.pl
===================================================================
--- /vendor/gnumake/current/tests/run_make_tests.pl	(revision 2595)
+++ /vendor/gnumake/current/tests/run_make_tests.pl	(revision 2596)
@@ -13,5 +13,6 @@
 
 # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
-# 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
+# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software
+# Foundation, Inc.
 # This file is part of GNU Make.
 #
@@ -29,7 +30,14 @@
 # this program.  If not, see <http://www.gnu.org/licenses/>.
 
+
 $valgrind = 0;              # invoke make with valgrind
-$valgrind_args = '--num-callers=15 --tool=memcheck --leak-check=full';
+$valgrind_args = '';
+$memcheck_args = '--num-callers=15 --tool=memcheck --leak-check=full';
+$massif_args = '--num-callers=15 --tool=massif --alloc-fn=xmalloc --alloc-fn=xcalloc --alloc-fn=xrealloc --alloc-fn=xstrdup --alloc-fn=xstrndup';
 $pure_log = undef;
+
+$command_string = '';
+
+$all_tests = 0;
 
 require "test_driver.pl";
@@ -44,18 +52,28 @@
    local($option) = @_;
 
-   if ($option =~ /^-make([-_]?path)?$/)
-   {
-      $make_path = shift @argv;
-      if (!-f $make_path)
-      {
-	 print "$option $make_path: Not found.\n";
-	 exit 0;
-      }
-      return 1;
-   }
-
-   if ($option =~ /^-valgrind$/i) {
-     $valgrind = 1;
-     return 1;
+   if ($option =~ /^-make([-_]?path)?$/i) {
+       $make_path = shift @argv;
+       if (!-f $make_path) {
+           print "$option $make_path: Not found.\n";
+           exit 0;
+       }
+       return 1;
+   }
+
+   if ($option =~ /^-all([-_]?tests)?$/i) {
+       $all_tests = 1;
+       return 1;
+   }
+
+   if ($option =~ /^-(valgrind|memcheck)$/i) {
+       $valgrind = 1;
+       $valgrind_args = $memcheck_args;
+       return 1;
+   }
+
+   if ($option =~ /^-massif$/i) {
+       $valgrind = 1;
+       $valgrind_args = $massif_args;
+       return 1;
    }
 
@@ -106,4 +124,5 @@
     $makestring =~ s/#MAKEPATH#/$mkpath/g;
     $makestring =~ s/#MAKE#/$make_name/g;
+    $makestring =~ s/#PERL#/$perl_name/g;
     $makestring =~ s/#PWD#/$pwd/g;
 
@@ -120,4 +139,5 @@
   $answer =~ s/#MAKEPATH#/$mkpath/g;
   $answer =~ s/#MAKE#/$make_name/g;
+  $answer =~ s/#PERL#/$perl_name/g;
   $answer =~ s/#PWD#/$pwd/g;
 
@@ -149,4 +169,6 @@
   }
 
+  $command_string = "$command\n";
+
   if ($valgrind) {
     print VALGRIND "\n\nExecuting: $command\n";
@@ -156,5 +178,8 @@
   {
       my $old_timeout = $test_timeout;
-      $test_timeout = $timeout if $timeout;
+      $timeout and $test_timeout = $timeout;
+
+      # If valgrind is enabled, turn off the timeout check
+      $valgrind and $test_timeout = 0;
 
       $code = &run_command_with_output($logname,$command);
@@ -184,8 +209,10 @@
     print "Error running $make_path (expected $expected_code; got $code): $command\n";
     $test_passed = 0;
+    $runf = &get_runfile;
+    &create_file (&get_runfile, $command_string);
     # If it's a SIGINT, stop here
     if ($code & 127) {
       print STDERR "\nCaught signal ".($code & 127)."!\n";
-      exit($code);
+      ($code & 127) == 2 and exit($code);
     }
     return 0;
@@ -196,5 +223,5 @@
   }
 
-  1;
+  return 1;
 }
 
@@ -202,11 +229,20 @@
 {
    &print_standard_usage ("run_make_tests",
-                          "[-make_path make_pathname] [-valgrind]",);
+                          "[-make_path make_pathname] [-memcheck] [-massif]",);
 }
 
 sub print_help
 {
-   &print_standard_help ("-make_path",
-          "\tYou may specify the pathname of the copy of make to run.");
+   &print_standard_help (
+        "-make_path",
+        "\tYou may specify the pathname of the copy of make to run.",
+        "-valgrind",
+        "-memcheck",
+        "\tRun the test suite under valgrind's memcheck tool.",
+        "\tChange the default valgrind args with the VALGRIND_ARGS env var.",
+        "-massif",
+        "\tRun the test suite under valgrind's massif toool.",
+        "\tChange the default valgrind args with the VALGRIND_ARGS env var."
+       );
 }
 
@@ -335,9 +371,10 @@
 
    if ($valgrind) {
+     my $args = $valgrind_args;
      open(VALGRIND, "> valgrind.out")
        || die "Cannot open valgrind.out: $!\n";
      #  -q --leak-check=yes
-     exists $ENV{VALGRIND_ARGS} and $valgrind_args = $ENV{VALGRIND_ARGS};
-     $make_path = "valgrind --log-fd=".fileno(VALGRIND)." $valgrind_args $make_path";
+     exists $ENV{VALGRIND_ARGS} and $args = $ENV{VALGRIND_ARGS};
+     $make_path = "valgrind --log-fd=".fileno(VALGRIND)." $args $make_path";
      # F_SETFD is 2
      fcntl(VALGRIND, 2, 0) or die "fcntl(setfd) failed: $!\n";
Index: /vendor/gnumake/current/tests/scripts/features/echoing
===================================================================
--- /vendor/gnumake/current/tests/scripts/features/echoing	(revision 2595)
+++ /vendor/gnumake/current/tests/scripts/features/echoing	(revision 2596)
@@ -1,69 +1,57 @@
-$description = "The following test creates a makefile to test command \n"
-              ."echoing.  It tests that when a command line starts with \n"
-              ."a '\@', the echoing of that line is suppressed.  It also \n"
-              ."tests the -n option which tells make to ONLY echo the  \n"
-              ."commands and no execution happens.  In this case, even \n"
-              ."the commands with '\@' are printed. Lastly, it tests the \n"
-              ."-s flag which tells make to prevent all echoing, as if \n"
-              ."all commands started with a '\@'.";
+#                                                                    -*-perl-*-
+$description = "The following test creates a makefile to test command
+echoing.  It tests that when a command line starts with
+a '\@', the echoing of that line is suppressed.  It also
+tests the -n option which tells make to ONLY echo the
+commands and no execution happens.  In this case, even
+the commands with '\@' are printed. Lastly, it tests the
+-s flag which tells make to prevent all echoing, as if
+all commands started with a '\@'.";
 
-$details = "This test is similar to the 'clean' test except that a '\@' has\n"
-          ."been placed in front of the delete command line.  Four tests \n"
-          ."are run here.  First, make is run normally and the first echo\n"
-          ."command should be executed.  In this case there is no '\@' so \n"
-          ."we should expect make to display the command AND display the \n"
-          ."echoed message.  Secondly, make is run with the clean target, \n"
-          ."but since there is a '\@' at the beginning of the command, we\n"
-          ."expect no output; just the deletion of a file which we check \n"
-          ."for.  Third, we give the clean target again except this time\n"
-          ."we give make the -n option.  We now expect the command to be \n"
-          ."displayed but not to be executed.  In this case we need only \n"
-          ."to check the output since an error message would be displayed\n"
-          ."if it actually tried to run the delete command again and the \n"
-          ."file didn't exist. Lastly, we run the first test again with \n"
-          ."the -s option and check that make did not echo the echo \n"
-          ."command before printing the message.";
+$details = "This test is similar to the 'clean' test except that a '\@' has
+been placed in front of the delete command line.  Four tests
+are run here.  First, make is run normally and the first echo
+command should be executed.  In this case there is no '\@' so
+we should expect make to display the command AND display the
+echoed message.  Secondly, make is run with the clean target,
+but since there is a '\@' at the beginning of the command, we
+expect no output; just the deletion of a file which we check
+for.  Third, we give the clean target again except this time
+we give make the -n option.  We now expect the command to be
+displayed but not to be executed.  In this case we need only
+to check the output since an error message would be displayed
+if it actually tried to run the delete command again and the
+file didn't exist. Lastly, we run the first test again with
+the -s option and check that make did not echo the echo
+command before printing the message.\n";
 
 $example = "EXAMPLE_FILE";
 
-open(MAKEFILE,"> $makefile");
-
-# The Contents of the MAKEFILE ...
-
-print MAKEFILE "all: \n";
-print MAKEFILE "\techo This makefile did not clean the dir... good\n";
-print MAKEFILE "clean: \n";
-print MAKEFILE "\t\@$delete_command $example\n";
-
-# END of Contents of MAKEFILE
-
-close(MAKEFILE);
-
-&touch($example);
+touch($example);
 
 # TEST #1
 # -------
 
-&run_make_with_options($makefile,"",&get_logfile,0);
-$answer = "echo This makefile did not clean the dir... good\n"
-         ."This makefile did not clean the dir... good\n";
-&compare_output($answer,&get_logfile(1));
-
+run_make_test("
+all:
+\techo This makefile did not clean the dir... good
+clean:
+\t\@$delete_command $example\n",
+              '', 'echo This makefile did not clean the dir... good
+This makefile did not clean the dir... good');
 
 # TEST #2
 # -------
 
-&run_make_with_options($makefile,"clean",&get_logfile,0);
+run_make_test(undef, 'clean', '');
 if (-f $example) {
   $test_passed = 0;
+  unlink($example);
 }
-&compare_output('',&get_logfile(1));
 
 # TEST #3
 # -------
 
-&run_make_with_options($makefile,"-n clean",&get_logfile,0);
-$answer = "$delete_command $example\n";
-&compare_output($answer,&get_logfile(1));
+run_make_test(undef, '-n clean', "$delete_command $example\n");
 
 
@@ -71,17 +59,6 @@
 # -------
 
-&run_make_with_options($makefile,"-s",&get_logfile,0);
-$answer = "This makefile did not clean the dir... good\n";
-&compare_output($answer,&get_logfile(1));
+run_make_test(undef, '-s', "This makefile did not clean the dir... good\n");
 
 
 1;
-
-
-
-
-
-
-
-
-
Index: /vendor/gnumake/current/tests/scripts/features/export
===================================================================
--- /vendor/gnumake/current/tests/scripts/features/export	(revision 2595)
+++ /vendor/gnumake/current/tests/scripts/features/export	(revision 2596)
@@ -7,10 +7,5 @@
 # about that here.
 
-open(MAKEFILE,"> $makefile");
-
-# The Contents of the MAKEFILE ...
-
-print MAKEFILE <<'EOMAKE';
-
+&run_make_test('
 FOO = foo
 BAR = bar
@@ -41,17 +36,7 @@
 	@echo "FOO=$(FOO) BAR=$(BAR) BAZ=$(BAZ) BOZ=$(BOZ) BITZ=$(BITZ) BOTZ=$(BOTZ)"
 	@echo "FOO=$$FOO BAR=$$BAR BAZ=$$BAZ BOZ=$$BOZ BITZ=$$BITZ BOTZ=$$BOTZ"
-
-EOMAKE
-
-close(MAKEFILE);
-
-# TEST 0: basics
-
-&run_make_with_options($makefile,"",&get_logfile,0);
-
-$answer = "FOO=foo BAR=bar BAZ=baz BOZ=boz BITZ=bitz BOTZ=botz
-FOO= BAR= BAZ=baz BOZ=boz BITZ=bitz BOTZ=\n";
-
-&compare_output($answer,&get_logfile(1));
+',
+           '', "FOO=foo BAR=bar BAZ=baz BOZ=boz BITZ=bitz BOTZ=botz
+FOO= BAR= BAZ=baz BOZ=boz BITZ=bitz BOTZ=\n");
 
 # TEST 1: make sure vars inherited from the parent are exported
@@ -59,56 +44,34 @@
 $extraENV{FOO} = 1;
 
-&run_make_with_options($makefile,"",&get_logfile,0);
-
-$answer = "FOO=foo BAR=bar BAZ=baz BOZ=boz BITZ=bitz BOTZ=botz
-FOO=foo BAR= BAZ=baz BOZ=boz BITZ=bitz BOTZ=\n";
-
-&compare_output($answer,&get_logfile(1));
+&run_make_test(undef, '', "FOO=foo BAR=bar BAZ=baz BOZ=boz BITZ=bitz BOTZ=botz
+FOO=foo BAR= BAZ=baz BOZ=boz BITZ=bitz BOTZ=\n");
 
 # TEST 2: global export.  Explicit unexport takes precedence.
 
-&run_make_with_options($makefile,"EXPORT_ALL=1",&get_logfile,0);
-
-$answer = "FOO=foo BAR=bar BAZ=baz BOZ=boz BITZ=bitz BOTZ=botz
-FOO=foo BAR=bar BAZ=baz BOZ=boz BITZ=bitz BOTZ=\n";
-
-&compare_output($answer,&get_logfile(1));
+run_make_test(undef, "EXPORT_ALL=1" ,
+              "FOO=foo BAR=bar BAZ=baz BOZ=boz BITZ=bitz BOTZ=botz
+FOO=foo BAR=bar BAZ=baz BOZ=boz BITZ=bitz BOTZ=\n");
 
 # TEST 3: global unexport.  Explicit export takes precedence.
 
-&run_make_with_options($makefile,"UNEXPORT_ALL=1",&get_logfile,0);
-
-$answer = "FOO=foo BAR=bar BAZ=baz BOZ=boz BITZ=bitz BOTZ=botz
-FOO= BAR= BAZ=baz BOZ=boz BITZ=bitz BOTZ=\n";
-
-&compare_output($answer,&get_logfile(1));
+&run_make_test(undef, "UNEXPORT_ALL=1",
+               "FOO=foo BAR=bar BAZ=baz BOZ=boz BITZ=bitz BOTZ=botz
+FOO= BAR= BAZ=baz BOZ=boz BITZ=bitz BOTZ=\n");
 
 # TEST 4: both: in the above makefile the unexport comes last so that rules.
 
-&run_make_with_options($makefile,"EXPORT_ALL=1 UNEXPORT_ALL=1",&get_logfile,0);
-
-$answer = "FOO=foo BAR=bar BAZ=baz BOZ=boz BITZ=bitz BOTZ=botz
-FOO= BAR= BAZ=baz BOZ=boz BITZ=bitz BOTZ=\n";
-
-&compare_output($answer,&get_logfile(1));
+&run_make_test(undef, "EXPORT_ALL=1 UNEXPORT_ALL=1",
+               "FOO=foo BAR=bar BAZ=baz BOZ=boz BITZ=bitz BOTZ=botz
+FOO= BAR= BAZ=baz BOZ=boz BITZ=bitz BOTZ=\n");
 
 # TEST 5: test the pseudo target.
 
-&run_make_with_options($makefile,"EXPORT_ALL_PSEUDO=1",&get_logfile,0);
-
-$answer = "FOO=foo BAR=bar BAZ=baz BOZ=boz BITZ=bitz BOTZ=botz
-FOO=foo BAR=bar BAZ=baz BOZ=boz BITZ=bitz BOTZ=\n";
-
-&compare_output($answer,&get_logfile(1));
-
+&run_make_test(undef, "EXPORT_ALL_PSEUDO=1",
+               "FOO=foo BAR=bar BAZ=baz BOZ=boz BITZ=bitz BOTZ=botz
+FOO=foo BAR=bar BAZ=baz BOZ=boz BITZ=bitz BOTZ=\n");
 
 # TEST 6: Test the expansion of variables inside export
 
-$makefile2 = &get_tmpfile;
-
-open(MAKEFILE, "> $makefile2");
-
-print MAKEFILE <<'EOF';
-
+&run_make_test('
 foo = f-ok
 bar = b-ok
@@ -126,22 +89,10 @@
 	@echo foo=$(foo) bar=$(bar)
 	@echo foo=$$foo bar=$$bar
-
-EOF
-
-close(MAKEFILE);
-
-&run_make_with_options($makefile2,"",&get_logfile,0);
-$answer = "foo=f-ok bar=b-ok\nfoo=f-ok bar=b-ok\n";
-&compare_output($answer,&get_logfile(1));
-
+',
+             "", "foo=f-ok bar=b-ok\nfoo=f-ok bar=b-ok\n");
 
 # TEST 7: Test the expansion of variables inside unexport
 
-$makefile3 = &get_tmpfile;
-
-open(MAKEFILE, "> $makefile3");
-
-print MAKEFILE <<'EOF';
-
+&run_make_test('
 foo = f-ok
 bar = b-ok
@@ -161,22 +112,10 @@
 	@echo foo=$(foo) bar=$(bar)
 	@echo foo=$$foo bar=$$bar
-
-EOF
-
-close(MAKEFILE);
-
-&run_make_with_options($makefile3,"",&get_logfile,0);
-$answer = "foo=f-ok bar=b-ok\nfoo= bar=\n";
-&compare_output($answer,&get_logfile(1));
-
+',
+              '', "foo=f-ok bar=b-ok\nfoo= bar=\n");
 
 # TEST 7: Test exporting multiple variables on the same line
 
-$makefile4 = &get_tmpfile;
-
-open(MAKEFILE, "> $makefile4");
-
-print MAKEFILE <<'EOF';
-
+&run_make_test('
 A = a
 B = b
@@ -197,21 +136,12 @@
 
 all: ; @echo A=$$A B=$$B C=$$C D=$$D E=$$E F=$$F G=$$G H=$$H I=$$I J=$$J
-EOF
-
-close(MAKEFILE);
-
-&run_make_with_options($makefile4,"",&get_logfile,0);
-$answer = "A=a B=b C=c D=d E=e F=f G=g H=h I=i J=j\n";
-&compare_output($answer,&get_logfile(1));
-
+',
+               '', "A=a B=b C=c D=d E=e F=f G=g H=h I=i J=j\n");
 
 # TEST 8: Test unexporting multiple variables on the same line
 
-$makefile5 = &get_tmpfile;
+@extraENV{qw(A B C D E F G H I J)} = qw(1 2 3 4 5 6 7 8 9 10);
 
-open(MAKEFILE, "> $makefile5");
-
-print MAKEFILE <<'EOF';
-
+&run_make_test('
 A = a
 B = b
@@ -232,14 +162,24 @@
 
 all: ; @echo A=$$A B=$$B C=$$C D=$$D E=$$E F=$$F G=$$G H=$$H I=$$I J=$$J
-EOF
+',
+               '', "A= B= C= D= E= F= G= H= I= J=\n");
 
-close(MAKEFILE);
+# TEST 9: Check setting a variable named "export"
 
-@extraENV{qw(A B C D E F G H I J)} = qw(1 2 3 4 5 6 7 8 9 10);
+&run_make_test('
+export = 123
+export export
+export export = 456
+a: ; @echo "\$$(export)=$(export) / \$$export=$$export"
+',
+               '', "\$(export)=456 / \$export=456\n");
 
-&run_make_with_options($makefile5,"",&get_logfile,0);
-$answer = "A= B= C= D= E= F= G= H= I= J=\n";
-&compare_output($answer,&get_logfile(1));
+# TEST 9: Check "export" as a target
 
+&run_make_test('
+a: export
+export: ; @echo "$@"
+',
+               '', "export\n");
 
 # This tells the test driver that the perl test script executed properly.
Index: /vendor/gnumake/current/tests/scripts/features/include
===================================================================
--- /vendor/gnumake/current/tests/scripts/features/include	(revision 2595)
+++ /vendor/gnumake/current/tests/scripts/features/include	(revision 2596)
@@ -91,6 +91,4 @@
 ', '', '');
 
-1;
-
 
 # Make sure that we don't die when the command fails but we dontcare.
@@ -118,3 +116,64 @@
 sinclude', '', '');
 
+
+# Test that the diagnostics is issued even if the target has been
+# tried before with the dontcare flag (direct dependency case).
+#
+run_make_test('
+-include foo
+
+all: bar
+
+foo: baz
+bar: baz
+',
+'',
+"#MAKE#: *** No rule to make target `baz', needed by `bar'.  Stop.\n",
+512);
+
+# Test that the diagnostics is issued even if the target has been
+# tried before with the dontcare flag (indirect dependency case).
+#
+run_make_test('
+-include foo
+
+all: bar
+
+foo: baz
+bar: baz
+baz: end
+',
+'',
+"#MAKE#: *** No rule to make target `end', needed by `baz'.  Stop.\n",
+512);
+
+# Test that the diagnostics is issued even if the target has been
+# tried before with the dontcare flag (include/-include case).
+#
+run_make_test('
+include bar
+-include foo
+
+all:
+
+foo: baz
+bar: baz
+baz: end
+',
+'',
+"#MAKEFILE#:2: bar: No such file or directory
+#MAKE#: *** No rule to make target `end', needed by `baz'.  Stop.\n",
+512);
+
+if ($all_tests) {
+    # Test that include of a rebuild-able file doesn't show a warning
+    # Savannah bug #102
+    run_make_test(q!
+include foo
+foo: ; @echo foo = bar > $@
+!,
+                  '', "#MAKE#: `foo' is up to date.\n");
+    rmfiles('foo');
+}
+
 1;
Index: /vendor/gnumake/current/tests/scripts/features/override
===================================================================
--- /vendor/gnumake/current/tests/scripts/features/override	(revision 2595)
+++ /vendor/gnumake/current/tests/scripts/features/override	(revision 2596)
@@ -1,34 +1,45 @@
-$description = "The following test creates a makefile to ...";
+#                                                                    -*-perl-*-
+
+$description = "Test the override directive on variable assignments.";
 
 $details = "";
 
-open(MAKEFILE,"> $makefile");
+# TEST 0: Basic override
 
-# The Contents of the MAKEFILE ...
+run_make_test('
+X = start
+override recur = $(X)
+override simple := $(X)
+X = end
+all: ; @echo "$(recur) $(simple)"
+',
+              'recur=I simple=J', "end start\n");
 
-print MAKEFILE "override define foo\n"
-              ."\@echo First comes the definition.\n"
-              ."\@echo Then comes the override.\n"
-              ."endef\n"
-              ."all: \n"
-              ."\t\$(foo)\n";
+# TEST 1: Override with append
 
-# END of Contents of MAKEFILE
+run_make_test('
+X += X1
+override X += X2
+override Y += Y1
+Y += Y2
+all: ; @echo "$(X) $(Y)"
+',
+              '', "X1 X2 Y1\n");
 
-close(MAKEFILE);
+# TEST 2: Override with append to the command line
 
-&run_make_with_options($makefile,"foo=Hello",&get_logfile);
+run_make_test(undef, 'X=C Y=C', "C X2 C Y1\n");
 
-# Create the answer to what should be produced by this Makefile
-$answer = "First comes the definition.\n"
-         ."Then comes the override.\n";
+# Test override of define/endef
 
-&compare_output($answer,&get_logfile(1));
+run_make_test('
+override define foo
+@echo First comes the definition.
+@echo Then comes the override.
+endef
+all: ; $(foo)
+',
+              'foo=Hello', "First comes the definition.\nThen comes the override.\n");
+
 
 1;
-
-
-
-
-
-
Index: /vendor/gnumake/current/tests/scripts/features/parallelism
===================================================================
--- /vendor/gnumake/current/tests/scripts/features/parallelism	(revision 2595)
+++ /vendor/gnumake/current/tests/scripts/features/parallelism	(revision 2596)
@@ -44,5 +44,5 @@
               "ONE.inc\nTHREE.inc\nTWO.inc\nONE\nTHREE\nTWO\nsuccess\n");
 
-unlink('1.inc', '2.inc');
+rmfiles(qw(1.inc 2.inc));
 
 
@@ -63,5 +63,5 @@
               "ONE.inc\nTHREE.inc\nTWO.inc\nONE\nTHREE\nTWO\nsuccess\n");
 
-unlink('1.inc', '2.inc');
+rmfiles(qw(1.inc 2.inc));
 
 # Grant Taylor reports a problem where tokens can be lost (not written back
@@ -139,6 +139,81 @@
 .PHONY: phony
 phony: ; : phony', '-rR -j', ': phony');
-unlink('target');
-
+rmfiles('target');
+
+# TEST #10: Don't put --jobserver-fds into a re-exec'd MAKEFLAGS.
+# We can't test this directly because there's no way a makefile can
+# show the value of MAKEFLAGS we were re-exec'd with.  We can intuit it
+# by looking for "disabling jobserver mode" warnings; we should only
+# get one from the original invocation and none from the re-exec.
+# See Savannah bug #18124
+
+run_make_test(q!
+-include inc.mk
+recur:
+#	@echo 'MAKEFLAGS = $(MAKEFLAGS)'
+	@rm -f inc.mk
+	@$(MAKE) -j2 -f #MAKEFILE# all
+all:
+#	@echo 'MAKEFLAGS = $(MAKEFLAGS)'
+	@echo $@
+inc.mk:
+#	@echo 'MAKEFLAGS = $(MAKEFLAGS)'
+	@echo 'FOO = bar' > $@
+!,
+              '--no-print-directory -j2', "#MAKE#[1]: warning: -jN forced in submake: disabling jobserver mode.\nall\n");
+
+rmfiles('inc.mk');
+
+if ($all_tests) {
+    # Implicit files aren't properly recreated during parallel builds
+    # Savannah bug #26864
+
+    # The first run works fine
+    run_make_test(q!
+%.bar: %.x foo.y ; cat $^ > $@
+%.x: ; touch $@
+foo.y: foo.y.in ; cp $< $@
+foo.y.in: ; touch $@
+!,
+                  '-j2 main.bar',
+                  "touch foo.y.in
+touch main.x
+cp foo.y.in foo.y
+cat main.x foo.y > main.bar
+rm main.x");
+
+    # Now we touch the .in file and make sure it still works
+    touch('foo.y.in');
+
+    run_make_test(undef, '-j2 main.bar', "cp foo.y.in foo.y
+touch main.x
+cat main.x foo.y > main.bar
+rm main.x");
+
+    # Clean up
+    rmfiles(qw(foo.y foo.y.in main.bar));
+}
+
+if ($all_tests) {
+    # Jobserver FD handling is messed up in some way.
+    # Savannah bug #28189
+    # It doesn't look like that bug anymore but this is the code it runs
+
+    run_make_test(q!
+ifdef EXTRA
+vpath %.dst /
+xxx.dst: ; true
+yyy.dst: ; true
+endif
+
+M := $(MAKE)
+xx: ; $M --no-print-directory -j2 -f $(MAKEFILE_LIST) xxx.dst yyy.dst EXTRA=1
+!,
+                  '-j2',
+                  '#MAKE#[1]: warning: -jN forced in submake: disabling jobserver mode.
+true
+true
+');
+}
 
 # Make sure that all jobserver FDs are closed if we need to re-exec the
@@ -169,5 +244,5 @@
 #               'bar');
 
-# unlink('dependfile', 'output');
+# rmfiles(qw(dependfile output));
 
 
@@ -175,5 +250,5 @@
 # run_make_test(undef, '-j2 recurse INCL=false', 'bar');
 
-# unlink('dependfile', 'output');
+# rmfiles(qw(dependfile output));
 
 1;
Index: /vendor/gnumake/current/tests/scripts/features/patspecific_vars
===================================================================
--- /vendor/gnumake/current/tests/scripts/features/patspecific_vars	(revision 2595)
+++ /vendor/gnumake/current/tests/scripts/features/patspecific_vars	(revision 2596)
@@ -121,4 +121,28 @@
 pattrn: global: new $t pattern: good $t inherit: good $t;');
 
+# TEST #8: override in pattern-specific variables
+
+run_make_test('
+a%: override FOO += f1
+a%: FOO += f2
+ab: ; @echo "$(FOO)"
+',
+              '', "f1\n");
+
+run_make_test(undef, 'FOO=C', "C f1\n");
+
+# TEST #9: Test shortest stem selection in pattern-specific variables.
+
+run_make_test('
+%-mt.x: x := two
+%.x: x := one
+
+all: foo.x foo-mt.x
+
+foo.x: ;@echo $x
+foo-mt.x: ;@echo $x
+',
+'',
+"one\ntwo");
 
 1;
Index: /vendor/gnumake/current/tests/scripts/features/patternrules
===================================================================
--- /vendor/gnumake/current/tests/scripts/features/patternrules	(revision 2595)
+++ /vendor/gnumake/current/tests/scripts/features/patternrules	(revision 2596)
@@ -16,9 +16,11 @@
 #
 
-run_make_test('
+run_make_test(q!
 .PHONY: all
 
 all: case.1 case.2 case.3
-a: void
+
+# We can't have this, due to "Implicit Rule Search Algorithm" step 5c
+#xxx: void
 
 # 1 - existing file
@@ -42,7 +44,5 @@
 
 3.implicit-phony:
-',
-'',
-'');
+!, '', '');
 
 # TEST #1: make sure files that are built via implicit rules are marked
@@ -146,4 +146,79 @@
 unlink('foo.in', 'foo.h', 'foo.c', 'foo.o');
 
+# TEST #5: make sure both prefix and suffix patterns work with multiple
+#          target patterns (Savannah bug #26593).
+#
+run_make_test('
+all: foo.s1 foo.s2 p1.foo p2.foo
+
+p1.% p2.%: %.orig
+	@echo $@
+%.s1 %.s2: %.orig
+	@echo $@
+
+.PHONY: foo.orig
+',
+              '', "foo.s1\np1.foo\n");
+
+# TEST 6: Make sure that non-target files are still eligible to be created
+# as part of implicit rule chaining.  Savannah bug #17752.
+
+run_make_test(q!
+BIN = xyz
+COPY = $(BIN).cp
+SRC = $(BIN).c
+allbroken: $(COPY) $(BIN) ; @echo ok
+$(SRC): ; @echo 'main(){}' > $@
+%.cp: % ; @cp $< $@
+% : %.c ; @cp $< $@
+clean: ; @rm -rf $(SRC) $(COPY) $(BIN)
+!,
+              '', "ok\n");
+
+unlink(qw(xyz xyz.cp xyz.c));
+
+# TEST 7: Make sure that all prereqs of all "also_make" targets get created
+# before any of the things that depend on any of them.  Savannah bug #19108.
+
+run_make_test(q!
+final: x ; @echo $@
+x: x.t1 x.t2 ; @echo $@
+x.t2: dep
+dep: ; @echo $@
+%.t1 %.t2: ; @echo $*.t1 ; echo $*.t2
+!,
+              '', "dep\nx.t1\nx.t2\nx\nfinal\n");
+
+
+# TEST 8: Verify we can remove pattern rules.  Savannah bug #18622.
+
+my @f = (qw(foo.w foo.ch));
+touch(@f);
+
+run_make_test(q!
+CWEAVE := :
+
+# Disable builtin rules
+%.tex : %.w
+%.tex : %.w %.ch
+!,
+              'foo.tex',
+              "#MAKE#: *** No rule to make target `foo.tex'.  Stop.", 512);
+
+unlink(@f);
+
+# TEST #9: Test shortest stem selection in pattern rules.
+
+run_make_test('
+%.x: ;@echo one
+%-mt.x: ;@echo two
+
+all: foo.x foo-mt.x
+',
+'',
+"one\ntwo");
+
+1;
+
 # This tells the test driver that the perl test script executed properly.
 1;
Index: /vendor/gnumake/current/tests/scripts/features/recursion
===================================================================
--- /vendor/gnumake/current/tests/scripts/features/recursion	(revision 2595)
+++ /vendor/gnumake/current/tests/scripts/features/recursion	(revision 2596)
@@ -17,5 +17,5 @@
 	@echo THE END
 ',
-              ('CFLAGS=-O -w' . ($parallel_jobs ? '-j 2' : '')),
+              ('CFLAGS=-O -w' . ($parallel_jobs ? ' -j 2' : '')),
               ($vos
                ? "#MAKE#: Entering directory `#PWD#'
Index: /vendor/gnumake/current/tests/scripts/features/se_explicit
===================================================================
--- /vendor/gnumake/current/tests/scripts/features/se_explicit	(revision 2595)
+++ /vendor/gnumake/current/tests/scripts/features/se_explicit	(revision 2596)
@@ -25,7 +25,7 @@
 # TEST #1: automatic variables.
 #
-run_make_test('
+run_make_test(q!
 .SECONDEXPANSION:
-.DEFAULT: ; @echo $@
+.DEFAULT: ; @echo '$@'
 
 foo: bar baz
@@ -40,5 +40,5 @@
      $$*.6
 
-',
+!,
 '',
 'bar
@@ -61,7 +61,7 @@
 # Test #2: target/pattern -specific variables.
 #
-run_make_test('
+run_make_test(q!
 .SECONDEXPANSION:
-.DEFAULT: ; @echo $@
+.DEFAULT: ; @echo '$@'
 
 foo.x: $$a $$b
@@ -70,6 +70,5 @@
 
 %.x: b := baz
-
-',
+!,
 '',
 'bar
@@ -80,37 +79,25 @@
 # Test #3: order of prerequisites.
 #
-run_make_test('
+run_make_test(q!
 .SECONDEXPANSION:
-.DEFAULT: ; @echo $@
+.DEFAULT: ; @echo '$@'
 
 all: foo bar baz
 
 # Subtest #1
-#
 foo: foo.1; @:
-
 foo: foo.2
-
 foo: foo.3
 
-
 # Subtest #2
-#
 bar: bar.2
-
 bar: bar.1; @:
-
 bar: bar.3
 
-
 # Subtest #3
-#
 baz: baz.1
-
 baz: baz.2
-
 baz: ; @:
-
-',
+!,
 '',
 'foo.1
@@ -124,4 +111,46 @@
 ');
 
+# TEST #4: eval in a context where there is no reading_file
+run_make_test(q!
+.SECONDEXPANSION:
+all : $$(eval $$(info test))
+!,
+            '', "test\n#MAKE#: Nothing to be done for `all'.\n");
+
+# TEST #5: (NEGATIVE) catch eval in a prereq list trying to create new
+# target/prereq relationships.
+
+run_make_test(q!
+.SECONDEXPANSION:
+proj1.exe : proj1.o $$(eval $$(test))
+define test
+proj1.o : proj1.c
+proj1.c: proj1.h
+endef
+!,
+              '', "#MAKE#: *** prerequisites cannot be defined in recipes.  Stop.\n", 512);
+
+
+# Automatic $$+ variable expansion issue.  Savannah bug #25780
+run_make_test(q!
+all : foo foo
+.SECONDEXPANSION:
+all : $$+ ; @echo '$+'
+foo : ;
+!,
+                  '', "foo foo foo foo\n");
+
+
+# Automatic $$+ variable expansion issue.  Savannah bug #25780
+run_make_test(q!
+all : bar bar
+bar : ;
+q%x : ;
+.SECONDEXPANSION:
+a%l: q1x $$+ q2x ; @echo '$+'
+!,
+                  '', "q1x bar bar q2x bar bar\n");
+
+
 # This tells the test driver that the perl test script executed properly.
 1;
Index: /vendor/gnumake/current/tests/scripts/features/se_implicit
===================================================================
--- /vendor/gnumake/current/tests/scripts/features/se_implicit	(revision 2595)
+++ /vendor/gnumake/current/tests/scripts/features/se_implicit	(revision 2596)
@@ -12,7 +12,7 @@
 # Test #1: automatic variables.
 #
-run_make_test('
-.SECONDEXPANSION:
-.DEFAULT: ; @echo $@
+run_make_test(q!
+.SECONDEXPANSION:
+.DEFAULT: ; @echo '$@'
 
 foo.a: bar baz
@@ -38,7 +38,7 @@
 5.buz \
 6.a:
-	@echo $@
-
-',
+	@echo '$@'
+
+!,
 '',
 '1.foo.a
@@ -61,5 +61,5 @@
 # Test #2: target/pattern -specific variables.
 #
-run_make_test('
+run_make_test(q!
 .SECONDEXPANSION:
 foo.x:
@@ -72,18 +72,14 @@
 %.x: x_b := baz
 
-bar baz: ; @echo $@
-
-',
-'',
-'bar
-baz
-');
+bar baz: ; @echo '$@'
+!,
+              '', "bar\nbaz\n");
 
 
 # Test #3: order of prerequisites.
 #
-run_make_test('
-.SECONDEXPANSION:
-.DEFAULT: ; @echo $@
+run_make_test(q!
+.SECONDEXPANSION:
+.DEFAULT: ; @echo '$@'
 
 all: foo bar baz
@@ -98,5 +94,5 @@
 foo: foo.3
 
-foo.1: ; @echo $@
+foo.1: ; @echo '$@'
 
 
@@ -109,5 +105,5 @@
 bar: bar.3
 
-bar.1: ; @echo $@
+bar.1: ; @echo '$@'
 
 
@@ -119,7 +115,6 @@
 
 %az: ; @:
-
-',
-'',
+!,
+              '',
 'foo.1
 foo.2
@@ -135,18 +130,16 @@
 # Test #4: stem splitting logic.
 #
-run_make_test('
+run_make_test(q!
 .SECONDEXPANSION:
 $(dir)/tmp/bar.o:
 
-$(dir)/tmp/foo/bar.c: ; @echo $@
-$(dir)/tmp/bar/bar.c: ; @echo $@
-foo.h: ; @echo $@
+$(dir)/tmp/foo/bar.c: ; @echo '$@'
+$(dir)/tmp/bar/bar.c: ; @echo '$@'
+foo.h: ; @echo '$@'
 
 %.o: $$(addsuffix /%.c,foo bar) foo.h
-	@echo $@: {$<} $^
-
-',
-"dir=$dir",
-"$dir/tmp/foo/bar.c
+	@echo '$@: {$<} $^'
+!,
+              "dir=$dir", "$dir/tmp/foo/bar.c
 $dir/tmp/bar/bar.c
 foo.h
@@ -157,16 +150,15 @@
 # Test #5: stem splitting logic and order-only prerequisites.
 #
-run_make_test('
+run_make_test(q!
 .SECONDEXPANSION:
 $(dir)/tmp/foo.o: $(dir)/tmp/foo.c
-$(dir)/tmp/foo.c: ; @echo $@
-bar.h: ; @echo $@
+$(dir)/tmp/foo.c: ; @echo '$@'
+bar.h: ; @echo '$@'
 
 %.o: %.c|bar.h
-	@echo $@: {$<} {$|} $^
-
-',
-"dir=$dir",
-"$dir/tmp/foo.c
+	@echo '$@: {$<} {$|} $^'
+
+!,
+              "dir=$dir", "$dir/tmp/foo.c
 bar.h
 $dir/tmp/foo.o: {$dir/tmp/foo.c} {bar.h} $dir/tmp/foo.c
@@ -176,56 +168,58 @@
 # Test #6: lack of implicit prerequisites.
 #
-run_make_test('
+run_make_test(q!
 .SECONDEXPANSION:
 foo.o: foo.c
-foo.c: ; @echo $@
+foo.c: ; @echo '$@'
 
 %.o:
-	@echo $@: {$<} $^
-
-',
-'',
-'foo.c
-foo.o: {foo.c} foo.c
-');
+	@echo '$@: {$<} $^'
+!,
+              '', "foo.c\nfoo.o: {foo.c} foo.c\n");
+
 
 # Test #7: Test stem from the middle of the name.
 #
-run_make_test('
+run_make_test(q!
 .SECONDEXPANSION:
 foobarbaz:
 
 foo%baz: % $$*.1
-	@echo $*
+	@echo '$*'
 
 bar bar.1:
-	@echo $@
-
-',
-'',
-'bar
-bar.1
-bar
-');
+	@echo '$@'
+!,
+              '', "bar\nbar.1\nbar\n");
+
 
 # Test #8: Make sure stem triple-expansion does not happen.
 #
-run_make_test('
+run_make_test(q!
 .SECONDEXPANSION:
 foo$$bar:
 
 f%r: % $$*.1
-	@echo \'$*\'
+	@echo '$*'
 
 oo$$ba oo$$ba.1:
-	@echo \'$@\'
-
-',
-'',
-'oo$ba
+	@echo '$@'
+!,
+              '', 'oo$ba
 oo$ba.1
 oo$ba
 ');
 
+# Test #9: Check the value of $^
+run_make_test(q!
+.SECONDEXPANSION:
+
+%.so: | $$(extra) ; @echo $^
+
+foo.so: extra := foo.o
+foo.so:
+foo.o:
+!,
+              '', "\n");
 
 # This tells the test driver that the perl test script executed properly.
Index: /vendor/gnumake/current/tests/scripts/features/se_statpat
===================================================================
--- /vendor/gnumake/current/tests/scripts/features/se_statpat	(revision 2595)
+++ /vendor/gnumake/current/tests/scripts/features/se_statpat	(revision 2596)
@@ -6,10 +6,9 @@
 # Test #1: automatic variables.
 #
-run_make_test('
+run_make_test(q!
 .SECONDEXPANSION:
-.DEFAULT: ; @echo $@
+.DEFAULT: ; @echo '$@'
 
 foo.a foo.b: foo.%: bar.% baz.%
-
 foo.a foo.b: foo.%: biz.% | buz.%
 
@@ -20,8 +19,6 @@
                     $$|.5 \
                     $$*.6
-
-',
-'',
-'bar.a
+!,
+              '', 'bar.a
 baz.a
 biz.a
@@ -42,7 +39,7 @@
 # Test #2: target/pattern -specific variables.
 #
-run_make_test('
+run_make_test(q!
 .SECONDEXPANSION:
-.DEFAULT: ; @echo $@
+.DEFAULT: ; @echo '$@'
 
 foo.x foo.y: foo.%: $$(%_a) $$($$*_b)
@@ -51,50 +48,34 @@
 
 %.x: x_b := baz
-
-
-',
-'',
-'bar
-baz
-');
+!,
+              '', "bar\nbaz\n");
 
 
 # Test #3: order of prerequisites.
 #
-run_make_test('
+run_make_test(q!
 .SECONDEXPANSION:
-.DEFAULT: ; @echo $@
+.DEFAULT: ; @echo '$@'
 
 all: foo.a bar.a baz.a
 
 # Subtest #1
-#
 foo.a foo.b: foo.%: foo.%.1; @:
-
 foo.a foo.b: foo.%: foo.%.2
-
 foo.a foo.b: foo.%: foo.%.3
 
 
 # Subtest #2
-#
 bar.a bar.b: bar.%: bar.%.2
-
 bar.a bar.b: bar.%: bar.%.1; @:
-
 bar.a bar.b: bar.%: bar.%.3
 
 
 # Subtest #3
-#
 baz.a baz.b: baz.%: baz.%.1
-
 baz.a baz.b: baz.%: baz.%.2
-
 baz.a baz.b: ; @:
-
-',
-'',
-'foo.a.1
+!,
+             '', 'foo.a.1
 foo.a.2
 foo.a.3
@@ -109,15 +90,13 @@
 # Test #4: Make sure stem triple-expansion does not happen.
 #
-run_make_test('
+run_make_test(q!
 .SECONDEXPANSION:
 foo$$bar: f%r: % $$*.1
-	@echo \'$*\'
+	@echo '$*'
 
 oo$$ba oo$$ba.1:
-	@echo \'$@\'
-
-',
-'',
-'oo$ba
+	@echo '$@'
+!,
+              '', 'oo$ba
 oo$ba.1
 oo$ba
Index: /vendor/gnumake/current/tests/scripts/features/targetvars
===================================================================
--- /vendor/gnumake/current/tests/scripts/features/targetvars	(revision 2595)
+++ /vendor/gnumake/current/tests/scripts/features/targetvars	(revision 2596)
@@ -7,7 +7,5 @@
 rules, semicolon interference, etc.";
 
-open(MAKEFILE,"> $makefile");
-
-print MAKEFILE <<'EOF';
+run_make_test('
 SHELL = /bin/sh
 export FOO = foo
@@ -18,5 +16,5 @@
 three: ; BAR=1000
 	@echo $(FOO) $(BAR)
-# Some things that shouldn't be target vars
+# Some things that shouldn not be target vars
 funk : override
 funk : override adelic
@@ -25,8 +23,8 @@
 four:FOO=x
 four:VAR$(FOO)=ok
-four: ; @echo '$(FOO) $(VAR$(FOO)) $(VAR) $(VARx)'
+four: ; @echo "$(FOO) $(VAR$(FOO)) $(VAR) $(VARx)"
 five:FOO=x
 five six : VAR$(FOO)=good
-five six: ;@echo '$(FOO) $(VAR$(FOO)) $(VAR) $(VARx) $(VARfoo)'
+five six: ;@echo "$(FOO) $(VAR$(FOO)) $(VAR) $(VARx) $(VARfoo)"
 # Test per-target variable inheritance
 seven: eight
@@ -42,6 +40,6 @@
 # Test = escaping
 EQ = =
-ten: one\=two
-ten: one \= two
+ten: one$(EQ)two
+ten: one $(EQ) two
 ten one$(EQ)two $(EQ):;@echo $@
 .PHONY: one two three four five six seven eight nine ten $(EQ) one$(EQ)two
@@ -55,61 +53,38 @@
 foo.r : RVAR += rvar
 foo.t : TVAR := $(QVAR)
-EOF
-
-close(MAKEFILE);
-
-# TEST #1
-
-&run_make_with_options($makefile, "one two three", &get_logfile);
-$answer = "one bar\nfoo two\nBAR=1000\nfoo bar\n";
-&compare_output($answer,&get_logfile(1));
+',
+                 "one two three", "one bar\nfoo two\nBAR=1000\nfoo bar\n");
 
 # TEST #2
 
-&run_make_with_options($makefile, "one two FOO=1 BAR=2", &get_logfile);
-$answer = "one 2\n1 2\n";
-&compare_output($answer,&get_logfile(1));
+run_make_test(undef, "one two FOO=1 BAR=2", "one 2\n1 2\n");
 
 # TEST #3
 
-&run_make_with_options($makefile, "four", &get_logfile);
-$answer = "x ok  ok\n";
-&compare_output($answer,&get_logfile(1));
+run_make_test(undef, "four", "x ok  ok\n");
 
 # TEST #4
 
-&run_make_with_options($makefile, "seven", &get_logfile);
-$answer = "eight: seven eight\nseven: seven seven\n";
-&compare_output($answer,&get_logfile(1));
+run_make_test(undef, "seven", "eight: seven eight\nseven: seven seven\n");
 
 # TEST #5
 
-&run_make_with_options($makefile, "nine", &get_logfile);
-$answer = "wallace bar wallace bar\n";
-&compare_output($answer,&get_logfile(1));
+run_make_test(undef, "nine", "wallace bar wallace bar\n");
 
 # TEST #5-a
 
-&run_make_with_options($makefile, "nine-a", &get_logfile);
-$answer = "baz\n";
-&compare_output($answer,&get_logfile(1));
+run_make_test(undef, "nine-a", "baz\n");
 
 # TEST #6
 
-&run_make_with_options($makefile, "ten", &get_logfile);
-$answer = "one=two\none bar\n=\nfoo two\nten\n";
-&compare_output($answer,&get_logfile(1));
+run_make_test(undef, "ten", "one=two\none bar\n=\nfoo two\nten\n");
 
 # TEST #6
 
-&run_make_with_options($makefile, "foo.q bar.q", &get_logfile);
-$answer = "qvar = rvar\nqvar =\n";
-&compare_output($answer,&get_logfile(1));
+run_make_test(undef, "foo.q bar.q", "qvar = rvar\nqvar =\n");
 
 # TEST #7
 
-&run_make_with_options($makefile, "foo.t bar.s", &get_logfile);
-$answer = "qvar = qvar\nqvar =\n";
-&compare_output($answer,&get_logfile(1));
+run_make_test(undef, "foo.t bar.s", "qvar = qvar\nqvar =\n");
 
 
@@ -117,8 +92,5 @@
 # For PR/1378: Target-specific vars don't inherit correctly
 
-$makefile2 = &get_tmpfile;
-
-open(MAKEFILE,"> $makefile2");
-print MAKEFILE <<'EOF';
+run_make_test('
 foo: FOO = foo
 bar: BAR = bar
@@ -126,10 +98,5 @@
 bar: baz
 baz: ; @echo $(FOO) $(BAR)
-EOF
-close(MAKEFILE);
-
-&run_make_with_options("$makefile2", "", &get_logfile);
-$answer = "foo bar\n";
-&compare_output($answer, &get_logfile(1));
+', "", "foo bar\n");
 
 # TEST #9
@@ -137,8 +104,5 @@
 # Also PR/1831
 
-$makefile3 = &get_tmpfile;
-
-open(MAKEFILE,"> $makefile3");
-print MAKEFILE <<'EOF';
+run_make_test('
 .PHONY: all one
 all: FOO += baz
@@ -150,32 +114,19 @@
 one: FOO += boz
 one: ; @echo $(FOO)
-EOF
-close(MAKEFILE);
-
-&run_make_with_options("$makefile3", "", &get_logfile);
-$answer = "bar baz biz boz\nbar baz\n";
-&compare_output($answer, &get_logfile(1));
+',
+              '', "bar baz biz boz\nbar baz\n");
 
 # Test #10
 
-&run_make_with_options("$makefile3", "one", &get_logfile);
-$answer = "bar biz boz\n";
-&compare_output($answer, &get_logfile(1));
+run_make_test(undef, 'one', "bar biz boz\n");
 
 # Test #11
 # PR/1709: Test semicolons in target-specific variable values
 
-$makefile4 = &get_tmpfile;
-
-open(MAKEFILE, "> $makefile4");
-print MAKEFILE <<'EOF';
+run_make_test('
 foo : FOO = ; ok
-foo : ; @echo '$(FOO)'
-EOF
-close(MAKEFILE);
-
-&run_make_with_options("$makefile4", "", &get_logfile);
-$answer = "; ok\n";
-&compare_output($answer, &get_logfile(1));
+foo : ; @echo "$(FOO)"
+',
+              '', "; ok\n");
 
 # Test #12
@@ -183,8 +134,5 @@
 # I nailed it this time :-/.
 
-$makefile5 = &get_tmpfile;
-
-open(MAKEFILE, "> $makefile5");
-print MAKEFILE <<'EOF';
+run_make_test('
 .PHONY: a
 
@@ -196,18 +144,11 @@
 a: BLAH := bar
 a: COMMAND += snafu $(BLAH)
-EOF
-close(MAKEFILE);
-
-&run_make_with_options("$makefile5", "", &get_logfile);
-$answer = "bar snafu bar\n";
-&compare_output($answer, &get_logfile(1));
+',
+              '', "bar snafu bar\n");
 
 # Test #13
 # Test double-colon rules with target-specific variable values
 
-$makefile6 = &get_tmpfile;
-
-open(MAKEFILE, "> $makefile6");
-print MAKEFILE <<'EOF';
+run_make_test('
 W = bad
 X = bad
@@ -225,11 +166,6 @@
   fo% : Z = pat
 endif
-
-EOF
-close(MAKEFILE);
-
-&run_make_with_options("$makefile6", "foo", &get_logfile);
-$answer = "ok ok foo nopat\nok ok foo nopat\n";
-&compare_output($answer, &get_logfile(1));
+',
+             'foo', "ok ok foo nopat\nok ok foo nopat\n");
 
 # Test #14
@@ -237,15 +173,10 @@
 # inheritance
 
-&run_make_with_options("$makefile6", "bar", &get_logfile);
-$answer = "ok ok bar nopat\nok ok bar nopat\n";
-&compare_output($answer, &get_logfile(1));
+run_make_test(undef, 'bar', "ok ok bar nopat\nok ok bar nopat\n");
 
 # Test #15
 # Test double-colon rules with pattern-specific variable values
 
-&run_make_with_options("$makefile6", "foo PATTERN=yes", &get_logfile);
-$answer = "ok ok foo pat\nok ok foo pat\n";
-&compare_output($answer, &get_logfile(1));
-
+run_make_test(undef, 'foo PATTERN=yes', "ok ok foo pat\nok ok foo pat\n");
 
 # Test #16
@@ -253,18 +184,10 @@
 # (> make default buffer length)
 
-$makefile7 = &get_tmpfile;
-
-open(MAKEFILE, "> $makefile7");
-print MAKEFILE <<'EOF';
+run_make_test('
 base_metals_fmd_reports.sun5 base_metals_fmd_reports CreateRealPositions        CreateMarginFunds deals_changed_since : BUILD_OBJ=$(shell if [ -f               "build_information.generate" ]; then echo "$(OBJ_DIR)/build_information.o"; else echo "no build information"; fi  )
 
 deals_changed_since: ; @echo $(BUILD_OBJ)
-
-EOF
-close(MAKEFILE);
-
-&run_make_with_options("$makefile7", '', &get_logfile);
-$answer = "no build information\n";
-&compare_output($answer, &get_logfile(1));
+',
+              '', "no build information\n");
 
 # TEST #17
@@ -287,6 +210,5 @@
 .INTERMEDIATE: foo.x rules.mk
 ',
-              '-I t1',
-              'MYVAR= FOOVAR=bar ALLVAR=xxx');
+              '-I t1', 'MYVAR= FOOVAR=bar ALLVAR=xxx');
 
 rmfiles('t1/rules.mk');
@@ -298,10 +220,44 @@
 # double-expansion.  See Savannah bug #15913.
 
-run_make_test("
-VAR := \$\$FOO
+run_make_test('
+VAR := $$FOO
 foo: VAR += BAR
-foo: ; \@echo '\$(VAR)'",
-              '',
-              '$FOO BAR');
+foo: ; @echo '."'".'$(VAR)'."'".'
+',
+              '', '$FOO BAR');
+
+# TEST #19: Override with append variables
+
+run_make_test('
+a: override FOO += f1
+a: FOO += f2
+a: ; @echo "$(FOO)"
+',
+              '', "f1\n");
+
+run_make_test(undef, 'FOO=C', "C f1\n");
+
+# TEST #20: Check for continuation after semicolons
+
+run_make_test(q!
+a: A = 'hello; \
+world'
+a: ; @echo $(A)
+!,
+              '', "hello; world\n");
+
+# TEST #19: Test define/endef variables as target-specific vars
+
+# run_make_test('
+# define b
+# @echo global
+# endef
+# a: define b
+# @echo local
+# endef
+
+# a: ; $(b)
+# ',
+#               '', "local\n");
 
 1;
Index: /vendor/gnumake/current/tests/scripts/features/vpath
===================================================================
--- /vendor/gnumake/current/tests/scripts/features/vpath	(revision 2595)
+++ /vendor/gnumake/current/tests/scripts/features/vpath	(revision 2596)
@@ -1,2 +1,4 @@
+#                                                                     -*-perl-*-
+
 $description = "The following test creates a makefile to test the \n"
               ."vpath directive which allows you to specify a search \n"
@@ -60,3 +62,20 @@
 }
 
+# TEST 2: after vpath lookup ensure we don't get incorrect circular dependency
+# warnings due to change of struct file ptr.  Savannah bug #13529.
+
+mkdir('vpath-d', 0777);
+
+run_make_test(q!
+vpath %.te vpath-d/
+.SECONDARY:
+default: vpath-d/a vpath-d/b
+vpath-d/a: fail.te
+vpath-d/b : fail.te
+vpath-d/fail.te:
+!,
+              '', "#MAKE#: Nothing to be done for `default'.\n");
+
+rmdir('vpath-d');
+
 1;
Index: /vendor/gnumake/current/tests/scripts/features/vpath3
===================================================================
--- /vendor/gnumake/current/tests/scripts/features/vpath3	(revision 2596)
+++ /vendor/gnumake/current/tests/scripts/features/vpath3	(revision 2596)
@@ -0,0 +1,50 @@
+#                                                                     -*-perl-*-
+
+$description = "Test the interaction of the -lfoo feature and vpath";
+$details = "";
+
+open(MAKEFILE,"> $makefile");
+
+# The Contents of the MAKEFILE ...
+
+print MAKEFILE "vpath %.a a1\n";
+print MAKEFILE "vpath %.so b1\n";
+print MAKEFILE "vpath % a2 b2\n";
+print MAKEFILE "vpath % b3\n";
+print MAKEFILE "all: -l1 -l2 -l3; \@echo \$^\n";
+
+# END of Contents of MAKEFILE
+
+close(MAKEFILE);
+
+mkdir("a1", 0777);
+mkdir("b1", 0777);
+mkdir("a2", 0777);
+mkdir("b2", 0777);
+mkdir("b3", 0777);
+
+@files_to_touch = ("a1${pathsep}lib1.a",
+		   "b1${pathsep}lib1.so",
+		   "a2${pathsep}lib2.a",
+		   "b2${pathsep}lib2.so",
+		   "lib3.a",
+		   "b3${pathsep}lib3.so");
+
+&touch(@files_to_touch);
+
+&run_make_with_options($makefile,"",&get_logfile);
+
+# Create the answer to what should be produced by this Makefile
+$answer = "a1${pathsep}lib1.a a2${pathsep}lib2.a lib3.a\n";
+
+if (&compare_output($answer,&get_logfile(1)))
+{
+  unlink @files_to_touch;
+  rmdir("a1");
+  rmdir("b1");
+  rmdir("a2");
+  rmdir("b2");
+  rmdir("b3");
+}
+
+1;
Index: /vendor/gnumake/current/tests/scripts/functions/shell
===================================================================
--- /vendor/gnumake/current/tests/scripts/functions/shell	(revision 2595)
+++ /vendor/gnumake/current/tests/scripts/functions/shell	(revision 2596)
@@ -12,4 +12,13 @@
 
 
+# Test unescaped comment characters in shells.  Savannah bug #20513
+if ($all_tests) {
+    run_make_test(q!
+FOO := $(shell echo '#')
+foo: ; echo '$(FOO)'
+!,
+              '', "#\n");
+}
+
 # Test shells inside exported environment variables.
 # This is the test that fails if we try to put make exported variables into
Index: /vendor/gnumake/current/tests/scripts/functions/wildcard
===================================================================
--- /vendor/gnumake/current/tests/scripts/functions/wildcard	(revision 2595)
+++ /vendor/gnumake/current/tests/scripts/functions/wildcard	(revision 2596)
@@ -82,13 +82,10 @@
 &compare_output($answer,&get_logfile(1));
 
+# TEST #4: Verify that failed wildcards don't return the pattern
+
+run_make_test(q!
+all: ; @echo $(wildcard xz--y*.7)
+!,
+              '', "\n");
 
 1;
-
-
-
-
-
-
-
-
-
Index: /vendor/gnumake/current/tests/scripts/misc/general4
===================================================================
--- /vendor/gnumake/current/tests/scripts/misc/general4	(revision 2595)
+++ /vendor/gnumake/current/tests/scripts/misc/general4	(revision 2596)
@@ -27,18 +27,4 @@
 cc foo.o -o foo');
 unlink('foo.c');
-
-
-# Test other implicit rule searching
-
-&touch('bar');
-run_make_test('
-test.foo:
-%.foo : baz ; @echo done $<
-%.foo : bar ; @echo done $<
-fox: baz
-',
-              '',
-              'done bar');
-unlink('bar');
 
 
@@ -81,3 +67,16 @@
               '', "mkdir -p dir/subdir\ntouch dir/subdir/file.\$b\ncp dir/subdir/file.\$b dir/subdir/file.\$a\n");
 
+# Test odd whitespace at the beginning of a line
+
+run_make_test("
+all:
+   \f
+
+    \\
+ \f  \\
+    \013 \\
+all: ; \@echo hi
+",
+              '', "hi\n");
+
 1;
Index: /vendor/gnumake/current/tests/scripts/options/dash-B
===================================================================
--- /vendor/gnumake/current/tests/scripts/options/dash-B	(revision 2595)
+++ /vendor/gnumake/current/tests/scripts/options/dash-B	(revision 2596)
@@ -71,3 +71,15 @@
 rmfiles('foo.x', 'blah.x');
 
+# Test that $? is set properly with -B; all prerequisites will be newer!
+
+utouch(-10, 'x.b');
+touch('x.a');
+
+run_make_test(q!
+x.a: x.b ; @echo $?
+!,
+              '-B', "x.b\n");
+
+unlink(qw(x.a x.b));
+
 1;
Index: /vendor/gnumake/current/tests/scripts/options/eval
===================================================================
--- /vendor/gnumake/current/tests/scripts/options/eval	(revision 2596)
+++ /vendor/gnumake/current/tests/scripts/options/eval	(revision 2596)
@@ -0,0 +1,19 @@
+#                                                                    -*-perl-*-
+
+$description = "Test the --eval option.";
+
+$details = "Verify that --eval options take effect,
+and are passed to sub-makes.";
+
+# Verify that --eval is evaluated first
+run_make_test(q!
+BAR = bar
+all: ; @echo all
+recurse: ; @$(MAKE) -f #MAKEFILE# && echo recurse!,
+              '--eval=\$\(info\ eval\) FOO=\$\(BAR\)', "eval\nall");
+
+# Make sure that --eval is handled correctly during recursion
+run_make_test(undef, '--no-print-directory --eval=\$\(info\ eval\) recurse',
+              "eval\neval\nall\nrecurse");
+
+1;
Index: /vendor/gnumake/current/tests/scripts/targets/ONESHELL
===================================================================
--- /vendor/gnumake/current/tests/scripts/targets/ONESHELL	(revision 2596)
+++ /vendor/gnumake/current/tests/scripts/targets/ONESHELL	(revision 2596)
@@ -0,0 +1,69 @@
+#                                                                    -*-perl-*-
+
+$description = "Test the behaviour of the .ONESHELL target.";
+
+$details = "";
+
+
+# Simple
+
+run_make_test(q!
+.ONESHELL:
+all:
+	a=$$$$
+	[ 0"$$a" -eq "$$$$" ] || echo fail
+!,
+              '', 'a=$$
+[ 0"$a" -eq "$$" ] || echo fail
+');
+
+# Again, but this time with inner prefix chars
+
+run_make_test(q!
+.ONESHELL:
+all:
+	a=$$$$
+	@-+    [ 0"$$a" -eq "$$$$" ] || echo fail
+!,
+              '', 'a=$$
+[ 0"$a" -eq "$$" ] || echo fail
+');
+
+# This time with outer prefix chars
+
+run_make_test(q!
+.ONESHELL:
+all:
+	   @a=$$$$
+	    [ 0"$$a" -eq "$$$$" ] || echo fail
+!,
+              '', '');
+
+
+# This time with outer and inner prefix chars
+
+run_make_test(q!
+.ONESHELL:
+all:
+	   @a=$$$$
+	    -@     +[ 0"$$a" -eq "$$$$" ] || echo fail
+!,
+              '', '');
+
+
+# Now try using a different interpreter
+
+run_make_test(q!
+.RECIPEPREFIX = >
+.ONESHELL:
+SHELL = #PERL#
+.SHELLFLAGS = -e
+all:
+>	   @$$a=5
+>	    +7;
+>	@y=qw(a b c);
+>print "a = $$a, y = (@y)\n";
+!,
+              '', "a = 12, y = (a b c)\n");
+
+1;
Index: /vendor/gnumake/current/tests/scripts/targets/POSIX
===================================================================
--- /vendor/gnumake/current/tests/scripts/targets/POSIX	(revision 2596)
+++ /vendor/gnumake/current/tests/scripts/targets/POSIX	(revision 2596)
@@ -0,0 +1,33 @@
+#                                                                    -*-perl-*-
+
+$description = "Test the behaviour of the .PHONY target.";
+
+$details = "";
+
+
+# Ensure turning on .POSIX enables the -e flag for the shell
+# We can't assume the exit value of "false" because on different systems it's
+# different.
+
+my $script = 'false; true';
+my $flags = '-ec';
+my $out = `/bin/sh $flags '$script' 2>&1`;
+my $err = $? >> 8;
+run_make_test(qq!
+.POSIX:
+all: ; \@$script
+!,
+              '', "#MAKE#: *** [all] Error $err\n", 512);
+
+# User settings must override .POSIX
+$flags = '-xc';
+$out = `/bin/sh $flags '$script' 2>&1`;
+run_make_test(qq!
+.SHELLFLAGS = $flags
+.POSIX:
+all: ; \@$script
+!,
+              '', $out);
+
+# This tells the test driver that the perl test script executed properly.
+1;
Index: /vendor/gnumake/current/tests/scripts/variables/DEFAULT_GOAL
===================================================================
--- /vendor/gnumake/current/tests/scripts/variables/DEFAULT_GOAL	(revision 2595)
+++ /vendor/gnumake/current/tests/scripts/variables/DEFAULT_GOAL	(revision 2596)
@@ -74,4 +74,13 @@
 'foo');
 
+# TEST #5: .DEFAULT_GOAL containing just whitespace (Savannah bug #25697)
+
+run_make_test('
+N =
+.DEFAULT_GOAL = $N  $N  # Just whitespace
+
+foo: ; @echo "boo"
+',
+              '', "#MAKE#: *** No targets.  Stop.\n", 512);
 
 # This tells the test driver that the perl test script executed properly.
Index: /vendor/gnumake/current/tests/scripts/variables/LIBPATTERNS
===================================================================
--- /vendor/gnumake/current/tests/scripts/variables/LIBPATTERNS	(revision 2596)
+++ /vendor/gnumake/current/tests/scripts/variables/LIBPATTERNS	(revision 2596)
@@ -0,0 +1,38 @@
+#                                                                    -*-perl-*-
+
+$description = "Test .LIBPATTERNS special variable.";
+
+$details = "";
+
+# TEST 0: basics
+
+touch('mtest_foo.a');
+
+run_make_test('
+.LIBPATTERNS = mtest_%.a
+all: -lfoo ; @echo "build $@ from $<"
+',
+              '', "build all from mtest_foo.a\n");
+
+# TEST 1: Handle elements that are not patterns.
+
+run_make_test('
+.LIBPATTERNS = mtest_foo.a mtest_%.a
+all: -lfoo ; @echo "build $@ from $<"
+',
+              '', "#MAKE#: .LIBPATTERNS element `mtest_foo.a' is not a pattern
+build all from mtest_foo.a\n");
+
+# TEST 2: target-specific override
+
+# Uncomment this when we add support, see Savannah bug #25703
+# run_make_test('
+# .LIBPATTERNS = mbad_%.a
+# all: .LIBPATTERNS += mtest_%.a
+# all: -lfoo ; @echo "build $@ from $<"
+# ',
+#               '', "build all from mtest_foo.a\n");
+
+unlink('mtest_foo.a');
+
+1;
Index: /vendor/gnumake/current/tests/scripts/variables/MAKE
===================================================================
--- /vendor/gnumake/current/tests/scripts/variables/MAKE	(revision 2595)
+++ /vendor/gnumake/current/tests/scripts/variables/MAKE	(revision 2596)
@@ -1,35 +1,24 @@
 #								     -*-perl-*-
 
-$description = "The following test creates a makefile to test MAKE \n"
-              ."(very generic)";
+$description = "Test proper behavior of the MAKE variable";
 
 $details = "DETAILS";
 
-open(MAKEFILE,"> $makefile");
+run_make_test(q!
+TMP  := $(MAKE)
+MAKE := $(subst X=$(X),,$(MAKE))
+all:
+	@echo $(TMP)
+	$(MAKE) -f #MAKEFILE# foo
 
-# The Contents of the MAKEFILE ...
+foo:
+	@echo $(MAKE)
+!,
+              '',
+              "#MAKEPATH#\n#MAKEPATH# -f #MAKEFILE# foo\n"
+              . "#MAKE#[1]: Entering directory `#PWD#'\n"
+              . "#MAKEPATH#\n#MAKE#[1]: Leaving directory `#PWD#'\n");
 
-print MAKEFILE "TMP  := \$(MAKE)\n";
-print MAKEFILE "MAKE := \$(subst X=\$(X),,\$(MAKE))\n\n";
-print MAKEFILE "all:\n";
-print MAKEFILE "\t\@echo \$(TMP)\n";
-print MAKEFILE "\t\$(MAKE) -f $makefile foo\n\n";
-print MAKEFILE "foo:\n";
-print MAKEFILE "\t\@echo \$(MAKE)\n";
-
-# END of Contents of MAKEFILE
-
-close(MAKEFILE);
-
-# Create the answer to what should be produced by this Makefile
-$answer = "$mkpath\n$mkpath -f $makefile foo\n"
-	. "${make_name}[1]: Entering directory `$pwd'\n"
-	. "$mkpath\n${make_name}[1]: Leaving directory `$pwd'\n";
-
-&run_make_with_options($makefile,"",&get_logfile,0);
-
-&rmfiles("foo");
-# COMPARE RESULTS
-&compare_output($answer,&get_logfile(1));
+rmfiles("foo");
 
 1;
Index: /vendor/gnumake/current/tests/scripts/variables/MAKEFILES
===================================================================
--- /vendor/gnumake/current/tests/scripts/variables/MAKEFILES	(revision 2595)
+++ /vendor/gnumake/current/tests/scripts/variables/MAKEFILES	(revision 2596)
@@ -32,3 +32,22 @@
 &compare_output($answer,&get_logfile(1));
 
+# TEST 2: Verify that included makefiles don't set the default goal.
+# See Savannah bug #13401.
+
+create_file('xx-inc.mk', '
+include_goal: ; @echo $@
+include xx-ind.mk
+');
+
+create_file('xx-ind.mk', '
+indirect_goal: ; @echo $@
+');
+
+run_make_test(q!
+top: ; @echo $@
+!,
+              'MAKEFILES=xx-inc.mk', "top\n");
+
+unlink(qw(xx-inc.mk xx-ind.mk));
+
 1;
Index: /vendor/gnumake/current/tests/scripts/variables/MAKEFLAGS
===================================================================
--- /vendor/gnumake/current/tests/scripts/variables/MAKEFLAGS	(revision 2596)
+++ /vendor/gnumake/current/tests/scripts/variables/MAKEFLAGS	(revision 2596)
@@ -0,0 +1,43 @@
+#								     -*-perl-*-
+
+$description = "Test proper behavior of MAKEFLAGS";
+
+$details = "DETAILS";
+
+# Normal flags aren't prefixed with "-"
+run_make_test(q!
+all: ; @echo $(MAKEFLAGS)
+!,
+              '-e -r -R', 'Rre');
+
+# Long arguments mean everything is prefixed with "-"
+run_make_test(q!
+all: ; @echo $(MAKEFLAGS)
+!,
+              '--no-print-directory -e -r -R', '--no-print-directory -Rre');
+
+
+if ($all_tests) {
+    # Recursive invocations of make should accumulate MAKEFLAGS values.
+    # Savannah bug #2216
+    run_make_test(q!
+MSG = Fails
+all:
+	@echo '$@: MAKEFLAGS=$(MAKEFLAGS)'
+	@MSG=Works $(MAKE) -e -f #MAKEFILE# jump
+jump:
+	@echo '$@: MAKEFLAGS=$(MAKEFLAGS)'
+	@$(MAKE) -f #MAKEFILE# print
+print:
+	@echo '$@: MAKEFLAGS=$(MAKEFLAGS)'
+	@echo $(MSG)
+.PHONY: all jump print
+!,
+                  '--no-print-directory',
+                  'all: MAKEFLAGS= --no-print-directory
+jump: MAKEFLAGS= --no-print-directory -e
+print: MAKEFLAGS= --no-print-directory -e
+Works');
+}
+
+1;
Index: /vendor/gnumake/current/tests/scripts/variables/SHELL
===================================================================
--- /vendor/gnumake/current/tests/scripts/variables/SHELL	(revision 2595)
+++ /vendor/gnumake/current/tests/scripts/variables/SHELL	(revision 2596)
@@ -50,7 +50,37 @@
 $extraENV{SHELL} = $mshell;
 
-run_make_test("all: export SHELL := /./$mshell\n".'
-all:;@echo "$(SHELL) $$SHELL"
-', '', "/./$mshell $mshell");
+run_make_test("
+SHELL := /././$mshell
+one: two
+two: export SHELL := /./$mshell\n".'
+one two:;@echo "$@: $(SHELL) $$SHELL"
+', '', "two: /./$mshell /./$mshell\none: /././$mshell $mshell\n");
+
+# Test .SHELLFLAGS
+
+# We don't know the output here: on Solaris for example, every line printed
+# by the shell in -x mode has a trailing space (!!)
+my $script = 'true; true';
+my $flags = '-xc';
+my $out = `/bin/sh $flags '$script' 2>&1`;
+
+run_make_test(qq!
+.SHELLFLAGS = $flags
+all: ; \@$script
+!,
+              '', $out);
+
+# We can't just use "false" because on different systems it provides a
+# different exit code--once again Solaris: false exits with 255 not 1
+$script = 'true; false; true';
+$flags = '-xec';
+$out = `/bin/sh $flags '$script' 2>&1`;
+my $err = $? >> 8;
+
+run_make_test(qq!
+.SHELLFLAGS = $flags
+all: ; \@$script
+!,
+              '', "$out#MAKE#: *** [all] Error $err\n", 512);
 
 1;
Index: /vendor/gnumake/current/tests/scripts/variables/automatic
===================================================================
--- /vendor/gnumake/current/tests/scripts/variables/automatic	(revision 2595)
+++ /vendor/gnumake/current/tests/scripts/variables/automatic	(revision 2596)
@@ -108,3 +108,15 @@
 unlink('foo');
 
+# TEST #4: ensure prereq ordering is correct when the commmand target has none
+# See Savannah bug #21198
+
+run_make_test('
+all : A B
+all : ; @echo $@ -- $^ -- $<
+all : C D
+all : E F
+A B C D E F G H : ; @:
+',
+              '', "all -- A B C D E F -- A\n");
+
 1;
Index: /vendor/gnumake/current/tests/scripts/variables/define
===================================================================
--- /vendor/gnumake/current/tests/scripts/variables/define	(revision 2596)
+++ /vendor/gnumake/current/tests/scripts/variables/define	(revision 2596)
@@ -0,0 +1,234 @@
+#                                                                    -*-perl-*-
+
+$description = "Test define/endef variable assignments.";
+
+$details = "";
+
+# TEST 0: old-style basic define/endef
+
+run_make_test('
+define multi
+@echo hi
+echo there
+endef
+
+all: ; $(multi)
+',
+              '', "hi\necho there\nthere\n");
+
+# TEST 1: Various new-style define/endef
+
+run_make_test('
+FOO = foo
+
+define multi =
+echo hi
+@echo $(FOO)
+endef # this is the end
+
+define simple :=
+@echo $(FOO)
+endef
+
+append = @echo a
+
+define append +=
+
+@echo b
+endef
+
+define cond ?= # this is a conditional
+@echo first
+endef
+
+define cond ?=
+@echo second
+endef
+
+FOO = there
+
+all: ; $(multi)
+	$(simple)
+	$(append)
+	$(cond)
+',
+              '', "echo hi\nhi\nthere\nfoo\na\nb\nfirst\n");
+
+# TEST 2: define in true section of conditional (containing conditional)
+
+run_make_test('
+FOO = foo
+NAME = def
+def =
+ifdef BOGUS
+ define  $(subst e,e,$(NAME))     =
+  ifeq (1,1)
+   FOO = bar
+  endif
+ endef
+endif
+
+$(eval $(def))
+all: ; @echo $(FOO)
+',
+              'BOGUS=1', "bar\n");
+
+# TEST 3: define in false section of conditional (containing conditional)
+
+run_make_test(undef, '', "foo\n");
+
+# TEST 4: nested define (supported?)
+
+run_make_test('
+define outer
+ define inner
+  A = B
+ endef
+endef
+
+$(eval $(outer))
+
+outer: ; @echo $(inner)
+',
+              '', "A = B\n");
+
+# TEST 5: NEGATIVE: Missing variable name
+
+run_make_test('
+NAME =
+define $(NAME)  =
+ouch
+endef
+all: ; @echo ouch
+',
+              '', "#MAKEFILE#:3: *** empty variable name.  Stop.\n", 512);
+
+# TEST 6: NEGATIVE: extra text after define
+
+run_make_test('
+NAME =
+define NAME = $(NAME)
+ouch
+endef
+all: ; @echo ok
+',
+              '', "#MAKEFILE#:3: extraneous text after `define' directive\nok\n");
+
+# TEST 7: NEGATIVE: extra text after endef
+
+run_make_test('
+NAME =
+define NAME =
+ouch
+endef $(NAME)
+all: ; @echo ok
+',
+              '', "#MAKEFILE#:5: extraneous text after `endef' directive\nok\n");
+
+# TEST 8: NEGATIVE: missing endef
+
+run_make_test('
+NAME =
+all: ; @echo ok
+define NAME =
+ouch
+endef$(NAME)
+',
+              '', "#MAKEFILE#:4: *** missing `endef', unterminated `define'.  Stop.\n", 512);
+
+# -------------------------
+# Make sure that prefix characters apply properly to define/endef values.
+#
+# There's a bit of oddness here if you try to use a variable to hold the
+# prefix character for a define.  Even though something like this:
+#
+#       define foo
+#       echo bar
+#       endef
+#
+#       all: ; $(V)$(foo)
+#
+# (where V=@) can be seen by the user to be obviously different than this:
+#
+#       define foo
+#       $(V)echo bar
+#       endef
+#
+#       all: ; $(foo)
+#
+# and the user thinks it should behave the same as when the "@" is literal
+# instead of in a variable, that can't happen because by the time make
+# expands the variables for the command line and sees it begins with a "@" it
+# can't know anymore whether the prefix character came before the variable
+# reference or was included in the first line of the variable reference.
+
+# TEST #5
+# -------
+
+run_make_test('
+define FOO
+$(V1)echo hello
+$(V2)echo world
+endef
+all: ; @$(FOO)
+', '', 'hello
+world');
+
+# TEST #6
+# -------
+
+run_make_test(undef, 'V1=@ V2=@', 'hello
+world');
+
+# TEST #7
+# -------
+
+run_make_test('
+define FOO
+$(V1)echo hello
+$(V2)echo world
+endef
+all: ; $(FOO)
+', 'V1=@', 'hello
+echo world
+world');
+
+# TEST #8
+# -------
+
+run_make_test(undef, 'V2=@', 'echo hello
+hello
+world');
+
+# TEST #9
+# -------
+
+run_make_test(undef, 'V1=@ V2=@', 'hello
+world');
+
+# TEST #10
+# -------
+# Test the basics; a "@" internally to the variable applies to only one line.
+# A "@" before the variable applies to the entire variable.
+
+run_make_test('
+define FOO
+@echo hello
+echo world
+endef
+define BAR
+echo hello
+echo world
+endef
+
+all: foo bar
+foo: ; $(FOO)
+bar: ; @$(BAR)
+', '', 'hello
+echo world
+world
+hello
+world
+');
+
+1;
Index: /vendor/gnumake/current/tests/scripts/variables/flavors
===================================================================
--- /vendor/gnumake/current/tests/scripts/variables/flavors	(revision 2595)
+++ /vendor/gnumake/current/tests/scripts/variables/flavors	(revision 2596)
@@ -5,179 +5,72 @@
 $details = "";
 
-open(MAKEFILE, "> $makefile");
+# TEST 0: Recursive
 
-# The Contents of the MAKEFILE ...
-
-print MAKEFILE <<'EOF';
+run_make_test('
+ugh = Goodbye
 foo = $(bar)
 bar = ${ugh}
 ugh = Hello
+all: ; @echo $(foo)
+',
+              '', "Hello\n");
 
-all: multi ; @echo $(foo)
-
-multi: ; $(multi)
-
-x := foo
-y := $(x) bar
-x := later
-
-nullstring :=
-space := $(nullstring) $(nullstring)
-
-next: ; @echo $x$(space)$y
-
-define multi
-@echo hi
-echo there
-endef
-
-ifdef BOGUS
-define
-@echo error
-endef
-endif
-
-define outer
- define inner
-  A = B
- endef
-endef
-
-$(eval $(outer))
-
-outer: ; @echo $(inner)
-
-EOF
-
-# END of Contents of MAKEFILE
-
-close(MAKEFILE);
-
-# TEST #1
-# -------
-
-&run_make_with_options($makefile, "", &get_logfile);
-$answer = "hi\necho there\nthere\nHello\n";
-&compare_output($answer, &get_logfile(1));
-
-# TEST #2
-# -------
-
-&run_make_with_options($makefile, "next", &get_logfile);
-$answer = "later foo bar\n";
-&compare_output($answer, &get_logfile(1));
-
-# TEST #3
-# -------
-
-&run_make_with_options($makefile, "BOGUS=true", &get_logfile, 512);
-$answer = "$makefile:24: *** empty variable name.  Stop.\n";
-&compare_output($answer, &get_logfile(1));
-
-# TEST #4
-# -------
-
-&run_make_with_options($makefile, "outer", &get_logfile);
-$answer = "A = B\n";
-&compare_output($answer, &get_logfile(1));
-
-# Clean up from "old style" testing.  If all the above tests are converted to
-# run_make_test() syntax than this line can be removed.
-$makefile = undef;
-
-# -------------------------
-# Make sure that prefix characters apply properly to define/endef values.
-#
-# There's a bit of oddness here if you try to use a variable to hold the
-# prefix character for a define.  Even though something like this:
-#
-#       define foo
-#       echo bar
-#       endef
-#
-#       all: ; $(V)$(foo)
-#
-# (where V=@) can be seen by the user to be obviously different than this:
-#
-#       define foo
-#       $(V)echo bar
-#       endef
-#
-#       all: ; $(foo)
-#
-# and the user thinks it should behave the same as when the "@" is literal
-# instead of in a variable, that can't happen because by the time make
-# expands the variables for the command line and sees it begins with a "@" it
-# can't know anymore whether the prefix character came before the variable
-# reference or was included in the first line of the variable reference.
-
-# TEST #5
-# -------
+# TEST 1: Simple
 
 run_make_test('
-define FOO
-$(V1)echo hello
-$(V2)echo world
-endef
-all: ; @$(FOO)
-', '', 'hello
-world');
+bar = Goodbye
+foo := $(bar)
+bar = ${ugh}
+ugh = Hello
+all: ; @echo $(foo)
+',
+              '', "Goodbye\n");
 
-# TEST #6
-# -------
-
-run_make_test(undef, 'V1=@ V2=@', 'hello
-world');
-
-# TEST #7
-# -------
+# TEST 2: Append to recursive
 
 run_make_test('
-define FOO
-$(V1)echo hello
-$(V2)echo world
-endef
-all: ; $(FOO)
-', 'V1=@', 'hello
-echo world
-world');
+foo = Hello
+ugh = Goodbye
+foo += $(bar)
+bar = ${ugh}
+ugh = Hello
+all: ; @echo $(foo)
+',
+              '', "Hello Hello\n");
 
-# TEST #8
-# -------
-
-run_make_test(undef, 'V2=@', 'echo hello
-hello
-world');
-
-# TEST #9
-# -------
-
-run_make_test(undef, 'V1=@ V2=@', 'hello
-world');
-
-# TEST #10
-# -------
-# Test the basics; a "@" internally to the variable applies to only one line.
-# A "@" before the variable applies to the entire variable.
+# TEST 3: Append to simple
 
 run_make_test('
-define FOO
-@echo hello
-echo world
-endef
-define BAR
-echo hello
-echo world
-endef
+foo := Hello
+ugh = Goodbye
+bar = ${ugh}
+foo += $(bar)
+ugh = Hello
+all: ; @echo $(foo)
+',
+              '', "Hello Goodbye\n");
 
-all: foo bar
-foo: ; $(FOO)
-bar: ; @$(BAR)
-', '', 'hello
-echo world
-world
-hello
-world
-');
+# TEST 4: Conditional pre-set
+
+run_make_test('
+foo = Hello
+ugh = Goodbye
+bar = ${ugh}
+foo ?= $(bar)
+ugh = Hello
+all: ; @echo $(foo)
+',
+              '', "Hello\n");
+
+# TEST 5: Conditional unset
+
+run_make_test('
+ugh = Goodbye
+bar = ${ugh}
+foo ?= $(bar)
+ugh = Hello
+all: ; @echo $(foo)
+',
+              '', "Hello\n");
 
 1;
Index: /vendor/gnumake/current/tests/scripts/variables/private
===================================================================
--- /vendor/gnumake/current/tests/scripts/variables/private	(revision 2596)
+++ /vendor/gnumake/current/tests/scripts/variables/private	(revision 2596)
@@ -0,0 +1,78 @@
+#                                                                    -*-perl-*-
+
+$description = "Test 'private' variables.";
+
+$details = "";
+
+# 1: Simple verification that private variables are not inherited
+&run_make_test('
+a:
+F = g
+a: F = a
+b: private F = b
+
+a b c: ; @echo $@: F=$(F)
+a: b
+b: c
+',
+              '', "c: F=a\nb: F=b\na: F=a\n");
+
+# 2: Again, but this time we start with "b" so "a"'s variable is not in scope
+&run_make_test(undef, 'b', "c: F=g\nb: F=b\n");
+
+# 3: Verification with pattern-specific variables
+&run_make_test('
+t.a:
+
+F1 = g
+F2 = g
+%.a: private F1 = a
+%.a: F2 = a
+
+t.a t.b: ; @echo $@: F1=$(F1) / F2=$(F2)
+t.a: t.b
+',
+               '', "t.b: F1=g / F2=a\nt.a: F1=a / F2=a\n");
+
+# 4: Test private global variables
+&run_make_test('
+a:
+private F = g
+G := $(F)
+a:
+b: F = b
+
+a b: ; @echo $@: F=$(F) / G=$(G)
+a: b
+',
+               '', "b: F=b / G=g\na: F= / G=g\n");
+
+# 5: Multiple conditions on the same variable.  Test export.
+delete $ENV{'_X'};
+&run_make_test('
+_X = x
+a: export override private _X = a
+a: ; @echo _X=$(_X) / _X=$$_X
+',
+               '', "_X=a / _X=a");
+
+# 6: Test override.
+&run_make_test(undef, '_X=c', "_X=a / _X=a\n");
+
+# 7: Ensure keywords still work as targets
+&run_make_test('
+a: export override private foo bar
+foo bar export override private: ; @echo $@
+',
+               '', "export\noverride\nprivate\nfoo\nbar\n");
+
+# 8: Ensure keywords still work as variables
+&run_make_test('
+private = g
+a: private = a
+a: b
+a b: ; @echo $@=$(private)
+',
+               '', "b=a\na=a\n");
+
+1;
Index: /vendor/gnumake/current/tests/scripts/variables/undefine
===================================================================
--- /vendor/gnumake/current/tests/scripts/variables/undefine	(revision 2596)
+++ /vendor/gnumake/current/tests/scripts/variables/undefine	(revision 2596)
@@ -0,0 +1,73 @@
+#                                                                    -*-perl-*-
+
+$description = "Test variable undefine.";
+
+$details = "";
+
+# TEST 0: basic undefine functionality
+
+run_make_test('
+a = a
+b := b
+define c
+c
+endef
+
+$(info $(flavor a) $(flavor b) $(flavor c))
+
+n := b
+
+undefine a
+undefine $n
+undefine c
+
+$(info $(flavor a) $(flavor b) $(flavor c))
+
+
+all: ;@:
+',
+'', "recursive simple recursive\nundefined undefined undefined");
+
+
+# TEST 1: override
+
+run_make_test('
+undefine a
+override undefine b
+
+$(info $(flavor a) $(flavor b))
+
+
+all: ;@:
+',
+'a=a b=b', "recursive undefined");
+
+1;
+
+# TEST 2: undefine in eval (make sure we undefine from the global var set)
+
+run_make_test('
+define undef
+$(eval undefine $$1)
+endef
+
+a := a
+$(call undef,a)
+$(info $(flavor a))
+
+
+all: ;@:
+',
+'', "undefined");
+
+
+# TEST 3: Missing variable name
+
+run_make_test('
+a =
+undefine $a
+all: ;@echo ouch
+',
+'', "#MAKEFILE#:3: *** empty variable name.  Stop.\n", 512);
+
+1;
Index: /vendor/gnumake/current/tests/test_driver.pl
===================================================================
--- /vendor/gnumake/current/tests/test_driver.pl	(revision 2595)
+++ /vendor/gnumake/current/tests/test_driver.pl	(revision 2596)
@@ -7,5 +7,6 @@
 #
 # Copyright (C) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
-# 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
+# 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software
+# Foundation, Inc.
 # This file is part of GNU Make.
 #
@@ -30,5 +31,5 @@
 # variables and then calls &toplevel, which does all the real work.
 
-# $Id: test_driver.pl,v 1.24 2007/11/04 21:54:02 psmith Exp $
+# $Id: test_driver.pl,v 1.30 2010/07/28 05:39:50 psmith Exp $
 
 
@@ -54,4 +55,6 @@
 $test_timeout = 5;
 
+# Path to Perl
+$perl_name = $^X;
 
 # %makeENV is the cleaned-out environment.
@@ -236,6 +239,7 @@
 {
   # Set up an initial value.  In perl5 we can do it the easy way.
-  #
   $osname = defined($^O) ? $^O : '';
+
+  # Find a path to Perl
 
   # See if the filesystem supports long file names with multiple
@@ -273,5 +277,5 @@
     if ($osname =~ /not found/i)
     {
-	$osname = "(something unixy with no uname)";
+	$osname = "(something posixy with no uname)";
     }
     elsif ($@ ne "" || $?)
@@ -280,5 +284,5 @@
         if ($@ ne "" || $?)
         {
-	    $osname = "(something unixy)";
+	    $osname = "(something posixy)";
 	}
     }
@@ -436,4 +440,5 @@
       $diffext = 'd';
       $baseext = 'b';
+      $runext = 'r';
       $extext = '';
     } else {
@@ -441,4 +446,5 @@
       $diffext = 'diff';
       $baseext = 'base';
+      $runext = 'run';
       $extext = '.';
     }
@@ -446,4 +452,5 @@
     $diff_filename = "$testpath.$diffext";
     $base_filename = "$testpath.$baseext";
+    $run_filename = "$testpath.$runext";
     $tmp_filename = "$testpath.$tmpfilesuffix";
 
@@ -459,4 +466,5 @@
     $tests_run = 0;
     $tests_passed = 0;
+
     $code = do $perl_testname;
 
@@ -692,4 +700,5 @@
 
     &create_file (&get_basefile, $answer);
+    &create_file (&get_runfile, $command_string);
 
     print "\nCreating Difference File ...\n" if $debug;
@@ -699,4 +708,6 @@
     local($command) = "diff -c " . &get_basefile . " " . $logfile;
     &run_command_with_output(&get_difffile,$command);
+  } else {
+      &rmfiles ();
   }
 
@@ -792,5 +803,5 @@
       local $SIG{ALRM} = sub { die "timeout\n"; };
       alarm $test_timeout;
-      $code = system @_;
+      $code = system(@_);
       alarm 0;
   };
@@ -829,5 +840,5 @@
   my $filename = shift;
 
-  print "\nrun_command_with_output($filename): @_\n" if $debug;
+  print "\nrun_command_with_output($filename,$runname): @_\n" if $debug;
   &attach_default_output ($filename);
   my $code = _run_command(@_);
@@ -1202,4 +1213,13 @@
 }
 
+# This subroutine returns a command filename with a number appended
+# to the end corresponding to how many logfiles (and thus command files)
+# have been created in the current running test.
+
+sub get_runfile
+{
+  return ($run_filename . &num_suffix ($num_of_logfiles));
+}
+
 # just like logfile, only a generic tmp filename for use by the test.
 # they are automatically cleaned up unless -keep was used, or the test fails.
Index: /vendor/gnumake/current/variable.c
===================================================================
--- /vendor/gnumake/current/variable.c	(revision 2595)
+++ /vendor/gnumake/current/variable.c	(revision 2596)
@@ -1,6 +1,6 @@
 /* Internals of variables for GNU Make.
 Copyright (C) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
-1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software
-Foundation, Inc.
+1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
+2010 Free Software Foundation, Inc.
 This file is part of GNU Make.
 
@@ -36,25 +36,59 @@
 static struct pattern_var *pattern_vars;
 
-/* Pointer to last struct in the chain, so we can add onto the end.  */
-
-static struct pattern_var *last_pattern_var;
-
-/* Create a new pattern-specific variable struct.  */
+/* Pointer to the last struct in the pack of a specific size, from 1 to 255.*/
+
+static struct pattern_var *last_pattern_vars[256];
+
+/* Create a new pattern-specific variable struct. The new variable is
+   inserted into the PATTERN_VARS list in the shortest patterns first
+   order to support the shortest stem matching (the variables are
+   matched in the reverse order so the ones with the longest pattern
+   will be considered first). Variables with the same pattern length
+   are inserted in the definition order. */
 
 struct pattern_var *
 create_pattern_var (const char *target, const char *suffix)
 {
+  register unsigned int len = strlen (target);
   register struct pattern_var *p = xmalloc (sizeof (struct pattern_var));
 
-  if (last_pattern_var != 0)
-    last_pattern_var->next = p;
+  if (pattern_vars != 0)
+    {
+      if (len < 256 && last_pattern_vars[len] != 0)
+        {
+          p->next = last_pattern_vars[len]->next;
+          last_pattern_vars[len]->next = p;
+        }
+      else
+        {
+          /* Find the position where we can insert this variable. */
+          register struct pattern_var **v;
+
+          for (v = &pattern_vars; ; v = &(*v)->next)
+            {
+              /* Insert at the end of the pack so that patterns with the
+                 same length appear in the order they were defined .*/
+
+              if (*v == 0 || (*v)->len > len)
+                {
+                  p->next = *v;
+                  *v = p;
+                  break;
+                }
+            }
+        }
+    }
   else
-    pattern_vars = p;
-  last_pattern_var = p;
-  p->next = 0;
+    {
+      pattern_vars = p;
+      p->next = 0;
+    }
 
   p->target = target;
-  p->len = strlen (target);
+  p->len = len;
   p->suffix = suffix + 1;
+
+  if (len < 256)
+    last_pattern_vars[len] = p;
 
   return p;
@@ -140,5 +174,5 @@
 static struct variable_set global_variable_set;
 static struct variable_set_list global_setlist
-  = { 0, &global_variable_set };
+  = { 0, &global_variable_set, 0 };
 struct variable_set_list *current_variable_set_list = &global_setlist;
 
@@ -209,5 +243,5 @@
 
   v = xmalloc (sizeof (struct variable));
-  v->name = savestring (name, length);
+  v->name = xstrndup (name, length);
   v->length = length;
   hash_insert_at (&set->table, v, var_slot);
@@ -224,4 +258,5 @@
   v->per_target = 0;
   v->append = 0;
+  v->private_var = 0;
   v->export = v_default;
 
@@ -244,4 +279,49 @@
 }
 
+
+
+/* Undefine variable named NAME in SET. LENGTH is the length of NAME, which
+   does not need to be null-terminated. ORIGIN specifies the origin of the
+   variable (makefile, command line or environment). */
+
+static void
+free_variable_name_and_value (const void *item);
+
+void
+undefine_variable_in_set (const char *name, unsigned int length,
+                          enum variable_origin origin,
+                          struct variable_set *set)
+{
+  struct variable *v;
+  struct variable **var_slot;
+  struct variable var_key;
+
+  if (set == NULL)
+    set = &global_variable_set;
+
+  var_key.name = (char *) name;
+  var_key.length = length;
+  var_slot = (struct variable **) hash_find_slot (&set->table, &var_key);
+
+  if (env_overrides && origin == o_env)
+    origin = o_env_override;
+
+  v = *var_slot;
+  if (! HASH_VACANT (v))
+    {
+      if (env_overrides && v->origin == o_env)
+	/* V came from in the environment.  Since it was defined
+	   before the switches were parsed, it wasn't affected by -e.  */
+	v->origin = o_env_override;
+
+      /* If the definition is from a stronger source than this one, don't
+         undefine it.  */
+      if ((int) origin >= (int) v->origin)
+	{
+          hash_delete_at (&set->table, var_slot);
+          free_variable_name_and_value (v);
+	}
+    }
+}
 
 /* If the variable passed in is "special", handle its special nature.
@@ -345,4 +425,5 @@
   const struct variable_set_list *setlist;
   struct variable var_key;
+  int is_parent = 0;
 
   var_key.name = (char *) name;
@@ -356,6 +437,8 @@
 
       v = (struct variable *) hash_find_item ((struct hash_table *) &set->table, &var_key);
-      if (v)
+      if (v && (!is_parent || !v->private_var))
 	return v->special ? lookup_special_var (v) : v;
+
+      is_parent |= setlist->next_is_parent;
     }
 
@@ -470,4 +553,5 @@
       initialize_file_variables (file->double_colon, reading);
       l->next = file->double_colon->variables;
+      l->next_is_parent = 0;
       return;
     }
@@ -480,4 +564,5 @@
       l->next = file->parent->variables;
     }
+  l->next_is_parent = 1;
 
   /* If we're not reading makefiles and we haven't looked yet, see if
@@ -525,4 +610,5 @@
               v->per_target = p->variable.per_target;
               v->export = p->variable.export;
+              v->private_var = p->variable.private_var;
             }
           while ((p = lookup_pattern_var (p, file->name)) != 0);
@@ -538,5 +624,7 @@
     {
       file->pat_variables->next = l->next;
+      file->pat_variables->next_is_parent = l->next_is_parent;
       l->next = file->pat_variables;
+      l->next_is_parent = 0;
     }
 }
@@ -560,4 +648,5 @@
   setlist->set = set;
   setlist->next = current_variable_set_list;
+  setlist->next_is_parent = 0;
 
   return setlist;
@@ -631,4 +720,5 @@
       global_setlist.set = setlist->set;
       global_setlist.next = setlist->next;
+      global_setlist.next_is_parent = setlist->next_is_parent;
     }
 
@@ -719,5 +809,5 @@
 
   sprintf (buf, "%u", makelevel);
-  (void) define_variable (MAKELEVEL_NAME, MAKELEVEL_LENGTH, buf, o_env, 0);
+  define_variable_cname (MAKELEVEL_NAME, buf, o_env, 0);
 
   sprintf (buf, "%s%s%s",
@@ -727,5 +817,5 @@
 	   (remote_description == 0 || remote_description[0] == '\0')
 	   ? "" : remote_description);
-  (void) define_variable ("MAKE_VERSION", 12, buf, o_default, 0);
+  define_variable_cname ("MAKE_VERSION", buf, o_default, 0);
 
 #ifdef  __MSDOS__
@@ -738,5 +828,5 @@
     struct variable *comp = lookup_variable ("COMSPEC", 7);
 
-    /* Make $MAKESHELL override $SHELL even if -e is in effect.  */
+    /* $(MAKESHELL) overrides $(SHELL) even if -e is in effect.  */
     if (mshp)
       (void) define_variable (shell_str, shlen,
@@ -744,5 +834,5 @@
     else if (comp)
       {
-	/* $COMSPEC shouldn't override $SHELL.  */
+	/* $(COMSPEC) shouldn't override $(SHELL).  */
 	struct variable *shp = lookup_variable (shell_str, shlen);
 
@@ -803,5 +893,5 @@
   /* This won't override any definition, but it will provide one if there
      isn't one there.  */
-  v = define_variable ("SHELL", 5, default_shell, o_default, 0);
+  v = define_variable_cname ("SHELL", default_shell, o_default, 0);
 #ifdef __MSDOS__
   v->export = v_export;  /*  Export always SHELL.  */
@@ -823,5 +913,5 @@
 
   /* Make sure MAKEFILES gets exported if it is set.  */
-  v = define_variable ("MAKEFILES", 9, "", o_default, 0);
+  v = define_variable_cname ("MAKEFILES", "", o_default, 0);
   v->export = v_ifset;
 
@@ -830,27 +920,27 @@
 
 #ifdef VMS
-  define_variable ("@D", 2, "$(dir $@)", o_automatic, 1);
-  define_variable ("%D", 2, "$(dir $%)", o_automatic, 1);
-  define_variable ("*D", 2, "$(dir $*)", o_automatic, 1);
-  define_variable ("<D", 2, "$(dir $<)", o_automatic, 1);
-  define_variable ("?D", 2, "$(dir $?)", o_automatic, 1);
-  define_variable ("^D", 2, "$(dir $^)", o_automatic, 1);
-  define_variable ("+D", 2, "$(dir $+)", o_automatic, 1);
+  define_variable_cname ("@D", "$(dir $@)", o_automatic, 1);
+  define_variable_cname ("%D", "$(dir $%)", o_automatic, 1);
+  define_variable_cname ("*D", "$(dir $*)", o_automatic, 1);
+  define_variable_cname ("<D", "$(dir $<)", o_automatic, 1);
+  define_variable_cname ("?D", "$(dir $?)", o_automatic, 1);
+  define_variable_cname ("^D", "$(dir $^)", o_automatic, 1);
+  define_variable_cname ("+D", "$(dir $+)", o_automatic, 1);
 #else
-  define_variable ("@D", 2, "$(patsubst %/,%,$(dir $@))", o_automatic, 1);
-  define_variable ("%D", 2, "$(patsubst %/,%,$(dir $%))", o_automatic, 1);
-  define_variable ("*D", 2, "$(patsubst %/,%,$(dir $*))", o_automatic, 1);
-  define_variable ("<D", 2, "$(patsubst %/,%,$(dir $<))", o_automatic, 1);
-  define_variable ("?D", 2, "$(patsubst %/,%,$(dir $?))", o_automatic, 1);
-  define_variable ("^D", 2, "$(patsubst %/,%,$(dir $^))", o_automatic, 1);
-  define_variable ("+D", 2, "$(patsubst %/,%,$(dir $+))", o_automatic, 1);
+  define_variable_cname ("@D", "$(patsubst %/,%,$(dir $@))", o_automatic, 1);
+  define_variable_cname ("%D", "$(patsubst %/,%,$(dir $%))", o_automatic, 1);
+  define_variable_cname ("*D", "$(patsubst %/,%,$(dir $*))", o_automatic, 1);
+  define_variable_cname ("<D", "$(patsubst %/,%,$(dir $<))", o_automatic, 1);
+  define_variable_cname ("?D", "$(patsubst %/,%,$(dir $?))", o_automatic, 1);
+  define_variable_cname ("^D", "$(patsubst %/,%,$(dir $^))", o_automatic, 1);
+  define_variable_cname ("+D", "$(patsubst %/,%,$(dir $+))", o_automatic, 1);
 #endif
-  define_variable ("@F", 2, "$(notdir $@)", o_automatic, 1);
-  define_variable ("%F", 2, "$(notdir $%)", o_automatic, 1);
-  define_variable ("*F", 2, "$(notdir $*)", o_automatic, 1);
-  define_variable ("<F", 2, "$(notdir $<)", o_automatic, 1);
-  define_variable ("?F", 2, "$(notdir $?)", o_automatic, 1);
-  define_variable ("^F", 2, "$(notdir $^)", o_automatic, 1);
-  define_variable ("+F", 2, "$(notdir $+)", o_automatic, 1);
+  define_variable_cname ("@F", "$(notdir $@)", o_automatic, 1);
+  define_variable_cname ("%F", "$(notdir $%)", o_automatic, 1);
+  define_variable_cname ("*F", "$(notdir $*)", o_automatic, 1);
+  define_variable_cname ("<F", "$(notdir $<)", o_automatic, 1);
+  define_variable_cname ("?F", "$(notdir $?)", o_automatic, 1);
+  define_variable_cname ("^F", "$(notdir $^)", o_automatic, 1);
+  define_variable_cname ("+F", "$(notdir $+)", o_automatic, 1);
 }
 
@@ -979,5 +1069,5 @@
 	      convert_Path_to_windows32(value, ';');
 #endif
-	    *result++ = xstrdup (concat (v->name, "=", value));
+	    *result++ = xstrdup (concat (3, v->name, "=", value));
 	    free (value);
 	  }
@@ -989,5 +1079,5 @@
               convert_Path_to_windows32(v->value, ';');
 #endif
-	    *result++ = xstrdup (concat (v->name, "=", v->value));
+	    *result++ = xstrdup (concat (3, v->name, "=", v->value));
 	  }
       }
@@ -1093,5 +1183,5 @@
             unsigned int oldlen, vallen;
             const char *val;
-            char *tp;
+            char *tp = NULL;
 
             val = value;
@@ -1106,13 +1196,15 @@
                  memory for the expansion as we may still need the rest of the
                  buffer if we're looking at a target-specific variable.  */
-              val = alloc_value = allocated_variable_expand (val);
+              val = tp = allocated_variable_expand (val);
 
             oldlen = strlen (v->value);
             vallen = strlen (val);
-            tp = alloca (oldlen + 1 + vallen + 1);
-            memcpy (tp, v->value, oldlen);
-            tp[oldlen] = ' ';
-            memcpy (&tp[oldlen + 1], val, vallen + 1);
-            p = tp;
+            p = alloc_value = xmalloc (oldlen + 1 + vallen + 1);
+            memcpy (alloc_value, v->value, oldlen);
+            alloc_value[oldlen] = ' ';
+            memcpy (&alloc_value[oldlen + 1], val, vallen + 1);
+
+            if (tp)
+              free (tp);
           }
       }
@@ -1222,8 +1314,8 @@
       else
         {
-          if (alloc_value)
-            free (alloc_value);
+          char *tp = alloc_value;
 
           alloc_value = allocated_variable_expand (p);
+
           if (find_and_set_default_shell (alloc_value))
             {
@@ -1238,4 +1330,7 @@
           else
             v = lookup_variable (varname, strlen (varname));
+
+          if (tp)
+            free (tp);
         }
     }
@@ -1264,64 +1359,30 @@
 
 
-/* Try to interpret LINE (a null-terminated string) as a variable definition.
-
-   ORIGIN may be o_file, o_override, o_env, o_env_override,
-   or o_command specifying that the variable definition comes
-   from a makefile, an override directive, the environment with
-   or without the -e switch, or the command line.
-
-   See the comments for parse_variable_definition().
-
-   If LINE was recognized as a variable definition, a pointer to its `struct
-   variable' is returned.  If LINE is not a variable definition, NULL is
-   returned.  */
-
-struct variable *
-parse_variable_definition (struct variable *v, char *line)
-{
-  register int c;
-  register char *p = line;
-  register char *beg;
-  register char *end;
-  enum variable_flavor flavor = f_bogus;
-  char *name;
+/* Parse P (a null-terminated string) as a variable definition.
+
+   If it is not a variable definition, return NULL.
+
+   If it is a variable definition, return a pointer to the char after the
+   assignment token and set *FLAVOR to the type of variable assignment.  */
+
+char *
+parse_variable_definition (const char *p, enum variable_flavor *flavor)
+{
+  int wspace = 0;
+
+  p = next_token (p);
 
   while (1)
     {
-      c = *p++;
+      int c = *p++;
+
+      /* If we find a comment or EOS, it's not a variable definition.  */
       if (c == '\0' || c == '#')
-	return 0;
-      if (c == '=')
+	return NULL;
+
+      if (c == '$')
 	{
-	  end = p - 1;
-	  flavor = f_recursive;
-	  break;
-	}
-      else if (c == ':')
-	if (*p == '=')
-	  {
-	    end = p++ - 1;
-	    flavor = f_simple;
-	    break;
-	  }
-	else
-	  /* A colon other than := is a rule line, not a variable defn.  */
-	  return 0;
-      else if (c == '+' && *p == '=')
-	{
-	  end = p++ - 1;
-	  flavor = f_append;
-	  break;
-	}
-      else if (c == '?' && *p == '=')
-        {
-          end = p++ - 1;
-          flavor = f_conditional;
-          break;
-        }
-      else if (c == '$')
-	{
-	  /* This might begin a variable expansion reference.  Make sure we
-	     don't misrecognize chars inside the reference as =, := or +=.  */
+	  /* This begins a variable expansion reference.  Make sure we don't
+	     treat chars inside the reference as assignment tokens.  */
 	  char closeparen;
 	  int count;
@@ -1332,5 +1393,6 @@
 	    closeparen = '}';
 	  else
-	    continue;		/* Nope.  */
+            /* '$$' or '$X'.  Either way, nothing special to do here.  */
+	    continue;
 
 	  /* P now points past the opening paren or brace.
@@ -1347,13 +1409,87 @@
 		}
 	    }
+          continue;
 	}
-    }
-  v->flavor = flavor;
+
+      /* If we find whitespace skip it, and remember we found it.  */
+      if (isblank ((unsigned char)c))
+        {
+          wspace = 1;
+          p = next_token (p);
+          c = *p;
+          if (c == '\0')
+            return NULL;
+          ++p;
+        }
+
+
+      if (c == '=')
+	{
+	  *flavor = f_recursive;
+	  return (char *)p;
+	}
+
+      /* Match assignment variants (:=, +=, ?=)  */
+      if (*p == '=')
+        {
+          switch (c)
+            {
+              case ':':
+                *flavor = f_simple;
+                break;
+              case '+':
+                *flavor = f_append;
+                break;
+              case '?':
+                *flavor = f_conditional;
+                break;
+              default:
+                /* If we skipped whitespace, non-assignments means no var.  */
+                if (wspace)
+                  return NULL;
+
+                /* Might be assignment, or might be $= or #=.  Check.  */
+                continue;
+            }
+          return (char *)++p;
+        }
+      else if (c == ':')
+        /* A colon other than := is a rule line, not a variable defn.  */
+        return NULL;
+
+      /* If we skipped whitespace, non-assignments means no var.  */
+      if (wspace)
+        return NULL;
+    }
+
+  return (char *)p;
+}
+
+
+/* Try to interpret LINE (a null-terminated string) as a variable definition.
+
+   If LINE was recognized as a variable definition, a pointer to its `struct
+   variable' is returned.  If LINE is not a variable definition, NULL is
+   returned.  */
+
+struct variable *
+assign_variable_definition (struct variable *v, char *line)
+{
+  char *beg;
+  char *end;
+  enum variable_flavor flavor;
+  char *name;
 
   beg = next_token (line);
+  line = parse_variable_definition (beg, &flavor);
+  if (!line)
+    return NULL;
+
+  end = line - (flavor == f_recursive ? 1 : 2);
   while (end > beg && isblank ((unsigned char)end[-1]))
     --end;
-  p = next_token (p);
-  v->value = p;
+  line = next_token (line);
+  v->value = line;
+  v->flavor = flavor;
 
   /* Expand the name, so "$(foo)bar = baz" works.  */
@@ -1377,5 +1513,5 @@
    or without the -e switch, or the command line.
 
-   See the comments for parse_variable_definition().
+   See the comments for assign_variable_definition().
 
    If LINE was recognized as a variable definition, a pointer to its `struct
@@ -1395,5 +1531,5 @@
     v.fileinfo.filenm = 0;
 
-  if (!parse_variable_definition (&v, line))
+  if (!assign_variable_definition (&v, line))
     return 0;
 
@@ -1445,4 +1581,6 @@
   fputs ("# ", stdout);
   fputs (origin, stdout);
+  if (v->private_var)
+    fputs (" private", stdout);
   if (v->fileinfo.filenm)
     printf (_(" (from `%s', line %lu)"),
@@ -1456,5 +1594,5 @@
   else
     {
-      register char *p;
+      char *p;
 
       printf ("%s %s= ", v->name, v->recursive ? v->append ? "+" : "" : ":");
@@ -1554,5 +1692,5 @@
    */
   convert_Path_to_windows32 (path, ';');
-  environ_path = xstrdup (concat ("PATH", "=", path));
+  environ_path = xstrdup (concat (3, "PATH", "=", path));
   putenv (environ_path);
   free (path);
Index: /vendor/gnumake/current/variable.h
===================================================================
--- /vendor/gnumake/current/variable.h	(revision 2595)
+++ /vendor/gnumake/current/variable.h	(revision 2596)
@@ -1,6 +1,6 @@
 /* Definitions for using variables in GNU Make.
 Copyright (C) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
-1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software
-Foundation, Inc.
+1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
+2010 Free Software Foundation, Inc.
 This file is part of GNU Make.
 
@@ -60,8 +60,10 @@
     unsigned int conditional:1; /* Nonzero if set with a ?=. */
     unsigned int per_target:1;	/* Nonzero if a target-specific variable.  */
-    unsigned int special:1;     /* Nonzero if this is a special variable. */
+    unsigned int special:1;     /* Nonzero if this is a special variable.  */
     unsigned int exportable:1;  /* Nonzero if the variable _could_ be
                                    exported.  */
     unsigned int expanding:1;	/* Nonzero if currently being expanded.  */
+    unsigned int private_var:1; /* Nonzero avoids inheritance of this
+                                   target-specific variable.  */
     unsigned int exp_count:EXP_COUNT_BITS;
                                 /* If >1, allow this many self-referential
@@ -93,4 +95,5 @@
     struct variable_set_list *next;	/* Link in the chain.  */
     struct variable_set *set;		/* Variable set.  */
+    int next_is_parent;                 /* True if next is a parent target.  */
   };
 
@@ -108,4 +111,5 @@
 extern char *variable_buffer;
 extern struct variable_set_list *current_variable_set_list;
+extern struct variable *default_goal_var;
 
 /* expand.c */
@@ -152,5 +156,7 @@
                                          enum variable_flavor flavor,
                                          int target_var);
-struct variable *parse_variable_definition (struct variable *v, char *line);
+char *parse_variable_definition (const char *line,
+                                 enum variable_flavor *flavor);
+struct variable *assign_variable_definition (struct variable *v, char *line);
 struct variable *try_variable_definition (const struct floc *flocp, char *line,
                                           enum variable_origin origin,
@@ -175,4 +181,10 @@
                                  current_variable_set_list->set,NILF)
 
+/* Define a variable with a constant name in the current variable set.  */
+
+#define define_variable_cname(n,v,o,r) \
+          define_variable_in_set((n),(sizeof (n) - 1),(v),(o),(r),\
+                                 current_variable_set_list->set,NILF)
+
 /* Define a variable with a location in the current variable set.  */
 
@@ -190,4 +202,13 @@
 #define define_variable_for_file(n,l,v,o,r,f) \
           define_variable_in_set((n),(l),(v),(o),(r),(f)->variables->set,NILF)
+
+void undefine_variable_in_set (const char *name, unsigned int length,
+                               enum variable_origin origin,
+                               struct variable_set *set);
+
+/* Remove variable from the current variable set. */
+
+#define undefine_variable_global(n,l,o) \
+          undefine_variable_in_set((n),(l),(o),NULL)
 
 /* Warn that NAME is an undefined variable.  */
Index: /vendor/gnumake/current/version.c
===================================================================
--- /vendor/gnumake/current/version.c	(revision 2595)
+++ /vendor/gnumake/current/version.c	(revision 2596)
@@ -1,6 +1,6 @@
 /* Record version and build host architecture for GNU make.
 Copyright (C) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
-1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software
-Foundation, Inc.
+1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
+2010 Free Software Foundation, Inc.
 This file is part of GNU Make.
 
Index: /vendor/gnumake/current/vmsdir.h
===================================================================
--- /vendor/gnumake/current/vmsdir.h	(revision 2595)
+++ /vendor/gnumake/current/vmsdir.h	(revision 2596)
@@ -1,5 +1,5 @@
 /* dirent.h for vms
 Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
-2007 Free Software Foundation, Inc.
+2007, 2008, 2009, 2010 Free Software Foundation, Inc.
 This file is part of GNU Make.
 
Index: /vendor/gnumake/current/vmsfunctions.c
===================================================================
--- /vendor/gnumake/current/vmsfunctions.c	(revision 2595)
+++ /vendor/gnumake/current/vmsfunctions.c	(revision 2596)
@@ -1,5 +1,5 @@
 /* VMS functions
 Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
-2007 Free Software Foundation, Inc.
+2007, 2008, 2009, 2010 Free Software Foundation, Inc.
 This file is part of GNU Make.
 
@@ -35,10 +35,8 @@
 opendir (char *dspec)
 {
-  struct DIR *dir  = (struct DIR *)xmalloc (sizeof (struct DIR));
-  struct NAM *dnam = (struct NAM *)xmalloc (sizeof (struct NAM));
+  struct DIR *dir  = xcalloc (sizeof (struct DIR));
+  struct NAM *dnam = xmalloc (sizeof (struct NAM));
   struct FAB *dfab = &dir->fab;
   char *searchspec = xmalloc (MAXNAMLEN + 1);
-
-  memset (dir, 0, sizeof *dir);
 
   *dfab = cc$rms_fab;
@@ -92,5 +90,5 @@
   if (!((i = sys$search (dfab)) & 1))
     {
-      DB (DB_VERBOSE, (_("sys$search failed with %d\n"), i));
+      DB (DB_VERBOSE, (_("sys$search() failed with %d\n"), i));
       return (NULL);
     }
@@ -142,4 +140,8 @@
 }
 
+#if 0
+/*
+ * Is this used? I don't see any reference, so I suggest to remove it.
+ */
 int
 vms_stat (char *name, struct stat *buf)
@@ -238,4 +240,5 @@
   return 0;
 }
+#endif
 
 char *
Index: /vendor/gnumake/current/vmsify.c
===================================================================
--- /vendor/gnumake/current/vmsify.c	(revision 2595)
+++ /vendor/gnumake/current/vmsify.c	(revision 2596)
@@ -1,5 +1,5 @@
 /* vmsify.c -- Module for vms <-> unix file name conversion
 Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
-2007 Free Software Foundation, Inc.
+2007, 2008, 2009, 2010 Free Software Foundation, Inc.
 This file is part of GNU Make.
 
@@ -121,5 +121,9 @@
   char *s;
 
-  INIT_DSC_CSTRING (name_dsc, name);
+  /*
+   * the string isn't changed, but there is no string descriptor with
+   * "const char *dsc$a_pointer"
+   */
+  INIT_DSC_CSTRING (name_dsc, (char *)name);
 
   stat = lib$sys_trnlog (&name_dsc, &resltlen, &reslt_dsc);
@@ -228,4 +232,7 @@
   int as_dir;
   int count;
+  const char *s;
+  const char *s1;
+  const char *s2;
 
   if (name == 0)
@@ -240,6 +247,6 @@
   if (t != 0)
     {
-      const char *s1;
-      const char *s2;
+//      const char *s1;
+//      const char *s2;
 
       if (type == 1)
@@ -273,6 +280,7 @@
   if (t != 0)
     {
-      const char *s;
-      const char *s1 = strchr (t+1, '[');
+//      const char *s;
+//      const char *s1 = strchr (t+1, '[');
+      s1 = strchr (t+1, '[');
       if (s1 == 0)
 	{
@@ -389,6 +397,6 @@
 	  case 3:				/* '//' at start */
             {
-            const char *s;
-            const char *s1;
+//            const char *s;
+//            const char *s1;
             char *vp;
 	    while (*fptr == '/')	/* collapse all '/' */
Index: /vendor/gnumake/current/vmsjobs.c
===================================================================
--- /vendor/gnumake/current/vmsjobs.c	(revision 2595)
+++ /vendor/gnumake/current/vmsjobs.c	(revision 2596)
@@ -3,5 +3,5 @@
 
 Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
-2007 Free Software Foundation, Inc.
+2007, 2008, 2009, 2010 Free Software Foundation, Inc.
 This file is part of GNU Make.
 
@@ -111,6 +111,9 @@
 }
 
-/* This is called as an AST when a child process dies (it won't get
-   interrupted by anything except a higher level AST).
+static int ctrlYPressed= 0;
+/* This is called at main or AST level. It is at AST level for DONTWAITFORCHILD
+   and at main level otherwise. In any case it is called when a child process
+   terminated. At AST level it won't get interrupted by anything except a
+   inner mode level AST.
 */
 int
@@ -124,4 +127,10 @@
 
     lib$free_ef(&child->efn);
+    if (child->comname)
+      {
+        if (!ISDB (DB_JOBS)&&!ctrlYPressed)
+          unlink (child->comname);
+        free (child->comname);
+      }
 
     (void) sigblock (fatal_signal_mask);
@@ -220,6 +229,5 @@
 static int oldCtrlMask;
 static int setupYAstTried= 0;
-static int pidToAbort= 0;
-static int chan= 0;
+static unsigned short int chan= 0;
 
 static void
@@ -229,12 +237,13 @@
 }
 
-static void
-astHandler (void)
+static int
+astYHandler (void)
 {
-	if (pidToAbort) {
-		sys$forcex (&pidToAbort, 0, SS$_ABORT);
-		pidToAbort= 0;
-	}
+	struct child *c;
+	for (c = children; c != 0; c = c->next)
+		sys$delprc (&c->pid, 0, 0);
+	ctrlYPressed= 1;
 	kill (getpid(),SIGQUIT);
+	return SS$_NORMAL;
 }
 
@@ -248,9 +257,12 @@
 		int	dvi;
 	} iosb;
+	unsigned short int loc_chan;
 
 	setupYAstTried++;
 
-	if (!chan) {
-		status= sys$assign(&inputDsc,&chan,0,0);
+	if (chan)
+          loc_chan= chan;
+	else {
+		status= sys$assign(&inputDsc,&loc_chan,0,0);
 		if (!(status&SS$_NORMAL)) {
 			lib$signal(status);
@@ -258,20 +270,13 @@
 		}
 	}
-	status= sys$qiow (0, chan, IO$_SETMODE|IO$M_CTRLYAST,&iosb,0,0,
-		astHandler,0,0,0,0,0);
-	if (status==SS$_NORMAL)
-		status= iosb.status;
-        if (status==SS$_ILLIOFUNC || status==SS$_NOPRIV) {
-		sys$dassgn(chan);
-#ifdef	CTRLY_ENABLED_ANYWAY
-		fprintf (stderr,
-                         _("-warning, CTRL-Y will leave sub-process(es) around.\n"));
-#else
-		return;
-#endif
-	}
-	else if (!(status&SS$_NORMAL)) {
-		sys$dassgn(chan);
-		lib$signal(status);
+	status= sys$qiow (0, loc_chan, IO$_SETMODE|IO$M_CTRLYAST,&iosb,0,0,
+                          astYHandler,0,0,0,0,0);
+        if (status==SS$_NORMAL)
+          	status= iosb.status;
+	if (status!=SS$_NORMAL) {
+		if (!chan)
+			sys$dassgn(loc_chan);
+		if (status!=SS$_ILLIOFUNC && status!=SS$_NOPRIV)
+			lib$signal(status);
 		return;
 	}
@@ -288,4 +293,6 @@
 		return;
 	}
+	if (!chan)
+		chan = loc_chan;
 }
 
@@ -300,4 +307,5 @@
   static struct dsc$descriptor_s efiledsc;
   int have_redirection = 0;
+  int have_append = 0;
   int have_newline = 0;
 
@@ -306,5 +314,5 @@
   char *cmd = alloca (strlen (argv) + 512), *p, *q;
   char ifile[256], ofile[256], efile[256];
-  char *comname = 0;
+  int comnamelen;
   char procname[100];
   int in_string;
@@ -315,4 +323,5 @@
   ofile[0] = 0;
   efile[0] = 0;
+  child->comname = NULL;
 
   DB (DB_JOBS, ("child_execute_job (%s)\n", argv));
@@ -384,4 +393,9 @@
 	    else
 	      {
+                if (*(p+1) == '>')
+                  {
+                    have_append = 1;
+                    p += 1;
+                  }
 		p = vms_redirect (&ofiledsc, ofile, p);
 	      }
@@ -482,7 +496,8 @@
 	}
 
-      outfile = open_tmpfile (&comname, "sys$scratch:CMDXXXXXX.COM");
+      outfile = open_tmpfile (&child->comname, "sys$scratch:CMDXXXXXX.COM");
       if (outfile == 0)
 	pfatal_with_name (_("fopen (temporary file)"));
+      comnamelen = strlen (child->comname);
 
       if (ifile[0])
@@ -502,7 +517,17 @@
       if (ofile[0])
 	{
-	  fprintf (outfile, "$ define sys$output %s\n", ofile);
-	  DB (DB_JOBS, (_("Redirected output to %s\n"), ofile));
-	  ofiledsc.dsc$w_length = 0;
+          if (have_append)
+            {
+              fprintf (outfile, "$ set noon\n");
+              fprintf (outfile, "$ define sys$output %.*s\n", comnamelen-3, child->comname);
+              DB (DB_JOBS, (_("Append output to %s\n"), ofile));
+              ofiledsc.dsc$w_length = 0;
+            }
+          else
+            {
+              fprintf (outfile, "$ define sys$output %s\n", ofile);
+              DB (DB_JOBS, (_("Redirected output to %s\n"), ofile));
+              ofiledsc.dsc$w_length = 0;
+            }
 	}
 
@@ -559,10 +584,23 @@
   	}
 
-      fwrite (p, 1, q - p, outfile);
+      if (*p)
+        {
+          fwrite (p, 1, --q - p, outfile);
       fputc ('\n', outfile);
+        }
+
+      if (have_append)
+        {
+          fprintf (outfile, "$ deassign sys$output ! 'f$verify(0)\n");
+          fprintf (outfile, "$ append:=append\n");
+          fprintf (outfile, "$ delete:=delete\n");
+          fprintf (outfile, "$ append/new %.*s %s\n", comnamelen-3, child->comname, ofile);
+          fprintf (outfile, "$ delete %.*s;*\n", comnamelen-3, child->comname);
+          DB (DB_JOBS, (_("Append %.*s and cleanup\n"), comnamelen-3, child->comname));
+        }
 
       fclose (outfile);
 
-      sprintf (cmd, "$ @%s", comname);
+      sprintf (cmd, "$ @%s", child->comname);
 
       DB (DB_JOBS, (_("Executing %s instead\n"), cmd));
@@ -579,5 +617,13 @@
       status = lib$get_ef ((unsigned long *)&child->efn);
       if (!(status & 1))
-	return 0;
+        {
+          if (child->comname)
+            {
+              if (!ISDB (DB_JOBS))
+                unlink (child->comname);
+              free (child->comname);
+            }
+          return 0;
+        }
     }
 
@@ -648,7 +694,5 @@
   if (status & 1)
     {
-      pidToAbort= child->pid;
       status= sys$waitfr (child->efn);
-      pidToAbort= 0;
       vmsHandleChildTerm(child);
     }
@@ -678,7 +722,4 @@
     }
 
-  if (comname && !ISDB (DB_JOBS))
-    unlink (comname);
-
   return (status & 1);
 }
Index: /vendor/gnumake/current/vpath.c
===================================================================
--- /vendor/gnumake/current/vpath.c	(revision 2595)
+++ /vendor/gnumake/current/vpath.c	(revision 2596)
@@ -1,6 +1,6 @@
 /* Implementation of pattern-matching file search paths for GNU Make.
 Copyright (C) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
-1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software
-Foundation, Inc.
+1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
+2010 Free Software Foundation, Inc.
 This file is part of GNU Make.
 
@@ -140,5 +140,5 @@
 
 
-/* Construct the VPATH listing for the pattern and searchpath given.
+/* Construct the VPATH listing for the PATTERN and DIRPATH given.
 
    This function is called to generate selective VPATH lists and also for
@@ -148,7 +148,7 @@
    variable.
 
-   If SEARCHPATH is nil, remove all previous listings with the same
+   If DIRPATH is nil, remove all previous listings with the same
    pattern.  If PATTERN is nil, remove all VPATH listings.  Existing
-   and readable directories that are not "." given in the searchpath
+   and readable directories that are not "." given in the DIRPATH
    separated by the path element separator (defined in make.h) are
    loaded into the directory hash table if they are not there already
@@ -195,5 +195,6 @@
 
 	      /* Free its unused storage.  */
-	      free (path->searchpath);
+              /* MSVC erroneously warns without a cast here.  */
+	      free ((void *)path->searchpath);
 	      free (path);
 	    }
@@ -300,5 +301,6 @@
   else
     /* There were no entries, so free whatever space we allocated.  */
-    free (vpath);
+    /* MSVC erroneously warns without a cast here.  */
+    free ((void *)vpath);
 }
 
@@ -325,9 +327,10 @@
    FILE exists.  If it is found, we return a cached name of the existing file
    and set *MTIME_PTR (if MTIME_PTR is not NULL) to its modtime (or zero if no
-   stat call was done).  Otherwise we return NULL.  */
+   stat call was done). Also set the matching directory index in PATH_INDEX
+   if it is not NULL. Otherwise we return NULL.  */
 
 static const char *
 selective_vpath_search (struct vpath *path, const char *file,
-                        FILE_TIMESTAMP *mtime_ptr)
+                        FILE_TIMESTAMP *mtime_ptr, unsigned int* path_index)
 {
   int not_target;
@@ -509,4 +512,7 @@
           /* Store the name we found and return it.  */
 
+          if (path_index)
+            *path_index = i;
+
           return strcache_add_len (name, (p + 1 - name) + flen);
 	}
@@ -520,8 +526,10 @@
    exists.  If it is found, return the cached name of an existing file, and
    set *MTIME_PTR (if MTIME_PTR is not NULL) to its modtime (or zero if no
-   stat call was done).  Otherwise we return 0.  */
+   stat call was done). Also set the matching directory index in VPATH_INDEX
+   and PATH_INDEX if they are not NULL.  Otherwise we return 0.  */
 
 const char *
-vpath_search (const char *file, FILE_TIMESTAMP *mtime_ptr)
+vpath_search (const char *file, FILE_TIMESTAMP *mtime_ptr,
+              unsigned int* vpath_index, unsigned int* path_index)
 {
   struct vpath *v;
@@ -537,15 +545,29 @@
     return 0;
 
+  if (vpath_index)
+    {
+      *vpath_index = 0;
+      *path_index = 0;
+    }
+
   for (v = vpaths; v != 0; v = v->next)
-    if (pattern_matches (v->pattern, v->percent, file))
-      {
-        const char *p = selective_vpath_search (v, file, mtime_ptr);
-        if (p)
-          return p;
-      }
+    {
+      if (pattern_matches (v->pattern, v->percent, file))
+        {
+          const char *p = selective_vpath_search (
+            v, file, mtime_ptr, path_index);
+          if (p)
+            return p;
+        }
+
+      if (vpath_index)
+        ++*vpath_index;
+    }
+
 
   if (general_vpath != 0)
     {
-      const char *p = selective_vpath_search (general_vpath, file, mtime_ptr);
+      const char *p = selective_vpath_search (
+        general_vpath, file, mtime_ptr, path_index);
       if (p)
         return p;
@@ -554,4 +576,7 @@
   return 0;
 }
+
+
+
 
 
Index: /vendor/gnumake/current/w32/Makefile.am
===================================================================
--- /vendor/gnumake/current/w32/Makefile.am	(revision 2595)
+++ /vendor/gnumake/current/w32/Makefile.am	(revision 2596)
@@ -1,5 +1,5 @@
 # Makefile.am to create libw32.a for mingw32 host.
 # Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
-# 2007 Free Software Foundation, Inc.
+# 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
 # This file is part of GNU Make.
 #
Index: /vendor/gnumake/current/w32/compat/dirent.c
===================================================================
--- /vendor/gnumake/current/w32/compat/dirent.c	(revision 2595)
+++ /vendor/gnumake/current/w32/compat/dirent.c	(revision 2596)
@@ -1,5 +1,5 @@
 /* Directory entry code for Window platforms.
 Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
-2006, 2007 Free Software Foundation, Inc.
+2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
 This file is part of GNU Make.
 
@@ -17,4 +17,5 @@
 
 
+#include <config.h>
 #include <sys/types.h>
 #include <sys/stat.h>
@@ -133,5 +134,5 @@
 
 	/* fill in struct dirent values */
-	pDir->dir_sdReturn.d_ino = -1;
+	pDir->dir_sdReturn.d_ino = (ino_t)-1;
 	strcpy(pDir->dir_sdReturn.d_name, wfdFindData.cFileName);
 
Index: /vendor/gnumake/current/w32/include/dirent.h
===================================================================
--- /vendor/gnumake/current/w32/include/dirent.h	(revision 2595)
+++ /vendor/gnumake/current/w32/include/dirent.h	(revision 2596)
@@ -1,5 +1,5 @@
 /* Windows version of dirent.h
 Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
-2007 Free Software Foundation, Inc.
+2007, 2008, 2009, 2010 Free Software Foundation, Inc.
 This file is part of GNU Make.
 
Index: /vendor/gnumake/current/w32/include/pathstuff.h
===================================================================
--- /vendor/gnumake/current/w32/include/pathstuff.h	(revision 2595)
+++ /vendor/gnumake/current/w32/include/pathstuff.h	(revision 2596)
@@ -1,5 +1,5 @@
 /* Definitions for Windows path manipulation.
 Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
-2007 Free Software Foundation, Inc.
+2007, 2008, 2009, 2010 Free Software Foundation, Inc.
 This file is part of GNU Make.
 
Index: /vendor/gnumake/current/w32/include/sub_proc.h
===================================================================
--- /vendor/gnumake/current/w32/include/sub_proc.h	(revision 2595)
+++ /vendor/gnumake/current/w32/include/sub_proc.h	(revision 2596)
@@ -1,5 +1,5 @@
 /* Definitions for Windows process invocation.
 Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
-2006, 2007 Free Software Foundation, Inc.
+2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
 This file is part of GNU Make.
 
@@ -22,9 +22,9 @@
  * Component Name:
  *
- * $Date: 2007/10/24 20:06:32 $
+ * $Date: 2010/07/13 01:20:43 $
  *
  * $Source: /sources/make/make/w32/include/sub_proc.h,v $
  *
- * $Id: sub_proc.h,v 1.10 2007/10/24 20:06:32 eliz Exp $
+ * $Id: sub_proc.h,v 1.12 2010/07/13 01:20:43 psmith Exp $
  */
 
Index: /vendor/gnumake/current/w32/include/w32err.h
===================================================================
--- /vendor/gnumake/current/w32/include/w32err.h	(revision 2595)
+++ /vendor/gnumake/current/w32/include/w32err.h	(revision 2596)
@@ -1,5 +1,5 @@
 /* Definitions for Windows error handling.
 Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
-2006, 2007 Free Software Foundation, Inc.
+2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
 This file is part of GNU Make.
 
Index: /vendor/gnumake/current/w32/pathstuff.c
===================================================================
--- /vendor/gnumake/current/w32/pathstuff.c	(revision 2595)
+++ /vendor/gnumake/current/w32/pathstuff.c	(revision 2596)
@@ -1,5 +1,5 @@
 /* Path conversion for Windows pathnames.
 Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
-2007 Free Software Foundation, Inc.
+2007, 2008, 2009, 2010 Free Software Foundation, Inc.
 This file is part of GNU Make.
 
@@ -16,7 +16,7 @@
 this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
+#include "make.h"
 #include <string.h>
 #include <stdlib.h>
-#include "make.h"
 #include "pathstuff.h"
 
@@ -50,4 +50,7 @@
 
     /* is this a multi-element Path ? */
+    /* FIXME: Perhaps use ":;\"" in strpbrk to convert all quotes to
+       delimiters as well, as a way to handle quoted directories in
+       PATH?  */
     for (p = Path, etok = strpbrk(p, ":;");
          etok;
@@ -75,6 +78,9 @@
                 ;
             etok = strpbrk(p, ":;");        /* find next delimiter */
-            *etok = to_delim;
-            p = ++etok;
+            if (etok) {
+                *etok = to_delim;
+                p = ++etok;
+	    } else
+                p += strlen(p);
         } else {
             /* found another one, no drive letter */
Index: /vendor/gnumake/current/w32/subproc/NMakefile
===================================================================
--- /vendor/gnumake/current/w32/subproc/NMakefile	(revision 2595)
+++ /vendor/gnumake/current/w32/subproc/NMakefile	(revision 2596)
@@ -3,5 +3,5 @@
 #
 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
-# 2006, 2007 Free Software Foundation, Inc.
+# 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
 # This file is part of GNU Make.
 #
Index: /vendor/gnumake/current/w32/subproc/build.bat
===================================================================
--- /vendor/gnumake/current/w32/subproc/build.bat	(revision 2595)
+++ /vendor/gnumake/current/w32/subproc/build.bat	(revision 2596)
@@ -19,5 +19,5 @@
 @echo off
 rem Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
-rem 2005, 2006, 2007 Free Software Foundation, Inc.
+rem 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
 rem This file is part of GNU Make.
 rem
Index: /vendor/gnumake/current/w32/subproc/misc.c
===================================================================
--- /vendor/gnumake/current/w32/subproc/misc.c	(revision 2595)
+++ /vendor/gnumake/current/w32/subproc/misc.c	(revision 2596)
@@ -1,5 +1,5 @@
 /* Process handling for Windows
 Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
-2006, 2007 Free Software Foundation, Inc.
+2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
 This file is part of GNU Make.
 
@@ -16,4 +16,5 @@
 this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
+#include <config.h>
 #include <stddef.h>
 #include <stdlib.h>
@@ -78,5 +79,5 @@
 	}
 
-        free(tmp);
+	free(tmp);
 	return TRUE;
 }
Index: /vendor/gnumake/current/w32/subproc/proc.h
===================================================================
--- /vendor/gnumake/current/w32/subproc/proc.h	(revision 2595)
+++ /vendor/gnumake/current/w32/subproc/proc.h	(revision 2596)
@@ -1,5 +1,5 @@
 /* Definitions for Windows
 Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
-2006, 2007 Free Software Foundation, Inc.
+2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
 This file is part of GNU Make.
 
Index: /vendor/gnumake/current/w32/subproc/sub_proc.c
===================================================================
--- /vendor/gnumake/current/w32/subproc/sub_proc.c	(revision 2595)
+++ /vendor/gnumake/current/w32/subproc/sub_proc.c	(revision 2596)
@@ -1,5 +1,5 @@
 /* Process handling for Windows.
 Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
-2006, 2007 Free Software Foundation, Inc.
+2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
 This file is part of GNU Make.
 
@@ -16,6 +16,12 @@
 this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
+#include <config.h>
 #include <stdlib.h>
 #include <stdio.h>
+#ifdef _MSC_VER
+# include <stddef.h>    /* for intptr_t */
+#else
+# include <stdint.h>
+#endif
 #include <process.h>  /* for msvc _beginthreadex, _endthreadex */
 #include <signal.h>
@@ -25,13 +31,13 @@
 #include "proc.h"
 #include "w32err.h"
-#include "config.h"
 #include "debug.h"
 
 static char *make_command_line(char *shell_name, char *exec_path, char **argv);
+extern char *xmalloc (unsigned int);
 
 typedef struct sub_process_t {
-	int sv_stdin[2];
-	int sv_stdout[2];
-	int sv_stderr[2];
+	intptr_t sv_stdin[2];
+	intptr_t sv_stdout[2];
+	intptr_t sv_stderr[2];
 	int using_pipes;
 	char *inp;
@@ -41,5 +47,5 @@
 	char * volatile errp;
 	volatile DWORD errcnt;
-	int pid;
+	pid_t pid;
 	int exit_code;
 	int signal;
@@ -310,10 +316,10 @@
 		return((HANDLE)pproc);
 	}
-	pproc->sv_stdin[0]  = (int) stdin_pipes[0];
-	pproc->sv_stdin[1]  = (int) stdin_pipes[1];
-	pproc->sv_stdout[0] = (int) stdout_pipes[0];
-	pproc->sv_stdout[1] = (int) stdout_pipes[1];
-	pproc->sv_stderr[0] = (int) stderr_pipes[0];
-	pproc->sv_stderr[1] = (int) stderr_pipes[1];
+	pproc->sv_stdin[0]  = (intptr_t) stdin_pipes[0];
+	pproc->sv_stdin[1]  = (intptr_t) stdin_pipes[1];
+	pproc->sv_stdout[0] = (intptr_t) stdout_pipes[0];
+	pproc->sv_stdout[1] = (intptr_t) stdout_pipes[1];
+	pproc->sv_stderr[0] = (intptr_t) stderr_pipes[0];
+	pproc->sv_stderr[1] = (intptr_t) stderr_pipes[1];
 
 	pproc->using_pipes = 1;
@@ -337,7 +343,7 @@
 	 * pipe, bypassing pipes altogether.
 	 */
-	pproc->sv_stdin[1]  = (int) stdinh;
-	pproc->sv_stdout[1] = (int) stdouth;
-	pproc->sv_stderr[1] = (int) stderrh;
+	pproc->sv_stdin[1]  = (intptr_t) stdinh;
+	pproc->sv_stdout[1] = (intptr_t) stdouth;
+	pproc->sv_stderr[1] = (intptr_t) stderrh;
 
 	pproc->last_err = pproc->lerrno = 0;
@@ -348,51 +354,52 @@
 
 static HANDLE
-find_file(char *exec_path, LPOFSTRUCT file_info)
+find_file(const char *exec_path, const char *path_var,
+	  char *full_fname, DWORD full_len)
 {
 	HANDLE exec_handle;
 	char *fname;
 	char *ext;
-
-	fname = malloc(strlen(exec_path) + 5);
+	DWORD req_len;
+	int i;
+	static const char *extensions[] =
+	  /* Should .com come before no-extension case?  */
+	  { ".exe", ".cmd", ".bat", "", ".com", NULL };
+
+	fname = xmalloc(strlen(exec_path) + 5);
 	strcpy(fname, exec_path);
 	ext = fname + strlen(fname);
 
-	strcpy(ext, ".exe");
-	if ((exec_handle = (HANDLE)OpenFile(fname, file_info,
-			OF_READ | OF_SHARE_COMPAT)) != (HANDLE)HFILE_ERROR) {
-		free(fname);
-		return(exec_handle);
-	}
-
-	strcpy(ext, ".cmd");
-	if ((exec_handle = (HANDLE)OpenFile(fname, file_info,
-			OF_READ | OF_SHARE_COMPAT)) != (HANDLE)HFILE_ERROR) {
-		free(fname);
-		return(exec_handle);
-	}
-
-	strcpy(ext, ".bat");
-	if ((exec_handle = (HANDLE)OpenFile(fname, file_info,
-			OF_READ | OF_SHARE_COMPAT)) != (HANDLE)HFILE_ERROR) {
-		free(fname);
-		return(exec_handle);
-	}
-
-	/* should .com come before this case? */
-	if ((exec_handle = (HANDLE)OpenFile(exec_path, file_info,
-			OF_READ | OF_SHARE_COMPAT)) != (HANDLE)HFILE_ERROR) {
-		free(fname);
-		return(exec_handle);
-	}
-
-	strcpy(ext, ".com");
-	if ((exec_handle = (HANDLE)OpenFile(fname, file_info,
-			OF_READ | OF_SHARE_COMPAT)) != (HANDLE)HFILE_ERROR) {
-		free(fname);
-		return(exec_handle);
+	for (i = 0; extensions[i]; i++) {
+		strcpy(ext, extensions[i]);
+		if (((req_len = SearchPath (path_var, fname, NULL, full_len,
+					    full_fname, NULL)) > 0
+		     /* For compatibility with previous code, which
+			used OpenFile, and with Windows operation in
+			general, also look in various default
+			locations, such as Windows directory and
+			Windows System directory.  Warning: this also
+			searches PATH in the Make's environment, which
+			might not be what the Makefile wants, but it
+			seems to be OK as a fallback, after the
+			previous SearchPath failed to find on child's
+			PATH.  */
+		     || (req_len = SearchPath (NULL, fname, NULL, full_len,
+					       full_fname, NULL)) > 0)
+		    && req_len <= full_len
+		    && (exec_handle =
+				CreateFile(full_fname,
+					   GENERIC_READ,
+					   FILE_SHARE_READ | FILE_SHARE_WRITE,
+					   NULL,
+					   OPEN_EXISTING,
+					   FILE_ATTRIBUTE_NORMAL,
+					   NULL)) != INVALID_HANDLE_VALUE) {
+			free(fname);
+			return(exec_handle);
+		}
 	}
 
 	free(fname);
-	return(exec_handle);
+	return INVALID_HANDLE_VALUE;
 }
 
@@ -417,4 +424,7 @@
 	int file_not_found=0;
 	HANDLE exec_handle;
+	char exec_fname[MAX_PATH];
+	const char *path_var = NULL;
+	char **ep;
 	char buf[256];
 	DWORD bytes_returned;
@@ -424,6 +434,4 @@
 	PROCESS_INFORMATION procInfo;
 	char *envblk=NULL;
-	OFSTRUCT file_info;
-
 
 	/*
@@ -434,14 +442,25 @@
 	 *  assume it's in the path somewhere (generally, the NT tools
 	 *  bin directory)
-	 *  We use OpenFile here because it is capable of searching the Path.
-	 */
-
-	exec_handle = find_file(exec_path, &file_info);
+	 */
+
+	/* Use the Makefile's value of PATH to look for the program to
+	   execute, because it could be different from Make's PATH
+	   (e.g., if the target sets its own value.  */
+	if (envp)
+		for (ep = envp; *ep; ep++) {
+			if (strncmp (*ep, "PATH=", 5) == 0
+			    || strncmp (*ep, "Path=", 5) == 0) {
+				path_var = *ep + 5;
+				break;
+			}
+		}
+	exec_handle = find_file(exec_path, path_var,
+				exec_fname, sizeof(exec_fname));
 
 	/*
-	 * If we couldn't open the file, just assume that Windows32 will be able
-	 * to find and execute it.
-	 */
-	if (exec_handle == (HANDLE)HFILE_ERROR) {
+	 * If we couldn't open the file, just assume that Windows will be
+	 * somehow able to find and execute it.
+	 */
+	if (exec_handle == INVALID_HANDLE_VALUE) {
 		file_not_found++;
 	}
@@ -497,6 +516,5 @@
 		command_line = make_command_line( shell_name, exec_path, argv);
 	else
-		command_line = make_command_line( shell_name, file_info.szPathName,
-				 argv);
+		command_line = make_command_line( shell_name, exec_fname, argv);
 
 	if ( command_line == NULL ) {
@@ -518,5 +536,5 @@
 		exec_path = 0;	/* Search for the program in %Path% */
 	} else {
-		exec_path = file_info.szPathName;
+		exec_path = exec_fname;
 	}
 
@@ -563,5 +581,5 @@
 	}
 
-	pproc->pid = (int)procInfo.hProcess;
+	pproc->pid = (pid_t)procInfo.hProcess;
 	/* Close the thread handle -- we'll just watch the process */
 	CloseHandle(procInfo.hThread);
Index: /vendor/gnumake/current/w32/subproc/w32err.c
===================================================================
--- /vendor/gnumake/current/w32/subproc/w32err.c	(revision 2595)
+++ /vendor/gnumake/current/w32/subproc/w32err.c	(revision 2596)
@@ -1,5 +1,5 @@
 /* Error handling for Windows
 Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
-2006, 2007 Free Software Foundation, Inc.
+2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
 This file is part of GNU Make.
 
