summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorManoj Srivastava <srivasta@golden-gryphon.com>2016-08-01 01:09:02 -0700
committerManoj Srivastava <srivasta@golden-gryphon.com>2016-08-01 01:09:02 -0700
commitcae4fe5df01ef0e0f4977c15085bb6df16d70f3a (patch)
tree7c37550107df32bfd25ef4ba594f2bf017bb226b
parent38ebe83c5bc047a1f5c1c8f9734d0303f22603f8 (diff)
parent9ab8af7cd8aaac587787d9df7e34758951d7c470 (diff)
Merge tag '4.2.1' into upstream
GNU Make release 4.2.1 Signed-off-by: Manoj Srivastava <srivasta@golden-gryphon.com> # gpg: Signature made Fri 10 Jun 2016 04:30:54 PM PDT # gpg: using DSA key 96B047156338B6D4 # gpg: Good signature from "Paul Smith (Mad Scientist) <psmith@gnu.org>" # gpg: WARNING: This key is not certified with a trusted signature! # gpg: There is no indication that the signature belongs to the owner. # Primary key fingerprint: 3D25 54F0 A153 38AB 9AF1 BB9D 96B0 4715 6338 B6D4 # Conflicts: # AUTHORS # Makefile.am # Makefile.ami # NEWS # README.Amiga # README.VMS # README.customs # acinclude.m4 # amiga.c # amiga.h # ar.c # arscan.c # build_w32.bat # commands.c # commands.h # config/Makefile.am # config/dospaths.m4 # configure.ac # configure.bat # debug.h # default.c # dep.h # dir.c # doc/Makefile.am # doc/make.texi # dosbuild.bat # expand.c # file.c # filedef.h # function.c # getloadavg.c # getopt.c # getopt.h # getopt1.c # gettext.h # gmk-default.scm # gnumake.h # guile.c # implicit.c # job.c # job.h # load.c # loadapi.c # main.c # make.1 # make_msvc_net2003.vcproj # makefile.com # makefile.vms # makeint.h # misc.c # output.c # output.h # po/Makevars # po/POTFILES.in # read.c # remake.c # remote-cstms.c # remote-stub.c # rule.c # rule.h # signame.c # strcache.c # subproc.bat # tests/ChangeLog.1 # tests/NEWS # tests/README # tests/config_flags_pm.com # tests/mkshadow # tests/run_make_tests.com # tests/run_make_tests.pl # tests/scripts/features/archives # tests/scripts/features/conditionals # tests/scripts/features/double_colon # tests/scripts/features/errors # tests/scripts/features/include # tests/scripts/features/jobserver # tests/scripts/features/load # tests/scripts/features/output-sync # tests/scripts/features/parallelism # tests/scripts/features/patternrules # tests/scripts/features/vpath3 # tests/scripts/features/vpathplus # tests/scripts/functions/call # tests/scripts/functions/error # tests/scripts/functions/file # tests/scripts/functions/foreach # tests/scripts/functions/shell # tests/scripts/functions/sort # tests/scripts/functions/warning # tests/scripts/misc/bs-nl # tests/scripts/misc/fopen-fail # tests/scripts/misc/general3 # tests/scripts/options/dash-B # tests/scripts/options/dash-W # tests/scripts/options/dash-k # tests/scripts/options/dash-n # tests/scripts/options/dash-q # tests/scripts/options/print-directory # tests/scripts/targets/POSIX # tests/scripts/variables/MAKEFLAGS # tests/scripts/variables/MAKE_RESTARTS # tests/scripts/variables/SHELL # tests/scripts/variables/special # tests/test_driver.pl # variable.c # variable.h # version.c # vmsdir.h # vmsfunctions.c # vmsify.c # vmsjobs.c # vpath.c # w32/Makefile.am # w32/compat/dirent.c # w32/compat/posixfcn.c # w32/include/dirent.h # w32/include/dlfcn.h # w32/include/pathstuff.h # w32/include/sub_proc.h # w32/include/w32err.h # w32/pathstuff.c # w32/subproc/NMakefile # w32/subproc/misc.c # w32/subproc/proc.h # w32/subproc/sub_proc.c # w32/subproc/w32err.c
-rw-r--r--.gitignore62
-rw-r--r--.purify12
-rw-r--r--AUTHORS2
-rw-r--r--ChangeLog.14997
-rw-r--r--ChangeLog.26653
-rw-r--r--ChangeLog.35633
-rw-r--r--Makefile.DOS.template587
-rw-r--r--Makefile.am31
-rw-r--r--Makefile.ami2
-rw-r--r--NEWS313
-rw-r--r--NMakefile.template132
-rw-r--r--README.Amiga2
-rw-r--r--README.DOS.template340
-rw-r--r--README.OS2.template176
-rw-r--r--README.VMS687
-rw-r--r--README.W32.template314
-rw-r--r--README.customs2
-rw-r--r--README.git292
-rw-r--r--README.template178
-rw-r--r--SMakefile.template218
-rw-r--r--TODO.private117
-rw-r--r--acinclude.m42
-rw-r--r--amiga.c2
-rw-r--r--amiga.h2
-rw-r--r--ar.c10
-rw-r--r--arscan.c93
-rw-r--r--build.template81
-rw-r--r--build_w32.bat560
-rw-r--r--commands.c12
-rw-r--r--commands.h7
-rw-r--r--config.ami.template337
-rw-r--r--config.h-vms.template432
-rw-r--r--config.h.W32.template532
-rw-r--r--config/.gitignore12
-rw-r--r--config/ChangeLog.149
-rw-r--r--config/Makefile.am2
-rw-r--r--config/dospaths.m42
-rw-r--r--configh.dos.template113
-rw-r--r--configure.ac30
-rw-r--r--configure.bat120
-rw-r--r--debug.h2
-rw-r--r--default.c96
-rw-r--r--dep.h101
-rw-r--r--dir.c223
-rw-r--r--doc/.gitignore22
-rw-r--r--doc/Makefile.am2
-rw-r--r--doc/make.texi359
-rw-r--r--dosbuild.bat130
-rw-r--r--expand.c21
-rw-r--r--file.c31
-rw-r--r--filedef.h11
-rw-r--r--function.c341
-rw-r--r--getloadavg.c2
-rw-r--r--getopt.c2
-rw-r--r--getopt.h2
-rw-r--r--getopt1.c2
-rw-r--r--gettext.h2
-rw-r--r--gmk-default.scm2
-rw-r--r--gnumake.h2
-rw-r--r--guile.c6
-rw-r--r--implicit.c31
-rw-r--r--job.c634
-rw-r--r--job.h20
-rw-r--r--load.c30
-rw-r--r--loadapi.c18
-rw-r--r--main.c596
-rw-r--r--maintMakefile410
-rw-r--r--make.14
-rw-r--r--make_msvc_net2003.vcproj677
-rw-r--r--makefile.com13
-rw-r--r--makefile.vms19
-rw-r--r--makeint.h194
-rw-r--r--misc.c32
-rw-r--r--os.h84
-rw-r--r--output.c22
-rw-r--r--output.h2
-rw-r--r--po/.gitignore15
-rw-r--r--po/Makevars2
-rw-r--r--po/POTFILES.in4
-rw-r--r--posixos.c431
-rw-r--r--prepare_vms.com59
-rw-r--r--prepare_w32.bat6
-rw-r--r--read.c191
-rw-r--r--remake.c151
-rw-r--r--remote-cstms.c4
-rw-r--r--remote-stub.c2
-rw-r--r--rule.c3
-rw-r--r--rule.h3
-rw-r--r--signame.c2
-rw-r--r--strcache.c133
-rw-r--r--subproc.bat47
-rw-r--r--tests/.gitignore2
-rw-r--r--tests/ChangeLog.12
-rw-r--r--tests/NEWS2
-rw-r--r--tests/README2
-rwxr-xr-xtests/config_flags_pm.com2
-rwxr-xr-xtests/mkshadow2
-rwxr-xr-xtests/run_make_tests.com8
-rw-r--r--tests/run_make_tests.pl23
-rw-r--r--tests/scripts/features/archives180
-rw-r--r--tests/scripts/features/conditionals16
-rw-r--r--tests/scripts/features/double_colon60
-rw-r--r--tests/scripts/features/errors22
-rw-r--r--tests/scripts/features/include64
-rw-r--r--tests/scripts/features/jobserver52
-rw-r--r--tests/scripts/features/load2
-rw-r--r--tests/scripts/features/output-sync26
-rw-r--r--tests/scripts/features/parallelism13
-rw-r--r--tests/scripts/features/patternrules7
-rw-r--r--tests/scripts/features/vpath38
-rw-r--r--tests/scripts/features/vpathplus7
-rw-r--r--tests/scripts/functions/call54
-rw-r--r--tests/scripts/functions/error10
-rw-r--r--tests/scripts/functions/file43
-rw-r--r--tests/scripts/functions/foreach24
-rw-r--r--tests/scripts/functions/shell32
-rw-r--r--tests/scripts/functions/sort22
-rw-r--r--tests/scripts/functions/warning30
-rw-r--r--tests/scripts/misc/bs-nl98
-rw-r--r--tests/scripts/misc/fopen-fail5
-rw-r--r--tests/scripts/misc/general32
-rw-r--r--tests/scripts/options/dash-B6
-rw-r--r--tests/scripts/options/dash-W7
-rw-r--r--tests/scripts/options/dash-k5
-rw-r--r--tests/scripts/options/dash-n2
-rw-r--r--tests/scripts/options/dash-q9
-rw-r--r--tests/scripts/options/print-directory4
-rw-r--r--tests/scripts/targets/DELETE_ON_ERROR22
-rw-r--r--tests/scripts/targets/POSIX3
-rw-r--r--tests/scripts/variables/MAKEFLAGS4
-rw-r--r--tests/scripts/variables/MAKE_RESTARTS9
-rw-r--r--tests/scripts/variables/SHELL3
-rw-r--r--tests/scripts/variables/special22
-rw-r--r--tests/scripts/vms/library73
-rw-r--r--tests/test_driver.pl2
-rw-r--r--variable.c114
-rw-r--r--variable.h16
-rw-r--r--version.c2
-rw-r--r--vms_exit.c95
-rw-r--r--vms_export_symbol.c527
-rw-r--r--vms_export_symbol_test.com37
-rw-r--r--vms_progname.c463
-rw-r--r--vmsdir.h2
-rw-r--r--vmsfunctions.c4
-rw-r--r--vmsify.c2
-rw-r--r--vmsjobs.c1658
-rw-r--r--vpath.c52
-rw-r--r--w32/Makefile.am7
-rw-r--r--w32/compat/dirent.c2
-rw-r--r--w32/compat/posixfcn.c2
-rw-r--r--w32/include/dirent.h2
-rw-r--r--w32/include/dlfcn.h2
-rw-r--r--w32/include/pathstuff.h2
-rw-r--r--w32/include/sub_proc.h19
-rw-r--r--w32/include/w32err.h2
-rw-r--r--w32/pathstuff.c4
-rw-r--r--w32/subproc/NMakefile2
-rw-r--r--w32/subproc/misc.c2
-rw-r--r--w32/subproc/proc.h2
-rw-r--r--w32/subproc/sub_proc.c141
-rw-r--r--w32/subproc/w32err.c2
-rw-r--r--w32/w32os.c198
162 files changed, 29267 insertions, 3431 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 00000000..07649663
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,62 @@
+# Development artifacts
+ID
+TAGS
+.*gdbinit
+.gdb_history
+*~
+#*
+.#*
+
+# Configure artifacts
+ABOUT-NLS
+Makefile
+Makefile.in
+aclocal.m4
+autom4te.cache
+config.cache
+config.h
+config.h.in
+config.log
+config.status
+configure
+stamp-h1
+
+# Build artifacts
+.deps
+gmk-default.h
+loadavg
+make
+*.o
+*.exe
+*.dll.a
+*.obj
+*.lib
+*.pdb
+*.sbr
+
+# Windows build artifacts
+WinDebug/
+WinRel/
+GccDebug/
+GccRel/
+
+# Distribution artifacts
+.dep_segment
+.check-git-HEAD
+ChangeLog
+Makefile.DOS
+NMakefile
+README
+README.DOS
+README.OS2
+README.W32
+SMakefile
+build.sh
+build.sh.in
+config.ami
+config.h-vms
+config.h.W32
+configh.dos
+make-[0-9]*/
+make-[0-9]*.tar.*
+checkcfg.*.log
diff --git a/.purify b/.purify
new file mode 100644
index 00000000..dc1b1d9c
--- /dev/null
+++ b/.purify
@@ -0,0 +1,12 @@
+# Solaris (2.5.1) has a couple if issues.
+#
+suppress plk malloc; setvbuf "libc*"; main "main.c"
+suppress umr kstat_read; kstat_chain_update; kstat_open; getloadavg
+suppress umr kstat_chain_update; kstat_open; getloadavg
+
+# The command line options stuff leaks a little bit. No big deal.
+#
+suppress mlk malloc; xmalloc "misc.c"; decode_env_switches "main.c"
+suppress plk malloc; xmalloc "misc.c"; decode_env_switches "main.c"
+suppress mlk malloc; xmalloc "misc.c"; concat "misc.c"; decode_env_switches "main.c"
+suppress plk malloc; xmalloc "misc.c"; concat "misc.c"; decode_env_switches "main.c"
diff --git a/AUTHORS b/AUTHORS
index 65398819..9b6212f3 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -72,7 +72,7 @@ With suggestions/comments/bug reports from a cast of ... well ...
hundreds, anyway :)
-------------------------------------------------------------------------------
-Copyright (C) 1997-2014 Free Software Foundation, Inc.
+Copyright (C) 1997-2016 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
diff --git a/ChangeLog.1 b/ChangeLog.1
new file mode 100644
index 00000000..c37b1390
--- /dev/null
+++ b/ChangeLog.1
@@ -0,0 +1,4997 @@
+Tue Oct 29 20:57:36 1991 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * Version 3.62.
+
+ * remake.c (update_file_1): Check for deps still running before
+ giving up if any dep has failed.
+
+Sat Oct 26 16:20:00 1991 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * make.h [uts]: #undef S_ISREG and S_ISDIR if defined.
+
+Fri Oct 25 19:50:39 1991 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * Version 3.60.17.
+
+Thu Oct 24 16:58:36 1991 Roland McGrath (roland@wookumz.gnu.ai.mit.edu)
+
+ * job.c (start_job): Don't check for empty cmds before tweaking the
+ command_ptr. Just let construct_command_argv do it.
+
+Tue Oct 22 20:21:03 1991 Roland McGrath (roland@wookumz.gnu.ai.mit.edu)
+
+ * remake.c, arscan.c [POSIX]: <fcntl.h> instead of <sys/file.h>.
+
+ * make.h [POSIX]: Declare vfork as pid_t.
+
+Mon Oct 21 15:37:30 1991 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * Version 3.60.16.
+
+ * job.c (construct_command_argv, construct_command_argv_internal):
+ Take new 2nd arg RESTP. If non-NULL, stop parsing at newline, and
+ store addr of the NL in *RESTP.
+ (start_job): Don't chop expanded cmd lines up; use above code to do it.
+ * function.c (expand_function: `shell'): Pass RESTP==NULL.
+
+Sat Oct 19 15:36:34 1991 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * Version 3.60.15.
+
+Fri Oct 18 15:26:55 1991 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * job.c (start_job): If on the same cmds->command_lines elt, look
+ at cmds->lines_recurse[CHILD->command_line - 1] instead of
+ [CHILD->command_line].
+
+ * dir.c [sgi]: <sys/dir.h>, not ndir or anything else.
+
+Thu Oct 17 16:28:55 1991 Roland McGrath (roland@geech.gnu.ai.mit.edu)
+
+ * file.c (print_file_data_base): Remove unused var.
+
+ * make.h [NeXT]: No #define ANSI_STRING.
+
+Tue Oct 15 20:08:41 1991 Roland McGrath (roland@geech.gnu.ai.mit.edu)
+
+ * Version 3.60.14.
+
+Fri Oct 11 16:23:52 1991 Roland McGrath (roland@geech.gnu.ai.mit.edu)
+
+ * make.h: Use PATH_MAX for getwd defn.
+
+ * make.h: Move getcwd/getwd outside of #ifndef POSIX, and make it
+ #if USG||POSIX.
+
+Thu Oct 10 11:53:31 1991 Roland McGrath (roland@geech.gnu.ai.mit.edu)
+
+ * Version 3.60.13.
+
+ * read.c (read_all_makefiles): When processing MAKEFILES, save the
+ malloc'd ptr to be freed, instead of freeing part-way thru it.
+
+ * remake.c (update_file_1): Don't tweak FILE->also_make.
+ (update_file): Do it here. After calling update_file_1, set the
+ command_state, update_status, and updated members of each also_make
+ elt to FILE's values.
+
+Tue Oct 8 14:56:04 1991 Roland McGrath (roland@albert.gnu.ai.mit.edu)
+
+ * Version 3.60.12.
+
+ * remake.c (notice_finished_file): Set command_state of FILE and
+ its also_make chain to cs_finished here.
+ * commands.c (execute_file_commands), job.c (child_handler),
+ remake.c (remake_file): Don't set it before calling
+ notice_finished_file.
+
+ * file.h (struct file): Changed `also_make' to struct dep *.
+ * job.c (delete_child_targets), file.c (print_file_data_base),
+ remake.c (notice_finished_file), implicit.c (pattern_search):
+ Use dep chain instead of array of file names.
+
+Mon Oct 7 17:04:33 1991 Roland McGrath (roland@geech.gnu.ai.mit.edu)
+
+ * Version 3.60.11.
+
+ * arscan.c: Declare open.
+ * misc.c: Declare {get,set}{re,}[ug]id.
+ * variable.c (target_environment): Declare getenv.
+
+Sat Oct 5 15:13:03 1991 Roland McGrath (roland@albert.gnu.ai.mit.edu)
+
+ * make.h [NeXT]: <string.h> instead of <strings.h>.
+
+Fri Oct 4 16:05:41 1991 Roland McGrath (roland@albert.gnu.ai.mit.edu)
+
+ * default.c (default_suffixes, defualt_suffix_rules): Add .texi
+ just like .texinfo.
+
+ * Version 3.60.10.
+
+ * job.c: Move vfork decl into make.h.
+
+Fri Sep 27 18:45:30 1991 Roland McGrath (roland@albert.gnu.ai.mit.edu)
+
+ * compatMakefile (glob/libglob.a): Pass CC value to submake.
+
+Thu Sep 26 00:08:15 1991 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * load.c (load_average): Made not static.
+
+ * load.c [ultrix && vax]: Define LDAV_TYPE and LDAV_CVT for Ultrix 4.2.
+
+Tue Sep 24 00:17:20 1991 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * Version 3.60.9.
+
+ * read.c (record_files): Warn about extra cmds even if the target's
+ name begins with a dot. I think the lusers can handle this.
+
+Mon Sep 23 22:33:26 1991 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * make.h, arscan.c: Don't declare bcmp, bzero, or bcopy if they're
+ #define'd.
+ * make.h: Declare write and open.
+
+ * default.c (default_suffixes, default_suffix_rules,
+ default_variables): Add .C just like .cc.
+ * make.texinfo (Catalogue of Rules): Document .C.
+
+ * make.man (-w): Fix gramo.
+
+Fri Sep 20 17:18:16 1991 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * make.h: No text after #endif.
+
+Sun Sep 15 16:20:46 1991 Roland McGrath (roland@albert.gnu.ai.mit.edu)
+
+ * Version 3.60.8.
+
+ * implicit.c (pattern_search): In the second pass, recurse on rule
+ deps that don't have a %. Why did I make it not do this?
+
+Fri Sep 14 18:29:39 1991 Roland McGrath (roland@geech.gnu.ai.mit.edu)
+
+ * read.c (record_files): For extra cmds, use the last ones given.
+ If the target's name doesn't begin with a dot (bletch!!), emit a
+ two-line warning, one line giving the old cmds' location and the
+ other the new cmds' location.
+
+ * misc.c (makefile_error, makefile_fatal): New fns.
+ * make.h: Declare them.
+ * Use them instead of error/fatal for all msgs including a file
+ name and line number.
+
+Thu Sep 13 16:35:54 1991 Roland McGrath (roland@albert.gnu.ai.mit.edu)
+
+ * make.h: Declare define_default_variables.
+ Declare ar_parse_name, instead of ar_name_parse (M-t).
+
+Mon Sep 10 18:35:40 1991 Roland McGrath (roland@wookumz.gnu.ai.mit.edu)
+
+ * Version 3.60.7.
+
+ * make.texinfo (Variables: Setting): Say whitespace is removed if
+ "immediately after =", rather than simply "after =".
+
+ * job.c: Don't declare wait #ifdef POSIX.
+
+ * make.h [__GNUC__]: #undef alloca and then #define it.
+
+ * main.c (main): When pruning makefiles which might loop from the
+ read_makefiles chain, look at all `prev' entries of double-colon rules.
+
+Fri Sep 7 00:41:53 1991 Roland McGrath (roland@albert.gnu.ai.mit.edu)
+
+ * main.c (main): Only remove makefiles with cmds but no deps from
+ the list of makefiles to be rebuilt if they are :: targets.
+ : targets with cmds and no deps are not dangerous.
+
+Wed Sep 5 17:35:51 1991 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * compatMakefile (defines): Add comment that some compilers take
+ ENUM_BITFIELDS but produce bogus code.
+ (LOAD_AVG): Fix examples to \ "s.
+ (LOADLIBES): Add comment that SGI Irix needs -lmld for nlist.
+
+Tue Sep 4 20:26:26 1991 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * Version 3.60.6.
+
+Fri Aug 30 19:34:04 1991 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * remake.c (update_file_1): When checking the command_state of
+ deps, check through the prev chain.
+ (update_goal_chain): When a target is finished, start checking its
+ prev (if it has one) instead.
+
+Wed Aug 7 17:32:03 1991 Roland McGrath (roland@geech.gnu.ai.mit.edu)
+
+ * rule.c (convert_to_pattern): Allow files with deps to define
+ suffix rules (really this time).
+
+Mon Aug 5 17:09:21 1991 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * misc.c (user_access, make_access): Do saved-IDs (USG) flavor
+ #ifdef POSIX.
+
+ * file.c (enter_file): Strip ./s here.
+ * read.c (parse_file_seq): Not here.
+
+Tue Jul 23 23:34:30 1991 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * compatMakefile: Added comment that -lPW alloca is broken on HPUX.
+
+Thu Jul 18 03:10:41 1991 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * Version 3.60.5.
+
+ * read.c (read_makefile): Ignore lines containing chars that are
+ all isspace, not just all isblank.
+
+ * make.texinfo (Copying): @include gpl.texinfo, rather than copying
+ the text.
+ * gpl.texinfo: New file (symlink to /gd/gnu/doc/gpl.texinfo).
+ * GNUmakefile: Put gpl.texinfo in distribution.
+
+Tue Jul 16 12:50:35 1991 Roland McGrath (roland@albert.gnu.ai.mit.edu)
+
+ * make.h: #define _GNU_SOURCE before including headers.
+ Include <ctype.h> and define isblank if <ctype.h> doesn't.
+ * commands.c: Don't include <ctype.h> here.
+ * *.c: Use isblank instead of explicit ' ' || '\t'.
+
+Mon Jul 15 17:43:38 1991 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * function.c (expand_function: `filter'/`filter-out'): Fixed to not
+ loop infinitely.
+
+Fri Jul 12 12:18:12 1991 Roland McGrath (roland@albert.gnu.ai.mit.edu)
+
+ * function.c (expand_function: `filter'/`filter-out'): Rewritten to
+ handle filter-out of multiple patterns properly. Also no longer
+ mallocs and reallocs for temp array; uses alloca and a linked-list
+ instead.
+
+Wed Jul 10 22:34:54 1991 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * Version 3.60.4.
+
+ * make.texinfo: Moved some @groups that were outside @examples to
+ be inside them.
+
+ * load.c [apollo] (load_average): Define using special syscall for
+ Apollo DOMAIN/OS SR10.n.
+
+Thu Jul 4 12:32:53 1991 Roland McGrath (roland@albert.gnu.ai.mit.edu)
+
+ * make.texinfo (Missing): Added Unix excessive implicit rule
+ search; mention that POSIX.2 doesn't require any of the missing
+ features.
+ (Top): Updated printed manual price to $15.
+
+Wed Jul 3 18:17:50 1991 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * file.c (rename_file): Carry over last_mtime when merging files.
+ * remake.c (f_mtime): Tail-recurse after renaming VPATH file, to
+ check for saved date in existing renamed-to file.
+
+ * remote-cstms.c (start_remote_job): Use PATH_VAR.
+
+ * commands.c [POSIX || __GNU_LIBRARY__]: Don't declare getpid.
+
+ * compatMakefile (glob-{clean,realclean}): Run clean/realclean in glob.
+ (clean, realclean): Require those.
+
+ * make.h: Always declare environ.
+ Don't declare old glob functions.
+
+ * GNUmakefile: Make no-lib deps for load.c and remote.c.
+
+Tue Jul 2 18:35:20 1991 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * Version 3.60.3.
+
+Mon Jul 1 16:58:30 1991 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * read.c (multi_glob): Don't pass GLOB_QUOTE flag to glob.
+
+ * make.h [POSIX]: Include <unistd.h>, and don't declare things that
+ should be there.
+
+ * main.c (main) [USG && sgi]: malloc a buffer for broken sgi stdio.
+
+Sat Jun 29 11:22:21 1991 Roland McGrath (roland@albert.gnu.ai.mit.edu)
+
+ * function.c (expand_function: `shell'): Use alloca for the error
+ msg buffer, instead of assuming an arbitrary max size.
+
+Fri Jun 28 18:15:08 1991 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * job.c [POSIX] (search_path): Do real 1003.1 goop to get NGROUPS_MAX.
+
+Wed Jun 26 11:04:44 1991 Roland McGrath (roland@albert.gnu.ai.mit.edu)
+
+ * default.c (define_default_variables): New fn.
+ (install_default_implicit_rules): Code for above fn moved there.
+ * main.c (main): Do define_default_variables before reading the
+ makefile.
+
+Tue Jun 25 17:30:46 1991 Roland McGrath (roland@albert.gnu.ai.mit.edu)
+
+ * main.c (main): Quote ; in MAKEOVERRIDES.
+
+Tue Jun 18 13:56:30 1991 Roland McGrath (roland@albert.gnu.ai.mit.edu)
+
+ * compatMakefile: Fixed typo in comment.
+
+Tue Jun 11 00:14:59 1991 Roland McGrath (roland@albert.gnu.ai.mit.edu)
+
+ * Version 3.60.2.
+
+Mon Jun 10 14:46:37 1991 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * make.h: Always include <sys/types.h>.
+ [POSIX]: Include <limits.h> and #define MAXPATHLEN to be PATH_MAX.
+
+ * default.c (default_suffix_rules: .texinfo.dvi): Use $(TEXI2DVI).
+ (default_variables): Define TEXI2DVI.
+
+Thu Jun 6 16:49:19 1991 Roland McGrath (roland@geech.gnu.ai.mit.edu)
+
+ * Version 3.60.1.
+
+ * make.h (SIGNAL): Cast handler arg to SIGHANDLER type.
+
+Wed Jun 5 06:00:43 1991 Roland McGrath (roland@geech.gnu.ai.mit.edu)
+
+ * read.c (multi_glob): Use POSIX.2 `glob' function.
+ If a glob pattern matches nothing, leave it as is (a la sh, bash).
+ Also, if can't find USER for ~USER, leave it as is (a la bash).
+
+Mon Jun 3 16:36:00 1991 Roland McGrath (roland@albert.gnu.ai.mit.edu)
+
+ * compatMakefile: Rewrote comments about -Ds to be easier to use.
+
+ * make.h, arscan.c, remake.c, main.c, dir.c, job.c: Changed tests
+ of _POSIX_SOURCE to POSIX.
+
+ * job.c: Take getdtablesize out of #ifdef __GNU_LIBRARY__.
+ Put separately #ifdef USG.
+
+ * COPYING: Replaced with version 2.
+ * Changed copyright notices to refer to GPL v2.
+
+Thu May 30 00:31:11 1991 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * make.h: Don't declare sigblock for POSIX.
+
+ * main.c (main, log_working_directory) [USG]: Get getcwd failure
+ mode from errno, not passed buffer like BSD getwd.
+
+ * misc.c (child_access): New fn to set access for a child process;
+ like user_access, but you can't change back.
+ * make.h: Declare it.
+ * job.c (exec_command): Use it in place of user_access.
+
+Wed May 29 23:28:48 1991 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * default.c (default_variables) [pyr]: PC = pascal.
+
+Tue May 28 20:24:56 1991 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * variable.c (print_variable): Put a newline before `endef'.
+
+Sat May 25 02:39:52 1991 Roland McGrath (roland@geech.gnu.ai.mit.edu)
+
+ * Version 3.60.
+
+Wed May 22 19:41:37 1991 Roland McGrath (roland@geech.gnu.ai.mit.edu)
+
+ * Version 3.59.5.
+
+Thu May 16 13:59:24 1991 Roland McGrath (roland@geech.gnu.ai.mit.edu)
+
+ * main.c (main): Do USGr3 setvbuf behavior #ifdef APOLLO.
+ Don't handle SIGCHLD #ifdef USG (Apollo is USG but defines SIGCHLD).
+
+Fri May 10 14:59:33 1991 Roland McGrath (roland@geech.gnu.ai.mit.edu)
+
+ * remake.c [sgi]: Don't include <sys/file.h>.
+
+Wed May 8 01:54:08 1991 Roland McGrath (roland@geech.gnu.ai.mit.edu)
+
+ * make.h (SIGHANDLER): #define as (void *) #if __STDC__,
+ else (int (*)()).
+ (SIGNAL): Use it to cast return value.
+ * main.c (main): Cast SIG_IGN to SIGHANDLER when comparing.
+ * job.c (block_signals, unblock_signals): Use SIGNAL instead of signal.
+
+ * main.c: Declare mktemp to return char*, not int.
+
+ * job.c (new_job): Don't increment files_remade.
+ * remake.c (notice_finished_file): Do it here.
+
+ * read.c (do_define): Don't clobber DEFINITION[-1] on empty defns.
+ Free storage that is no longer needed.
+
+Wed Apr 24 20:49:48 1991 Roland McGrath (roland at churchy.gnu.ai.mit.edu)
+
+ * misc.c (message): New fn to print informational msgs with
+ leading "make: " or "make[N]: ".
+ * make.h: Declare it.
+ * remake.c (update_file): Use it instead of printf.
+
+Fri Apr 19 05:52:45 1991 Roland McGrath (roland at churchy.gnu.ai.mit.edu)
+
+ * main.c (main): When there are no targets, if there were no
+ makefiles, print a different error message, which mentions makefiles.
+
+Tue Apr 16 03:22:45 1991 Roland McGrath (roland at geech.gnu.ai.mit.edu)
+
+ * remake.c (update_file): Print "nothing to be done" instead of "is
+ up to date" if FILE->cmds == 0.
+
+ * job.c [!WIFEXITED]: Define if not already defined.
+
+Thu Apr 11 18:00:50 1991 Roland McGrath (roland at wookumz.gnu.ai.mit.edu)
+
+ * arscan.c (ar_name_equal): Fixed truncation comparison.
+
+Tue Apr 2 16:17:35 1991 Roland McGrath (roland at churchy.gnu.ai.mit.edu)
+
+ * glob.c: Use common version from djm.
+ * dir.c: Snarfed #ifdef mess for <dirent.h> or whatever from glob.c.
+ (dir_file_exists_p): Ignore directory entries with d_ino==0.
+
+Mon Apr 1 20:49:45 1991 Roland McGrath (roland at albert.gnu.ai.mit.edu)
+
+ * Version 3.59.4.
+
+Fri Mar 29 19:16:18 1991 Roland McGrath (roland at albert.gnu.ai.mit.edu)
+
+ * job.c (free_child): Free CHILD->environment and its elts.
+
+Sat Mar 23 14:08:09 1991 Roland McGrath (roland at albert.gnu.ai.mit.edu)
+
+ * read.c (read_makefile): Don't ignore lines containing only
+ comments if they start with a tab. Such lines should be passed to
+ the shell for it to decide about the comments.
+
+ * job.c (free_child): Free CHILD->command_lines and its elts, not
+ CHILD->commands (which is obsolete).
+ * job.h, job.c: Remove obsolete `commands' member of `struct child'.
+
+Sun Mar 17 18:40:53 1991 Roland McGrath (roland at albert.ai.mit.edu)
+
+ * remake.c (update_file): Print a msg for a top-level up-to-date
+ phony target (a different one than for a real file).
+
+ * read.c (conditional_line): Boundary check so we don't check the
+ value of the -1th elt of the stack (which is bogus).
+
+Sat Mar 16 16:58:47 1991 Roland McGrath (roland at albert.ai.mit.edu)
+
+ * read.c (conditional_line): Don't evaluate an if* when we're
+ already ignoring. Instead, just push a new level, with a value of
+ 1, to keep ignoring.
+
+Tue Mar 12 00:16:52 1991 Roland McGrath (roland at geech.ai.mit.edu)
+
+ * Version 3.59.3.
+
+Mon Mar 11 23:56:57 1991 Roland McGrath (roland at geech.ai.mit.edu)
+
+ * job.c (construct_command_argv_internal): Quote backslashes
+ when building the shell -c line.
+
+Fri Mar 8 01:40:18 1991 Roland McGrath (roland at geech.ai.mit.edu)
+
+ * job.c (exec_command): Call user_access rather than setgid(getgid()).
+
+ * misc.c (remove_comments): Renamed from collapse_line; took out
+ collapse_continuations call.
+ * make.h: Change decl.
+ * read.c (read_makefile): Collapse continuations on the line buffer
+ immediately after reading it. Call remove_comments rather than
+ collapse_line (which is now defunct).
+
+Thu Feb 21 18:06:51 1991 Roland McGrath (mcgrath at cygint.cygnus.com)
+
+ * misc.c (user_access, make_access): New fns to toggle btwn permissions
+ for user data (files and spawning children), and permissions for make
+ (for taking the load average, mostly).
+ * make.h: Declare them.
+ * job.c (start_job): Call make_access before wait_to_start_job, and
+ user_access after.
+ * main.c (main): Call user_access before doing much.
+
+Mon Feb 3 15:02:03 1991 Roland McGrath (roland at albert.ai.mit.edu)
+
+ * Version 3.59.2.
+
+Tue Jan 29 20:30:50 1991 Roland McGrath (roland at cygint.cygnus.com)
+
+ * read.c (read_all_makefiles): Use allocated_variable_expand to expand
+ `$(MAKEFILES)', since the results are used across calls to
+ read_makefile, which could clobber them.
+
+Wed Jan 23 00:24:10 1991 Roland McGrath (roland at cygint.cygnus.com)
+
+ * main.c (main): Call install_default_implicit_rules after reading
+ makefiles, not before.
+ * default.c (install_default_implicit_rules): If a suffix-rule file
+ entry has cmds, don't give it any from default_suffix_rules.
+
+Fri Jan 17 17:39:49 1991 Roland McGrath (roland at albert.ai.mit.edu)
+
+ * arscan.c: Added support for AIX archives.
+
+ * remake.c: Don't include ar.h.
+ * main.c: Removed unused atol decl.
+ * arscan.c (ar_scan): Declare arg FUNCTION to return long int.
+ * ar.c (ar_touch): Don't perror for an invalid archive.
+ * make.h: Declare lseek as long int.
+
+ * job.c [hpux]: Define getdtablesize a la USG.
+
+Sun Jan 12 21:08:34 1991 Roland McGrath (roland at albert.ai.mit.edu)
+
+ * Version 3.59.1.
+
+Fri Jan 10 03:48:08 1991 Roland McGrath (roland at albert.ai.mit.edu)
+
+ * job.c (search_path): Take new arg, place to put full pathname (rather
+ than mallocing it).
+ (exec_command): Pass it, using auto storage.
+
+ * main.c (print_version): Updated copyright years.
+
+Wed Jan 8 19:46:19 1991 Roland McGrath (roland at albert.ai.mit.edu)
+
+ * job.c [_POSIX_SOURCE]: Just #include <sys/wait.h>, and define macro
+ WAIT_NOHANG in terms of waitpid.
+ [!_POSIX_SOURCE && (HAVE_SYS_WAIT || !USG)]: Don't #include <signal.h>
+ (make.h does).
+ Define macro WAIT_NOHANG in terms of wait3.
+ (child_handler): #ifdef on WAIT_NOHANG, not HAVE_SYS_WAIT || !USG.
+ Use WAIT_NOHANG macro instead of wait3.
+
+ * file.h (struct file.command_state): Remove unused elt.
+
+Wed Dec 26 18:10:26 1990 Roland McGrath (roland at albert.ai.mit.edu)
+
+ * commands.c (set_file_variables): If FILE got its commands from
+ .DEFAULT, make $< == $@ (4.3 BSD/POSIX.2d11 compat).
+
+Mon Dec 24 17:36:27 1990 Roland McGrath (roland at albert.ai.mit.edu)
+
+ * default.c (default_variables): Rename 2nd LINK.s defn to LINK.S.
+
+Fri Dec 14 15:05:25 1990 Roland McGrath (roland at albert.ai.mit.edu)
+
+ * vpath.c (selective_vpath_search): Check for makefile-mentioned before
+ checking for actual existence. The old order loses if the containing
+ directory doesn't exist (but a rule might make it).
+
+ * make.h [__GNUC__]: Don't #define alloca if already #define'd.
+
+ * rule.c (convert_to_pattern): Don't look at the target constructed for
+ the empty rule when making the null-suffix rule. Construct it over
+ again, since the former may have been freed already.
+
+Thu Dec 13 17:21:03 1990 Roland McGrath (roland at churchy.ai.mit.edu)
+
+ * make.h [__GNU_LIBRARY__]: Include <unistd.h> to get random fn decls.
+
+Wed Dec 12 17:12:59 1990 Roland McGrath (roland at churchy.ai.mit.edu)
+
+ * make.h, arscan.c, glob.c: Only include <memory.h> #ifdef USG.
+
+ * variable.c (define_variable_in_set): Replace env_overrides check that
+ wasn't really redundant (undoing Sep 28 change). Add comment saying
+ why this check is necessary.
+
+ * job.c, main.c [DGUX]: Needs siglist like USG.
+
+Mon Dec 11 01:19:29 1990 Roland McGrath (roland at albert.ai.mit.edu)
+
+ * default.c [M_XENIX]: For rules that are different for Xenix, use the
+ generic Unix version #ifdef __GNUC__.
+
+ * main.c [M_XENIX]: Use USGr3-style setvbuf call.
+
+ * read.c (find_percent): Do backslash folding correctly, not leaving
+ extra crud on the end of the string.
+
+Sun Dec 10 21:48:36 1990 Roland McGrath (roland at albert.ai.mit.edu)
+
+ * job.c: Don't declare wait3 if it's #defined.
+
+ * GNUmakefile, compatMakefile, make.texinfo: Change make-info
+ to make.info.
+
+Thu Dec 7 21:20:01 1990 Roland McGrath (roland at churchy.ai.mit.edu)
+
+ * make.h [STDC_HEADERS || __GNU_LIBRARY__ || _POSIX_SOURCE]: Use
+ ANSI <string.h> and names for str/mem functions.
+ Use <stdlib.h> to declare misc fns rather than explicit decls.
+ [_POSIX_SOURCE]: Don't declare kill (<signal.h> will).
+ Include <sys/types.h> before <signal.h> because some braindead
+ nonconformant 1003.1 implementation needs it.
+ * misc.c: Don't declare malloc, realloc. Do it in make.h.
+ * arscan.c, glob.c: Use sequence for string fns from make.h verbatim.
+ * make.h (S_ISDIR, S_ISREG): Declare if necessary.
+ * commands.c (delete_child_targets), job.c (search_path), read.c
+ (construct_include_path): Use S_ISfoo(m) instead of
+ (m & S_IFMT) == S_IFfoo.
+ * dir.c, glob.c [_POSIX_SOURCE]: Use dirent.
+
+Wed Nov 29 22:53:32 1990 Roland McGrath (roland at geech.ai.mit.edu)
+
+ * Version 3.59.
+
+Tue Nov 28 16:00:04 1990 Roland McGrath (roland at churchy.ai.mit.edu)
+
+ * arscan.c (ar_name_equal) [APOLLO]: Don't do `.o' hacking. On Apollos
+ the full file name is elsewhere, and there is no length restriction (or
+ so I'm told).
+
+Thu Nov 23 17:33:11 1990 Roland McGrath (roland at albert.ai.mit.edu)
+
+ * load.c [hp300 && BSD] (LDAV_CVT): Define for this system.
+
+Tue Nov 21 07:58:40 1990 Roland McGrath (roland at albert.ai.mit.edu)
+
+ * read.c (record_files): Fix trivial bug with deciding to free storage
+ for a file name.
+
+Thu Nov 16 06:21:38 1990 Roland McGrath (roland at geech.ai.mit.edu)
+
+ * compatMakefile ($(bindir)/make): Install it setgid kmem.
+
+Thu Nov 1 16:12:55 1990 Roland McGrath (roland at churchy.ai.mit.edu)
+
+ * GNUmakefile (make-*.tar.Z): Use `h' option to tar (dereference
+ symlinks), to grab texinfo.tex from wherever it lives.
+
+Tue Oct 30 16:15:20 1990 Roland McGrath (roland at churchy.ai.mit.edu)
+
+ * Version 3.58.13.
+
+Fri Oct 26 14:33:34 1990 Roland McGrath (roland at churchy.ai.mit.edu)
+
+ * GNUmakefile: make-*.tar.Z: Include texinfo.tex.
+
+Tue Oct 23 19:34:33 1990 Roland McGrath (roland at churchy.ai.mit.edu)
+
+ * main.c (define_makeflags): When there are no flags to write, make
+ sure the array has two leading nulls, since `MAKEFLAGS' is defined from
+ &flags[1].
+
+ * main.c (default_keep_going_flag): New variable (constant one).
+ (command_switches: -k, -S): Use above for default value.
+ (define_makeflags): Only write flag/flag_off switches if they are on,
+ and either there is no default value, or they are not the default.
+
+Mon Oct 22 16:14:44 1990 Roland McGrath (roland at churchy.ai.mit.edu)
+
+ * main.c (struct command_switch): New member `no_makefile'.
+ (command_switches: -n, -q, -t): Set no_makefile == 1.
+ (define_makeflags): Take new arg MAKEFILE: if nonzero, don't use
+ options whose `no_makefile' flags are set.
+ (main): Call define_makeflags with MAKEFILE==1 before remaking
+ makefiles, and again with MAKEFILE==0 before remaking goals.
+
+Tue Oct 2 17:16:45 1990 Roland McGrath (roland at geech.ai.mit.edu)
+
+ * Version 3.58.12.
+
+Mon Oct 1 15:43:23 1990 Roland McGrath (roland at churchy.ai.mit.edu)
+
+ * arscan.c [HPUX]: Use PORTAR==1 format.
+
+Sat Sep 29 16:38:05 1990 Roland McGrath (roland at churchy.ai.mit.edu)
+
+ * make.h, remake.c, arscan.c: Don't declare `open'.
+
+Fri Sep 28 04:46:23 1990 Roland McGrath (roland at churchy.ai.mit.edu)
+
+ * variable.c (define_variable_in_set): Remove redundant -e check.
+
+Wed Sep 26 00:28:59 1990 Roland McGrath (roland at geech.ai.mit.edu)
+
+ * job.c (start_job): Set RECURSIVE from the right elt of
+ CHILD->file->cmds->lines_recurse.
+
+ * commands.c (chop_commands): Don't botch the line count for allocating
+ CMDS->lines_recurse.
+
+ * Version 3.58.11.
+
+ * job.c (start_job): Don't always increment CHILD->command_line! Only
+ do it when CHILD->command_ptr has run out! (Dumb bug. Sigh.)
+
+Thu Sep 20 02:18:51 1990 Roland McGrath (roland at geech.ai.mit.edu)
+
+ * GNUmakefile [ARCH]: Give explicit rule for remote.{c,dep} to use
+ variable `REMOTE' for more flags.
+ ($(prog)): Link in $(LOADLIBES).
+
+Wed Sep 19 02:30:36 1990 Roland McGrath (roland at churchy.ai.mit.edu)
+
+ * commands.h (struct commands): New member `ncommand_lines', the number
+ of elts in `command_lines' et al.
+ * commands.c (chop_commands): Set `ncommand_lines' elt of CMDS, and
+ don't put a nil pointer at the end of `command_lines'.
+ * job.h (struct child): New member `command_lines' to hold
+ variable-expanded command lines.
+ * job.c (new_job): Store expanded command lines in `command_lines'
+ member of new child. Don't clobber FILE->cmds.
+ (start_job): Use CHILD->command_lines in place of
+ CHILD->file->cmds->command_lines.
+
+ * variable.h, variable.c, job.c, expand.c: Undo yesterday's change,
+ which is no longer necessary since we have cleverly avoided the issue.
+
+ * job.c (start_job): Don't variable-expand each command line.
+ (new_job): Do them all here, storing the expansions in the array.
+
+Tue Sep 18 01:23:13 1990 Roland McGrath (roland at churchy.ai.mit.edu)
+
+ * variable.h (struct variable): Remove `expanding' member.
+ * variable.c (define_variable_in_set): Don't initialize it.
+ * expand.c (struct variable_expanding): New type, a linked list
+ containing `struct variable' pointers.
+ (variables_expanding): New variable, the chain of variables currently
+ being expanded.
+ (recursively_expand): Don't test and set `expanding' member.
+ Instead, run through the `variables_expanding' chain looking for a link
+ referring to V to find self-reference. Add a new link to the chain,
+ describing V, before recursive expansion, and pop it off afterward.
+ * job.c (child_handler): Save `variables_expanding' and clear it before
+ calling start_job, and restore it afterward. This avoids major lossage
+ when the SIGCHLD comes in the middle of variable expansion.
+
+Mon Sep 17 14:46:26 1990 Roland McGrath (roland at geech.ai.mit.edu)
+
+ * job.c, commands.c: Don't define sigmask.
+ * make.h: Put it here instead.
+
+ * variable.c (target_environment): If `.NOEXPORT' was specified as a
+ target, only export command-line and environment variables, and
+ file-origin variables that were in the original environment.
+
+ * make.man: Add missing ?roff control for `-I' option description.
+
+Thu Sep 13 14:10:02 1990 Roland McGrath (roland at churchy.ai.mit.edu)
+
+ * load.c [UMAX]: Move #include <sys/sysdefs.h> to [not UMAX_43].
+
+Wed Sep 12 15:10:15 1990 Roland McGrath (roland at churchy.ai.mit.edu)
+
+ * expand.c (recursively_expand): Don't use `reading_filename' and
+ `reading_lineno_ptr' if they're nil.
+
+Thu Aug 30 17:32:50 1990 Roland McGrath (roland at geech)
+
+ * Version 3.58.10.
+
+Tue Aug 28 04:06:29 1990 Roland McGrath (roland at churchy.ai.mit.edu)
+
+ * job.c [USG] (unknown_children_possible): New variable, set nonzero
+ when it's possible for children not in the `children' chain to die.
+ (block_signals) [USG]: Set it.
+ (unblock_signals) [USG]: Clear it.
+ (child_handler) [USG]: Don't complain about unknown children if
+ `unknown_children_possible' is set.
+
+ * read.c (do_define): Make sure there's enough space for the newline,
+ so we don't write off the end of allocated space.
+
+ * arscan.c (ar_name_equal): Fixed to work when MEM is AR_NAMELEN-1 but
+ NAME is not the same length.
+
+Sat Aug 25 16:17:14 1990 Roland McGrath (roland at geech)
+
+ * job.c (construct_command_argv_internal): Use a static char array for
+ a constant, since old C has no auto aggregate initializers.
+
+Thu Aug 23 16:11:03 1990 Roland McGrath (roland at churchy.ai.mit.edu)
+
+ * job.c (search_path): If PATH is nil or "" use a default path.
+
+Wed Aug 22 01:05:32 1990 Roland McGrath (roland at churchy.ai.mit.edu)
+
+ * Version 3.58.9.
+
+ * job.c (exec_command): Don't take PATH and SHELL args. Get them from
+ ENVP.
+ (child_execute_job): Don't take FILE arg, and don't pass path and shell
+ to exec_command.
+ (start_job): Don't pass FILE arg to child_execute_job.
+ * function.c (expand_function: `shell'): Ditto.
+ * main.c (main): Don't pass path and shell to exec_command.
+
+Fri Aug 17 23:17:27 1990 Roland McGrath (roland at geech)
+
+ * job.c (construct_command_argv_internal): New fn broken out of
+ construct_command_argv. Takes strings SHELL and IFS instead of doing
+ variable expansion for them. Recurse to make an argv for SHELL,
+ passing SHELL==0. When SHELL==0, don't recurse for shell argv; make a
+ simple one using /bin/sh.
+ (construct_command_argv): Do the variable expansions and call above.
+
+Thu Aug 16 19:03:14 1990 Roland McGrath (roland at geech)
+
+ * read.c (multi_glob): For ~USER/FILE, if USER isn't found, don't
+ change the file name at all.
+
+Tue Aug 7 18:33:28 1990 Roland McGrath (mcgrath at homer.Berkeley.EDU)
+
+ * function.c (expand_function: `suffix'/`notdir'): Don't kill the last
+ space if we never wrote one.
+
+ * function.c (expand_function: `suffix'): Retain the dot, like the
+ documentation says.
+
+Mon Aug 6 14:35:06 1990 Roland McGrath (mcgrath at paris.Berkeley.EDU)
+
+ * Version 3.58.8.
+
+ * main.c (decode_switches): For positive_int and floating cases, move
+ SW past the arg (and don't set it to ""), so another switch can follow.
+
+Fri Aug 3 00:43:15 1990 Roland McGrath (mcgrath at paris.Berkeley.EDU)
+
+ * job.c (child_execute_job): Use unblock_signals instead of
+ push_signals_blocked_p (0).
+
+ * main.c (fatal_signal_mask): New variable, mask of signals caught with
+ fatal_error_signal.
+ (main): Set it.
+ * job.c ({block,unblock}_children): Renamed to {block,unblock}_signals.
+ Block/unblock both child signal and signals in fatal_signal_mask.
+ (children_blocked_p_{stack,max,depth}, {push,pop}_children_blocked_p):
+ Renamed from children to signals. Use {block,unblock}_signals instead
+ of {block,unblock}_children.
+ * commands.c (fatal_error_signal), job.c (wait_for_children, new_job,
+ child_execute_job, main, log_working_directory), function.c
+ (expand_function: `shell'), job.h: Rename {push,pop}_children_blocked_p
+ to {push,pop}_signals_blocked_p.
+ * job.c (child_handler): Call {block,unblock}_signals instead of just
+ {block,unblock}_remote_children. We need to block the fatal signals.
+
+Thu Aug 2 22:41:06 1990 Roland McGrath (mcgrath at paris.Berkeley.EDU)
+
+ * main.c, function.c: Fixed typos in comments.
+
+ * file.c (print_file_data_base): Fix computation of avg files/bucket.
+
+Tue Jul 31 22:11:14 1990 Roland McGrath (mcgrath at paris.Berkeley.EDU)
+
+ * Version 3.58.7.
+
+Wed Jul 25 16:32:38 1990 Roland McGrath (mcgrath at tully.Berkeley.EDU)
+
+ * arscan.c (ar_name_equal): Fixed to really do it right.
+ (ar_member_pos): Fixed order of args.
+ * ar.c (ar_member_date_1): Ditto.
+
+Fri Jul 20 15:30:26 1990 Roland McGrath (mcgrath at tully.Berkeley.EDU)
+
+ * arscan.c (ar_name_equal): Rewritten. Accounts for a possible
+ trailing slash in MEM.
+
+ * remake.c (f_mtime): Keep track of whether ARNAME is used and free it
+ if not. Also free MEMNAME.
+ * ar.c (ar_member_date, ar_touch): Ditto.
+
+ * arscan.c (arscan) [HPUX or hpux]: Treat same as USGr3 PORTAR==1.
+
+ * make.h: If NSIG is not defined, but _NSIG is, #define NSIG _NSIG.
+
+ * compatMakefile: Don't use $* in explicit rules.
+
+ * default.c (default_variables: "PREPROCESS.S"): Include $(CPPFLAGS).
+
+ * remake.c (f_mtime): If FILE is an ar ref, get the member modtime.
+
+ * function.c (string_glob): Terminate the string properly when it's
+ empty.
+
+Wed Jul 18 11:26:56 1990 Roland McGrath (mcgrath at paris.Berkeley.EDU)
+
+ * Version 3.58.6.
+
+ * commands.c (set_file_variables): Fixed computation for ^F/?F elt len.
+
+Sat Jul 14 13:41:24 1990 Roland McGrath (mcgrath at paris.Berkeley.EDU)
+
+ * job.c (construct_command_argv): Always use
+ allocated_variable_expand_for_file instead of variable_expand_for_file
+ because we might be called from inside a variable expansion (for the
+ `shell' function).
+
+ * function.c (expand_function: `shell'): Free the arglist's storage
+ correctly. construct_command_argv only allocates ARGV and ARGV[0].
+
+ * job.c (children_blocked_p_idx): Renamed to children_blocked_p_depth.
+ (push_children_blocked_p, pop_children_blocked_p): Use ..._depth
+ instead of ..._idx, and do it right!
+
+Wed Jul 11 15:35:43 1990 Roland McGrath (mcgrath at paris.Berkeley.EDU)
+
+ * make.h (SIGNAL): New macro to replace `signal' calls. Does arg and
+ ret value casts to (void *) #ifdef __STDC__ to avoid conflicts btwn
+ ANSI and BSD `signal' and handler types.
+ * main.c (main), job.c (child_handler): Use it.
+
+Fri Jul 6 00:00:38 1990 Roland McGrath (mcgrath at homer.Berkeley.EDU)
+
+ * ar.c (ar_member_date, ar_touch): Pass 2nd arg to f_mtime.
+
+ * read.c (read_makefile): Search the include path for MAKEFILES
+ variable makefiles (TYPE == 1), like it says in the manual.
+
+ * file.h (struct file), main.c (struct command_switch): Remove trailing
+ commas from enums.
+
+ * commands.c (execute_file_commands): Remove unused variables.
+ * commands.h: Declare chop_commands.
+ * make.h: Declare uniquize_deps.
+ * main.c (main): Remove unused variable.
+ (decode_switches): Remove unused label.
+ * remake.c: Include "ar.h" for ar_parse_name decl.
+ * implicit.c (try_implicit_rule): Remove unused variable.
+ * function.c (expand_function: `shell'): Declare fork, pipe.
+ * ar.c: Declare ar_name_equal.
+
+ * GNUmakefile: If using gcc, add warning flags to CFLAGS.
+
+ * remake.c: Remove decl of ar_member_date, since it's done in make.h.
+
+ * remake.c (f_mtime): For ar refs, allow the archive to be found via
+ VPATH search if we're searching, and change the ar ref accordingly.
+
+ * ar.c (ar_parse_name): New global fn to parse archive-member
+ references into the archive and member names.
+ (ar_member_date, ar_touch): Use it.
+ * make.h: Declare it.
+
+ * remake.c (f_mtime): After doing rename_file, do check_renamed instead
+ of assuming rename_file will always set FILE->renamed (which it won't).
+
+ * vpath.c (selective_vpath_search): Only accept prospective files that
+ don't actually exist yet are mentioned in a makefile if the file we are
+ searching for isn't a target.
+
+Wed Jul 4 04:11:55 1990 Roland McGrath (mcgrath at helen.Berkeley.EDU)
+
+ * remake.c (update_goal_chain): Do check_renamed after calling
+ file_mtime.
+ (check_dep): Ditto after update_file.
+
+ * file.c (rename_file): Prettied up long message for merging cmds.
+
+ * remake.c (update_file_1): Get each dep file's modtime, and allow for
+ it being renamed, before checking for a circular dep, since a renaming
+ may have introduced one.
+
+Tue Jul 3 18:15:01 1990 Roland McGrath (mcgrath at homer.Berkeley.EDU)
+
+ * ar.c (ar_touch): Don't free ARNAME since enter_file holds onto the
+ storage.
+
+ * function.c (string_glob): Don't leave a trailing space.
+
+ * read.c (do_define): Allow leading whitespace before `endef'.
+
+Mon Jul 2 14:10:16 1990 Roland McGrath (mcgrath at homer.Berkeley.EDU)
+
+ * implicit.c (pattern_search): No longer take NAME arg. Instead take
+ ARCHIVE flag. If ARCHIVE is nonzero, FILE->name is of the form
+ "LIB(MEMBER)"; rule for "(MEMBER)" is searched for, and LASTSLASH is
+ set to nil. Since NAME was only non-nil when it was the archive member
+ name passed by try_implicit_rule, this change easily allows turning off
+ LASTSLASH checking for archive members without excessive kludgery.
+ (try_implicit_rule): Pass ARCHIVE flag instead of file name.
+
+ * Version 3.58.5.
+
+ * commands./c (set_file_variables): Don't kill last char of $(^D) elts.
+
+Sat Jun 30 00:53:38 1990 Roland McGrath (mcgrath at homer.Berkeley.EDU)
+
+ * ar.c (ar_member_date): Don't free ARNAME since enter_file holds onto
+ the storage.
+
+ * arscan.c (ar_scan) [sun386 && PORTAR == 1]: Treat like USGr3.
+
+Wed Jun 27 14:38:49 1990 Roland McGrath (mcgrath at paris.Berkeley.EDU)
+
+ * main.c (main): Put a newline on the debugging message when deciding
+ not to remake a makefile to avoid a possible loop.
+ Only decide not to remake makefiles that have commands (as well as
+ being targets and having no deps).
+
+Fri Jun 22 12:35:37 1990 Roland McGrath (mcgrath at paris.Berkeley.EDU)
+
+ * default.c (default_variables): Define `LINK.s' and `LINK.S'.
+ (default_suffix_rules): Define .S.o rule.
+
+ * job.c (construct_command_argv): If we decide to go the slow route,
+ free all storage for the chopped args.
+ (start_job): Free the argument list's storage correctly.
+ construct_command_argv only allocates ARGV and ARGV[0].
+
+Tue Jun 19 18:27:43 1990 Roland McGrath (mcgrath at paris.Berkeley.EDU)
+
+ * Version 3.58.4.
+
+Fri Jun 15 21:12:10 1990 Roland McGrath (mcgrath at paris.Berkeley.EDU)
+
+ * glob.c: New version from ai-lab which doesn't do [^abc].
+
+Thu Jun 7 00:30:46 1990 Roland McGrath (mcgrath at paris.Berkeley.EDU)
+
+ * dir.c: Copied dirent vs direct et al mess from glob.c.
+
+ * glob.c: Replaced with updated version from djm.
+ * glob.c: Check macro DIRENT instead of _POSIX_SOURCE for <dirent.h>.
+ __GNU_LIBRARY__ implies DIRENT and STDC_HEADERS.
+
+Thu May 31 22:19:49 1990 Roland McGrath (mcgrath at paris.Berkeley.EDU)
+
+ * vpath.c (vpath_search): Don't stop the loop if a pattern matches but
+ the search fails. All matching patterns have their paths searched
+ (like it says in the manual).
+
+ * make.texinfo (Rules: Directory Search: Selective Search): Say that
+ multiple `vpath' directives with the same pattern DO accumulate, not
+ supersede earlier ones.
+
+ * vpath.c (print_vpath_data_base): Increment the count of vpaths on
+ each loop iteration, rather than letting it stay zero.
+
+ * Version 3.58.3.
+
+ * job.c (block_children, unblock_children): Made static.
+ (push_children_blocked_p, pop_children_blocked_p): New functions to
+ push and pop whether children are blocked or not.
+ * job.h: Declare push_children_blocked_p, pop_children_blocked_p and
+ not block_children, unblock_children.
+ * commands.c (fatal_error_signal), job.c (wait_for_children, new_job,
+ child_execute_job), main.c (main, log_working_directory): Use sequences
+ of push_children_blocked_p (1) and pop_children_blocked_p () instead of
+ explicitly blocking and unblocking children.
+ * function.c (expand_function: `shell'): Don't unblock children. The
+ push-pop sequence in wait_for_children makes it unnecessary.
+
+Tue May 29 21:30:00 1990 Roland McGrath (mcgrath at helen.Berkeley.EDU)
+
+ * read.c (do_define): Don't include the last newline in the definition.
+
+ * function.c (expand_function: `shell'): Call construct_command_argv
+ before forking and don't fork if it returns nil. Free the argument
+ list's storage before finishing.
+
+ * job.c (start_job): Free the storage for the child's argument list
+ in the parent side of the fork after the child has been spawned.
+
+ * job.c (start_job): If construct_command_argv returns nil, go to the
+ next command line.
+
+ * job.c (construct_command_argv): Use the shell if the command contains
+ an unterminated quote.
+
+Wed May 23 19:54:10 1990 Roland McGrath (mcgrath at paris.Berkeley.EDU)
+
+ * Version 3.58.2.
+
+ * read.c (read_makefile): Parse "override define" correctly.
+
+Thu May 17 15:25:58 1990 Roland McGrath (mcgrath at paris.Berkeley.EDU)
+
+ * arscan.c [USG]: Don't declare memcpy and memcmp. <memory.h> should
+ do this anyway (and lack of declarations is harmless).
+
+ * remote-customs.c: Renamed to remote-cstms.c for System V.
+ * remote.c [CUSTOMS]: Changed accordingly.
+
+Sun May 13 14:38:39 1990 Roland McGrath (mcgrath at paris.Berkeley.EDU)
+
+ * GNUmakefile: Use same cmds for doc tar.Z as for dist tar.Z (so the
+ contents go in make-N.NN).
+
+Thu Apr 26 19:33:25 1990 Roland McGrath (mcgrath at homer.Berkeley.EDU)
+
+ * Version 3.58.1.
+
+Wed Apr 25 20:27:52 1990 Roland McGrath (mcgrath at homer.Berkeley.EDU)
+
+ * job.c (init_siglist): Don't do SIGUSR1 and SIGUSR2 if they are the
+ same as SIGIO and SIGURG (true on Cray).
+
+Tue Apr 24 20:26:41 1990 Roland McGrath (mcgrath at homer.Berkeley.EDU)
+
+ * arscan.c (ar_scan): Do behavior for PORTAR == 1 and USGr3 also
+ #ifdef APOLLO.
+
+Wed Apr 11 10:00:39 1990 Roland McGrath (mcgrath at paris.Berkeley.EDU)
+
+ * job.c (exec_command): Set the effective GID to the real GID. Somehow
+ this code got lost.
+
+ * implicit.c (pattern_search): Use the right index variable when
+ seeing if we need to expand FILE->also_make.
+
+Sun Mar 4 09:18:58 1990 Roland McGrath (mcgrath at homer.Berkeley.EDU)
+
+ * Version 3.58.0.
+
+ * remake.c (remake_file): Treat non-targets without commands under -t
+ the same as anything else without commands.
+
+Sat Feb 24 17:46:04 1990 Roland McGrath (mcgrath at homer.Berkeley.EDU)
+
+ * default.c (default_variables: PREPROCESS.S): Removed $< from defn.
+
+ * main.c (main): Ignore arguments that are the empty string, rather
+ than feeding them to enter_file and barfing therein.
+
+Wed Feb 14 16:28:37 1990 Roland McGrath (mcgrath at homer.Berkeley.EDU)
+
+ * main.c (main): Call construct_include_path after doing chdirs.
+
+Thu Feb 8 13:43:44 1990 Roland McGrath (mcgrath at homer.Berkeley.EDU)
+
+ * Version 3.58.
+
+Sat Feb 3 22:06:55 1990 Roland McGrath (mcgrath at homer.Berkeley.EDU)
+
+ * Version 3.57.7.
+
+ * make.texinfo (Implicit: Catalogue of Rules): For RCS, noted that
+ working files are never overwritten by the default rule.
+
+Thu Feb 1 17:27:54 1990 Roland McGrath (mcgrath at homer.Berkeley.EDU)
+
+ * rule.c (count_implicit_rule_limits): Redid loop control to not run
+ twice on freed rules.
+
+ * GNUmakefile: Made `.dep' files be architecture-specific too.
+
+ * main.c (main, log_working_directory) [USG]: Block children around
+ calls to `getwd' (actually `getcwd' on USG), because that function
+ sometimes spawns a child running /bin/pwd on USG.
+
+Tue Jan 30 14:02:50 1990 Roland McGrath (mcgrath at homer.Berkeley.EDU)
+
+ * function.c (subst_expand): Pay attention to SUFFIX_ONLY, putz.
+
+Wed Jan 24 21:03:29 1990 Roland McGrath (mcgrath at homer.Berkeley.EDU)
+
+ * make.man: Fixed repeated word.
+
+ * make.texinfo (Missing): Reworded a buggy sentence.
+
+Mon Jan 22 12:39:22 1990 Roland McGrath (mcgrath at homer.Berkeley.EDU)
+
+ * main.c (print_version): Added 1990 to copyright notice.
+
+ * Version 3.57.6.
+
+Sat Jan 20 11:52:01 1990 Roland McGrath (mcgrath at homer.Berkeley.EDU)
+
+ * file.c (rename_file): Don't free the storage for the old name, since
+ it might not have been malloc'd.
+
+ * job.c (construct_command_argv): Call
+ allocated_variable_expand_for_file instead of variable_expand_for_file
+ to expand `$(SHELL)'.
+
+ * make.texinfo (Bugs): Change address from roland@wheaties.ai.mit.edu
+ to roland@prep.ai.mit.edu.
+
+Tue Jan 16 19:22:33 1990 Roland McGrath (mcgrath at tully.Berkeley.EDU)
+
+ * Version 3.57.5.
+
+Sun Jan 14 16:48:01 1990 Roland McGrath (mcgrath at helen.Berkeley.EDU)
+
+ * job.c (start_job): Only call wait_to_start_job for the first command
+ line in each sequence.
+
+Thu Jan 4 14:27:20 1990 Roland McGrath (mcgrath at helen.Berkeley.EDU)
+
+ * load.c [LDAV_BASED] (wait_to_start_job): Loop while job_slots_used >
+ 0, not > 1.
+
+ * job.c (search_path): Don't return a pointer to local storage.
+ Allocate data space for the pathname instead.
+
+ * function.c (expand_function: `shell'): Don't write garbage if the
+ child wrote no output.
+
+Wed Jan 3 15:28:30 1990 Roland McGrath (mcgrath at paris.Berkeley.EDU)
+
+ * Version 3.57.4.
+
+ * file.h (struct file): New member `renamed', a `struct file *' that is
+ the place this file has been renamed to (or nil).
+ (check_renamed): Macro to check for a file having been renamed.
+ Dereferences the renaming and sets the given variable.
+ * file.c (rename_file): Completely rewritten. Renames in place if
+ possible, or moves FILE to a different hash bucket if there is no
+ existing file with the new name. If there is an existing file with the
+ new name, FILE is merged into it and FILE->renamed is set to point to
+ it.
+ * variable.c (merge_variable_sets): New fn to merge two variable sets.
+ (merge_variable_set_lists): New fn to merge two variable set lists.
+ * variable.h: Declare merge_variable_set_lists.
+ * remake.c (update_file_1, check_dep): Run `check_renamed' after
+ calling file_mtime, check_dep.
+ (update_file): Same after update_file_1.
+ (update_goal_chain, update_file_1, check_dep): Same after update_file.
+
+ * read.c (uniquize_deps): New fn, broken out of record_files, to remove
+ duplicate deps from a chain.
+ (record_files): Use it.
+ * implicit.c (pattern_search): Use uniquize_deps.
+
+ * file.h (file_mtime_1): New macro, like file_mtime, but take second
+ arg, passed to f_mtime.
+ (file_mtime): Implement as file_mtime_1 (file, 1).
+ (file_mtime_no_search): New macro: file_mtime (file, 0).
+ * remake.c (f_mtime): Take new arg SEARCH. Only do VPATH and `-lNAME'
+ searching if it is nonzero.
+ * main.c (main): Use file_mtime_no_search for makefiles.
+ * remake.c (update_goal_chain): Use file_mtime_no_search if MAKEFILES.
+
+ * main.c (printed_version): New variable, init'd to zero.
+ (print_version): Set it to nonzero before returning.
+ (die): If -v and !printed_version, call print_version before clean up
+ and death.
+
+ * main.c (log_working_directory): Keep track of whether or not the
+ "Entering" message has been printed, and return without printing the
+ "Leaving" message if not.
+
+ * main.c (decode_switches): Don't complain about missing args before
+ checking for a noarg_value elt in the command_switch structure.
+
+Tue Jan 2 15:41:08 1990 Roland McGrath (mcgrath at tully.Berkeley.EDU)
+
+ * make.texinfo (Commands: Recursion: Options/Recursion): Document
+ special case of -j.
+
+ * make.texinfo, main.c, job.c: Changed copyright notices to include
+ 1990.
+
+ * make.texinfo (Top): Fixed introductory paragraph, which said that
+ `make' itself (instead of the manual) has various chapters.
+ (Variables: Advanced: Substitution Refs): When pxref'ing about
+ `patsubst', use node `Text Functions', not `Functions'.
+ Add an xref about `patsubst' after description of $(var:a%b=c%d).
+ (Functions: Syntax of Functions): Explain why mixing delimiters in
+ function/var refs is unwise. Clarify fn arg evaluation order.
+ (Options): Reworded sentence about `-e'.
+ (Implicit: Implicit Variables): Don't say `RM' is unused.
+ Say the dflt values for the flag vars is empty unless otherwise noted,
+ since some have defaults.
+ (Implicit: Pattern Rules: Pattern Examples): Clarified use of $< and $@
+ in first example.
+ (Implicit: Last Resort): Don't say the .DEFAULT example creates files
+ "silently". It's automatic, but not silent.
+ (Implicit: Search Algorithm): Fixed confusing ungrammatical sentence
+ for item 5.1.
+ (Archives: Archive Update): Added missing `next' pointer.
+ (Archives: Archive Symbols): Note that GNU `ar' deals with this
+ automatically.
+
+ * job.c (search_path): New fn, to search for an executable file in a
+ search path (broken out of exec_command).
+ (exec_command): Take fourth arg, the shell program to use (if
+ necessary). Use search_path for the program, and the shell program.
+ Pass args "file args ..." to shell program (with no -c), where FILE is
+ the full pathname of the program (script) to be run.
+ (child_execute_job): Pass shell program to exec_command.
+ * main.c (main): Ditto.
+
+ * main.c (main): Don't write a message if exec_command returns, because
+ it will never return.
+
+Fri Dec 22 16:19:58 1989 Roland McGrath (mcgrath at hecuba.Berkeley.EDU)
+
+ * default.c (default_variables: "LINK.cc"): Use $(C++FLAGS) instead of
+ $(CFLAGS).
+
+Wed Dec 20 09:58:48 1989 Roland McGrath (mcgrath at hecuba.Berkeley.EDU)
+
+ * job.c (new_job): If start_job set the child's `command_state' to
+ `cs_finished', call notice_finished_file.
+
+Sun Dec 17 19:45:41 1989 Roland McGrath (mcgrath at hecuba.Berkeley.EDU)
+
+ * Version 3.57.3.
+
+Wed Dec 13 17:57:12 1989 Roland McGrath (mcgrath at paris.Berkeley.EDU)
+
+ * rule.c (convert_to_pattern): Accept files with dependencies as
+ suffix rules.
+
+Thu Nov 30 15:47:13 1989 Roland McGrath (mcgrath at homer.Berkeley.EDU)
+
+ * Version 3.57.2.
+
+ * function.c (expand_function: `shell'): Don't clobber BUFFER and then
+ try to free it.
+
+ * remake.c (update_file_1): Took code to force remake of nonexistent
+ deps out of #if 0, and changed the test to nonexistent non-intermediate
+ deps. In version 4, I think removing this test completely will
+ implement the new feature that if a: b and b: c and c is newer than a,
+ b need not be remade.
+
+Sun Nov 26 16:12:41 1989 Roland McGrath (mcgrath at paris.Berkeley.EDU)
+
+ * compatMakefile (load.o, remote.o): Use $*.c instead of explicit file
+ names so that using VPATH works.
+
+Tue Nov 21 14:57:18 1989 Roland McGrath (mcgrath at paris.Berkeley.EDU)
+
+ * Version 3.57.1.
+
+Fri Nov 10 03:28:40 1989 Roland McGrath (mcgrath at paris.Berkeley.EDU)
+
+ * remake.c (check_dep): Set *MUST_MAKE_PTR if FILE does not exist after
+ being updated. (The exact opposite test was here before; why???)
+ (update_file_1): Set a dep's `changed' member after updating it if it
+ is phony and has commands (because they will then always be executed).
+
+Thu Nov 9 13:47:12 1989 Roland McGrath (mcgrath at paris.Berkeley.EDU)
+
+ * load.c [UMAX]: #ifdef UMAX_43 include different headers for the
+ `inq_stats' call.
+ * compatMakefile (LOAD_AVG): Document UMAX_43.
+
+ * Version 3.57.0.
+
+ * commands.c (chop_commands): New function to chop commands into lines.
+ * job.c (new_job): Break that code out, and call chop_commands.
+ * remake.c (remake_file): Call chop_commands before looking at
+ FILE->cmds->any_recurse.
+
+ * make.texinfo (Running: Goals): Don't say that the default target
+ won't be taken from an included makefile.
+
+ * remake.c (update_file_1): #if 0 out setting MUST_MAKE if a dep
+ doesn't exist.
+
+Fri Nov 3 15:53:03 1989 Roland McGrath (mcgrath at tully.Berkeley.EDU)
+
+ * Version 3.57.
+
+ * variable.c (try_variable_definition): Don't calculate useless value.
+
+ * main.c (define_makeflags): Fixed -j propagation.
+
+ * commands.c (execute_file_commands): Removed unused variable.
+
+Sun Oct 29 11:11:15 1989 Roland McGrath (mcgrath at paris.Berkeley.EDU)
+
+ * commands.c (execute_file_commands): If the commands are empty, call
+ notice_finished_file before returning.
+
+Sat Oct 28 23:06:32 1989 Roland McGrath (mcgrath at paris.Berkeley.EDU)
+
+ * remake.c (update_file_1): Don't always update a target that has no
+ deps. Only do this for double-colon targets.
+
+Wed Oct 25 16:36:16 1989 Roland McGrath (mcgrath at paris.Berkeley.EDU)
+
+ * main.c (main) [hpux]: hpux == HPUX.
+ * compatMakefile (defines): Document that HPUX should be defined.
+
+Tue Oct 24 19:19:48 1989 Roland McGrath (mcgrath at paris.Berkeley.EDU)
+
+ * Version 3.56.8.
+
+ * job.c (exec_command): Fixed what mode bits are checked.
+
+ * remake.c (update_file_1): "No cmds and no deps actually changed"
+ loses if ! FILE->is_target.
+
+ * make.texinfo (Variables: Setting): Don't say that spaces after a
+ variable definition are ignored (since they aren't).
+
+Mon Oct 23 14:34:23 1989 Roland McGrath (mcgrath at paris.Berkeley.EDU)
+
+ * Version 3.56.7.
+
+ * remake.c (update_file_1): If, after being updated, any dependency
+ does not exist, remake the target.
+
+ * remake.c (update_file_1): Always update if FILE has commands but no
+ deps.
+
+ * commands.c (execute_file_commands): If we return early because there
+ are no commands, set FILE->updated.
+
+Thu Oct 19 18:47:37 1989 Roland McGrath (mcgrath at paris.Berkeley.EDU)
+
+ * arscan.c (ar_scan) [M_XENIX]: Don't run atoi or atol on the
+ `struct ar_hdr' members that are int or long int on Xenix.
+
+Sat Oct 14 10:43:03 1989 Roland McGrath (mcgrath at paris.Berkeley.EDU)
+
+ * arscan.c (ar_scan): Cosmetic clean ups.
+ (ar_name_equal): New function to compare names, handling truncated
+ member names and special `.o' truncation.
+ (ar_member_pos): Use ar_name_equal.
+ * ar.c (ar_member_date_1): Use ar_name_equal.
+
+ * Version 3.56.6.
+
+ * file.h (struct file): Made `update_status' a `short int', and moved
+ it before `command_state' so the bitfields can be packed better.
+
+ * remake.c (files_remade): Made global.
+ (notice_finished_file): Don't increment files_remade.
+ * job.c (new_job): Do.
+
+ * job.c (start_job): Don't return a value. Always set
+ CHILD->file->command_state to either cs_running or cs_finished.
+ (new_job, child_handler): Don't expect start_job to return a value.
+ Instead, look at the file's command_state.
+
+ * commands.c (chop_commands): Merged into job.c (new_job).
+ * commands.h: Don't declare chop_commands.
+
+ * job.c (start_job): Made static.
+ (new_job): New function to create a `struct child' and call start_job.
+ (free_child): New function to free a `struct child'.
+ (child_handler, new_job): Call it.
+ * job.h: Don't declare start_job. Do declare new_job.
+ * commands.c (execute_file_commands): Call new_job.
+
+ * commands.c (execute_file_commands): Don't set FILE->update_status if
+ start_job fails.
+
+ * function.c (expand_function): Don't use `reading_filename' and
+ `reading_lineno_ptr' if they're nil.
+
+Fri Oct 13 18:16:00 1989 Roland McGrath (mcgrath at paris.Berkeley.EDU)
+
+ * read.c (find_semicolon): New function to look for an unquoted ; not
+ preceded by an unquoted # in a string.
+ (read_makefile): Call it before expanding the line. If it finds a ;,
+ cut the line short there before expanding it. If not, call it again
+ after expanding.
+
+ * commands.c (execute_file_commands): Don't check FILE->command_state.
+ We won't get called unless it's cs_not_started.
+
+ * read.c (read_makefile): Call collapse_line on the variable-expanded
+ rule line after checking for ; and #.
+
+ * job.c (start_job): When there are no more commands, always return 0.
+ * commands.c (execute_file_commands): Don't put the new child in the
+ `children' chain unless FILE->command_state is cs_running.
+
+ * read.c (read_makefile): Rewrote ;-handling to only do it once (why
+ did I do it twice??) and to check for a # before the ;.
+
+ * job.c (start_job): Set CHILD->file->update_status to 0 when we run
+ out of commands. Set it to 1 before returning failure.
+ (child_handler): Don't set C->file->update_status to 0 when start_job
+ returns success and commands are not running.
+
+ * read.c (read_makefile): If there is a # before the ; for commands,
+ forget the ; and commands.
+
+Thu Oct 12 15:48:16 1989 Roland McGrath (mcgrath at paris.Berkeley.EDU)
+
+ * job.c (child_execute_job): Pass -c to the shell.
+
+Wed Oct 11 18:41:10 1989 Roland McGrath (mcgrath at paris.Berkeley.EDU)
+
+ * Version 3.56.5.
+
+ * main.c (define_makeflags): Cleaned up to keep better track of dashes
+ written, etc.
+
+ * function.c (expand_function: `shell'): When converting newlines to
+ spaces in output, search with `index' calls rather than a simple loop.
+
+ * main.c (main): Make sure stdout is line-buffered.
+
+ * main.c (decode_switches): Always check for missing switch arg.
+
+Mon Oct 9 17:17:23 1989 Roland McGrath (mcgrath at paris.Berkeley.EDU)
+
+ * Version 3.56.4.
+
+Sat Oct 7 00:32:25 1989 Roland McGrath (mcgrath at paris.Berkeley.EDU)
+
+ * commands.c (set_file_variables): #ifdef NO_ARCHIVES, still set $@ and
+ $%.
+
+ * commands.c (set_file_variables): Include a trailing slash in the
+ directory variables (@D, etc.).
+
+ * job.c (child_handler): Call notice_finished_file after changing a
+ child's state to `cs_finished'.
+ * remake.c (update_file_1): Don't call notice_finished_file if
+ FILE->command_state == cs_finished.
+
+Wed Oct 4 16:09:33 1989 Roland McGrath (mcgrath at paris.Berkeley.EDU)
+
+ * Version 3.56.3.
+
+Tue Oct 3 21:09:51 1989 Roland McGrath (mcgrath at paris.Berkeley.EDU)
+
+ * read.c (read_all_makefiles): When setting elements of MAKEFILES from
+ the contents of read_makefiles, make sure we're using the right
+ element.
+
+ * dir.c, glob.c [USGr3 || DIRENT]: Don't define d_ino as d_fileno.
+
+ * Version 3.56.2.
+
+ * remake.c (update_file_1): Return zero after calling remake_file if
+ FILE->command_state != cs_finished. Test update_status thoroughly.
+
+ * commands.c (execute_file_commands): Don't call notice_finished_file.
+
+ * remake.c (remake_file): Return immediately after calling
+ execute_file_commands.
+
+Sat Sep 30 14:57:05 1989 Roland McGrath (mcgrath at paris.Berkeley.EDU)
+
+ * Version 3.56.1 (alpha).
+
+ * file.h (struct file): Made `update_status' not be a bitfield, since
+ some broken compilers don't handle it right.
+
+ * function.c (expand_function: `join'): Don't clobber the pointers and
+ then try to free them.
+
+ * job.c (exec_command): Fixed & vs = precedence problem.
+
+Thu Sep 28 17:29:56 1989 Roland McGrath (mcgrath at paris.Berkeley.EDU)
+
+ * remake.c (update_file_1): Fixed typo in debugging output.
+
+ * remake.c (library_file_mtime): Search for /usr/local/lib/libLIB.a
+ after /usr/lib/libLIB.a.
+
+Tue Sep 26 16:07:58 1989 Roland McGrath (mcgrath at helen.Berkeley.EDU)
+
+ * read.c (conditional_line): For `ifeq (a, b)', swallow space after the
+ comma.
+
+Sun Sep 24 13:25:32 1989 Roland McGrath (mcgrath at paris.Berkeley.EDU)
+
+ * function.c (patsubst_function): If BY_WORD and the match is not a
+ full word, update the text pointer correctly.
+
+ * function.c (expand_function: `word'): Don't lose track of the second
+ arg's expansion and free something else instead.
+
+Fri Sep 22 16:15:29 1989 Roland McGrath (mcgrath at paris.Berkeley.EDU)
+
+ * Version 3.56.
+
+Thu Sep 21 14:28:42 1989 Roland McGrath (mcgrath at paris.Berkeley.EDU)
+
+ * main.c (main): Make an array of the mtimes of the makefiles before
+ updating them, and compare their file_mtimes against this later. Don't
+ re-exec if a makefile was successfully updated but didn't change. If a
+ makefile failed to be remade and no longer exists, die. If a makefile
+ failed to be remade, but changed anyway, re-exec. If a makefile failed
+ to be remade, but is unchanged, continue on.
+
+Wed Sep 20 18:02:07 1989 Roland McGrath (mcgrath at paris.Berkeley.EDU)
+
+ * Version 3.55.6.
+
+ * implicit.c (pattern_search): Maintain an array CHECK_LASTSLASH of the
+ CHECK_LASTSLASH flag values used to match each member of TRYRULES.
+ When making FILE->stem, if CHECKED_LASTSLASH[FOUNDRULE], prepend the
+ part of FILENAME before LASTSLASH.
+
+Tue Sep 19 17:44:08 1989 Roland McGrath (mcgrath at paris.Berkeley.EDU)
+
+ * dir.c (dir_file_exists_p): Check for FILENAME being nil before
+ checking for it being "".
+
+ * main.c (define_makeflags): Fixed test for whether a flag/flag_off
+ option was non-default. Also changed to generate a string that Unix
+ Make will grok (except for FP/int values and new flags).
+
+ * job.c (child_execute_job): Don't use the shell's -c option.
+ Also fixed an off-by-one bug in the ARGV -> shell arg list copying.
+
+Mon Sep 18 15:17:31 1989 Roland McGrath (mcgrath at paris.Berkeley.EDU)
+
+ * Version 3.55.5.
+
+ * read.c (parse_file_seq): Check the beginning of the file name for a
+ `./', not the two chars after the end of the name (Q rather than P).
+
+ * job.c (child_execute_job): Include all of ARGV in the arg list for
+ the shell.
+
+ * main.c (define_makeflags): Don't include floating and positive_int
+ options in !PF.
+
+ * job.c (exec_command): Set the effective gid to the real gid before
+ execing.
+
+ * job.c (child_execute_job): Don't clobber the arg list when execing
+ the shell.
+
+Sun Sep 17 15:27:19 1989 Roland McGrath (mcgrath at paris.Berkeley.EDU)
+
+ * main.c (define_makeflags): Moved all the checking inside the switch.
+
+ * load.c [LDAV_BASED] (load_average): When we can't get the load
+ average, return zero instead of running off the end.
+
+ * file.c: Include variables.h.
+ * job.c: Declare dup2 and {block,unblock}_remote_children.
+ * file.h: Declare f_mtime.
+ * job.c: Don't declare construct_command_argv, since job.h does.
+ * function.c, main.c, load.c, remake.c: Include job.h.
+ * load.c [LDAV_BASED] (load_average): Declare nlist.
+ * variable.h: Declare print_file_variables.
+ * job.c [!USG]: Don't declare sigsetmask.
+ [!USG]: Declare getdtablesize.
+ Don't declare load_average. Do declare wait_to_start_job.
+ Declare vfork, gete[gu]id, execve.
+ * commands.c: Declare remote_kill, getpid.
+ * make.h: Declare kill, exit, sigblock, pipe, close, ctime, open,
+ lseek, read.
+ * make.h [not USG]: Declare sigsetmask.
+ * job.h: Declare wait_for_children and {block,unblock}_children.
+
+ * dir.c (dir_file_exists_p): If FILENAME is nil, read in the whole
+ directory.
+ (find_directory): When we want to read in the whole directory, call
+ dir_file_exists_p with nil instead of "".
+
+ * file.h (struct file), job.h (struct child),
+ variable.h (struct variable): Use bitfields for flags.
+ * make.h (ENUM_BITFIELD): If GCC or #ifdef ENUM_BITFIELDS, define as
+ :BITS, else empty.
+ * compatMakefile (defines): Document ENUM_BITFIELDS.
+
+Sat Sep 16 12:38:58 1989 Roland McGrath (mcgrath at paris.Berkeley.EDU)
+
+ * Version 3.55.4 (alpha).
+
+ * GNUmakefile (dist): Depend on default and doc.
+
+ * load.c [LDAV_BASED]: Include <nlist.h> rather than <a.out.h>; #ifdef
+ NLIST_NAME_UNION, use n_un.n_name instead of n_name.
+ * compatMakefile (LOAD_AVG): Document NLIST_NAME_UNION.
+
+ * job.c [USG-ish]: Don't redefine WIF{SIGNALED,EXITED} if they're
+ already defined.
+
+Fri Sep 15 13:59:42 1989 Roland McGrath (mcgrath at paris.Berkeley.EDU)
+
+ * glob.c, dir.c [USGr3 or DIRENT]: If neither d_ino, nor d_fileno is
+ defined, define d_ino as d_fileno.
+
+Thu Sep 14 18:29:38 1989 Roland McGrath (mcgrath at paris.Berkeley.EDU)
+
+ * job.c: Don't declare exec_command static.
+
+ * make.texinfo (Name Index): Changed title to include directives.
+
+ * Version 3.55.3 (alpha).
+
+ * make.texinfo (Running: Options): Document -e.
+
+ * main.c (main): Always give imported environment variables origin
+ `o_env'.
+ * variable.c (define_variable_in_set): Under -e, if ORIGIN, or an
+ existing variable's origin, is `o_env', make it `o_env_override'.
+
+ * load.c: Use the symbol KERNEL_FILE_NAME instead of KERNEL_FILE.
+ * compatMakefile: Changed the comment for `LOAD_AVG' accordingly.
+
+Thu Sep 7 16:46:26 1989 Roland McGrath (mcgrath at paris.Berkeley.EDU)
+
+ * Version 3.55.2 (alpha).
+
+ * variable.c (print_variable_set), rule.c (print_rule_data_base),
+ file.c (print_file_data_base): If NO_FLOAT is defined, don't use
+ floating-point for printing statistics.
+ * compatMakefile (defines): Document NO_FLOAT.
+
+ * make.h (HASH): New macro to add the hashing value of one char to a
+ variable.c.
+ * file.c (lookup_file, enter_file, rename_file): Use it.
+ * dir.c (find_directory, dir_file_exists_p, file_impossible_p): Ditto.
+ * variable.c (define_variable_in_set, lookup_variable): Same here.
+
+ * variable.c, file.c, dir.c: Don't define *_BUCKETS if they are already
+ defined.
+
+ * compatMakefile (defines): Added comment about defining NO_ARCHIVES.
+ (ARCHIVES, ARCHIVES_SRC): New variables for {ar,arscan}.[oc].
+ (objs, srcs): Use $(ARCHIVES) and $(ARCHIVES_SRC).
+ * commands.c (set_file_variables), dir.c (file_exists_p),
+ remake.c (touch_file, name_mtime), implicit.c (try_implicit_rule,
+ pattern_search), make.h: If NO_ARCHIVES is #defined, don't do any
+ archive stuff.
+
+ * commands.c (set_file_variables): Don't kill the last char of
+ directory names in $([@*<%?^]D).
+
+Wed Sep 6 15:23:11 1989 Roland McGrath (mcgrath at paris.Berkeley.EDU)
+
+ * default.c (default_terminal_rules {%:: %,v}, {%:: RCS/%,v}): Don't
+ run co if the target exists.
+
+ * glob.c (glob_match): [!xyz], rather than [^xyz], means none of [xyz].
+
+ * glob.c: Misc minor cosmetic changes.
+
+Tue Sep 5 14:49:56 1989 Roland McGrath (mcgrath at saffron.Berkeley.EDU)
+
+ * load.c [LDAV_BASED] (load_average): Check for == -1, rather than < 0
+ to see if lseek fails. On some systems, `avenrun' is at an offset >
+ (2**31)-1, and lseek succeeds, returning a negative value.
+
+Mon Sep 4 11:07:58 1989 Roland McGrath (mcgrath at saffron.Berkeley.EDU)
+
+ * rule.c (new_pattern_rule): Return `int' instead of `void': nonzero if
+ the passed rule was used, zero if not.
+ (install_pattern_rule): Pay attention to the return from
+ new_pattern_rule, and don't set the rule's `terminal' flag or give it
+ commands unless it's used.
+ (create_pattern_rule): Same idea.
+
+ * dir.c (find_directory): Removed unused variable.
+
+ * commands.c (execute_file_commands): Removed unused variable.
+
+ * read.c (record_files): Don't use NAME after freeing it.
+
+Sat Sep 2 00:33:19 1989 Roland McGrath (mcgrath at saffron.Berkeley.EDU)
+
+ * Version 3.55.1 (alpha).
+
+ * function.c (string_glob): Don't add spaces after file names that
+ aren't added. (Also means don't add spaces without checking the size
+ of the buffer.)
+
+ * remake.c (update_goal_chain): Don't remove makefiles with cmds and no
+ deps from the chain.
+ * main.c (main): Do it here, before calling update_goal_chain.
+
+ * remake.c (update_goal_chain): When updating fails, change STATUS even
+ if MAKEFILES is set. Also stop remaking when updating fails if not
+ under -k and MAKEFILES is not set.
+
+ * remake.c (remake_file, update_file_1, notice_finished_file),
+ commands.c (execute_file_commands), make.h, commands.h: The functions
+ remake_file, notice_finished_file, and execute_file_commands no longer
+ return values, and their callers no longer expect values returned.
+
+ * remake.c (notice_finished_file): Don't set FILE's modtime to now if
+ it is a non-target with no commands.
+
+Fri Sep 1 00:04:39 1989 Roland McGrath (mcgrath at saffron.Berkeley.EDU)
+
+ * read.c (read_all_makefiles): After freeing each element on MAKEFILES,
+ replace it with the name stored in read_makefiles by read_makefile.
+
+ * remake.c (update_file_1): Don't decide not to remake if FILE has no
+ cmds and no deps actually changed if FILE doesn't have any deps.
+
+ * file.c (remove_intermediate): Remove precious files that also have
+ the `dontcare' flag set.
+
+ * remake.c (update_file_1): Don't always remake if FILE has cmds but no
+ deps; only if FILE is double-colon. (I don't know why this should be
+ done for double-colon targets, but that's what Unix make does.)
+
+ * load.c [LDAV_BASED] (load_average): Write error messages if the
+ various system calls fail. Keep track of if we've failed before.
+ The first time we fail, write a message saying -l won't be enforced.
+ The first time we succeed after having failed, write a message saying
+ -l will be enforced again.
+
+ * remake.c [USG]: Don't #include <sys/file.h>
+
+ * load.c [generic Unix LDAV_BASED]: #include <fcntl.h> #ifdef USG,
+ else <sys/file.h> instead.
+
+ * job.c [USG && !USGr3 && !HAVE_DUP2]: Remove redundant
+ #include <errno.h> and declaration of `errno'.
+ [...] (dup2): Fixed so it won't always lose.
+
+ * default.c (default_suffix_rules: .texinfo.dvi): Copy, rather than
+ move, the aux and index files, so the TeX run can use them.
+
+ * compatMakefile: Remove redundant comment.
+
+ * load.c [generic Unix LDAV_BASED]: Include <a.out.h> instead of
+ <nlist.h>, since the `struct nlist' declaration in <nlist.h> varies
+ more than the one in <a.out.h>.
+ (load_average): Use the `n_un.n_name' field of the `struct nlist',
+ since the <a.out.h> declaration uses the union.
+
+ * main.c (main): For the temporary files made for stdin makefiles, set
+ the `intermediate' and `dontcare' flags.
+ * file.c (remove_intermediates): Don't print any messages for files
+ whose `dontcare' flag is set. (The only files that will be
+ intermediate and `dontcare' will be the temporary files made for stdin
+ makefiles.)
+
+ * job.c (exec_command): Made global.
+ * job.h: Declare it.
+ * main.c (main): Use exec_command when re-execing.
+
+ * make.h: Declare environ.
+ * make.c: Don't.
+
+ * job.c (child_execute_job): New function to perform everything done in
+ the child side of a fork (for a job or `shell' function).
+ (start_job): Call it.
+ * job.h: Declare construct_command_argv and child_execute_job.
+ * function.c (expand_function: `shell'): Use child_execute_job.
+
+Thu Aug 31 18:42:51 1989 Roland McGrath (mcgrath at saffron.Berkeley.EDU)
+
+ * function.c (expand_function: `shell'): Remove a trailing newline
+ instead of turning it into a space.
+
+ * main.c (main): Do init_siglist #ifdef HAVE_SIGLIST.
+
+ * job.c [WTERMSIG || (USG && !HAVE_SYS_WAIT)]: Test each W* macro
+ separately and define all those that aren't defined.
+
+Sat Aug 26 15:13:21 1989 Roland McGrath (roland at hobbes.ai.mit.edu)
+
+ * ar.c (ar_name): Return zero for `(foo)'.
+
+ * Version 3.55.
+
+ * make.texinfo (Rules: Multiple Targets): Make this node's `next'
+ pointer point to `Static Pattern'.
+ * make.texinfo (Makefiles: MAKEFILES Variable): Make this node's `prev'
+ pointer point to `Makefile Names'.
+
+ * make.1: Renamed to make.man.
+ * compatMakefile: Define `mandir' and `manext'.
+ (install): Depend on $(mandir)/make.$(manext).
+ ($(mandir)/make.$(manext)): Depend on make.man and copy it to $@.
+ ($(bindir)/make): Use `make' rather than $<; so Unix make can grok it.
+
+Thu Aug 24 03:35:48 1989 Roland McGrath (roland at hobbes.ai.mit.edu)
+
+ * variable.c (target_environment): Allow variables that start with
+ underscores.
+
+Wed Aug 23 22:50:32 1989 Roland McGrath (roland at hobbes.ai.mit.edu)
+
+ * variable.c (target_environment): Reject variables that don't start
+ with letters.
+
+Tue Aug 22 04:14:29 1989 Roland McGrath (roland at hobbes.ai.mit.edu)
+
+ * GNUmakefile (make-$(version).tar.Z): Put make.1 (the Unix manual
+ page) in the tar file.
+
+ * variable.c (target_environment): Don't write variables with origin
+ o_default (i.e., ones from default.c).
+ * make.texinfo (Commands: Recursion: Variables/Recursion): Document
+ that default variables are not put in the environment.
+
+ * remake.c (update_file_1): Remake all targets with commands but no
+ deps.
+
+Sat Aug 19 06:03:16 1989 Roland McGrath (roland at hobbes.ai.mit.edu)
+
+ * remake.c (update_file_1): In the final loop, set the deps'
+ `changed' members if they are newer than FILE.
+
+ * remake.c (update_goal_chain): Under -d, print a message if we decide
+ not to remake a makefile so as to avoid a possible infinite loop.
+
+Fri Aug 18 20:30:14 1989 Roland McGrath (roland at hobbes.ai.mit.edu)
+
+ * remake.c (remake_file): Cleaned up.
+
+ * commands.c (execute_file_commands): If the commands are empty, set
+ FILE->update_status to zero before returning.
+
+ * remake.c (notice_finished_file): Set `last_mtime' fields to zero
+ instead of calling name_mtime; file_mtime will do that later if anybody
+ cares.
+
+Thu Aug 17 10:01:11 1989 Roland McGrath (roland at hobbes.ai.mit.edu)
+
+ * make.texinfo (Rules: Wildcards: Wildcard Examples): Give this node a
+ `prev' pointer.
+
+ * Version 3.54.9 (alpha).
+
+ * make.texinfo: Fixed some @nodes.
+
+ * remake.c (check_dep): Don't set *MUST_MAKE_PTR if FILE doesn't exist
+ after running update_file.
+
+ * remake.c (notice_finished_file): If FILE has no commands, pretend its
+ modtime is now.
+
+ * remake.c (update_file_1): In the loops that call update_file on the
+ deps, compare modtimes before and after (unless deps are still being
+ made) and set the deps' `changed' members. Do not set the `changed'
+ members in the loop that prints the newer/older debugging messages.
+ * remake.c (update_file_1): If no deps changed and FILE has no
+ commands, decide it doesn't need remaking.
+
+ * remake.c (update_file_1): Print a debugging message if we take
+ commands from default_file.
+
+ * make.texinfo (Rules: Directory Search: Selective Search): Removed
+ note about warning for `vpath' with a constant pathname, since it isn't
+ warned about anymore.
+
+ * remake.c (update_goal_chain): If MAKEFILES, remove makefiles which
+ are targets and have no deps.
+ * make.texinfo (Makefiles: Remaking Makefiles): Document that makefiles
+ will not be remade if they are targets but have no dependencies.
+
+Tue Aug 15 00:00:08 1989 Roland McGrath (roland at apple-gunkies.ai.mit.edu)
+
+ * remake.c (notice_finished_file): Increment files_remade for non-phony
+ files if they didn't exist before (even if they still don't).
+
+ * job.c: Include <errno.h> and declare errno.
+
+ * job.c (exec_command): If the execve fails with ENOEXEC (Exec format
+ error), return instead of exiting the child process.
+
+ * job.c (start_job): In the child side, if exec_command fails, try
+ using the shell.
+
+ * job.c (start_job): In the child side, call unblock_children instead
+ of sigsetmask.
+
+ * remake.c (notice_finished_file): Under -n or -q, always increment
+ files_remade for non-phony files.
+
+ * rule.c (intall_pattern_rule): Use find_percent.
+
+ * vpath.c (vpath_search): Pass the `percent' members to
+ pattern_matches.
+
+Mon Aug 14 23:30:24 1989 Roland McGrath (roland at apple-gunkies.ai.mit.edu)
+
+ * vpath.c (struct vpath): New member `percent', to hold a pointer into
+ the pattern where the % is.
+ (construct_vpath_list): Call find_percent on the pattern and set the
+ new `percent' member.
+ * read.c (read_makefile): Don't run find_percent on `vpath' directive
+ patterns.
+
+ * function.c (pattern_matches): Take new arg PERCENT, a pointer into
+ PATTERN where the % is. If PERCENT is nil, copy PATTERN into local
+ space and run find_percent on it.
+ (expand_function: `filter', `filter-out'): Pass new arg to
+ pattern_matches.
+ * read.c (record_files): Pass PATTERN_PERCENT to pattern_matches for
+ static pattern rules. Save the percent pointer into implicit rule
+ targets, and pass them to create_pattern_rule.
+ * rule.c (convert_to_pattern): Pass new arg to create_pattern_rule.
+ (create_pattern_rule): Take new arg TARGET_PERCENTS, nil or an array of
+ pointers into the corresponding elements of TARGETS, where the %s are.
+
+Sun Aug 13 00:29:19 1989 Roland McGrath (roland at hobbes.ai.mit.edu)
+
+ * Version 3.54.8.
+
+ * README.templatate, README-doc.template: New files, turned into README
+ and README-doc to go into the two distribution tar files.
+ * GNUmakefile: Added a rule to edit the version number in
+ README.template and README-doc.template, producing README and
+ README-doc.
+
+ * remake.c (update_goal_chain): If -n or -q is in effect for a
+ makefile, and it got updated, don't change STATUS, so we can still
+ return -1 (meaning nothing was done). This avoids an infinite loop on
+ "make -n Makefile".
+
+Sat Aug 12 23:14:24 1989 Roland McGrath (roland at hobbes.ai.mit.edu)
+
+ * remake.c (notice_finished_file): Treat -q the same as -n.
+
+ * remake.c (update_goal_chain): Fixed handling of return from
+ update_file. If -n or -q is in effect, ignore it.
+
+ * job.c (start_job): Don't test for -t. We should never get called in
+ that case.
+
+Fri Aug 11 04:09:14 1989 Roland McGrath (roland at hobbes.ai.mit.edu)
+
+ * function.c (expand_function): Removed unused variables.
+ (handle_function): Removed unused variable.
+
+ * main.c (main): Removed unused variable.
+
+Wed Aug 9 09:37:10 1989 Roland McGrath (roland at hobbes.ai.mit.edu)
+
+ * Version 3.54.7.
+
+ * remake.c (notice_finished_file): If FILE's modtime actually changed,
+ increment files_remade.
+ (remake_file): Don't increment files_remade.
+
+ * remake.c (update_file): Don't print "up to date" messages for
+ phony files.
+
+ * job.c (child_handler): Don't set C->file->update_status to 1 if
+ start_job returns nonzero under -n or -t.
+
+ * expand.c (variable_expand): Count parens in $(foo:a=b) refs.
+
+ * main.c: Removed old declaration of `glob_tilde' (which hasn't existed
+ for a few months).
+
+Tue Aug 8 23:53:43 1989 Roland McGrath (roland at hobbes.ai.mit.edu)
+
+ * job.c (exec_command): Fixed to not ignore the last path component and
+ to do the right thing with an empty path.
+
+Fri Aug 4 15:58:19 1989 Roland McGrath (roland at hobbes.ai.mit.edu)
+
+ * remake.c (library_file_mtime): Look for libLIB.a, not /libLIB.a.
+ Do VPATH search on libLIB.a, not /usr/lib/libLIB.a
+
+Thu Aug 3 20:42:00 1989 Roland McGrath (roland at hobbes.ai.mit.edu)
+
+ * job.c [HAVE_SYS_WAIT or not USG]: If WIFSIGNALED is not defined by
+ <sys/wait.h>, define it as (WTERMSIG != 0).
+
+Tue Aug 1 19:25:34 1989 Roland McGrath (roland at hobbes.ai.mit.edu)
+
+ * remake.c (remake_file): If FILE has no commands and is a target,
+ don't set its time to now. The time gets reset by notice_finished_file
+ anyway, and it isn't needed since check_dep checks for nonexistence.
+
+ * Version 3.54.6.
+
+ * read.c (read_makefile): Don't read off the end of the string after an
+ `include'.
+
+ * job.c (exec_command): New function to search the path for a file and
+ execute it.
+ (start_job): Use exec_command rather than execvp.
+
+ * read.c (read_makefile): Expand `include' directive args before
+ parsing them. Allow trailing whitespace after filename.
+
+ * variable.c (target_environment): Put makelevel + 1, rather than
+ makelevel, in the `MAKELEVEL' envariable.
+
+Sat Jul 29 10:27:04 1989 Roland McGrath (roland at hobbes.ai.mit.edu)
+
+ * remake.c (notice_finished_file): Don't get the new modtime of phony
+ files.
+
+ * remake.c (remake_file): Run commands instead of touching under -t if
+ FILE->cmds->any_recurse is set.
+
+ * commands.h (struct commands): Add new member `any_recurse', to be set
+ nonzero if any `lines_recurse' element is nonzero.
+ * commands.c (chop_commands): Set the `any_recurse' member.
+
+ * commands.c (execute_file_commands): Split chopping of commands into
+ lines into new function chop_commands.
+ * commands.h: Declare chop_commands.
+
+ * read.c (read_makefile): Test for a line beginning with a tab after
+ checking for conditional lines, but before all other checks.
+
+Fri Jul 28 18:10:29 1989 Roland McGrath (roland at hobbes.ai.mit.edu)
+
+ * read.c (read_makefile): Match directives against collapsed line
+ and use that for their args.
+
+ * read.c (read_makefile): Warn about extra text after `include'.
+
+Tue Jul 25 14:34:25 1989 Roland McGrath (roland at hobbes.ai.mit.edu)
+
+ * make.texinfo (Rules: Directory Search: Selective Search): Fixed
+ example to use correct `vpath' syntax.
+
+Mon Jul 24 12:10:58 1989 Roland McGrath (roland at hobbes.ai.mit.edu)
+
+ * Version 3.54.5.
+
+ * job.c (start_job): In the child side, unblock SIGCHLD.
+
+Fri Jul 21 18:25:59 1989 Roland McGrath (roland at hobbes.ai.mit.edu)
+
+ * make.h: Don't include <sys/types.h> #ifdef sun.
+
+Mon Jul 17 14:29:10 1989 Roland McGrath (roland at hobbes.ai.mit.edu)
+
+ * implicit.c (pattern_search): If ar_name (FILENAME), don't check for
+ directory names.
+
+ * job.c (wait_for_children): Changed "waiting for children" message to
+ "waiting for unfinished jobs".
+
+Fri Jul 14 13:17:13 1989 Roland McGrath (roland at hobbes.ai.mit.edu)
+
+ * load.c (load_average): Use an unsigned offset into kmem.
+
+Thu Jul 13 18:44:49 1989 Roland McGrath (roland at hobbes.ai.mit.edu)
+
+ * variable.c (pop_variable_scope): Don't free the head of the chain of
+ variables in each bucket twice.
+
+Tue Jul 11 06:45:24 1989 Roland McGrath (roland at hobbes.ai.mit.edu)
+
+ * GNUmakefile: Include COPYING in the doc tar file.
+
+ * variable.c, read.c, misc.c, job.c, function.c: Replace some identical
+ "for" loops with next_token or end_of_token calls.
+
+Mon Jul 10 16:55:08 1989 Roland McGrath (roland at hobbes.ai.mit.edu)
+
+ * Version 3.54.4.
+
+ * compatMakefile: Documented new conditionals.
+
+ * job.c: Don't define sys_siglist if HAVE_SIGLIST is defined.
+ Don't define dup2 if HAVE_DUP2 is defined.
+
+ * job.c (child_handler): Interpret the return from start_job correctly.
+
+ * remake.c (update_file_1): Don't write "target not remade because of
+ errors" message under -n or -q.
+
+ * read.c: Declare getpwnam.
+
+ * glob.c: Use <dirent.h> if DIRENT is defined.
+ [USG]: Don't declare memcpy, since <memory.h> does.
+
+Fri Jul 7 20:53:13 1989 Roland McGrath (roland at hobbes.ai.mit.edu)
+
+ * misc.c (collapse_line): Copy the line over in the right place.
+
+Fri Jul 7 18:33:24 1989 Roland McGrath (fsf at void.ai.mit.edu)
+
+ * remake.c: Conditionalize inclusion of <sys/file.h> on not
+ USG, since HP-UX defines a `struct file' there.
+
+Fri Jul 7 12:11:30 1989 Roland McGrath (roland at hobbes.ai.mit.edu)
+
+ * job.c: If WTERMSIG is defined by <sys/wait.h>, define WAIT_T as int,
+ and don't define other macros; this covers HP-UX.
+ If WTERMSIG is not defined, use int or union wait based on USG and
+ HAVE_SYS_WAIT; this covers BSD and SysV.
+
+ * Version 3.54.3 (alpha).
+
+ * job.c [USG and not USGr3]: Include <errno.h> and declare errno.
+
+ * job.c (unblock_children [USG]): Declare child_handler.
+
+ * job.c: Renamed WRETCODE to WEXITSTATUS.
+ [HAVE_SYS_WAIT or not USG]: Undefine WTERMSIG, WCOREDUMP, and
+ WEXITSTATUS before defining them. The HP-UX <sys/wait.h> defines them.
+
+ * main.c (main): If there are no goals, fatal AFTER printing the data
+ base under -p.
+
+Thu Jul 6 22:43:33 1989 Roland McGrath (roland at apple-gunkies.ai.mit.edu)
+
+ * glob.c [USG]: #define rindex as strrchr.
+
+ * job.c [USG]: Include <sys/param.h> and #define getdtablesize() as
+ NOFILE.
+
+Wed Jul 5 09:36:00 1989 Roland McGrath (roland at hobbes.ai.mit.edu)
+
+ * Version 3.54.2 (alpha).
+
+ * expand.c (variable_expand): When expanding recursive variable
+ references (${${a}}), use the correct delimiters in the constructed
+ variable reference.
+
+Mon Jul 3 18:29:26 1989 Roland McGrath (roland at apple-gunkies.ai.mit.edu)
+
+ * compatMakefile: Clear out and redefine the .SUFFIXES list because
+ silly Sun 4 make defines .cps.h.
+
+ * compatMakefile: Fix comment about -DNO_MINUS_C_MINUS_O.
+
+ * remake.c: Include <sys/file.h> for O_* on 4.2.
+
+ * commands.c: Define sigmask if it's not defined.
+
+Fri Jun 30 07:33:08 1989 Roland McGrath (roland at apple-gunkies.ai.mit.edu)
+
+ * remake.c (remake_file): Don't always increment files_remade.
+
+ * variable.c (push_new_variable_scope): Zero the new variable hash
+ table.
+
+Thu Jun 29 17:14:32 1989 Roland McGrath (roland at hobbes.ai.mit.edu)
+
+ * expand.c (variable_expand): When terminating the variable expansion
+ buffer, use variable_buffer_output instead of a simply zero store,
+ because the buffer may need to be enlarged.
+
+Wed Jun 28 16:53:47 1989 Roland McGrath (roland at hobbes.ai.mit.edu)
+
+ * Version 3.54.
+
+ * default.c (default_suffixes): Added `.ln'.
+ (default_suffix_rules): Changed lint rules to use -C.
+
+Thu Jun 22 20:49:35 1989 Roland McGrath (roland at hobbes.ai.mit.edu)
+
+ * job.c (start_job): Set `environ' to CHILD->environment before execing
+ in the child process!
+
+Tue Jun 20 17:23:13 1989 Roland McGrath (roland at spiff.ai.mit.edu)
+
+ * compatMakefile: Put job.h and rule.h in `srcs'.
+
+ * Version 3.53.
+
+Mon Jun 19 16:25:18 1989 Roland McGrath (roland at spiff.ai.mit.edu)
+
+ * job.c (start_job): If there are no more commands, return nonzero
+ under -n or -t.
+
+ * compatMakefile (make): Pass `-f' to mv.
+
+ * GNUmakefile: If `ARCH' or `machine' is defined, make $(ARCH)/*.o and
+ $(ARCH)/make instead of *.o and make.
+
+ * function.c (string_glob): Don't try to use freed storage!
+
+ * read.c (readline): If there is only one byte of space in the buffer,
+ enlarge the buffer before reading more.
+
+ * arscan.c [M_XENIX]: Miscellaneous minor changes for Xenix.
+
+Sun Jun 18 13:07:45 1989 Roland McGrath (roland at hobbes.ai.mit.edu)
+
+ * GNUmakefile (depend): Split commands into two lines so they won't be
+ so long when variable-expanded.
+
+ * compatMakefile: Documented MINUS_C_MINUS_O meaning. The line
+ describing it got removed when the USG/wait stuff was documented.
+
+Sat Jun 17 22:56:54 1989 Roland McGrath (roland at hobbes.ai.mit.edu)
+
+ * Version 3.52.
+
+Mon Jun 12 17:45:11 1989 Roland McGrath (mcgrath at paris.Berkeley.EDU)
+
+ * remake.c (check_dep): Drop circular dependencies instead of fataling.
+ (update_file_1 already does this.)
+
+ * default.c (default_suffix_rules): For .s -> .o, put the -o flag to
+ the assembler before the source file name.
+
+Sun Jun 11 12:00:52 1989 Roland McGrath (mcgrath at homer.Berkeley.EDU)
+
+ * Version 3.51.
+
+ * make.texinfo (Features): Noted 1003.2 requirement of `+' meaning.
+
+ * file.c (remove_intermediates): If !SIG, write a single "rm" command
+ line, listing all files.
+
+ * read.c (read_makefile): Don't free the storage for the passed
+ filename, since it might not be malloc'd. When doing an included
+ makefile, free the name's storage.
+ (read_all_makefiles): Use variable_expand to find the value of
+ `MAKEFILES'. Free the storage for the names of -f makefiles.
+ (read_makefile): Allocate storage for the makefile name in the
+ `struct file' in read_makefiles.
+
+ * make.texinfo (Running: Instead of Execution): Document the effect of
+ + and $(MAKE)/${MAKE}.
+
+ * make.texinfo (Functions: Foreach Function): Document that if the
+ iteration variable was undefined before the `foreach' call, it will be
+ undefined after the call.
+
+ * commands.c: Split into commands.c, job.h, and job.c.
+
+ * rule.c (try_implicit_rule, pattern_search): Moved to new file
+ implicit.c.
+
+ * rule.c: Split into rule.h, rule.c, and default.c.
+ * default.c (install_default_pattern_rules): Renamed to
+ install_default_implicit_rules.
+ * make.h, main.c (main): Renamed uses.
+
+ * make.c: Renamed to misc.c.
+
+ * make.c (main, log_working_directory, decode_switches,
+ decode_env_switches, define_makeflags, die, print_version,
+ print_data_base): Moved to new file main.c.
+
+ * commands.c (execute_file_commands): Don't collapse backslash-newlines
+ here. When chopping the commands up into lines, don't chop at
+ backslash-newlines.
+ (start_job): Collapse backslash-newlines after printing the line.
+
+ * commands.c (start_job): Don't collapse backslash-newlines here.
+ (execute_file_commands): Collapse backslash-newlines before chopping
+ the commands up into lines.
+
+ * commands.c (set_file_variables): Initialize the length counters for
+ $^ and $? to zero!
+
+ * commands.c (start_job): Use vfork instead of fork. Someone else says
+ the child and parent DO have separate file descriptors.
+
+ * variable.c: Split internals into variable.c, function expansion into
+ function.c, and variable expansion into expand.c.
+ * function.c (handle_function): New function to check for a function
+ invocation and expand it.
+ * expand.c (variable_expand): Use handle_function.
+ * variable.c (push_new_variable_scope): New function to push a new
+ empty variable set onto the current setlist.
+ (pop_variable_scope): New function to pop the topmost set from the
+ current setlist and free its storage.
+ * function.c (expand_function: `foreach'): Push a new variable scope
+ for the iteration variable and pop the scope when finished.
+ * variable.h: Declare new functions.
+ * variable.c (initialize_variable_output): New function to return a
+ pointer to the beginning of the output buffer.
+ (save_variable_output): New function to save the variable output state.
+ (restore_variable_output): New function to restore it.
+ * expand.c (variable_expand): Use initialize_variable_output.
+ (allocated_variable_expand): Use {save,restore}_variable_output.
+ * variable.c (current_setlist): Renamed to current_variable_set_list
+ and made global.
+
+Sat Jun 10 00:11:25 1989 Roland McGrath (mcgrath at paris.Berkeley.EDU)
+
+ * remake.c (library_file_mtime): Check for libNAME.a in the current
+ directory before doing VPATH search.
+
+ * variable.c (print_variable_set): Don't write "# Variables", and write
+ fewer blank lines.
+ (print_variable_data_base): Precede the variables with "# Variables".
+
+ * make.c (main): Print the data base under -p after doing everything
+ else, just before exitting. This way it gets info determined in
+ updating the goal targets.
+
+ * variable.c (print_variable_data_base): Split into print_variable,
+ which prints one variable, and print_variable_set, which prints a set.
+ Replaced with a call to print_variable_set for the global set.
+ (print_file_variables): New function to print a given file's local
+ variables.
+
+ * file.c (print_file_data_base): Call print_file_variables to print
+ each file's local variables.
+
+ * commands.c (set_file_variables): Actually define the values for
+ the $^ and $? variables!!!
+
+ * make.texinfo (Implicit: Pattern Rules: Automatic): Document new D and
+ F versions of $^ and $?.
+
+ * commands.c (start_job): In the child fork, use getdtablesize and a
+ loop to close all file descriptors other than 0, 1, and 2. We need to
+ do this since not only the bad stdin pipe, but also some directories,
+ may be open.
+
+ * commands.c (start_job): Use fork instead of vfork, because a vfork
+ parent and child share file descriptors, and our child needs to diddle
+ with stdin.
+
+ * variable.c (initialize_file_variables): When created a new variable
+ set, zero out the hash table.
+
+ * variable.c (target_environment): Don't use variables whose names are
+ not made up of alphanumerics and underscores.
+
+ * remake.c (update_file_1): Set the `parent' member of each dependency
+ to FILE before updating it.
+
+ * file.h (struct file): Add `parent' member.
+
+ * variable.c (initialize_file_variables): Don't take second arg PARENT.
+ Use FILE->parent instead. If FILE->parent->variables is nil, recurse
+ to initialize it.
+
+ * variable.h: Declare {allocated_}variable_expand_for_file.
+
+ * variable.c (allocated_variable_expand): Now
+ allocated_variable_expand_for_file, calling variable_expand_for_file,
+ and taking second arg FILE.
+ (allocated_variable_expand): New function, a wrapper around
+ allocated_variable_expand_for_file, passing a nil second arg.
+
+Fri Jun 9 12:11:45 1989 Roland McGrath (mcgrath at paris.Berkeley.EDU)
+
+ * commands.c (start_job): On the child side of the fork, always close
+ the bad stdin file descriptor.
+
+ * commands.c (struct child): New member `environment', to hold the
+ environment for the child.
+ (execute_file_commands): Set the new childs `environment' member to nil
+ before calling start_job.
+ (start_job): Set up CHILD->environment before running the commands if
+ it is nil.
+
+ * make.c (main): Don't call new_environ. `shell' functions will now be
+ run with the environment make was called with.
+
+ * commands.c (child_handler): Don't check C->command_ptr before calling
+ start_job since we now have to check C->file->cmds->command_lines and
+ it's easier to let start_job handle all that.
+
+ * commands.c (struct child): New member `command_line', to hold an
+ index into file->cmds->command_lines.
+ (execute_file_commands): Set the new child's `command_line' to 0 and
+ its `commands' and `commands_ptr' to nil.
+ (start_job): When CHILD->command_ptr runs out, increment
+ CHILD->command_line and run the corresponding line from
+ CHILD->file->cmds->command_lines. Run it even under -t, -q, or -n if
+ the CHILD->file->cmds->lines_recurse element for that line is set.
+
+ * commands.c (execute_file_commands): Chop CMDS up into lines, setting
+ its `command_lines' and `lines_recurse' members, if it wasn't already
+ chopped.
+
+ * commands.h (struct commands): New members `command_lines' and
+ `lines_recurse'. The first is an array of chopped-up lines; the second
+ is an array of flags, each nonzero if the corresponding line is
+ recursive.
+
+ * variable.c (variable_expand_for_file): If FILE is nil, just do a
+ vanilla variable_expand.
+ (expand_function: `shell'): Pass second arg (as nil) to
+ construct_command_argv.
+
+ * commands.c (construct_command_argv): Use variable_expand_for_file on
+ `$(SHELL)' and `$(IFS)' instead of lookup_variable to check those
+ variables. This handles file-local and recursive values correctly.
+ To support this, take an additional argument FILE.
+
+ * variable.c (initialize_file_variables): New function to initialize
+ FILE's variable set list from PARENT's setlist. PARENT is the
+ immediate dependent that caused FILE to be remade, or nil if FILE is a
+ goal. (When user-level per-file variables are implemented, PARENT
+ should be passed as nil when defining per-file variables.)
+
+ * variable.c (variable_expand_for_file): New function to expand a line
+ using the variable set of a given file, and reporting error messages
+ for the file and line number of that file's commands.
+
+ * variable.h: Don't declare lookup_variable_for_file.
+
+ * variable.c (lookup_variable_*): Turned back into lookup_variable. It
+ now uses current_setlist.
+ (global_setlist): New static `struct variable_set_list', a setlist
+ containing global_variable_set.
+ (current_setlist): New static `struct variable_set_list *', a pointer
+ to the current variable set list.
+ (define_variable): Define in the current top-level set, not the global
+ set.
+
+ * commands.c (set_file_variables): New function to set up the automatic
+ variables for a file in its own variable set.
+ (execute_file_commands): Use set_file_variables.
+
+ * variable.c (new_environ): Replaced with target_environment, taking an
+ argument FILE, and returning an environment for FILE's commands.
+
+ * variable.c, variable.h: Remove all global special variable pointers.
+
+ * variable.c (define_variable_for_file): New function like
+ define_variable, but takes additional arg FILE, and defines the
+ variable in the variable set at the top of FILE's chain.
+ (lookup_variable_for_file): New function like lookup_variable, but
+ takes additional arg FILE, and looks the variable up in all of FILE's
+ variable sets.
+
+ * file.h (struct file): New member `variables', a `struct
+ variable_set_list' containing the list of variable sets used in the
+ expansion of the file's commands.
+
+ * variable.c (variables): Replaced with static `struct variable_set'
+ global_variable_set.
+ (define_variable): Now define_variable_in_set, taking additional
+ argument SET, the `struct variable_set' to define it in.
+ (define_variable): Use define_variable_in_set with global_variable_set.
+ (lookup_variable): Now lookup_variable_in_set, taking additional
+ argument SET, the `struct variable_set' to look it up in.
+ (lookup_variable): Use lookup_variable_in_set with global_variable_set.
+ (lookup_variable_in_setlist): New function to look up a variable in a
+ `struct variable_set_list' using lookup_variable_in_set.
+
+ * variable.h (struct variable_set): New structure, containing a hash
+ table and the number of hash buckets.
+ (struct variable_set_list): New structure, containing a link for a
+ linked-list, and a `struct variable_set'.
+
+ * commands.c (start_job): Under -n, return what the recursive start_job
+ call returns, since it might actually start a child.
+
+ * make.texinfo (Rules: Wildcards): Document ~ and ~USER expansion.
+
+ * commands.c (execute_file_commands): If start_job returns
+ failure, but -t is set, set FILE->update_status to success.
+ (start_job): If -t is set, and the commands are not recursive, return
+ failure (is is done for -q).
+
+ * remake.c (touch_file): New function to touch FILE.
+ (remake_file): Use touch_file. When touching a file, still do
+ execute_file_commands.
+
+ * remake.c (remake_file): Don't check question_flag (-q), since we
+ can't know here if the commands are recursive.
+
+ * commands.c (start_job): Don't use the `recursive' member of
+ CHILD->file->cmds. Instead, check for leading +s and $(MAKE) or
+ ${MAKE} in the command line here.
+
+ * commands.h (struct commands): Remove `recursive' member.
+
+ * rule.c (install_default_pattern_rules): Remove use of `recursive'
+ member.
+
+ * read.c (record_files): Don't check commands from $(MAKE) and set
+ their `recursive' member.
+
+ * commands.c (fatal_error_signal): Treat SIGQUIT like SIGINT, SIGHUP,
+ and SIGTERM, but don't send it to ourselves because it will cause a
+ core dump.
+
+Thu Jun 8 20:30:04 1989 Roland McGrath (mcgrath at paris.Berkeley.EDU)
+
+ * Version 3.50.
+
+ * variable.c (variable_expand): Use allocated_variable_expand instead
+ of expand_argument in a few places.
+
+ * variable.c (allocated_variable_expand): Do static variable shuffling
+ here instead of using expand_argument.
+ (expand_argument): Use allocated_variable_expand.
+
+ * variable.c (recursively_expand): New function to recursively expand
+ its argument (a `struct variable'), returning the malloc'd value.
+ (variable_expand): Use recursively_expand.
+
+Sun May 28 12:49:27 1989 Roland McGrath (mcgrath at tully.Berkeley.EDU)
+
+ * make.c (main): Fixed buggy fix in deciding to increase space for
+ command-line variable definitions. (First it never did it, then it
+ always did it; now it does it when necessary.)
+
+Sat May 27 14:01:54 1989 Roland McGrath (mcgrath at hecuba.Berkeley.EDU)
+
+ * make.c (main): Fixed bug in deciding to increase space for
+ command-line variable definitions.
+
+Fri May 26 15:48:01 1989 Roland McGrath (mcgrath at paris.Berkeley.EDU)
+
+ * read.c (multi_glob): Use allocated_expand_variable for checking
+ `HOME' variable for ~ expansion, since this may be called from inside a
+ `wildcard' function expansion.
+
+ * variable.h: Declare allocated_expand_variable.
+
+ * variable.c (allocated_expand_variable): New function to do variable
+ expansion in an allocated buffer, rather than the static one.
+
+ * make.c (main): Don't set glob_tilde (it no longer exists).
+
+ * variable.c (string_glob): Use multi_glob and parse_file_seq.
+
+ * read.c (multi_glob): Do ~ expansion here.
+
+ * glob.c (glob_tilde, glob_filename): Removed ~ expansion.
+
+ * variable.c (define_variable, lookup_variable): Use a smarter hashing
+ algorithm (the same one used for files and directories).
+ (VARIABLE_BUCKETS): Increased to 523.
+
+ * file.c (enter_file, lookup_file, rename_file): Use a smarter hashing
+ algorithm, spreading the bits about somewhat.
+
+ * make.c (log_working_directory): Under `-p', precede the directory
+ message with a `#'.
+
+ * make.c (print_version): Under `-p', precede each line with a `#'.
+ (print_data_base): Precede the header line with a `#' and include the
+ date and time on it.
+
+ * vpath.c (print_vpath_data_base): Precede non-directive
+ lines with `#'s.
+
+ * commands.c (print_commands): Precede the non-command line with a `#'.
+
+ * rule.c (print_rule_data_base), file.c (print_file_data_base): Precede
+ non-rule lines with `#'s.
+
+ * dir.c (print_dir_data_base): Precede all lines with `#'s.
+
+ * variable.c (print_variable_data_base): Changed format so that it can
+ be makefile input. Lines that are not variable definitions are
+ preceded with `#'. Nonrecursive variable definitions are made with all
+ dollar signs doubled to reproduce the initial value. Recursive
+ variable definitions containing newlines are done with `define'
+ directives. Nonrecursive variable definitions containing newlines, and
+ variable names containing :, =, or newlines, will come out garbled.
+
+Wed May 24 00:20:04 1989 Roland McGrath (mcgrath at paris.Berkeley.EDU)
+
+ * Version 3.49.
+
+Tue May 23 19:18:00 1989 Roland McGrath (mcgrath at paris.Berkeley.EDU)
+
+ * variable.c (expand_function: `filter'/`filter-out'): Use
+ find_percent instead of pattern_p.
+
+ * variable.c (expand_function: `patsubst'): Pass new args (both nil)
+ to patsubst_expand.
+ (variable_expand): For $(var:pat%=rep%) references, pass new args to
+ patsubst_expand so as to avoid find_percent and thus disallow
+ quoting the %s.
+
+ * read.c (record_files): Pass new args to patsubst_expand.
+
+ * variable.c (patsubst_expand): Take two new args: PATTERN_PERCENT
+ and REPLACE_PERCENT. Each of these, if non-nil, means that PATTERN
+ (or REPLACE) has already been run through find_percent, and
+ PATTERN_PERCENT (or REPLACE_PERCENT) is the result.
+
+ * make.h: Declare find_percent instead of pattern_p.
+
+ * read.c (pattern_p): Changed to find_percent, returning a pointer
+ to the %, or nil if there is none.
+ (record_files): Take another arg, PATTERN_PERCENT, a pointer to the
+ % in PATTERN.
+ (read_makefile): Pass PATTERN_PERCENT to record_files.
+
+ * make.texinfo (Rules: Static Pattern: Static Usage,
+ Rules: Directory Search: Selective Search,
+ Functions: Text Functions): Documented that `%' can be quoted.
+
+ * variable.c (expand_function: `filter'/`filter-out'): Use pattern_p
+ to allow quoted %s in patterns.
+
+ * variable.c (patsubst_expand): Use pattern_p on PATTERN and REPLACE
+ to allow quoted %s. Quoting backslashes are removed from REPLACE
+ even if PATTERN contains no unquoted %.
+
+ * read.c (pattern_p): Made global.
+ * make.h: Declare pattern_p.
+
+ * read.c (pattern_p): New function to search for an unquoted % in a
+ string. Backslashes quote %s and backslashes. Quoting backslashes
+ are removed from the string by compacting it into itself. Returns
+ nonzero if an unquoted % was found, zero if not.
+ (record_files): Use pattern_p to check for implicit rules.
+ (read_makefile): Use pattern_p to check for static pattern rules.
+ Also use it to allow quoted %s in `vpath' patterns; warn about
+ `vpath' patterns with no %s.
+
+Mon May 22 16:31:52 1989 Roland McGrath (mcgrath at tully.Berkeley.EDU)
+
+ * glob.c (glob_filename): Replace a `1' with the `l' that should
+ have been there. This incidentally stops it from dumping core.
+
+ * glob.c (glob_filename): If the path is just a directory, with no
+ file name pattern, return the directory alone.
+
+ * glob.c (glob_tilde): New global variable (int), defaults to zero.
+ (glob_filename): If glob_tilde is nonzero, expand ~ or ~USER.
+
+ * variable.c (string_glob): Keep a static allocated buffer for file
+ names taken from the list, instead of allocating and freeing one
+ every time.
+
+Fri May 19 18:06:26 1989 Roland McGrath (mcgrath at paris.Berkeley.EDU)
+
+ * make.c (decode_switches): Get floating numbers from the right string.
+
+Sun May 14 13:48:04 1989 Roland McGrath (mcgrath at homer.Berkeley.EDU)
+
+ * commands.c (delete_child_targets): When deleting `also_make'
+ files, include the target's name in the message:
+ make: *** [foo] Deleting file `bar'
+
+Sat May 13 17:34:26 1989 Roland McGrath (mcgrath at tully.Berkeley.EDU)
+
+ * make.c (max_load_average, default_load_average): Default to -1.
+
+ * load.c (wait_to_start_job): Return if max_load_average is < 0.0,
+ not equal.
+
+Fri May 12 16:08:05 1989 Roland McGrath (mcgrath at homer.Berkeley.EDU)
+
+ * variable.c (variable_buffer_output): Don't try to do pointer
+ arithmetic between objects not in the same array.
+
+Wed May 10 15:55:29 1989 Roland McGrath (mcgrath at paris.Berkeley.EDU)
+
+ * rule.c [M_XENIX] (default_suffix_rules, default_variables): Minor
+ changes to allow for strange compiler syntax.
+
+ * rule.c (default_variables): Don't include "> $@" in
+ $(PREPROCESS.S), since it's already in the .S.s rule.
+
+ * file.c (enter_file): Make a new double-colon file the `prev'
+ member of the bottom `prev' file (the one whose `prev' is nil).
+
+ * read.c (do_define): Append newlines after copying the lines into
+ the value buffer, so we end up with a trailing newline.
+
+ * make.c (print_version): If the global variable
+ `remote_description' is not nil or "", append "-%s" (its value) to
+ the version number.
+ * remote-*.c: Define remote_description appropriately.
+
+Sun May 7 15:15:53 1989 Roland McGrath (mcgrath at paris.Berkeley.EDU)
+
+ * commands.c (error_status): Converted to new function child_error,
+ taking new arguments TARGET_NAME and IGNORED, and writing an error
+ message: "*** [target] Error 1" (or signal #, etc.), appending
+ " (ignored)" if IGNORED is nonzero.
+ (child_handler): Use child_error instead of error_status.
+
+ * compatMakefile (all): Don't depend on `doc'.
+
+ * compatMakefile (clean): Don't remove make-info*.
+ (realclean): New rule, depends on `clean', removes tags, TAGS,
+ and all Info and TeX files.
+
+Thu May 4 17:00:46 1989 Roland McGrath (mcgrath at paris.Berkeley.EDU)
+
+ * variable.c (print_variable_data_base), file.c
+ (print_file_data_base), rule.c (print_rule_data_base),
+ Use floating-point for averages and percentages.
+
+ * make.c (print_data_base): Print messages before and after the data
+ base information.
+
+ * commands.c (print_commands): Changed output format to separate
+ lines in commands and prefix them with tabs.
+
+ * dir.c (print_dir_data_base): Changed output format slightly.
+
+ * vpath.c (struct vpath, construct_vpath_list,
+ selective_vpath_search): Remove the `exists' member and its uses.
+
+ * vpath.c (print_vpath_data_base): New function to print all
+ selective and general VPATH search paths (for -p).
+
+ * make.c (print_data_base): Call print_vpath_data_base.
+
+ * file.c (print_file_data_base): Changed format to look more like a
+ makefile rule. Now reports all information in the `struct file'.
+
+ * rule.c (print_rule_data_base): Changed format of display from:
+ %: (terminal)
+ depends on: RCS/%,v
+ to:
+ %: RCS/%,v
+ is terminal.
+ references nonexistent subdirectory.
+ Also include number and percent that refer to nonexistent
+ subdirectories.
+
+Thu Apr 27 15:45:40 1989 Roland McGrath (mcgrath at paris.Berkeley.EDU)
+
+ * make.c (main): Figure out the level of recursion before writing
+ the `Entering directory' message.
+ * variable.c (define_automatic_variables): Don't figure out the
+ level of recursion from `MAKELEVEL'. It's now done in main.
+
+ * Version 3.48.
+
+Wed Apr 26 16:39:17 1989 Roland McGrath (mcgrath at paris.Berkeley.EDU)
+
+ * commands.c (child_handler): Set `update_status' to zero when there
+ are no more commands.
+
+ * make.c (log_working_directory): If MAKELEVEL > 0, indicate the
+ recurson in the message (make[1]: ...).
+
+ * commands.c (child_handler): Change status to `cs_finished' when
+ commands fail.
+
+ * commands.c (start_job): Return 0 (success) if there were no more
+ commands for the child.
+ (child_handler): Change the status to `cs_finished' when start_job
+ fails to start the commands.
+
+ * make.c (main): Don't handle SIGEMT if it's not defined.
+ Do handle SIGDANGER if it is defined.
+
+ * commands.c (child_handler): Reorganized inner loop so that it
+ doesn't try to inspect the child before finding it.
+
+Tue Apr 25 16:28:24 1989 Roland McGrath (mcgrath at paris.Berkeley.EDU)
+
+ * make.c (end_of_token): Fixed bug wherein backslashes caused
+ immediate return.
+
+ * Version 3.47.
+
+ * make.texinfo (Implicit: Pattern Rules: Automatic): Document
+ setting of `$*' for explicit rules. Add note clarifying that
+ automatic variables, though referred to in the documentation as
+ `$<', etc. are no different than `$(<)', etc.
+
+Fri Apr 21 18:00:12 1989 Roland McGrath (mcgrath at paris.Berkeley.EDU)
+
+ * file.c (enter_file): Don't strip leading `./'s.
+
+ * read.c (parse_file_seq): Strip leading `./'s.
+
+Thu Apr 13 17:26:41 1989 Roland McGrath (mcgrath at paris.Berkeley.EDU)
+
+ * make.texinfo (Commands: Parallel, Running: Options): Document that
+ -l with no argument removes a previous load limit.
+
+ * make.c (struct command_switch): New member `default_value'.
+ (default_job_slots): Default value (of 1) for -j.
+ (default_load_average): Default value (of 0, unlimited) for -l.
+ (command_switches): Use default values for -j and -l.
+ Also, -l without an arg now means no load limit.
+ (define_makeflags): Don't write positive_int or floating options
+ whose values are their defaults.
+
+ * make.c (main): Under -w, write a `Leaving directory' message
+ before re-execing.
+
+Tue Apr 11 16:46:29 1989 Roland McGrath (mcgrath at paris.Berkeley.EDU)
+
+ * Version 3.46.
+
+ * Makefile: Provide an easy place for system-specific definitions
+ (-DUSG, etc.) and extra object files (for whatever).
+
+ * make.texinfo: Miscellaneous fixes from RMS.
+
+Mon Apr 10 19:31:34 1989 Roland McGrath (mcgrath at paris.Berkeley.EDU)
+
+ * rule.c (pattern_search): Put rules with `subdir' flags set in
+ TRYRULES, since these might be valid with VPATHs. In the TRYRULES
+ loop, don't do lookup_file or file_exists_p calls for dependencies
+ of rules with `subdir' flags set, but still do vpath_search calls
+ and intermediate-file searches.
+
+Thu Apr 6 16:33:00 1989 Roland McGrath (mcgrath at paris.Berkeley.EDU)
+
+ * make.texinfo (Implicit: Pattern Rules: Automatic): Document the
+ new definition of $* for explicit rules.
+
+ * commands.c (execute_file_commands): If FILE->stem is nil, figure
+ out if FILE->name ends in a suffix in the .SUFFIXES list; if so,
+ store the name sans suffix in FILE->stem (and $*).
+
+Wed Apr 5 15:24:48 1989 Roland McGrath (mcgrath at helen.Berkeley.EDU)
+
+ * file.c (remove_intermediates): Don't use `file_exists_p' to check
+ for the existence of intermediate files, because the hashed
+ directories will probably be out of date.
+
+ * commands.c (child_handler): Free the good stdin before running the
+ next command line.
+
+ * commands.c [USG] (init_siglist): Don't case SIGEMT if it's not
+ defined. Do case SIGDANGER (for IBM RT) if it is defined.
+
+ * commands.c: Changed `SYS_WAIT' to `HAVE_SYS_WAIT'.
+ (child_handler): Use `wait3' if HAVE_SYS_WAIT is #defined.
+
+ * file.c (enter_file): If any `./'s are stripped off, allocate a new
+ copy of the shortened name.
+
+ * rule.c (pattern_search): Allocate the right length strings for
+ `also_make' members.
+
+Sat Apr 1 13:28:38 1989 Roland McGrath (mcgrath at paris.Berkeley.EDU)
+
+ * Version 3.45.
+
+ * GNUmakefile: Make a separate tarfile of the DVI and info files.
+
+ * make.c (define_makeflags): If a switch that takes an argument has
+ its default value, put the switch in MAKEFLAGS with no arguments.
+
+ * make.c (command_switches): Pass `-l' in MAKEFLAGS.
+
+Wed Mar 29 17:50:05 1989 Roland McGrath (mcgrath at paris.Berkeley.EDU)
+
+ * GNUmakefile: Don't include the DVI and info files in the dist.
+
+ * commands.c (child_handler): Don't call
+ check_changed_{directories,vpaths}.
+
+ * make.h: Don't declare check_changed_{directories,vpaths}.
+
+ * vpath.c (check_changed_vpaths): Removed this function.
+
+ * dir.c (struct directory): Remove `modtime' member.
+ (find_directory): Don't set `modtime' member.
+ (check_changed_directories): Removed this function.
+
+ * remake.c (update_file_1): Set FILE->command_state to cs_finished
+ if it didn't need to be remade.
+
+ * remake.c (update_file): Only write the "up to date" message if the
+ target went from `not_started' state to `finished' state without
+ incrementing the count of files remade.
+
+ * commands.c [USG] (init_siglist): If both SIGCHLD and SIGCLD are
+ defined, don't put them both in the `switch'.
+
+Tue Mar 28 15:37:02 1989 Roland McGrath (mcgrath at paris.Berkeley.EDU)
+
+ * file.c (rename_file): Change FILE's name!!!
+
+ * rule.c (create_pattern_rule): Set the `terminal' member of the new
+ rule after calling new_pattern_rule, which zeros it.
+
+ * rule.c (default_variables): Use $(C++) in $(COMPILE.cc)!
+
+Sun Mar 26 15:52:30 1989 Roland McGrath (mcgrath at paris.Berkeley.EDU)
+
+ * Makefile: Added a `clean' target.
+
+Fri Mar 24 15:08:46 1989 Roland McGrath (mcgrath at helen.Berkeley.EDU)
+
+ * Version 3.44.
+
+ * file.c (rename_file): If a `struct file' for the renamed-to name
+ exists, and it is a target or has deps or commands, barf.
+ If not just remove the old one for put in the new one.
+
+ * remake.c (update_file_1, check_dep): Changed it back so that equal
+ modtimes to NOT make dependencies be considered newer. RCS checks
+ out files with equal modtimes as the RCS files, so this screws it.
+
+ * make.h, glob.c: If __GNUC__ is defined, use __builtin_alloca.
+
+ * Makefile: Use variables `ALLOCA' and `ALLOCASRC' so systems
+ without a good standard alloca can get it from the Emacs
+ distribution (or somewhere).
+
+ * dir.c: Don't include <sys/stat.h>, since make.h does.
+
+ * make.c: Removed debugging version of getwd.
+
+Thu Mar 23 16:16:27 1989 Roland McGrath (mcgrath at paris.Berkeley.EDU)
+
+ * Version 3.43.
+
+ * remake.c (update_file_1): If a dependency loop is found, don't
+ fatal. Emit an error message and remove the dependency.
+
+ * remake.c (library_file_mtime): Fixed to use the right names.
+ (update_file_1, check_dep): Consider a dependency "newer" than its
+ dependent if they have the same modification time.
+
+Wed Mar 22 19:31:35 1989 Roland McGrath (mcgrath at paris.Berkeley.EDU)
+
+ * file.c (remove_intermediates): Don't try to remove nonexistent files.
+
+Mon Mar 20 10:21:22 1989 Roland McGrath (mcgrath at paris.Berkeley.EDU)
+
+ * Version 3.42.
+
+ * rule.c (default_variables): Set F77 to $(FC) and F77FLAGS to
+ $(FFLAGS) so explicit rules expecting these (which are in System V)
+ will work. However, there is no way to make setting these affect
+ the implicit rules, unless we trash FC and FFLAGS (which BSD uses).
+ [USG]: Set GET to `get' rather than `/usr/sccs/get'.
+
+Sun Mar 19 20:00:27 1989 Roland McGrath (mcgrath at paris.Berkeley.EDU)
+
+ * vpath.c (construct_vpath_list): Don't replace VPATH[ELEM] with
+ dir_name (V), because the latter may get freed.
+
+Sat Mar 18 15:01:39 1989 Roland McGrath (mcgrath at paris.Berkeley.EDU)
+
+ * Version 3.41.
+
+ * make.texinfo: Cleaned-up edition 0.1 Beta from RMS and Bob Chassell.
+
+ * file.c (rename_file): If a file with the new name already existed,
+ use the same storage space, after freeing the old file's name, deps,
+ and `also_make' member, preserving the link in the chain.
+ Also write an error message telling the user to report the incident;
+ I don't think this should be able to happen, but I'm not sure.
+
+ * file.c (rename_file): Don't add the hash values of the old and new
+ names together! Reset HASHVAL before computing the second value.
+
+ * dir.c (check_changed_directories): Zero the new file hash table
+ after allocating it.
+
+ * dir.c (dir_file_exists_p): If FILENAME is "", return 1 if the
+ directory exists.
+
+ * vpath.c (check_changed_vpaths): New function to run through the
+ search paths of all VPATHs, making the `exists' members correspond
+ to reality.
+
+ * commands.c (child_handler): Call check_changed_vpaths.
+
+ * make.h: Declare check_changed_vpaths.
+
+ * vpath.c (struct vpath): New element `exists', an array of char
+ flags; exists[N] is nonzero if searchpath[N] exists.
+ (construct_vpath_list): Set the `exists' member.
+ (selective_vpath_search): Don't search directories whose `exists'
+ elements are zero.
+
+ * read.c (read_makefile): Set the `dontcare' flag of makefiles
+ from the MAKEFILES variable if they were not mentioned anywhere but
+ in the MAKEFILES variable.
+
+ * read.c (read_makefile): Don't write an error message if fopen
+ fails for a makefile from the MAKEFILES variable.
+
+ * dir.c (struct directory): Add `modtime' member to record the
+ modification time of the directory when it was opened.
+ (check_changed_directories): New function to check all known
+ directories; if their modtimes have changed since they were opened,
+ their file tables are cleared and they are reset to be read in.
+
+ * commands.c (child_handler): Call check_changed_directories before
+ returning.
+ make.h: Declare check_changed_directories.
+
+Tue Mar 14 20:07:13 1989 Roland McGrath (mcgrath at paris.Berkeley.EDU)
+
+ * Version 3.40.
+
+ * make.c (print_version): Made the copyright say 1988, 1989.
+
+ * read.c (read_all_makefiles): Don't set *MAKEFILES to the name of
+ the end of the read_makefiles chain, since the latter may be from an
+ included makefile. (Why did I do this before?)
+
+ * make.c (main): Set argv[0] to "" if it was nil. Don't put the
+ command-line variable definitions into argv[0], only into the MAKE
+ variable!
+
+Sun Mar 5 20:44:08 1989 Roland McGrath (mcgrath at paris.Berkeley.EDU)
+
+ * ar.c (ar_member_date, ar_touch): Remove the trailing ) from the
+ member name.
+
+Fri Mar 3 18:15:15 1989 Roland McGrath (mcgrath at paris.Berkeley.EDU)
+
+ * commands.c (construct_command_argv): Initialize NEW_ARGV to 0. At
+ `slow' label, if NEW_ARGV is not 0, free it; then allocate 4 strings.
+
+Tue Feb 28 14:29:39 1989 Roland McGrath (mcgrath at paris.Berkeley.EDU)
+
+ * Version 3.39.
+
+ * COPYING, make.texinfo: New GNU General Public License, version 1.
+
+ * *.c, *.h, Makefile: New copyright notices for the new GNU General
+ Public License, version 1.
+
+ * commands.c [USG]: Define WRETCODE correctly (again).
+
+ * variable.c (expand_function: `shell'): Don't capture the standard
+ error output of the shell command.
+
+ * ar.c (ar_touch, ar_member_date): Allocate MEMNAME with the right
+ length.
+
+ * load.c [not UMAX] (load_average): Don't clobber the first nlist
+ member when trying to set the second!
+
+Thu Feb 23 13:13:53 1989 Roland McGrath (mcgrath at tully.Berkeley.EDU)
+
+ * commands.c (child_handler): Really ignore errors under -i and for
+ - lines, don't just print a different message.
+
+ * make.c (decode_switches): Fixed handling of arguments (or lack
+ thereof) to switches.
+
+Wed Feb 22 16:25:39 1989 Roland McGrath (mcgrath at tully.Berkeley.EDU)
+
+ * commands.c (construct_command_argv): Don't clobber LINE when
+ checking the IFS variable.
+
+Sun Feb 19 11:17:07 1989 Roland McGrath (mcgrath at paris.Berkeley.EDU)
+
+ * load.c [UMAX, not NO_LDAV] (load_average): Return 0.0 rather than
+ randomness when calls fail.
+
+ * Version 3.38.
+
+ * commands.c (fatal_error_signal): If handling a user kill signal
+ (TERM, INT, HUP), wait for the children without printing the
+ "Waiting for children" message, since they will die quickly.
+
+ * Version 3.37.
+
+ * remote-stub.c (remote_status): Take another arg, BLOCK. If this
+ is nonzero block waiting for remote children. If not, return 0 if
+ we would have to block.
+
+ * commands.c (child_handler) [not USG]: If called as a signal
+ handler, use wait3 and don't block.
+ [USG]: If called as a signal handler, return after handling one child.
+
+Sat Feb 18 13:37:04 1989 Roland McGrath (mcgrath at paris.Berkeley.EDU)
+
+ * file.c (snap_deps): Process all double-colon entries of each file,
+ not just the first one.
+
+ * Version 3.36.
+
+ * remote-stub.c: remote.c renamed.
+ remote.c: Just include remote-stub.c
+
+ * commands.c (child_handler): If we were called as a signal handler,
+ return after handling one child.
+
+ * commands.c [not USG]: Include <signal.h> and define `sigmask' if
+ <signal.h> doesn't.
+ (block_children, unblock_children): Use sigmask rather than
+ bitshifting explicitly (and incorrectly).
+
+ * remote.c (remote_kill): New function to send a signal to a
+ remote child.
+
+ * commands.c (fatal_error_signal): If we get a SIGTERM, send one to
+ each living child. If we get a SIGTERM, SIGINT, or SIGHUP, delete
+ all pending targets before waiting for children.
+ (struct child): Add new member `deleted'.
+ (start_job): Initialize `deleted' member to 0.
+ (delete_child_targets): New function to delete a given child's
+ targets, unless the `deleted' flag in the `struct child' says they
+ have already been deleted. Sets this flag before returning.
+
+Thu Feb 16 18:32:07 1989 Roland McGrath (mcgrath at paris.Berkeley.EDU)
+
+ * commands.c [USG]: Define `WRETCODE' correctly (X & 0xff00).
+
+Tue Feb 14 16:05:00 1989 Roland McGrath (mcgrath at paris.Berkeley.EDU)
+
+ * commands.c (construct_command_argv): Don't make the 0th element of
+ the argument list be "sh" when executing /bin/sh, because start_job
+ uses the 0th element as the program name.
+
+Sun Feb 12 17:42:05 1989 Roland McGrath (mcgrath at paris.Berkeley.EDU)
+
+ * Version 3.35.
+
+ * read.c (readline): Put a null in the beginning of the buffer
+ before starting the reading loop.
+
+ * read.c (read_makefile): Made main reading loop while
+ !feof (infile), and removed EOF check after calling readline.
+
+Sun Feb 5 19:52:38 1989 Roland McGrath (mcgrath at paris.Berkeley.EDU)
+
+ * remote.c (block_remote_children, unblock_remote_children): New
+ (stub) functions to block and restore asynchronous notification of
+ remote child death.
+
+ * commands.c (block_children): Call block_remote_children.
+ (unblock_children): Call unblock_remote_children.
+ (child_handler): If called as a signal handler, block remote
+ children on entry and unblock them before returning.
+
+ * commands.c (child_handler): For unknown children, if they are
+ remote, give their remote ID; if local, give their PID and make's.
+
+ * commands.c (execute_file_command): Don't put a new child in the
+ chain unless start_job succeeds. Block children before calling
+ start_job, and unblock them after putting the child in the chain and
+ incrementing `job_slots_used' (if start_job succeeded).
+
+ * commands.c (block_children, unblock_children): Make these globally
+ visible (not `static').
+ commands.h: Declare block_children and unblock_children.
+
+ * variable.c (expand_function: `shell'): Use
+ `shell_function_completed'. Block children before forking and
+ unblock after `shell_function_pid' is set properly and
+ `shell_function_completed' is reset to 0.
+
+ * commands.c (child_handler): When the child of the `shell' function
+ completes, set `shell_function_completed' to 1 if it actually ran,
+ or -1 if it didn't (due to fork or exec failure).
+
+ * commands.c (block_children, unblock_children): New functions to
+ block and unblock the child termination signal.
+ (wait_for_children): Use block_children and unblock_children.
+ (execute_file_commands): Block children around the critical section
+ wherein a new child is put on the chain.
+
+ * make.c (main): Change the environment to contain the correct
+ MAKELEVEL before re-execing.
+
+Sat Feb 4 18:28:48 1989 Roland McGrath (mcgrath at paris.Berkeley.EDU)
+
+ * Version 3.34.
+
+Fri Feb 3 16:36:49 1989 Roland McGrath (mcgrath at helen.Berkeley.EDU)
+
+ * rule.c (default_variables): Fixed $(LINK.c).
+
+Wed Feb 1 18:05:07 1989 Roland McGrath (mcgrath at pepper.Berkeley.EDU)
+
+ * Version 3.33.
+
+ * version.c: Removed copyright notice, since this is a one-line file.
+
+ * commands.c (error_status): Made it return BUF, rather than running
+ off the end (this apparently worked on Sun 3s for some reason).
+
+ * ar.c, commands.c, dep.h, load.c, make.c, make.h, read.c, remake.c,
+ rule.c, variable.c, Makefile: Changed copyrght notices to cover 1989.
+
+Mon Jan 30 15:51:28 1989 Roland McGrath (mcgrath at homer.Berkeley.EDU)
+
+ * Version 3.32.
+
+Fri Jan 27 20:09:24 1989 Roland McGrath (mcgrath at tully.Berkeley.EDU)
+
+ * remake.c (remake_file): Don't touch phony targets.
+
+ * rule.c (convert_to_pattern): Fixed an incorrect length passed to
+ savestring.
+
+ * variable.c (expand_function: `shell'): Close the read side of the
+ pipe on the parent side of the fork.
+
+ * commands.c (start_job): On the child of the fork, close the
+ BAD_STDIN fd if we're not using it.
+
+ * read.c (record_files): A file beginning with a dot can be a
+ default target if it also contains a slash (as in `../foo').
+
+ * commands.c (wait_for_children): For BSD, block SIGCHLD rather than
+ ignoring it to avoid a race condition when child_handler is returning.
+
+ * commands.c (child_handler): Do blocking waits.
+ (error_status): Return a string describing exit status. (Split out
+ of child_handler).
+
+ * read.c (multi_glob): Change VECTOR to VEC for Alliant.
+
+Thu Jan 5 00:06:51 1989 Roland McGrath (mcgrath at homer.Berkeley.EDU)
+
+ * Version 3.31.
+
+ * make.texinfo (Features): Noted $(foo:PAT=SUB) from SunOS 4.0.
+
+ * make.texinfo (Options/Recursion): -d and -p go in the environment.
+
+ * load.c: Include "commands.h".
+
+Wed Jan 4 17:49:25 1989 Roland McGrath (mcgrath at homer.Berkeley.EDU)
+
+ * make.c (switches): -d and -p can come from the environment and are
+ put into it.
+
+ * read.c (record_files): Fixed the checking for duplicate deps so it
+ doesn't clobber the first one.
+
+ * make.texinfo: Documented default implicit rule changes.
+
+ * rule.c: Revamped default suffix rules. They now use Sun's style
+ of using variables `COMPILE.c', `LINK.c', etc. for each suffix, and
+ use `TARGET_ARCH' and `TARGET_MACH' variable where appropriate.
+ Also support Modula-2 compilation (suffixes .sym, .def, and .mod).
+ Ratfor Yacc support is gone, since nobody has yacc -r.
+ All EFL support is gone, since nobody uses EFL.
+
+ * ar.c, arscan.c: Don't assume `long int' and `int' are the same.
+
+ * commands.c [USG]: Fixed wait status bit encoding.
+ [USG and not USGr3] (dup2): Define this for SysVr2.
+
+ * make.h, dep.h, make.c [iAPX286]: Make allowances for this
+ brain-damaged compiler.
+
+ * make.texinfo (Variables: Flavors): Fixed a typo.
+
+Tue Jan 3 18:09:31 1989 Roland McGrath (mcgrath at homer.Berkeley.EDU)
+
+ * ar.c (ar_member_date, ar_touch): Truncate member names to 15 chars.
+
+ * Version 3.30.
+
+ * commands.c [SYS_WAIT]: If this is defined, use BSD <sys/wait.h>
+ and wait3 even if USG.
+
+ * read.c (record_files): Defining .DEFAULT with no deps or commands
+ clears its commands.
+
+ * rule.c (default_suffixes): Added `.sh'.
+ (default_suffix_rules): Added single-suffix .sh rule, copies source
+ to target and makes target executable.
+ make.texinfo (Catalogue of Rules): Documented .sh rule and its use
+ in conjunction with SCCS.
+
+ * rule.c (set_default_suffixes): Define variable `SUFFIXES' to the
+ default list ("" under -r).
+ make.texinfo (Suffix Rules): Document `SUFFIXES' variable.
+
+ * rule.c (default_variables), make.texinfo (Implicit Variables):
+ Variable AR defaults to `ar', ARFLAGS to `rv', and RM to `rm -f'.
+
+ * rule.c (install_default_pattern_rules): Default variables are made
+ recursive.
+ (default_variables): Added "CPP", defined to "$(CC) -E".
+ (default_suffixes): Added `.S', before `.s'.
+ (default_suffix_rules): New rule for .S to .s, runs CPP.
+ All rules that use CPP now include "$(CPPFLAGS)".
+ make.texinfo (Catalogue of Implicit Rules, Implicit Variables):
+ Documented above changes.
+
+ * commands.c [USG] (sys_siglist): Don't define.
+ [USG] (init_siglist): New function to initialize sys_siglist.
+
+ * make.texinfo (Variables: Reference): Documented `$(foo:PAT=SUB)'
+ references.
+
+ * variable.c (variable_expand): A reference `$(foo:PAT=SUB)' is
+ equivalent to `$(patsubst PAT,SUB,$(foo))'.
+
+ * variable.c (variable_expand): Free the storage for the expansion
+ of a recursive variable when it is nod longer needed.
+
+ * variable.c (variable_expand): When checking for `$($(foo))', use
+ lindex so as not to search for the second `$' outside the parens.
+
+ * make.c (struct stringlist, main, decode_switches): Changed `index'
+ member to `idx'.
+
+Sat Dec 24 16:02:32 1988 Roland McGrath (mcgrath at paris.Berkeley.EDU)
+
+ * commands.c (wait_for_children [USG]): Handle SIGCLD with SIG_DFL,
+ rather than SIG_IGN. Ignoring SIGCLD reportedly makes wait return -1.
+
+ * arscan.c [USGr3]: Define PORTAR to 1 (as with sun386).
+ (ar_scan [USGr3]): Remove trailing slashes from member names.
+
+Thu Dec 22 17:54:05 1988 Roland McGrath (mcgrath at homer.Berkeley.EDU)
+
+ * make.texinfo (Makefiles: Overriding Makefiles): New node
+ documenting use of .DEFAULT to have one makefile defer unmakeable
+ targets to another.
+
+ * make.texinfo (Implicit: Using Implicit, Implicit: Last Resort):
+ Mention empty commands and xref node `Empty Commands'.
+
+Wed Dec 21 20:12:40 1988 Roland McGrath (mcgrath at tully.Berkeley.EDU)
+
+ * Version 3.29.
+
+ * make.c (struct command_switch, command_switches, et al): New
+ member `noarg_value', if not nil, ptr to value to use if no arg is
+ given to a switch that would otherwise require one. The -j option
+ can now be given w/o an arg, to mean infinite jobs.
+ * commands.c: If job_slots is zero, infinite jobs.
+
+ * read.c (read_all_makefiles, read_makefile): Make makefiles precious.
+
+ * make.c (decode_switches): For a positive_int or floating option,
+ if we moved to the next argument word, but found no argument for the
+ option, move back to the correct word.
+
+ * make.c (decode_switches): If we got any unknown options, die after
+ processing all arguments.
+
+ * GNUmakefile: Moved `include depend' to the end, so the default
+ goal will be set before then.
+
+ * load.c (wait_to_start_job [Unix, UMAX]): Merged into one version
+ under #ifdef LDAV_BASED. Only loop while we have jobs running.
+ Sleep for increasing amounts (increase one second per iteration)
+ before checking the load average (after the first check).
+ Get the load average from function load_average.
+ (wait_to_start_job [not LDAV_BASED]): Always return.
+ (load_average [UMAX]): Fetch load average for Encore UMAX.
+ (load_average [not NO_LDAV]): Fetch load average from /dev/kmem.
+ [not NO_LDAV]: Define LDAV_BASED.
+
+Tue Dec 20 18:54:50 1988 Roland McGrath (mcgrath at tully.Berkeley.EDU)
+
+ * Version 3.28.
+
+ * commands.c (wait_for_children): Take second arg, ERROR. If
+ nonzero, and there are children, print a message on stderr.
+ (execute_file_commands, fatal_error_signal): Pass second arg.
+ * make.c (die), remake.c (update_goal_chain), variable.c
+ (expand_function: `shell'): Ditto.
+
+Sat Dec 17 01:05:38 1988 Roland McGrath (mcgrath at paris.Berkeley.EDU)
+
+ * commands.c (start_job): Call wait_to_start_job before forking.
+
+ * load.c (load_average): Converted to wait_to_start_job.
+
+ * remote.c: New file for remote execution functions.
+ (start_remote_job_p): Return nonzero if the next job should be run
+ remotely.
+ (start_remote_job): Start a remote job and return an ID for it.
+ (remote_status): Get status of dead remote children.
+
+Fri Dec 16 16:51:07 1988 Roland McGrath (mcgrath at hecuba.Berkeley.EDU)
+
+ * commands.c (start_job): If start_remote_job_p () returns nonzero,
+ call start_remote_job to start the job rather than fork and exec.
+ (child_handler):
+
+ * commands.c (execute_file_commands): Moved load average checking to
+ start_job.
+
+ * commands.c (child_handler: USG): Record the pid wait returns.
+
+ * load.c (UMAX): Added some #include's needed for UMAX.
+
+ * read.c (multi_glob), variable.c (string_glob): Ignore a (char **)
+ -1 return from glob_filename.
+
+ * variable.c (variable_expand): Make sure we don't increment past
+ the end of the string we were passed.
+
+ * variable.c (variable_expand): Terminate the expansion.
+
+ * file.c (rename_file): If there is already a file under the new
+ name, set its contents equal to FILE's (ick).
+
+ * variable.c (define_automatic_variables): Pass all the args to
+ define_variable when defining MAKELEVEL!
+
+ * commands.c (execute_file_commands): If max_load_average > 0, and
+ we have children running, don't start up another child until the
+ load average goes below max_load_average.
+
+ * make.c: New variable `max_load_average'.
+ (struct command_switch, decode_switches, decode_env_switches):
+ Handle floating-point (double) args.
+ (command_switches): Added `-l' switch to set `max_load_average'.
+
+ * load.c (load_average): New file and function to return a double
+ that is the current load average (1.00 scale).
+ * GNUmakefile, oldMakefile: Pass flags in $(LOAD_AVG) for load.c.
+
+Thu Dec 15 15:22:08 1988 Roland McGrath (mcgrath at homer.Berkeley.EDU)
+
+ * Makefile: Renamed to oldMakefile.
+ * GNUmakefile: Make Makefile from oldMakefile and depend.
+
+ * read.c (read_all_makefiles): When putting the default makefiles in
+ the read_makefiles chain so they will be remade, put them in the
+ right order.
+
+ * remake.c (update_goal_chain): If MAKEFILES is nonzero, always make
+ in serial, and return as soon as one goal whose `changed' member is
+ nonzero is successfully remade.
+
+ * commands.c: Don't include <sys/fcntl.h>.
+
+ * commands.c (construct_command_argv): Added ` to sh_chars.
+
+ * make.h: Don't declare construct_makeflags.
+
+ * make.c (main): Set up MAKEFLAGS and MFLAGS and make an environment
+ both before and after reading the makefiles, so the makefiles can
+ use them and possible change them, and later children will get the
+ right information.
+ (construct_makeflags): Replaced with define_makeflags (static void),
+ which defines the two variables.
+ * variable.c (define_automatic_variables): Don't define MAKEFLAGS
+ and MFLAGS.
+
+Mon Dec 12 14:40:31 1988 Roland McGrath (mcgrath at helen.Berkeley.EDU)
+
+ * Version 3.27.
+
+ * commands.c (child_handler): Reset the handler to ourselves when
+ called for USG, since it has no safe signals.
+
+ * commands.c: For USG, use an int rather than a `union wait' for
+ wait calls, and dissect it with bitmasks.
+ (child_handler): No wait3 system call in USG. Since we can't
+ protect from hanging, always return immediately if we have no
+ children we know about and we're not running a `shell' function.
+ (There is still the danger of hanging waiting for a child that died
+ without our being notified.)
+
+ * remake.c: Include <fcntl.h> instead of <sys/file.h>. What we need
+ is really in <fcntl.h>, and while BSD <sys/file.h> includes
+ <fcntl.h>, USG doesn't.
+
+ * make.c (main): Figure out the program name before doing anything
+ which might need it (in a call to error or fatal).
+
+ * dir.c, glob.c: Use `struct dirent' and <dirent.h> for USGr3.
+
+ * arscan.c (ar_scan): Added missing & before buf (which is an int)
+ if SARMAG is not defined (SysV).
+
+Fri Dec 9 18:44:13 1988 Roland McGrath (mcgrath at pepper.Berkeley.EDU)
+
+ * Version 3.26.
+
+ * dir.c (find_directory, dir_file_exists_p): Keep track of how many
+ directories we have open and don't let it be more than
+ MAX_OPEN_DIRECTORIES (currently 10).
+
+ * variable.c (expand_function: `foreach'): Use expand_argument
+ rather than variable_expand so each repetition doesn't clobber the
+ last!!!
+
+Mon Dec 5 15:58:46 1988 Roland McGrath (mcgrath at hecuba.Berkeley.EDU)
+
+ * Version 3.25.
+
+ * Makefile: Define `install' target.
+
+ * GNUmakefile: Don't include GNUmakefile or depend in the
+ distribution file.
+
+Wed Nov 30 15:53:42 1988 Roland McGrath (mcgrath at helen.Berkeley.EDU)
+
+ * commands.c (execute_file_commands): Don't clobber a null into
+ random storage if there were no $^ and/or $? words.
+
+ * remake.c (check_dep): Set *MUST_MAKE_PTR nonzero if a dependency
+ doesn't exist.
+
+ * ar.c (ar_member_date, ar_touch): Make sure the modtime of the
+ archive file itself is known before we fetch or change the modtime
+ of one of its members.
+
+ * read.c (read_makefile): Expand variable and function references
+ before parsing rules so variable can contain special characters
+ (colons and semicolons).
+
+Sat Nov 26 11:36:31 1988 Roland McGrath (mcgrath at homer.Berkeley.EDU)
+
+ * variable.c (expand_function: `filter', `filter-out'): Fixed so
+ that filter-out works right.
+
+ * variable.c (expand_function: `filter', `filter-out'): Made these
+ functions use each word of their first argument as a pattern.
+
+Fri Nov 25 10:51:47 1988 Roland McGrath (mcgrath at paris.Berkeley.EDU)
+
+ * Version 3.24.
+
+ * read.c (record_files): If a target is listed more than once in a
+ single rule (that defines commands), give a warning message rather
+ than the counter-intuitive message saying commands were already
+ defined (in the same place).
+
+ * make.c (fatal, error): Made them both take 6 args since there is
+ at least one error message that need that many. Too bad vfprintf is
+ not universal!
+
+ * Version 3.23.
+
+ * read.c (read_makefile): Moved the construction of the `struct
+ commands' into record_files. Call record_files before recursing for an
+ included makefile so the higher-up will determine the default goal.
+ (record_files): Take arguments COMMANDS, COMMANDS_IDX and
+ COMMANDS_STARTED and construct a `struct commands.
+
+Thu Nov 24 14:36:33 1988 Roland McGrath (mcgrath at paris.Berkeley.EDU)
+
+ * Version 3.22.
+
+ * make.c (main): Made it a fatal error if we can't move back to the
+ directory we started in before re-execing.
+
+ * make.c (main): Get the current directory before doing anything
+ else, so we know it even if we don't need it for the value of
+ `MAKE', since we might want it when re-execing.
+
+Wed Nov 23 13:34:44 1988 Roland McGrath (mcgrath at homer.Berkeley.EDU)
+
+ * Version 3.21.
+
+ * read.c (record_files): Eliminate duplicate deps in a chain.
+
+ * variable.c (expand_function: `sort'): Pass the right number to
+ qsort, not one less.
+
+ * remake.c (remake_file): Always call notice_finished_file if
+ FILE->command_state == cs_finished.
+
+ * commands.c (execute_file_commands): Call notice_finished_file to
+ set FILE's status correctly when start_job fails (because it's out
+ of commands or running under -n).
+
+Fri Nov 18 15:31:12 1988 Roland McGrath (mcgrath at saffron.Berkeley.EDU)
+
+ * Version 3.20.
+
+ * remake.c (update_file_1): Set the `update_status' of FILE to
+ nonzero and set FILE's `updated' bit if we have decided to give up
+ on remaking FILE because of errors in the dependencies.
+
+ * rule.c (pattern_search): Debugging messages use `dependency' (vs.
+ `dependent') properly.
+
+ * make.texinfo (Conditionals: Conditional Syntax): Function index
+ entries for `ifndef' and `ifneq'.
+
+ * variable.c (define_automatic_variables): Define `MAKELEVEL' to the
+ decimal number of the makelevel, since it may be malformed or blank.
+
+ * remake.c (remake_file): Call notice_finished_file after touching.
+
+Sat Nov 12 19:29:34 1988 Roland McGrath (mcgrath at tully.Berkeley.EDU)
+
+ * Version 3.19.
+
+ * GNUmakefile (dist): Pass the `-f' flag to compress.
+
+ * vpath.c (build_vpath_lists): Check for VPATHS being nil after
+ constructing the general VPATH list from the `VPATH' variable.
+
+Fri Nov 11 08:02:26 1988 Roland McGrath (mcgrath at tully.Berkeley.EDU)
+
+ * make.c (fatal, error): Made error messages for recursive runs be
+ shorter.
+
+Thu Nov 10 16:51:36 1988 Roland McGrath (mcgrath at basil.Berkeley.EDU)
+
+ * Version 3.18.
+
+ * read.c (read_makefile): Made it eat leading spaces and formfeeds
+ (but not tabs), like it's documented to.
+
+ * read.c (read_makefile): Let included makefiles determine the
+ default goal, as is done by System V Make.
+
+Tue Nov 1 19:03:08 1988 Roland McGrath (mcgrath at tully.Berkeley.EDU)
+
+ * variable.c (new_environ): Don't increment VCNT when a variable is
+ rejected.
+
+Fri Oct 28 16:54:15 1988 Roland McGrath (mcgrath at basil.Berkeley.EDU)
+
+ * Version 3.17.
+
+ * rule.c (convert_to_pattern): Don't use the same storage for a name
+ in two rules since new_pattern_rule may free this storage when a
+ rule is discarded.
+
+ * rule.c (new_pattern_rule): Undid useless change I made Oct 25.
+
+Thu Oct 27 19:17:53 1988 Roland McGrath (mcgrath at tully.Berkeley.EDU)
+
+ * Version 3.16.
+
+ * GNUmakefile, Makefile: Fixed a typo in a comment.
+ * Makefile: Removed malloc.o from object file list.
+
+ * variable.c: Removed old debugging #define's for xmalloc and
+ xrealloc so non-ANSI cpp's won't barf.
+
+ * make.c (main): Made local array for temp file name static so
+ compilers that don't do auto aggregate initialization won't barf.
+
+ * read.c: Removed static declaration of copy_dep_chain since it is
+ no longer static.
+
+Tue Oct 25 16:59:30 1988 Roland McGrath (mcgrath at pepper.Berkeley.EDU)
+
+ * rule.c (new_pattern_rule): If we threw out the new rule because it
+ matched an old one and OVERRIDE was zero, don't put the freed
+ pointer in the chain!
+
+Wed Oct 19 15:07:43 1988 Roland McGrath (mcgrath at pepper.Berkeley.EDU)
+
+ * Version 3.15.
+
+ * variable.c (expand_function: `sort'): Don't do the sorting and
+ writing out if there were no words in the first place.
+
+ * remake.c (remake_file): Only fail with a "no way to make" message
+ for a dependency (non-target) file. If we don't know how to remake
+ a target file, pretend it was successfully remade and is very new.
+
+ * remake.c (remake_file): Don't increment `files_remade' for a
+ non-target file we don't know how to remake.
+
+ * read.c (record_files): Don't die with "both : and :: entries" for
+ a file whose `is_target' flag is not set.
+
+Tue Oct 18 17:24:11 1988 Roland McGrath (mcgrath at paris.Berkeley.EDU)
+
+ * variable.c (expand_function: `patsubst', `subst'): Free the right
+ things!
+
+ * variable.c (expand_function: `subst'): Don't clobber the
+ pointer to the end of the second arg and then try to use it!!!
+
+Mon Oct 17 16:44:45 1988 Roland McGrath (mcgrath at catnip.Berkeley.EDU)
+
+ * variable.c (expand_function: `patsubst'): Don't clobber the
+ pointer to the end of the second arg and then try to use it!!!
+
+ * variable.c (expand_function: `word' function): Made it parse its
+ second argument correctly.
+
+ * ar.c (ar_touch): Return 1 rather than -1 for on errors.
+
+Sat Oct 15 15:12:16 1988 Roland McGrath (mcgrath at homer.Berkeley.EDU)
+
+ * Version 3.14.
+
+ * GNUmakefile: Removed explicit rule for make.dvi since the built-in
+ implicit rule now works.
+
+ * rule.c (default_suffix_rules): Fixed .texinfo.dvi rule yet again
+ so that it really works, now that parens are counted.
+
+ * remake.c (update_file_1): Set FILE's `updated' flag after calling
+ remake_file if it failed or finished immediately.
+
+ * remake.c (update_file): Use the `updated' flag rather than the
+ command state to decide if a file was fully considered, and
+ therefore might give an "up to date" message.
+
+ * variable.c (expand_function): Made all functions that take more
+ than one argument count parens of the appropriate flavor in their
+ args and ignore commands nested in parens.
+
+Fri Oct 14 18:35:00 1988 Roland McGrath (mcgrath at tully.Berkeley.EDU)
+
+ * read.c (read_all_makefiles): Pass second arg to read_makefile for
+ default makefiles.
+
+Thu Oct 13 16:40:08 1988 Roland McGrath (mcgrath at tully.Berkeley.EDU)
+
+ * Version 3.13.
+
+ * GNUmakefile: Added an explicit rule for make.dvi since the
+ built-in .texinfo.dvi implicit rule is screwed up.
+
+ * rule.c (default_suffix_rules): Added a comment that the
+ .texinfo.dvi rule does not work because of an ahem, feature of Make
+ that at some point will be fixed--er, enhanced to alleviate this
+ difficulty.
+
+ * rule.c (default_suffix_rules): Fixed Texinfo -> DVI rule (again).
+
+ * make.texinfo (Commands: Execution): Documented new competing for
+ standard input among children.
+
+ * commands.c (struct child): Added `good_stdin' flag to tell if this
+ child has the stdin that doesn't point into nirvana.
+ (good_stdin_used): New variable to tell if any child has the good
+ standard input.
+ (child_handler): Reset `good_stdin_used' if a dead child's
+ `good_stdin' flag is set.
+ (start_job): Give the new child the good standard input if
+ `good_stdin_used' is no set, and set the child's `good_stdin' flag
+ appropriately.
+
+ * rule.c (default_suffix_rules): Changed Texinfo -> DVI rule to work
+ better (I hope).
+
+ * read.c (read_all_makefiles): Stop reading default makefiles after
+ one is found.
+
+ * read.c (read_makefile): Reset `reading_filename' and
+ `reading_lineno_ptr' after recursing for an included makefile.
+
+ * GNUmakefile: New GNU Make-specific makefile that does everything
+ Makefile does plus distribution stuff, and doesn't contain any hacks
+ to try to work with Unix make.
+
+ * Makefile: Removed distribution stuff.
+
+ * make.c (main): Use mktemp to construct the names of temporary
+ files used for standard input makefiles.
+
+ * make.c (main): Don't turn standard input into a broken pipe.
+
+ * commands.c (start_job): Keep two extra file descriptors around: a
+ good standard input, and a bad one that reads from a broken pipe.
+ On the child side of the fork, if there are other children, give
+ this one the broken pipe so they won't compete; if this is the only
+ one, give it the good standard input.
+
+ * make.h: Declare notice_finished_file.
+
+ * commands.c (execute_file_commands): Use noticed_finished_file
+ after waiting for the child when there is only one job slot.
+
+ * remake.c (notice_finished_file): New function to re-check mtime's
+ and such things to be done when commands finish.
+ (update_file_1): Use notice_finished_file.
+
+ * commands.c (child_handler, execute_file_commands): Use new
+ variable `job_slots_used' to record the number of jobs currently
+ running, rather than diddling with `job_slots'.
+ (execute_file_commands): Increment `job_slots_used' before calling
+ start_job and decrement it on failure to avoid race condition.
+ If there is only one job slot, wait for the child to finish and
+ return its status so commands are run in linear order, as if there
+ were no parallelism.
+
+Wed Oct 12 15:59:03 1988 Roland McGrath (mcgrath at tully.Berkeley.EDU)
+
+ * remake.c (remake_file): Don't print a "No way to make" message for
+ targets whose `dontcare' flags are set.
+
+ * read.c (read_all_makefiles): Set the `dontcare' flag of the
+ `struct file' each default makefile added to the chain.
+
+ * file.h (struct file): Add `dontcare' member.
+
+ * read.c (read_all_makefiles): When no default makefiles are found,
+ put the names of all those tried in the `read_makefiles' chain so
+ they will be updated if possible, giving their `struct dep's'
+ `changed' members the value of 0 so we won't care if they cannot be
+ found or remade.
+
+ * make.texinfo (Makefiles: Remaking Makefiles): Documented that
+ default makefiles will be remade if not found.
+
+ * read.c (read_all_makefiles): If no default makefiles can be found,
+ go through the list of default names, trying to make one, stopping
+ if one is made.
+
+ * remake.c (remake_file): Set STATUS to 0 after successfully touching.
+
+ * dir.c (file_impossible, file_impossible_p): Don't clobber FILENAME
+ to "" and then try to to a strcmp on it!!!
+
+Mon Oct 10 16:09:18 1988 Roland McGrath (mcgrath at cinnamon.Berkeley.EDU)
+
+ * make.c (main): Don't do `dir_load (".")'.
+
+ * rule.c (count_implicit_rule_limits), vpath.c
+ (construct_vpath_list): Test the existence of a given directory by
+ `dir_file_exists_p (DIR, ".")' and assume that if this returns zero,
+ it means the directory really does not exist.
+
+ * dir.c (struct dirdata): Replaced with `struct directory' for
+ directories, each containing a chain of `struct dirfiles', one for
+ each file (real or impossible).
+ (dir_load): Removed.
+ (find_directory): New function to find the `struct directory' for a
+ named directory and return it (possibly creating a new one).
+ (dir_file_exists_p): Read the directory on the fly if its stream is
+ still valid (and ever was) if the file we're looking for is not
+ already in the hash tables.
+ (file_impossible, file_impossible_p, dir_name, print_dir_data_base):
+ Use the new directory/file scheme.
+
+ * make.texinfo: Miscellaneous editorial changes and clarifiactions.
+
+ * commands.c (struct child): Remove `environ' member.
+ (child_handler, start_job, execute_file_commands): Remove use of
+ `environ' member and new_environ.
+
+ * make.c (main): Call new_environ after reading makefiles.
+
+ * variable.h: Declare `new_environ' to return void.
+
+ * variable.c (new_environ): Put the environment in `environ' and
+ return void.
+
+Fri Oct 7 15:48:39 1988 Roland McGrath (mcgrath at pepper.Berkeley.EDU)
+
+ * Version 3.12.
+
+ * Makefile: Don't make the uncompressed tar file.
+
+ * variable.c (expand_function: `shell' function): Made it not expect
+ read to null-terminate the buffer.
+
+ * Makefile: Made it use a temporary symlink to . rather than a
+ temporary directory to make the distribution tar file.
+
+Thu Oct 6 17:52:35 1988 Roland McGrath (mcgrath at paris.Berkeley.EDU)
+
+ * Version 3.11.
+
+ * make.texinfo: Fixed a line that got garbaged somehow.
+
+Mon Oct 3 16:14:39 1988 Roland McGrath (mcgrath at paris.Berkeley.EDU)
+
+ * make.c (main): Try to move back to the directory we started in
+ before re-exec ourself.
+
+ * remake.c (update_file_1): A double-colon target with no deps
+ always needs to be remade.
+
+ * remake.c (remake_file): Changed "No way to make" message to say
+ `target' rather than `file'.
+
+Sun Oct 2 12:50:47 1988 Roland McGrath (mcgrath at catnip.Berkeley.EDU)
+
+ * remake.c (update_file_1): Set FILE->update_status to the return
+ value of remake_file.
+
+ * rule.c (convert_to_pattern): Fixed swapped lengths passed to
+ xmalloc for source/target suffixes.
+
+ * make.texinfo: Documented that MAKEFLAGS and MFLAGS are read in
+ from makefiles. Updated the `Features' section a bit.
+
+ * make.c (main): Read switches from MAKEFLAGS and MFLAGS variables
+ after reading in makefiles.
+
+ * make.c (main): Put a line "/tmp/foo:;" rather than ".PHONY:
+ /tmp/foo" in front of temp files made for stdin makefiles.
+
+ * remake.c (update_file): Test the state of the right `struct file'
+ for double-colon files.
+
+ * make.c (main): Put a ".PHONY: /tmp/foo" line in front of temp
+ files made for stdin makefiles so they won't be remade when we
+ re-exec. Kludge-o-matic!!
+
+ * remake.c (update_goal_chain): Judge files as being finished based
+ on their `updated' flag, not their state.
+
+ * read.c (read_makefile): Don't check for FILENAME being "-".
+ (read_all_makefiles): Set each element of MAKEFILES to the name put
+ in READ_MAKEFILES by read_makefile, since read_makefile may free the
+ storage for the name it is passed, and someone might want to look at
+ the elements of MAKEFILES again.
+
+ * make.c (main): For each `-f' flag with arg `-' (standard input),
+ read standard input into a temp file and pass the temp file's name
+ to read_all_makefiles, after making sure it will not be remade.
+
+ * make.c (construct_makeflags): Always put out `-j1'.
+
+Sat Oct 1 00:19:59 1988 Roland McGrath (mcgrath at tully.Berkeley.EDU)
+
+ * commands.c (execute_file_commands): If commands are nothing but
+ whitespace, set the state to `cs_finished' before returning 0.
+
+ * make.c (decode_switches): Allocate space for args in stringlists
+ so they can be freed later.
+
+ * make.h: Declare `makelevel'.
+
+ * variable.c (makelevel): Moved to make.c (and made global).
+
+ * make.c (fatal, error): Print the makelevel if it's > 0.
+ (perror_with_name): Use error rather than calling fprintf directly.
+ (pfatal_with_name): Use fatal rather than fprintf and die.
+
+ * variable.c (new_environ): Don't put default variables (origin
+ `o_default') into the environment; they just take up space.
+
+ * read.c (read_makefile): Don't add FILENAME to the chain of read
+ makefiles if it's "-" (standard input).
+
+ * remake.c (update_goal_chain): Set STATUS correctly when nothing
+ happens (as well as in all other situations).
+
+ * make.c (construct_makeflags): Put a `-' before each switch and
+ spaces between them.
+
+ * Version 3.10.
+
+ * commands.c (wait_for_children): Don't check if `children' is nil.
+ This is the case when waiting for the child of a `shell' function.
+
+ * dir.c (dir_load): Don't add a hash-table entry for directory
+ DIRNAME and filename "" if DIRNAME doesn't exist.
+
+ * commands.c (execute_file_commands): Return 0 after start_job
+ returns 1 (failure) under the -n flag.
+
+ * remake.c (remake_file): Set the state to `cs_finished' when not
+ calling execute_file_commands.
+
+ * remake.c (update_goal_chain): Second arg is now MAKEFILES, nonzero
+ meaning to disable -t, -q, and -n for each target unless the target
+ was also given on the command-line.
+
+ * read.c (read_makefile): Enter the `struct file's for the makefiles
+ added to the `read_makefiles' `struct dep' chain.
+
+ * remake.c (update_goal_chain): Made it not enter the files for the
+ goals in the chain. It will already have been done.
+
+ * rule.c (convert_to_pattern): Null-terminate the names of targets
+ and deps of the pattern rules properly.
+
+Fri Sep 30 18:56:20 1988 Roland McGrath (mcgrath at nutmeg.Berkeley.EDU)
+
+ * make.c (main): Call install_default_pattern_rules.
+
+ * make.h: Declare copy_dep_chain.
+
+ * read.c (copy_dep_chain): Moved to make.c (and made global).
+
+ * make.c (main): Call update_goal_chain to update goals.
+ Update read makefiles and re-exec self if they change.
+
+ * remake.c (update_file): Make this function static.
+ (update_goal_chain): New function to update a `struct dep' chain of
+ goals, waiting until they are all finished before returning.
+
+ * make.h: Don't declare update_file. Declare update_goal_chain.
+
+ * make.c (main): Call snap_deps, etc. that were in read_all_makefiles.
+
+ * read.c (find_makefile): Removed this function.
+ (read_all_makefiles): Don't update makefiles, don't diddle with
+ pattern rules, don't call snap_deps, etc. Return a `struct dep'
+ chain of all makefiles read.
+ (read_makefile): Now takes two args: FILENAME and TYPE, which is 0
+ for a normal makefile, 1 for MAKEFILES variable or 2 for an included
+ makefile. Add a `struct dep' containing the name of the makefile
+ (as it was found in the search path for type 2s), and TYPE in the
+ `changed' member to the global `read_makefiles' chain.
+
+ * make.h, rule.c (displace_pattern_rules,
+ add_displaced_pattern_rules): Removed these functions.
+
+ * read.c (read_makefile): Variable-expand the name of an `include'd
+ makefile before calling find_makefile on it.
+
+ * file.c (snap_deps): If the `struct file' for a `struct dep'
+ already exists, free the `struct dep's `name' member before setting
+ it to nil (since this info is in the `struct file').
+
+ * read.c (copy_dep_chain): Made it copy each name rather than
+ leaving multiple `struct dep's with the same pointers.
+
+Thu Sep 29 19:08:13 1988 Roland McGrath (mcgrath at catnip.Berkeley.EDU)
+
+ * make.c (decode_switches): Fixed second decode_env_switches call to
+ use correct length of "MFLAGS" (6, not 5).
+
+ * read.c (read_makefile): Don't stop reading when readline returns
+ zero lines read. Only stop when the stream reaches EOF. This makes
+ it recognize the last line of a makefile without a newline.
+
+ * remake.c (remake_file): If we don't know how to make FILE, set its
+ command state to `cs_finished'.
+
+ * remake.c (update_file): Don't write the "up to date" message if
+ update_file_1 returned a nonzero status.
+
+Wed Sep 28 16:30:07 1988 Roland McGrath (mcgrath at catnip.Berkeley.EDU)
+
+ * commands.c (child_handler): Set the `update_status' member
+ properly for ignored errors.
+
+ * rule.c (convert_to_pattern): Made it not care about if the target
+ suffix comes before the source suffix in the .SUFFIXES list.
+
+ * make.texinfo: Misc editorial changes.
+
+ * commands.c (wait_for_children): Return immediately if `children'
+ is nil (there are no children).
+
+Tue Sep 27 15:33:14 1988 Roland McGrath (mcgrath at pepper.Berkeley.EDU)
+
+ * Version 3.09.
+
+ * commands.c (struct child): New member `command_ptr' to hold the
+ current position in the commands. The `commands' member is never
+ changed.
+ (start_job, child_handler, execute_file_commands): Use new method
+ for `commands' and `command_ptr' members.
+
+ * make.c (decode_env_switches): Skip past an invalid letter (instead
+ of looping forever).
+
+ * commands.c (struct child): Add `environ' member to hold the
+ environment for this child.
+ (execute_file_commands): Get a new environment from new_environ and
+ put in the the new `struct child's `environ' member.
+ (child_handler): When freeing a child, free its `commands' member, the
+ elements of its `environ' array and its `environ' member itself.
+ (start_job): Set `environ' to the child's `environ' member before
+ exec'ing the command.
+
+ * variable.h, variable.c (new_environ): Made it return the new
+ environment, not putting it in `environ'.
+
+ * remake.c (update_file): Don't give a "is up to date" message
+ unless no files were remade and the state went from `cs_not_started'
+ to `cs_finished', so repeat calls to finish jobs won't get the message.
+
+Mon Sep 26 16:26:08 1988 Roland McGrath (mcgrath at helen.Berkeley.EDU)
+
+ * Version 3.08.
+
+ * make.texinfo (Commands: Execution): Documented that children will
+ be waited for rather than killed.
+
+ * commands.c (fatal_error_signal): Wait for children.
+ (kill_children): Removed this function.
+
+ * make.c (main, die): Wait for children to die, don't kill them.
+
+ * variable.c (expand_function): Use wait_for_children.
+
+ * make.c (main): Use wait_for_children rather than child_handler.
+
+ * commands.c (wait_for_children): New function to block waiting for
+ children, insuring that child_handler is not called recursively.
+ (execute_file_commands, kill_children): Use wait_for_children.
+
+ * commands.c (child_handler): Start up additional commands in a
+ sequence after an ignored error.
+
+ * remake.c (update_file): Don't print "`foo' is up to date" messages
+ when update_file_1 returns while commands are executing.
+
+ * remake.c (update_file_1): Pass the file name to name_mtime, not
+ the bloody `struct file', dammit!!
+
+ * commands.c (child_handler): Print out the "*** ..." error message
+ when not under -i. (I somehow forgot this.)
+
+ * remake.c (update_file_1): Use name_mtime rather than file_mtime to
+ re-get the mtime of a file whose commands have finished.
+
+ * make.c (command_switches, decode_switches, decode_env_switches):
+ Make all switches that take string args allow them right after the
+ switch letter.
+
+ * commands.c (child_handler): Check for a child being the `shell'
+ function's command returning and set the global variable for
+ expand_function to check.
+
+ * variable.c (expand_function): For the `shell' function, instead of
+ waiting for the child shell ourselves, let child_handler do it and
+ loop around waiting for something to happen.
+
+ * make.c (print_version): Made the copyright year static, not dynamic.
+
+ * make.h, make.c: Remove construct_argv function.
+
+ * make.c (main): Say "no goal target" instead of "no target".
+
+ * make.texinfo (Commands: Parallel): Don't send SIGKILL.
+
+ * commands.c (kill_children): Don't send SIGKILL to children that
+ aren't killed by the first signal.
+
+ * make.c (main), commands.c (kill_children): Decide between SIGCHLD
+ and SIGCLD based on whether or not SIGCHLD is defined, not on USG.
+
+ * Makefile: Link make with $(LOADLIBES).
+
+ * read.c (construct_include_path): Fixed another bad xrealloc call.
+
+ * make.c (decode_switches): Fixed an xrealloc call with no first arg.
+
+Sat Sep 24 01:16:21 1988 Roland McGrath (mcgrath at paris.Berkeley.EDU)
+
+ * Version 3.07.
+
+ * remake.c (update_file_1): If deps are running, set state to
+ `cs_deps_running' and return 0. If deps are done, run commands.
+
+ * commands.c (child_handler): Made it delete non-precious targets
+ killed by fatal signals.
+
+ * make.texinfo: Documented parallelism.
+
+Fri Sep 23 16:52:27 1988 Roland McGrath (mcgrath at helen.Berkeley.EDU)
+
+ * remake.c (update_file_1): Don't return if FILE's state is
+ `cs_deps_running'. In that case, we need to run through and check
+ the states of all our dependencies.
+
+ * commands.c (execute_file_commands): Decrement `job_slots' after
+ starting a new job to run file commands.
+
+ * commands.c (start_job): Made it set the state to `cs_running'.
+
+ * make.c (main): Fixed usage of `g', `lastgoal', and `goals' in the
+ goal-making loop.
+
+ * commands.c (child_handler): When commands finish, set the
+ corresponding file's `update_status' and `updated' flags as
+ appropriate, and reset the modtimes of the file and any `also_make'
+ files it has.
+
+ * remake.c (remake_file): Don't re-set `last_mtime' and set `updated'.
+
+ * commands.c (fatal_error_signal): Don't swallow all the children
+ with a loop around `wait ((union wait *) 0)'!!!
+
+ * make.c (struct command_switch): Added `positive_int' type.
+ (switches): Added -j (job_slots).
+ (construct_makeflags, decode_switches, decode_env_switches):
+ Handle`positive_int'-type switches.
+
+ * glob.c (glob_vector): Rename local variable `vector' to `VeCtOr'.
+ This is said to avoid a conflict with some system's global `vector'
+ variable.
+
+ * variable.c (expand_function): Made the `shell' function use
+ construct_command_argv and do its own child control and piping.
+
+ * make.c (main): Turn standard input into a broken pipe after
+ reading in all makefiles (the last time it will be needed).
+
+ * commands.c (struct child): Remove `pipe_fd' member. We don't use
+ pipes any more.
+ (start_job): Return 0 for success, 1 or failure (rather than void).
+ Don't use pipes. Don't turn the child's stdin into a broken pipe.
+ (child_handler): Print "*** Error" messages when necessary.
+ Die on failed commands when -k was not given.
+ (execute_file_commands): Check the return of start_job and remove
+ the child from the chain and return failure if it is nonzero.
+
+ * make.c (die): New function to clean up and exit.
+ (fatal, pfatal_with_name): Use die.
+
+Thu Sep 22 14:27:11 1988 Roland McGrath (mcgrath at helen.Berkeley.EDU)
+
+ * commands.c (struct child): Added `commands', `pipe_fd', and
+ `noerror' members to keep track of info about a command thread.
+ (start_job): New function to start a job and update the argument
+ `struct child' to reflect its status.
+ (execute_file_commands): Merged run_file_commands back in.
+ Made it use new start_job function.
+
+ * rule.c (freerule): Don't free the `struct commands' of the
+ discarded rule. It may be used in more than one place.
+
+ * commands.c (execute_command_line): Made it not try to delete the
+ possibly partly-made file. The child_handler function will do this.
+ (fatal_error_signal): Ditto + call kill_children.
+
+ * make.h: Declare job_slots.
+
+ * make.c (main): Collect goals in a dep chain and run through this
+ chain waiting for a child, eliminating finished goals, updating all
+ remaining goals, and quitting if they fail and not -k.
+
+ * commands.c (child_handler): If called with SIG < 0, - SIG is the
+ max number of children to bury.
+
+ * commands.c (child_handler): If called with SIG as zero,
+ block waiting for running children.
+ (kill_children): Call child_handler with zero rather than SIGCHLD.
+
+ * remake.c (update_file_1): Use the `command_state' member of FILE
+ and its dependencies to determine what commands are running, what to
+ do, etc. If commands or dep commands are running when we are
+ called, return success (0). If commands finished since the last
+ time we were called, return their status.
+
+ * commands.h: Declare kill_children.
+
+ * commands.c: Define `struct child' to keep track of child
+ processes, with the chain in `children'.
+ (child_handler): New function to catch child-termination signals
+ (SIGCHLD, or SIGCLD for USG), store the returned status in the
+ appropriate structure, take the now-obsolete `struct child' out of
+ the chain, and free its storage.
+ (execute_file_commands): Put all of the stuff invloving running the
+ commands into new function run_file_commands. Execute_file_commands
+ now does process management for the commands, while
+ run_file_commands (which is run in a subprocess) runs the commands.
+ (kill_children): New function to kill all running children by
+ sending them signal SIG. If there are any children still living
+ after they are all sent SIG, they are all sent SIGKILL.
+
+ * make.c (main): Catch SIGCHLD (SIGCLD for USG) with child_handler.
+
+ * commands.h: Declare child_handler function.
+
+ * commands.c (execute_file_commands): Check the `command_state'
+ member of FILE and return 0 if it is `cs_running' or
+ `cs_deps_running' and return the stored status if it is `cs_finished'.
+
+ * file.h (struct file): Added `command_state' member.
+
+ * commands.c (execute_command_line): Add `$' to the list of
+ characters special to the shell.
+
+Wed Sep 21 15:57:41 1988 Roland McGrath (mcgrath at helen.Berkeley.EDU)
+
+ * read.c (read_all_makefiles): Call convert_to_pattern before
+ recomputing the limits after adding the displaced rules.
+
+ * make.c (main): Move calls to snap_deps, convert_to_pattern, and
+ build_vpath_lists to read_all_makefiles.
+
+ * read.c (read_all_makefiles): Install the default pattern rules
+ before checking to remake the makefiles, displace these rules before
+ reading in the makefiles, and then add the displaced rules to the
+ chain after reading in all the makefiles.
+
+ * make.c (main): Don't call install_default_pattern_rules or
+ count_implicit_rule_limits.
+
+ * make.h: Declare displace_pattern_rules and
+ add_displaced_pattern_rules.
+
+ * rule.c (displace_pattern_rules, add_displaced_pattern_rules): New
+ functions to stow the chain and add the stowed chain on the end of
+ the current chain.
+
+ * make.texinfo (Implicit: Search Algorithm): Fixed PREV reference.
+
+ * make.c (main): Call construct_include_path right after decoding
+ the switches.
+
+ * read.c (find_makefile): Use rename_file.
+
+ * file.h: Declare rename_file.
+
+ * file.c (rename_file): New function to rename a `struct file' and
+ put it in the correct hash bucket.
+
+ * read.c (find_makefile): New function to find and update a makefile.
+ (read_all_makefilese): Use find_makefile.
+ (read_makefile): Don't do updating. Removed UPDATEIT arg.
+
+ * remake.c (update_file_1): Took out setting the `updated' member to
+ -1 rather than 1 sometimes.
+
+ * make.c (main): Made it print version info before doing anything else.
+
+ * remake.c (library_file_mtime, f_mtime): Removed use of last two
+ arguments to vpath_search.
+
+ * rule.c (pattern_search): Removed use of last two arguments
+ to vpath_search.
+
+ * vpath.c (vpath_search, selective_vpath_search): Removed unused
+ DIRPREFIX and DPLEN args.
+
+ * read.c (read_makefile): Also turn off -n when updating makefiles.
+
+Tue Sep 20 17:01:10 1988 Roland McGrath (mcgrath at pepper.Berkeley.EDU)
+
+ * Makefile: Put tags files in the tarfile.
+
+ * read.c (read_makefile): Get the modtime of the makefile via a stat
+ call so that a later file_mtime call won't do VPATH search for it.
+
+ * read.c (read_makefile): Don't turn off -t and -q if the makefile
+ was a command-line target.
+
+ * make.c (main): Enter command-line targets as files and set their
+ `cmd_target' members.
+
+ * file.h (struct file): Added `cmd_target' member.
+
+ * read.c (read_makefile): Temporarily turn off -t and -q while
+ updating makefiles.
+
+ * make.c (main): Don't use arg 0 from other_args (which is now
+ argv[0]; i.e., the program's name).
+
+ * read.c (read_makefile): Only return nonzero if commands were
+ actually run to remake the makefile.
+
+ * remake.c (update_file_1): Set FILE->updated to -1 if no commands
+ were actually run (because no update was done or -t was given).
+
+ * make.c (decode_switches): Fixed bug wherein xrealloc was passed
+ bad args if it tried to expand other_args->list.
+
+ * read.c (read_all_makefiles): Made it not look at the `MAKE'
+ variable, just use argv[0].
+
+Sun Sep 18 17:34:11 1988 Roland McGrath (mcgrath at paris.Berkeley.EDU)
+
+ * read.c (rerun_make): New function to re-exec make.
+
+ * make.c (construct_makeflags, construct_argv): New functions to
+ construct the `MAKEFLAGS' variable and to construct an arg list from
+ parsed info.
+
+ * read.c (read_makefile): New arg UPDATEIT, if nonzero, says to
+ update the makefile as a target before reading it in. When reading
+ included makefiles, pass this as zero. Now returns nonzero if the
+ makefile was updated, zero if not.
+ (read_all_makefiles): Pass a nonzero UPDATEIT arg to read_makefile
+ for all default and -f makefiles and all makefiles from the
+ `MAKEFILES' variable. If any of the makefiles has changed, re-exec
+ self to re-read them.
+
+ * remake.c (update_file): Print a "File `foo' up to date'" message
+ under -p.
+
+ * commands.c (execute_file_commands): Allocate one byte for each of
+ $^ and $< rather than zero if they are to be empty.
+
+Fri Sep 16 13:59:59 1988 Roland McGrath (mcgrath at tully.Berkeley.EDU)
+
+ * Version 3.06.
+
+ * make.c (command_switches): Fixed entry for `-o' switch.
+
+ * make.texinfo: Renamed -c switch to -C.
+
+ * make.c: Renamed -c switch to -C.
+
+ * Miscellaneous de-linting.
+
+ * read.c (record_files): Made it not free the storage for the name
+ if it started with `./' and was therefore not quite the same as in
+ the `struct file'.
+
+ * read.c (record_files): If commands were specified twice, the error
+ message specifies in what files and at what line numbers.
+
+ * make.c (main): If any of the signals we usually fatal on were
+ ignored by the parent (probably a shell), ignore them.
+
+ * make.c (main): Print version info for -v, -p, or -d.
+ (print_data_base): Don't print version info. It will be done in main.
+
+ * variable.c: Increased number of hash buckets to 257.
+
+ * file.c: Increased number of hash buckets to 1007.
+
+ * rule.c (count_implicit_rule_limits): Moved comptation of
+ `maxsuffix' to convert_to_pattern, since that function uses
+ `maxsuffix', and must be called before count_implicit_rule_limits.
+
+ * rule.c (pattern_search): If an existent (non-intermediate)
+ dependency was found via a terminal rule, set its
+ `tried_implicit' flag, so it will never have implicit rule search done.
+
+ * glob.c: Bug fix to avoid alloca(0).
+
+ * arscan.c: USG and Sun386i fixes.
+
+Thu Sep 15 19:40:26 1988 Roland McGrath (mcgrath at helen.Berkeley.EDU)
+
+ * make.texinfo: Fixed some typos and spelling errors.
+
+Wed Sep 7 14:20:39 1988 Roland McGrath (mcgrath at helen.Berkeley.EDU)
+
+ * make.c (decode_switches): Fixed bug wherein a bad option would
+ give a useless error message and loop forever.
+
+Tue Sep 6 14:36:02 1988 Roland McGrath (mcgrath at tully.Berkeley.EDU)
+
+ * make.texinfo: Documented `shell' function.
+
+ * variable.c (expand_function): New function `shell', does
+ backquote-style command expansion of its arg.
+
+ * commands.c (execute_command_line): Second arg OUTBUF, if not nil,
+ gets filled in with a malloc'd buffer containing the piped stdout of
+ the command.
+ (execute_file_commands): Use above (pass nil).
+
+Mon Sep 5 17:03:49 1988 Roland McGrath (mcgrath at hecuba.Berkeley.EDU)
+
+ * Makefile: Added copyright notice.
+ Added a comment about defining `NO_MINUS_C_MINUS_O' if necessary.
+
+ * Version 3.05.
+
+ * rule.c (default_suffix_rules): Don't pass `-o' switches with `-c'
+ switches if `NO_MINUS_C_MINUS_O' is #define'd.
+
+ * make.texinfo: Documented `GNUmakefile'.
+
+ * read.c (read_all_makefiles): Made it try default makefile
+ `GNUmakefile' before others.
+
+ * make.texinfo: Added new-style Texinfo header thingies.
+
+Sat Sep 3 18:09:39 1988 Roland McGrath (mcgrath at homer.Berkeley.EDU)
+
+ * Version 3.04.
+
+ * make.texinfo (Chained Rules): Added a @cindex about using
+ .PRECIOUS to preserve intermediate files.
+
+ * remake.c (update_file_1): Made it not just return before executing
+ commands under -p.
+
+ * rule.c (default_pattern_rules, default_variables): Made it use
+ `$(AR)' for `ar r' (to put files in archives).
+
+ * vpath.c (build_vpath_lists): Made it recursively expand the
+ `VPATH' variable (by using variable_expand instead of lookup_variable).
+
+ * read.c (conditional_line): Made it not swallow whitespace after
+ the comma in an `ifeq' using the `(a,b)' syntax.
+
+ * rule.c (count_implicit_rule_limits): Made it not crash if a
+ pattern rule dep begins with `/'.
+
+Sun Aug 28 15:51:12 1988 Roland McGrath (mcgrath at homer.Berkeley.EDU)
+
+ * make.texinfo: Clarified that the arg to the `origin' function is a
+ variable *name*, not a reference.
+
+ * make.texinfo: Clarified that both -Idir and -I dir are allowed.
+
+Sat Aug 27 13:49:28 1988 Roland McGrath (mcgrath at tully.Berkeley.EDU)
+
+ * remake.c (remake_file): Made touching phonies work right.
+
+Wed Aug 24 20:40:48 1988 Roland McGrath (mcgrath at nutmeg.Berkeley.EDU)
+
+ * make.texinfo: Removed reference to `RANLIB' variable.
+
+ * Version 3.03.
+
+ * variables.c (expand_function): Added `origin' function.
+ * make.texinfo: Documented same.
+
+ * read.c (record_files): Made double-colon entries work.
+
+Sat Aug 20 21:09:39 1988 Roland McGrath (mcgrath at tully.Berkeley.EDU)
+
+ * make.c (collapse_continuations): Bug fix from RMS.
+
+ * rule.c (install_default_pattern_rules): Made it set the
+ `in_use' flag of the created rules to zero, rather than letting
+ it be random garbage.
+
+ * rule.c (pattern_search): Fixed putting `also make' targets into
+ file strucutres.
+
+ * read.c (record_files): Fixed bug which made double-colon entries
+ make it read off into space.
+
+ * make.c (decode_switches): Made it understand `ignored' switches
+ rather than dumping core.
+
+Sun Aug 14 16:49:00 1988 Roland McGrath (mcgrath at tully.Berkeley.EDU)
+
+ * read.c (read_makefile): Made `include' filenames be
+ variable-expanded.
+
+ * read.c (read_makefile): Fixed an error message.
+
+ * read.c (read_makefile): Made it accept ^L's as whitespace.
+ * make.c (next_token, end_of_token): Ditto.
+
+ * vpath.c (vpath_search): Fixed it so that the general VPATH (from
+ the variable) is always checked, even if a selective VPATH (from a
+ directive) matched the filename.
+
+Sat Aug 13 14:20:46 1988 Roland McGrath (mcgrath at tully.Berkeley.EDU)
+
+ * make.c (decode_switches, main): Made the command switches be
+ processed from a table of switches, variables, and types. No
+ functions are passed argc and argv any more. They are passed arrays
+ of strings they need to process.
+ * read.c (read_all_makefiles): Made it take an array rather than
+ argc and argv.
+ (construct_include_path): Ditto.
+
+ * make.c (collapse_continuations): Made it work right (I hope).
+
+ * make.texinfo: Minor editorial changes.
+
+ * read.c (read_makefile): Minor speed improvement by freeing and
+ then mallocing something rather than reallocing it to avoid the
+ unnecessary bcopy.
+
+Thu Aug 11 00:10:43 1988 Roland McGrath (mcgrath at tully.Berkeley.EDU)
+
+ * make.texinfo: Fixed some unquoted @'s.
+
+ * make.texinfo: Documented multiple-target pattern rules.
+ Miscellaneous minor editorial changes and corrections.
+
+ * make.texinfo (Implicit: Catalogue of Rules): Removed the list of
+ variables. That's what the next section is for.
+ (Implicit: Implicit Variables): Made it agree with reality.
+
+Wed Aug 10 00:55:39 1988 Roland McGrath (mcgrath at tully.Berkeley.EDU)
+
+ * variable.c (print_variable_data_base): Fixed bug which made -p
+ dump core. (This was a really idiotic bug.)
+
+ * rule.c (pattern_search): Fixed a bug which made it make the
+ `also_make' member of the file in question nil if the first of
+ the successful rule's targets was the matching one.
+ Made it use only as much storage as necessary in the `also_make'
+ member.
+ (create_pattern): Made it use only as much storage as necessary in
+ the `lens' and `suffixes' members of the created rule.
+
+ * remake.c (library_file_mtime): Made it `static'.
+
+ * file.c: Added a declaration for `errno', which is declared in some
+ <errno.h>'s, but not all.
+
+ * file.h (struct file): Added `also_make' member for multiple-target
+ implicit rules.
+ * rule.c (pattern_search): Made it put the names of files updated by
+ the given file's commands in its `also_make' member.
+ * remake.c (update_file_1): Made it mark the files in a file's
+ `also_make' member as updated when the file is updated.
+
+ * variable.c (try_variable_definition): Fixed a bug which made it
+ define a variable with the name of the whole definition when there
+ was no space before the = or :=.
+
+ * make.texinfo (Features): Made the changes which were made in RCS
+ revision 2.7 but somehow lost since then. Added -W.
+
+Tue Aug 9 10:04:50 1988 Roland McGrath (mcgrath at tully.Berkeley.EDU)
+
+ * variable.h: Added `o_default' to `enum variable_origin'.
+ * variable.c (print_variable_data_base): Made it print the origins of
+ the variables.
+ * rule.c (install_default_pattern_rules): Made it define the default
+ variables with origin `o_default'.
+
+ * make.texinfo: Documented -W.
+
+ * make.c (decode_switches, main): Added the -W flag to give files a
+ time-stamp of now, for a `what if' effect when used with -n.
+
+ * commands.c (print_commands): Made it say `(built-in)' for commands
+ that are built into the default ruleset.
+
+ * read.c (record_file): Made .SUFFIXES get its deps frontwards (again).
+ * rule.c (set_default_suffixes, convert_to_pattern): Made it read
+ .SUFFIXES's deps frontwards, so the converted rules will not be in
+ reverse order.
+
+ * rule.c (new_pattern_rule): Fixed a bug wherein it would keep
+ searching after it had removed a matching rule and ended up diddling
+ with freed storage.
+
+ * rule.c (freerule): Made it take the given rule off the chain.
+ (new_pattern_rule, count_implicit_rule_limits): Use freerule to
+ remove rules from the chain.
+
+ * vpath.c (construct_vpath_list): Made it return after cleaning out
+ all previous searchpaths when given a nil DIRPATH arg, so it won't
+ go into the construction code and dump core dereferencing a nil
+ pointer.
+
+ * variable.c (patsubst_expand): Fixed a bug which made it not match
+ correctly and sometimes dump core.
+
+Mon Aug 8 16:35:48 1988 Roland McGrath (mcgrath at tully.Berkeley.EDU)
+
+ * rule.c (default_suffix_rules): Made the .texinfo.dvi rule remove
+ the files used in the comparison to determine whether or not a
+ second TeX run is necessary.
+
+ * make.texinfo: Fixed some overfull TeX hboxes.
+
+ * make.texinfo (Implicit: Catalogue of Rules): Fixed a Texinfo error.
+
+ * rule.c (create_pattern_rule): Fixed bug wherein index was not
+ being passed its second arg.
+
+ * read.c (getline): Merged back into readline.
+
+ * rule.c (default_suffixes, default_suffix_rules,
+ default_variables): Added .texinfo.info rule.
+ * make.texinfo (Implicit: Catalogue of Rules): Documented
+ .texinfo.dvi and .texinfo.info rules.
+
+ * make.texinfo (Top): Changed `last updated' date to be correct (for
+ the last time it was updated, not today). Changed `for version
+ 3.00' since it's not going to be called that.
+
+Sat Aug 6 19:51:10 1988 Roland McGrath (mcgrath at tully.Berkeley.EDU)
+
+ * commands.c (print_commands): Added this function to print the
+ contents of a `struct commands' for -p.
+ * rule.c (print_rule_data_base): Use above.
+ * file.c (print_file_data_base): Ditto.
+
+ * rule.c (count_implicit_rule_limits, new_pattern_rule,
+ install_pattern_rule, print_rule_data_base): Made it understand the
+ changed `struct rule' and act accordingly.
+ (freerule): Added this function to free all the storage used by a rule.
+
+ * rule.c (pattern_search): Made it grok multiple targets of pattern
+ rules. The matching is done properly, but at present, only the
+ matching pattern's target is used to give deps and commands.
+
+Fri Aug 5 18:00:29 1988 Roland McGrath (mcgrath at tully.Berkeley.EDU)
+
+ * rule.c (struct rule): Changed name, namelen, and patsuffix members
+ to targets, lens, and suffixes, which are arrays, for multiple targets.
+ (create_pattern_rule): Now takes first arg TARGETS, a nil-terminated
+ array of targets, rather than a single target and patsuffix pointer.
+
+ * read.c (record_files): If it finds an implicit pattern rule, it
+ collects all the targets into an array and passes the whole thing to
+ create_pattern_rule. If there are non-pattern targets, it is a
+ fatal error.
+
+Tue Aug 2 15:06:38 1988 Roland McGrath (mcgrath at tully.Berkeley.EDU)
+
+ * make.c (readline): Split backslash-newline checking from reading
+ and buffer-expanding.
+ (getline): Created to do the reading and buffer-expanding formerly
+ done in readline.
+
+ * rule.c (pattern_search): Made it reject nonterminal match-anything
+ rules when a specific rule has matched, rather than rejecting
+ terminal match-anything rules in this case.
+
+ * rule.c (convert_to_pattern): Fixed a bug caused when the change to
+ make it only recognize two-suffix rules whose target suffixes
+ precede their dependency suffixes which made it work in the opposite
+ direction (even worse than it started out).
+
+ * rule.c (pattern_search): Made it reject nonterminal match-anything
+ rules as intermediate targets when searching for both real and
+ intermediate dependencies, rather than only when searching for
+ intermediate ones.
+
+Sun Jul 31 00:33:56 1988 Roland McGrath (mcgrath at tully.Berkeley.EDU)
+
+ * rule.c (convert_to_pattern): Made it only recognize two-suffix
+ rules whose target suffix comes before the dependency suffix in the
+ .SUFFIXES list.
+
+ * variable.c (define_automatic_variables): Made all automatic
+ variables be defined with origin `o_automatic'.
+
+ * variable.h: Added `o_automatic' to `enum variable_origin'
+
+ * file.c (remove_intermediates): Made it not print an error message
+ if the error was that the file does not exist.
+
+ * rule.c: Removed `recursive' member from `struct rule'.
+
+ * remake.c (library_file_mtime): Made it not use the directory hash
+ functions, as reading in and hashing /usr/lib and /lib is slow and
+ most likely unnecessary.
+
+ * remake.c (remake_file): Changed message from ``No specification
+ for making'' to ``No way to make'' so it will be short enough that
+ most filenames will fit on a line.
+ Made it look at the `recursive' member of the `struct commands',
+ rather than of the `struct file' (which no longer has one).
+
+ * commands.c (execute_file_commands): Made it look at the
+ `recursive' member of the `struct commands', rather than of the
+ `struct file' (which no longer has one).
+
+ * file.h: Removed `recursive' member from `struct file'.
+
+ * commands.h: Added `recursive' member to `struct commands'.
+
+ * dep.h: Removed unused `quotedparen' member from `struct nameseq'
+ and `struct dep'.
+
+ * read.c (dequote): Removed this function.
+ (multi_glob): Removed reference to `quotedparen' member of
+ a `struct nameseq' and calls to dequote.
+
+ * read.c (record_files): Made it set the stem for $* for all static
+ pattern rules, not just those with commands given at that time.
+ Removed check for recursive commands.
+ Made it check for pairs of .SUFFIXES dependencies to reject as
+ default goals as well as single ones (that don't start with dots).
+ (read_makefile): Added checks for recursive commands to set
+ the `recursive' flag in the `struct commands'.
+
+Sat Jul 30 15:47:23 1988 Roland McGrath (mcgrath at tully.Berkeley.EDU)
+
+ * make.c (find_next_token): Made the LENGTHPTR arg optionally nil.
+
+ * make.c: Removed `files_made' variable which is defined static in
+ remake.c and used only there.
+ (main): Cleaned up somewhat.
+ (decode_switches): Cleaned up a bit. Made an unknown option be a
+ non-fatal error.
+ (decode_env_switches): Made LEN arg unsigned. Cleaned up.
+ (print_version): Made it say ``see the source'' rather than ``see
+ the source file'', since there is more than one.
+
+ * file.h: Made `num_intermediates' declared unsigned.
+
+ * file.c: Made `num_intermediates' variable unsigned.
+ (remove_intermediates): Removed unused FORMAT arg.
+ (enter_file): Made it handle double-colon files properly, adding the
+ new entry as the old entry's prev pointer.
+
+ * dir.c: Re-indented the `struct dir' definition to be right.
+ (dir_load): Cleaned up slightly.
+ (file_exists_p): Removed comment saying we could use `access', since
+ that is a bad idea (except for setuid programs). Cleaned up slightly.
+
+ * commands.c: Changed some comments slightly.
+ (execute_file_commands): Cleaned up a bit. Changed some comments,
+ added others. Moved freeing of storage for $^ and $? to the same
+ place as for the other automatic variables.
+ (execute_command_line): Made `#' trigger a shell.
+ Added some comments. Cleaned up a bit. Put all the special chars
+ that trigger shells into an array easily changeable at the top.
+
+ * ar.c: Added comments explaining each function.
+ (ar_scan_1): Merged into ar_member_date.
+ (ar_member_date): Changed call to ar_scan_1 to the body of that
+ function.
+ (ar_member_date_1): Simplified to a ?: expression rather than an
+ if-else statement.
+ (ar_member_touch): Changed error handling around a bit.
+ None of these errors are fatal now.
+
+ * variable.c (subst_expand): Added a new arg BY_WORD, to do substs
+ only on full words.
+ (patsubst_expand): Fixed bug which made calls whose patterns
+ contained no `%' to not work correctly, by using above.
+ (variable_expand): Pass extra arg to `subst_expand'.
+
+ * variable.c (expand_function): Fixed bug which made `foreach' calls
+ with one-word lists run off into never-never land.
+
+Fri Jul 29 20:12:36 1988 Roland McGrath (mcgrath at tully.Berkeley.EDU)
+
+ * variable.c (expand_function): Made a very minor speed improvement
+ by avoiding an unnecessary strlen call.
+
+Wed Jul 27 16:01:47 1988 Roland McGrath (mcgrath at tully.Berkeley.EDU)
+
+ * rule.c (default_suffixes): Rearranged the list somewhat; added
+ `.el' and `.elc' to speed things up (especially when building
+ Emacs), for the same reason `.h' is there.
+
+ * read.c (record_files): Changed `lineno' from `long' to
+ `unsigned int'.
+
+Sun Jul 24 02:15:30 1988 Roland McGrath (mcgrath at tully.Berkeley.EDU)
+
+ * variable.c (expand_function): Eliminated use of `wstok'
+ because it is non-reentrant and unreliable.
+ Fixed a minor bug which would cause something not to be freed.
+ * make.c (wstok): Removed `wstok' because it is no longer used.
+
+ * variable.c (expand_function): Made `foreach' function put
+ spaces between output texts like it's supposed to.
+
+Sat Jul 23 17:32:55 1988 Roland McGrath (mcgrath at tully.Berkeley.EDU)
+
+ * rule.c (default_suffixes, default_suffix_rules): Added rule
+ to make %.dvi from %.texinfo.
+
+ * dir.c (print_dir_data_base): Made it say a bit more.
+
+Fri Jul 22 23:13:16 1988 Roland McGrath (mcgrath at tully.Berkeley.EDU)
+
+ * make.c (print_data_base): Split this function up into one
+ for each thing.
+ * variable.c (print_variable_data_base): One of the above.
+ * rule.c (print_rule_data_base): Ditto.
+ * file.c (print_file_data_base): Ditto.
+ * dir.c (print_dir_data_base): Ditto.
+
+ * rule.c (install_pattern_rule): Fixed a bug which caused the
+ terminal and recursive flags to always be zero for rules
+ entered by this function.
+
+ * make.texinfo (Rules: Double-colon): Added a paragraph
+ explaining the purpose of double-colon rules.
+
+ * make.texinfo (Implicit: Catalogue of Rules): Updated to
+ reflect new C++, TeX, Web, and Texinfo rules. Other slight
+ editorial changes.
+
+ * commands.c (execute_file_commands): Fixed a bug wherein
+ random memory could get written for files with no deps.
+
+Wed Jul 20 19:30:31 1988 Roland McGrath (mcgrath at tully.Berkeley.EDU)
+
+ * read.c (readline): Fix bug wherein it would not recognize a
+ backslash-newline if the buffer filled up and was enlarged
+ right before reading the newline.
+
+Tue Jul 19 19:55:02 1988 Roland McGrath (mcgrath at chilli.Berkeley.EDU)
+
+ * read.c: Added default suffix rules for .cc (using $(C++),
+ which defaults to `g++', and $(C++FLAGS)), .tex, .dvi, .web
+ and .cweb (using $(TEX), $(WEAVE), $(TANGLE), $(CWEAVE) and
+ $(CTANGLE)).
+
+Sat Jul 16 21:24:28 1988 Roland McGrath (mcgrath at tully.Berkeley.EDU)
+
+ * Made error formats use %u rather than %ld for line numbers,
+ which are now unsigned int's rather than long's.
+
+ * read.c (conditional_line): Fixed some bugs caused by use of
+ unsigned int rather than int in one place.
+
+ * read.c (conditional_line): Put the info about active
+ conditionals in a struct.
+ (read_makefile): Make a new struct of info about conditionals
+ for included makefiles and restore the old one after the
+ included makefile has been read.
+
+ * read.c (read_makefile): Don't try to read a makefile with
+ name "" after giving an error message because an `include'
+ directive gave no filename.
+
+ * read.c (read_makefile): Give an error message for
+ non-whitespace text after the filename in an `include' directive.
+
+ * make.c (error): Take five args, like `fatal'. It managed to
+ lose with only two. Is there a better way to do this without vfprintf?
+
+ * read.c (read_makefile): Commands consisting of only
+ whitespace are not the same as no commands. I thought I'd
+ fixed this bug months ago; it seems to have come back.
+
+ * make.c (collapse_continuations): All whitespace around a
+ backslash-newline combination is turned into a single space.
+
+ * Added COPYING file and copyright notices to all files.
+
+ * make.texinfo (Running: Goals): Fix a typo.
+
+ * read.c (do_define): Take an arg for the origin of the
+ variable being defined.
+ (read_makefile): Grok `override define'.
+
+ * make.texinfo (Variables: Override Directive, Defining):
+ Document the `override define' combination directive.
+
+ * ar.c (ar_member_date): Make a 0 return from `ar_scan' return
+ (time_t) -1 (nonexistent file), rather than (time_t) 0, which,
+ when put in the `struct file', makes `file_mtime' try to get
+ the mtime over and over again.
+
+ * variable.c (pattern_matches): Fix a bug that made patterns
+ not beginning with `%' never match.
+
+Fri Jul 15 21:01:44 1988 Roland McGrath (mcgrath at tully.Berkeley.EDU)
+
+ * Took Make out of RCS.
+
+ * Split the monolithic `make.c' into several smaller files.
+
+
+
+Copyright (C) 1988-2009 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
+terms of the GNU General Public License as published by the Free Software
+Foundation; either version 3 of the License, or (at your option) any later
+version.
+
+GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License along with
+this program. If not, see <http://www.gnu.org/licenses/>.
diff --git a/ChangeLog.2 b/ChangeLog.2
new file mode 100644
index 00000000..08164546
--- /dev/null
+++ b/ChangeLog.2
@@ -0,0 +1,6653 @@
+2000-06-22 Paul D. Smith <psmith@gnu.org>
+
+ * job.c (start_job_command): Increment commands_started before the
+ special check for ":" (empty command) to avoid spurious "is up to
+ date" messages. Also move the test for question_flag after we
+ expand arguments, and only stop if the expansion provided an
+ actual command to run, not just whitespace. This fixes PR/1780.
+
+2000-06-21 Paul D. Smith <psmith@gnu.org>
+
+ * read.c (read_makefile): If we find a semicolon in the target
+ definition, remember where it was. If the line turns out to be a
+ target-specific variable, add back the semicolon and everything
+ after it. Fixes PR/1709.
+
+2000-06-19 Paul D. Smith <psmith@gnu.org>
+
+ * config.h-vms.template: #define uintmax_t for this system.
+ * config.ami.template: Ditto.
+ * config.h.W32.template: Ditto.
+
+ * configure.in: We don't use select(2) anymore, so don't bother
+ checking for it.
+ * acconfig.h: Ditto.
+ * acinclude.m4: Ditto.
+
+ * file.c (all_secondary): New static global; if 1 it means
+ .SECONDARY with no prerequisites was seen in the makefile.
+ (snap_deps): Set it appropriately.
+ (remove_intermediates): Check it.
+ (num_intermediates): Remove this global, it's not used anywhere.
+ (considered): Move this to remake.c and make it static.
+
+ * NEWS: Document the change to .SECONDARY.
+ * make.texinfo (Special Targets): Document the change to .SECONDARY.
+
+ * implicit.c (pattern_search): Remove the increment of
+ num_intermediates; it's not used.
+ * filedef.h: Remove num_intermediates and considered.
+
+ * function.c (handle_function): If the last argument was empty, we
+ were pretending it didn't exist rather than providing an empty
+ value. Keep looking until we're past the end, not just at the end.
+
+ * implicit.c (pattern_search): Multi-target implicit rules weren't
+ expanding the "also made" targets correctly if the pattern didn't
+ contain a slash but the target did; in that case the directory
+ part wasn't being added back to the stem on the "also made"
+ targets. Reported by Seth M LaForge <sethml@newtonlabs.com>, with
+ a patch.
+
+2000-06-17 Eli Zaretskii <eliz@is.elta.co.il>
+
+ * Makefile.DOS.template (DESTDIR, bindir, datadir, libdir)
+ (infodir, mandir, includedir): Support installation under a
+ non-default DESTDIR.
+
+ * remake.c (f_mtime): Fix the spelling of __MSDOS__.
+
+ * configh.DOS.template (HAVE_FDOPEN, HAVE_MKSTEMP): Define.
+
+2000-06-14 Paul D. Smith <psmith@gnu.org>
+
+ * acinclude.m4 (pds_WITH_GETTEXT): rewrite fp_WITH_GETTEXT and
+ rename it to avoid confusion. This version is very specific: it
+ won't accept any gettext that isn't GNU. If the user doesn't
+ explicitly ask for the included gettext, we look to see if the
+ system gettext is GNU (testing both the actual libintl library,
+ and the libintl.h header file). Only if the system gettext is
+ really GNU gettext will we allow it to be used.
+ (pds_CHECK_SYSTEM_GETTEXT): A helper function.
+
+2000-06-13 Paul D. Smith <psmith@gnu.org>
+
+ * gettext.h: If we have libintl.h, use that instead of any of the
+ contents of gettext.h. We won't check for libintl.h unless we're
+ using the system gettext.
+
+ * function.c (func_word): Clarify error message.
+
+2000-06-10 Paul Eggert <eggert@twinsun.com>
+
+ Support nanosecond resolution on hosts with 64-bit time_t and
+ uintmax_t (e.g. 64-bit Sparc Solaris), by splitting
+ FILE_TIMESTAMP into a 30-bit part for nanoseconds, with the
+ rest for seconds, if FILE_TIMESTAMP is at least 64 bits wide.
+
+ * make.h: Always define FILE_TIMESTAMP to be uintmax_t, for
+ simplicity.
+
+ * filedef.h (FILE_TIMESTAMP_HI_RES, FILE_TIMESTAMP_LO_BITS)
+ (UNKNOWN_MTIME, NONEXISTENT_MTIME, OLD_MTIME)
+ (ORDINARY_MTIME_MIN, ORDINARY_MTIME_MAX): New macros.
+ (FILE_TIMESTAMP_STAT_MODTIME): Now takes fname arg. All uses changed.
+ (FILE_TIMESTAMP_DIV, FILE_TIMESTAMP_MOD)
+ (FILE_TIMESTAMP_FROM_S_AND_NS): Remove.
+ (FILE_TIMESTAMP_S, FILE_TIMESTAMP_NS): Use shifts instead of
+ multiplication and division. Offset the timestamps by
+ ORDINARY_MTIME_MIN.
+ (file_timestamp_cons): New decl.
+ (NEW_MTIME): Now just the maximal timestamp value, as we no longer use
+ -1 to refer to nonexistent files.
+
+ * file.c (snap_deps, print_file): Use NONEXISTENT_MTIME,
+ UNKNOWN_MTIME, and OLD_MTIME instead of magic constants.
+ * filedef.h (file_mtime_1): Likewise.
+ * main.c (main): Likewise.
+ * remake.c (update_file_1, notice_finished_file, check_dep)
+ (f_mtime, name_mtime, library_search): Likewise.
+ * vpath.c (selective_vpath_search): Likewise.
+
+ * remake.c (f_mtime): Do not assume that (time_t) -1 equals
+ NONEXISTENT_MTIME. When futzing with time stamps, adjust by
+ multiples of 2**30, not 10**9. Do not calculate timestamp
+ adjustments on DOS unless they are needed.
+
+ * commands.c (delete_target): Do not assume that
+ FILE_TIMESTAMP_S yields -1 for a nonexistent file, as that is
+ no longer true with the new representation.
+
+ * file.c (file_timestamp_cons): New function, replacing
+ FILE_TIMESTAMP_FROM_S_AND_NS. All uses changed.
+ (file_timestamp_now): Use FILE_TIMESTAMP_HI_RES instead of 1 <
+ FILE_TIMESTAMPS_PER_S to determine whether we're using hi-res
+ timestamps.
+ (print_file): Print OLD_MTIME values as "very old" instead of
+ as a timestamp.
+
+2000-05-31 Paul Eggert <eggert@twinsun.com>
+
+ * remake.c (name_mtime): Check for stat failures. Retry if EINTR.
+
+2000-05-24 Paul D. Smith <psmith@gnu.org>
+
+ * main.c (decode_switches): The "positive_int" switch uses atoi()
+ which succeeds for any input, and doesn't notice if extra,
+ non-digit text is after the number. This causes make to mis-parse
+ command lines like "make -j 5foo" as "make -j5" (ignoring "foo"
+ completely) instead of "make -j0 5foo" (where "5foo" is a
+ target). Fix this by checking the value by hand. We could use
+ strtol() if we were sure of having it; this is the only
+ questionable use of atoi() I found so we'll just stick with that.
+ Fixes PR/1716.
+
+ * i18n/ja.po, i18n/nl.po, i18n/pt_BR.po: New translation files.
+ * configure.in (ALL_LINGUAS): Added pt_BR.
+
+2000-05-22 Paul Eggert <eggert@twinsun.com>
+
+ * remake.c (f_mtime): Fix bug when handling future odd
+ timestamps in the WINDOWS32 case. Do not bother initializing
+ static var to zero. Simplify code that works around WINDOWS32
+ and __MSDOS__ time skew brain damage.
+
+2000-05-22 Paul Eggert <eggert@twinsun.com>
+
+ * job.c: Don't include time.h, as make.h already does this.
+
+2000-05-22 Paul Eggert <eggert@twinsun.com>
+
+ * configure.in (AC_CHECK_HEADERS): Add sys/time.h.
+ (AC_HEADER_TIME): Add.
+ (clock_gettime): Prefer -lrt to -lposix4, for Solaris 7.
+ (gettimeofday): Add check for standard version of gettimeofday.
+ This merges changes written by Paul D. Smith.
+
+ * file.c (file_timestamp_now): Use gettimeofday if available
+ and if clock_gettime does not work. Don't bother with
+ high-resolution clocks if file timestamps have only one-second
+ resolution.
+
+ * make.h <sys/time.h>: Include, conditionally on the usual
+ TIME_WITH_SYS_TIME and HAVE_SYS_TIME_H macros. This is needed
+ for gettimeofday.
+
+2000-05-20 Paul D. Smith <psmith@gnu.org>
+
+ * read.c (read_makefile): We weren't keeping makefile names around
+ unless there was a rule defined in them; but now we need to keep
+ them for variables as well. Forget trying to be fancy: just keep
+ every makefile name we successfully open.
+
+ * remote-cstms.c (start_remote_job_p): Change DB_EXTRA (?) to DB_JOBS.
+
+2000-05-17 Paul Eggert <eggert@twinsun.com>
+
+ * commands.c (chop_commands): Ensure ctype macro args are nonnegative.
+ * expand.c (variable_expand_string): Likewise.
+ * function.c (subst_expand, lookup_function, msdos_openpipe):
+ Likewise.
+ * job.c (vms_redirect, start_job_command, new_job, child_execute_job,
+ construct_command_argv_internal, construct_command_argv): Likewise.
+ * main.c (decode_env_switches, quote_for_env): Likewise.
+ * misc.c (collapse_continuations, end_of_token, end_of_token_w32,
+ next_token): Likewise.
+ * read.c (read_makefile, do_define, conditional_line,
+ find_char_unquote,get_next_mword): Likewise.
+ * variable.c (try_variable_definition): Likewise.
+ * vpath.c (construct_vpath_list): Likewise.
+ * w32/pathstuff.c (convert_vpath_to_windows32): Likewise.
+
+2000-05-10 Eli Zaretskii <eliz@is.elta.co.il>
+
+ * main.c (main) [__MSDOS__]: Add SIGFPE to signals we block when
+ running child programs, to prevent Make from dying on Windows 9X
+ when the child triggers an FP exception.
+
+2000-05-08 Paul D. Smith <psmith@gnu.org>
+
+ * dir.c (find_directory) [WINDOWS32]: If we strip a trailing "\"
+ from the directory name, remember to add it back. The argument
+ might really be inside a longer string (e.g. %Path%) and if you
+ don't restore the "\" it'll be truncated permanently. Fixes PR/1722.
+ Reported by <steven@surfcast.com>
+
+2000-05-02 Paul D. Smith <psmith@gnu.org>
+
+ * job.c (construct_command_argv_internal) [WINDOWS32]: Added "rd"
+ and "rmdir" to the list of command.com commands.
+ Reported by Elod Horvath <Elod_Horvath@lnotes5.bankofny.com>
+
+2000-04-24 Paul D. Smith <psmith@gnu.org>
+
+ * i18n/ja.po: New translation file from the Japanese language team.
+
+2000-04-18 Paul D. Smith <psmith@gnu.org>
+
+ * remake.c (f_mtime): If ar_member_date() returns -1 (the member
+ doesn't exist), then return (FILE_TIMESTAMP)-1 rather than
+ returning the timestamp calculated from the value -1. Fixes PR/1696.
+ Reported by Gilles Bourhis <Gilles.Bourhis@univ-rennes1.fr>.
+
+2000-04-17 Paul D. Smith <psmith@gnu.org>
+
+ * config.h.W32.template: Add LOCALEDIR macro resolving to "".
+ * w32/subproc/sub_proc.c (process_begin): Remove reference to
+ debug_flag; change it to a DB() call. Fixes PR/1700.
+ Reported by Jim Smith <jwksmith@attglobal.net>
+
+2000-04-17 Bruno Haible <haible@clisp.cons.org>
+
+ * arscan.c [BeOS]: Add replacement for nonexistent <ar.h> from GNU
+ binutils.
+
+2000-04-11 Paul D. Smith <psmith@gnu.org>
+
+ * function.c (expand_builtin_function): If no arguments were
+ provided, just quit early rather than changing each function to
+ test for this.
+ (function_table[]): Change the min # of arguments to 0 for all
+ those functions for which it makes sense (currently everything
+ that used to take a minimum of 1 argument, except $(call ...)).
+ Fixes PR/1689.
+
+2000-04-09 Eli Zaretskii <eliz@is.elta.co.il>
+
+ * README.DOS: Add instructions to install a binary distro.
+ Mention latest versions of Windows.
+
+2000-04-07 Eli Zaretskii <eliz@is.elta.co.il>
+
+ * main.c (main): Rename TMP_TEMPLATE into DEFAULT_TMPDIR, and use
+ it for the directory of the temporary file. If P_tmpdir is
+ defined, use it in preference to "/tmp/". Try $TMPDIR, $TEMP, and
+ $TMP in the environment before defaulting to DEFAULT_TMPDIR.
+ (print_version): Add year 2000 to the Copyright line.
+
+2000-04-04 Paul D. Smith <psmith@gnu.org>
+
+ * Version 3.79 released.
+
+ * make.texinfo: Update documentation with new features for 3.79.
+
+ * function.c (func_wordlist): Don't re-order arguments to
+ wordlist.
+
+2000-04-03 Paul D. Smith <psmith@gnu.org>
+
+ * remake.c (f_mtime): Archive member timestamps are stored as
+ time_t, without nanoseconds. But, f_mtime() wants to return
+ nanosecond info on those systems that support it. So, convert the
+ return value of ar_member_date() into a FILE_TIMESTAMP, using 0 as
+ the nanoseconds.
+
+2000-03-28 Paul D. Smith <psmith@gnu.org>
+
+ * Version 3.78.92 released.
+
+ * build.template: Updates for gettext support; some bugs fixed.
+
+2000-03-27 Paul D. Smith <psmith@gnu.org>
+
+ * config.guess, config.sub: Updated from config CVS archive at
+ :pserver:anoncvs@subversions.gnu.org:/home/cvs as of today.
+
+ * read.c (record_files): Check if expanding a static pattern
+ rule's prerequisite pattern leaves an empty string as the
+ prerequisite, and issue an error if so. Fixes PR/1670.
+ (read_makefile): Store the starting linenumber for a rule in
+ TGTS_STARTED.
+ (record_waiting_files): Use the TGTS_STARTED value for the file
+ location passed to record_file() instead of the current
+ linenumber, so error messages list the line where the target was
+ defined instead of the line after the end of the rule definition.
+
+ * remake.c (start_updating, finish_updating, is_updating): Fix
+ PR/1671; circular dependencies in double-colon rules are not
+ diagnosed. These macros set the updating flag in the root
+ double-colon file instead of the current one, if it's part of a
+ double-colon list. This solution provided by Tim Magill
+ <magill@gate.net>; I just changed the macro names :).
+ (update_file_1): Call them.
+ (check_dep): Call them.
+
+ The change to not automatically evaluate the $(call ...)
+ function's arguments breaks recursive use of call. Although using
+ $(if ...) and $(foreach ...) in $(call ...) macros is important,
+ the error conditions generated are simply to obscure for me to
+ feel comfortable with. If a method is devised to get both
+ working, we'll revisit. For now, remove this change.
+
+ * function.c (function_table): Turn on the expand bit for func_call.
+ (func_call): Don't expand arguments for builtin functions; that
+ will have already been done.
+
+2000-03-26 Paul D. Smith <psmith@gnu.org>
+
+ * file.c (remove_intermediates): Never remove targets explicitly
+ requested on the command-line by checking the cmd_target flag.
+ Fixed PR/1669.
+
+2000-03-23 Paul Eggert <eggert@twinsun.com>
+
+ * filedef.h (FILE_TIMESTAMP_STAT_MODTIME): Use st_mtime instead of
+ st_mtim.tv_sec; the latter doesn't work on Unixware.
+
+2000-03-18 Paul D. Smith <psmith@gnu.org>
+
+ * file.c (file_hash_enter): If we're trying to change a file into
+ itself, just return. We used to assert this wasn't true, but
+ someone came up with a weird case involving archives. After
+ playing with it for a while I decided it was OK to ignore it.
+
+ * default.c: Define COFLAGS to empty to avoid spurious warnings.
+
+ * filedef.h: Change #if ST_MTIM_NSEC to #ifdef; this is a macro
+ containing the name of the nsec field, not true/false.
+ * make.h: Ditto.
+ Reported by Marco Franzen <Marco.Franzen@Thyron.com>.
+
+2000-03-08 Tim Magill <magill@gate.net>
+
+ * remake.c (update_file): Return the exit status of the pruned
+ file when pruning, not just 0. Fixes PR/1634.
+
+2000-02-24 Paul D. Smith <psmith@gnu.org>
+
+ * configure.in: Close a minor potential security hole; if you're
+ reading makefiles from stdin (who does that?) you could run into a
+ race condition with the temp file using mktemp() or tmpnam(). Add
+ a check for mkstemp() and fdopen().
+ * main.c (open_tmpfile): New function to open a temporary file.
+ If we have mkstemp() (and fdopen()), use that. If not use
+ mktemp() or tmpnam(). If we have fdopen(), use open() to open the
+ file O_CREAT|O_EXCL. If not, fall back to normal fopen() (insecure).
+ (main): Call it.
+ * job.c (child_execute_job) [VMS]: Call it.
+
+ * variable.c (lookup_variable): If we find a variable which is
+ being expanded, then note it but keep looking through the rest of
+ the set list to see if we can find one that isn't. If we do,
+ return that. If we don't, return the original. Fix for PR/1610.
+
+ While implementing this I realized that it also solves PR/1380 in
+ a much more elegant way. I don't know what I was smoking before.
+ So, remove the hackage surrounding the original fix for that (see
+ below). Change this function back to lookup_variable and remove
+ the extra setlist argument.
+ * variable.h (recursively_expand_setlist): Remove the macro,
+ rename the prototype, and remove the extra setlist argument.
+ (lookup_variable): Ditto.
+ * expand.c (recursively_expand): Rename and remove the extra
+ setlist argument.
+ (reference_variable): Use lookup_variable() again.
+ (allocated_variable_append): Remove the extra setlist argument.
+
+2000-02-21 Paul D. Smith <psmith@gnu.org>
+
+ * README.template: A few updates.
+
+ * i18n/de.po: New version from the German translation team.
+
+2000-02-09 Paul D. Smith <psmith@gnu.org>
+
+ * Version 3.78.91 released.
+
+2000-02-07 Paul D. Smith <psmith@gnu.org>
+
+ * read.c (read_makefile): Reset *p2 to ':', not *colonp. If any
+ filenames contained backslashes the resulting output (without
+ backslashes) will be shorter, so setting *colonp doesn't change
+ the right character. Fix for PR/1586.
+
+ For += target-specific variables we need to remember which
+ variable set we found the variable in, so we can start looking
+ from there in the next iteration (otherwise we might see it again
+ in recursively_expand and fail!). This is turning into a hack; if
+ it gets any worse we'll have to rethink this entire algorithm...
+ implementing expansion of these references separately from the
+ "normal" expansion, say, instead of using the same codepath.
+ Actually, it's already "worse enough" :-/.
+ Fix for PR/1380.
+
+ * variable.h (recursively_expand_setlist): Rename
+ recursively_expand to add a struct variable_set_list argument, and
+ make a macro for recursively_expand.
+ (lookup_variable_setlist): Rename lookup_variable to add a struct
+ variable_set_list argument, and make a macro for lookup_variable.
+
+ * expand.c (recursively_expand_setlist): Take an extra struct
+ variable_set_list argument and pass it to allocated_variable_append().
+ (reference_variable): Use lookup_variable_setlist() and pass the
+ returned variable_set_list to recursively_expand_setlist.
+ (allocated_variable_append): Take an extra setlist argument and
+ use this as the starting place when searching for the appended
+ expansion. If it's null, use current_variable_set_list as before.
+
+ * variable.c (lookup_variable_setlist): If the LISTP argument is
+ not nil, set it to the list containing the variable we found.
+
+2000-02-04 Paul D. Smith <psmith@gnu.org>
+
+ * variable.c (print_variable): Write out filename/linenumber
+ information for the variable definition if present.
+ (define_variable_in_set): Store filename information if provided.
+ (define_variable, define_variable_for_file): Removed.
+ (try_variable_definition): Use define_variable_loc() to keep
+ variable definition location information.
+ * read.c (read_makefile): Keep variable definition location info.
+ (do_define): Ditto.
+ (record_target_var): Ditto.
+ * variable.h (define_variable_in_set): New fileinfo argument.
+ (define_variable, define_variable_loc, define_variable_for_file):
+ Declare new macros.
+
+ Fix PR/1407:
+
+ * filedef.h (struct file): Rename patvar to pat_variables and make
+ it just a variable_set_list; we need our own copy of the pattern
+ variable's variable set list here to avoid overwriting the global
+ one.
+ * variable.c (initialize_file_variables): Move the instantiation
+ of the pat_variables pointer here. Only do the search after we're
+ done reading the makefiles so we don't search too early. If
+ there's a pat_variables value, set up the variables next ptr.
+ * expand.c (variable_expand_for_file): Remove the setup of the
+ pat_variables info; it's done earlier now to ensure the parent's
+ pattern variables are set up correctly as well.
+
+2000-02-03 Paul D. Smith <psmith@gnu.org>
+
+ * job.c (sh_chars_dos) [WINDOWS32]: Add "&" as a shell
+ metacharacter for the W32 DOS shell.
+ Reported by Warren Jones <wjones@tc.fluke.com>.
+
+2000-02-02 Paul D. Smith <psmith@gnu.org>
+
+ Fixes for the OpenVMS port from Hartmut Becker <becker@rto.dec.com>
+
+ * config.h-vms [VMS]: Define LOCALEDIR to something; needed for
+ the expansion of bindtextdomain() even though it's a no-op.
+ * vmsfunctions.c (strcmpi): Remove duplicate definition of strcmpi().
+ (readdir): Use DB() instead of testing debug_flag.
+ * dir.c (file_impossible) [VMS]: Search "p" not "name".
+ * job.c [VMS]: Switch from debug_flag to the new DB macro. Add
+ some i18n _() macros (even though VMS doesn't yet support it).
+
+ * function.c (patsubst_expand): Change "len" to not be unsigned to
+ avoid type mismatches.
+
+ * main.c (main): Declare signame_init() if we're going to call it.
+
+2000-01-29 Eli Zaretskii <eliz@is.elta.co.il>
+
+ * Makefile.DOS.template: Track changes in Makefile.in
+ (install-recursive, uninstall-recursive): Add missing targets.
+ (DESTDIR): Define.
+ (install-binPROGRAMS, uninstall-binPROGRAMS): Use $(DESTDIR).
+
+ * default.c (default_variables) [__MSDOS__]: Define CXX to gpp.
+
+2000-01-27 Paul D. Smith <psmith@gnu.org>
+
+ * gettext.c: Some warning cleanups, and a fix for systems which
+ don't define HAVE_ALLOCA (the workaround code was included
+ twice).
+
+2000-01-26 Paul D. Smith <psmith@gnu.org>
+
+ * Version 3.78.90 released.
+
+2000-01-25 Paul D. Smith <psmith@gnu.org>
+
+ Change gettext support to use the simplified version in libit 0.7.
+
+ * getopt.c, make.h: Use gettext.h instead of libintl.h.
+ * ABOUT-NLS, gettext.h, gettext.c: New files from libit 0.7.
+ Modified to remove some static declarations which aren't defined.
+ * acconfig.h: Use new gettext #defines.
+ * acinclude.m4: Add fp_WITH_GETTEXT; remove AM_GNU_GETTEXT.
+ * configure.in: Call fp_WITH_GETTEXT instead.
+ * Makefile.am: New gettext stuff. Also force inclusion of glob
+ files for systems which have LIBC glob.
+
+ * i18n/Makefile.am, i18n/.cvsignore: New dir for translation files.
+ * i18n/de.po, i18n/es.po, i18n/fr.po, i18n/ko.po, i18n/nl.po:
+ * i18n/pl.po, i18n/ru.po: Import translations already done for
+ earlier versions of GNU make. Thanks for that work!!
+
+ * po/Makefile.in.in, po/POTFILES.in: Removed.
+
+2000-01-23 Paul D. Smith <psmith@gnu.org>
+
+ * main.c (decode_debug_flags): If debug_flag is set, enable all
+ debugging levels.
+ (debug_flag): Resurrect this flag variable.
+ (switches): Make -d give the old behavior of turning on all
+ debugging. Change --debug alone to emit basic debugging and take
+ optional arguments to expand debugging.
+ * NEWS: Document the new debugging options.
+
+ * remake.c (no_rule_error): Remove this function. This tries to
+ fix a real problem--see the description with the introduction of
+ this function below. However, the cure is worse than the disease
+ and this approach won't work.
+ (remake_file): Put the code from no_rule_error back here.
+ (update_file_1): Remove call to no_rule_error.
+
+ * filedef.h (struct file): Remove mfile_status field.
+
+2000-01-22 Paul D. Smith <psmith@gnu.org>
+
+ Integrate GNU gettext support.
+
+ * configure.in: Add AM_GNU_GETTEXT.
+ * Makefile.am: Add options for setting LOCALEDIR, -Iintl, etc.
+ * acinclude.m4: Add gettext autoconf macros.
+ * acconfig.h: Add new gettext #defines.
+ * make.h: Include libintl.h. Make sure _() and N_() macros are
+ declared. Make gettext() an empty macro is NLS is disabled.
+ * main.c (struct command_switch switches[]): Can't initialize
+ static data with _() (gettext calls), so use N_() there then use
+ gettext() directly when printing the strings.
+ * remake.c (no_rule_error): The string constants can't be static
+ when initializing _() macros.
+ * file.c (print_file): Reformat a few strings to work better for
+ translation.
+ * po/POTFILES.in, po/Makefile.in.in: New files. Take
+ Makefile.in.in from the latest GNU tar distribution, as that
+ version works better than the one that comes with gettext.
+ * NEWS: Mention i18n ability.
+
+2000-01-21 Paul D. Smith <psmith@gnu.org>
+
+ Installed patches for the VMS port.
+ Patches provided by: Hartmut Becker <Hartmut.Becker@compaq.com>
+
+ * readme.vms, arscan.c, config.h-vms, default.c, dir.c, file.c:
+ * implicit.c, job.c, make.h, makefile.com, makefile.vms, rule.c:
+ * variable.c, vmsdir.h, vmsfunctions.c, vmsify.c, glob/glob.c:
+ * glob/glob.h: Installed patches. See readme.vms for details.
+
+2000-01-14 Andreas Schwab <schwab@suse.de>
+
+ * dir.c (read_dirstream): Initialize d_type if it exists.
+
+2000-01-11 Paul D. Smith <psmith@gnu.org>
+
+ Resolve PR/xxxx: don't automatically evaluate the $(call ...)
+ function's arguments. While we're here, clean up argument passing
+ protocol to always use simple nul-terminated strings, instead of
+ sometimes using offset pointers to mark the end of arguments.
+ This change also fixes PR/1517.
+ Reported by Damien GIBOU <damien.gibou@st.com>.
+
+ * function.c (struct function_table_entry): Remove the negative
+ required_args hack; put in explicit min and max # of arguments.
+ (function_table): Add in the max value. Turn off the expand bit
+ for func_call.
+ (expand_builtin_function): Test against minimum_args instead of
+ the obsolete required_args.
+ (handle_function): Rewrite this. We don't try to be fancy and
+ pass one style of arguments to expanded functions and another
+ style to non-expanded functions: pass pointers to nul-terminated
+ strings to all functions.
+ (func_call): Rewrite this. If we are invoking a builtin function
+ and it's supposed to have its arguments expanded, do that (since
+ it's not done by handle_function for $(call ...) anymore). For
+ non-builtins, just add the variables as before but mark them as
+ recursive so they'll be expanded later, as needed.
+ (func_if): All arguments are vanilla nul-terminated strings:
+ remove trickery with "argv[1]-1".
+ (func_foreach): Ditto.
+
+ * expand.c (expand_argument): If the second arg is NULL, expand
+ the entire first argument.
+
+ * job.c (new_job): Zero the child struct. This change was just
+ made to keep some heap checking software happy, not because there
+ was an actual bug (the important memory was being cleared properly).
+
+1999-12-15 Paul D. Smith <psmith@gnu.org>
+
+ * variable.c (print_variable): Print the variable with += if the
+ append flag is set.
+
+ * implicit.c (pattern_search): Remove the extra check of the
+ implicit flag added on 8/24/1998. This causes problems and the
+ reason for the change was better resolved by the change made to
+ check_deps() on 1998-08-26. This fixes PR/1423.
+
+1999-12-08 Paul D. Smith <psmith@gnu.org>
+
+ * dir.c (dir_setup_glob): On 64 bit ReliantUNIX (5.44 and above)
+ in LFS mode, stat() is actually a macro for stat64(). Assignment
+ doesn't work in that case. So, stat is a macro, make a local
+ wrapper function to invoke it.
+ (local_stat): Wrapper function, if needed.
+ Reported by Andrej Borsenkow <Andrej.Borsenkow@mow.siemens.ru>.
+
+1999-12-02 Paul D. Smith <psmith@gnu.org>
+
+ * remake.c (update_file): Move the considered test outside the
+ double-colon loop, _but_ make sure we test the double_colon target
+ not the "current" target. If we stop early because one
+ double-colon target is running, mark all the rest considered and
+ try to start their prerequisites (so they're marked considered).
+ Fix for PR/1476 suggested by Tim Magill <tim.magill@telops.gte.com>.
+
+1999-11-22 Rob Tulloh <rob_tulloh@dev.tivoli.com>
+
+ * function.c (windows32_openpipe, func_shell): Correct Windows32
+ problem where $(shell nosuchfile) would incorrectly exit make. The
+ fix is to print the error and let make continue.
+ Reported by David Masterson <David.Masterson@kla-tencor.com>.
+
+ * w32/subproc/misc.c (arr2envblk): Memory leak fix.
+
+1999-11-21 Paul D. Smith <psmith@gnu.org>
+
+ Rework GNU make debugging to provide different levels of output.
+
+ * NEWS: mention it.
+ * debug.h: New file. Define various debugging levels and macros.
+ * function.c, implicit.c, job.c, main.c, misc.c, read.c, remake.c
+ * remote-cstms.c, vmsfunctions.c: Replace all code depending on
+ debug_flag with invocations of debugging macros.
+ * make.h: Remove debug_flag and DEBUGPR, add db_level.
+
+1999-11-18 Paul Eggert <eggert@twinsun.com>
+
+ * acinclude.m4 (AC_SYS_LARGEFILE_FLAGS): Work around a problem
+ with the QNX 4.25 shell, which doesn't propagate exit status of
+ failed commands inside shell assignments.
+
+1999-11-17 Paul D. Smith <psmith@gnu.org>
+
+ * function.c (func_if): Find the end of the arg list by testing
+ the next item for NULL; any other test is not correct.
+ Reported by Graham Reed <grahamr@algorithmics.com> (PR/1429).
+
+ Fix += when used in a target-specific variable context.
+
+ * variable.h: New bitfield APPEND set if we have a +=
+ target-specific variable.
+
+ * variable.c (try_variable_definition): Add an argument to specify
+ if we're trying a target-specific variable. If we are and it's an
+ append style, don't append it, record it as normal recursive, but
+ set the APPEND flag so it'll be expanded later.
+ * main.c (handle_non_switch_argument): Use new
+ try_variable_definition() signature.
+ * read.c (read_makefile,record_target_var): Ditto.
+
+ * expand.c (allocated_variable_append): New function: like
+ allocated_variable_expand(), but we expand the same variable name
+ in the context of the ``next'' variable set, then we append this
+ expanded value.
+ (recursively_expand): Invoke it, if the APPEND bit is set.
+
+1999-11-10 Paul D. Smith <psmith@gnu.org>
+
+ * file.c (snap_deps): If the .NOTPARALLEL target is defined, turn
+ off parallel builds for this make only (still allow submakes to be
+ run in parallel).
+ * main.c: New variable, ``not_parallel''.
+ * make.h: Add an extern for it.
+ * job.c (new_job): Test NOT_PARALLEL as well as JOB_SLOTS.
+ * NEWS: Add info on .NOTPARALLEL.
+ * make.texinfo (Special Targets): Document it.
+
+ * configure.in (GLOBDIR): Set to "glob" if we need to build the
+ glob library.
+ * Makefile.am (SUBDIRS): Use the GLOBDIR variable instead of
+ "glob" so we don't try to build glob if we don't need to (if we
+ have GLIBC glob). Reported by Lars Hecking <lhecking@nmrc.ucc.ie>.
+
+ * main.c (main): Don't put "***" in the clock skew warning
+ message. Reported by karl@gnu.org.
+
+ * make.h: Remove unneeded signal setup.
+
+ * signame.c: Remove extraneous #includes; some versions of Ultrix
+ don't protect against multiple inclusions and it causes compile
+ errors. Reported by Simon Burge <simonb@thistledown.com.au>.
+
+1999-10-15 Paul D. Smith <psmith@gnu.org>
+
+ * main.c (quote_for_env): Rename from quote_as_word().
+
+ * make.h, *.c: Prefer strchr() and strrchr() in the code
+ rather than index() and rindex(). Define strchr/strrchr in terms
+ of index/rindex if the former aren't supported.
+
+ * default.c (CHECKOUT,v): Replace the fancy, complicated
+ patsubst/filter expression with a simple $(if ...) expression.
+
+ * main.c (print_usage): Add the bug reporting mailing address to
+ the --help output, as per the GNU coding standards.
+ Reported by Paul Eggert <eggert@twinsun.com>.
+
+ * README.customs: Installed information on running Customs-ized
+ GNU make and setuid root, collected by Ted Stern <stern@tera.com>.
+
+ * read.c (read_all_makefiles): PR/1394: Mark the end of the next
+ token in the MAKEFILES value string _before_ we dup it.
+
+1999-10-13 Paul D. Smith <psmith@gnu.org>
+
+ * configure.in (make_cv_sys_gnu_glob): We used to add the -Iglob
+ flag to CPPFLAGS, but that loses if the user specifies his own
+ CPPFLAGS; this one gets added _after_ his and if he happens to
+ have an old or broken glob.h--boom. Instead, put it in GLOBINC
+ and SUBST it.
+
+ * Makefile.am (INCLUDES): Add @GLOBINC@ to the INCLUDES macro;
+ these things get on the compile line well before the user's
+ CPPFLAGS.
+
+1999-10-12 Paul D. Smith <psmith@gnu.org>
+
+ * remake.c (notice_finished_file): If we get here and -n is set,
+ see if all the command lines are marked recursive. If so, then we
+ ran every command there is, so check the mtime on this file just
+ like we would normally. If not, we assume the command we didn't
+ run would updates the target and set mtime of the target to "very new".
+
+ * job.c (start_job_command): Update lines_flags in the file's cmds
+ structure with any per-line tokens we found (`@', `-', `+').
+
+1999-10-08 Paul D. Smith <psmith@gnu.org>
+
+ * variable.c (initialize_file_variables): Always recurse to
+ initialize the parent's file variables: the parent might not have
+ any rules to run so it might not have been initialized before
+ this--we need this to set up the chain properly for
+ target-specific variables.
+
+1999-09-29 Paul Eggert <eggert@twinsun.com>
+
+ * main.c (quote_as_word): Always quote for decode_env_switches
+ instead of for the shell, so that arguments with strange
+ characters are are passed to submakes correctly. Remove
+ double_dollars arg; we always double dollars now. All callers
+ changed.
+ (decode_env_switches): Don't run off the end of an environment
+ variable whose contents ends in a unescaped backslash.
+
+1999-09-23 Paul D. Smith <psmith@gnu.org>
+
+ * commands.c, function.c, job.c, read.c: Cast arguments to
+ ctype.h functions/macros to _unsigned_ char for portability.
+
+ * remake.c, function.c: Compiler warning fixes: the second
+ argument to find_next_token() should be an _unsigned_ int*.
+ Reported by Han-Wen Nienhuys <hanwen@cs.uu.nl>.
+
+1999-09-23 Paul D. Smith <psmith@gnu.org>
+
+ * Version 3.78.1 released.
+
+ * make.texinfo: Update version/date stamp.
+
+ * main.c (main): Argh. For some reason we were closing _all_ the
+ jobserver pipes before we re-exec'd due to changed makefiles.
+ This means that any re-exec got a "jobserver unavailable" error :-/.
+ I can't believe we didn't notice this before.
+
+1999-09-22 Paul D. Smith <psmith@gnu.org>
+
+ * Version 3.78 released.
+
+ * main.c (main): Only fail on multiple --jobserver-fds options if
+ they aren't all the same. Some makefiles use things like
+ $(MAKE) $(MFLAGS) which will cause multiple, identical copies of
+ --jobserver-fds to show up.
+
+1999-09-16 Paul D. Smith <psmith@gnu.org>
+
+ * main.c (define_makeflags): Zero out FLAGSTRING to avoid
+ uninitialized memory reads when checking *p != '-' in the loop.
+
+1999-09-15 Paul D. Smith <psmith@gnu.org>
+
+ * Version 3.77.97 released.
+
+ * configure.in (MAKE_HOST): AC_SUBST this so it will go into the
+ makefile.
+ * Makefile.am (check-local): Print a success banner if the check
+ succeeds.
+ (check-regression): A bit of fine-tuning.
+
+1999-09-15 Eli Zaretskii <eliz@is.elta.co.il>
+
+ * README.DOS.template: Document requirements for the test suite.
+ * Makefile.DOS.template: Updates to allow the test suite to run
+ from "make check".
+
+ * main.c (main): Handle it if argv[0] isn't an absolute path.
+
+1999-09-13 Paul D. Smith <psmith@gnu.org>
+
+ * Version 3.77.96 released.
+
+ * Makefile.am (loadavg): Use CPPFLAGS, etc. to make sure we get
+ all the right #defines to compile.
+ (check-regression): Look for the regression test suite in the make
+ package itself. If we're building remotely, use symlinks to make
+ a local copy.
+ (dist-hook): Put the test suite into the tar file.
+
+ * configure.in: Look for perl for the test suite.
+
+1999-09-10 Paul Eggert <eggert@twinsun.com>
+
+ * acinclude.m4 (AC_SYS_LARGEFILE_FLAGS): If on HP-UX 10.20 or
+ later, and using GCC, define __STDC_EXT__; this works around a
+ bug in GCC 2.95.1.
+
+1999-09-08 Paul D. Smith <psmith@gnu.org>
+
+ * main.c (print_version): Ugh. GLIBC's configure tries to check
+ make version strings and is too aggressive with their matching
+ expressions. I've struck a deal with them to leave the version
+ output as-is for 3.78, and they'll change their configure checks
+ so that I can change this back in the future.
+
+1999-09-07 Eli Zaretskii <eliz@is.elta.co.il>
+
+ * job.c (construct_command_argv_internal) [__MSDOS__]: Add "echo"
+ and "unset" to the list of builtin shell commands.
+
+ * configh.DOS.template (MAKE_HOST): Define to "i386-pc-msdosdjgpp"
+ which is the canonical name of the DJGPP host.
+
+1999-09-05 Paul D. Smith <psmith@gnu.org>
+
+ * Version 3.77.95 released.
+
+ * make.texinfo (Make Errors): Document some new jobserver error
+ messages.
+
+1999-09-04 Eli Zaretskii <eliz@is.elta.co.il>
+
+ * make.texinfo (Make Errors): Document the hint about 8 spaces
+ instead of a TAB.
+ (Call Function, Quick Reference): Use @code{$(1)}, not @var.
+
+ * main.c (main) [__MSDOS__]: Say "on this platform" instead of "on
+ MS-DOS", since the MSDOS version could run on Windows.
+
+1999-09-03 Paul D. Smith <psmith@gnu.org>
+
+ * remake.c (notice_finished_file): Always set mtime_before_update
+ if it's not been set, not just if we ran some rules. Otherwise we
+ may have a situation where a target's prerequisite was rebuilt but
+ not changed, so this target's rules weren't run, then
+ update_goal_chain() sees mtime_before_update != last_mtime and
+ thinks that the top-level target changed when it really didn't.
+ This can cause an infinite loop when remaking makefiles.
+ (update_goal_chain): If we get back to the top and we don't know
+ what the goal's last_mtime was, find it now. We need to know so
+ we can compare it to mtime_before_update later (this is only
+ crucial when remaking makefiles--should we only do it then?)
+
+1999-09-02 Paul D. Smith <psmith@gnu.org>
+
+ * read.c (read_makefile): If "override" appears as the first
+ prerequisite, look further to ensure this is really a
+ target-specific variable definition, and not just some
+ prerequisite named "override".
+
+1999-09-01 Paul D. Smith <psmith@gnu.org>
+
+ * function.c (IS_PATHSEP) [WINDOWS32]: Allow backslash separators
+ for W32 platforms.
+ * read.c (record_files) [WINDOWS32]: Allow backslash separators
+ for W32 platforms.
+ * implicit.c (pattern_search) [WINDOWS32]: Allow backslash
+ separators for W32 platforms.
+
+ * configure.in (MAKE_HOST): Define it to be the canonical build
+ host info, now that we need AC_CANONICAL_HOST anyway (for large
+ file support).
+ * version.c (make_host): Define a variable to MAKE_HOST so we're
+ sure to get it from the local config.h.
+ * main.c (print_version): Use it in the version information.
+ * config.ami.template: Add MAKE_HOST.
+ * configh.dos.template: Ditto.
+ * config.h.W32.template: Ditto.
+ * config.h-vms.template: Ditto.
+
+ * main.c (main): Close the jobserver file descriptors if we need
+ to re-exec ourselves.
+ Also print more reasonable error if users force -jN for submakes.
+ This may be common for a while until people use the jobserver
+ feature. If it happens, we ignore the existing jobserver stuff
+ and use whatever they specified on the commandline.
+ (define_makeflags): Fixed a long-standing bug: if a long name
+ only option comes immediately after a single letter option with no
+ argument, then the option string is constructed incorrectly. For
+ example, with -w and --jobserver-fds you get "-w-jobserver-fds..."
+ instead of "-w --jobserver-fds..."; add in an extra " -".
+
+ * make.texinfo (Phony Targets): Add another example of using
+ .PHONY with subdirectories/recursive make.
+
+1999-08-30 Paul D. Smith <psmith@gnu.org>
+
+ * README.W32.template: Renamed from README.W32 so it's
+ autogenerated during the dist. A few minor modifications.
+
+ * configure.in: Check for kstat_open before AC_FUNC_GETLOADAVG
+ since the latter needs to know whether the former exists to give
+ an accurate result.
+
+1999-08-26 Rob Tulloh <rob_tulloh@dev.tivoli.com>
+
+ * NMakefile [WINDOWS32]: Now more robust. If you change a file
+ under w32/subproc, the make.exe will be relinked. Also added some
+ tests to make sure erase commands won't fail when executed in a
+ pristine build environment.
+
+ * w32/subproc/sub_proc.c [WINDOWS32]: Added support for
+ HAVE_CYGWIN_SHELL. If you are using the Cygwin B20.1 release, it
+ is now possible to have have native support for this shell without
+ having to rely on klutzy BATCH_MODE_ONLY_SHELL.
+
+ * config.h.W32 [WINDOWS32]: Added HAVE_CYGWIN_SHELL macro which
+ users can define if they want to build make to use this shell.
+
+ * README.W32 [WINDOWS32]: Added informaton about
+ HAVE_CYGWIN_SHELL. Cleaned up text a bit to make it more current.
+
+1999-08-26 Paul Eggert <eggert@twinsun.com>
+
+ Support large files in AIX, HP-UX, and IRIX.
+
+ * acinclude.m4 (AC_LFS): Remove. Superseded by AC_SYS_LARGEFILE.
+ (AC_SYS_LARGEFILE_FLAGS, AC_SYS_LARGEFILE_SPACE_APPEND,
+ AC_SYS_LARGEFILE_MACRO_VALUE, AC_SYS_LARGEFILE): New macros.
+ (jm_AC_TYPE_UINTMAX_T): Check for busted compilers that can't
+ shift or divide unsigned long long.
+ (AM_PROG_CC_STDC): New macro; a temporary workaround of a bug in
+ automake 1.4.
+
+ * configure.in (AC_CANONICAL_HOST): Add; required by new
+ AC_SYS_LARGEFILE.
+ (AC_SYS_LARGEFILE): Renamed from AC_LFS.
+ (AM_PROG_CC_STDC): Add.
+
+ * config.guess, config.sub: New files, needed for AC_CANONICAL_HOST.
+
+1999-08-25 Paul Eggert <eggert@twinsun.com>
+
+ * make.h (CHAR_MAX): New macro.
+ * main.c (struct command_switch): c is now int,
+ so that it can store values greater than CHAR_MAX.
+ (switches): Replace small numbers N with CHAR_MAX+N-1,
+ to avoid problems with non-ASCII character sets.
+ (short_option): New macro.
+ (init_switches, print_usage, define_makeflags): Use it instead of
+ isalnum.
+
+1999-08-25 Paul D. Smith <psmith@gnu.org>
+
+ * Version 3.77.94 released.
+
+ * main.c (main) [__MSDOS__]: If the user uses -j, warn that it's
+ not supported and reset it.
+
+ * make.h (ISDIGIT): Obtained this from the textutils distribution.
+ * main.c (decode_switches): Use it.
+ * function.c (is_numeric): Use it.
+
+ * main.c (struct command_switch): Store the switch char in an
+ unsigned char to shut up GCC about using it with ctype.h macros.
+ Besides, it _is_ always unsigned.
+
+1999-08-24 Paul D. Smith <psmith@gnu.org>
+
+ * make.texinfo: Change "dependency" to "prerequisite" and
+ "dependencies" to "prerequisites". Various other cleanups related
+ to the terminology change.
+ * file.c: Change debugging and error messages to use
+ "prerequisite" instead of "dependency".
+ * implicit.c: Ditto.
+ * remake.c: Ditto.
+ * NEWS: Document it.
+
+1999-08-23 Paul D. Smith <psmith@gnu.org>
+
+ * remake.c (update_file): Move the considered check into the
+ double-colon rule loop, so we consider double-colon rules
+ individually (otherwise after the first is pruned, the rest won't
+ get run).
+
+ * README.template: Minor changes.
+
+ Remove the debugging features of the jobserver, so it no longer
+ writes distinct tokens to the pipe. Thus, we don't need to store
+ the token we get. A side effect of this is to remove a potential
+ "unavailable token" situation: make-1 invokes make-2 with its
+ special token and make-3 with a normal token; make-2 completes.
+ Now we're waiting for make-3 but using 2 tokens; our special token
+ is idle. In the new version we don't have special tokens per se,
+ we merely decide if we already have a child or not. If we don't,
+ we don't need a token. If we do, we have to get one to run the
+ next child. Similar for putting tokens back: if we're cleaning up
+ the last child, we don't put a token back. Otherwise, we do.
+
+ * main.c: Add a new, internal flag --jobserver-fds instead of
+ overloading the meaning of -j. Remove job_slots_str and add the
+ stringlist jobserver_fds.
+ (struct command_switch): We don't need the int_string type.
+ (switches[]): Add a new option for --jobserver-fds and remove
+ conditions around -j. Make the description for the former 0 so it
+ doesn't print during "make --help".
+ (main): Rework jobserver parsing. If we got --jobserver-fds
+ make sure it's valid. We only get one and job_slots must be 0.
+ If we're the toplevel make (-jN without --jobserver-fds) create
+ the pipe and write generic tokens.
+ Create the stringlist struct for the submakes.
+ Clean up the stringlist where necessary.
+ (init_switches): Remove int_string handling.
+ (print_usage): Don't print internal flags (description ptr is 0).
+ (decode_switches): Remove int_string handling.
+ (define_makeflags): Remove int_string handling.
+
+ * job.c: Remove my_job_token flag and all references to the
+ child->job_token field.
+ (free_job_token): Remove this and merge it into free_child().
+ (reap_children): Rework the "reaped a child" logic slightly.
+ Don't call defunct free_job_token anymore. Always call
+ free_child, even if we're dying.
+ (free_child): If we're not freeing the only child, put a token
+ back in the pipe. Then, if we're dying, don't bother to free.
+ (new_job): If we are using the jobserver, loop checking to see if
+ a) there are no children or b) we get a token from the pipe.
+
+ * job.h (struct child): Remove the job_token field.
+
+1999-08-20 Paul D. Smith <psmith@gnu.org>
+
+ * variable.c (try_variable_definition): Allocate for variable
+ expansion in f_append with a simple variable: if we're looking at
+ target-specific variables we don't want to trash the buffer.
+ Noticed by Reiner Beninga <Reiner.Beninga@mchp.siemens.de>.
+
+1999-08-16 Eli Zaretskii <eliz@is.elta.co.il>
+
+ * main.c (main) [__MSDOS__]: Mirror any backslashes in argv[0], to
+ avoid problems in shell commands that use backslashes as escape
+ characters.
+
+1999-08-16 Paul D. Smith <psmith@gnu.org>
+
+ * Version 3.77.93 released.
+
+1999-08-13 Paul D. Smith <psmith@gnu.org
+
+ * function.c (func_if): New function $(if ...) based on the
+ original by Han-Wen but reworked quite a bit.
+ (function_table): Add it.
+ * NEWS: Introduce it.
+ * make.texinfo (If Function): Document it.
+
+ * job.c (free_job_token): Check for EINTR when writing tokens to
+ the jobserver pipe.
+
+1999-08-12 Paul D. Smith <psmith@gnu.org>
+
+ Another jobserver algorithm change. We conveniently forgot that
+ the blocking bit is shared by all users of the pipe, it's not a
+ per-process setting. Since we have many make processes all
+ sharing the pipe we can't use the blocking bit as a signal handler
+ flag. Instead, we'll dup the pipe's read FD and have the SIGCHLD
+ handler close the dup'd FD. This will cause the read() to fail
+ with EBADF the next time we invoke it, so we know we need to reap
+ children. We then re-dup and reap.
+
+ * main.c (main): Define the job_rfd variable to hold the dup'd FD.
+ Actually dup the read side of the pipe. Don't bother setting the
+ blocking bit on the file descriptor.
+ * make.h: Declare the job_rfd variable.
+ * job.c (child_handler): If the dup'd jobserver pipe is open,
+ close it and assign -1 to job_rfd to notify the main program that
+ we got a SIGCHLD.
+ (start_job_command): Close the dup'd FD before exec'ing children.
+ Since we open and close this thing so often it doesn't seem
+ worth it to use the close-on-exec bit.
+ (new_job): Remove code for testing/setting the blocking bit.
+ Instead of EAGAIN, test for EBADF. If the dup'd FD has been
+ closed, re-dup it before we reap children.
+
+ * function.c (func_shell): Be a little more accurate about the
+ length of the error string to allocate.
+
+ * expand.c (variable_expand_for_file): If there's no filenm info
+ (say, from a builtin command) then reset reading_file to 0.
+
+1999-08-09 Paul D. Smith <psmith@gnu.org>
+
+ * maintMakefile: Use g in sed (s///g) to replace >1 variable per
+ line.
+
+ * Makefile.DOS.template [__MSDOS__]: Fix mostlyclean-aminfo to
+ remove the right files.
+
+1999-08-01 Eli Zaretskii <eliz@is.elta.co.il>
+
+ * function.c (msdos_openpipe) [__MSDOS__]: *Really* return a FILE
+ ptr.
+
+1999-08-01 Paul D. Smith <psmith@gnu.org>
+
+ New jobserver algorithm to avoid a possible hole where we could
+ miss SIGCHLDs and get into a deadlock. The original algorithm was
+ suggested by Roland McGrath with a nice refinement by Paul Eggert.
+ Many thanks as well to Tim Magill and Howard Chu, who also
+ provided many viable ideas and critiques. We all had a fun week
+ dreaming up interesting ways to use and abuse UNIX syscalls :).
+
+ Previously we could miss a SIGCHLD if it happened after we reaped
+ the children but before we re-entered the blocking read. If this
+ happened to all makes and/or all children, make would never wake
+ up.
+
+ We avoid this by having the SIGCHLD handler reset the blocking bit
+ on the jobserver pipe read FD (normally read does block in this
+ algorithm). Now if the handler is called between the time we reap
+ and the time we read(), and there are no tokens available, the
+ read will merely return with EAGAIN instead of blocking.
+
+ * main.c (main): Set the blocking bit explicitly here.
+ * job.c (child_handler): If we have a jobserver pipe, set the
+ non-blocking bit for it.
+ (start_waiting_job): Move the token stuff back to new_job; if we
+ do it here then we're not controlling the number of remote jobs
+ started!
+ (new_job): Move the check for job slots to _after_ we've created a
+ child structure. If the read returns without getting a token, set
+ the blocking bit then try to reap_children.
+
+ * make.h (EINTR_SET): Define to test errno if EINTR is available,
+ or 0 otherwise. Just some code cleanup.
+ * arscan.c (ar_member_touch): Use it.
+ * function.c (func_shell): Use it.
+ * job.c (reap_children): Use it.
+ * remake.c (touch_file): Use it.
+
+1999-07-28 Paul D. Smith <psmith@gnu.org>
+
+ * make.h: Define _() and N_() macros as passthrough to initiate
+ NLS support.
+ * <all>: Add _()/N_() around translatable strings.
+
+1999-07-27 Paul D. Smith <psmith@gnu.org>
+
+ * read.c: Make sure make.h comes before other headers.
+
+1999-07-26 Paul D. Smith <psmith@gnu.org>
+
+ * make.texinfo (Quick Reference): Update with the new features.
+
+1999-07-25 Eli Zaretskii <eliz@is.elta.co.il>
+
+ * remake.c [__MSDOS__]: Don't include variables.h, it's already
+ included.
+
+ * function.c (msdos_openpipe) [__MSDOS__]: Return FILE ptr.
+ (func_shell) [__MSDOS__]: Fix the argument list.
+
+ * Makefile.DOS.template: Update from Makefile.in.
+
+ * README.DOS.template: Configure command fixed.
+
+ * configh.dos.template: Update to provide definitions for
+ uintmax_t, fd_set_size_t, and HAVE_SELECT.
+
+1999-07-24 Paul D. Smith <psmith@gnu.org>
+
+ * Version 3.77.91 released.
+
+ * configure.in: Changes to the boostrapping code: if build.sh.in
+ doesn't exist configure spits an error and generates an empty
+ build.sh file which causes make to be confused.
+ * maintMakefile: Don't build README early.
+
+1999-07-23 Paul D. Smith <psmith@gnu.org>
+
+ * job.c (my_job_token): This variable controls whether we've
+ handed our personal token to a subprocess or not. Note we could
+ probably infer this from the value of job_slots_used, but it's
+ clearer to just keep it separately. Job_slots_used isn't really
+ relevant when running the job server.
+ (free_job_token): New function: free a job token. If we don't
+ have one, no-op. If we have the personal token, reclaim it. If
+ we have another token, write it back to the pipe.
+ (reap_children): Call free_job_token.
+ (free_child): Call free_job_token.
+ (start_job_command): Remove duplicate test for '+' in the command.
+ If we don't appear to be running a recursive make, close the
+ jobserver filedescriptors.
+ (start_waiting_job): If our personal token is available, use that
+ instead of going to the server pipe.
+ (*): Add the token value to many debugging statements, and print
+ the child target name in addition to the ptr hex value.
+ Change the default "no token" value from '\0' to '-' so it looks
+ better in the output.
+
+ * main.c (main): Install the child_handler with sigaction()
+ instead of signal() if we have it. On SysV systems, signal() uses
+ SysV semantics which are a pain. But sigaction() always does what
+ we want.
+ (main): If we got job server FDs from the environment, test them
+ to see if they're open. If not, the parent make closed them
+ because it didn't think we were a submake. Print a warning and
+ suggestion to use "+" on the submake invocation, and hard-set to
+ -j1 for this instance of make.
+ (main): Change the algorithm for assigning slots to be more
+ robust. Previously make checked to see if it thought a subprocess
+ was a submake and if so, didn't give it a token. Since make's
+ don't consume tokens we could spawn many of makes fighting for a
+ small number of tokens. Plus this is unreliable because submakes
+ might not be recognized by the parent (see above) then all the
+ tokens could be used up by unrecognized makes, and no one could
+ run. Now every make consumes a token from its parent. However,
+ the make can also use this token to spawn a child. If the make
+ wants more than one, it goes to the jobserver pipe. Thus there
+ will never be more than N makes running for -jN, and N*2 processes
+ (N makes and their N children). Every make can always run at
+ least one job, and we'll never deadlock. (Note the closing of the
+ pipe for non-submakes also solves this, but this is still a better
+ algorithm.) So! Only put N-1 tokens into the pipe, since the
+ topmost make keeps one for itself.
+
+ * configure.in: Find sigaction. Disable job server support unless
+ the system provides it, in addition to either waitpid() or
+ wait3().
+
+1999-07-22 Rob Tulloh <rob_tulloh@dev.tivoli.com>
+
+ * arscan.c (ar_member_touch) [WINDOWS32]: The ar_date field is a
+ string on Windows, not a timestamp.
+
+1999-07-21 Paul D. Smith <psmith@gnu.org>
+
+ * Version 3.77.90 released.
+
+ * Makefile.am (AUTOMAKE_OPTIONS): Require automake 1.4.
+
+ * function.c: Rearrange so we don't need to predeclare the
+ function_table array; K&R C compilers don't like that.
+
+ * acinclude.m4 (AC_FUNC_SELECT): Ouch; this requires an ANSI C
+ compiler! Change to work with K&R compilers as well.
+
+ * configure.in (AC_OUTPUT): Put build.sh back. I don't know how I
+ thought it would work this way :-/. We'll have to think of
+ something else.
+ * Makefile.am: Remove rule to create build.sh.
+
+ * default.c (default_suffix_rules): Rearrange the default command
+ lines to conform to POSIX rules (put the filename argument $<
+ _after_ the OUTPUT_OPTION, not before it).
+
+ * various: Changed !strncmp() calls to strneq() macros.
+
+ * misc.c (sindex): Make slightly more efficient.
+
+ * dir.c (file_impossible): Change savestring(X,strlen(X)) to xstrdup().
+ * implicit.c (pattern_search): Ditto.
+ * main.c (enter_command_line_file): Ditto.
+ (main): Ditto.
+ * misc.c (copy_dep_chain): Ditto.
+ * read.c (read_makefile): Ditto.
+ (parse_file_seq): Ditto.
+ (tilde_expand): Ditto.
+ (multi_glob): Ditto.
+ * rule.c (install_pattern_rule): Ditto.
+ * variable.c (define_variable_in_set): Ditto.
+ (define_automatic_variables): Ditto.
+ * vpath.c (construct_vpath_list): Ditto.
+
+ * misc.c (xrealloc): Some reallocs are non-standard: work around
+ them in xrealloc by calling malloc if PTR is NULL.
+ * main.c (main): Call xrealloc() directly instead of testing for
+ NULL.
+
+ * function.c (func_sort): Don't try to free NULL; some older,
+ non-standard versions of free() don't like it.
+
+ * configure.in (--enable-dmalloc): Install some support for using
+ dmalloc (http://www.dmalloc.com/) with make. Use --enable-dmalloc
+ with configure to enable it.
+
+ * function.c (function_table_entry): Whoops! The function.c
+ rewrite breaks backward compatibility: all text to a function is
+ broken into arguments, and extras are ignored. So $(sort a,b,c)
+ returns "a"! Etc. Ouch. Fix it by making a positive value in
+ the REQUIRED_ARGS field mean exactly that many arguments to the
+ function; any "extras" are considered part of the last argument as
+ before. A negative value means at least that many, but may be
+ more: in this case all text is broken on commas.
+ (handle_function): Stop when we've seen REQUIRED_ARGS args, if >0.
+ (expand_builtin_function): Compare number of args to the absolute
+ value of REQUIRED_ARGS.
+
+1999-07-20 Paul D. Smith <psmith@gnu.org>
+
+ * job.c (start_job_command): Ensure that the state of the target
+ is cs_running. It might not be if we skipped all the lines due to
+ -n (for example).
+
+ * commands.c (execute_file_commands): If we discover that the
+ command script is empty and succeed early, set cs_running so the
+ modtime of the target is still rechecked.
+
+ * rule.c (freerule): Free the dependency list for the rule.
+
+ * implicit.c (pattern_search): When turning an intermediate file
+ into a real target, keep the also_make list.
+ Free the dep->name if we didn't use it during enter_file().
+
+1999-07-16 Paul D. Smith <psmith@gnu.org>
+
+ * read.c (read_makefile): Don't allocate the commands buffer until
+ we're sure we found a makefile and won't return early (mem leak).
+
+ * job.c (start_job_command): Broken #ifdef test: look for F_SETFD,
+ not FD_SETFD. Close-on-exec isn't getting set on the bad_stdin
+ file descriptor and it's leaking :-/.
+ * getloadavg.c (getloadavg): Ditto.
+
+1999-07-15 Paul D. Smith <psmith@gnu.org>
+
+ * read.c (read_makefile): Fix some potential memory stomps parsing
+ `define' directives where no variable name is given.
+
+ * function.c (func_call): Rename from func_apply. Various code
+ cleanup and tightening.
+ (function_table): Add "call" as a valid builtin function.
+
+ * make.texinfo (Call Function): Document it.
+
+ * NEWS: Announce it.
+
+1999-07-09 Eli Zaretskii <eliz@is.elta.co.il>
+
+ * variable.c (try_variable_definition) [__MSDOS__, WINDOWS32]:
+ Treat "override SHELL=" the same as just "SHELL=".
+
+1999-07-09 Paul D. Smith <psmith@gnu.org>
+
+ * job.c (start_waiting_job): Don't get a second job token if we
+ already have one; if we're waiting on the load to go down
+ start_waiting_job() might get called twice on the same file.
+
+ * filedef.h (struct file): Add new field, mtime_before_update.
+ When notice_finished_file runs it assigns the cached last_mtime to
+ this field.
+ * remake.c (update_goal_chain): Notice that a file wasn't updated
+ by asking if it changed (g->changed) and comparing the current
+ cached time (last_mtime) with the previous one, stored in
+ mtime_before_update. The previous check ("did last_mtime changed
+ during the run of update_file?") fails for parallel builds because
+ last_mtime is set during reap_children, before update_file is run.
+ This causes update_goal_chain to always return -1 (nothing
+ rebuilt) when running parallel (-jN). This is OK during "normal"
+ builds since our caller (main) treats these cases identically in
+ that case, but if when rebuilding makefiles the difference is very
+ important, as it controls whether we re-exec or not.
+ * file.c (file_hash_enter): Copy the mtime_before_update field.
+ (snap_deps): Initialize mtime_before_update to -1.
+ * main.c (main): Initialize mtime_before_update on old (-o) and
+ new (-W) files.
+
+1999-07-08 Paul D. Smith <psmith@gnu.org>
+
+ * main.c (switches): Define a new switch -R (or
+ --no-builtin-variables). This option disables the defining of all
+ the GNU make builtin variables.
+ (main): If -R was given, force -r as well.
+ * default.c (define_default_variables): Test the new flag.
+ * make.h: Declare global flag.
+ * make.texinfo (Options Summary): Document the new option.
+ (Implicit Variables): Ditto.
+
+1999-07-06 Paul D. Smith <psmith@gnu.org>
+
+ * make.texinfo (Options Summary): Correct examples in
+ --print-data-base option summary (problem reported by David Morse
+ <morse@nichimen.com>).
+
+ * arscan.c: Add support for archives in Windows (VC++). Frank
+ Libbrecht <frankl@abzx.belgium.hp.com> provided info on how to do
+ this.
+ * NMakefile.template (CFLAGS_any): Remove NO_ARCHIVES from the
+ compile line.
+ * build_w32.bat: Ditto.
+
+ * remake.c (no_rule_error): Fix -include/sinclude so it doesn't
+ give errors if you try to -include the same file twice.
+ (updating_makefiles): New variable: we need to know this info in
+ no_rule_error() so we know whether to print an error or not.
+ (update_file_1): Unconditionally call no_rule_error(), don't try
+ to play games with the dontcare flag.
+
+1999-06-14 Paul D. Smith <psmith@gnu.org>
+
+ * make.texinfo (Remaking Makefiles): Add a description of how to
+ prevent implicit rule searches for makefiles.
+
+ * make.1: Remove statement that make continues processing when -v
+ is given.
+
+1999-06-14 Paul D. Smith <psmith@gnu.org>
+
+ * read.c (read_makefile): Cast -1 arguments to
+ variable_expand_string() to long. Alexandre Sauve
+ <Alexandre.SAUVE@ifp.fr> reports that without casts, this breaks
+ on a NEC SUPER-UX SX-4 system (and it's wrong without a cast
+ anyway). Of course, (a) I'd really love to start using function
+ prototypes, and (b) there's a whole slew of issues related to int
+ vs. long and signed vs. unsigned in the length handling of
+ variable buffers, etc. Gross. Needs a complete mucking-out.
+ * expand.c (variable_expand): Ditto.
+
+ * acinclude.m4 (AC_FUNC_SELECT): Slight enhancement for AIX 3.2 by
+ Lars Hecking <lhecking@nmrc.ucc.ie>.
+
+ * read.c (get_next_mword): Allow colons to be escaped in target
+ names: fix for regression failure.
+
+1999-04-26 Paul D. Smith <psmith@gnu.org>
+
+ * main.c (main): Reset read_makefiles to empty after processing so
+ we get the right error message.
+
+1999-04-25 Paul D. Smith <psmith@gnu.org>
+
+ * make.texinfo: Updates to @dircategory and @direntry suggested by
+ Karl Berry <karl@cs.umb.edu>.
+
+1999-04-23 Eli Zaretskii <eliz@is.elta.co.il>
+
+ * job.c (start_job_command) [__MSDOS__]: Call unblock_sigs before
+ turning off dos_command_running, so child's signals produce the
+ right effect.
+
+ * commands.c (fatal_error_signal) [__MSDOS__]: Use EXIT_FAILURE
+ instead of 1.
+
+1999-04-18 Eli Zaretskii <eliz@is.elta.co.il>
+
+ * configh.dos.template: Update to recognize that version 2.02 of
+ DJGPP contains sys_siglist stuff.
+
+1999-04-14 Paul D. Smith <psmith@gnu.org>
+
+ * make.texinfo (Options/Recursion): Document the job server.
+ (Parallel): Tweaks.
+
+1999-04-13 Paul D. Smith <psmith@gnu.org>
+
+ Implement a new "job server" feature; the implementation was
+ suggested by Howard Chu <hyc@highlandsun.com>.
+
+ * configure.in (job-server): New disable option for job server
+ support--it's enabled by default. If it works well this will go
+ away.
+
+ * NEWS: Summarize the new feature.
+
+ * acconfig.h: New definition MAKE_JOBSERVER if job server support
+ is enabled.
+ * config.h-vms.template: Undef MAKE_JOBSERVER for this port.
+ * config.h.W32.template: Ditto.
+ * config.ami.template: Ditto.
+
+ * main.c (struct command_switch): Add a new type: int_string.
+ (switches[]) Use int_string for -j if MAKE_JOBSERVER.
+ (init_switches): Initialize the new int_string switch type.
+ (print_usage): New function, extracted from decode_switches().
+ (decode_switches): Call it. Decode the new int_string switch type.
+ (define_makeflags): Add new int_string switch data to MAKEFLAGS.
+ (job_fds[]) Array to contain the pipe file descriptors.
+ (main): Parse the job_slots_str option results. If necessary,
+ create the pipe and seed it with tokens. Set the non-blocking bit
+ for the read fd. Enable the signal handler for SIGCHLD even if we
+ have a non-hanging wait; it's needed to interrupt the select() in
+ job.c:start_waiting_job().
+
+ * make.h: Declare job_fds[].
+
+ * job.h (struct child): Add job_token field to store the token for
+ this job (if any).
+
+ * job.c (reap_children): When a child is fully reaped, release the
+ token back into the pipe.
+ (free_child): If the child to be freed still has a token, put it
+ back.
+ (new_job): Initialize the job_token member.
+ (start_waiting_job): For local jobs, if we're using the pipe, get
+ a token before we check the load, etc. We do this by performing a
+ non-blocking read in a loop. If the read fails, no token is
+ available. Do a select on the fd to wait for a token. We need to
+ re-enable the signal handler for SIGCHLD even if we have a
+ non-hanging waitpid() or wait3(), so that the signal will
+ interrupt the select() and we can wake up to reap children.
+ (child_handler): Re-enable the signal handler. The count is still
+ kept although it's not needed or used unless you don't have
+ waitpid() or wait3().
+
+1999-04-10 Paul D. Smith <psmith@gnu.org>
+
+ * main.c (main): Reset the considered bit on all the makefiles if
+ something failed to update; we need to examine them again if they
+ appear as normal targets in order to get the proper error message.
+
+1999-04-09 Paul D. Smith <psmith@gnu.org>
+
+ Performance enhancement from Tim Magill <tim.magill@telops.gte.com>.
+
+ * remake.c (update_file): If you have large numbers of
+ dependencies and you run in parallel, make can spend considerable
+ time each pass through the graph looking at branches it has
+ already seen. Since we only reap_children() when starting a pass,
+ not in the middle, if a branch has been seen already in that pass
+ nothing interesting can happen until the next pass. So, we toggle
+ a bit saying whether we've seen this target in this pass or not.
+ (update_goal_chain): Initially set the global considered toggle to
+ 1, since all targets initialize their boolean to 0. At the end of
+ each pass, toggle the global considered variable.
+ * filedef.h (struct file): Per-file considered toggle bit.
+ * file.c: New global toggle variable considered.
+
+1999-04-05 Paul D. Smith <psmith@gnu.org>
+
+ * arscan.c (ar_scan): Added support for ARFZMAG (compressed
+ archives?) for Digital UNIX C++. Information provided by
+ Patrick E. Krogel <pekrogel@mtu.edu>.
+ (ar_member_touch): Ditto.
+
+1999-04-03 Paul D. Smith <psmith@gnu.org>
+
+ * remake.c (f_mtime): If: a) we found a file and b) we didn't
+ create it and c) it's not marked as an implicit target and d) it
+ is marked as an intermediate target, then it was so marked due to
+ an .INTERMEDIATE special target, but it already existed in the
+ directory. In this case, unset the intermediate flag so we won't
+ delete it when make is done. It feels like it would be cleaner to
+ put this check in update_file_1() but I worry it'll get missed...
+
+1999-04-01 Paul D. Smith <psmith@gnu.org>
+
+ * job.c (construct_command_argv_internal): Use bcopy() to copy
+ overlapping strings, rather than strcpy(). ISO C says the latter
+ is undefined. Found this in a bug report from 1996! Ouch!
+
+1999-03-31 Paul D. Smith <psmith@gnu.org>
+
+ * read.c (readline): Ignore carriage returns at the end of the
+ line, to allow Windows-y CRLF line terminators.
+
+1999-03-30 Paul D. Smith <psmith@gnu.org>
+
+ * configure.in: Don't put build.sh here, since build.sh.in doesn't
+ exist initially. This cause autoreconf and automake to fail when
+ run on a clean CVS checkout. Instead, we create build.sh in the
+ Makefile (see below).
+
+ * Makefile.am: Remove BUILT_SOURCES; this is no longer relevant.
+ Put those files directly into EXTRA_DIST so they're distributed.
+ Create a local build rule to create build.sh.
+ Create a local maintainer-clean rule to delete all the funky
+ maintainers files.
+
+ * maintMakefile: Makefile.in depends on README, since automake
+ fails if it doesn't exist. Also don't remove glob/Makefile.in
+ here, as it causes problems.
+
+1999-03-26 Paul D. Smith <psmith@gnu.org>
+
+ * configure.in: Substitute GLOBLIB if we need the link the
+ glob/libglob.a library.
+ * Makefile.am (make_LDADD): Use the subst variable GLOBLIB so we
+ don't link the local libglob.a at all if we don't need it.
+ * build.template: Don't compile glob/*.o unless we want globlib.
+ * maintMakefile (build.sh.in): Substitute the glob/*.o files
+ separately.
+
+1999-03-25 Paul D. Smith <psmith@gnu.org>
+
+ * make.texinfo: Various typos and additions, pointed out by James
+ G. Sack <jsack@dornfeld.com>.
+
+1999-03-22 Paul D. Smith <psmith@gnu.org>
+
+ * make.texinfo (Functions): Add a new section documenting the new
+ $(error ...) and $(warning ...) functions. Also updated copyright
+ dates.
+ * NEWS: Updated for the new functions.
+ * function.c (func_error): Implement the new $(error ...) and
+ $(warning ...) functions.
+ (function_table): Insert new functions into the table.
+ (func_firstword): Don't call find_next_token() with argv[0]
+ itself, since that function modifies the pointer.
+ * function.c: Cleanups and slight changes to the new method of
+ calling functions.
+
+1999-03-20 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+
+ * function.c: Rewrite to use one C function per make function,
+ instead of a huge switch statement. Also allows some cleanup of
+ multi-architecture issues, and a cleaner API which makes things
+ like func_apply() simple.
+
+ * function.c (func_apply): Initial implementation. Expand either
+ a builtin function or a make variable in the context of some
+ arguments, provided as $1, $2, ... $N.
+
+1999-03-19 Eli Zaretskii <eliz@is.elta.co.il>
+1999-03-19 Rob Tulloh <rob_tulloh@dev.tivoli.com>
+
+ * job.c (construct_command_argv_internal): Don't treat _all_
+ backslashes as escapes, only those which really escape a special
+ character. This allows most normal "\" directory separators to be
+ treated normally.
+
+1999-03-05 Paul D. Smith <psmith@gnu.org>
+
+ * configure.in: Check for a system strdup().
+ * misc.c (xstrdup): Created. Suggestion by Han-Wen Nienhuys
+ <hanwen@cs.uu.nl>.
+ * make.h: Prototype xstrdup().
+ * remake.c (library_search): Use it.
+ * main.c (main): Use it.
+ (find_and_set_default_shell): Use it.
+ * job.c (construct_command_argv_internal): Use it.
+ * dir.c (find_directory): Use it.
+
+ * Makefile.am, configure.in: Use AC_SUBST_FILE to insert the
+ maintMakefile instead of "include", to avoid automake 1.4
+ incompatibility.
+
+1999-03-04 Paul D. Smith <psmith@gnu.org>
+
+ * amiga.c, amiga.h, ar.c, arscan.c, commands.c, commands.h,
+ * default.c, dep.h, dir.c, expand.c, file.c, filedef.h, function.c,
+ * implicit.c, job.c, job.h, main.c, make.h, misc.c, read.c, remake.c
+ * remote-cstms.c, remote-stub.c, rule.h, variable.c, variable.h,
+ * vpath.c, Makefile.ami, NMakefile.template, build.template,
+ * makefile.vms: Updated FSF address in the copyright notice.
+
+ * variable.c (try_variable_definition): If we see a conditional
+ variable and we decide to set it, re-type it as recursive so it
+ will be expanded properly later.
+
+1999-02-22 Paul D. Smith <psmith@gnu.org>
+
+ * NEWS: Mention new .LIBPATTERNS feature.
+
+ * make.texinfo (Libraries/Search): Describe the use and
+ ramifications of the new .LIBPATTERNS variable.
+
+ * remake.c (library_search): Instead of searching only for the
+ hardcoded expansion "libX.a" for a library reference "-lX", we
+ obtain a list of patterns from the .LIBPATTERNS variable and
+ search those in order.
+
+ * default.c: Added a new default variable .LIBPATTERNS. The
+ default for UNIX is "lib%.so lib%.a". Amiga and DOS values are
+ also provided.
+
+ * read.c: Remove bogus HAVE_GLOB_H references; always include
+ vanilla glob.h.
+
+1999-02-21 Paul D. Smith <psmith@gnu.org>
+
+ * function.c (expand_function): Set value to 0 to avoid freeing it.
+ * variable.c (pop_variable_scope): Free the value of the variable.
+ (try_variable_definition): For simple variables, use
+ allocated_variable_expand() to avoid stomping on the variable
+ buffer when we still need it for other things.
+
+ * arscan.c: Modified to support AIX 4.3 big archives. The changes
+ are based on information provided by Phil Adams
+ <padams@austin.ibm.com>.
+
+1999-02-19 Paul D. Smith <psmith@gnu.org>
+
+ * configure.in: Check to see if the GNU glob library is already
+ installed on the system. If so, _don't_ add -I./glob to the
+ compile line. Using the system glob code with the local headers
+ is very bad mojo!
+ Rewrite SCCS macros to use more autoconf facilities.
+
+ * Makefile.am: Move -Iglob out of INCLUDES; it'll get added to
+ CPPFLAGS by configure now.
+ Automake 1.4 introduced its own "include" feature which conflicts
+ with the maintMakefile stuff. A hack that seems to work is add a
+ space before the include :-/.
+
+ * build.template: Move -Iglob out of the compile line; it'll get
+ added to CPPFLAGS by configure now.
+
+1999-02-16 Glenn D. Wolf <Glenn_Wolf@email.sps.mot.com>
+
+ * arscan.c (ar_scan) [VMS]: Initialized VMS_member_date before
+ calling lbr$get_index since if the archive is empty,
+ VMS_get_member_info won't get called at all, and any leftover date
+ will be used. This bug shows up if any member of any archive is
+ made, followed by a dependency check on a different, empty
+ archive.
+
+1998-12-13 Martin Zinser <zinser@decus.decus.de>
+
+ * config.h-vms [VMS]: Set _POSIX_C_SOURCE. Redefine the getopt
+ functions so we don't use the broken VMS versions.
+ * makefile.com [VMS]: Allow debugging.
+ * dir.c (dir_setup_glob) [VMS]: Don't extern stat() on VMS.
+
+1998-11-30 Paul D. Smith <psmith@gnu.org>
+
+ * signame.c (init_sig): Check the sizes of signals being set up to
+ avoid array overwrites (if the system headers have problems).
+
+1998-11-17 Paul D. Smith <psmith@gnu.org>
+
+ * read.c (record_files): Clean up some indentation.
+
+1998-11-08 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+
+ * rule.c (print_rule_data_base): Fix arguments to fatal() call.
+
+1998-10-13 Paul D. Smith <psmith@gnu.org>
+
+ * job.c (start_job_command): If the command list resolves to no
+ chars at all (e.g.: "foo:;$(empty)") then command_ptr is NULL;
+ quit early.
+
+1998-10-12 Andreas Schwab <schwab@issan.cs.uni-dortmund.de>
+
+ * rule.c (print_rule_data_base): Ignore num_pattern_rules if it is
+ zero.
+
+1998-10-09 Paul D. Smith <psmith@gnu.org>
+
+ * read.c (read_makefile): Allow non-empty lines to expand to the
+ empty string after variable, etc., expansion, and be ignored.
+
+1998-09-21 Paul D. Smith <psmith@gnu.org>
+
+ * job.c (construct_command_argv_internal): Only add COMMAND.COM
+ "@echo off" line for non-UNIXy shells.
+
+1998-09-09 Paul D. Smith <psmith@gnu.org>
+
+ * w32/subproc/sub_proc.c: Add in missing HAVE_MKS_SHELL tests.
+
+1998-09-04 Paul D. Smith <psmith@gnu.org>
+
+ * read.c (read_makefile): If we hit the "missing separator" error,
+ check for the common case of 8 spaces instead of a TAB and give an
+ extra comment to help people out.
+
+1998-08-29 Paul Eggert <eggert@twinsun.com>
+
+ * configure.in (AC_STRUCT_ST_MTIM_NSEC):
+ Renamed from AC_STRUCT_ST_MTIM.
+
+ * acinclude.m4 (AC_STRUCT_ST_MTIM_NSEC): Likewise.
+ Port to UnixWare 2.1.2 and pedantic Solaris 2.6.
+
+ * acconfig.h (ST_MTIM_NSEC):
+ Renamed from HAVE_ST_MTIM, with a new meaning.
+
+ * filedef.h (FILE_TIMESTAMP_FROM_S_AND_NS):
+ Use new ST_MTIM_NSEC macro.
+
+1998-08-26 Paul D. Smith <psmith@gnu.org>
+
+ * remake.c (check_dep): For any intermediate file, not just
+ secondary ones, try implicit and default rules if no explicit
+ rules are given. I'm not sure why this was restricted to
+ secondary rules in the first place.
+
+1998-08-24 Paul D. Smith <psmith@gnu.org>
+
+ * make.texinfo (Special Targets): Update documentation for
+ .INTERMEDIATE: if used with no dependencies, then it does nothing;
+ old docs said it marked all targets as intermediate, which it
+ didn't... and which would be silly :).
+
+ * implicit.c (pattern_search): If we find a dependency in our
+ internal tables, make sure it's not marked intermediate before
+ accepting it as a found_file[].
+
+1998-08-20 Paul D. Smith <psmith@gnu.org>
+
+ * ar.c (ar_glob): Use existing alpha_compare() with qsort.
+ (ar_glob_alphacompare): Remove it.
+
+ Modify Paul Eggert's patch so we don't abandon older systems:
+
+ * configure.in: Warn the user if neither waitpid() nor wait3() is
+ available.
+
+ * job.c (WAIT_NOHANG): Don't syntax error on ancient hosts.
+ (child_handler, dead_children): Define these if WAIT_NOHANG is not
+ available.
+ (reap_children): Only track the dead_children count if no
+ WAIT_NOHANG. Otherwise, it's a boolean.
+
+ * main.c (main): Add back signal handler if no WAIT_NOHANG is
+ available; only use default signal handler if it is.
+
+1998-08-20 Paul Eggert <eggert@twinsun.com>
+
+ Install a more robust signal handling mechanism for systems which
+ support it.
+
+ * job.c (WAIT_NOHANG): Define to a syntax error if our host
+ is truly ancient; this should never happen.
+ (child_handler, dead_children): Remove.
+ (reap_children): Don't try to keep separate track of how many
+ dead children we have, as this is too bug-prone.
+ Just ask the OS instead.
+ (vmsHandleChildTerm): Fix typo in error message; don't mention
+ child_handler.
+
+ * main.c (main): Make sure we're not ignoring SIGCHLD/SIGCLD;
+ do this early, before we could possibly create a subprocess.
+ Just use the default behavior; don't have our own handler.
+
+1998-08-18 Eli Zaretskii <eliz@is.elta.co.il>
+
+ * read.c (read_makefile) [__MSDOS__, WINDOWS32]: Add code to
+ recognize library archive members when dealing with drive spec
+ mess. Discovery and initial fix by George Racz <gracz@mincom.com>.
+
+1998-08-18 Paul D. Smith <psmith@gnu.org>
+
+ * configure.in: Check for stdlib.h explicitly (some hosts have it
+ but don't have STDC_HEADERS).
+ * make.h: Use HAVE_STDLIB_H. Clean up some #defines.
+ * config.ami: Re-compute based on new config.h.in contents.
+ * config.h-vms: Ditto.
+ * config.h.W32: Ditto.
+ * configh.dos: Ditto.
+
+ * dir.c (find_directory) [WINDOWS32]: Windows stat() fails if
+ directory names end with `\' so strip it.
+
+1998-08-17 Paul D. Smith <psmith@gnu.org>
+
+ * make.texinfo: Added copyright year to the printed copy. Removed
+ the price from the manual. Change the top-level reference to
+ running make to be "Invoking make" instead of "make Invocation",
+ to comply with GNU doc standards.
+
+ * make.h (__format__, __printf__): Added support for these in
+ __attribute__ macro.
+ (message, error, fatal): Use ... prototype form under __STDC__.
+ Add __format__ attributes for printf-style functions.
+
+ * configure.in (AC_FUNC_VPRINTF): Check for vprintf()/_doprnt().
+
+ * misc.c (message, error, fatal): Add preprocessor stuff to enable
+ creation of variable-argument functions with appropriate
+ prototypes, that works with ANSI, pre-ANSI, varargs.h, stdarg.h,
+ v*printf(), _doprnt(), or none of the above. Culled from GNU
+ fileutils and slightly modified.
+ (makefile_error, makefile_error): Removed (merged into error() and
+ fatal(), respectively).
+ * amiga.c: Use them.
+ * ar.c: Use them.
+ * arscan.c: Use them.
+ * commands.c: Use them.
+ * expand.c: Use them.
+ * file.c: Use them.
+ * function.c: Use them.
+ * job.c: Use them.
+ * main.c: Use them.
+ * misc.c: Use them.
+ * read.c: Use them.
+ * remake.c: Use them.
+ * remote-cstms.c: Use them.
+ * rule.c: Use them.
+ * variable.c: Use them.
+
+ * make.h (struct floc): New structure to store file location
+ information.
+ * commands.h (struct commands): Use it.
+ * variable.c (try_variable_definition): Use it.
+ * commands.c: Use it.
+ * default.c: Use it.
+ * file.c: Use it.
+ * function.c: Use it.
+ * misc.c: Use it.
+ * read.c: Use it.
+ * rule.c: Use it.
+
+1998-08-16 Paul Eggert <eggert@twinsun.com>
+
+ * filedef.h (FILE_TIMESTAMP_PRINT_LEN_BOUND): Add 10, for nanoseconds.
+
+1998-08-16 Paul Eggert <eggert@twinsun.com>
+
+ * filedef.h (FLOOR_LOG2_SECONDS_PER_YEAR): New macro.
+ (FILE_TIMESTAMP_PRINT_LEN_BOUND): Tighten bound, and try to
+ make it easier to understand.
+
+1998-08-14 Paul D. Smith <psmith@gnu.org>
+
+ * read.c (read_makefile): We've already unquoted any colon chars
+ by the time we're done reading the targets, so arrange for
+ parse_file_seq() on the target list to not do so again.
+
+1998-08-05 Paul D. Smith <psmith@gnu.org>
+
+ * configure.in: Added glob/configure.in data. We'll have the glob
+ code include the regular make config.h, rather than creating its
+ own.
+
+ * getloadavg.c (main): Change return type to int.
+
+1998-08-01 Paul Eggert <eggert@twinsun.com>
+
+ * job.c (reap_children): Ignore unknown children.
+
+1998-07-31 Paul D. Smith <psmith@gnu.org>
+
+ * make.h, filedef.h, dep.h, rule.h, commands.h, remake.c:
+ Add prototypes for functions. Some prototypes needed to be moved
+ in order to get #include order reasonable.
+
+1998-07-30 Paul D. Smith <psmith@gnu.org>
+
+ * make.h: Added MIN/MAX.
+ * filedef.h: Use them; remove FILE_TIMESTAMP_MIN.
+
+1998-07-30 Paul Eggert <eggert@twinsun.com>
+
+ Add support for sub-second timestamp resolution on hosts that
+ support it (just Solaris 2.6, so far).
+
+ * acconfig.h (HAVE_ST_MTIM, uintmax_t): New undefs.
+ * acinclude.m4 (jm_AC_HEADER_INTTYPES_H, AC_STRUCT_ST_MTIM,
+ jm_AC_TYPE_UINTMAX_T): New defuns.
+ * commands.c (delete_target): Convert file timestamp to
+ seconds before comparing to archive timestamp. Extract mod
+ time from struct stat using FILE_TIMESTAMP_STAT_MODTIME.
+ * configure.in (C_STRUCT_ST_MTIM, jm_AC_TYPE_UINTMAX_T): Add.
+ (AC_CHECK_LIB, AC_CHECK_FUNCS): Add clock_gettime.
+ * file.c (snap_deps): Use FILE_TIMESTAMP, not time_t.
+ (file_timestamp_now, file_timestamp_sprintf): New functions.
+ (print_file): Print file timestamps as FILE_TIMESTAMP, not
+ time_t.
+ * filedef.h: Include <inttypes.h> if available and if HAVE_ST_MTIM.
+ (FILE_TIMESTAMP, FILE_TIMESTAMP_STAT_MODTIME, FILE_TIMESTAMP_MIN,
+ FILE_TIMESTAMPS_PER_S, FILE_TIMESTAMP_FROM_S_AND_NS,
+ FILE_TIMESTAMP_DIV, FILE_TIMESTAMP_MOD, FILE_TIMESTAMP_S,
+ FILE_TIMESTAMP_NS, FILE_TIMESTAMP_PRINT_LEN_BOUND): New macros.
+ (file_timestamp_now, file_timestamp_sprintf): New decls.
+ (struct file.last_mtime, f_mtime, file_mtime_1, NEW_MTIME):
+ time_t -> FILE_TIMESTAMP.
+ * implicit.c (pattern_search): Likewise.
+ * vpath.c (vpath_search, selective_vpath_search): Likewise.
+ * main.c (main): Likewise.
+ * remake.c (check_dep, name_mtime, library_search, f_mtime): Likewise.
+ (f_mtime): Use file_timestamp_now instead of `time'.
+ Print file timestamp with file_timestamp_sprintf.
+ * vpath.c (selective_vpath_search): Extract file time stamp from
+ struct stat with FILE_TIMESTAMP_STAT_MODTIME.
+
+1998-07-28 Paul D. Smith <psmith@gnu.org>
+
+ * Version 3.77 released.
+
+ * dosbuild.bat: Change to DOS CRLF line terminators.
+
+ * make-stds.texi: Update from latest version.
+
+ * make.texinfo (Options Summary): Clarify that the -r option
+ affects only rules, not builtin variables.
+
+1998-07-27 Paul D. Smith <psmith@gnu.org>
+
+ * make.h: Make __attribute__ resolve to empty for non-GCC _and_
+ for GCC pre-2.5.x.
+
+ * misc.c (log_access): Print UID/GID's as unsigned long int for
+ maximum portability.
+
+ * job.c (reap_children): Print PIDs as long int for maximum
+ portability.
+
+1998-07-24 Eli Zaretskii <eliz@is.elta.co.il>
+
+ * Makefile.DOS (*_INSTALL, *_UNINSTALL): Replace `true' with `:'.
+
+1998-07-25 Paul D. Smith <psmith@gnu.org>
+
+ * Version 3.76.94 released.
+
+1998-07-23 Paul D. Smith <psmith@gnu.org>
+
+ * config.h.W32.template: Make sure all the #defines of macros here
+ have a value (e.g., use ``#define HAVE_STRING_H 1'' instead of
+ just ``#define HAVE_STRING_H''. Keeps the preprocessor happy in
+ some contexts.
+
+ * make.h: Remove __attribute__((format...)) stuff; using it with
+ un-prototyped functions causes older GCC's to fail.
+
+ * Version 3.76.93 released.
+
+1998-07-22 Paul D. Smith <psmith@gnu.org>
+
+ * file.c (print_file_data_base): Fix average calculation.
+
+1998-07-20 Paul D. Smith <psmith@gnu.org>
+
+ * main.c (die): Postpone the chdir() until after
+ remove_intermediates() so that intermediate targets with relative
+ pathnames are removed properly.
+
+1998-07-17 Paul D. Smith <psmith@gnu.org>
+
+ * filedef.h (struct file): New flag: did we print an error or not?
+
+ * remake.c (no_rule_error): New function to print error messages,
+ extraced from remake_file().
+
+ * remake.c (remake_file): Invoke the new error print function.
+ (update_file_1): Invoke the error print function if we see that we
+ already tried this target and it failed, but that an error wasn't
+ printed for it. This can happen if a file is included with
+ -include or sinclude and couldn't be built, then later is also
+ the dependency of another target. Without this change, make just
+ silently stops :-/.
+
+1998-07-16 Paul D. Smith <psmith@gnu.org>
+
+ * make.texinfo: Removed "beta" version designator.
+ Updated ISBN for the next printing.
+
+1998-07-13 Paul Eggert <eggert@twinsun.com>
+
+ * acinclude.m4: New AC_LFS macro to determine if special compiler
+ flags are needed to allow access to large files (e.g., Solaris 2.6).
+ * configure.in: Invoke it.
+
+1998-07-08 Eli Zaretskii <eliz@is.elta.co.il>
+
+ * Makefile.DOS: track changes in Makefile.in.
+
+1998-07-07 Paul D. Smith <psmith@gnu.org>
+
+ * remote-cstms.c (start_remote_job): Move gethostbyaddr() to the
+ top so host is initialized early enough.
+
+ * acinclude.m4: New file. Need some special autoconf macros to
+ check for network libraries (-lsocket, -lnsl, etc.) when
+ configuring Customs.
+
+ * configure.in (make_try_customs): Invoke new network libs macro.
+
+1998-07-06 Paul D. Smith <psmith@gnu.org>
+
+ * Version 3.76.92 released.
+
+ * README.customs: Added to the distribution.
+
+ * configure.in (make_try_customs): Rewrite to require an installed
+ Customs library, rather than looking at the build directory.
+
+ * Makefile.am (man_MANS): Install make.1.
+ * make.1: Renamed from make.man.
+
+ * make.texinfo (Bugs): New mailing list address for GNU make bug
+ reports.
+
+1998-07-02 Paul D. Smith <psmith@gnu.org>
+
+ * Version 3.76.91 released.
+
+ * default.c: Added default rule for new-style RCS master file
+ storage; ``% :: RCS/%''.
+ Added default rules for DOS-style C++ files with suffix ".cpp".
+ They use the new LINK.cpp and COMPILE.cpp macros, which are set by
+ default to be equal to LINK.cc and COMPILE.cc.
+
+1998-06-19 Eli Zaretskii <eliz@is.elta.co.il>
+
+ * job.c (start_job_command): Reset execute_by_shell after an empty
+ command was skipped.
+
+1998-06-09 Paul D. Smith <psmith@gnu.org>
+
+ * main.c (main): Keep track of the temporary filename created when
+ reading a makefile from stdin (-f-) and attempt to remove it
+ as soon as we know we're not going to re-exec. If we are, add it
+ to the exec'd make's cmd line with "-o" so the exec'd make doesn't
+ try to rebuild it. We still have a hole: if make re-execs then
+ the temporary file will never be removed. To fix this we'd need
+ a brand new option that meant "really delete this".
+ * AUTHORS, getopt.c, getopt1.c, getopt.h, main.c (print_version):
+ Updated mailing addresses.
+
+1998-06-08 Paul D. Smith <psmith@gnu.org>
+
+ * main.c (main): Andreas Luik <luik@isa.de> points out that the
+ check for makefile :: rules with commands but no dependencies
+ causing a loop terminates incorrectly.
+
+ * maintMakefile: Make a template for README.DOS to update version
+ numbers.
+
+1998-05-30 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
+
+ * remake.c (update_file_1): Don't free the memory for the
+ dependency structure when dropping a circular dependency.
+
+1998-05-30 Eli Zaretskii <eliz@is.elta.co.il>
+
+ * dir.c (file_exists_p, file_impossible_p, file_impossible)
+ [__MSDOS__, WINDOWS32]: Retain trailing slash in "d:/", and make
+ dirname of "d:foo" be "d:".
+
+1998-05-26 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
+
+ * read.c (read_makefile): Avoid running past EOS when scanning
+ file name after `include'.
+
+1998-05-26 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
+
+ * make.texinfo (Flavors): Correct description of conditional
+ assignment, which is not equivalent to ifndef.
+ (Setting): Likewise.
+
+1998-05-24 Paul D. Smith <psmith@gnu.org>
+
+ * arscan.c (ar_name_equal): strncmp() might be implemented as a
+ macro, so don't put preprocessor conditions inside the arguments
+ list.
+
+1998-05-23 Eli Zaretskii <eliz@is.elta.co.il>
+
+ * read.c (read_makefile) [__MSDOS__, WINDOWS32]: Skip colons in
+ drive specs when parsing targets, target-specific variables and
+ static pattern rules. A colon can only be part of drive spec if
+ it is after the first letter in a token.
+
+1998-05-22 Eli Zaretskii <eliz@is.elta.co.il>
+
+ * remake.c (f_mtime) [__MSDOS__]: Allow up to 3 sec of skew before
+ yelling bloody murder.
+
+ * dosbuild.bat: Use -DINCLUDEDIR= and -DLIBDIR= where appropriate.
+
+ * read.c (parse_file_seq): Combine the special file-handling code
+ for WINDOWS32 and __MSDOS__ into a single snippet.
+ (get_next_mword) [__MSDOS__, WINDOWS32]: Allow a word to include a
+ colon as part of a drive spec.
+
+ * job.c (batch_mode_shell) [__MSDOS__]: Declare.
+
+1998-05-20 Paul D. Smith <psmith@gnu.org>
+
+ * Version 3.76.90 released.
+
+1998-05-19 Paul D. Smith <psmith@gnu.org>
+
+ * make.texinfo (Make Errors): Added a new appendix describing
+ common errors make might generate and how to resolve them (or at
+ least more information on what they mean).
+
+ * maintMakefile (NMAKEFILES): Use the new automake 1.3 feature
+ to create a dependency file to construct Makefile.DOS, SMakefile,
+ and NMakefile.
+ (.dep_segment): Generate the dependency fragment file.
+
+1998-05-14 Paul D. Smith <psmith@gnu.org>
+
+ * make.man: Minor changes.
+
+1998-05-13 Paul D. Smith <psmith@gnu.org>
+
+ * function.c (pattern_matches,expand_function): Change variables
+ and types named "word" to something else, to avoid compilation
+ problems on Cray C90 Unicos.
+ * variable.h: Modify the function prototype.
+
+1998-05-11 Rob Tulloh <rob_tulloh@tivoli.com>
+
+ * job.c (construct_command_argv_internal) [WINDOWS32]: Turn off
+ echo when using a batch file, and make sure the command ends in a
+ newline.
+
+1998-05-03 Paul D. Smith <psmith@gnu.org>
+
+ * configure.in (make_try_customs): Add some customs flags if the
+ user configures custom support.
+
+ * job.c, remote-cstms.c: Merge in changes for custom library.
+
+ * remote-stub.c: Add option to stub start_remote_job_p().
+
+1998-05-01 Paul D. Smith <psmith@gnu.org>
+
+ * remake.c (f_mtime): Install VPATH+ handling for archives; use
+ the hname field instead of the name field, and rehash when
+ appropriate.
+
+1998-04-30 Paul D. Smith <psmith@gnu.org>
+
+ * rule.c (print_rule_data_base): Print out any pattern-specific
+ variable values into the rules database.
+
+ * variable.c (print_variable_set): Make this variable extern, to
+ be called by print_rule_data_base() for pattern-specific variables.
+
+ * make.texinfo (Pattern-specific): Document pattern-specific
+ variables.
+
+1998-04-29 Paul D. Smith <psmith@gnu.org>
+
+ * expand.c (variable_expand_for_file): Make static; its only
+ called internally. Look up this target in the list of
+ pattern-specific variables and insert the variable set into the
+ queue to be searched.
+
+ * filedef.h (struct file): Add a new field to hold the
+ previously-found pattern-specific variable reference. Add a new
+ flag to remember whether we already searched for this file.
+
+ * rule.h (struct pattern_var): New structure for storing
+ pattern-specific variable values. Define new function prototypes.
+
+ * rule.c: New variables pattern_vars and last_pattern_var for
+ storage and handling of pattern-specific variable values.
+ (create_pattern_var): Create a new pattern-specific variable value
+ structure.
+ (lookup_pattern_var): Try to match a target to one of the
+ pattern-specific variable values.
+
+1998-04-22 Paul D. Smith <psmith@gnu.org>
+
+ * make.texinfo (Target-specific): Document target-specific
+ variables.
+
+1998-04-21 Paul D. Smith <psmith@gnu.org>
+
+ * variable.c (define_variable_in_set): Made globally visible.
+ (lookup_variable_in_set): New function: like lookup_variable but
+ look only in a specific variable set.
+ (target_environment): Use lookup_variable_in_set() to get the
+ correct export rules for a target-specific variable.
+ (create_new_variable_set): Create a new variable set, and just
+ return it without installing it anywhere.
+ (push_new_variable_scope): Reimplement in terms of
+ create_new_variable_set.
+
+ * read.c (record_target_var): Like record_files, but instead of
+ files create a target-specific variable value for each of the
+ listed targets. Invoked from read_makefile() when the target line
+ turns out to be a target-specific variable assignment.
+
+1998-04-19 Paul D. Smith <psmith@gnu.org>
+
+ * read.c (read_makefile): Rewrite the entire target parsing
+ section to implement target-specific variables. In particular, we
+ cannot expand the entire line as soon as it's read in, since we
+ may want to evaluate parts of it with different variable contexts
+ active. Instead, start expanding from the beginning until we find
+ the `:' (or `::'), then determine what kind of line this is and
+ continue appropriately.
+
+ * read.c (get_next_mword): New function to parse a makefile line
+ by "words", considering an entire variable or function as one
+ word. Return the type read in, along with its starting position
+ and length.
+ (enum make_word_type): The types of words that are recognized by
+ get_next_mword().
+
+ * variable.h (struct variable): Add a flag to specify a per-target
+ variable.
+
+ * expand.c: Make variable_buffer global. We need this during the
+ new parsing of the makefile.
+ (variable_expand_string): New function. Like variable_expand(),
+ but start at a specific point in the buffer, not the beginning.
+ (variable_expand): Rewrite to simply call variable_expand_string().
+
+1998-04-13 Paul D. Smith <psmith@gnu.org>
+
+ * remake.c (update_goal_chain): Allow the rebuilding makefiles
+ step to use parallel jobs. Not sure why this was disabled:
+ hopefully we won't find out :-/.
+
+1998-04-11 Paul D. Smith <psmith@gnu.org>
+
+ * main.c (main): Set the CURDIR makefile variable.
+ * make.texinfo (Recursion): Document it.
+
+1998-03-17 Paul D. Smith <psmith@gnu.org>
+
+ * misc.c (makefile_fatal): If FILE is nil, invoke plain fatal().
+ * variable.c (try_variable_definition): Use new feature.
+
+1998-03-10 Paul D. Smith <psmith@gnu.org>
+
+ * main.c (main): Don't pass included, rebuilt makefiles to
+ re-exec'd makes with -o. Reopens a possible loop, but it caused
+ too many problems.
+
+1998-03-02 Paul D. Smith <psmith@gnu.org>
+
+ * variable.c (try_variable_definition): Implement ?=.
+ * make.texinfo (Setting): Document it.
+
+1998-02-28 Eli Zaretskii <eliz@is.elta.co.il>
+
+ * job.c (start_job_command): Reset execute_by_shell after an empty
+ command, like ":", has been seen.
+
+Tue Oct 07 15:00:00 1997 Phil Brooks <phillip_brooks@hp.com>
+
+ * make.h [WINDOWS32]: make case sensitivity configurable
+ * dir.c [WINDOWS32]: make case sensitivity configurable
+ * README.W32: Document case sensitivity
+ * config.ami: Share case warping code with Windows
+
+Mon Oct 6 18:48:45 CDT 1997 Rob Tulloh <rob_tulloh@dev.tivoli.com>
+
+ * w32/subproc/sub_proc.c: Added support for MKS toolkit shell
+ (turn on HAVE_MKS_SHELL).
+ * read.c [WINDOWS32]: Fixed a problem with multiple target rules
+ reported by Gilbert Catipon (gcatipon@tibco.com). If multiple
+ path tokens in a rule did not have drive letters, make would
+ incorrectly concatenate the 2 tokens together.
+ * main.c/variable.c [WINDOWS32]: changed SHELL detection code to
+ follow what MSDOS did. In addition to watching for SHELL variable
+ updates, make's main will attempt to default the value of SHELL
+ before and after makefiles are parsed.
+ * job.c/job.h [WINDOWS32]: The latest changes made to enable use
+ of the GNUWIN32 shell from make could cause make to fail due to a
+ concurrency condition between parent and child processes. Make
+ now creates a batch file per job instead of trying to reuse the
+ same singleton batch file.
+ * job.c/job.h/function.c/config.h.W32 [WINDOWS32]: Renamed macro
+ from HAVE_CYGNUS_GNUWIN32_TOOLS to BATCH_MODE_ONLY_SHELL. Reworked
+ logic to reduce complexity. WINDOWS32 now uses the unixy_shell
+ variable to detect Bourne-shell compatible environments. There is
+ also a batch_mode_shell variable that determines whether not
+ command lines should be executed via script files. A WINDOWS32
+ system with no sh.exe installed would have unixy_shell set to
+ FALSE and batch_mode_shell set to TRUE. If you have a unixy shell
+ that does not behave well when invoking things via 'sh -c xxx',
+ you may want to turn on BATCH_MODE_ONLY_SHELL and see if things
+ improve.
+ * NMakefile: Added /D DEBUG to debug build flags so that unhandled
+ exceptions could be debugged.
+
+Mon Oct 6 00:04:25 1997 Rob Tulloh <rob_tulloh@dev.tivoli.com>
+
+ * main.c [WINDOWS32]: The function define_variable() does not
+ handle NULL. Test before calling it to set Path.
+ * main.c [WINDOWS32]: Search Path again after makefiles have been
+ parsed to detect sh.exe.
+ * job.c [WINDOWS32]: Added support for Cygnus GNU WIN32 tools.
+ To use, turn on HAVE_CYGNUS_GNUWIN32_TOOLS in config.h.W32.
+ * config.h.W32: Added HAVE_CYGNUS_GNUWIN32_TOOLS macro.
+
+Sun Oct 5 22:43:59 1997 John W. Eaton <jwe@bevo.che.wisc.edu>
+
+ * glob/glob.c (glob_in_dir) [VMS]: Globbing shouldn't be
+ case-sensitive.
+ * job.c (child_execute_job) [VMS]: Use a VMS .com file if the
+ command contains a newline (e.g. from a define/enddef block).
+ * vmsify.c (vmsify): Return relative pathnames wherever possible.
+ * vmsify.c (vmsify): An input string like "../.." returns "[--]".
+
+Wed Oct 1 15:45:09 1997 Rob Tulloh <rob_tulloh@tivoli.com>
+
+ * NMakefile: Changed nmake to $(MAKE).
+ * subproc.bat: Take the make command name from the command
+ line. If no command name was given, default to nmake.
+ * job.c [MSDOS, WINDOWS32]: Fix memory stomp: temporary file names
+ are now always created in heap memory.
+ * w32/subproc/sub_proc.c: New implementation of make_command_line()
+ which is more compatible with different Bourne shell implementations.
+ Deleted the now obsolete fix_command_line() function.
+ * main.c [WINDOWS32]: Any arbitrary spelling of Path can be
+ detected. Make will ensure that the special spelling `Path' is
+ inserted into the environment when the path variable is propagated
+ within itself and to make's children.
+ * main.c [WINDOWS32]: Detection of sh.exe was occurring too
+ soon. The 2nd check for the existence of sh.exe must come after
+ the call to read_all_makefiles().
+
+Fri Sep 26 01:14:18 1997 <zinser@axp602.gsi.de>
+
+ * makefile.com [VMS]: Fixed definition of sys.
+ * readme.vms: Comments on what's changed lately.
+
+Fri Sep 26 01:14:18 1997 John W. Eaton <jwe@bevo.che.wisc.edu>
+
+ * read.c (read_all_makefiles): Allow make to find files named
+ "MAKEFILE" with no extension on VMS.
+ * file.c (lookup_file): Lowercase filenames on VMS.
+
+1997-09-29 Paul D. Smith <psmith@baynetworks.com>
+
+ * read.c (read_makefile): Reworked target detection again; the old
+ version had an obscure quirk.
+
+Fri Sep 19 09:20:49 1997 Paul D. Smith <psmith@baynetworks.com>
+
+ * Version 3.76.1 released.
+
+ * Makefile.am: Add loadavg files to clean rules.
+
+ * configure.in (AC_OUTPUT): Remove stamp-config; no longer needed.
+ * Makefile.ami (distclean): Ditto.
+ * SMakefile (distclean): Ditto.
+
+ * main.c (main): Arg count should be int, not char! Major braino.
+
+Tue Sep 16 10:18:22 1997 Paul D. Smith <psmith@baynetworks.com>
+
+ * Version 3.76 released.
+
+Tue Sep 2 10:07:39 1997 Paul D. Smith <psmith@baynetworks.com>
+
+ * function.c (expand_function): When processing $(shell...)
+ translate a CRLF (\r\n) sequence as well as a newline (\n) to a
+ space. Also remove an ending \r\n sequence.
+ * make.texinfo (Shell Function): Document it.
+
+Fri Aug 29 12:59:06 1997 Rob Tulloh <rob_tulloh@tivoli.com>
+
+ * w32/pathstuff.c (convert_Path_to_windows32): Fix problem where
+ paths which contain single character entries like `.' are not
+ handled correctly.
+
+ * README.W32: Document path handling issues on Windows systems.
+
+Fri Aug 29 02:01:27 1997 Paul D. Smith <psmith@baynetworks.com>
+
+ * Version 3.75.93.
+
+Thu Aug 28 19:39:06 1997 Rob Tulloh <rob_tulloh@tivoli.com>
+
+ * job.c (exec_command) [WINDOWS32]: If exec_command() is invoked
+ from main() to re-exec make, the call to execvp() would
+ incorrectly return control to parent shell before the exec'ed
+ command could run to completion. I believe this is a feature of
+ the way that execvp() is implemented on top of WINDOWS32 APIs. To
+ alleviate the problem, use the supplied process launch function in
+ the sub_proc library and suspend the parent process until the
+ child process has run. When the child exits, exit the parent make
+ with the exit code of the child make.
+
+Thu Aug 28 17:04:47 1997 Paul D. Smith <psmith@baynetworks.com>
+
+ * Makefile.DOS.template (distdir): Fix a line that got wrapped in
+ email.
+
+ * Makefile.am (loadavg): Give the necessary cmdline options when
+ linking loadavg.
+
+ * configure.in: Check for pstat_getdynamic for getloadvg on HP.
+
+ * job.c (start_job_command) [VMS, _AMIGA]: Don't perform empty
+ command optimization on these systems; it doesn't make sense.
+
+Wed Aug 27 17:09:32 1997 Paul D. Smith <psmith@baynetworks.com>
+
+ * Version 3.75.92
+
+Tue Aug 26 11:59:15 1997 Paul D. Smith <psmith@baynetworks.com>
+
+ * main.c (print_version): Add '97 to copyright years.
+
+ * read.c (do_define): Check the length of the array before looking
+ at a particular offset.
+
+ * job.c (construct_command_argv_internal): Examine the last byte
+ of the previous arg, not the byte after that.
+
+Sat Aug 23 1997 Eli Zaretskii <eliz@is.elta.co.il>
+
+ * Makefile.DOS.template: New file (converted to Makefile.DOS in
+ the distribution).
+
+ * configure.bat: Rewrite to use Makefile.DOS instead of editing
+ Makefile.in. Add support for building from outside of the source
+ directory. Fail if the environment block is too small.
+
+ * configh.dos: Use <sys/config.h>.
+
+ * README.DOS: Update instructions.
+
+Fri Aug 22 1997 Eli Zaretskii <eliz@is.elta.co.il>
+
+ * job.c (start_job_command) [__MSDOS__]: Don't test for "/bin/sh"
+ literally, use value of unixy_shell instead.
+
+ * filedef.h (NEW_MTIME): Use 1 less than maximum possible value if
+ time_t is unsigned.
+
+Sat Aug 16 00:56:15 1997 John W. Eaton <jwe@bevo.che.wisc.edu>
+
+ * vmsify.c (vmsify, case 11): After translating `..' elements, set
+ nstate to N_OPEN if there are still more elements to process.
+ (vmsify, case 2): After translating `foo/bar' up to the slash,
+ set nstate to N_OPEN, not N_DOT.
+
+Fri Aug 8 15:18:09 1997 John W. Eaton <jwe@bevo.che.wisc.edu>
+
+ * dir.c (vmsstat_dir): Leave name unmodified on exit.
+ * make.h (PATH_SEPARATOR_CHAR): Set to comma for VMS.
+ * vpath.c: Fix comments to refer to path separator, not colon.
+ (selective_vpath_search): Avoid Unixy slash handling for VMS.
+
+Thu Aug 7 22:24:03 1997 John W. Eaton <jwe@bevo.che.wisc.edu>
+
+ * ar.c [VMS]: Don't declare ar_member_touch.
+ Delete VMS version of ar_member_date.
+ Enable non-VMS versions of ar_member_date and ar_member_date_1 for
+ VMS too.
+ * arscan.c (VMS_get_member_info): New function.
+ (ar_scan): Provide version for VMS systems.
+ (ar_name_equal): Simply compare name and mem on VMS systems.
+ Don't define ar_member_pos or ar_member_touch on VMS systems.
+
+ * config.h-vms (pid_t, uid_t): Don't define.
+
+ * remake.c: Delete declaration of vms_stat.
+ (name_mtime): Don't call vms_stat.
+ (f_mtime) [VMS]: Funky time value manipulation no longer necessary.
+
+ * file.c (print_file): [VMS] Use ctime, not cvt_time.
+
+ * make.h [VMS]: Don't define POSIX.
+
+ * makefile.com (filelist): Include ar and arscan.
+ Also include them in the link commands.
+ Don't define NO_ARCHIVES in cc command.
+
+ * makefile.vms (ARCHIVES, ARCHIVES_SRC): Uncomment.
+ (defines): Delete NO_ARCHIVES from list.
+
+ * remake.c (f_mtime): Only check to see if intermediate file is
+ out of date if it also exists (i.e., mtime != (time_t) -1).
+
+ * vmsdir.h (u_long, u_short): Skip typedefs if using DEC C.
+
+Fri Jun 20 23:02:07 1997 Rob Tulloh <rob_tulloh@tivoli.com>
+
+ * w32/subproc/sub_proc.c: Get W32 sub_proc to handle shebang
+ (#!/bin/sh) in script files correctly.
+ Fixed a couple of memory leaks.
+ Fixed search order in find_file() (w32/subproc/sub_proc.c) so that
+ files with extensions are preferred over files without extensions.
+ Added search for files with .cmd extension too.
+ * w32/subproc/misc.c (arr2envblk): Fixed memory leak.
+
+Mon Aug 18 09:41:08 1997 Paul D. Smith <psmith@baynetworks.com>
+
+ * Version 3.75.91
+
+Fri Aug 15 13:50:54 1997 Paul D. Smith <psmith@baynetworks.com>
+
+ * read.c (do_define): Remember to count the newline after the endef.
+
+Thu Aug 14 23:14:37 1997 Paul D. Smith <psmith@baynetworks.com>
+
+ * many: Rewrote builds to use Automake 1.2.
+
+ * AUTHORS: New file.
+ * maintMakefile: Contains maintainer-only make snippets.
+ * GNUmakefile: This now only runs the initial auto* tools.
+ * COPYING,texinfo.tex,mkinstalldirs,install-sh: Removed (obtained
+ automatically by automake).
+ * compatMakefile: Removed (not needed anymore).
+ * README,build.sh.in: Removed (built from templates).
+ * config.h.in,Makefile.in: Removed (built by tools).
+
+Wed Aug 13 02:22:08 1997 Paul D. Smith <psmith@baynetworks.com>
+
+ * make.texinfo: Updates for DOS/Windows information (Eli Zaretskii)
+ * README,README.DOS: Ditto.
+
+ * remake.c (update_file_1,f_mtime): Fix GPATH handling.
+ * vpath.c (gpath_search): Ditto.
+
+ * file.c (rename_file): New function: rehash, but also rename to
+ the hashname.
+ * filedef.h: Declare it.
+
+ * variable.c (merge_variable_set_lists): Remove free() of variable
+ set; since various files can share variable sets we don't want to
+ free them here.
+
+Tue Aug 12 10:51:54 1997 Paul D. Smith <psmith@baynetworks.com>
+
+ * configure.in: Require autoconf 2.12
+
+ * make.texinfo: Replace all "cd subdir; $(MAKE)" examples with a
+ more stylistically correct "cd subdir && $(MAKE)".
+
+ * main.c: Global variable `clock_skew_detected' defined.
+ (main): Print final warning if it's set.
+ * make.h: Declare it.
+ * remake.c (f_mtime): Test and set it.
+
+ * job.c (start_job_command): Add special optimizations for
+ "do-nothing" rules, containing just the shell no-op ":". This is
+ useful for timestamp files and can make a real difference if you
+ have a lot of them (requested by Fergus Henderson <fjh@cs.mu.oz.au>).
+
+ * configure.in,Makefile.in: Rewrote to use the new autoconf
+ program_transform_name macro.
+
+ * function.c (function_strip): Strip newlines as well as spaces
+ and TABs.
+
+Fri Jun 6 23:41:04 1997 Rob Tulloh <rob_tulloh@tivoli.com>
+
+ * remake.c (f_mtime): Datestamps on FAT-based files are rounded to
+ even seconds when stored, so if the date check fails on WINDOWS32
+ systems, see if this "off-by-one" error is the problem.
+
+ * General: If your TZ environment variable is not set correctly
+ then all your timestamps will be off by hours. So, set it!
+
+Mon Apr 7 02:06:22 1997 Paul D. Smith <psmith@baynetworks.com>
+
+ * Version 3.75.1
+
+ * compatMakefile (objs): Define & use the $(GLOB) variable so
+ that it's removed correctly from build.sh.in when it's built.
+
+ * configure.in: On Solaris we can use the kstat_*() functions to
+ get load averages without needing special permissions. Add a
+ check for -lkstat to see if we have it.
+
+ * getloadavg.c (getloadavg): Use HAVE_LIBKSTAT instead of SUN5 as
+ the test to enable kstat_open(), etc. processing.
+
+Fri Apr 4 20:21:18 1997 Eli Zaretskii <eliz@is.elta.co.il>
+
+ * <lots>: Fixes to work in the DJGPP DOS environment.
+
+Mon Mar 31 02:42:52 1997 Paul D. Smith <psmith@baynetworks.com>
+
+ * function.c (expand_function): Added new function $(wordlist).
+
+ * make.texinfo (Filename Functions): Document $(wordlist) function.
+
+ * vpath.c (build_vpath_lists): Construct the GPATH variable
+ information in the same manner we used to construct VPATH.
+ (gpath_search): New function to search GPATH.
+
+ * make.h: Declare the new function.
+
+ * remake.c (update_file_1): Call it, and keep VPATH if it's found.
+
+ * make.texinfo (Search Algorithm): Document GPATH variable.
+
+Sun Mar 30 20:57:16 1997 Paul D. Smith <psmith@baynetworks.com>
+
+ * main.c (handle_non_switch_argument): Defined the MAKECMDGOALS
+ variable to contain the user options passed in on the cmd line.
+
+ * make.texinfo (Goals): Document MAKECMDGOALS variable.
+
+ * remake.c (f_mtime): Print a warning if we detect a clock skew
+ error, rather than failing.
+
+ * main.c (main): If we rebuild any makefiles and need to re-exec,
+ add "-o<mkfile>" options for each makefile rebuilt to avoid
+ infinite looping.
+
+Fri Mar 28 15:26:05 1997 Paul D. Smith <psmith@baynetworks.com>
+
+ * job.c (construct_command_argv_internal): Track whether the last
+ arg in the cmd string was empty or not (Roland).
+ (construct_command_argv_internal): If the shell line is empty,
+ don't do anything (Roland).
+
+ * glob/glob.h,glob/glob.c,glob/fnmatch.c,glob/fnmatch.h: Install
+ the latest changes from the GLIBC version of glob (Ulrich Drepper).
+
+ * getloadavg.c,make-stds.texi: New version (Roland).
+
+ * (ALL): Changed WIN32 to W32 or WINDOWS32 (RMS).
+
+Mon Mar 24 15:33:34 1997 Rob Tulloh <rob_tulloh@tivoli.com>
+
+ * README.W32: Describe preliminary FAT support.
+
+ * build_w32.bat: Use a variable for the final exe name.
+
+ * dir.c (find_directory): W32: Find the filesystem type.
+ (dir_contents_file_exists_p): W32: for FAT filesystems, always
+ rehash since FAT doesn't change directory mtime on change.
+
+ * main.c (handle_runtime_exceptions): W32: Add an
+ UnhandledExceptionFilter so that when make bombs due to ^C or a
+ bug, it won't cause a GUI requestor to pop up unless debug is
+ turned on.
+ (main): Call it.
+
+Mon Mar 24 00:57:34 1997 Paul D. Smith <psmith@baynetworks.com>
+
+ * configure.in, config.h.in, config.ami, config.h-vms, config.h.w32:
+ Check for memmove() function.
+
+ * make.h (bcopy): If memmove() available, define bcopy() to use it.
+ Otherwise just use bcopy(). Don't use memcpy(); it's not guaranteed
+ to handle overlapping moves.
+
+ * read.c (read_makefile): Fix some uninitialized memory reads
+ (reported by Purify).
+
+ * job.c (construct_command_argv_internal): Use bcopy() not
+ strcpy(); strcpy() isn't guaranteed to handle overlapping moves.
+
+ * Makefile.in: Change install-info option ``--infodir'' to
+ ``--info-dir'' for use with new texinfo.
+
+ * function.c (expand_function): $(basename) and $(suffix) should
+ only search for suffixes as far back as the last directory (e.g.,
+ only the final filename in the path).
+
+Sun Mar 23 00:13:05 1997 Paul D. Smith <psmith@baynetworks.com>
+
+ * make.texinfo: Add @dircategory/@direntry information.
+ (Top): Remove previous reference to (dir) (from RMS).
+ (Static Usage): Add "all:" rule to example.
+ (Automatic Dependencies): fix .d file creation example.
+
+ * Install VPATH+ patch:
+
+ * filedef.h (struct file): Add in hname field to store the hashed
+ filename, and a flag to remember if we're using the vpath filename
+ or not. Renamed a few functions for more clarity.
+
+ * file.c (lookup_file,enter_file,file_hash_enter): Store filenames
+ in the hash table based on their "hash name". We can change this
+ while keeping the original target in "name".
+ (rehash_file): Renamed from "rename_file" to be more accurate.
+ Changes the hash name, but not the target name.
+
+ * remake.c (update_file_1): Modify -d output for more detailed
+ VPATH info. If we don't need to rebuild, use the VPATH name.
+ (f_mtime): Don't search for vpath if we're ignoring it. Call
+ renamed function rehash_file. Call name_mtime instead of
+ file_mtime, to avoid infinite recursion since the file wasn't
+ actually renamed.
+
+ * implicit.c (pattern_search): if we find an implicit file in
+ VPATH, save the original name not the VPATH name.
+
+ * make.texinfo (Directory Search): Add a section on the new VPATH
+ functionality.
+
+Sun Dec 1 18:36:04 1996 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
+
+ * dir.c (file_exists_p, file_impossible, file_impossible_p): If
+ dirname is empty replace it by the name of the root directory.
+ Note that this doesn't work (yet) for W32, Amiga, or VMS.
+
+Tue Oct 08 13:57:03 1996 Rob Tulloh <tulloh@tivoli.com>
+
+ * main.c (main): W32 bug fix for PATH vars.
+
+Tue Sep 17 1996 Paul Eggert <eggert@twinsun.com>
+
+ * filedef.h (NEW_MTIME): Don't assume that time_t is a signed
+ 32-bit quantity.
+
+ * make.h: (CHAR_BIT, INTEGER_TYPE_SIGNED, INTEGER_TYPE_MAXIMUM,
+ INTEGER_TYPE_MINIMUM): New macros.
+
+Tue Aug 27 01:06:34 1996 Roland McGrath <roland@baalperazim.frob.com>
+
+ * Version 3.75 released.
+
+ * main.c (print_version): Print out bug-reporting address.
+
+Mon Aug 26 19:55:47 1996 Roland McGrath <roland@baalperazim.frob.com>
+
+ * main.c (print_data_base): Don't declare ctime; headers do it for us
+ already.
+
+Sun Jul 28 15:37:09 1996 Rob Tulloh (tulloh@tivoli.com)
+
+ * w32/pathstuff.c: Turned convert_vpath_to_w32() into a
+ real function. This was done so that VPATH could contain
+ white space separated pathnames. Please note that directory
+ paths (in VPATH/vpath context) containing white space are not
+ supported (just as they are not under Unix). See README.W32
+ for suggestions.
+
+ * w32/include/pathstuff.h: Added prototype for the new
+ function convert_vpath_to_w32. Deleted macro for same.
+
+ * README.W32: Added some notes about why I chose not to try
+ and support pathnames which contain white space and some
+ workaround suggestions.
+
+Thu Jul 25 19:53:31 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
+
+ * GNUmakefile (mkdep-nolib): Use -MM option unconditionally.
+
+ * Version 3.74.7.
+
+ * main.c (define_makeflags): Back up P to point at null terminator
+ when killing final space and dash before setting MFLAGS.
+
+ From Robert Hoehne <robert.hoehne@Mathematik.TU-Chemnitz.DE>:
+ * dir.c [__MSDOS__ && DJGPP > 1]: Include <libc/dosio.h> and defin
+ `__opendir_flags' initialized to 0.
+ (dosify) [__MSDOS__ && DJGPP > 1]: Return name unchanged if _USE_LFN.
+ (find_directory) [__MSDOS__ && DJGPP > 1]: If _USE_LGN, set
+ __opendir_flags to __OPENDIR_PRESERVE_CASE.
+
+ * vmsfunctions.c (vms_stat): `sys$dassgn (DevChan);' added by kkaempf.
+
+ * GNUmakefile (w32files): Add NMakefile.
+
+ * NMakefile (LDFLAGS_debug): Value fixed by tulloh.
+
+Sat Jul 20 12:32:10 1996 Klaus Kämpf (kkaempf@progis.de)
+
+ * remake.c (f_mtime) [VMS]: Add missing `if' conditional for future
+ modtime check.
+ * config.h-vms, makefile.vms, readme.vms, vmsify.c: Update address.
+
+Sat Jul 20 05:29:43 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
+
+ * configure.in: Require autoconf 2.10 or later.
+
+Fri Jul 19 16:57:27 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
+
+ * Version 3.74.6.
+
+ * GNUmakefile (w32files): New variable.
+ (distfiles): Add it.
+ * w32: Updated by Rob Tulloh.
+
+ * makefile.vms (LOADLIBES): Fix typo.
+
+Sun Jul 14 12:59:27 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
+
+ * job.c (construct_command_argv_internal): Fix up #else, #endifs.
+
+ * configh.dos: Define HAVE_DIRENT_H instead of DIRENT.
+
+ * remake.c (f_mtime): Don't compare MTIME to NOW if MTIME == -1.
+
+ * Version 3.74.5.
+
+ * main.c (main): Exit with status 2 when update_goal_chain returns 2.
+
+Sat Jun 22 14:56:05 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
+
+ * configure.in: Don't check for _sys_siglist.
+ * make.h [HAVE__SYS_SIGLIST]: Don't test this; just punt if there is
+ no strsignal or sys_siglist.
+
+ * read.c (conditional_line): Strip ws in `ifeq (a , b)' so it is the
+ same as `ifeq (a, b)'.
+
+ * job.c (reap_children): Don't call die if handling_fatal_signal.
+
+ * file.c (file_hash_enter): Allow renaming :: to : when latter is
+ non-target, or : to :: when former is non-target.
+
+ * job.c (start_job_command): Call block_sigs.
+ (block_sigs): New function, broken out of start_job_command.
+ (reap_children): Block fatal signals around removing dead child from
+ chain and adjusting job_slots_used.
+ * job.h: Declare block_sigs.
+
+ * remote-stub.c (remote_setup, remote_cleanup): New (empty) functions.
+ * main.c (main): Call remote_setup.
+ (die): Call remote_cleanup.
+
+ * job.c (reap_children): Quiescent value of shell_function_pid is
+ zero, not -1.
+
+ * main.c (print_version): Add 96 to copyright years.
+
+Sat Jun 15 20:30:01 1996 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
+
+ * read.c (find_char_unquote): Avoid calling strlen on every call
+ just to throw away the value most of the time.
+
+Sun Jun 2 12:24:01 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
+
+ * main.c (decode_env_switches): Prepend '-' to ARGV[1] if it contains
+ no '=', regardless of ARGC.
+ (define_makeflags): Elide leading '-' from MAKEFLAGS value if first
+ word is short option, regardless of WORDS.
+
+Wed May 22 17:24:51 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
+
+ * makefile.vms: Set LOADLIBES.
+ * makefile.com (link_using_library): Fix typo.
+
+Wed May 15 17:37:26 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
+
+ * dir.c (print_dir_data_base): Use %ld dev and ino and cast them to
+ long.
+
+Wed May 15 10:14:14 CDT 1996 Rob Tulloh <tulloh@tivoli.com>
+
+ * dir.c: W32 does not support inode. For now, fully qualified
+ pathname along with st_mtime will be keys for files.
+ Fixed problem where vpath can be confused when files
+ are added to a directory after the directory has already been
+ read in. The code now attempts to reread the directory if it
+ discovers that the datestamp on the directory has changed since
+ it was cached by make. This problem only seems to occur on W32
+ right now so it is lumped under port #ifdef WINDOWS32.
+
+ * function.c: W32: call subproc library (CreateProcess()) instead of
+ fork/exec.
+
+ * job.c: W32: Added the code to do fork/exec/waitpid style processing
+ on W32 systems via calls to subproc library.
+
+ * main.c: W32: Several things added here. First, there is code
+ for dealing with PATH and SHELL defaults. Make tries to figure
+ out if the user has %PATH% set in the environment and sets it to
+ %Path% if it is not set already. Make also looks to see if sh.exe
+ is anywhere to be found. Code path through job.c will change
+ based on existence of a working Bourne shell. The checking for
+ default shell is done twice: once before makefiles are read in
+ and again after. Fall back to MSDOS style execution mode if no sh.exe
+ is found. Also added some debug support that allows user to pause make
+ with -D switch and attach a debugger. This is especially useful for
+ debugging recursive calls to make where problems appear only in the
+ sub-make.
+
+ * make.h: W32: A few macros and header files for W32 support.
+
+ * misc.c: W32: Added a function end_of_token_w32() to assist
+ in parsing code in read.c.
+
+ * read.c: W32: Fixes similar to MSDOS which allow colon to
+ appear in filenames. Use of colon in filenames would otherwise
+ confuse make.
+
+ * remake.c: W32: Added include of io.h to eliminate compiler
+ warnings. Added some code to default LIBDIR if it is not set
+ on W32.
+
+ * variable.c: W32: Added support for detecting Path/PATH
+ and converting them to semicolon separated lists for make's
+ internal use. New function sync_Path_environment()
+ which is called in job.c and function.c before creating a new
+ process. Caller must set Path in environment since we don't
+ have fork() to do this for us.
+
+ * vpath.c: W32: Added detection for filenames containing
+ forward or backward slashes.
+
+ * NMakefile: W32: Visual C compatible makefile for use with nmake.
+ Use this to build GNU make the first time on Windows NT or Windows 95.
+
+ * README.W32: W32: Contains some helpful notes.
+
+ * build_w32.bat: W32: If you don't like nmake, use this the first
+ time you build GNU make on Windows NT or Windows 95.
+
+ * config.h.W32: W32 version of config.h
+
+ * subproc.bat: W32: A bat file used to build the
+ subproc library from the top-level NMakefile. Needed because
+ WIndows 95 (nmake) doesn't allow you to cd in a make rule.
+
+ * w32/include/dirent.h
+ * w32/compat/dirent.c: W32: opendir, readdir, closedir, etc.
+
+ * w32/include/pathstuff.h: W32: used by files needed functions
+ defined in pathstuff.c (prototypes).
+
+ * w32/include/sub_proc.h: W32: prototypes for subproc.lib functions.
+
+ * w32/include/w32err.h: W32: prototypes for w32err.c.
+
+ * w32/pathstuff.c: W32: File and Path/Path conversion functions.
+
+ * w32/subproc/build.bat: W32: build script for subproc library
+ if you don't wish to use nmake.
+
+ * w32/subproc/NMakefile: W32: Visual C compatible makefile for use
+ with nmake. Used to build subproc library.
+
+ * w32/subproc/misc.c: W32: subproc library support code
+ * w32/subproc/proc.h: W32: subproc library support code
+ * w32/subproc/sub_proc.c: W32: subproc library source code
+ * w32/subproc/w32err.c: W32: subproc library support code
+
+Mon May 13 14:37:42 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
+
+ * Version 3.74.4.
+
+ * GNUmakefile (vmsfiles): Fix typo.
+
+ * GNUmakefile (amigafiles): Add amiga.h.
+
+Sun May 12 19:19:43 1996 Aaron Digulla <digulla@fh-konstanz.de>
+
+ * dir.c: New function: amigafy() to fold filenames
+ Changes HASH() to HASHI() to fold filenames on Amiga.
+ Stringcompares use strieq() instead of streq()
+ The current directory on Amiga is "" instead of "."
+ * file.c: Likewise.
+
+ * amiga.c: New function wildcard_expansion(). Allows to use
+ Amiga wildcards with $(wildcard )
+
+ * amiga.h: New file. Prototypes for amiga.c
+
+ * function.c: Use special function wildcard_expansion() for
+ $(wildcard ) to allow Amiga wildcards
+ The current directory on Amiga is "" instead of "."
+
+ * job.c: No Pipes on Amiga, too
+ (load_too_high) Neither on Amiga
+ ENV variable on Amiga are in a special directory and are not
+ passed as third argument to main().
+
+ * job.h: No envp on Amiga
+
+ * make.h: Added HASHI(). This is the same as HASH() but converts
+ it's second parameter to lowercase on Amiga to fold filenames.
+
+ * main.c: (main), variable.c Changed handling of ENV-vars. Make
+ stores now the names of the variables only and reads their contents
+ when they are accessed to reflect that these variables are really
+ global (i.e., they CAN change WHILE make runs !) This handling is
+ made in lookup_variable()
+
+ * Makefile.ami: renamed file.h to filedep.h
+ Updated dependencies
+
+ * read.c: "find_semicolon" is declared as static but never defined.
+ No difference between Makefile and makefile on Amiga; added
+ SMakefile to *default_makefiles[].
+ (read_makefile) SAS/C want's two_colon and pattern_percent be set
+ before use.
+ The current directory on Amiga is "" instead of "."
+ Strange #endif moved.
+
+ * README.Amiga: updated feature list
+
+ * SMakefile: Updated dependencies
+
+ * variable.c: Handling of ENV variable happens inside lookup_variable()
+
+Sat May 11 17:58:32 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
+
+ * variable.c (try_variable_definition): Count parens in lhs variable
+ refs to avoid seeing =/:=/+= inside a ref.
+
+Thu May 9 13:54:49 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
+
+ * commands.c (fatal_error_signal) [SIGQUIT]: Make SIGQUIT check
+ conditional.
+
+ * main.c (main): Use unsigned for fread return.
+
+ * read.c (parse_file_seq): Use `int' for char arg to avoid widening
+ conflict issues.
+ * dep.h: Fix prototype.
+
+ * function.c (expand_function) [_AMIGA]: Fix some typos.
+ (patsubst_expand): Make len vars unsigned.
+
+ * GNUmakefile (globfiles): Add AmigaDOS support files.
+ (distfiles): Add $(amigafiles).
+ (amigafiles): New variable.
+
+Thu Nov 7 10:18:16 1995 Aaron Digulla <digulla@fh-konstanz.de>
+
+ * Added Amiga support in commands.c, dir.c, function.c,
+ job.c, main.c, make.h, read.c, remake.c
+ * commands.c: Amiga has neither SIGHUP nor SIGQUIT
+ * dir.c: Amiga has filenames with Upper- and Lowercase,
+ but "FileName" is the same as "filename". Added strieq()
+ which is use to compare filenames. This is like streq()
+ on all other systems. Also there is no such thing as
+ "." under AmigaDOS.
+ * function.c: On Amiga, the environment is not passed as envp,
+ there are no pipes and Amiga can't fork. Use my own function
+ to create a new child.
+ * job.c: default_shell is "" (The system automatically chooses
+ a shell for me). Have to use the same workaround as MSDOS for
+ running batch commands. Added HAVE_SYS_PARAM_H. NOFILE isn't
+ known on Amiga. Cloned code to run children from MSDOS. Own
+ version of sh_chars[] and sh_cmds[]. No dup2() or dup() on Amiga.
+ * main.c: Force stack to 20000 bytes. Read environment from ENV:
+ device. On Amiga, exec_command() does return, so I exit()
+ afterwards.
+ * make.h: Added strieq() to compare filenames.
+ * read.c: Amiga needs special extension to have passwd. Only
+ one include-dir. "Makefile" and "makefile" are the same.
+ Added "SMakefile". Added special code to handle device names (xxx:)
+ and "./" in rules.
+ * remake.c: Only one lib-dir. Amiga link-libs are named "%s.lib"
+ instead of "lib%s.a".
+ * main.c, rule.c, variable.c: Avoid floats at all costs.
+ * vpath.c: Get rid of as many alloca()s as possible.
+
+Thu May 9 13:20:43 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
+
+ * read.c (read_makefile): Grok `sinclude' as alias for `-include'.
+
+Wed Mar 20 09:52:27 1996 Roland McGrath <roland@charlie-brown.gnu.ai.mit.edu>
+
+ * GNUmakefile (vmsfiles): New variable.
+ (distfiles): Include $(vmsfiles).
+
+Tue Mar 19 20:21:34 1996 Roland McGrath <roland@charlie-brown.gnu.ai.mit.edu>
+
+ Merged VMS port from Klaus Kaempf <kkaempf@didymus.rmi.de>.
+ * make.h (PARAMS): New macro.
+ * config.h-vms: New file.
+ * makefile.com: New file.
+ * makefile.vms: New file.
+ * readme.vms: New file.
+ * vmsdir.h: New file.
+ * vmsfunctions.c: New file.
+ * vmsify.c: New file.
+ * file.h: Renamed to filedef.h to avoid conflict with VMS system hdr.
+ * ar.c: Added prototypes and changes for VMS.
+ * commands.c: Likewise.
+ * commands.h: Likewise.
+ * default.c: Likewise.
+ * dep.h: Likewise.
+ * dir.c: Likewise.
+ * expand.c: Likewise.
+ * file.c: Likewise.
+ * function.c: Likewise.
+ * implicit.c: Likewise.
+ * job.c: Likewise.
+ * job.h: Likewise.
+ * main.c: Likewise.
+ * make.h: Likewise.
+ * misc.c: Likewise.
+ * read.c: Likewise.
+ * remake.c: Likewise.
+ * remote-stub.c: Likewise.
+ * rule.c: Likewise.
+ * rule.h: Likewise.
+ * variable.c: Likewise.
+ * variable.h: Likewise.
+ * vpath.c: Likewise.
+ * compatMakefile (srcs): Rename file.h to filedef.h.
+
+Sat Aug 19 23:11:00 1995 Richard Stallman <rms@mole.gnu.ai.mit.edu>
+
+ * remake.c (check_dep): For a secondary file, try implicit and
+ default rules if appropriate.
+
+Wed Aug 2 04:29:42 1995 Richard Stallman <rms@mole.gnu.ai.mit.edu>
+
+ * remake.c (check_dep): If an intermediate file exists,
+ do consider its actual date.
+
+Sun Jul 30 00:49:53 1995 Richard Stallman <rms@mole.gnu.ai.mit.edu>
+
+ * file.h (struct file): New field `secondary'.
+ * file.c (snap_deps): Check for .INTERMEDIATE and .SECONDARY.
+ (remove_intermediates): Don't delete .SECONDARY files.
+
+Sat Mar 2 16:26:52 1996 Roland McGrath <roland@charlie-brown.gnu.ai.mit.edu>
+
+ * compatMakefile (srcs): Add getopt.h; prepend $(srcdir)/ to getopt*.
+
+Fri Mar 1 12:04:47 1996 Roland McGrath <roland@charlie-brown.gnu.ai.mit.edu>
+
+ * Version 3.74.3.
+
+ * remake.c (f_mtime): Move future modtime check before FILE is
+ clobbered by :: loop.
+
+ * dir.c: Use canonical code from autoconf manual for dirent include.
+ [_D_NAMLEN]: Redefine NAMLEN using this.
+ (dir_contents_file_exists_p): Use NAMLEN macro.
+ (read_dirstream) [_DIRENT_HAVE_D_NAMLEN]: Only set d_namlen #if this.
+
+ * compatMakefile (objs): Add missing backslash.
+
+Wed Feb 28 03:56:20 1996 Roland McGrath <roland@charlie-brown.gnu.ai.mit.edu>
+
+ * default.c (default_terminal_rules): Remove + prefix from RCS cmds.
+ (default_variables): Put + prefix in $(CHECKOUT,v) value instead.
+
+ * remake.c (f_mtime): Check for future timestamps; give error and mark
+ file as "failed to update".
+
+Fri Jan 12 18:09:36 1996 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
+
+ * job.c: Don't declare unblock_sigs; job.h already does.
+
+Sat Jan 6 16:24:44 1996 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
+
+ * acconfig.h (HAVE_SYSCONF_OPEN_MAX): #undef removed.
+
+ * job.c (NGROUPS_MAX): Don't try to define this macro.
+
+Fri Dec 22 18:44:44 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
+
+ * compatMakefile (GETOPT, GETOPT_SRC, GLOB): Variables removed.
+ (objs, srcs): Include their values here instead of references.
+
+Thu Dec 14 06:21:29 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
+
+ * Version 3.74.2.
+
+ * job.c (reap_children): Call unblock_sigs after start_job_command.
+
+Thu Dec 14 07:22:03 1995 Roland McGrath <roland@duality.gnu.ai.mit.edu>
+
+ * dir.c (dir_setup_glob): Don't use lstat; glob never calls it anyway.
+ Avoid & before function names to silence bogus sunos4 compiler.
+
+ * configure.in: Remove check for `sysconf (_SC_OPEN_MAX)'.
+
+Tue Dec 12 00:48:42 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
+
+ * Version 3.74.1.
+
+ * dir.c (read_dirstream): Fix braino: fill in the buffer when not
+ reallocating it!
+
+Mon Dec 11 22:26:15 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
+
+ * misc.c (collapse_continuations): Fix skipping of trailing \s so
+ it can never dereference before the beginning of the array.
+
+ * read.c (find_semicolon): Function removed.
+ (read_makefile): Don't use find_semicolon or remove_comments for
+ rule lines. Use find_char_unquote directly and handle quoted comments
+ properly.
+
+ * default.c: Remove all [M_XENIX] code.
+
+ * dir.c [HAVE_D_NAMLEN]: Define this for __GNU_LIBRARY__ > 1.
+ (D_NAMLEN): Macro removed.
+ (FAKE_DIR_ENTRY): New macro.
+ (dir_contents_file_exists_p): Test HAVE_D_NAMLEN instead of using
+ D_NAMLEN.
+ (read_dirstream): Return a struct dirent * for new glob interface.
+ (init_dir): Function removed.
+ (dir_setup_glob): New function.
+ * main.c (main): Don't call init_dir.
+ * read.c (multi_glob): Call dir_setup_glob on our glob_t and use
+ GLOB_ALTDIRFUNC flag.
+
+ * misc.c (safe_stat): Function removed.
+ * read.c, commands.c, remake.c, vpath.c: Use plain stat instead of
+ safe_stat.
+
+Sat Nov 25 20:35:18 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
+
+ * job.c [HAVE_UNION_WAIT]: Include sys/wait.h.
+
+ * main.c (log_working_directory): Made global.
+ Print entering msg only once.
+ * make.h (log_working_directory): Declare it.
+ * misc.c (message): Take new arg PREFIX. Print "make: " only if
+ nonzero. Call log_working_directory.
+ * remake.c: Pass new arg in `message' calls.
+ * job.c (start_job_command): Pass new arg to `message'; fix
+ inverted test in that call.
+
+Tue Nov 21 19:01:12 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
+
+ * job.c (start_job_command): Use `message' to print the command,
+ and call it with null if the command is silent.
+ * remake.c (touch_file): Use message instead of printf.
+
+Tue Oct 10 14:59:30 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
+
+ * main.c (enter_command_line_file): Barf if NAME is "".
+
+Sat Sep 9 06:33:20 1995 Roland McGrath <roland@whiz-bang.gnu.ai.mit.edu>
+
+ * commands.c (delete_target): Ignore unlink failure if it is ENOENT.
+
+Thu Aug 17 15:08:57 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
+
+ * configure.in: Don't check for getdtablesize.
+ * job.c (getdtablesize): Remove decls and macros.
+
+Thu Aug 10 19:10:03 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
+
+ * main.c (define_makeflags): Omit command line variable
+ definitions from MFLAGS value.
+
+ * arscan.c (ar_scan) [AIAMAG]: Check for zero MEMBER_OFFSET,
+ indicating a valid, but empty, archive.
+
+Mon Aug 7 15:40:03 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
+
+ * dir.c (file_impossible_p): Correctly reset FILENAME to name
+ within directory before hash search.
+
+ * job.c (child_error): Do nothing if IGNORED under -s.
+
+ * job.c (exec_command): Correctly use ARGV[0] for script name when
+ running shell directly.
+
+Tue Aug 1 14:39:14 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
+
+ * job.c (child_execute_job): Close STDIN_FD and STDOUT_FD after
+ dup'ing from them. Don't try to close all excess descriptors;
+ getdtablesize might return a huge value. Any open descriptors in
+ the parent should have FD_CLOEXEC set.
+ (start_job_command): Set FD_CLOEXEC flag on BAD_STDIN descriptor.
+
+Tue Jun 20 03:47:15 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
+
+ * read.c (read_all_makefiles): Properly append default makefiles
+ to the end of the `read_makefiles' chain.
+
+Fri May 19 16:36:32 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
+
+ * Version 3.74 released.
+
+Wed May 10 17:43:34 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
+
+ * Version 3.73.3.
+
+Tue May 9 17:15:23 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
+
+ * compatMakefile ($(infodir)/make.info): Make sure $$dir is set in
+ install-info cmd.
+
+Wed May 3 15:56:06 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
+
+ * file.c (print_file): Grok update_status of 1 for -q.
+
+Thu Apr 27 12:39:35 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
+
+ * Version 3.73.2.
+
+Wed Apr 26 17:15:57 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
+
+ * file.c (remove_intermediates): Fix inverted test to bail under
+ -n for signal case. Bail under -q or -t.
+ Skip files with update_status==-1.
+
+ * job.c (job_next_command): Skip empty lines.
+ (new_job): Don't test the return of job_next_command.
+ Just let start_waiting_job handle the case of empty commands.
+
+Wed Apr 19 03:25:54 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
+
+ * function.c [__MSDOS__]: Include <fcntl.h>. From DJ Delorie.
+
+ * Version 3.73.1.
+
+Sat Apr 8 14:53:24 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
+
+ * remake.c (notice_finished_file): Set FILE->update_status to zero
+ if it's -1.
+
+Wed Apr 5 00:20:24 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
+
+ * Version 3.73 released.
+
+Tue Mar 28 13:25:46 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
+
+ * main.c (main): Fixed braino in assert.
+
+ * Version 3.72.13.
+
+Mon Mar 27 05:29:12 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
+
+ * main.c: Avoid string in assert expression. Some systems are broken.
+
+Fri Mar 24 00:32:32 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
+
+ * main.c (main): Handle 1 and 2 returns from update_goal_chain
+ makefile run properly.
+
+ * Version 3.72.12.
+
+ * main.c (handle_non_switch_argument): New function, broken out of
+ decode_switches.
+ (decode_switches): Set optind to 0 to reinitialize getopt, not to 1.
+ When getopt_long returns EOF, break the loop and handle remaining args
+ with a simple second loop.
+
+ * remake.c (remake_file): Set update_status to 2 instead of 1 for
+ no rule to make. Mention parent (dependent) in error message.
+ (update_file_1): Handle FILE->update_status == 2 in -d printout.
+ * job.c (start_job_command, reap_children): Set update_status to 2
+ instead of 1 for failed commands.
+
+Tue Mar 21 16:23:38 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
+
+ * job.c (search_path): Function removed (was already #if 0'd out).
+ * configure.in: Remove AC_TYPE_GETGROUPS; nothing needs it any more.
+
+Fri Mar 17 15:57:40 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
+
+ * configure.bat: Write @CPPFLAGS@ translation.
+
+Mon Mar 13 00:45:59 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
+
+ * read.c (parse_file_seq): Rearranged `l(a b)' -> `l(a) l(b)' loop
+ to not skip the elt immediately preceding `l(...'.
+
+Fri Mar 10 13:56:49 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
+
+ * Version 3.72.11.
+
+ * read.c (find_char_unquote): Make second arg a string of stop
+ chars instead of a single stop char. Stop when any char in the
+ string is hit. All callers changed.
+ (find_semicolon): Pass stop chars "#;" to one find_char_unquote call,
+ instead of using two calls. If the match is not a ; but a #,
+ return zero.
+ * misc.c: Changed find_char_unquote callers here too.
+
+ * Version 3.72.10.
+
+ * read.c (read_makefile, parse_file_seq): Fix typo __MS_DOS__ ->
+ __MSDOS__.
+
+ * GNUmakefile (globfiles): Add glob/configure.bat.
+ (distfiles): Add configh.dos, configure.bat.
+
+Wed Mar 8 13:10:57 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
+
+ Fixes for MS-DOS from DJ Delorie.
+ * read.c (read_makefile, parse_file_seq) [__MS_DOS__]: Don't see :
+ as separator in "C:\...".
+ * configh.dos (STDC_HEADERS): Define only if undefined.
+ (HAVE_SYS_PARAM_H): Don't define this.
+ (HAVE_STRERROR): Define this.
+ * job.c (construct_command_argv_internal) [__MSDOS__]: Fix typos.
+
+ * Version 3.72.9.
+
+ * main.c (decode_switches): Reset optind to 1 instead of 0.
+
+Tue Mar 7 17:31:06 1995 Roland McGrath <roland@geech.gnu.ai.mit.edu>
+
+ * main.c (decode_switches): If non-option arg is "-", ignore it.
+
+Mon Mar 6 23:57:38 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
+
+ * Version 3.72.8.
+
+Wed Feb 22 21:26:36 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
+
+ * Version 3.72.7.
+
+Tue Feb 21 22:10:43 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
+
+ * main.c (main): Pass missing arg to tmpnam.
+
+ * configure.in: Check for strsignal.
+ * job.c (child_error): Use strsignal.
+ * main.c (main): Don't call signame_init #ifdef HAVE_STRSIGNAL.
+
+ * misc.c (strerror): Fix swapped args in sprintf.
+
+Mon Feb 13 11:50:08 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
+
+ * configure.in (CFLAGS, LDFLAGS): Don't set these variables.
+
+Fri Feb 10 18:44:12 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
+
+ * main.c (print_version): Add 95 to copyright years.
+
+ * Version 3.72.6.
+
+ * job.c (start_job_command): Remember to call notice_finished_file
+ under -n when not recursing. To do this, consolidate that code
+ under the empty command case and goto there for the -n case.
+
+Tue Feb 7 13:36:03 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
+
+ * make.h [! STDC_HEADERS]: Don't declare qsort. Sun headers
+ declare it int.
+
+Mon Feb 6 17:37:01 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
+
+ * read.c (read_makefile): For bogus line starting with tab, ignore
+ it if blank after removing comments.
+
+ * main.c: Cast results of `alloca' to `char *'.
+ * expand.c: Likewise.
+
+Sun Feb 5 18:35:46 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
+
+ * Version 3.72.5.
+
+ * configure.in: Check for mktemp.
+ * main.c (main) [! HAVE_MKTEMP]: Use tmpnam instead of mktemp.
+
+ * configure.in (make_cv_sysconf_open_max): New check for `sysconf
+ (_SC_OPEN_MAX)'.
+ * acconfig.h: Added #undef HAVE_SYSCONF_OPEN_MAX.
+ * job.c [HAVE_SYSCONF_OPEN_MAX] (getdtablesize): Define as macro
+ using sysconf.
+
+Fri Jan 27 04:42:09 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
+
+ * remake.c (update_file_1): When !MUST_MAKE, don't set
+ FILE->update_status to zero before calling notice_finished_file.
+ (notice_finished_file): Touch only when FILE->update_status is zero.
+ (remake_file): Set FILE->update_status to zero after not calling
+ execute_file_command and deciding to touch instead.
+
+Thu Jan 26 01:29:32 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
+
+ * main.c (debug_signal_handler): New function; toggles debug_flag.
+ (main): Handle SIGUSR1 with that.
+
+Mon Jan 16 15:46:56 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
+
+ * compatMakefile (realclean): Remove Info files.
+
+Sun Jan 15 08:23:09 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
+
+ * Version 3.72.4.
+
+ * job.c (start_job_command): Save and restore environ around vfork
+ call.
+ (search_path): Function #if 0'd out.
+ (exec_command): Use execvp instead of search_path.
+
+ * expand.c (variable_expand): Rewrote computed variable name and
+ substitution reference handling to be simpler. First expand the
+ entire text between the parens if it contains any $s, then examine
+ the result of that for subtitution references and do no further
+ expansion while parsing them.
+
+ * job.c (construct_command_argv_internal): Handle " quoting too,
+ when no backslash, $ or ` characters appear inside the quotes.
+
+ * configure.in (union wait check): If WEXITSTATUS and WTERMSIG are
+ defined, just use int.
+
+Tue Jan 10 06:27:27 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
+
+ * default.c (default_variables) [__hpux]: Remove special
+ definition of ARFLAGS. Existence of the `f' flag is not
+ consistent across HPUX versions; and one might be using GNU ar
+ anyway.
+
+ * compatMakefile (clean): Don't remove Info files.
+
+ * compatMakefile (check): Remove gratuitous target declaration.
+
+Sat Jan 7 11:38:23 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
+
+ * compatMakefile (ETAGS, CTAGS): Don't use -t.
+
+ * arscan.c (ar_name_equal) [cray]: Subtract 1 like [__hpux].
+
+ * main.c (decode_switches): For --help, print usage to stdout.
+
+Mon Dec 5 12:42:18 1994 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
+
+ * Version 3.72.3.
+
+ * remake.c (update_file_1): Do set_command_state (FILE,
+ cs_not_started) only if old state was deps_running.
+
+Mon Nov 28 14:24:03 1994 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
+
+ * job.c (start_waiting_job): Use set_command_state.
+
+ * build.template (CPPFLAGS): New variable.
+ (prefix, exec_prefix): Set from @...@.
+ (compilation loop): Pass $CPPFLAGS to compiler.
+
+ * GNUmakefile (build.sh.in): Make it executable.
+
+ * GNUmakefile (globfiles): Add configure.in, configure.
+
+ * Version 3.72.2.
+
+ * configure.in (AC_OUTPUT): Don't write glob/Makefile.
+
+ * configure.in (AC_CHECK_SYMBOL): Use AC_DEFINE_UNQUOTED.
+
+ * configure.in: Don't check for ranlib.
+
+Tue Nov 22 22:42:40 1994 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
+
+ * remake.c (notice_finished_file): Only mark also_make's as
+ updated if really ran cmds.
+
+Tue Nov 15 06:32:46 1994 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
+
+ * configure.in: Put dnls before random whitespace.
+
+Sun Nov 13 05:02:25 1994 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
+
+ * compatMakefile (CPPFLAGS): New variable, set from @CPPFLAGS@.
+ (RANLIB): Variable removed.
+ (prefix, exec_prefix): Set these from @...@.
+ (.c.o): Use $(CPPFLAGS).
+ (glob/libglob.a): Don't pass down variables to sub-make.
+ glob/Makefile should be configured properly by configure.
+ (distclean): Remove config.log and config.cache (autoconf stuff).
+
+Mon Nov 7 13:58:06 1994 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
+
+ * acconfig.h: Add #undef HAVE_UNION_WAIT.
+ * configure.in: Converted to Autoconf v2.
+ * dir.c: Test HAVE_DIRENT_H, HAVE_SYS_DIR_H, HAVE_NDIR_H instead
+ of DIRENT, SYSDIR, NDIR.
+ * build.sh.in (prefix, exec_prefix): Set these from @...@.
+ (CPPFLAGS): New variable, set from @CPPFLAGS@.
+ (compiling loop): Pass $CPPFLAGS before $CFLAGS.
+ * install.sh: File renamed to install-sh.
+
+ * main.c (define_makeflags): When no flags, set WORDS to zero.
+
+Sun Nov 6 18:34:01 1994 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
+
+ * Version 3.72.1.
+
+ * main.c (define_makeflags): Terminate properly when FLAGSTRING is
+ empty.
+
+Fri Nov 4 16:02:51 1994 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
+
+ * Version 3.72.
+
+Tue Nov 1 01:18:10 1994 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
+
+ * Version 3.71.5.
+
+ * job.c (start_job_command): When ARGV is nil, only set
+ update_state and call notice_finished_file if job_next_command
+ returns zero.
+
+ * job.c (start_job_command): Call notice_finished_file for empty
+ command line.
+
+Thu Oct 27 02:02:45 1994 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
+
+ * file.c (snap_deps): Set COMMANDS_SILENT for .SILENT, not
+ COMMANDS_NOERROR.
+
+Wed Oct 26 02:14:10 1994 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
+
+ * Version 3.71.4.
+
+Tue Oct 25 22:49:24 1994 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
+
+ * file.c (snap_deps): Set command_flags bits in all :: entries.
+
+Mon Oct 24 18:47:50 1994 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
+
+ * make.h (posix_pedantic): Declare it.
+ * main.c (main): Move checks .IGNORE, .SILENT, .POSIX to
+ snap_deps.
+ * file.c (snap_deps): Check .IGNORE, .SILENT, .POSIX here instead
+ of in main. If .IGNORE has deps, OR COMMANDS_NOERROR into their
+ command_flags and don't set -i. Likewise .SILENT.
+ * job.c (start_job_command): In FLAGS initialization, OR in
+ CHILD->file->command_flags.
+ * file.h (struct file): New member `command_flags'.
+
+Sun Oct 16 01:01:51 1994 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
+
+ * main.c (switches): Bump flag values for --no-print-directory and
+ --warn-undefined-variables, so neither is 1 (which indicates a
+ nonoption argument).
+
+Sat Oct 15 23:39:48 1994 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
+
+ * main.c (main): Add missing code in .IGNORE test.
+
+Mon Oct 10 04:09:03 1994 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
+
+ * variable.c (define_automatic_variables): Define +D and +F.
+
+Sat Oct 1 04:07:48 1994 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
+
+ * main.c (main): Define hidden automatic variable with command
+ vars, and MAKEOVERRIDES to a reference to that.
+ (define_makeflags): If posix_pedantic, write a reference to that
+ instead.
+
+Thu Sep 29 00:14:26 1994 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
+
+ * main.c (posix_pedantic): New variable.
+ (main): Set posix_pedantic if .POSIX is a target.
+ Fix .IGNORE and .SILENT checks to require is_target.
+
+ * commands.c (set_file_variables): Define new automatic variable
+ $+, like $^ but before calling uniquize_deps.
+
+ * job.c (reap_children): Call delete_child_targets for non-signal
+ error if .DELETE_ON_ERROR is a target.
+
+Tue Sep 27 01:57:14 1994 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
+
+ * Version 3.71.3.
+
+Mon Sep 26 18:16:55 1994 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
+
+ * job.c (reap_children): Don't change C->file->command_state when
+ dying. Test it only after calling start_job_command for a new
+ command line. When no more cmds, just set C->file->update_status.
+ (start_job_command): When the last line is empty or under -n, set
+ C->file->update_status.
+ (start_waiting_job): Grok cs_not_started after start_job_command
+ as success.
+ (new_job): Set C->file->update_status when there are no cmds.
+ (job_next_command): When out of lines, don't set
+ CHILD->file->update_status or CHILD->file->command_state.
+
+ * main.c (quote_as_word): Renamed from shell_quote. Take new arg;
+ if nonzero, also double $s.
+ (main): Define MAKEOVERRIDES from command_variables here.
+ (define_makeflags): Don't use command_variables here; instead write a
+ reference $(MAKEOVERRIDES) in MAKEFLAGS. Make vars recursive.
+
+ * dir.c [__MSDOS__]: Fixed typo.
+
+ * vpath.c (selective_vpath_search): Reset EXISTS when stat fails.
+
+Sat Sep 10 03:01:35 1994 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
+
+ * remake.c: Include <assert.h> and use assert instead of printfs
+ and abort.
+
+ * main.c (decode_switches): Loop until optind hits ARGC, not just
+ until getopt_long returns EOF. Initialize C to zero before loop;
+ in loop if C is EOF, set optarg from ARGV[optind++], else call
+ getopt_long.
+ (decode_env_switches): Use variable_expand instead of
+ allocated_variable_expand. Allocate a fresh buffer to copy split
+ words into; scan characters by hand to break words and
+ debackslashify.
+ (shell_quote): New function.
+ (define_makeflags): Allocate doubled space for switch args, and command
+ variable names and values; use shell_quote to quote those things.
+
+Fri Sep 9 01:37:47 1994 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
+
+ * Version 3.71.2.
+
+ * acconfig.h: Add HAVE_SYS_SIGLIST and HAVE__SYS_SIGLIST.
+
+ * main.c (decode_switches): The non-option return from getopt is
+ 1, not 0.
+ (command_variables): New type and variable.
+ (decode_switches, decode_env_switches): After making a variable
+ definition, record the struct variable pointer in the
+ command_variables chain.
+ (define_makeflags): If ALL, write variable definitions for
+ command_variables.
+
+ * main.c (other_args): Variable removed.
+ (goals, lastgoal): New static variables (moved from auto in main).
+ (main): Don't process OTHER_ARGS at all.
+ Don't set variable MAKEOVERRIDES at all; define MAKE to just
+ $(MAKE_COMMAND).
+ (init_switches): Prepend a - {return in order} instead of a +
+ {require order}.
+ (decode_switches): Don't set OTHER_ARGS at all.
+ Grok '\0' return from getopt_long as non-option argument; try
+ variable definition and (if !ENV) enter goal targets here.
+ (decode_env_switches): Use allocated_variable_expand to store value.
+ Use find_next_token to simplify word-splitting loop. Don't
+ prepend a dash to uninterpreted value. Instead, if split into
+ only one word, try variable definition and failing that prepend a
+ dash to the word and pass it to decode_switches as a single arg.
+
+Wed Sep 7 03:02:46 1994 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
+
+ * remake.c (notice_finished_file): Only recheck modtimes if
+ FILE->command_state was cs_running on entry (meaning the commands
+ actually just ran).
+ (update_file_1): Whenever we set FILE->update_status, call
+ notice_finished_file instead of just set_command_state.
+ * job.c (start_job_command): Whenever we set
+ CHILD->file->update_status, call notice_finished_file instead of
+ just set_command_state.
+
+Tue Sep 6 19:13:54 1994 Roland McGrath <roland@geech.gnu.ai.mit.edu>
+
+ * default.c: Add missing ".
+
+ * job.c: Changed all assignments of command_state members to calls
+ to set_command_state.
+ * remake.c: Likewise.
+ * file.c (set_command_state): New function.
+ * file.h: Declare set_command_state.
+
+ * main.c (init_switches): Put a + first in options.
+
+Mon Jul 25 18:07:46 1994 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
+
+ Merge MSDOS/GO32 port from DJ Delorie <dj@ctron.com>.
+ * vpath.c: Changed all uses of ':' to PATH_SEPARATOR_CHAR.
+ * main.c (directory_before_chdir): New variable, moved out of main
+ (was local).
+ (main) [__MSDOS__]: Look for \ or : to delimit last component of
+ PROGRAM. Don't frob ARGV[0] before setting MAKE_COMMAND variable.
+ (die): Change back to `directory_before_chdir' before dying.
+ * make.h (PATH_SEPARATOR_CHAR): New macro; differing defns for
+ [__MSDOS__] and not.
+ * job.c [__MSDOS__]: Include <process.h>.
+ [__MSDOS__] (dos_pid, dos_status, dos_bname, dos_bename,
+ dos_batch_file): New variables.
+ (reap_children) [__MSDOS__]: Don't call wait; just examine those vars.
+ (unblock_sigs) [__MSDOS__]: Do nothing.
+ (start_job_command) [__MSDOS__]: Use spawnvpe instead of vfork & exec.
+ (load_too_high) [__MSDOS__]: Always return true.
+ (search_path) [__MSDOS__]: Check for : or / in FILE to punt.
+ Use PATH_SEPARATOR_CHAR instead of ':'.
+ (construct_command_argv_internal) [__MSDOS__]: Wholly different
+ values for sh_chars and sh_cmds. Wholly new code to handle shell
+ scripts.
+ * function.c (expand_function: `shell') [__MSDOS__]: Wholly new
+ implementation.
+ * dir.c [__MSDOS__] (dosify): New function.
+ (dir_contents_file_exists_p) [__MSDOS__]: Call it on FILENAME and
+ process the result instead of FILENAME itself.
+ (file_impossible_p) [__MSDOS__]: Likewise.
+ * default.c [__MSDOS__]: Define GCC_IS_NATIVE.
+ (default_suffix_rules) [__MSDOS__]: Use `y_tab.c' instead of `y.tab.c'.
+ (default_variables) [GCC_IS_NATIVE]: Set CC and CXX to `gcc', YACC to
+ `bison -y', and LEX to `flex'.
+ * configure.bat, configh.dos: New files.
+ * commands.c (fatal_error_signal) [__MSDOS__]: Just remove
+ intermediates and exit.
+
+ * commands.c (set_file_variables): Add parens in length
+ computation in .SUFFIXES dep loop to quiet compiler warning. From
+ Jim Meyering.
+
+ * read.c (read_makefile): Free FILENAME if we allocated it. From
+ Jim Meyering.
+
+Mon Jul 4 17:47:08 1994 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * misc.c (safe_stat): New function, EINTR-safe wrapper around stat.
+ * vpath.c (selective_vpath_search): Use safe_stat in place of stat.
+ * read.c (construct_include_path): Use safe_stat in place of stat.
+ * job.c (search_path): Use safe_stat in place of stat.
+ * dir.c (find_directory): Use safe_stat in place of stat.
+ * commands.c (delete_target): Use safe_stat in place of stat.
+ * arscan.c (ar_member_touch) [EINTR]: Do EINTR looping around fstat.
+ * remake.c (name_mtime): Use safe_stat in place of stat.
+ (touch_file) [EINTR]: Do EINTR looping around fstat.
+
+Fri Jun 24 05:40:24 1994 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * read.c (read_makefile): Check for a shell command first, and
+ then strip leading tabs before further checking if it's not a
+ shell command line.
+
+ * make.h [__arm]: Undefine POSIX.
+ [!__GNU_LIBRARY__ && !POSIX && !_POSIX_VERSION]: Don't declare system
+ functions that return int.
+
+ * job.c (construct_command_argv_internal): After swallowing a
+ backslash-newline combination, if INSTRING is set goto string_char
+ (new label) for normal INSTRING handling code.
+
+Sat Jun 4 01:11:20 1994 Roland McGrath (roland@geech.gnu.ai.mit.edu)
+
+ * configure.in: Don't check for sys_siglist and _sys_siglist with
+ AC_HAVE_FUNCS. Instead use two AC_COMPILE_CHECKs.
+
+Mon May 23 18:20:38 1994 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * Version 3.71.1 released.
+
+ * make.h [!__GNU_LIBRARY__ && !POSIX]: Also test #ifndef
+ _POSIX_VERSION for these declarations.
+
+ * misc.c [GETLOADAVG_PRIVILEGED] [POSIX]: Remove bogus #ifndefs
+ around #undefs of HAVE_SETREUID and HAVE_SETREGID.
+
+Sat May 21 16:26:38 1994 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * Version 3.71 released.
+
+ * misc.c [GETLOADAVG_PRIVILEGED] [POSIX]: Don't test [HAVE_SETUID]
+ and [HAVE_SETGID]. Every system has those, and configure doesn't
+ check for them.
+
+ * make.h [_POSIX_VERSION]: Don't #define POSIX #ifdef ultrix.
+
+ * compatMakefile (loadavg): Depend on and use loadavg.c instead of
+ getloadavg.c.
+ (loadavg.c): Link or copy it from getloadavg.c.
+ (distclean): Remove loadavg.c.
+
+Mon May 16 22:59:04 1994 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * Version 3.70.4.
+
+ * misc.c [GETLOADAVG_PRIVILEGED] [! POSIX]: Undefine HAVE_SETEUID
+ and HAVE_SETEGID.
+
+ * default.c (default_terminal_rules): In SCCS rules, put
+ $(SCCS_OUTPUT_OPTION) before $<. On some systems -G is grokked
+ only before the file name.
+ * configure.in (SCCS_GET_MINUS_G check): Put -G flag before file name.
+
+Tue May 10 16:27:38 1994 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * job.c (construct_command_argv_internal): Swallow
+ backslash-newline combinations inside '' strings too.
+
+Thu May 5 04:15:10 1994 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * read.c (do_define): Call collapse_continuations on each line
+ before all else.
+
+Mon Apr 25 19:32:02 1994 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * job.c (construct_command_argv_internal): Notice newline inside
+ '' string when RESTP is non-null.
+
+Fri Apr 22 17:33:30 1994 Roland McGrath (roland@geech.gnu.ai.mit.edu)
+
+ * Version 3.70.3.
+
+ * remake.c (update_goal_chain): Reset FILE to G->file after the
+ double-colon loop so it is never null for following code.
+
+ * read.c (read_makefile): Fix `override define' parsing to skip
+ whitespace after `define' properly.
+
+ * compatMakefile (srcdir): Define as @srcdir@; don't reference
+ $(VPATH).
+ (glob/Makefile): New target.
+
+Thu Apr 21 16:16:55 1994 Roland McGrath (roland@geech.gnu.ai.mit.edu)
+
+ * Version 3.70.2.
+
+ * misc.c (remove_comments): Use find_char_unquote.
+ * make.h (find_char_unquote): Declare it.
+ * read.c (find_char_unquote): New function, generalized from
+ find_percent.
+ (find_percent, find_semicolon, parse_file_seq): Use that.
+
+Wed Apr 20 18:42:39 1994 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * implicit.c (pattern_search): Always allocate new storage for
+ FILE->stem. It is not safe to store STEM's address because it
+ might be auto storage.
+
+ * configure.in: Check for seteuid and setegid.
+ * misc.c [HAVE_SETEUID]: Declare seteuid.
+ [HAVE_SETEGID]: Declare setegid.
+ (make_access, user_access) [HAVE_SETEUID]: Use seteuid.
+ [HAVE_SETEGID]: Use setegid.
+
+ * remake.c (update_goal_chain): Set STATUS to FILE->update_status,
+ to preserve whether it's 2 for error or 1 for -q trigger. When
+ STATUS gets nonzero and -q is set, always stop immediately.
+ * main.c (main, decode_switches): Die with 2 for errors.
+ (main): Accept 2 return from update_goal_chain and die with that.
+ * misc.c (fatal, makefile_fatal): Die with 2; 1 is reserved for -q
+ answer.
+ * job.c (reap_children): Die with 2 for error.
+ (start_job_command): Set update_status to 2 for error. Set it to
+ 1 when we would run a command and question_flag is set.
+
+ * read.c (read_makefile): Don't mark makefiles as precious. Just
+ like other targets, they can be left inconsistent and in need of
+ remaking by aborted commands.
+
+ * read.c (read_makefile): Write no error msg for -include file.
+
+Tue Apr 5 05:22:19 1994 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * commands.c (fatal_error_signal): Don't unblock signals.
+
+ * file.h (struct file): Change member `double_colon' from flag to
+ `struct file *'.
+ * read.c (record_files): Set double_colon pointer instead of flag.
+ * main.c (main): When disqualifying makefiles for updating, use
+ double_colon pointer to find all entries for a file.
+ * file.c (enter_file): If there is already a double-colon entry
+ for the file, set NEW->double_colon to that pointer.
+ (file_hash_enter): Use FILE->double_colon to find all entries to
+ set name.
+ * remake.c (update_goal_chain): Do inner loop on double-colon entries.
+ (update_file): Use FILE->double_colon pointer to find all entries.
+ (f_mtime): Likewise.
+ (notice_finished_file): Propagate mtime change to all entries.
+
+ * variable.c (try_variable_definition): Return after abort.
+
+Fri Apr 1 18:44:15 1994 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * read.c (read_makefile): Remove unused variable.
+ (parse_file_seq): When removing an elt that is just `)', properly
+ fix up the previous elt's next pointer.
+
+Mon Mar 28 18:31:49 1994 Roland McGrath (roland@mole.gnu.ai.mit.edu)
+
+ * configure.in: Do AC_SET_MAKE.
+ * GNUmakefile (Makefile.in): Edit MAKE assignment into @SET_MAKE@.
+
+Fri Mar 4 00:02:32 1994 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * function.c (subst_expand): If BY_WORD or SUFFIX_ONLY is set and
+ the search string is the empty string, find a match at the end of
+ each word (using end_of_token in place of sindex).
+
+ * misc.c (end_of_token): Don't treat backslashes specially; you
+ can no longer escape blanks with backslashes in export, unexport,
+ and vpath. This was never documented anyway.
+
+Thu Mar 3 23:53:46 1994 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * read.c (read_makefile): Variable name for `define' is not just
+ first token; use whole rest of line and strip trailing blanks.
+
+Wed Feb 16 16:03:45 1994 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * Version 3.70.1.
+
+ * read.c (read_makefile): Add -d msg stating args.
+
+ * read.c (read_makefile): Use isspace to skip over leading
+ whitespace, and explicitly avoid skipping over tabs. Don't want
+ to skip just spaces though; formfeeds et al should be skipped.
+
+ * default.c (default_variables) [__hpux]: Add f in ARFLAGS.
+
+ * arscan.c (ar_name_equal) [__hpux]: Subtract 2 instead of 1 from
+ sizeof ar_name for max length to compare.
+
+ * misc.c [GETLOADAVG_PRIVILEGED] [POSIX]: Undefine HAVE_SETREUID
+ #ifdef HAVE_SETUID; likewise HAVE_SETREGID and HAVE_SETGID.
+
+ * main.c (main): Call user_access after setting `program', in case
+ it needs to use it in an error message.
+
+ * read.c (read_makefile): Ignore an empty line starting with a tab.
+
+Thu Feb 10 21:45:31 1994 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * configure.in (AC_SYS_SIGLIST_DECLARED): Use this instead of
+ AC_COMPILE_CHECK that is now its contents.
+
+Fri Feb 4 16:28:54 1994 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * make.h: #undef strerror after #include <string.h>.
+ [! ANSI_STRING]: Declare strerror.
+
+Thu Feb 3 02:21:22 1994 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * misc.c (strerror): #undef any macro before function definition.
+
+Mon Jan 31 19:07:23 1994 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * variable.c (try_variable_definition): Calculate BEG before loop
+ to strip blanks by decrementing END. Don't decr END to before BEG.
+
+ * read.c (read_makefile): Skip over leading space characters, but
+ not tabs, after removing continuations and comments (it used to
+ use isspace).
+
+Tue Jan 25 16:45:05 1994 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * variable.c (define_automatic_variables): In $(@D) et al, use
+ patsubst to remove trailing slash.
+
+ * commands.c (delete_target): New function, broken out of
+ delete_child_targets. Check for archive members and give special msg.
+ (delete_child_targets): Use delete_target.
+
+Mon Jan 17 17:03:22 1994 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * default.c (default_suffix_rules): Use $(TEXI2DVI_FLAGS) in
+ texi2dvi rules. Use $(MAKEINFO_FLAGS) in makeinfo rules.
+
+Tue Jan 11 19:29:55 1994 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * GNUmakefile (tarfiles): Omit make-doc.
+ (make-$(version).tar): Include make.info*.
+
+Fri Jan 7 16:27:00 1994 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * compatMakefile (configure, config.h.in): Comment out rules.
+
+Thu Jan 6 18:08:08 1994 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * compatMakefile (binprefix, manprefix): New variables.
+ (instname): Variable removed.
+ (install): Use $({bin,man}prefix)make in place of $(instname).
+ File targets likewised renamed.
+
+Mon Jan 3 17:50:25 1994 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * Version 3.70 released.
+
+Thu Dec 23 14:46:54 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * Version 3.69.3.
+
+ * read.c (parse_file_seq): Inside multi-word archive ref
+ translation loop, check NEW1==0 at end and break out of the loop.
+
+ * GNUmakefile (make-$(version).tar): Distribute install.sh.
+ * install.sh: New file.
+
+ * configure.in (SCCS_GET_MINUS_G check): Put redirection for admin
+ cmds outside subshell parens, to avoid "command not found" msgs
+ from the shell.
+
+Wed Dec 22 17:00:43 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * configure.in (SCCS_GET_MINUS_G check): Put -G flag last in get cmd.
+ Redirect output & error from get to /dev/null.
+ Fix reversed sense of test.
+
+Fri Dec 17 15:31:36 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * configure.in (SCCS_GET_MINUS_G check): Use parens instead of
+ braces inside if condition command; some shells lose.
+
+Thu Dec 16 15:10:23 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * Version 3.69.2.
+
+ * arscan.c [M_UNIX]: Move #undef M_XENIX for PORTAR stuff.
+ (PORTAR) [M_XENIX]: Define to 0 instead of 1.
+
+ * main.c (define_makeflags): Only export MAKEFLAGS if !ALL.
+
+Wed Dec 15 17:47:48 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * main.c (main): Cast result of pointer arith to unsigned int
+ before passing to define_variable for envars. Matters when
+ sizeof(unsigned)!=sizeof(ptrdiff_t).
+
+Tue Dec 14 14:21:16 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * configure.in: Add new check for SCCS_GET_MINUS_G.
+ * config.h.in: Add #undef SCCS_GET_MINUS_G.
+ * default.c (default_terminal_rules): Use `$(SCCS_OUTPUT_OPTION)' in
+ place of `-G $@' in SCCS commands.
+ (default_variables) [SCCS_GET_MINUS_G]: Define SCCS_OUTPUT_OPTION
+ to "-G$@".
+
+ * configure.in (AC_OUTPUT): Put touch stamp-config in second arg
+ (so it goes in config.status), rather than afterward.
+
+ * ar.c (ar_member_date): Don't call enter_file on the archive file
+ if it doesn't exist (by file_exists_p).
+
+ * compatMakefile ($(infodir)/make.info): Replace `$$d/foo.info'
+ with `$$dir/make.info' in install-info invocation (oops).
+
+ * vpath.c (construct_vpath_list): Only set LASTPATH set PATH when
+ we do not unlink and free PATH.
+
+ * file.c (print_file_data_base): Fix inverted calculation for
+ average files per hash bucket.
+
+ * read.c (readline): When we see a NUL, give only a warning and
+ synthesize a newline to terminate the building line (used to
+ fatal). Move fgets call into the loop condition, and after the
+ loop test ferror (used to test !feof in the loop).
+
+Fri Dec 3 16:40:31 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * configure.in: Check for strerror in AC_HAVE_FUNCS.
+
+Thu Dec 2 15:37:50 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ Differentiate different flavors of missing makefile error msgs,
+ removing gratuitous `fopen: ' and giving caller for included makefiles.
+ * misc.c [! HAVE_STRERROR]: Define our own strerror here.
+ (perror_with_name, pfatal_with_name): Use strerror instead of
+ replicating its functionality.
+ * read.c (read_makefile): Return int instead of void.
+ (read_all_makefiles, read_makefile): Change callers to notice zero
+ return and give error msg.
+
+Thu Nov 11 11:47:36 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * Version 3.69.1.
+
+ * default.c: Put `-G $@' before $< in SCCS cmds.
+
+Wed Nov 10 06:06:14 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * read.c (read_makefile): After trying a variable defn, notice if
+ the line begins with a tab, and diagnose an error.
+
+Sun Nov 7 08:07:37 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * Version 3.69.
+
+Wed Nov 3 06:54:33 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * Version 3.68.10.
+
+ * implicit.c (try_implicit_rule): Look for a normal rule before an
+ archive rule.
+
+Fri Oct 29 16:45:28 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * function.c (expand_function: `sort'): Double NWORDS when it
+ overflows, instead of adding five.
+
+ * compatMakefile (clean): Remove loadavg.
+
+Wed Oct 27 17:58:33 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * Version 3.68.9.
+
+ * file.h (NEW_MTIME): Define new macro.
+ * main.c (main): Set time of NEW_FILES to NEW_MTIME, not to
+ current time returned from system. Removed variable NOW.
+ * remake.c (notice_finished_file): Use NEW_MTIME in place of
+ current time here too.
+
+Tue Oct 26 19:45:35 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * Version 3.68.8.
+
+ * remake.c (update_file_1): Don't clear MUST_MAKE when FILE has no
+ cmds and !DEPS_CHANGED unless also !NOEXIST.
+
+Mon Oct 25 15:25:21 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * read.c (parse_file_seq): When converting multi-word archive
+ refs, ignore a word beginning with a '('.
+
+Fri Oct 22 02:53:38 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * configure.in: Check for sys/timeb.h.
+ * make.h [HAVE_SYS_TIMEB_H]: Test this before including it.
+
+Thu Oct 21 16:48:17 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * Version 3.68.7.
+
+ * rule.c (convert_suffix_rule): New local TARGPERCENT. Set it to
+ TARGNAME+1 for "(%.o)", to TARGNAME for "%.?". Use it in place of
+ TARGNAME to initialize PERCENTS[0].
+
+Mon Oct 18 06:49:35 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * configure.in: Use AC_HAVE_HEADERS(unistd.h) instead of AC_UNISTD_H.
+ Remove AC_USG; it is no longer used.
+
+ * file.c (print_file): New function, broken out of
+ print_file_data_base.
+ (print_file_data_base): Call it.
+ * rule.c (print_rule): New function, broken out of
+ print_rule_data_base.
+ (print_rule_data_base): Call it.
+
+Thu Oct 14 14:54:03 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * default.c (install_default_suffix_rules): New function, broken
+ out of install_default_implicit_rules.
+ (install_default_implicit_rules): Move suffix rule code there.
+ * make.h: Declare install_default_suffix_rules.
+ * main.c (main): Call install_default_suffix_rules before reading
+ makefiles. Move convert_to_pattern call before
+ install_default_implicit_rules.
+
+ * job.h (struct child): Make `pid' member type `pid_t' instead of
+ `int'.
+
+ * compatMakefile (RANLIB): New variable, set by configure.
+ (glob/libglob.a): Pass RANLIB value down to submake.
+
+ Fixes for SCO 3.2 "devsys 4.2" from pss@tfn.com (Peter Salvitti).
+ * make.h: Include <sys/timeb.h> before <time.h> for SCO lossage.
+ * job.c [! getdtablesize] [! HAVE_GETDTABLESIZE]: If NOFILE is not
+ defined but NOFILES_MAX is, define it to be that.
+
+Mon Oct 11 19:47:33 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * GNUmakefile (make-$(version).tar): Depend on acconfig.h, so it
+ is distributed.
+
+Sun Oct 3 15:15:33 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * default.c (default_terminal_rules): Add `-G $@' to SCCS get cmds.
+
+Tue Sep 28 14:18:20 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * job.c (construct_command_argv_internal): Add ^ to SH_CHARS; it
+ is another symbol for | in some shells.
+ * main.c (main): Add it to CMD_DEFS quoting list as well.
+
+Mon Sep 20 18:05:24 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * job.c (construct_command_argv_internal): Remove '=' from
+ SH_CHARS. Only punt on '=' if it is unquoted in a word before the
+ first word without an unquoted '='.
+
+ * main.c (define_makeflags): Set v_export for MAKEFLAGS.
+
+Fri Sep 17 00:37:18 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * remake.c (update_file_1): Use .DEFAULT cmds for phony targets.
+
+ * make.h [_AIX && _POSIX_SOURCE]: Define POSIX.
+
+ * commands.c (delete_child_targets): Don't delete phony files.
+
+ * job.c (start_job_command): Set COMMANDS_RECURSE in FLAGS if we
+ see a `+' at the beginning of the command line.
+
+Thu Sep 9 17:57:14 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * Version 3.68.6.
+
+Wed Sep 8 20:14:21 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * main.c (define_makeflags): Define MAKEFLAGS with o_file, not o_env.
+
+Mon Aug 30 12:31:58 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * expand.c (variable_expand): Fatal on an unterminated reference.
+
+Thu Aug 19 16:27:53 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * Version 3.68.5.
+
+ * variable.c (define_automatic_variables): Define new o_default
+ variable `MAKE_VERSION' from version_string and remote_description.
+
+ * make.h (version_string, remote_description): Declare these here.
+ * main.c: Don't declare version_string.
+ (print_version): Don't declare remote_description.
+
+Wed Aug 18 15:01:24 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * read.c (read_makefile): Free space pointed to by CONDITIONALS
+ before restoring the old pointer.
+
+Mon Aug 16 17:33:36 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * compatMakefile ($(objs)): Depend on config.h.
+
+ * GNUmakefile (build.sh.in): Depend on compatMakefile.
+
+ * configure.in: Touch stamp-config after AC_OUTPUT.
+
+Fri Aug 13 16:04:22 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * Version 3.68.4.
+
+Thu Aug 12 17:18:57 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * make.h: Include <config.h> instead of "config.h".
+
+Wed Aug 11 02:35:25 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * main.c (main): Make all variables interned from ENVP be v_export.
+ * variable.c (try_variable_definition): In v_default case, don't
+ check for an o_file variable that `getenv' finds.
+
+ * job.c (reap_children): New local variable ANY_LOCAL; set it
+ while setting ANY_REMOTE. If !ANY_LOCAL, don't wait for local kids.
+
+ * main.c (main): Don't call decode_env_switches on MFLAGS. DOC THIS.
+
+ * function.c (expand_function): #if 0 out freeing of ENVP since it
+ is environ.
+
+Mon Aug 9 17:37:20 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * Version 3.68.3.
+
+ * remote-stub.c (remote_status): Set errno to ECHILD before return.
+ * job.c (reap_children): Scan the chain for remote children and
+ never call remote_status if there are none.
+
+ * function.c (expand_function: `shell'): #if 0 out calling
+ target_environment; just set ENVP to environ instead.
+
+ * job.c (reap_children): Check for negative return from
+ remote_status and fatal for it.
+ When blocking local child wait returns 0, then try a blocking call
+ to remote_status.
+
+Tue Aug 3 00:19:00 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * compatMakefile (clean): Delete make.info* and make.dvi here.
+ (distclean): Not here.
+
+ * dep.h (RM_*): Use #defines instead of enum to avoid lossage from
+ compilers that don't like enum values used as ints.
+
+Mon Aug 2 16:46:34 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * compatMakefile (loadavg): Add $(LOADLIBES).
+
+Sun Aug 1 16:01:15 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * Version 3.68.2.
+
+ * compatMakefile (loadavg, check-loadavg): New targets.
+ (check): Depend on check-loadavg.
+
+ * compatMakefile (glob/libglob.a): Depend on config.h.
+
+ * misc.c (log_access): Write to stderr instead of stdout.
+
+Fri Jul 30 00:07:02 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * Version 3.68.1.
+
+Thu Jul 29 23:26:40 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * configure.in (SYS_SIGLIST_DECLARED): In test program include
+ <unistd.h> #ifdef HAVE_UNISTD_H.
+
+ * compatMakefile (.PHONY): Put after `all' et al.
+
+ * configure.in: Add AC_IRIX_SUN.
+
+Wed Jul 28 17:41:12 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * Version 3.68.
+
+Mon Jul 26 14:36:49 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * Version 3.67.8.
+
+Sun Jul 25 22:09:08 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * Version 3.67.7.
+
+ * compatMakefile ($(infodir)/make.info): Don't use $(instname).
+ Run install-info script if present.
+
+Fri Jul 23 16:03:50 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * make.h [STAT_MACROS_BROKEN]: Test this instead of [uts].
+
+ * configure.in: Add AC_STAT_MACROS_BROKEN.
+
+Wed Jul 14 18:48:11 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * Version 3.67.6.
+
+ * read.c (read_makefile): Recognize directive `-include', like
+ `include' but sets RM_DONTCARE flag.
+
+ * variable.c (target_environment): If FILE is nil, use
+ current_variable_set_list in place of FILE->variables.
+ * function.c (expand_function: `shell'): Get an environment for
+ the child from target_environment instead of using environ.
+
+ * dep.h: Declare read_all_makefiles here.
+ (RM_*): Define new enum constants.
+ * read.c (read_makefile): Second arg is FLAGS instead of TYPE.
+ Treat it as a bit mask containing RM_*.
+ (read_all_makefiles): For default makefiles, set D->changed to
+ RM_DONTCARE instead of 1.
+ * main.c: Don't declare read_all_makefiles here.
+ (main): Check `changed' member of read_makefiles elts for RM_*
+ flags instead of specific integer values.
+
+Mon Jul 12 22:42:17 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * make.h [sequent && i386]: #undef POSIX. From trost@cse.ogi.edu.
+
+Thu Jul 8 19:51:23 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * vpath.c (construct_vpath_list): If ELEM is zero 0, free PATTERN
+ as well as VPATH.
+ (build_vpath_lists): Empty `vpaths' around construct_vpath_list
+ call for $(VPATH). Expand $(strip $(VPATH)), not just $(VPATH).
+
+ * rule.c (convert_suffix_rule): Use alloca instead of xmalloc for
+ PERCENTS, whose storage is not consumed by create_pattern_rule.
+
+ * make.h [__mips && _SYSTYPE_SVR3]: #undef POSIX.
+
+Wed Jun 30 18:11:40 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * Version 3.67.5.
+
+ * rule.c (max_pattern_targets): New variable.
+ (count_implicit_rule_limits): Compute its value.
+ * rule.h: Declare it.
+ * implicit.c (pattern_search): Make TRYRULES max_target_patterns
+ times bigger. Move adding new TRYRULES elt inside the inner
+ targets loop, so each matching target gets its own elt in MATCHES
+ and CHECKED_LASTSLASH.
+
+ * file.c (remove_intermediates): If SIG!=0 say `intermediate file'
+ instead of just `file' in error msg.
+
+Fri Jun 25 14:55:15 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * job.c (construct_command_argv): Turn off
+ --warn-undefined-variables around expansion of SHELL and IFS.
+ * read.c (tilde_expand): Likewise for HOME.
+ (read_all_makefiles): Likewise for MAKEFILES.
+ * vpath.c (build_vpath_lists): Likewise for VPATH.
+
+ * main.c (warn_undefined_variables_flag): New flag variable.
+ (switches): Add --warn-undefined-variables.
+ * make.h (warn_undefined_variables_flag): Declare it.
+ * expand.c (warn_undefined): New function.
+ (reference_variable): Call it if the variable is undefined.
+ (variable_expand): In substitution ref, call warn_undefined if the
+ variable is undefined.
+
+ * default.c (default_pattern_rules): Add `%.c: %.w %.ch' and
+ `%.tex: %.w %.ch' rules.
+ (default_suffix_rules: .w.c, .w.tex): Pass three args: $< - $@.
+ (default_suffixes): Add `.ch'.
+
+Mon Jun 21 17:55:39 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * default.c (default_suffixes): Replace `.cweb' with `.w'.
+ (default_suffix_rules): Rename `.cweb.c' and `.cweb.tex' to `.w.c'
+ and `.w.tex'.
+
+Fri Jun 11 14:42:09 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * compatMakefile ($(bindir)/$(instname)): Add missing backslash.
+
+Thu Jun 10 18:14:08 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * Version 3.67.4.
+
+ * read.c (multi_glob): Don't free OLD and OLD->name in the
+ FOUND!=0 fork. Use new block-local variable F instead of
+ clobbering OLD.
+
+ * ar.c (glob_pattern_p): New function, snarfed from glob/glob.c.
+ (ar_glob): Call it; return nil immediately if MEMBER_PATTERN
+ contains no metacharacters.
+
+Wed Jun 9 16:25:35 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * ar.c (ar_glob{_match,_alphacompare}): New function.
+
+ * dep.h [! NO_ARCHIVES]: Declare it.
+ * read.c (multi_glob) [! NO_ARCHIVES]: Use it on archive member elts.
+
+ * read.c (read_makefile): Pass flag (1) to parse_file_seq, not to
+ multi_glob (which doesn't take a 3rd arg).
+ * rule.c (install_pattern_rule): Likewise.
+ * default.c (set_default_suffixes): Here too.
+ * function.c (string_glob): Don't pass gratuitous arg to multi_glob.
+
+ * read.c (parse_file_seq) [! NO_ARCHIVES]: Add post-processing
+ loop to translate archive refs "lib(a b)" into "lib(a) lib(b)".
+
+Mon Jun 7 19:26:51 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * compatMakefile (installdirs): Actually pass directory names.
+ ($(bindir)/$(instname)): Test chgrp&&chmod exit status with `if';
+ if it fails, echo a warning msg, but don't make the rule fail.
+
+ * read.c (tilde_expand): New function, broken out of tilde_expand.
+ (multi_glob): Call it.
+ (construct_include_path): Expand ~ in directory names.
+ * dep.h: Declare tilde_expand.
+ * main.c (enter_command_line_file): Expand ~ at the start of NAME.
+ (main): Expand ~ in -C args.
+ * read.c (read_makefile): Expand ~ in FILENAME unless TYPE==2.
+
+Fri Jun 4 13:34:47 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * main.c (decode_env_switches): Use xmalloc instead of alloca for ARGS.
+
+ * main.c (main): Put result of alloca in temporary variable with
+ simple assignment, to make SGI compiler happy.
+
+Thu Jun 3 20:15:46 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * Version 3.67.3.
+
+ * main.c (main): Before re-execing, remove intermediate files, and
+ print the data base under -p. Sexier debugging message.
+
+ * implicit.c (pattern_search): Allocate an extra copy of the name
+ of a winning intermediate file when putting it in FOUND_FILES.
+
+Wed Jun 2 16:38:08 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * read.c (read_makefile): Pass flag (1) to parse_file_seq, not to
+ multi_glob (which doesn't take a 3rd arg).
+
+ * dir.c (dir_contents_file_exists_p): When reading dirents, ignore
+ chars within D_NAMLEN that are NULs.
+
+ * main.c (decode_switches): Don't savestring ARGV[0] to put it
+ into `other_args'.
+ For string switch, don't savestring `optarg'.
+ (main): Don't free elts of makefiles->list that are "-".
+ Use alloca'd rather than savestring'd storage for elts of
+ makefiles->list that are temporary file names.
+ * read.c (read_all_makefiles): Don't free *MAKEFILES.
+ * file.c (enter_file): Don't strip `./'s.
+ * main.c (enter_command_line_file): New function.
+ (main): Use it in place of enter_file for command-line goals from
+ other_files, and for old_files and new_files.
+
+Mon May 31 18:41:40 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * Version 3.67.2.
+
+ * compatMakefile (.SUFFIXES): Add .info.
+ ($(infodir)/$(instname).info): Find make.info* in cwd if there,
+ else in $srcdir. Use basename to remove dir name from installed name.
+
+Thu May 27 17:35:02 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * implicit.c (pattern_search): When interning FOUND_FILES, try
+ lookup_file first; if found, free the storage for our copy of the name.
+
+Wed May 26 14:31:20 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * Version 3.67.1.
+
+ * main.c (decode_switches): In usage msg, write `--switch=ARG' or
+ `--switch[=OPTARG]' rather than `--switch ARG' or `--switch [ARG]'.
+
+Mon May 24 16:17:31 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * rule.c (convert_suffix_rule): New function.
+ (convert_to_pattern): Use it instead of doing all the work here
+ several times.
+ For target suffix `.a', generate both the archive magic rule and
+ the normal rule.
+
+ * compatMakefile (distclean): Remove stamp-config.
+
+Sat May 22 16:15:18 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * Version 3.67.
+
+ * file.c (remove_intermediates): Don't write extra space after `rm'.
+
+ * main.c (struct command_switch.type): Remove `usage_and_exit'.
+ (print_usage_flag): New variable.
+ (switches: --help): Make type `flag', to set print_usage_flag.
+ (init_switches): Remove `usage_and_exit' case.
+ (decode_switches): Likewise.
+ (decode_switches): Print usage if print_usage_flag is set.
+ When printing usage, die with status of BAD.
+ (main): Die with 0 if print_version_flag.
+
+Fri May 21 16:09:28 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * Version 3.66.
+
+Wed May 19 21:30:44 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * compatMakefile (installdirs): New target.
+ (install): Depend on it.
+
+Sun May 16 20:15:07 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * Version 3.65.2.
+
+Fri May 14 16:40:09 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * vpath.c (construct_vpath_list): In removal loop for DIRPATH==0,
+ set LASTPATH to PATH, not NEXT.
+
+ * dir.c (read_dirstream): Break out of loop after incrementing
+ DS->buckets such that it reaches DIRFILE_BUCKETS; avoid trying to
+ dereference DS->contents->files[DIRFILE_BUCKETS].
+
+ * read.c (read_makefile): Clear no_targets after reading a
+ targetful rule line.
+
+ * main.c (main): If print_version_flag is set, exit after printing
+ the version.
+ (switches): Change --version docstring to say it exits.
+
+ * make.h [butterfly]: #undef POSIX.
+
+Wed May 12 15:20:21 1993 Roland McGrath (roland@geech.gnu.ai.mit.edu)
+
+ * Version 3.65.1.
+
+ * arscan.c (ar_scan) [! AIAMAG]: Don't declare LONG_NAME.
+ [AIAMAG]: Pass TRUNCATE flag arg to (*FUNCTION), always zero.
+
+ * function.c (handle_function): Use fatal instead of
+ makefile_fatal when reading_filename is nil.
+
+ * configure.in: Add AC_GETGROUPS_T.
+ * job.c (search_path): Use GETGROUPS_T in place of gid_t.
+
+Sun May 9 15:41:25 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * Version 3.65.
+
+Fri May 7 18:34:56 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * function.c (handle_function): Fatal for unmatched paren.
+
+Thu May 6 16:13:41 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * Version 3.64.3.
+
+ * commands.c (handling_fatal_signal): New variable.
+ (fatal_error_signal): Set it.
+ * job.c (reap_children): Avoid nonreentrant operations if that is set.
+ * make.h: Declare handling_fatal_signal.
+
+ * expand.c (reference_variable): New function, snippet of code
+ broken out of simple-reference case of variable_expand.
+ (variable_expand): Use it for simple refs.
+ (variable_expand): When checking for a computed variable name,
+ notice a colon that comes before the final CLOSEPAREN. Expand
+ only up to the colon, and then replace the pending text with a
+ copy containing the expanded name and fall through to subst ref
+ handling.
+ (variable_expand): Don't bother expanding the name if a colon
+ appears before the first $.
+ (expand_argument): Use alloca instead of savestring.
+ (variable_expand): For subst ref, expand both sides of = before
+ passing to [pat]subst_expand. Use find_percent instead of lindex
+ to check the lhs for a %.
+
+Wed May 5 14:45:52 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * Version 3.64.2.
+
+Mon May 3 17:00:32 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * arscan.c (ar_name_equal) [AIAMAG]: Abort if TRUNCATED is nonzero.
+
+ * read.c (read_makefile): Pass extra arg of 1 to parse_file_seq,
+ not to multi_glob.
+
+Thu Apr 29 19:47:33 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * Version 3.64.1.
+
+ * arscan.c (ar_scan): New local flag var LONG_NAME. Set it when
+ we read the member name in any of the fashions that allow it to be
+ arbitrarily long. Pass its negation to FUNCTION.
+ (describe_member): Take TRUNCATED from ar_scan and print it.
+ (ar_name_equal): Take new arg TRUNCATED; if nonzero, compare only
+ the first sizeof (struct ar_hdr.ar_name) chars.
+ (ar_member_pos): Take TRUNCATED from ar_scan, pass to ar_name_equal.
+ * ar.c (ar_member_date_1): Likewise.
+
+Wed Apr 28 21:18:22 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * job.c (reap_children): Before calling start_job_command to start
+ the next command line, reset C->remote by calling start_remote_job_p.
+
+Mon Apr 26 15:56:15 1993 Roland McGrath (roland@geech.gnu.ai.mit.edu)
+
+ * arscan.c (ar_scan): New local var NAMEMAP.
+ In loop, rename NAME to NAMEBUF; new var NAME is a pointer; new
+ flag IS_NAMEMAP. When extracting the member name, always put a
+ null at its end first. If the name is "//" or "/ARFILENAMES", set
+ IS_NAMEMAP. If we have already read in NAMEMAP, and NAME looks
+ like " /N", get full name from NAMEMAP+N.
+ Else if NAME looks like "#1/N", read N chars from the
+ elt data to be the full name. At end of loop, if IS_NAMEMAP, read
+ the elt's data into alloca'd NAMEMAP.
+ (ar_name_equal): #if 0 truncating code.
+
+ * make.h: Don't declare vfork at all. It returns int anyway,
+ unless <unistd.h> declared it; and we conflicted with some systems.
+
+ * main.c (define_makeflags): If FLAGSTRING[1] is '-', define
+ MAKEFLAGS to all of FLAGSTRING, not &FLAGSTRING[1]. Don't want to
+ define it to something like "-no-print-directory".
+ Use %g format instead of %f for floating-valued things.
+
+Thu Apr 22 18:40:58 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * GNUmakefile (Makefile.in): Use a substitution ref on nolib-deps
+ to change remote-%.dep to remote-stub.dep.
+
+Wed Apr 21 15:17:54 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * Version 3.64.
+
+Fri Apr 16 14:22:22 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * compatMakefile (install): Remove - prefix from chgrp+chmod.
+
+ * Version 3.63.8.
+
+Thu Apr 15 18:24:07 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * acconfig.h: New file; contains "#undef SCCS_GET" for autoheader.
+ * configure.in: If /usr/sccs/get exists, define SCCS_GET to that,
+ else to "get".
+ * default.c (default_variables): Set GET to macro SCCS_GET.
+
+ * read.c (parse_file_seq): Take extra arg STRIP; strip `./' only
+ if nonzero. I hope this is the last time this argument is added
+ or removed.
+ (read_makefile): Pass it 1 when parsing include file names.
+ Pass it 1 when parsing target file names.
+ Pass it 1 when parsing static pattern target pattern names.
+ * rule.c (install_pattern_rule): Pass it 1 when parsing rule deps.
+ * default.c (set_default_suffixes): Pass it 1 when parsing
+ default_suffixes.
+ * function.c (string_glob): Pass it 0 here.
+
+Wed Apr 14 11:32:05 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * misc.c (log_access): New function.
+ ({init,user,make,child}_access): Call it.
+ (child_access): Abort if !access_inited.
+
+ * main.c (switches: --no-print-directory): Use 1 instead of -1 for
+ single-letter option.
+ (init_switches, decode_switches, define_makeflags): An option with
+ no single-letter version is no longer indicated by a value of -1;
+ instead a value that is !isalnum.
+ (init_switches): Don't put such switches into the string, only
+ into the long_option table.
+
+ * make.h [!NSIG] [!_NSIG]: #define NSIG 32.
+
+ * job.c [HAVE_WAITPID]: Remove #undef HAVE_UNION_WAIT. AIX's
+ bsdcc defined WIF* to use union wait.
+
+ * main.c (struct command_switch): Change member `c' to type int.
+ (switches): Make const.
+ (decode_switches): Use `const struct command_switch *'.
+ (define_makeflags): Likewise.
+
+ * default.c (default_suffix_rules): Add `-o $@' to makeinfo rules.
+
+Mon Apr 12 12:30:04 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * Version 3.63.7.
+
+ * configure.in (AC_HAVE_HEADERS): Check for string.h and memory.h.
+ Removed AC_MEMORY_H.
+ * make.h [USG, NeXT]: Don't test these.
+ [HAVE_STRING_H]: Test this to include string.h and define ANSI_STRING.
+ [HAVE_MEMORY_H]: Test this instead of NEED_MEMORY_H.
+ [! ANSI_STRING]: Put decls of bcopy et al here.
+ [sparc]: Don't test this for alloca.h; HAVE_ALLOCA_H is sufficient.
+ [HAVE_SIGSETMASK]: Test this rather than USG.
+ [__GNU_LIBRARY__ || POSIX]: Don't #include <unistd.h> again.
+ * main.c (main): Handle SIGCHLD if defined, and SIGCLD if defined.
+ It doesn't hurt to do both if they are both defined, and testing
+ USG is useless.
+ * dir.c: Rationalize directory header conditionals.
+ * arscan.c [HAVE_FCNTL_H]: Test this rather than USG || POSIX.
+
+ * default.c (default_suffixes): Add `.txinfo'.
+ (default_suffix_rules): Add `.txinfo.info' and `.txinfo.dvi' rules.
+
+ * variable.c (try_variable_definition): Replace RECURSIVE flag
+ with enum FLAVOR, which can be simple, recursive, or append.
+ Recognize += as append flavor. Set new variable VALUE in a switch
+ on FLAVOR. For append flavor, prepend the variable's old value.
+ If the variable was previously defined recursive, set FLAVOR to
+ recursive; if it was defined simple, expand the new value before
+ appending it to the old value. Pass RECURSIVE flag to
+ define_variable iff FLAVOR == recursive.
+
+ * variable.c (try_variable_definition): Use alloca and bcopy for
+ NAME, instead of savestring. Might as well use stack storage
+ since we free it immediately anyway.
+
+Thu Apr 8 18:04:43 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * job.c (start_waiting_jobs): Move decl of JOB outside of loop.
+
+ * main.c (define_makeflags): Rename `struct flag' member `switch'
+ to `cs', which is not a reserved word.
+
+Wed Apr 7 15:30:51 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * job.c (new_job): Call start_waiting_jobs first thing.
+ (start_waiting_job): Changed return type from void to int.
+ Return 0 when putting the child on the waiting_jobs chain.
+ (start_waiting_jobs): Don't check load and job_slots here.
+ Always take a job off the chain and call start_waiting_job on it;
+ give up and return when start_waiting_job returns zero.
+
+ * main.c (define_makeflags: struct flag): Change member `char c' to
+ `struct command_switch *switch'.
+ (ADD_FLAG): Set that to CS instead of CS->c.
+ If CS->c is -1, increment FLAGSLEN for the long name.
+ When writing out FLAGS, handle FLAGS->switch->c == -1 and write
+ the long name instead.
+
+ * compatMakefile (stamp-config): New target of old config.h rule.
+ Touch stamp-config after running config.status.
+ (config.h): Just depend on stamp-config, and have empty commands.
+
+Mon Apr 5 20:14:02 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * job.c [HAVE_WAITPID]: #undef HAVE_UNION_WAIT.
+
+ * configure.in (AC_HAVE_FUNCS): Check for psignal.
+
+Fri Apr 2 17:15:46 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * main.c (long_option_aliases): Remove "new"; it is already an
+ unambiguous prefix of "new-file".
+
+Sun Mar 28 16:57:17 1993 Roland McGrath (roland@geech.gnu.ai.mit.edu)
+
+ * Version 3.63.6.
+
+Wed Mar 24 14:26:19 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * vpath.c (selective_vpath_search): When adding the
+ name-within-directory at the end of NAME, and we don't add a
+ slash, don't copy FILENAME in one char too far into NAME.
+
+ * variable.c (define_automatic_variables): Find default_shell's
+ length with strlen, not numerology.
+
+Wed Mar 17 20:02:27 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * main.c (define_makeflags): Add the elts of a string option in
+ reverse order, so they come out right when reversed again.
+
+Fri Mar 12 15:38:45 1993 Roland McGrath (roland@geech.gnu.ai.mit.edu)
+
+ * compatMakefile (make.info): Use `-o make.info'.
+
+Thu Mar 11 14:13:00 1993 Roland McGrath (roland@geech.gnu.ai.mit.edu)
+
+ * compatMakefile (REMOTE): Set to @REMOTE@; change comments to
+ reflect new use.
+ (objs): Replace remote.o with remote-$(REMOTE).o.
+ (srcs): Replace remote.c with remote-$(REMOTE).c.
+ (remote.o): Rule removed.
+
+ * configure.in (REMOTE): Subst this in Makefile et al; default "stub".
+ Use AC_WITH to grok --with-customs arg to set REMOTE=cstms.
+ * GNUmakefile (build.sh.in): Filter out remote-% from objs list.
+ * build.template (REMOTE): New var; set to @REMOTE@.
+ (objs): Add remote-${REMOTE}.o.
+
+Wed Mar 10 15:12:24 1993 Roland McGrath (roland@geech.gnu.ai.mit.edu)
+
+ * Version 3.63.5.
+
+ * implicit.c (pattern_search): Fix "dependent"->"dependency" in
+ "Rejecting impossible" -d msg.
+
+ * file.c (file_hash_enter): New local vars {OLD,NEW}BUCKET. Store
+ mod'd values there; never mod {OLD,NEW}HASH.
+
+Mon Mar 8 13:32:48 1993 Roland McGrath (roland@geech.gnu.ai.mit.edu)
+
+ * remake.c [eta10]: Include <fcntl.h> instead of <sys/file.h>.
+
+ * compatMakefile (VPATH): Set this to @srcdir@.
+ (srcdir): Set this to $(VPATH).
+
+ * main.c (main): New local var DIRECTORY_BEFORE_CHDIR. Save in it
+ a copy of CURRENT_DIRECTORY after the first getcwd. Use it
+ instead of CURRENT_DIRECTORY when chdir'ing back before re-execing.
+
+ * remake.c (notice_finished_file): Pass missing SEARCH arg to f_mtime.
+
+ * read.c (read_makefile): Remove extraneous arg to parse_file_seq.
+
+Mon Feb 22 14:19:38 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * compatMakefile ($(infodir)/$(instname).info): Use , instead of /
+ as the sed delimiter char.
+
+Sun Feb 21 14:11:04 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * Version 3.63.4.
+
+ * rule.h (struct rule): Removed `subdir' member.
+ * rule.c (new_pattern_rule): No need to clear it.
+ (count_implicit_rule_limits): Set the `changed' flag in each dep
+ that refers to a nonexistent directory. No longer set rule-global
+ `subdir' flag with that information.
+ (print_rule_data_base): Don't record info on `subdir' flags.
+
+ * implicit.c (pattern_search): Check the DEP->changed flag rather
+ than the (now gone) RULE->subdir flag. Also test CHECK_LASTSLASH;
+ if it is set, the file might exist even though the DEP->changed
+ flag is set.
+
+ * rule.c (count_implicit_rule_limits): Pass "", not ".", as file
+ name arg to dir_file_exists_p to check for existence of directory.
+
+ * implicit.c (pattern_search): Inside dep-finding loop, set
+ CHECK_LASTSLASH from the value recorded in CHECKED_LASTSLASH[I],
+ rather than computing it anew.
+
+ * commands.c (set_file_variables): Must alloca space for PERCENT
+ and copy it, to avoid leaving the trailing `)' in the value.
+
+ * misc.c (remove_comments): Fixed backslash-checking loop
+ condition to allow it to look at the first char on the line.
+ P2 >= LINE, not P2 > LINE.
+
+ * compatMakefile ($(bindir)/$(instname)): Before moving $@.new to
+ $@, rm $@.old and mv $@ to $@.old.
+
+ * variable.c (try_variable_definition): Take new args FILENAME and
+ LINENO. Fatal if the variable name is empty.
+ * read.c (read_makefile): Change callers.
+ * main.c (main): Likewise.
+
+ * compatMakefile (group): Define to @KMEM_GROUP@, autoconf magic
+ that configure will replace with the group owning /dev/kmem.
+
+Mon Feb 8 14:26:43 1993 Roland McGrath (roland@geech.gnu.ai.mit.edu)
+
+ * vpath.c (vpath_search): Take second arg MTIME_PTR, pass thru to
+ selective_vpath_search.
+ (selective_vpath_search): Take second arg MTIME_PTR.
+ If the dir cache thinks a file exists, stat it to make sure, and
+ put the modtime in *MTIME_PTR.
+ * remake.c (library_search): Take second arg MTIME_PTR.
+ When we find a match, record its mtime there.
+ Pass MTIME_PTR through to vpath_search to do same.
+ (f_mtime): Pass &MTIME as new 2nd arg to {vpath,library}_search;
+ store it in FILE->last_mtime if set nonzero.
+ * implicit.c (pattern_search): Pass nil 2nd arg to vpath_search.
+
+ * compatMakefile (remote.o): Prepend `$(srcdir)/' to `remote-*.c',
+ so globbing looks somewhere it will find things.
+
+ * compatMakefile ($(infodir)/$(instname).info): Install `make.info*'
+ not `$(srcdir)/make.info*'; no need to use basename.
+
+Fri Feb 5 12:52:43 1993 Roland McGrath (roland@geech.gnu.ai.mit.edu)
+
+ * Version 3.63.3.
+
+ * compatMakefile (install): Add missing ;\s.
+
+ Make -, @, and + prefixes on a pre-expanded command line affect
+ all lines in the expansion, not just the first.
+ * commands.h (struct commands): Replace `lines_recurse' member
+ with `lines_flags'.
+ (COMMANDS_{RECURSE,SILENT,NOERROR}): New macros, bits to set in
+ that flag byte.
+ * commands.c (chop_commands): Set `lines_flags' instead of
+ `lines_recurse'. Record not only + but also @ and - prefixes.
+ * remake.c (notice_finished_file): Check the COMMANDS_RECURSE bit
+ in FILE->cmds->lines_flags, rather than FILE->cmds->lines_recurse.
+ * job.c (start_job_command): Replaced RECURSIVE and NOPRINT local
+ var with FLAGS; initialize it to the appropriate `lines_flags' byte.
+ Set CHILD->noerror if the COMMANDS_NOERROR bit is set in FLAGS.
+ Set the COMMANDS_SILENT bit in FLAGS for a @ prefix.
+
+ * remake.c (update_goal_chain): Set G->file to its prev after
+ checking for G being finished, since that check needs to examine
+ G->file.
+
+ * configure.in (union wait check) [HAVE_WAITPID]: Try using
+ waitpid with a `union wait' STATUS arg. If waitpid and union wait
+ don't work together, we should not use union wait.
+
+ * Version 3.63.2.
+
+ * remake.c (update_goal_chain): When G->file->updated, move
+ G->file to its prev. We aren't finished until G->file is nil.
+
+Thu Feb 4 12:53:04 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * main.c (starting_directory): New global variable.
+ (main): Set it to cwd after doing -Cs.
+ (log_working_directory): Use it, rather than computing each time.
+ * make.h: Declare it.
+
+ * compatMakefile (SHELL): Define to /bin/sh for losing Unix makes.
+
+ * main.c (decode_env_switches): Allocate (1 + LEN + 1) words for
+ ARGV, rather than LEN words plus one byte.
+
+Wed Feb 3 18:13:52 1993 Roland McGrath (roland@geech.gnu.ai.mit.edu)
+
+ * compatMakefile ($(bindir)/$(instname)): Put - before
+ install_setgid command line, so its failure won't be an error.
+ (infodir): New variable.
+ (install): Depend on $(infodir)/$(instname).info.
+ ($(infodir)/$(instname).info): New target.
+
+ * read.c (read_makefile): If FILENAMES is nil when we see a line
+ starting with a tab, don't treat it as a command. Just fall
+ through, rather than giving an error.
+
+ * read.c (read_makefile): If the NO_TARGETS flag is set when we see a
+ command line, don't clear it before continuing. We want
+ subsequent command lines to be ignored as well.
+
+ * job.c (new_job): Before expanding each command line, collapse
+ backslash-newline combinations that are inside var or fn references.
+
+Mon Feb 1 16:00:13 1993 Roland McGrath (roland@geech.gnu.ai.mit.edu)
+
+ * compatMakefile (exec_prefix): Default to $(prefix), not /usr/local.
+
+ * compatMakefile (make.info): Pass -I$(srcdir) to makeinfo.
+
+ * job.c [POSIX] (unblock_sigs): Made global.
+ [!POSIX] (unblock_sigs): Move defns to job.h.
+ * job.h [POSIX] (unblock_sigs): Declare.
+
+Sun Jan 31 19:11:05 1993 Roland McGrath (roland@geech.gnu.ai.mit.edu)
+
+ * read.c (read_makefile): In vpath parsing, after finding the
+ pattern token, take entire rest of line as the search path, not
+ just the next token.
+
+ * compatMakefile (remote.o): Depend on remote-*.c.
+
+Thu Jan 28 16:40:29 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * commands.c (set_file_variables): Don't define any F or D versions.
+ * variable.c (define_automatic_variables): Define them here as
+ recursively-expanded variables that use the dir and notdir funcs.
+
+ * variable.c (target_environment): In v_default case, don't export
+ o_default or o_automatic variables.
+
+ * configure.in (union wait check): Remove ` and ' inside C code;
+ they confuse the shell script.
+
+Mon Jan 25 13:10:42 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * Version 3.63.1.
+
+ * vpath.c (construct_vpath_list): When skipping further processing
+ of an elt that is ".", don't also skip the code that pushes P past
+ the next separator.
+
+ * compatMakefile (distclean): Don't remove make-*.
+
+ * configure.in (HAVE_UNION_WAIT): Try to use WEXITSTATUS if it's
+ defined. If one cannot use WEXITSTATUS with a `union wait'
+ argument, we don't want to believe the system has `union wait' at all.
+
+ * remake.c (update_file): Do nothing to print "up to date" msgs.
+ (update_goal_chain): Do it here instead.
+ Use the `changed' flag of each goal's `struct dep' to keep track
+ of whether files_remade (now commands_started) changed around a
+ call to update_file for that goal.
+ When a goal is finished, and its file's update_status is zero (i.e.,
+ success or nothing done), test the `changed' flag and give an "up
+ to date" msg iff it is clear.
+ * make.h (files_remade): Renamed to commands_started.
+ * remake.c: Changed defn.
+ (update_goal_chain): Changed uses.
+ * job.c (start_job_command): Increment commands_started here.
+ (reap_children): Not here.
+
+ * remake.c (update_goal_chain): Don't do anything with files'
+ `prev' members. update_file now completely handles this.
+
+ * variable.c (target_environment): Don't expand recursive
+ variables if they came from the environment.
+
+ * main.c (define_makeflags): For flags with omitted optional args,
+ store {"", 0} with ADD_FLAG. When constructing FLAGSTRING, a flag
+ so stored cannot have more flags appended to the same word.
+
+Fri Jan 22 14:46:16 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * variable.c (print_variable_set): In vars/bucket calculation,
+ don't spuriously multiply by 100.
+
+ * Version 3.63.
+
+ * job.c [!HAVE_UNION_WAIT] (WTERMSIG, WCOREDUMP, WEXITSTATUS):
+ Don't define if already defined.
+
+ * remake.c (update_file): Don't keep track of the command_state before
+ calling update_file_1. Remove local variable COMMANDS_FINISHED,
+ and don't test it to decide to print the "is up to date" msg.
+ Testing for files_remade having changed should always be sufficient.
+ The old method lost when we are called in the goal chain run on a
+ makefile, because the makefile's command_state is already
+ `cs_finished' from the makefile chain run.
+
+ * misc.c [HAVE_SETRE[GU]ID]: Test these to decl setre[gu]id.
+
+ * configure.in: Rewrote wait checking.
+ Use AC_HAVE_HEADERS to check for <sys/wait.h>.
+ Use AC_HAVE_FUNCS to check for waitpid and wait3.
+ Use a compile check to test just for `union wait'.
+ * job.c: Rewrote conditionals accordingly.
+ [HAVE_WAITPID]: Test this only to define WAIT_NOHANG.
+ [HAVE_WAIT3]: Likewise.
+ [HAVE_UNION_WAIT]: Test this to define WAIT_T and W*.
+
+ * configure.in: Set CFLAGS and LDFLAGS before all checks.
+
+ * dir.c: Add static forward decls of {open,read}_dirstream.
+
+Thu Jan 21 17:18:00 1993 Roland McGrath (roland@geech.gnu.ai.mit.edu)
+
+ * Version 3.62.31.
+
+ * job.c [NGROUPS_MAX && NGROUPS_MAX==0]: #undef NGROUPS_MAX.
+
+ * compatMakefile (CFLAGS, LDFLAGS): Set to @CFLAGS@/@LDFLAGS@.
+ * build.template (CFLAGS, LDFLAGS): Same here.
+ * configure.in: AC_SUBST(CFLAGS) and LDFLAGS.
+ Set them to -g if not defined in the environment.
+
+ * remake.c (library_search): Use LIBNAME consistently, setting it
+ only once, to be the passed name sans `-l'.
+ Pass new var FILE to be modified by vpath_search.
+
+Mon Jan 18 14:53:54 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * Version 3.62.30.
+
+ * job.c (start_waiting_jobs): Return when job_slots_used is equal to
+ job_slots.
+
+ * configure.in: Add AC_CONST for the sake of getopt.
+
+ * read.c (read_makefile): Continue after parsing `override'
+ directive, rather than falling through to lossage.
+ Check for EOL or blank after "override define".
+
+ * compatMakefile (.c.o, remote.o): Put $(CFLAGS) after other switches.
+
+Fri Jan 15 12:52:52 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * Version 3.62.29.
+
+ * main.c (define_makeflags): After writing everything into
+ FLAGSTRING, only back up two chars if [-1] is a dash, meaning we
+ just wrote " -". Always terminate the string at *P.
+
+ * remake.c (library_search): When constructing names in std dirs,
+ use &(*LIB)[2] for the stem, not LIBNAME (which points at the
+ buffer we are writing into!).
+
+Thu Jan 14 13:50:06 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * read.c (read_makefile): Set IN_IGNORED_DEFINE for "override
+ define" when IGNORING is true.
+
+ * compatMakefile (distclean): Remove config.status and build.sh.
+
+Wed Jan 13 16:01:12 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * Version 3.62.28.
+
+ * misc.c (xmalloc, xrealloc): Cast result of malloc/realloc to
+ (char *).
+
+ * arscan.c (ar_scan) [AIAMAG]: Cast read arg to (char *).
+
+ * variable.c (define_automatic_variables): Override SHELL value for
+ origin o_env_override as well as o_env.
+
+ * GNUmakefile (build.sh.in): Don't replace %globobjs%. Instead,
+ add the names of the glob objects (w/subdir) to %objs%.
+ * build.template (globobjs): Removed.
+ Take basename of $objs before linking.
+
+Tue Jan 12 12:31:06 1993 Roland McGrath (roland@geech.gnu.ai.mit.edu)
+
+ * Version 3.62.27.
+
+ * configure.in (AC_OUTPUT): Also edit build.sh.
+ * build.template: New file.
+ * GNUmakefile (build.sh.in): New rule to create it from build.template.
+ (make-$(version).tar.Z): Depend on build.sh.in.
+
+ * main.c (die): Call print_data_base if -p.
+ (main): Don't call it here.
+
+ * compatMakefile (defines): Add @DEFS@. configure should turn this
+ into -DHAVE_CONFIG_H.
+
+Mon Jan 11 14:39:23 1993 Roland McGrath (roland@geech.gnu.ai.mit.edu)
+
+ * Version 3.62.26.
+
+ * misc.c (init_access): Surround with #ifdef GETLOADAVG_PRIVILEGED.
+ ({make,user,child}_access) [! GETLOADAVG_PRIVILEGED]: Make no-op.
+ * compatMakefile (install_setgid): New var, set by configure.
+ (install): Install setgid $(group) only if $(install_setgid) is true.
+
+Fri Jan 8 15:31:55 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * job.c (load_too_high): If getloadavg fails with errno==0, give a
+ message saying that load limits are not supported.
+
+ * vpath.c (construct_vpath_list): Rewrote path deletion code to
+ not try to use PATH's next link after freeing PATH.
+
+ * main.c (define_makeflags): Rewritten; now handles string-valued
+ option, and has no arbitrary limits.
+ (switches): Set `toenv' flag for -I and -v.
+
+ * main.c (decode_env_switches): Cast return value of alloca to char *.
+
+ * misc.c (child_access) [HAVE_SETREUID, HAVE_SETREGID]: Use
+ setre[gu]id in place of set[gu]id.
+
+Wed Jan 6 15:06:12 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * main.c (main): Define MAKEOVERRIDES, MAKE, and MAKE_COMMAND with
+ origin o_default.
+
+ * make.h [POSIX]: Don't test this to use ANSI_STRING.
+ Testing STDC_HEADERS should be sufficient.
+
+ * job.h: Declare start_waiting_jobs.
+
+ * read.c (read_makefile): Add missing parens in if stmt that find
+ conditional directives.
+
+ * main.c (main): Declare init_dir.
+ * implicit.c (pattern_search): Always use two % specs in a
+ DEBUGP2, and always pass two non-nil args.
+ Cast field width args to int.
+ Add missing parens in !RULE->subdir if stmt.
+ * function.c (expand_function, patsubst_expand): Add parens around
+ assignments inside `while' stmts.
+ * commands.c (print_commands): Cast field width args to int.
+
+ * read.c (do_define): Cast return value of alloca to (char *).
+
+ * main.c (init_switches): New function, broken out of decode_switches.
+ (decode_switches): Take new arg ENV. If set, ignore non-option
+ args; print no error msgs; ignore options with clear `env' flags.
+ (decode_env_switches): Rewritten to chop envar value into words
+ and pass them to decode_switches.
+ (switches): Set `env' flag for -I and -v.
+
+ * dir.c (init_dir): Cast free to __glob_closedir_hook's type.
+
+Tue Jan 5 14:52:15 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * Version 3.62.25.
+
+ * job.c [HAVE_SYS_WAIT || !USG]: Don't #include <sys/time.h> and
+ <sys/resource.h>. <sys/time.h> interacts badly with <time.h>, and
+ we don't need these anyway.
+
+ * configure.in (AC_HAVE_FUNCS): Check for setre[gu]id.
+ * misc.c ({user,make}_access): Test #ifndef HAVE_SETRE[GU]ID, not
+ #ifdef POSIX || USG. SunOS 4.1 is supposedly POSIX.1 compliant,
+ but its set[gu]id functions aren't; its setre[gu]id functions work.
+
+ * misc.c ({user,make,child}_access): Give name of caller in error msgs.
+
+ * job.c (load_too_high): Say "cannot enforce load limit" in error msg.
+
+ * configure.in: Call AC_PROG_CC.
+ * compatMakefile (CC): Define to @CC@ (autoconf magic).
+
+ * compatMakefile: Add .NOEXPORT magic target.
+
+Mon Jan 4 17:00:03 1993 Roland McGrath (roland@geech.gnu.ai.mit.edu)
+
+ * main.c (print_version): Updated copyright to include 93.
+
+Thu Dec 31 12:26:15 1992 Roland McGrath (roland@geech.gnu.ai.mit.edu)
+
+ * make.h [_AIX]: Don't declare alloca.
+
+Tue Dec 29 13:45:13 1992 Roland McGrath (roland@geech.gnu.ai.mit.edu)
+
+ * Version 3.62.24.
+
+ * compatMakefile (objs): Add signame.o.
+ (srcs): Add signame.[ch].
+
+ * compatMakefile (srcs): Add config.h.in.
+ (remote.o): Add -I. before -I$(srcdir).
+
+Mon Dec 28 15:51:26 1992 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * Version 3.62.23.
+
+ * read.c (readline): Fatal when LEN==0, indicating a line starting
+ with a NUL.
+ (readline): Take new arg LINENO, for use in error msg.
+ (read_makefile, do_define): Pass it.
+
+ * compatMakefile (glob/libglob.a): Pass -DHAVE_CONFIG_H in CPPFLAGS.
+ (.c.o): Add -I. before -I$(srcdir).
+
+Wed Dec 23 12:12:04 1992 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * read.c (read_makefile): Accept and ignore a rule with no targets.
+
+ * compatMakefile (ALLOCA_SRC): New variable.
+ (srcs): Include its value.
+
+ * read.c (struct conditional): Renamed member `max_ignoring' to
+ `allocated'; added new member `seen_else'.
+ (conditional_line): Initialize seen_else flag when starting an `if...';
+ set it when we see an `else'; fatal if set when we see `else'.
+ (read_makefile): Fatal "missing `endif'" if there are any pending
+ conditionals, not just if we are still ignoring.
+
+Tue Dec 22 15:36:28 1992 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * compatMakefile (manext): Set to 1, not l.
+ ($(mandir)/$(instname).$(manext)): Use $(srcdir) for make.man in cmds.
+
+ * file.c (file_hash_enter): Don't call uniquize_deps here.
+ * read.c (record_files): Likewise.
+ * implicit.c (pattern_search): Likewise.
+ * commands.c (set_file_variables): Call it only here.
+
+ * default.c (default_variables) [__convex__]: FC=fc.
+
+ * variable.c (target_environment): Expand the values of recursively
+ expanded variables when putting them into the environment.
+ * expand.c (recursively_expand): Made global.
+ * make.h (recursively_expand): Declare it.
+
+ * remake.c (check_dep): Set FILE->command_state to cs_deps_running
+ when a dep's command_state is cs_running or cs_deps_running.
+
+ * read.c (read_makefile): Changed error msg for spurious cmds to
+ not say "first target".
+
+Sun Dec 20 17:56:09 1992 Roland McGrath (roland@albert.gnu.ai.mit.edu)
+
+ * configure.in: Do AC_CONFIG_HEADER right after AC_INIT.
+ * make.h (HAVE_CONFIG_H): #include "config.h", then #define this.
+ * compatMakefile (config.h, configure, config.h.in): New rules.
+ (defines): Removed @DEFS@.
+
+Thu Dec 17 16:11:40 1992 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * compatMakefile (realclean): Just depend on distclean; no cmds.
+ (distclean): Do what realclean did before; also remove Makefile and
+ config.h; don't remove configure.
+ (info, dvi): New targets; depend on make.{info,dvi}.
+ (doc): Removed target.
+ (MAKEINFO, TEXI2DVI): New vars.
+ (make.info, make.dvi): Use them instead of explicit cmds.
+
+Wed Dec 16 16:25:24 1992 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * configure.in: Added fcntl.h to AC_HAVE_HEADERS. getloadavg cares.
+
+Wed Dec 9 15:21:01 1992 Roland McGrath (roland@geech.gnu.ai.mit.edu)
+
+ * main.c (long_option_aliases): Add --new-file alias for -W.
+
+ * default.c (default_variables): Change all C++ to CXX and C++FLAGS
+ to CXXFLAGS.
+
+ * read.c (do_define): Expand the variable name before using it.
+
+ * main.c (main): Define variable "MAKE_COMMAND" to argv[0];
+ define "MAKE=$(MAKE_COMMAND) $(MAKEOVERRIDES)" always.
+
+ * remake.c (library_search): Search for libNAME.a in cwd; look in
+ vpath before looking in standard dirs, not after.
+ Changed order of std dirs to: /lib, /usr/lib, ${prefix}/lib.
+
+Mon Nov 23 14:57:34 1992 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * default.c (default_pattern_rules, default_terminal_rules): Added
+ brackets around initializers.
+
+ * variable.c (try_variable_definition): Don't check for LINE[0]=='\t'.
+ (try_variable_definition): Expand the name before defining the var.
+
+ * job.c (init_siglist): Removed function.
+ Removed decl of `sys_siglist'.
+ * make.h [! HAVE_SYS_SIGLIST]: #include "signame.h".
+ [HAVE_SYS_SIGLIST && !SYS_SIGLIST_DECLARED]: Declare sys_siglist
+ only under these conditions.
+ * main.c (main): Don't declare init_siglist.
+ (main) [! HAVE_SYS_SIGLIST]: Call signame_init instead of init_siglist.
+
+Wed Nov 18 14:52:51 1992 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * read.c (record_files): Don't try to append to FIRSTDEPS if it's
+ nil; instead just set it to MOREDEPS.
+
+Mon Nov 16 17:49:17 1992 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * vpath.c (construct_vpath_list): Initialize P to DIRPATH before
+ loop that sets MAXELEM.
+
+Fri Nov 13 18:23:18 1992 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * Version 3.62.22.
+
+Thu Nov 12 15:45:31 1992 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * job.c (start_job_command): Under -n, increment files_remade after
+ processing (i.e., printing) all command lines.
+
+Tue Nov 10 15:33:53 1992 Roland McGrath (roland@geech.gnu.ai.mit.edu)
+
+ * read.c (record_files): Append new deps if this rule has no
+ commands; prepend them to existing deps if this rule has no commands.
+
+ * dir.c (open_dirstream): Return nil if DIR->contents->files is nil.
+
+ * read.c (parse_file_seq): Removed last arg STRIP. Always strip `./'s.
+ (read_makefile): Changed callers.
+ * function.c (string_glob): Likewise.
+ * rule.c (install_pattern_rule): Likewise.
+
+Mon Nov 9 17:50:16 1992 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * remake.c (files_remade): Made global.
+ (notice_finished_file): Don't increment files_remade here; this
+ function gets called in many situations where no remaking was in
+ fact done.
+ * job.c (reap_children): Do it here instead, when we know that
+ actual commands have been run for the file.
+ * make.h (files_remade): Declare it.
+
+Thu Nov 5 18:26:10 1992 Roland McGrath (roland@geech.gnu.ai.mit.edu)
+
+ * vpath.c (construct_vpath_list): Allow blanks as well as colons to
+ separate elts in the search path.
+
+ * read.c (read_makefile): Don't fatal on extra tokens in `vpath'.
+ The search path can contain spaces now.
+
+Tue Nov 3 20:44:32 1992 Roland McGrath (roland@geech.gnu.ai.mit.edu)
+
+ * compatMakefile (check): New target; no-op.
+
+ * file.c (file_hash_enter): Mod OLDHASH by FILE_BUCKETS after
+ testing for OLDHASH==0 but before using the value.
+ (rename_file): Don't mod OLDHASH by FILE_BUCKETS before passing it
+ to file_hash_enter.
+
+ * file.c (rename_file): Notice when OLDFILE->cmds came from
+ default.c, and don't try to print ->filename in that case.
+
+Sun Oct 25 01:48:23 1992 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * remake.c (update_file): Don't process F->also_make here.
+ (notice_finished_file): Don't process FILE->also_make if no attempt
+ to update FILE was actually made.
+ Fixed to call f_mtime directly to refresh their modtimes.
+
+Sat Oct 24 22:08:59 1992 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * read.c (find_percent): Don't increment P again after skipping
+ an escaped %.
+
+ * expand.c (variable_expand): In call to patsubst_expand, don't
+ find `%'s ourselves; let that function do it.
+
+ * read.c (read_makefile: record_waiting_files): Don't call
+ record_files if FILENAMES is nil.
+ (read_makefile): All alternatives in the parsing, except for rule
+ lines, fall through to the end of the loop. At the end of the
+ loop, do record_waiting_files so we notice later spurious cmds.
+
+Fri Oct 23 15:57:37 1992 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * variable.c (define_automatic_variables): Free old value of SHELL
+ before replacing it.
+
+Thu Oct 15 18:57:56 1992 Roland McGrath (roland@geech.gnu.ai.mit.edu)
+
+ * compatMakefile (.c.o): Add -I$(srcdir)/glob to flags.
+
+ * dir.c (open_dirstream): Cast return value to __ptr_t.
+
+ * default.c (default_variables: "GET") [_IBMR2]: Use USG defn.
+
+ * make.h (MAXPATHLEN): Moved out of #ifndef POSIX.
+ (GET_PATH_MAX): Moved from #ifdef POSIX to #ifdef PATH_MAX #else.
+ Define as (get_path_max ()).
+ [! PATH_MAX] (NEED_GET_PATH_MAX): Define.
+ [! PATH_MAX] (get_path_max): Declare fn.
+ * misc.c [NEED_GET_PATH_MAX] (get_path_max): New function.
+
+Mon Oct 12 13:34:45 1992 Roland McGrath (roland@geech.gnu.ai.mit.edu)
+
+ * Version 3.62.21.
+
+ * job.c (sys_siglist): Only declare #ifndef SYS_SIGLIST_DECLARED.
+ * make.h [! HAVE_SYS_SIGLIST && HAVE__SYS_SIGLIST]: #define
+ SYS_SIGLIST_DECLARED.
+
+ * dir.c (file_impossible): When initializing DIR->contents, set
+ DIR->contents->dirstream to nil.
+
+ * compatMakefile (GLOB): Define new variable.
+ (objs): Use it, rather than glob/libglob.a explicitly.
+
+ * read.c (parse_file_seq): When stripping "./", handle cases like
+ ".///foo" and "./////".
+ * file.c (lookup_file, enter_file): Likewise.
+
+Sun Oct 11 17:00:35 1992 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * dir.c (struct dirstream, {open,read}_dirstream): New
+ data type and functions to read a directory sequentially.
+ (init_dir): New function to hook it into glob.
+ * main.c (main): Call init_dir.
+
+ * compatMakefile (objs): Added glob/libglob.a.
+ * configure.in: Remove code to test for glob.
+
+Fri Oct 9 12:08:30 1992 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * read.c (record_files): Generalized test for NAME pointing
+ somewhere into F->name.
+
+ * variable.c (define_variable_in_set): Free old value when replacing.
+
+ * read.c (do_define): Free the linebuffer before returning.
+ (record_files): When clearing .SUFFIXES deps, free their data.
+ (multi_glob): Free OLD and its data when replacing it with results
+ of glob run.
+
+ * commands.c (set_file_variables): Use alloca in place of xmalloc
+ for temp space for $^, $?, et al.
+
+ * dir.c (struct directory): New member `contents' replaces `files'
+ and `dirstream'.
+ (struct directory_contents): New type.
+ (directories_contents): New hash table.
+ (dir_struct_file_exists_p): Take a struct directory_contents.
+ (dir_file_exists_p): Pass it the `contents' member of the dir found.
+ (dir_struct_file_exists_p): Renamed to dir_contents_file_exists_p;
+ made static. Return 0 if DIR is nil (meaning it couldn't be stat'd).
+ (dir_file_exists_p, find_directory): Change all callers.
+ (file_impossible): Use DIR->contents, initializing it if nil.
+ (print_dir_data_base): Use DIR->contents, and print out device and
+ inode numbers with each directory.
+
+ * Changes for performance win from John Gilmore <gnu@cygnus.com>:
+ * dir.c (DIRECTORY_BUCKETS): Increase to 199.
+ (DIRFILE_BUCKETS): Decrease to 107.
+ (find_directory): Allocate and zero a multiple of
+ sizeof (struct dirfile *), not of sizeof (struct dirfile).
+ (dir_struct_file_exists_p): New function, nearly all code from
+ dir_file_exists_p.
+ (dir_file_exists_p): Just call find_directory+dir_struct_file_exists_p.
+ * vpath.c (selective_vpath_search): Remove redundant
+ dir_file_exists_p call.
+
+ * configure.in: Comment out glob check; always use our code.
+
+Fri Oct 2 19:41:20 1992 Roland McGrath (roland@geech.gnu.ai.mit.edu)
+
+ * make.h [! HAVE_SYS_SIGLIST && HAVE__SYS_SIGLIST]: #define
+ HAVE_SYS_SIGLIST; after doing #define sys_siglist _sys_siglist, we
+ do have it.
+
+Wed Sep 30 19:21:01 1992 Roland McGrath (roland@geech.gnu.ai.mit.edu)
+
+ * main.c (main): Don't do -w automatically if -s.
+
+Tue Sep 29 21:07:55 1992 Roland McGrath (roland@geech.gnu.ai.mit.edu)
+
+ * main.c (printed_version): Move variable inside print_version.
+ (print_version): Return immediately if printed_version is set.
+ (die): Don't test printed_version here.
+ (decode_switches): Under -v, do print_version before giving usage.
+ (DESCRIPTION_COLUMN): New macro.
+ (decode_switches): Use it when printing the usage message.
+ Leave at least two spaces between options and their descriptions.
+
+Fri Sep 25 13:12:42 1992 Roland McGrath (roland@geech.gnu.ai.mit.edu)
+
+ * Version 3.62.20.
+
+Wed Sep 16 16:15:22 1992 Roland McGrath (roland@geech.gnu.ai.mit.edu)
+
+ * read.c (read_makefile): Save errno value from trying to open
+ FILENAME, and restore it before erring; otherwise we get the errno
+ value from the last elt of the search path.
+
+Tue Sep 15 15:12:47 1992 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * main.c (long_option_aliases): Add --stop for -S.
+
+ * read.c (word1eq): Do strncmp before dereferencing someplace that
+ may be out in space.
+
+Wed Sep 9 15:50:41 1992 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * remake.c (notice_finished_file): If all the command lines were
+ recursive, don't do the touching.
+
+ * job.c (start_job_command): Don't check for + here.
+ * commands.c (chop_commands): Do it here instead.
+
+ * default.c (default_terminal_rules): Prepend + to cmds for RCS.
+
+Wed Sep 2 17:53:08 1992 Roland McGrath (roland@geech.gnu.ai.mit.edu)
+
+ * compatMakefile (objs): Include $(ALLOCA).
+
+ * make.h [CRAY]: Move #define signal bsdsignal to before #includes.
+
+Thu Aug 27 17:45:43 1992 Roland McGrath (roland@wookumz.gnu.ai.mit.edu)
+
+ * read.c (default_include_directories): Add INCLUDEDIR first.
+ * compatMakefile (includedir): Define.
+ (defines): Add -D for INCLUDEDIR="$(includedir)".
+
+ * read.c (read_makefile): Grok multiple files in `include';
+ globbing too.
+
+ * remake.c (library_search): New function.
+ (library_file_mtime): Remove function.
+ (f_mtime): Use library_search instead of library_file_mtime.
+ * compatMakefile (libdir): Define.
+ (defines): Add -D for LIBDIR="$(libdir)".
+ * make.texinfo (Libraries/Search): Document change.
+
+ * file.c (rename_file): Fix file_hash_enter call with missing arg.
+
+Wed Aug 26 17:10:46 1992 Roland McGrath (roland@geech.gnu.ai.mit.edu)
+
+ * Version 3.62.19.
+
+ * main.c (main): Set command_state to cs_finished for temp files
+ made for stdin makefiles.
+
+ * main.c (decode_switches): Don't tell getopt to return non-option
+ args in order.
+ Ignore an argument of `-'.
+
+Thu Aug 20 13:36:04 1992 Roland McGrath (roland@geech.gnu.ai.mit.edu)
+
+ * job.c (start_job_command): If (touch_flag && !RECURSIVE), ignore
+ the command line and go to the next.
+ (notice_finished_file): Under -t, touch FILE.
+ * remake.c (remake_file): Don't touch it here.
+
+Wed Aug 19 16:06:09 1992 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * function.c (pattern_matches): Use temporary for strlen (WORD)
+ instead of two function calls.
+
+ * compatMakefile (LOAD_AVG): Remove variable and comments.
+
+Tue Aug 18 14:58:58 1992 Roland McGrath (roland@geech.gnu.ai.mit.edu)
+
+ * make.texinfo (Running): Node renamed to `make Invocation'.
+
+Fri Aug 14 12:27:10 1992 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * arscan.c (ar_name_equal): Don't compare [MAX-3..MAX] if
+ NAMELEN != MEMLEN.
+
+Thu Aug 13 17:50:09 1992 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * Version 3.62.18.
+
+ * main.c: Don't #include <time.h>; make.h already does.
+
+Mon Aug 10 17:03:01 1992 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * implicit.c (pattern_search): Fixed copying of suffix when building
+ also_make elts.
+
+ * function.c (expand_function: `shell'): Make sure BUFFER is
+ null-terminated before replacing newlines.
+
+ * compatMakefile (mandir): Use man$(manext), not always manl.
+
+Sun Aug 2 01:42:50 1992 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * rule.c (new_pattern_rule): Not static.
+ * rule.h: Declare it.
+
+ * file.c (file_hash_enter): New function, most code from rename_file.
+ (rename_file): Call it.
+ * file.h (file_hash_enter): Declare it.
+
+ * dep.h: Doc fix.
+
+Thu Jul 30 15:40:48 1992 Roland McGrath (roland@geech.gnu.ai.mit.edu)
+
+ * main.c (decode_switches): Handle usage_and_exit when building
+ long options vector.
+
+ * default.c (default_terminal_rules): Make RCS rules use $(CHECKOUT,v).
+ (default_variables): Define CHECKOUT,v (hairy).
+
+ * make.h [!HAVE_SYS_SIGLIST && HAVE__SYS_SIGLIST]: #define
+ sys_siglist to _sys_siglist.
+
+Sun Jul 26 16:56:32 1992 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * NEWS: Add header and tail copyright info like Emacs NEWS.
+
+ * make.h [ANSI_STRING]: Don't #define index, rindex, bcmp, bzero,
+ bcopy if already #define'd.
+ [STDC_HEADERS] (qsort, abort, exit): Declare here.
+ [! __GNU_LIBRARY__ && !POSIX]: Not here.
+
+ * make.h [_AIX]: #pragma alloca first thing.
+
+ * job.c (start_waiting_job): Set the command_state to cs_running
+ when we queue a job on waiting_jobs.
+
+Fri Jul 24 02:16:28 1992 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * variable.c (define_automatic_variables): Use "" instead of nil
+ for empty value.
+
+Thu Jul 23 22:31:18 1992 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * Version 3.62.17.
+
+ * main.c (struct command_switch.type): Add alternative usage_and_exit.
+ (command_switches): Add -h/--help.
+
+Thu Jul 16 14:27:50 1992 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * GNUmakefile (make-$(version).tar.Z): Include NEWS, not CHANGES.
+ * README.template: Mention NEWS.
+ * CHANGES: Renamed to NEWS.
+
+ * main.c [! STDC_HEADERS] [sun]: Don't declare exit.
+
+Tue Jul 14 18:48:41 1992 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * main.c (main): Set -o files' command_states to cs_finished.
+
+ * rule.c (count_implicit_rule_limits): Decrement num_pattern_rules
+ when tossing a rule.
+
+ * main.c (main): Use alloca only in simple local var assignment,
+ for braindead SGI compiler.
+
+ * rule.c (print_rule_data_base): Barf if num_pattern_rules is
+ inconsistent with the number computed when listing them.
+
+Mon Jul 13 17:51:53 1992 Roland McGrath (roland@geech.gnu.ai.mit.edu)
+
+ * commands.c (set_file_variables): For $? and $^ elts that are archive
+ member refs, use member name only.
+
+Fri Jul 10 00:05:04 1992 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * variable.h (struct variable.export): Add new alternative v_ifset.
+ * variable.c (target_environment): Check for it.
+ (define_automatic_variables): Set it for MAKEFILES.
+
+Thu Jul 9 21:24:28 1992 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * compatMakefile (objs): Remove getloadavg.o; $(extras) gets it.
+ (remote.o): Use $(srcdir)/remote.c, not $remote.c<.
+ (distclean, mostlyclean): New targets.
+
+Tue Jul 7 19:12:49 1992 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * Version 3.62.16.
+
+ * compatMakefile (config.status): Remove rule.
+
+ * job.c (start_waiting_job): Free C after using C->file, not before.
+
+Sat Jul 4 20:51:49 1992 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * commands.c, job.c, main.c, make.h, remote-cstms.c: Use #ifdef
+ HAVE_* instead of #ifndef *_MISSING.
+ * configure.in: Use AC_HAVE_FUNCS instead of AC_MISSING_FUNCS (gone).
+
+Thu Jul 2 18:47:52 1992 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * main.c (main): makelevel>0 or -C implies -w.
+
+Tue Jun 30 20:50:17 1992 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * file.c, job.c, function.c: Don't #include <errno.h>.
+ make.h: Do it here instead.
+ * arscan.c (ar_member_touch): Don't declare errno.
+
+Thu Jun 25 17:06:55 1992 Roland McGrath (roland@geech.gnu.ai.mit.edu)
+
+ * GNUmakefile (make-$(version).tar.Z): Depend on INSTALL, configure.in.
+
+ * remake.c (update_file): If commands or deps are running after
+ update_file_1 returns, break out of the :: rule (->prev) loop and
+ just return.
+
+ * job.c (job_next_command): New function; code from start_job.
+ (start_job_command): Renamed from start_job. Call job_next_command
+ and recurse for empty command lines and -n.
+ (start_waiting_job): Call start_job_command, not start_job.
+ (new_job): Call job_next_command to prime the child structure, and
+ then call start_waiting_job.
+ (reap_children): Use job_next_command and start_job_command.
+ (start_waiting_job): Call start_remote_job_p here, and store its
+ result in C->remote. If zero, check the load average and
+ maybe put C on waiting_jobs.
+ (start_job_command): Test CHILD->remote rather than calling
+ start_remote_job_p. Don't do load avg checking at all here.
+
+ * main.c (main): Don't handle SIGILL, SIGIOT, SIGEMT, SIGBUS,
+ SIGSEGV, SIGFPE or SIGTRAP.
+
+ * compatMakefile (glob/libglob.a): Don't pass srcdir to sub-make.
+ configure will set it in glob/Makefile.
+
+Wed Jun 24 19:40:34 1992 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * dir.c [DIRENT] (direct): Don't define to dirent.
+ [! DIRENT] (direct): Define to dirent.
+ (dir_file_exists_p): Use struct dirent instead of struct direct.
+
+ * make.h (getcwd): No space between macro and ( for args!
+
+ * job.c (start_job): Don't put the job on waiting_jobs if
+ job_slots_used==0.
+
+ * make.texinfo (Missing): Shortened title.
+
+Tue Jun 23 18:42:21 1992 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * file.c (remove_intermediates): Print "rm" commands under -n.
+
+Mon Jun 22 16:20:02 1992 Roland McGrath (roland@geech.gnu.ai.mit.edu)
+
+ * Version 3.62.15.
+
+Fri Jun 19 16:20:26 1992 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * arscan.c [M_UNIX]: #undef M_XENIX.
+
+Wed Jun 17 17:59:28 1992 Roland McGrath (roland@geech.gnu.ai.mit.edu)
+
+ * default.c (default_terminal_rules): Put @ prefix on RCS cmds.
+
+Tue Jun 16 19:24:17 1992 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * compatMakefile (getloadavg.o): Removed special rule.
+ (CFLAGS): Don't include $(defines).
+ (.c.o): Define suffix rule.
+ (glob/libglob.a): Pass CPPFLAGS=$(defines) to submake.
+ (GETOPT_SRC, srcs, tagsrcs): Prefix files with $(srcdir)/.
+
+ * arscan.c (ar_name_equal): Moved local vars inside #if'd block.
+
+ * make.h (max): Removed.
+ * expand.c (variable_buffer_output): Don't use it.
+
+ * compatMakefile (INSTALL): Define.
+ (Makefile): New rule to make from Makefile.in.
+ (srcdir): Define.
+ (VPATH): Define.
+ (getloadavg.o, remote.o): Use autoconf $foo< hack.
+
+ * commands.c (fatal_error_signal): Removed return.
+
+Mon Jun 15 17:42:51 1992 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * Version 3.62.14.
+
+ * make.texinfo (Summary): New node.
+ (Special Targets): Mention .EXPORT_ALL_VARIABLES here.
+
+ * variable.c (max): Moved to make.h.
+
+ * compatMakefile (objs, srcs): Added ar & arscan.
+
+ * job.c (start_waiting_job): New function, 2nd half of new_job.
+ (new_job): Call it.
+ (start_waiting_jobs): New function.
+ * remake.c (update_goal_chain): Call start_waiting_jobs at the top
+ of the main loop.
+ * compatMakefile (objs, srcs): Removed load, added getloadavg.
+
+Fri Jun 12 19:33:16 1992 Roland McGrath (roland@geech.gnu.ai.mit.edu)
+
+ * job.c (load_too_high): New function. Uses getloadavg.
+ (waiting_jobs): New variable.
+ (start_job): Don't call wait_to_start_job. Instead, if
+ load_too_high returns nonzero, add the child to the
+ `waiting_jobs' chain and return without starting the job.
+
+Thu Jun 11 00:05:28 1992 Roland McGrath (roland@geech.gnu.ai.mit.edu)
+
+ * expand.c (variable_buffer_output): Made global again.
+ * variable.h: And declare it.
+
+ * arscan.c (PORTAR): Define for all systems if PORT5AR is not defined.
+ (AR_NAMELEN, AR_TRAILING_SLASH): Removed.
+ (ar_scan): Don't use it. Don't #ifdef AR_TRAILING_SLASH; just look
+ for a slash in the archive at run time.
+ (ar_name_equal): Rewrote .o hacking to not use AR_NAMELEN, and to
+ cope with trailing-slash and non-trailing-slash archives.
+
+ * main.c (main) [! SETVBUF_REVERSED]: Test this instead of USGr3 et al.
+ [SETVBUF_REVERSED]: Always allocate a buffer ourselves.
+
+ * load.c (load_average) [sgi]: Use sysmp call.
+
+ * compatMakefile (INSTALL_DATA, INSTALL_PROGRAM): Define.
+ ($(bindir)/$(instname), $(mandir)/make.$(manext)): Use them.
+
+ * make.h [HAVE_VFORK_H]: #include <vfork.h>.
+ (vfork, VFORK_NAME): Don't define.
+ * job.c (start_job): Use "vfork" in place of VFORK_NAME.
+
+ * make.h [HAVE_LIMITS_H, HAVE_SYS_PARAM_H]: If #define'd, #include
+ the each file. Rearranged PATH_MAX hacking.
+ * job.c: Rearranged NGROUPS_MAX hacking.
+
+ * remake.c (fstat, time): Don't declare.
+
+ * compatMakefile (defines): Value is @DEFS@.
+ (LOADLIBES): Value is @LIBS@.
+ (extras): Value is @LIBOBJS@.
+ (ARCHIVES, ARCHIVES_SRC, ALLOCASRC): Removed.
+ * arscan.c, ar.c: Surround body with #ifndef NO_ARCHIVES.
+
+ * misc.c [! HAVE_UNISTD_H]: Test instead of !POSIX to decl get*id.
+
+ * make.h [GETCWD_MISSING]: Test instead of !USG && !POSIX et al.
+ (getcwd): Just declare if present. If not, declare as a macro
+ using getwd, and declare getwd.
+ [PATH_MAX] (GET_PATH_MAX): #define to PATH_MAX.
+ * main.c (main, log_working_directory): Use getcwd instead of getwd.
+
+ * main.c (main) [SETLINEBUF_MISSING]: Test this instead of USG.
+
+ * make.h (SIGHANDLER, SIGNAL): Removed.
+ (RETSIGTYPE): Define if not #define'd.
+ * main.c (main): Use signal in place of SIGNAL.
+
+ * main.c [SYS_SIGLIST_MISSING]: Test instead of USG.
+
+ * job.c (search_path) [GETGROUPS_MISSING]: Test instead of USG.
+ [HAVE_UNISTD_H]: Test instead of POSIX to not decl getgroups.
+
+ * main.c [! HAVE_UNISTD_H]: Test instead of !POSIX to decl chdir.
+ [! STDC_HEADERS]: Test instead of !POSIX to decl exit & atof.
+
+ * job.c (child_handler), commands.c (fatal_error_signal): Return
+ RETSIGTYPE instead of int.
+ * main.c (main): Declare fatal_error_signal and child_handler here
+ to return RETSIGTYPE; removed top-level decl of former.
+
+ * commands.c (fatal_error_signal), job.c (unblock_sigs, start_job),
+ main.c [SIGSETMASK_MISSING]: Test this instead of USG.
+
+Wed Jun 10 22:06:13 1992 Roland McGrath (roland@geech.gnu.ai.mit.edu)
+
+ * job.c [HAVE_WAITPID]: Test this instead of USG.
+ [! HAVE_UNISTD_H]: Test this instead of !POSIX to declare misc fns.
+ (GID_T): Don't #define.
+ (search_path): Use gid_t instead of GID_T.
+ [GETDTABLESIZE_MISSING, SYS_SIGLIST_MISSING, DUP2_MISSING]: Test
+ these individually instead of USG for all.
+ * make.h (ctime): Don't declare. #include time.h instead.
+ [HAVE_UNISTD_H]: #include <unistd.h> and #define POSIX #ifdef
+ _POSIX_VERSION.
+ * dir.c [__GNU_LIBRARY__] (D_NAMLEN): Define to use d_namlen member.
+ * make.h [NEED_MEMORY_H]: Only include memory.h #ifdef this.
+
+ * arscan.c: Removed #ifdef mess about string.h et al.
+ Just #include make.h instead.
+ * make.h (fstat, atol): Declare.
+
+ * commands.c (fatal_error_signal): Don't use sigmask to check for
+ propagated signals; use ||s instead.
+ (PROPAGATED_SIGNAL_MASK): Removed.
+ (fatal_error_signal) [POSIX]: Use sigprocmask in place of sigsetmask.
+
+ * variable.c (variable_buffer, variable_buffer_length,
+ initialize_variable_output, variable_output): Moved to expand.c;
+ made all static.
+ (struct output_state, save_variable_output,
+ restore_variable_output): Removed.
+ * expand.c (initialize_variable_output): Put a NUL at the beginning
+ of the new buffer after allocating it.
+ (allocated_variable_expand_for_file): Don't use
+ {save,restore}_variable_output. Do it by hand instead, keeping
+ state on the stack instead of malloc'ing it.
+ (allocated_variable_expand): Removed.
+ * variable.h (allocated_variable_expand): Define here as macro.
+ (variable_buffer_output, initialize_variable_output,
+ save_variable_output, restore_variable_output): Removed decls.
+
+ * read.c (conditional_line): For an if cmd, if any elt of the
+ conditionals stack is ignoring, just push a new level that ignores
+ and return 1; don't evaluate the condition.
+
+Thu Jun 4 21:01:20 1992 Roland McGrath (roland@geech.gnu.ai.mit.edu)
+
+ * main.c (main): Put #ifdef's around frobbing SIGSYS and SIGBUS.
+
+ * job.c (getdtablesize): Don't declare or #define if already #define'd.
+
+Wed Jun 3 23:42:36 1992 Roland McGrath (roland@geech.gnu.ai.mit.edu)
+
+ * file.c (snap_deps): If `.EXPORT_ALL_VARIABLES' is a target, set
+ export_all_variables.
+ * make.texinfo (Variables/Recursion): Document .EXPORT_ALL_VARIABLES.
+
+Tue Jun 2 21:08:35 1992 Roland McGrath (roland@geech.gnu.ai.mit.edu)
+
+ * Version 3.62.13.
+
+ * commands.c (set_file_variables): Calculate length for ^D and ?D
+ individually, making sure to give them at least enough space for "./".
+
+ * make.h [CRAY]: #define signal to bsdsignal.
+
+ * default.c (default_variables) [CRAY]: Define PC, SEGLDR,
+ CF77PPFLAGS, CF77PP, CFT, CF, and FC.
+
+ * arscan.c (AR_HDR_SIZE): Define to sizeof (struct ar_hdr), if it
+ wasn't defined by <ar.h>.
+
+Thu May 28 00:56:53 1992 Roland McGrath (roland@geech.gnu.ai.mit.edu)
+
+ * Version 3.62.12.
+
+Tue May 26 01:26:30 1992 Roland McGrath (roland@geech.gnu.ai.mit.edu)
+
+ * rule.c (new_pattern_rule): Initialize LASTRULE to nil, not
+ pattern_rules.
+
+Mon May 25 19:02:15 1992 Roland McGrath (roland@geech.gnu.ai.mit.edu)
+
+ * main.c (decode_switches): Initialize all the long_option elt members.
+
+Thu May 21 16:34:24 1992 Roland McGrath (roland@wookumz.gnu.ai.mit.edu)
+
+ * make.texinfo (Text Functions): Correct filter-out description.
+
+Tue May 19 20:50:01 1992 Roland McGrath (roland@geech.gnu.ai.mit.edu)
+
+ * compatMakefile (realclean): Don't remove backup files.
+
+ * main.c (decode_switches): Allocate ARGC+1 elts in `other_args'.
+
+Sun May 17 16:38:48 1992 Roland McGrath (roland@albert.gnu.ai.mit.edu)
+
+ * Version 3.62.11.
+
+Thu May 14 16:42:33 1992 Roland McGrath (roland@albert.gnu.ai.mit.edu)
+
+ * job.c (reap_children): Don't die if wait returns EINTR.
+
+Wed May 13 18:28:25 1992 Roland McGrath (roland@geech.gnu.ai.mit.edu)
+
+ * job.c (reap_children): Always run the next command for a
+ successful target. If we are going to die, we don't want to leave
+ the target partially made.
+
+Tue May 12 00:39:19 1992 Roland McGrath (roland@albert.gnu.ai.mit.edu)
+
+ * job.c (construct_command_argv_internal): After loop, if we only
+ have one word, check it for being a shell command.
+
+ * main.c (decode_switches): Allocate ARGC slots in other_args to
+ begin with, so we never need to worry about growing it.
+ If we get a non-option arg and POSIXLY_CORRECT is in the
+ environment, break out of the loop. After the loop, add all remaining
+ args to other_args list.
+
+ * main.c (decode_switches): For positive_int and floating switches
+ when optarg is nil, use next arg if it looks right (start with a
+ digit, or maybe decimal point for floating).
+
+ * variable.c (define_automatic_variables): Always set SHELL to
+ default if it comes from the environment. Set its export bit.
+ * make.texinfo (Environment): Document change.
+
+Mon May 11 00:32:46 1992 Roland McGrath (roland@albert.gnu.ai.mit.edu)
+
+ * Version 3.62.10.
+
+ * compatMakefile (tags, TAGS): Use vars for cmds.
+ (ETAGS, CTAGS): Define.
+
+ * main.c (decode_switches): If a switches elt has a nil long_name,
+ make the long option name elt be "".
+ Fixed loop to not ignore all the options.
+
+ * make.texinfo (Option Summary): Added long options.
+
+ * main.c (switches): Changed -m's description to "-b".
+ (decode_switches): When printing the usage message, don't print
+ switches whose descriptions start with -.
+ When constructing the list of names for switch -C, search the
+ switches vector for switches whose descriptions are "-C".
+
+ * main.c (switches): Call -S --no-keep-going, not --dont-keep-going.
+ Call -I --include-dir, not --include-path.
+ (long_option_aliases): Added --new == -W, --assume-new == -W,
+ --assume-old == -o, --max-load == -l, --dry-run == -n, --recon == -n,
+ --makefile == -f.
+
+ * main.c (switches): Removed bogus "silent" elt.
+ (long_option_aliases): Define new var.
+ (decode_switches): Add long_option_aliases onto the end of the long
+ options vector created for getopt_long.
+ Look through long_option_aliases for extra names to list
+ in usage message.
+
+Sat May 9 00:21:05 1992 Roland McGrath (roland@geech.gnu.ai.mit.edu)
+
+ * main.c (log_working_directory): Fixed to properly not print the
+ leaving message when we haven't printed the entering message.
+
+Fri May 8 21:55:35 1992 Roland McGrath (roland@geech.gnu.ai.mit.edu)
+
+ * main.c (struct command_switch): Added elts `long_name',
+ `description', and `argdesc'.
+ (switches): Added initializers for new members.
+ (decode_switches): Rewritten to use getopt_long.
+ * compatMakefile (GETOPT, GETOPT_SRC): Define.
+ (objs, srcs): Include them.
+
+ * job.c (child_died): Renamed to dead_children; made static.
+ (child_handler): Increment dead_children instead of setting child_died.
+ (reap_children): Decrement dead_children instead of clearing
+ child_died. The point of all this is to avoid printing "waiting
+ for unfinished jobs" when we don't actually need to block.
+ This happened when multiple SIGCHLDs before reap_children was called.
+
+ * job.c (reap_children): If ERR is set, so we don't call start_job
+ on the child being reaped, instead set its command_state to
+ cs_finished.
+ (reap_children, child_handler, new_job): I added several
+ debugging printf's while fixing this. I left them in if (debug_flag)
+ because they may be useful for debugging this stuff again.
+
+Wed May 6 22:02:37 1992 Roland McGrath (roland@albert.gnu.ai.mit.edu)
+
+ * read.c (read_makefile): v_export is not 1.
+
+Mon May 4 17:27:37 1992 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * Version 3.62.9.
+
+ * variable.c (export_all_variables): New variable.
+ (target_environment): Export variables whose `export' member is
+ v_default if export_all_variables is set and their names are benign.
+ * variable.h: Declare export_all_variables.
+ * read.c (read_makefile): If export or unexport is given with no
+ args, set or clear export_all_variables, respectively.
+
+ * variable.c (target_environment): Exclude MAKELEVEL in the loop,
+ so it isn't duplicated when we add it at the end.
+
+Sun May 3 17:44:48 1992 Roland McGrath (roland@geech.gnu.ai.mit.edu)
+
+ * Version 3.62.8.
+
+ * variable.h (struct variable): Added new member `export'.
+ * variable.c (define_variable_in_set): Initialize it to v_default.
+ (target_environment): Don't check for .NOEXPORT.
+ Export variables whose `export' member is v_default and that would
+ have been exported under .NOEXPORT, and variables whose `export'
+ member is v_export.
+ (try_variable_definition): Return the variable defined.
+ * variable.h (try_variable_definition): Changed decl.
+ * read.c (read_makefile): Recognize `export' and `unexport' directives.
+
+Fri May 1 11:39:38 1992 Roland McGrath (roland@albert.gnu.ai.mit.edu)
+
+ * main.c (main) [POSIX]: Reversed args to sigaddset.
+
+Thu Apr 30 17:33:32 1992 Roland McGrath (roland@geech.gnu.ai.mit.edu)
+
+ * job.c [POSIX || !USG] (unblock_sigs): New fn.
+ (start_job): Block signals before forking.
+ (new_job): Unblock signals after putting the new child on the chain.
+ * main.c (main) [POSIX]: Use sigset_t fatal_signal_set instead of
+ int fatal_signal_mask.
+
+ * load.c [sgi] (LDAV_CVT): Define.
+
+Wed Apr 29 17:15:59 1992 Roland McGrath (roland@albert.gnu.ai.mit.edu)
+
+ * Version 3.62.7.
+
+ * load.c (load_average) [sgi]: Clear the high bit of the address
+ from the symbol table before looking it up in kmem.
+
+ * misc.c (fatal, makefile_fatal): Put *** in fatal error messages.
+ (remake_file): No longer needed in message here.
+
+ * main.c (die): Call reap_children with BLOCK==1.
+
+Tue Apr 28 20:44:35 1992 Roland McGrath (roland@albert.gnu.ai.mit.edu)
+
+ * rule.c (freerule): Don't set LASTRULE->next if LASTRULE is nil.
+
+Sun Apr 26 15:09:51 1992 Roland McGrath (roland@albert.gnu.ai.mit.edu)
+
+ * rule.c (count_implicit_rule_limits): Initialize LASTRULE to nil,
+ not to head of chain. Extract next ptr before we might do
+ freerule, and use that for next iteration.
+ (freerule): Still do next ptr frobbing if LASTRULE is nil.
+
+Tue Apr 21 03:16:29 1992 Roland McGrath (roland@geech.gnu.ai.mit.edu)
+
+ * job.c (child_error): Removed extra %s from error msg format.
+
+ * Version 3.62.6.
+
+ * job.c (reap_children): Don't start later commands in a sequence
+ if ERR is nonzero.
+
+ * job.c (new_job): Always call reap_children with BLOCK==0 first thing.
+
+ * job.c (reap_children): New function; work that used to be done in
+ child_handler.
+ (child_died): New global var.
+ (child_handler): Now just sets child_died.
+ (wait_for_children): Removed.
+ (unknown_children_possible, block_signals, unblock_signals,
+ push_signals_blocked_p, pop_signals_blocked_p): Removed.
+ (child_execute_job): Removed call to unblock_signals.
+ (new_job): Removed calls to push_signals_blocked_p and
+ pop_signals_blocked_p.
+ * job.h: Declare reap_children, not wait_for_children.
+ * commands.c (fatal_error_signal), job.c (new_job),
+ load.c [LDAV_BASED] (wait_to_start_job), main.c (die),
+ remake.c (update_goal_chain), function.c (expand_function: `shell'):
+ Changed wait_for_children calls to reap_children.
+ Some needed to be loops to wait for all children to die.
+ * commands.c (fatal_error_signal), main.c (main,
+ log_working_directory), function.c (expand_function): Removed calls
+ to push_signals_blocked_p and pop_signals_blocked_p.
+ * job.h: Removed decls.
+
+ * job.h: Added copyright notice.
+
+Wed Apr 15 02:02:40 1992 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * job.c (child_error): No *** for ignored error.
+
+Tue Apr 14 18:31:21 1992 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * implicit.c (DEBUGP2): Use do ... while (0) instead of if ... else to
+ avoid compiler warnings.
+
+ * read.c (parse_file_seq): Don't remove ./ when it is followed by a
+ blank.
+
+Mon Apr 13 21:56:15 1992 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * make.h (DEBUGPR): Use do ... while (0) instead of if ... else to
+ avoid compiler warnings.
+
+ * remake.c (notice_finished_file): Run file_mtime on the also_make
+ files, so vpath_search can happen.
+
+ * GNUmakefile (tests): Use perl test suite from csa@sw.stratus.com.
+ (alpha-files): Include test suite tar file.
+
+Fri Apr 3 00:50:13 1992 Roland McGrath (roland@geech.gnu.ai.mit.edu)
+
+ * Version 3.62.5.
+
+Wed Apr 1 05:31:18 1992 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * remake.c (update_file, update_file_1): Do check_renamed on elts
+ of dep chains when traversing them. Something unrelated might have
+ renamed one of the files the dep chain points to.
+
+ * file.c (rename_file): If FILE has been renamed, follow its
+ `renamed' ptr, so we get to the final real FILE. Using the renamed
+ ones loses because they are not in the hash table, so the removal
+ code loops infinitely.
+
+ * read.c (read_all_makefiles): Clobber null terminator into
+ MAKEFILES expansion, so string passed to read_makefile is properly
+ terminated.
+
+Mon Mar 30 20:18:02 1992 Roland McGrath (roland@geech.gnu.ai.mit.edu)
+
+ * commands.c (set_file_variables): $* for archive member with
+ explicit cmds is stem of member, not of whole `lib(member)'.
+
+Thu Mar 26 15:24:38 1992 Roland McGrath (roland@albert.gnu.ai.mit.edu)
+
+ * Version 3.62.4.
+
+Tue Mar 24 05:20:51 1992 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * rule.c (new_pattern_rule): Rules are identical only if all their
+ targets match (regardless of order).
+
+Wed Mar 11 13:49:54 1992 Roland McGrath (roland@geech.gnu.ai.mit.edu)
+
+ * remake.c (remake_file): Changed error "no way to make" to "no
+ rule to make". Fiat Hugh.
+
+ * make.texinfo (Last Resort): Describe %:: rules and new .DEFAULT
+ behavior.
+
+ * remake.c (update_file_1): Only use .DEFAULT cmds if FILE is not a
+ target.
+
+Tue Mar 10 18:13:13 1992 Roland McGrath (roland@wookumz.gnu.ai.mit.edu)
+
+ * remote-stub.c, remote-cstms.c (start_remote_job): Take new arg,
+ environment to pass to child.
+ * job.c (start_job): Pass it.
+
+Mon Mar 9 19:00:11 1992 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * file.c (enter_file): Also strip ./s here, to get command-line
+ target names.
+
+ * remote-cstms.c: Add comment telling people to leave me alone.
+
+ * compatMakefile (manpage install): Remove target before copying.
+
+Tue Mar 3 18:43:21 1992 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * make.texinfo (Missing): Renamed to "Incompatibilities and ...".
+ Added paragraph describing $? incompatibility with Unix and POSIX.2.
+
+Sun Mar 1 15:50:54 1992 Roland McGrath (roland@nutrimat.gnu.ai.mit.edu)
+
+ * function.c (expand_function: `shell'): Don't declare fork or pipe.
+ Use vfork instead of fork.
+
+Tue Feb 25 22:05:32 1992 Roland McGrath (roland@wookumz.gnu.ai.mit.edu)
+
+ * make.texinfo (Chained Rules): Clarify .PRECIOUS to save
+ intermediate files.
+
+ * load.c [sun] (LDAV_CVT): Define to divide by FSCALE.
+
+Sun Feb 16 02:05:16 1992 Roland McGrath (roland@wookumz.gnu.ai.mit.edu)
+
+ * Version 3.62.3.
+
+Sat Feb 15 17:12:20 1992 Roland McGrath (roland@wookumz.gnu.ai.mit.edu)
+
+ * compatMakefile (makeinfo): Use emacs batch-texinfo-format fn.
+
+Fri Feb 14 00:11:55 1992 Roland McGrath (roland@wookumz.gnu.ai.mit.edu)
+
+ * read.c (read_makefile): Correctly handle define & endef in ifdefs.
+
+ * read.c (record_files): Pass arg for %s in error msg.
+
+ * main.c (main) [__IBMR2, POSIX]: Use correct (a la USGr3) setvbuf
+ call.
+
+Wed Feb 12 12:07:39 1992 Roland McGrath (roland@wookumz.gnu.ai.mit.edu)
+
+ * make.texinfo (Libraries/Search): Say it does /usr/local/lib too.
+
+Sun Feb 9 23:06:24 1992 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * read.c (read_makefile): Check for extraneous `endef' when ignoring.
+
+Thu Feb 6 16:15:48 1992 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * Version 3.62.2.
+
+Tue Feb 4 20:04:46 1992 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * job.c (construct_command_argv_internal): Correctly ignore
+ whitespace after backslash-NL.
+
+Fri Jan 31 18:30:05 1992 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * compatMakefile: Ignore errors from chgrp and chmod when installing.
+
+Wed Jan 29 18:13:30 1992 Roland McGrath (roland@albert.gnu.ai.mit.edu)
+
+ * main.c (main): When setting MAKELEVEL in the env to re-exec,
+ allocate space so as not to clobber past the end of the old string.
+
+ * make.h [HAVE_ALLOCA_H]: Include <alloca.h>
+ * compatMakefile (defines): Document HAVE_ALLOCA_H.
+
+Mon Jan 20 13:40:05 1992 Roland McGrath (roland@albert.gnu.ai.mit.edu)
+
+ * make.h [VFORK_MISSING]: Use fork instead.
+ * compatMakefile (defines): Document same.
+
+ * job.c (construct_command_argv_internal): Don't create an empty
+ arg if backslash-NL is at beginning of word.
+
+Sun Jan 19 16:26:53 1992 Roland McGrath (roland@albert.gnu.ai.mit.edu)
+
+ * main.c [DGUX]: Call setvbuf as for USGr3.
+
+ * job.c (construct_command_argv_internal): Notice correctly that
+ backslash-NL is the end of the arg (because it is replaced with a
+ space).
+
+Thu Jan 16 18:42:38 1992 Roland McGrath (roland@albert.gnu.ai.mit.edu)
+
+ * job.c (construct_command_argv_internal): If SHELL is nil, set it
+ to default_shell before proceeding.
+
+ * make.h [sgi]: No alloca.h, after all.
+
+Wed Jan 15 12:30:04 1992 Roland McGrath (roland@albert.gnu.ai.mit.edu)
+
+ * read.c (multi_glob): Cons up the chain of the results of glob
+ from back to front, so it comes out in forward order.
+
+ * job.c (construct_command_argv_internal): Don't eat char following
+ backslash-NL.
+
+Mon Jan 13 19:16:56 1992 Roland McGrath (roland@albert.gnu.ai.mit.edu)
+
+ * Version 3.62.1.
+
+ * default.c (default_variables) [ultrix]: GET=get, like USG.
+
+ * job.c (construct_command_argv_internal): Remove tabs following
+ backslash-NL combos in the input line, so they don't show up when
+ that line is printed.
+
+ * read.c (read_makefile): Don't collapse_continuations the line on
+ input; do it on the copy we do remove_comments on.
+ For rule lines, collapse_continuations the line after chopping
+ ";cmds" off the end, so we don't eat conts in the cmds.
+ Give error for ";cmds" with no rule.
+ * job.c (construct_command_argv_internal): Eat backslash-NL combos
+ when constructing the line to recurse on for slow, too.
+
+Sat Jan 11 02:20:27 1992 Roland McGrath (roland@albert.gnu.ai.mit.edu)
+
+ * file.c (enter_file): Don't strip leading `./'s.
+ * read.c (parse_file_seq): Take new arg STRIP; if nonzero, do it here.
+ * default.c (set_default_suffixes), function.c (string_glob),
+ read.c (read_makefile), rule.c (install_pattern_rule): Change callers.
+
+ * default.c (default_variables) [_IBMR2]: FC=xlf
+
+ * job.c (construct_command_argv_internal): Turn backslash-NL and
+ following whitespace into a single space, rather than just eating
+ the backslash.
+
+ * make.texinfo (Copying): @include gpl.texinfo, rather than
+ duplicating its contents.
+
+Fri Nov 8 20:06:03 1991 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * job.c (construct_command_argv_internal): Make sure not to bother
+ processing an empty line.
+
+ * Version 3.62.0.
+
+ * job.c (construct_command_argv_internal): Always recurse for slow;
+ simple case didn't handle finding newlines.
+
+Tue Nov 5 18:51:10 1991 Roland McGrath (roland@wookumz.gnu.ai.mit.edu)
+
+ * job.c (construct_command_argv_internal): Set RESTP properly when
+ slow; don't \ify past a newline.
+
+Fri Nov 1 19:34:28 1991 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * make.h [sgi]: #include <alloca.h>.
+
+
+
+See ChangeLog.1, available in the Git repository at:
+
+ http://git.savannah.gnu.org/cgit/make.git/tree/
+
+for earlier changes.
+
+
+Copyright (C) 1991-2007 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
+terms of the GNU General Public License as published by the Free Software
+Foundation; either version 3 of the License, or (at your option) any later
+version.
+
+GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License along with
+this program. If not, see <http://www.gnu.org/licenses/>.
diff --git a/ChangeLog.3 b/ChangeLog.3
new file mode 100644
index 00000000..5fcf2732
--- /dev/null
+++ b/ChangeLog.3
@@ -0,0 +1,5633 @@
+2013-10-09 Paul Smith <psmith@gnu.org>
+
+ Version 4.0 released.
+
+ * configure.ac: Updated for the release.
+ * NEWS: Updated for the release.
+
+ * maintMakefile (tag-release): New target to add a Git tag.
+ * read.c (eval): Typo fix.
+ * ChangeLog.1: Typo fixes.
+ * w32/subproc/sub_proc.c (process_cleanup): Typo fix.
+
+2013-10-07 Eli Zaretskii <eliz@gnu.org>
+
+ * w32/compat/posixfcn.c (tmpfile): Move declaration of h before
+ the first executable statement. Reported by Gisle Vanem
+ <gvanem@yahoo.no>.
+
+2013-10-05 Paul Smith <psmith@gnu.org>
+
+ * makeint.h (MAP_USERFUNC): A new map type for function names.
+ * main.c (initialize_stopchar_map): Set up the function name map.
+
+ * gnumake.h (gmk_func_ptr): Define a type for function pointers.
+ (gmk_add_function): Convert the last argument to FLAGS.
+ (GMK_FUNC_*): Define flags for the function. Change the default
+ behavior to "expand" since that's the most common one.
+
+ * function.c (function_table_entry): Use new function pointer type.
+ (lookup_function): Accept any valid function name character based
+ on the MAP_USERFUNC values.
+ (define_new_function): Use the new calling signature. Verify that
+ registered functions have valid names.
+
+ * guile.c (guile_gmake_setup): Use new calling signatures.
+ * loadapi.c (gmk_add_function): Ditto.
+ * variable.h (define_new_function): Ditto.
+
+ * doc/make.texi (Loaded Object API): Make the registered function
+ API documentation more clear.
+
+2013-10-03 Eli Zaretskii <eliz@gnu.org>
+
+ * function.c (abspath): Reset root_len to one for Cygwin only when
+ HAVE_DOS_PATHS is defined. Suggested by Christopher Faylor.
+
+2013-10-02 Eli Zaretskii <eliz@gnu.org>
+
+ * w32/compat/posixfcn.c (tmpfile): New function, a replacement for
+ the Windows libc version.
+
+ Fix $abspath on Cygwin when HAVE_DOS_PATHS is in effect.
+ * function.c (IS_ABSOLUTE) [__CYGWIN__]: Special definition for
+ Cygwin.
+ (abspath) [__CYGWIN__]: Reset root_len to 1 if the absolute file
+ name has the Posix /foo/bar form.
+ [HAVE_DOS_PATHS]: Use root_len instead of hard-coded 2.
+
+2013-10-01 Paul Smith <psmith@gnu.org>
+
+ * configure.ac: Update version to 3.99.93.
+ * NEWS: Ditto.
+
+2013-09-30 Paul Smith <psmith@gnu.org>
+
+ * guile.c: Portability fixes for Guile 1.8.
+
+2013-09-29 Paul Smith <psmith@gnu.org>
+
+ * output.c (output_dump): Always write Enter/Leave messages to stdio.
+ (log_working_directory): This now always writes to stdio, so we
+ don't need the struct output parameter anymore.
+ (output_start): Show the working directory when output_sync is not
+ set or is recursive.
+ * main.c (main): Ensure the special "already shown Enter message"
+ token is removed from MAKE_RESTARTS before the user can see it.
+ * function.c (func_shell_base): If the output_context stderr
+ exists but is invalid, write to the real stderr.
+ Fixes suggested by Frank Heckenbach <f.heckenbach@fh-soft.de>.
+
+ * output.c: Guard unistd.h inclusion, add io.h.
+ * gnumake.h: Move GMK_EXPORT before the declarations.
+ * make_msvc_net2003.vcproj: Add missing files.
+ Changes for MSVC suggested by Gerte Hoogewerf <g.hoogewerf@gmail.com>
+
+ * function.c (func_shell_base) [EMX]: Fix EMX support for output-sync.
+ * job.c (child_execute_job) [EMX]: Ditto.
+ * job.h (child_execute_job) [EMX]: Ditto.
+ * w32/compat/posixfcn.c: Invert the test for NO_OUTPUT_SYNC.
+
+ * guile.c (GSUBR_TYPE): Pre-2.0 Guile doesn't provide a typedef
+ for gsubr pointers. Create one.
+ (guile_define_module): Use it.
+ (internal_guile_eval): Force UTF-8 encoding for Guile strings.
+
+ * main.c (main): Clear GNUMAKEFLAGS after parsing, to avoid
+ proliferation of options.
+ * NEWS: Document it.
+ * doc/make.texi (Options/Recursion): Ditto.
+
+2013-09-23 Eli Zaretskii <eliz@gnu.org>
+
+ * w32/compat/posixfcn.c: Fix the forgotten OUTPUT_SYNC conditional.
+
+ * job.h: Ditto, but in a comment.
+
+2013-09-22 Paul Smith <psmith@gnu.org>
+
+ * configure.ac: Update version to 3.99.92.
+ * NEWS: Ditto.
+
+ * implicit.c (pattern_search): After second expansion be sure to
+ handle order-only markers inside the expansion properly.
+ Fixes Savannah bug #31155.
+
+ * guile.c (guile_define_module): Technically a void* cannot
+ contain a pointer-to-function and some compilers warn about this.
+ Cast the function pointers.
+ * load.c (load_object): Ditto.
+
+ * read.c (eval): If load_file() returns -1, don't add this to the
+ "to be rebuilt" list.
+ * doc/make.texi (load Directive): Document it.
+
+ * guile.c (guile_gmake_setup): Don't initialize Guile so early.
+ (func_guile): Lazily initialize Guile the first time the $(guile ..)
+ function is invoked. Guile can steal file descriptors which
+ confuses our jobserver FD checking, so we don't want to initialize
+ it before we have to.
+
+ VMS port updates by Hartmut Becker <becker.ismaning@freenet.de>
+
+ * makefile.com: Add output to the filelist.
+ * output.c (va_copy): Add an implementation of this macro for VMS.
+ * commands.c: Ensure filedef.h is #included before dep.h.
+ * dir.c: Ditto.
+ * file.c: Ditto.
+ * guile.c: Ditto.
+ * main.c: Ditto.
+ * misc.c: Ditto.
+ * read.c: Ditto.
+ * rule.c: Ditto.
+ * variable.c: Ditto.
+ * readme.vms: Renamed to README.VMS and updates for this release.
+ * Makefile.am: Ditto.
+ * NEWS: Ditto.
+ * README.template: Ditto.
+ * Makefile.DOS.template: Ditto.
+
+2013-09-21 Paul Smith <psmith@gnu.org>
+
+ * maintMakefile (check-alt-config): Create a target to test
+ alternative configurations. Each one will build make with a
+ different configuration then run the test suite.
+
+ Invert the output-sync #define to NO_OUTPUT_SYNC
+
+ * configure.ac: Don't set OUTPUT_SYNC.
+ * makeint.h: Ditto.
+ * main.c: Use NO_OUTPUT_SYNC instead of OUTPUT_SYNC.
+ * output.c: Ditto.
+ * output.h: Ditto.
+ * job.h: Ditto.
+ * job.c: Ditto.
+ * config.ami.template: Set NO_OUTPUT_SYNC.
+ * config.h-vms.template: Ditto.
+ * config.h.W32.template: Ditto.
+ * configh.dos.template: Ditto.
+
+ Output generated while reading makefiles should be synced.
+
+ * main.c (make_sync): Define a context for syncing while reading
+ makefiles and other top-level operations.
+ (main): If we request syncing, enable it while we are parsing
+ options, reading makefiles, etc. to capture that output. Just
+ before we start to run rules, dump the output if any.
+ (die): Dump any output we've been syncing before we die
+ * output.h (OUTPUT_SET): Disable output_context if not syncout.
+
+ Stderr generated from shell functions in recipes should be synced.
+
+ * job.h (FD_STDIN, FD_STDOUT, FD_STDERR): Create new macros to
+ avoid magic numbers.
+ (child_execute_job): Take a FD for stderr.
+ * job.c (child_execute_job): Handle STDERR FD's in addition to
+ stdin and stdout.
+ (start_job_command): Call child_execute_job() with the new STDERR
+ parameter. Instead of performing the dup() here, send it to
+ child_execute_job() where it's already being done.
+ * function.c (func_shell_base): Pass the OUTPUT_CONTEXT stderr to
+ child_execute_job() if it's set, otherwise FD_STDERR.
+ * main.c (main): Pass FD_STDERR to child_execute_job().
+
+2013-09-19 Paul Smith <psmith@gnu.org>
+
+ * main.c (main): Set MAKE_RESTARTS to negative before re-exec if
+ we've already generated an "Entering" message. If we are started
+ and notice that MAKE_RESTARTS is negative, assume we already wrote
+ "Entering" and don't write it again.
+
+2013-09-18 Paul Smith <psmith@gnu.org>
+
+ * main.c (main): Set starting_directory before we write any
+ errors. Fixes Savannah bug #40043.
+
+2013-09-16 Eli Zaretskii <eliz@gnu.org>
+
+ * output.c [WINDOWS32]: Include windows.h and sub_proc.h, to avoid
+ compiler warnings for CLOSE_ON_EXEC.
+
+2013-09-16 Paul Smith <psmith@gnu.org>
+
+ * configure.ac: Update version to 3.99.91.
+ * NEWS: Ditto.
+
+2013-09-15 Paul Smith <psmith@gnu.org>
+
+ * doc/make.texi (Error Messages): Add a bit more info to the
+ section on static pattern errors, since they're common.
+ Fixes Savannah bug #31326.
+
+ * read.c (eval_makefile): If the file open fails with an
+ unrecoverable error, stop now rather than trying to make it.
+ Fixes Savannah bug #27374.
+
+ * main.c (main): Perform the validation of the jobserver FDs
+ early, before we read makefiles, to ensure that something hasn't
+ opened and used those FDs for some other reason.
+ Fixes Savannah bug #39934.
+
+ * main.c (main): Don't set MAKEFLAGS in the environment when we
+ restart. We have the original command line flags so keep the
+ original MAKEFLAGS settings as well.
+ Fixes Savannah bug #39203.
+
+2013-09-14 Paul Smith <psmith@gnu.org>
+
+ * main.c (decode_debug_flags): Add support for the "n" flag to
+ disable all debugging.
+ * make.1: Document the "n" (none) flag.
+ * doc/make.texi (Options Summary): Ditto.
+ * NEWS: Ditto.
+ Fixes Savannah bug #35248.
+
+ * misc.c (close_stdout): Move to output.c.
+ * main.c (main): Move atexit call to output_init().
+ * makeint.h: Remove close_stdout() declaration.
+ * output.c (output_init): Add close_stdout at exit only if it's open.
+ Fixes Savannah bug #33134. Suggested by David Boyce <dsb@boyski.com>.
+
+2013-09-14 Paul Smith <psmith@gnu.org>
+
+ * misc.c (set_append_mode, open_tmpfd, open_tmpfile): Move to output.c.
+ * misc.h: Ditto.
+ * output.h: Ditto.
+ * main.c (main): Move stdio init into output.c:output_init().
+ Change open_tmpfile() to output_tmpfile().
+ * output.c: Rename open_*() to output_*(). set_append_mode() and
+ open_tmpfd() are static.
+ (_outputs, log_working_directory): Accept a struct output and
+ print to that rather than the global context.
+ (output_dump): In recurse mode print enter/leave once for the
+ whole makefile.
+ (output_init): Initialize this processes stdio as well as child's.
+
+ * vmsjobs.c: Reformat to be closer to convention.
+
+2013-09-12 Paul Smith <psmith@gnu.org>
+
+ Rework output to handle synchronization and directory logging more
+ reliably.
+
+ * output.c: New file. Implement lazy synchronization and
+ directory logging so that we manage them "just in time", and the
+ destination of the output is set via a global state variable.
+ * output.h: New file.
+ * function.c (func_shell_base): Ensure the output is set up before
+ running a shell command, in case it writes to stderr.
+ (func_error): Use outputs() to generate output.
+ * job.h (struct child): Add struct output to track the child's output.
+ * job.c: Use struct output in the child structure to track output.
+ (child_out, sync_init, assign_child_tempfiles, pump_from_tmp)
+ (acquire_semaphore, release_semaphore, sync_output): Move most of
+ the output_sync handling to output.c.
+ (child_error): Set output, then use simple message() and error()
+ not _s versions.
+ * main.c (log_working_directory): Moved to output.c
+ (trace_option, decode_trace_flags) Remove. Remove support for
+ different trace modes; we don't use it anymore.
+ (die) Invoke output_close() before we exit.
+ * misc.c (message_s, error_s): Removed; no longer needed.
+ (message, error, fatal, perror_with_name, pfatal_with_name): Moved
+ to output.c.
+ * makeint.h: Remove message_s(), error_s(), and
+ log_working_directory(). Remove the TRACE_* macros.
+ * doc/make.texi: Enhance documentation for output sync, and remove
+ MODE assignment for --trace.
+ * make.1: Remove MODE assignment for --trace.
+ * Makefile.am: Add new files.
+ * NMakefile.template: Ditto.
+ * SMakefile.template: Ditto.
+ * build_w32.bat: Ditto.
+ * dosbuild.bat: Ditto.
+ * make.lnk: Ditto.
+ * make_nsvc_net2003.vcproj: Ditto.
+ * makefile.vms: Ditto.
+ * po/POTFILES.in: Ditto.
+
+2013-08-22 Petr Machata <pmachata@redhat.com>
+
+ * function.c (func_shell_base): Get rid of any avoidable limit on
+ stack size for processes spawned via $(shell).
+
+2013-07-22 Paul Smith <psmith@gnu.org>
+
+ * implicit.c (pattern_search): Use PARSE_SIMPLE_SEQ() even for
+ non-second expansion prerequisites, to handle globbing in patterns.
+ Fixes Savannah bug #39310.
+
+ * dep.h (PARSE_SIMPLE_SEQ): Macro for simple file sequence parsing.
+ * default.c (set_default_suffixes): Use it.
+ * file.c (split_prereqs): Ditto.
+ * main.c (main): Ditto.
+ * read.c (eval): Ditto.
+ * rule.c (install_pattern_rule): Ditto.
+ * file.c (split_prereqs): Use PARSEFS_NONE instead of 0.
+
+2013-07-21 Paul Smith <psmith@gnu.org>
+
+ Cleanups detected by cppcheck. Fixes Savannah bug #39158.
+ * arscan.c (ar_scan): Reduce the scope of local variables.
+ * dir.c (vms_hash): Ditto.
+ (find_directory): Ditto.
+ (file_impossible_p): Ditto.
+ * expand.c (variable_expand_string): Ditto.
+ * function.c (func_sort): Ditto.
+ (func_and): Ditto.
+ * job.c (reap_children): Ditto.
+ (exec_command): Ditto.
+ * main.c (main): Ditto.
+ * misc.c (collapse_continuations): Ditto.
+ * read.c (eval): Ditto.
+ (parse_file_seq): Ditto.
+ * vpath.c (gpath_search): Ditto.
+ (selective_vpath_search): Ditto.
+ * job.c (is_bourne_compatible_shell): Simplify for non-Windows systems.
+ * remake.c (f_mtime): Remove duplicate test.
+ * signame.c (strsignal): Fix bogus conditional.
+
+ * job.c (assign_child_tempfiles): Assign OUTFD to -1 for safety.
+ (start_job_command): Don't test output_sync and sync_cmd: redundant.
+ Changes suggested by Frank Heckenbach <f.heckenbach@fh-soft.de>.
+
+2013-07-14 Paul Smith <psmith@gnu.org>
+
+ * filedef.h (update_status): Convert UPDATE_STATUS from a char to
+ an enumeration. Some systems declare "char" to be "unsigned"
+ which broke the code (which expected to be able to use -1 as a
+ flag). Using magic values was unpleasant, so rather than just
+ force "signed char" I reworked it to use an enum.
+
+ * dep.h (update_goal_chain): Return an update_status value not int.
+ * remake.c (touch_file): Ditto.
+ (update_goal_chain): Track the update_status enum.
+
+ * file.c (enter_file): Use new enumeration values with update_status.
+ (remove_intermediates): Ditto.
+ (print_file): Ditto.
+ * commands.c (execute_file_commands): Ditto.
+ * job.c (reap_children): Ditto.
+ (start_job_command): Ditto.
+ (start_waiting_job): Ditto.
+ * main.c (main): Ditto.
+ * remake.c (update_file): Ditto.
+ (complain): Ditto.
+ (update_file_1): Ditto.
+ (notice_finished_file): Ditto.
+ (remake_file): Ditto.
+ * vmsjobs.c (vmsHandleChildTerm): Ditto.
+
+2013-07-09 Paul Smith <psmith@gnu.org>
+
+ * implicit.c (pattern_search): Keep a local copy of the number of
+ deps in deplist: the global max might change due to recursion.
+ Fixes a bug reported by Martin d'Anjou <martin.danjou14@gmail.com>.
+
+2013-06-28 Paul Smith <psmith@gnu.org>
+
+ * misc.c (set_append_mode): Set the O_APPEND flag on a file descriptor.
+ (open_tmpfd): Set append mode on the temporary file descriptor.
+ * main.c (main): Set append mode on stdout and stderr.
+ * makeint.h (set_append_mode): Declare it.
+
+2013-06-22 Eli Zaretskii <eliz@gnu.org>
+
+ * build_w32.bat (LinkGCC): Prevent a comment from being displayed
+ at build time.
+
+ * job.c (construct_command_argv_internal) [WINDOWS32]: Use
+ case-insensitive comparison with internal commands of non-Unix
+ shells.
+
+ * main.c (find_and_set_default_shell): Don't use file_exists_p or
+ dir_file_exists_p, as those call readdir, which can fail if PATH
+ includes directories with non-ASCII characters, and that would
+ cause Make to fail at startup with confusing diagnostics. See
+ https://sourceforge.net/mailarchive/message.php?msg_id=30846737
+ for the details.
+
+2013-06-22 Paul Smith <psmith@gnu.org>
+
+ Improve performance by using a character map to determine where we
+ want to stop searching strings, rather than discrete comparisons.
+
+ * read.c (find_char_unquote): Pass a stop map instead of various
+ flags and use that to check when to stop parsing the string.
+ (eval): Use the new find_char_unquote() calling signature.
+ (remove_comments): Ditto.
+ (unescape_char): Ditto.
+ (find_percent_cached): Ditto.
+ (parse_file_seq): Use a stop-map flag.
+ * main.c (stopchar_map): Character map definition.
+ (initialize_stopchar_map): Initialize the map definition.
+ (main): Invoke the map initialization function.
+ * misc.c (end_of_token_w32): Remove unused function.
+ * dir.c (dosify): Use STOP_SET to check for stop chars.
+ * main.c (main): Ditto.
+ * misc.c (end_of_token): Ditto.
+ * function.c (subst_expand): Ditto.
+ (func_notdir_suffix): Ditto.
+ (func_basename_dir): Ditto.
+ (abspath): Ditto.
+ * job.c (is_bourne_compatible_shell): Ditto.
+ * variable.c (parse_variable_definition): Ditto.
+ * read.c (eval): Ditto.
+ (conditional_line): Ditto.
+ (find_percent_cached): Ditto.
+ * dep.h (PARSE_FILE_SEQ): Update function declaration.
+ * default.c (set_default_suffixes): Update PARSE_FILE_SEQ() call.
+ * file.c (split_prereqs): Ditto.
+ * function.c (string_glob): Ditto.
+ * implicit.c (pattern_search): Ditto.
+ * rule.c (install_pattern_rule): Ditto.
+ * main.c (main): Ditto.
+
+2013-06-21 Paul Smith <psmith@gnu.org>
+
+ * main.c (verify_flag): Global variable to determine whether to
+ verify the database or not.
+ (decode_debug_flags): If debug mode, enable verify_flag.
+ (main): If MAKE_MAINTAINER_MODE, enable verify_flag, otherwise not.
+ (die): Only verify the database if verify_flag is set.
+ * file.c (enter_file): Don't check caching unless verify_flag.
+ * makeint.h: Export verify_flag.
+
+2013-05-27 Paul Smith <psmith@gnu.org>
+
+ * variable.c (define_automatic_variables): Create a new variable
+ MAKE_HOST.
+
+2013-05-27 Hartmut Becker <becker.ismaning@freenet.de>
+
+ * function.c (func_shell_base) [VMS]: Support VMS.
+ * makefile.com [VMS]: Ditto.
+ * makefile.vms [VMS]: Ditto.
+ * makeint.h [VMS]: Ditto.
+ * vmsjobs.c [VMS]: Ditto.
+ * job.h: Define RECORD_SYNC_MUTEX() when OUTPUT_SYNC is not set.
+ * load.c (unload_file): Fix signature if MAKE_LOAD is not set.
+
+2013-05-26 Paul Smith <psmith@gnu.org>
+
+ * remake.c (f_mtime): Ensure that archive file names are in the
+ string cache. Fixes Savannah bug #38442.
+
+ * read.c (readline): To be safe, move the entire buffer if we
+ detect a CR. Fixes Savannah bug #38945.
+
+ * job.c (new_job): Compare OUT to the beginning of the OUT
+ var/function, not IN. Fixes Savannah bug #39035.
+
+2013-05-22 Paul Smith <psmith@gnu.org>
+
+ * main.c (switches[]): Order switches so simple flags all come first.
+ (define_makeflags): Rework to make option passing more
+ reliable and the code less tricksy. Ensure simple flags are kept
+ in the initial batch of flags. Do not allow any flags with
+ options in that batch. If there are only non-simple flags MAKEFLAGS
+ begins with ' '.
+ (print_data_base): Print the version. Fixes part of Savannah #35336.
+
+ * read.c (eval_buffer): Initialize lineno.
+
+2013-05-18 Alexey Pavlov <alexpux@gmail.com> (tiny change)
+
+ * w32/Makefile.am (libw32_a_SOURCES): Add compat/posixfcn.c.
+
+ * configure.ac (OUTPUT_SYNC): Define for mingw32 target.
+
+ * job.c (construct_command_argv_internal) <sh_cmds_dos>
+ [WINDOWS32]: Add "move". Fixes Savannah bug #30714.
+
+ * guile.c: Move inclusion of makeint.h before gnumake.h. This
+ order must be observed when building Make, because gnumake.h must
+ be included with GMK_BUILDING_MAKE defined, which makeint.h
+ already does. Otherwise, the linker will look for, and fail to
+ find, gmk_* functions in some external dynamic library.
+
+2013-05-17 Benno Schulenberg <bensberg@justemail.net>
+
+ * main.c (decode_output_sync_flags): Fix output message.
+ * read.c (EXTRANEOUS): Ditto.
+ (record_files): Ditto.
+ * remake.c (update_file_1): Ditto.
+
+2013-05-17 Eli Zaretskii <eliz@gnu.org>
+
+ * main.c (prepare_mutex_handle_string): Define conditioned on
+ OUTPUT_SYNC.
+
+ * build_w32.bat: Copy config.h.W32 to config.h regardless of
+ whether or not we are building from SCM.
+
+2013-05-17 Paul Smith <psmith@gnu.org>
+
+ * configure.ac: Update version to 3.99.90.
+ * NEWS: Ditto.
+
+ * Source (*.[ch]): Remove TABs, use GNU coding styles.
+
+ * ALL: Update copyright.
+
+ * hash.c (CALLOC): Use xcalloc() to handle out of memory errors.
+
+ * makeint.h: Prototype new unload_file() function.
+ * load.c (unload_file): Create a function to unload a file.
+ (struct load_list): Type to remember loaded objects.
+ (loaded_syms): Global variable of remembered loaded objects so we
+ can unload them later. We don't have to remove from the list
+ because the only time we unload is if we're about to re-exec.
+ (load_object): Remove unneeded extra DLP argument.
+ (load_file): Remove unneeded extra DLP argument.
+ * filedef.h (struct file): Remove the DLP pointer and add the
+ LOADED bit flag. Saves 32/64 bytes per file, as this pointer is
+ almost never needed.
+ * read.c (eval): Set the new LOADED bit flag on the file.
+ * file.c (rehash_file): Merge the loaded bitfield.
+ * commands.c (execute_file_commands): Call unload_file() instead
+ of dlclose() directly.
+
+2013-05-14 Paul Smith <psmith@gnu.org>
+
+ * doc/make.texi (Loaded Object API): Document the requirement for
+ the plugin_is_GPL_compatible symbol.
+ * load.c (load_object): Check for plugin_is_GPL_compatible symbol.
+
+2013-05-13 Paul Smith <psmith@gnu.org>
+
+ * filedef.h (struct file): Add a builtin flag.
+ * file.c (enter_file): Unset the builtin flag.
+ (rehash_file): Ditto.
+ (print_file): Don't print builtin files if we've omitted them.
+ * default.c (undefine_default_variables): New function: go through
+ the default variables and undefine them.
+ (set_default_suffixes): Mark these suffix rules as builtin.
+ * makeint.h: Prototype.
+ * main.c (main): Handle addition of -r and -R to MAKEFLAGS in the
+ makefile. Fixes Savannah bug #20501.
+
+ * main.c (define_makeflags): Assign o_env_override level to
+ MAKEFLAGS to ensure it's set even in the presence of -e.
+ Fixes Savannah bug #2216.
+
+ * makeint.h (TRACE_NONE, TRACE_RULE, TRACE_DIRECTORY): Define
+ constants for the trace mode.
+ * main.c: Add new --trace mode parsing.
+ (decode_trace_flags): New function.
+ (decode_switches): Call it.
+ (define_makeflags): Fix a bug with long-name options.
+ * misc.c (fatal): Remove special output-sync handling.
+ * make.1: Document new --trace mode flags.
+ * doc/make.texi (Options Summary): Ditto.
+
+2013-05-11 Eli Zaretskii <eliz@gnu.org>
+
+ * job.c (child_out): Output the newline following the message
+ before fllush-ing the stream. Avoids displaying the following
+ failure message, which goes to stderr, on the same line.
+
+2013-05-06 Eli Zaretskii <eliz@gnu.org>
+
+ * gnumake.h (GMK_EXPORT) [_WIN32]: Move the dllexport declaration
+ here from makeint.h.
+
+ * makeint.h (GMK_BUILDING_MAKE) [WINDOWS32]: Define before
+ including gnumake.h.
+
+ * doc/make.texi (Loaded Object Example): Add a note about building
+ shared objects on MS-Windows.
+
+2013-05-05 Paul Smith <psmith@gnu.org>
+
+ * makeint.h (OUTPUT_SYNC_LINE, OUTPUT_SYNC_RECURSE): Rename
+ output-sync options "job" to "line" and "make" to "recurse".
+ * main.c (decode_output_sync_flags): Ditto.
+ * job.c (reap_children): Ditto.
+ (start_job_command): Ditto.
+ * make.1: Ditto.
+ * doc/make.texi (Parallel Output): Ditto.
+
+ * job.c (child_out): Write newlines explicitly, and don't do
+ anything if the message is empty.
+ (sync_output): Put working dir messages around stdout AND stderr.
+ (start_job_command): Move the tmp file assignment earlier. After
+ we do it, write the command line to the temp file to get the order
+ correct.
+
+ * misc.c (message): Remove special handling for output_sync.
+ (error): Ditto.
+
+2013-05-04 Paul Smith <psmith@gnu.org>
+
+ * loadapi.c (gmk_alloc): New function.
+ * gnumake.h: Add gmk_alloc(). Clean GMK_EXPORT a bit to avoid MAIN.
+ * makeint.h (GMK_EXPORT): New handling, vs. MAIN.
+ * doc/make.texi (Loaded Object API): Add information on the memory
+ handling functions.
+ (Loaded Object Example): Create an example.
+
+ * job.c (pump_from_tmp): (Rename) Write to stdout/stderr using
+ FILE* rather than fd. It's not a good idea to mix and match.
+
+2013-05-04 Eli Zaretskii <eliz@gnu.org>
+
+ * makeint.h (ftruncate) [_MSC_VER]: Redirect to _chsize.
+ (_S_ISDIR): If not defined (MinGW64), define to S_ISDIR.
+
+2013-05-04 Paul Smith <psmith@gnu.org>
+
+ * job.c (child_out): Handle EINTR and incomplete write scenarios.
+ (sync_init): New function: separate the initialization code.
+ (assign_child_tempfiles): Remove truncation from this function,
+ (sync_output): and add it here after output is generated.
+ (reap_children): Always call sync_output() in case output_sync was
+ reset after the child started, due to error.
+ (start_job_command): Create new sync_cmd variable. Use new method
+ for initializing the handle.
+ If we're not syncing the output be sure any output we've saved is
+ dumped immediately before starting the child.
+
+2013-05-04 Eli Zaretskii <eliz@gnu.org>
+
+ * job.c (start_job_command): Make the condition for creating a
+ temporary output file be identical to the Posix code branch.
+ Suggested by Frank Heckenbach <f.heckenbach@fh-soft.de>.
+
+2013-05-03 Eli Zaretskii <eliz@gnu.org>
+
+ * w32/subproc/sub_proc.c: Include makeint.h. Remove a private
+ incompatible prototype of xmalloc.
+ (batch_file_with_spaces): New function, detects Windows batch
+ files whose names include whitespace characters.
+ (process_begin): If exec_name is a batch file with whitespace
+ characters in its name, pass NULL as the first argument to
+ CreateProcess. This avoids weird failures due to buggy quoting by
+ CreateProcess. For the details, see the discussion starting at
+ http://lists.gnu.org/archive/html/make-w32/2013-04/msg00008.html.
+
+ * load.c (load_object, load_file): Accept an additional argument
+ DLP and return in it a pointer that can be used to unload the
+ dynamic object.
+
+ * read.c (eval): Call load_file with an additional argument, and
+ record the pointer returned there in the 'struct file' object of
+ dynamic objects in that object's 'struct file'.
+
+ * commands.c (execute_file_commands): Unload dynamic objects
+ before remaking them, to avoid failure to remake if the OS doesn't
+ allow overwriting objects that are in use.
+
+ * filedef.h (struct file): New member dlopen_ptr.
+
+ * gnumake.h (GMK_EXPORT): Define to dllexport/dllimport
+ decorations for Windows and to nothing on other platforms.
+ (gmk_eval, gmk_expand, gmk_add_function): Add GMK_EXPORT qualifier
+ to prototypes.
+
+ * makeint.h (MAIN): Define before including gnumake.h, to give
+ correct dllexport decorations to exported functions.
+ (load_file): Adjust prototype.
+
+ * loadapi.c: Don't include gnumake.h, since makeint.h already
+ includes it, and takes care of defining MAIN before doing so.
+
+ * build_w32.bat (LinkGCC): Produce an import library for functions
+ exported by Make for loadable dynamic objects.
+
+ * w32/compat/posixfcn.c (dlclose): New function.
+
+ * w32/include/dlfcn.h (dlclose): Add prototype.
+
+2013-05-01 Eli Zaretskii <eliz@gnu.org>
+
+ * job.c (start_job_command) [WINDOWS32]: Make the same fix for
+ MS-Windows as the previous commit did for Posix platforms.
+ (construct_command_argv_internal): Don't treat a backslash as an
+ escape character before whitespace, if the shell is not a Posix
+ shell. For the description of the problem, see
+ http://lists.gnu.org/archive/html/make-w32/2013-04/msg00014.html.
+
+2013-05-01 Paul Smith <psmith@gnu.org>
+
+ * job.c (start_job_command): Don't redirect output for recursive
+ make jobs, unless we're in makefile synchronization mode.
+
+2013-04-30 Stefano Lattarini <stefano.lattarini@gmail.com> (tiny change)
+
+ build: enable the 'silent-rules' automake options
+
+ * configure.ac (AM_INIT_AUTOMAKE): Here. The future major Automake
+ version 2.0 (ETA about one, one and half year from now) will enable
+ it by default, so better prepare ourselves.
+
+2013-04-30 Stefano Lattarini <stefano.lattarini@gmail.com> (tiny change)
+
+ build: require Autoconf >= 2.62 and Automake >= 1.11.1
+
+ Older versions of those tools should be considered fully obsolete.
+ Also, GNU make already requires Gettext >= 0.18.1, which has been
+ released six months after Automake 1.11.1 and two years after
+ Autoconf 2.62; so the new requirement shouldn't be problematic
+ for people already bootstrapping GNU make from the Git repository.
+
+ * configure.ac (AC_PREREQ): Require Autoconf 2.62 or later.
+ (AM_INIT_AUTOMAKE): Require Automake 1.11.1 or later (1.11 had
+ some serious bugs, and should not be used).
+
+2013-04-30 Stefano Lattarini <stefano.lattarini@gmail.com> (tiny change)
+
+ build: get rid of 'HAVE_ANSI_COMPILER' C preprocessor conditional
+
+ GNU make already assume C89 or later throughout the codebase, and
+ that preprocessor conditional was no longer used anyway.
+
+ * configure.ac: Remove AC_DEFINE of HAVE_ANSI_COMPILER.
+ * config.ami.template: Remove #define of HAVE_ANSI_COMPILER.
+ * config.h-vms.template: Likewise.
+ * config.h.W32.template: Likewise.
+ * configh.dos.template: Likewise.
+
+2013-04-30 Stefano Lattarini <stefano.lattarini@gmail.com> (tiny change)
+
+ cosmetics: fix few innocuous typos
+
+ Most of these were found using Lucas De Marchi's 'codespell' tool.
+
+ * ChangeLog: Fix minor typos.
+ * ChangeLog.2: Likewise.
+ * README.Amiga: Likewise.
+ * TODO.private: Likewise.
+ * function.c: Likewise.
+ * glob/glob.h: Likewise.
+ * job.c: Likewise.
+ * main.c: Likewise.
+ * readme.vms: Likewise.
+ * remake.c: Likewise.
+ * tests/ChangeLog: Likewise.
+ * tests/NEWS: Likewise.
+ * tests/README: Likewise.
+ * tests/scripts/variables/private: Likewise.
+ * vmsdir.h: Likewise.
+ * signame.c: Likewise. While at it, improve line wrapping in the
+ touched comment.
+
+2013-04-29 Eli Zaretskii <eliz@gnu.org>
+
+ * w32/include/dlfcn.h: New file.
+
+ * w32/compat/posixfcn.c: Include dlfcn.h.
+ (dlopen, dlerror, dlsym) [MAKE_LOAD]: New functions, in support of
+ dynamic loading.
+
+ * config.h.W32.template (MAKE_LOAD): Define.
+
+ * load.c (load_object) [HAVE_DOS_PATHS]: Support backslashes and
+ drive letters in file names of dynamic objects.
+
+ * job.c (construct_command_argv_internal) [WINDOWS32]: Return
+ right after generating new_argv for one_shell case. This fixes
+ the Windows build for both Unixy shell and stock Windows shells.
+
+2013-04-28 Eli Zaretskii <eliz@gnu.org>
+
+ * dir.c (local_stat) [WINDOWS32]: Use the wrapper on MS-Windows.
+ If the argument ends in "dir/.", make sure the parent dir exists
+ and is indeed a directory. Fixes Savannah bug #37065.
+
+2013-04-28 Paul Smith <psmith@gnu.org>
+
+ * makeint.h (message_s, error_s): Functions that print to strings
+ rather than directly to files.
+ * misc.c (message_s, error_s): Create them.
+ * job.c (child_error): Print error messages to the output sync
+ logs, if one exists, rather then directly to the terminal.
+ (reap_children): Move the per-line sync after child_error().
+
+ * configure.ac: Remove support for pre-ANSI variadic function calls.
+ * makeint.h: Ditto.
+ * misc.c: Ditto.
+ * config.ami.template: Ditto.
+ * config.h-vms.template: Ditto.
+ * config.h.W32.template: Ditto.
+ * configh.dos.template: Ditto.
+
+ Implement a "per-job" output synchronization option.
+
+ * main.c (decode_output_sync_flags): Recognize the new option.
+ * makeint.h (OUTPUT_SYNC_JOB): Add new values for "job"
+ * job.c (assign_child_tempfiles): In per-job mode, truncate the
+ temp file for re-use by the next job.
+ (sync_output): Don't close the temp files as we may still use them.
+ (free_child): Close the temp files here as we definitely don't
+ need them.
+ (new_job): In per-job output mode, sync_output() after each job.
+ * job.h (struct child): Avoid ifdefs.
+ * make.1: Add new options to the man page.
+ * doc/make.texi (Parallel Output): Break documentation on input
+ and output into separate sections for readability. Document the
+ new "job" and "none" modes.
+
+2013-04-27 Paul Smith <psmith@gnu.org>
+
+ * job.c (construct_command_argv_internal): Fix oneshell support
+ for non-POSIX-sh shells.
+
+ * load.c (load_object): Extract all POSIX-isms into a separate
+ function for portability.
+ (load_file): Check the .LOADED variable first and don't invoke
+ load_object() if it's already been loaded.
+
+2013-04-27 Eli Zaretskii <eliz@gnu.org>
+
+ * read.c (record_files): Pay attention to .ONESHELL in MS-Windows.
+
+ * job.c (construct_command_argv_internal): Support .ONESHELL on
+ MS-Windows, when the shell is not a Unixy shell.
+
+2013-04-27 Eli Zaretskii <eliz@gnu.org>
+
+ * job.c: Fix compilation error on GNU/Linux due to "label at end
+ of compound statement".
+
+2013-04-27 Frank Heckenbach <f.heckenbach@fh-soft.de> (tiny change)
+
+ * job.c (sync_output): Don't discard the output if
+ acquire_semaphore fails; instead, dump the output unsynchronized.
+
+2013-04-27 Eli Zaretskii <eliz@gnu.org>
+
+ Support --output-sync on MS-Windows.
+ * w32/compat/posixfcn.c: New file, with emulations of Posix
+ functions and Posix functionality for MS-Windows.
+
+ * w32/subproc/sub_proc.c: Include io.h.
+ (process_noinherit): New function, forces a file descriptor to not
+ be inherited by child processes.
+ (process_easy): Accept two additional arguments, and use them to
+ set up the standard output and standard error handles of the child
+ process.
+
+ * w32/include/sub_proc.h (process_easy): Adjust prototype.
+ (process_noinherit): Add prototype.
+
+ * read.c [WINDOWS32]: Include windows.h and sub_proc.h.
+
+ * makeint.h (LOCALEDIR) [WINDOWS32}: Define to NULL if not
+ defined. This is needed because the MS-Windows build doesn't have
+ a canonical place for LOCALEDIR.
+ (WIN32_LEAN_AND_MEAN) [WINDOWS32]: Define, to avoid getting from
+ windows.h header too much stuff that could conflict with the code.
+
+ * main.c <sync_mutex>: New static variable.
+ <switches>: Add support for "--sync-mutex" switch.
+ (decode_output_sync_flags): Decode the --sync-mutex= switch.
+ (prepare_mutex_handle_string) [WINDOWS32]: New function.
+ (main): Add "output-sync" to .FEATURES.
+
+ * job.h (CLOSE_ON_EXEC) [WINDOWS32]: Define to call
+ process_noinherit.
+ (F_GETFD, F_SETLKW, F_WRLCK, F_UNLCK, struct flock) [WINDOWS32]:
+ New macros.
+ (RECORD_SYNC_MUTEX): New macro, a no-op for Posix platforms.
+ (sync_handle_t): New typedef.
+
+ * job.c <sync_handle>: Change type to sync_handle_t.
+ (FD_NOT_EMPTY): Seek to the file's end. Suggested by Frank
+ Heckenbach <f.heckenbach@fh-soft.de>.
+ (pump_from_tmp_fd) [WINDOWS32]: Switch to_fd to binary mode for
+ the duration of this function, and then change back before
+ returning.
+ (start_job_command) [WINDOWS32]: Support output_sync mode on
+ MS-Windows. Use a system-wide mutex instead of locking
+ stdout/stderr. Call process_easy with two additional arguments:
+ child->outfd and child->errfd.
+ (exec_command) [WINDOWS32]: Pass two additional arguments, both
+ -1, to process_easy, to adjust for the changed function signature.
+
+ * function.c (windows32_openpipe) [WINDOWS32]: This function now
+ returns an int, which is -1 if it fails and zero otherwise. It
+ also calls 'error' instead of 'fatal', to avoid exiting
+ prematurely.
+ (func_shell_base) [WINDOWS32]: Call perror_with_name if
+ windows32_openpipe fails, now that it always returns. This avoids
+ a compiler warning that error_prefix is not used in the MS-Windows
+ build.
+
+ * config.h.W32.template (OUTPUT_SYNC): Define.
+
+ * build_w32.bat: Add w32/compat/posixfcn.c to compilation and
+ linking commands.
+
+2013-04-20 Stefano Lattarini <stefano.lattarini@gmail.com> (tiny change)
+
+ * README.git: Our autoconf input file is 'configure.ac', not
+ 'configure.in'. Adjust accordingly.
+ * build_w32.bat: Likewise.
+ * config.h-vms.template: Likewise.
+ * Makefile.DOS.template: Likewise.
+
+2013-04-16 Paul Smith <psmith@gnu.org>
+
+ * misc.c (open_tmpfd): Add a new function that returns a temporary
+ file by file descriptor.
+ (open_tmpfile): Move here from main.c.
+ * job.c (assign_child_tempfiles): Use the new open_tmpfd().
+
+2013-04-15 Paul Smith <psmith@gnu.org>
+
+ * makeint.h (OUTPUT_SYNC_TARGET, OUTPUT_SYNC_MAKE): Rename.
+ * job.c (start_job_command): Use new constants.
+ * main.c: New -O argument format.
+
+ * doc/make.texi (Options Summary): Document the argument to -O.
+ * make.1: Ditto.
+
+ * main.c (define_makeflags): Don't add space between a single-char
+ option and its argument.
+
+2013-04-06 Paul Smith <psmith@gnu.org>
+
+ * doc/make.texi (Implicit Variables): Clarify LDFLAGS vs. LDLIBS.
+ Fixes Savannah bug #37970.
+
+ * remake.c (check_dep): Reconsider files waiting on prerequisites,
+ as they may have finished. Fixes Savannah bug #37703.
+
+2013-02-28 Paul Smith <psmith@gnu.org>
+
+ * function.c (func_realpath): On Solaris (at least) realpath() can
+ fail due to EINTR, so loop it. Fixes Savannah bug #38420.
+
+2013-02-25 Paul Smith <psmith@gnu.org>
+
+ Add a proposed supported API for GNU make loaded objects.
+
+ * doc/make.texi (Loaded Object API): Document it.
+ * Makefile.am (make_SOURCES): Add new loadapi.c.
+ * dep.h: Remove eval_buffer(); moved to loadapi.c:gmk_eval().
+ * read.c (eval_buffer): Change eval_buffer() signature.
+ * main.c (main): Change eval_buffer() signature.
+ * variable.h (define_new_function): Change func_ptr signature.
+ * load.c (SYMBOL_EXTENSION): Change the extension.
+ * loadapi.c: Implement the new API.
+ * gnumake.h (gmk_eval): New function prototype.
+ (gmk_expand) Ditto.
+ (gmk_add_function) Ditto.
+ * gmk-default.scm (gmk-eval): Remove: now implemented in guile.c.
+ * guile.c (guile_expand_wrapper): Use gmk_expand()
+ (guile_eval_wrapper): Implement eval here to avoid double-expansion.
+ (guile_define_module): Define gmk-eval.
+ (func_guile): Use new func_ptr calling model.
+ (guile_gmake_setup): Use gmk_add_function() to declare $(guile ...)
+ * function.c (function_table_entry): Provide alternative func_ptr.
+ (func_eval): New signature for eval_buffer();
+ (function_table_init): New initialization for function_table_entry.
+ (expand_builtin_function): Support alternative invocation signature.
+ (define_new_function): Ditto.
+
+2013-01-20 Paul Smith <psmith@gnu.org>
+
+ * gnumake.h: New file to contain externally-visible content.
+ * makeint.h: Include gnumake.h. Move gmk_floc type to gnumake.h.
+ * Makefile.am (include_HEADERS): Install the gnumake.h header.
+
+ * makeint.h: Change struct floc to gmk_floc typedef.
+ * Many: Use the new typedef.
+
+ * make.h: Rename to makeint.h.
+ * Many: Use the new name makeint.h.
+
+2013-01-19 Paul Smith <psmith@gnu.org>
+
+ * doc/make.texi (load Directive): Update to discuss location of
+ loaded object file.
+ (Remaking Loaded Objects): Document remaking of loaded objects.
+
+ * main.c (main): Rename READ_MAKEFILES to READ_FILES.
+ * read.c: Change READ_MAKEFILES to READ_FILES since it now
+ contains loaded object files as well.
+ (read_all_makefiles): Ditto.
+ (eval_makefile): Ditto.
+ (eval): Add any loaded file to the READ_FILES list, so that it
+ will be considered for re-build.
+
+ * load.c (load_file): Return the simple filename (no symbol) in
+ the LDNAME argument (now a const char **).
+ This filename should no longer have "./" prepended: modify the
+ function to always check the current directory if the name has no
+ "/", before using the normal methods.
+ * make.h: Change the load_file() prototype.
+
+ * README.git: Add a bit more documentation on Git workflow & rules.
+
+2013-01-13 Paul Smith <psmith@gnu.org>
+
+ * main.c (main): Restore all make flags after re-exec is complete.
+ Fixes Savannah bug #38051.
+
+2013-01-12 Paul Smith <psmith@gnu.org>
+
+ Convert CVS archive to Git.
+
+ * configure.in: Rename to configure.ac.
+ * README.cvs: Rename to README.git and rework for Git.
+ * maintMakefile: Use git clean for cleanup.
+ * ChangeLog: Use new Git repository URL.
+ * ChangeLog.2: Ditto.
+ * Makefile.am: Change documentation for Git
+ * Makefile.DOS.template: Ditto.
+ * README.template: Ditto.
+ * build_w32.bat: Ditto.
+ * prepare_w32.bat: Ditto.
+ * .cvsignore: Rename to .gitignore, and change to Git format.
+
+2012-12-08 Eli Zaretskii <eliz@gnu.org>
+
+ * job.c (create_batch_file): Fix last change: always increment the
+ counter of batch files before trying to use it.
+
+2012-12-07 Eli Zaretskii <eliz@gnu.org>
+
+ * job.c (construct_command_argv_internal): Remove " from
+ sh_chars_dos[]. Ignore an escaped backslash inside a string
+ quoted with "..". This lifts the 4KB or 8KB command-line length
+ limitation imposed by the Windows shells when a command uses quoted
+ strings, because we now don't call the shell in that case.
+
+ * job.c (create_batch_file): Declare the counter of batch files
+ static, to avoid having 2 jobs using the same file name and
+ stepping on each other's toes. When all 64K names are used up,
+ make one more loop looking for slots that became vacant. This
+ avoids leaving behind temporary batch files in the temporary
+ directory, which happens frequently on a fast machine when using
+ parallel builds.
+ (reap_children): Add debug message for when removal of a temporary
+ batch file fails.
+
+2012-10-29 Paul Smith <psmith@gnu.org>
+
+ New feature: "load" directive for dynamically-loaded objects.
+
+ * NEWS: Document new "load" directive.
+ * doc/make.texi (Extending make): New chapter on extensions to make.
+ * configure.in: Check for dlopen/dlsym/dlerror and -ldl.
+ * Makefile.am (make_SOURCES): Add new file load.c.
+ * make.h: Prototype for load_file().
+ * main.c (main): Add "load" to .FEATURES if it's available.
+ * read.c (eval): Parse "load" and "-load" directives.
+
+2012-09-29 Paul Smith <psmith@gnu.org>
+
+ * configure.in: Require a new version of gettext (1.18.1).
+ Fixes Savannah bug #37307.
+
+2012-09-09 Paul Smith <psmith@gnu.org>
+
+ * configure.in (bsd_signal): Define _GNU_SOURCE, a la make.h.
+ Fixes Savannah bug #32247.
+
+ * remake.c (update_file_1): Force intermediate files to be
+ considered, not pruned, if their non-intermediate parent needs to
+ be remade. Fixes Savannah bug #30653.
+
+ * job.c (construct_command_argv_internal): Keep the command line
+ on the heap for very long lines. Fixes Savannah bug #36451.
+
+ * function.c (func_realpath): BSD realpath(3) doesn't fail if the
+ file does not exist: use stat. Fixes Savannah bug #35919.
+
+ * file.c (expand_deps): Duplicate the current variable buffer, not
+ the old pointer. Fixes Savannah bug #36925.
+
+ * read.c (eval): If we detect an initial UTF-8 BOM, skip it.
+ Fixes Savannah bug #36529.
+ (record_target_var): Remove unused variable "fname".
+ (eval): Use the correct pointer when adding to the variable buffer.
+ Fixes Savannah bug #36106.
+
+2012-09-09 Eli Zaretskii <eliz@gnu.org>
+
+ * read.c (unescape_char): Fix a thinko in the last change.
+
+2012-09-09 Paul Smith <psmith@gnu.org>
+
+ * default.c (default_variables): Use a correct default LIBPPATERNS
+ for MacOS. Fixes Savannah bug #37197.
+
+ * read.c (record_files): Reset the default macro values if .POSIX
+ is set. Fixes Savannah bug #37069.
+ (parse_file_seq): Break out of an infinite loop if we're not
+ making progress when parsing archive references.
+
+2012-09-01 Eli Zaretskii <eliz@gnu.org>
+
+ * README.W32.template: Update for job-server and Guile support.
+
+ * read.c (unescape_char): Advance 'p' after copying the unescaped
+ characters. Otherwise the backslashes are incorrectly erased from
+ the original string.
+
+2012-03-05 Paul Smith <psmith@gnu.org>
+
+ Update copyright notices to use year ranges, as allowed by
+ clarifications in the GNU Maintainer's Manual.
+
+2012-03-04 Paul Smith <psmith@gnu.org>
+
+ * read.c (unescape_char): New function to remove escapes from a char.
+ (record_files): Call it on the dependency string to unescape ":".
+ Fixes Savannah bug #12126 and bug #16545.
+
+ * make.h (CSTRLEN): Determine the length of a constant string.
+ * main.c: Use the new macro.
+ * read.c: Ditto.
+ * variable.h: Ditto.
+ * function.c: Simplify checks for function alternatives.
+
+ * expand.c (variable_append): If the current set is local and the
+ next one is not a parent, then treat the next set as
+ local as well. Fixes Savannah bug #35468.
+
+2012-03-03 Paul Smith <psmith@gnu.org>
+
+ * acinclude.m4 (AC_STRUCT_ST_MTIM_NSEC): Add support for AIX 5.2+
+ nanosecond timestamps. Fixes Savannah bug #32485.
+
+ Convert uses of `foo' for quoting to 'foo' to reflect changes in
+ the GNU Coding Standards. Fixes Savannah bug #34530.
+
+ * job.c (construct_command_argv_internal): In oneshell we need to
+ break the SHELLFLAGS up for argv. Fixes Savannah bug #35397.
+
+ * function.c (func_filter_filterout): Recompute the length of each
+ filter word in case it was compressed due to escape chars. Don't
+ reset the string as it's freed. Fixes Savannah bug #35410.
+
+ * misc.c (collapse_continuations): Only use POSIX-style
+ backslash/newline handling if the .POSIX target is set.
+ Addresses Savannah bug #16670 without backward-incompatibility.
+ * NEWS: Document behavior change.
+ * doc/make.texi (Splitting Lines): New section describing how to
+ use backslash/newline to split long lines.
+
+2012-02-26 Paul Smith <psmith@gnu.org>
+
+ * implicit.c (pattern_search): Check the stem length to avoid
+ stack overflows in stem_str. Fixes Savannah bug #35525.
+
+2012-02-03 Eli Zaretskii <eliz@gnu.org>
+
+ * w32/subproc/sub_proc.c (proc_stdin_thread, proc_stdout_thread)
+ (proc_stderr_thread, process_pipe_io): Ifdef away unused
+ functions.
+
+ * w32/subproc/w32err.c (map_windows32_error_to_string) [_MSC_VER]:
+ Don't use TLS storage for szMessageBuffer. Ifdef away special
+ code for handling Winsock error codes. Make the function return a
+ `const char *'. Suggested by Ozkan Sezer. Fixes Savannah bug #34832.
+
+2012-01-29 Paul Smith <psmith@gnu.org>
+
+ * gmk-default.scm (to-string-maybe): Variables map to empty strings.
+ In Guile 2.0, (define ...) results in a variable object so make
+ sure that maps to an empty string in make.
+
+ * variable.c (parse_variable_definition): New POSIX assignment ::=
+ Take a struct variable to return more information after parsing.
+ (assign_variable_definition): New parse_variable_definition() call.
+ * variable.h: New declaration of parse_variable_definition().
+ * read.c (do_define): New parse_variable_definition() call.
+ (parse_var_assignment): Ditto.
+ (get_next_mword): Parse ::= as a variable assignment.
+ * doc/make.texi (Flavors): Describe the new ::= syntax.
+ * NEWS: Mention the ::= operator.
+
+ * variable.h (struct variable): Rearrange elts to reduce struct size.
+
+ * function.c (func_file): Create a new function, $(file ...)
+ * doc/make.texi (File Function): Document the $(file ..) function.
+ * NEWS: Announce it.
+
+ * gmk-default.scm (to-string-maybe): Use a more portable way to
+ test for unprintable characters.
+ * configure.in [GUILE]: Guile 1.6 doesn't have pkg-config
+ * build_w32.bat: Ditto.
+
+2012-01-28 Eli Zaretskii <eliz@gnu.org>
+
+ * config.h.W32.template: Update from config.h.in.
+
+ Support a Windows build with Guile.
+
+ * README.W32.template: Update with instructions for building with
+ Guile.
+
+ * build_w32.bat: Support building with Guile.
+
+ * make.h [HAVE_STDINT_H]: Include stdint.h.
+
+ * main.c (main, clean_jobserver): Move declarations of variables
+ not used in the WINDOWS32 build to the #else branch, to avoid
+ compiler warnings.
+
+ Fix failures on MS-Windows when Make's standard handles are invalid.
+ This can happen when Make is invoked from a GUI application.
+
+ * w32/subproc/sub_proc.c (process_init_fd): Don't dereference
+ pproc if it is a NULL pointer.
+ (process_begin, process_cleanup): Don't try to close pipe handles
+ whose value is INVALID_HANDLE_VALUE.
+ (process_easy): Initialize hIn, hOut, and hErr to
+ INVALID_HANDLE_VALUE. If DuplicateHandle fails with
+ ERROR_INVALID_HANDLE, duplicate a handle for the null device
+ instead of STD_INPUT_HANDLE, STD_OUTPUT_HANDLE or
+ STD_ERROR_HANDLE. Don't try to close pipe handles whose value is
+ INVALID_HANDLE_VALUE.
+
+ * function.c (windows32_openpipe): Initialize hIn and hErr to
+ INVALID_HANDLE_VALUE. If DuplicateHandle fails with
+ ERROR_INVALID_HANDLE, duplicate a handle for the null device
+ instead of STD_INPUT_HANDLE or STD_ERROR_HANDLE. Fix indentation.
+ Don't try to close handles whose value is INVALID_HANDLE_VALUE.
+
+2012-01-25 Eli Zaretskii <eliz@gnu.org>
+
+ * function.c (define_new_function): Fix format strings in calls to
+ `fatal'.
+
+2012-01-17 Paul Smith <psmith@gnu.org>
+
+ * guile.c (func_guile): Handle NULL returns from Guile.
+
+2012-01-16 Paul Smith <psmith@gnu.org>
+
+ * make.h (PATH_SEPARATOR_CHAR): Allow resetting for crosscompiling
+ for Windows. Patch by Chris Sutcliffe <ir0nh34d@gmail.com>
+ Fixes Savannah bug #34818.
+
+2012-01-15 Paul Smith <psmith@gnu.org>
+
+ * variable.h: Prototype an interface for defining new make functions.
+ * function.c (define_new_function): Define it.
+ (func_guile): Remove the "guile" function.
+ (function_table_init): Ditto.
+ * guile.c (func_guile): Add the "guile" function here.
+ (setup_guile): Call define_new_function() to define it.
+ (guile_eval_string): Obsolete.
+
+ * all: Update copyright notices.
+
+2012-01-12 Paul Smith <psmith@gnu.org>
+
+ Support GNU Guile as an embedded extension language for GNU make.
+
+ * NEWS: Note the new Guile capability.
+ * Makefile.am (EXTRA_DIST, make_SOURCES): Add new guile source files.
+ (AM_CFLAGS): Add Guile compiler flags.
+ (guile): Add a rule for converting default SCM into a C header.
+ * configure.in: Add support for --with-guile.
+ Also, convert the entire file to properly escaped autoconf m4, and
+ utilize newer features such as AS_IF() and AS_CASE().
+ * doc/make.texi (Guile Function): Document the GNU guile integration.
+ * make.h (guile_eval_string, guile_boot): Prototypes for Guile.
+ * main.c (main): Run guile_boot() to handle main().
+ (real_main): All the previous content of main() is here.
+ (real_main): Add "guile" to the .FEATURES variable.
+ * function.c (func_guile): Call Guile.
+ * guile.c: New file implementing GNU make integration with GNU Guile.
+ * gmk-default.scm: The integration of GNU make with Guile uses
+ Guile itself for much of the parsing and conversion of return
+ types, etc. This implementation is embedded into GNU make.
+ * config.h-vms.template: Disable Guile support.
+ * config.h.W32.template: Ditto.
+ * configh.dos.template: Ditto.
+ * config.ami.template: Ditto.
+ * makefile.vms: Add new Guile files.
+ * Makefile.DOS.template: Ditto.
+ * Makefile.ami: Ditto.
+ * NMakefile.template: Ditto.
+ * SMakefile.template: Ditto.
+ * build_w32.bat: Ditto.
+ * dosbuild.bat: Ditto.
+ * make_msvc_net2001.vcproj: Ditto.
+
+2011-11-15 Paul Smith <psmith@gnu.org>
+
+ * main.c (main): Use %ld when printing DWORD values.
+ * job.c (new_job): Ditto.
+ * w32/include/sub_proc.h: Use const.
+ * w32/subproc/sub_proc.c (open_jobserver_semaphore): Use const.
+ Fixes Savannah bug #34830. Changes suggested by Ozkan Sezer.
+
+ * configure.in (MAKE_JOBSERVER): Enable jobserver on W32 systems.
+ * config.h.W32.template (MAKE_JOBSERVER): Ditto.
+
+2011-11-14 Paul Smith <psmith@gnu.org>
+
+ * read.c (eval): parse_file_seq() might shorten the string due to
+ backslash removal. Start parsing again at the colon.
+ Fixes Savannah bug #33399.
+
+2011-11-13 Paul Smith <psmith@gnu.org>
+
+ * file.c (file_timestamp_cons): Match up data types to avoid warnings.
+ * filedef.h: Ditto.
+ * misc.c (concat): Ditto.
+ * read.c (eval): Assign value to avoid warnings.
+ * function.c (func_shell_base): Use fork() instead of vfork() to
+ avoid warnings.
+ * make.h (INTEGER_TYPE_SIGNED): Use <=0 to avoid warnings.
+ Fixes Savannah bug #34608.
+
+ * job.c (construct_command_argv): Remove _p.
+ (construct_command_argv_internal): Remove _ptr.
+ Fixes Savannah bug #32567.
+
+ * main.c (clean_jobserver): Don't write the free token to the pipe.
+ Change suggested by Tim Newsome <tnewsome@aristanetworks.com>
+
+ * acinclude.m4 (AC_STRUCT_ST_MTIM_NSEC): Add support for Darwin.
+ * filedef.h (FILE_TIMESTAMP_STAT_MODTIME): Ditto.
+ Patch provided by Troy Runkel <Troy.Runkel@mathworks.com>
+
+2011-10-11 Troy Runkel <Troy.Runkel@mathworks.com>
+
+ * config.h.W32: Enable job server support for Windows.
+ * main.c [WINDOWS32]: Include sub_proc.h
+ (main): Create a named semaphore to implement the job server.
+ (clean_jobserver): Free the job server semaphore when make is finished.
+ * job.c [WINDOWS32]: Define WAIT_NOHANG
+ (reap_children): Support non-blocking wait for child processes.
+ (free_child): Release job server semaphore when child process finished.
+ (job_noop): Don't define function on Windows.
+ (set_child_handler_action_flags): Don't define function on Windows.
+ (new_job): Wait for job server semaphore or child process termination.
+ (exec_command): Pass new parameters to process_wait_for_any.
+ * w32/include/sub_proc.h [WINDOWS32]: New/updated EXTERN_DECL entries.
+ * w32/subproc/sub_proc.c [WINDOWS32]: Added job server implementation.
+ (open_jobserver_semaphore): Open existing job server semaphore by name.
+ (create_jobserver_semaphore): Create new job server named semaphore.
+ (free_jobserver_semaphore): Close existing job server semaphore.
+ (acquire_jobserver_semaphore): Decrement job server semaphore count.
+ (release_jobserver_semaphore): Increment job server semaphore count.
+ (has_jobserver_semaphore): Returns whether job server semaphore exists.
+ (get_jobserver_semaphore_name): Returns name of job server semaphore.
+ (wait_for_semaphore_or_child_process): Wait for either the job server
+ semaphore to become signalled or a child process to terminate.
+ (process_wait_for_any_private): Support for non-blocking wait for child.
+ (process_wait_for_any): Added support for non-blocking wait for child.
+ (process_file_io): Pass new parameters to process_wait_for_any_private.
+
+2011-09-18 Paul Smith <psmith@gnu.org>
+
+ * main.c (main): If we're re-exec'ing and we're the master make,
+ then restore the job_slots value so it goes back into MAKEFLAGS
+ properly. See Savannah bug #33873.
+
+ * remake.c (library_search): STD_DIRS is computed when other
+ static vars like buflen etc. are computed, so it must be static
+ as well. See Savannah bug #32511.
+
+2011-09-16 Paul Smith <psmith@gnu.org>
+
+ * maintMakefile (do-po-update): Apparently we have to avoid
+ certificate checks on the http://translationproject.org site now.
+
+2011-09-12 Paul Smith <psmith@gnu.org>
+
+ * read.c (eval): Ensure exported variables are defined in the
+ global scope. Fixes Savannah bug #32498.
+
+2011-09-11 Paul Smith <psmith@gnu.org>
+
+ * Makefile.am (dist-hook): Remove w32/Makefile and .deps/ from the
+ dist file. Fixes Savannah bug #31489.
+
+ * doc/make.texi (Complex Makefile): Add a hint about using
+ #!/usr/bin/make (for Savannah support request #106459)
+
+2011-09-02 Paul Smith <psmith@gnu.org>
+
+ * remake.c (touch_file): If we have both -n and -t, -n takes
+ precedence. Patch from Michael Witten <mfwitten@gmail.com>
+
+2011-08-29 Paul Smith <psmith@gnu.org>
+
+ * expand.c (variable_expand_string): Always allocate a new buffer
+ for a string we're expanding. The string we're working on can get
+ freed while we work on it (for example if it's the value of a
+ variable which modifies itself using an eval operation).
+ See Savannah patch #7534 for the original report by Lubomir Rintel.
+
+2011-06-12 Paul Smith <psmith@gnu.org>
+
+ * read.c (parse_file_seq): Move the check for empty members out of
+ the loop so we can go to the next member properly.
+ Another fix for Savannah bug #30612.
+
+ * config.h-vms.template: Newer versions of VMS have strncasecmp()
+ Patch provided by: Hartmut Becker <becker.ismaning@freenet.de>
+
+2011-05-07 Paul Smith <psmith@gnu.org>
+
+ * expand.c (variable_append): Add a LOCAL argument to track
+ whether this is the first invocation or not. If it's not and
+ private_var is set, then skip this variable and try the next one.
+ Fixes Savannah bug #32872.
+
+ * read.c (parse_file_seq): Ensure existence checks use glob().
+
+2011-05-07 Eli Zaretskii <eliz@gnu.org>
+
+ * job.c (construct_command_argv_internal): Don't assume shellflags
+ is always non-NULL. Escape-protect characters special to the
+ shell when copying the value of SHELL into new_line. Fixes
+ Savannah bug #23922.
+
+2011-05-02 Paul Smith <psmith@gnu.org>
+
+ * doc/make.texi (Special Variables): Add documentation for the new
+ words in .FEATURES. Fixes Savannah bug #32058.
+ (Flavor Function): Rewrite the section on the flavor function.
+ Fixes Savannah bug #31582.
+
+ * function.c (func_sort): Use the same algorithm to count the
+ number of words we will get after the split, as we use to split.
+ Based on a patch from Matthias Hopf. Fixes Savannah bug #33125.
+
+ * make.h: Make global variable stack_limit extern.
+ Fixes Savannah bug #32753.
+
+2011-05-01 Paul Smith <psmith@gnu.org>
+
+ * read.c (parse_file_seq): Don't try to invoke glob() unless there
+ are potential wildcard characters in the filename. Performance
+ enhancement suggested by Michael Meeks <michael.meeks@novell.com>
+
+2011-04-29 Boris Kolpackov <boris@codesynthesis.com>
+
+ * read.c (eval_makefile): Delay caching of the file name until after
+ all the expansions and searches.
+
+2011-04-17 David A. Wheeler <dwheeler@dwheeler.com>
+
+ * doc/make.texi (Reading Makefiles): Document "!=".
+ (Setting): Ditto.
+ (Features): Ditto.
+ * variable.h (enum variable_flavor): New type "f_shell".
+ * variable.c (shell_result): Send a string to the shell and store
+ the output.
+ (do_variable_definition): Handle f_shell variables: expand the
+ value, then send it to the shell and store the result.
+ (parse_variable_definition): Parse "!=" shell assignments.
+ * read.c (get_next_mword): Treat "!=" as a varassign word.
+ * function.c (fold_newlines): If trim_newlines is set remove all
+ trailing newlines; otherwise remove only the last newline.
+ (func_shell_base): Move the guts of the shell function here.
+ (func_shell): Call func_shell_base().
+
+2011-02-21 Paul Smith <psmith@gnu.org>
+
+ * strcache.c (various): Increase performance based on comments
+ from Ralf Wildenhues <Ralf.Wildenhues@gmx.de>. Stop looking for
+ a buffer when we find the first one that fits, not the best fit.
+ If there is not enough free space in a buffer move it to a
+ separate list so we don't have to walk it again.
+ * make.h (NDEBUG): Turn off asserts unless maintainer mode is set.
+ (strcache_add_len, strcache_setbufsize): Use unsigned length/size.
+ * maintMakefile (AM_CPPFLAGS): Enable MAKE_MAINTAINER_MODE.
+
+ * remake.c (complain): Move translation lookups closer to use.
+
+2011-02-13 Paul Smith <psmith@gnu.org>
+
+ * doc/make.texi: Clean up references to "static" variables and
+ semicolon errors. Patch from Michael Witten <mfwitten@gmail.com>.
+
+2010-12-27 Paul Smith <psmith@gnu.org>
+
+ * make.1: Update the header/footer info in the man page.
+
+2010-11-28 Paul Smith <psmith@gnu.org>
+
+ * read.c (record_target_var): Don't reset v if it's the same as
+ the global version. Fixes Savannah bug #31743.
+
+2010-11-06 Paul Smith <psmith@gnu.org>
+
+ * variable.c (print_auto_variable): Print auto variables; ignore others.
+ (print_noauto_variable): Print non-auto variables; ignore others.
+ (print_variable_set): Allow the caller to select which type to print.
+ (print_target_variables): Show all the non-auto variables for a target.
+
+ * default.c (install_default_suffix_rules): Initialize recipe_prefix.
+ * rule.c (install_pattern_rule): Ditto.
+ * read.c (record_files): Pass in the current recipe prefix. Remember
+ it in the struct command for these targets.
+ (eval): Remember the value of RECIPEPREFIX when we start parsing.
+ Do not remove recipe prefixes from the recipe here: we'll do it later.
+ * job.c (start_job_command): Remove recipe prefix characters early,
+ before we print the output or chop it up.
+ * file.c (print_file): If recipe_prefix is not standard, reset it
+ in -p output. Assign target variables in -p output as well.
+
+ * commands.c (chop_commands): Max command lines is USHRT_MAX.
+ Set any_recurse as a bitfield.
+ * make.h (USHRT_MAX): Define if not set.
+
+2010-10-27 Paul Smith <psmith@gnu.org>
+
+ * commands.h (struct commands): Rearrange to make better use of
+ memory. Add new recipe_prefix value.
+
+2010-10-26 Paul Smith <psmith@gnu.org>
+
+ * doc/make.texi (Setting): Document the treatment of
+ backslash-newline in variable values.
+ * misc.c (collapse_continuations): Do not collapse multiple
+ backslash-newlines into a single space. Fixes Savannah bug #16670.
+
+2010-08-29 Paul Smith <psmith@gnu.org>
+
+ * doc/make.texi (Implicit Variables): Document LDLIBS and LOADLIBES.
+ Fixes Savannah bug #30807.
+ (Instead of Execution): Mention that included makefiles are still
+ rebuilt even with -n. Fixes Savannah bug #30762.
+
+ * configure.in: Bump to 3.82.90.
+
+ * make.h: Add trace_flag variable.
+ * main.c (switches): Add --trace option.
+ (trace_flag): Declare variable.
+ * job.c (start_job_command): Show recipe if trace_flag is set.
+ (new_job): Show trace messages if trace_flag is set.
+ * doc/make.texi (Options Summary): Document the new --trace option.
+ * make.1: Add --trace documentation.
+ * NEWS: Mention --trace.
+
+ * job.c (child_error): Show recipe filename/linenumber on error.
+ Also show "(ignored)" when appropriate even for signals/coredumps.
+ * NEWS: Mention file/linenumber change.
+
+ * main.c (main): Print version info when DB_BASIC is set.
+
+ * job.c (construct_command_argv_internal): If shellflags is not
+ set, choose an appropriate default value. Fixes Savannah bug #30748.
+
+2010-08-27 Eli Zaretskii <eliz@gnu.org>
+
+ * variable.c (define_automatic_variables) [__MSDOS__ || WINDOWS32]:
+ Remove trailing backslashes in $(@D), $(<D), etc., for consistency
+ with forward slashes. Fixes Savannah bug #30795.
+
+2010-08-13 Paul Smith <psmith@gnu.org>
+
+ * NEWS: Accidentally forgot to back out the sorted wildcard
+ enhancement in 3.82, so update NEWS.
+ Also add NEWS about the error check for explicit and pattern
+ targets in the same rule, added to 3.82.
+
+ * main.c (main): Add "oneshell" to $(.FEATURES) (forgot to add
+ this in 3.82!)
+
+ * read.c (parse_file_seq): Fix various errors parsing archives
+ with multiple objects in the parenthesis, as well as wildcards.
+ Fixes Savannah bug #30612.
+
+2010-08-10 Paul Smith <psmith@gnu.org>
+
+ * main.c (main): Expand MAKEFLAGS before adding it to the
+ environment when re-exec'ing. Fixes Savannah bug #30723.
+
+2010-08-07 Eli Zaretskii <eliz@gnu.org>
+
+ * w32/subproc/build.bat: Make all 3 cl.exe compile command lines
+ use the same /I switches. Fixes Savannah bug #30662.
+
+ * function.c (func_shell) [WINDOWS32]: Reset just_print_flag
+ around the call to construct_command_argv, so that a temporary
+ batch file _is_ created when needed for $(shell).
+ Fixes Savannah bug #16362.
+
+2010-08-07 Juan Manuel Guerrero <juan.guerrero@gmx.de>
+
+ * configh.dos.template (HAVE_STRNCASECMP): Define.
+
+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>
+
+ * build_w32.bat (GCCBuild): Use "-gdwarf-2 -g3" instead of
+ "-gstabs+ -ggdb3".
+
+ * w32/subproc/build.bat (GCCBuild): Likewise.
+
+2008-09-30 David Russo <d-russo@ti.com> (tiny change)
+
+ * job.c (construct_command_argv_internal): Avoid extra backslash
+ in batch-mode Unixy shells. Under DB_JOBS, display the contents
+ of the batch file.
+
+2008-05-31 Eli Zaretskii <eliz@gnu.org>
+
+ * README.W32.template: Remove obsolete text about non-support for
+ -jN without Unixy shell. Remove obsolete text about not supplying
+ Visual Studio project files (we do supply them). Modify text to
+ prefer GCC builds to MSC builds.
+
+2008-04-02 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
+
+ * doc/make.texi (Empty Targets): Fix typo.
+
+2008-03-27 Paul Smith <psmith@gnu.org>
+
+ Fix Savannah bug #22379:
+ * ar.c (ar_glob_match): Zero the allocated structure.
+ * read.c (parse_file_seq): Ditto.
+
+2008-03-08 Brian Dessent <brian@dessent.net>
+
+ * maintMakefile: Update Translation Project location.
+
+2008-01-26 Eli Zaretskii <eliz@gnu.org>
+
+ * variable.c (target_environment): Don't use shell_var if its
+ `value' field is NULL.
+
+2007-12-22 Eli Zaretskii <eliz@gnu.org>
+
+ Suggested by Juan Manuel Guerrero <juan.guerrero@gmx.de>:
+
+ * Makefile.DOS.template (info_TEXINFOS): Remove unused variable.
+ (TEXINFOS): Value changed to `doc/make.texi'.
+ (.SUFFIXES): Use .texi instead of .texinfo.
+ (make.info, make.dvi): Depend on doc/make.texi.
+ (.texi.info): New target, instead of ".texinfo.info". Change -I
+ switch to $(MAKEINFO) to look in doc/. Use --no-split.
+ (.texi): New target, instead of ".texinfo". Change -I switch to
+ $(MAKEINFO) to look in doc/. Use --no-split.
+ (.texi.dvi): New target, instead of ".texinfo.dvi". Change -I
+ switch to $(MAKEINFO) to look in doc/.
+ (install-info-am, uninstall-info): Don't look for "*.i[0-9]" and
+ "*.i[0-9][0-9]" (due to --no-split above).
+ (noinst_TEXINFOS, TEXI2HTML, TEXI2HTML_FLAGS): New variables.
+ (html, make_1.html): New targets.
+ (.PHONY): Add "html".
+ (.SUFFIXES): Add .html.
+
+2007-12-22 Juan Manuel Guerrero <juan.guerrero@gmx.de> (tiny change)
+
+ * configh.dos.template [__DJGPP__]: Replace HAVE_SYS_SIGLIST with
+ HAVE_DECL_SYS_SIGLIST.
+
+ * job.c (child_execute_job): Remove __MSDOS__ because MSDOS/DJGPP
+ build does not use child_execute_job.
+
+ * variable.c (define_automatic_variables) [__MSDOS__]: Always
+ export the SHELL environment variable to the child.
+
+2007-12-22 Eli Zaretskii <eliz@gnu.org>
+
+ * config.h.W32: Include sys/types.h.
+ [!_PID_T_] (pid_t): Define only if not already defined by sys/types.h.
+
+ * vpath.c (construct_vpath_list) [HAVE_DOS_PATHS]: Support VPATH
+ values that use `:' in drive letters, when PATH_SEPARATOR_CHAR is
+ also `:'.
+
+2007-11-04 Paul Smith <psmith@gnu.org>
+
+ * doc/make.texi: Convert references to "commands", "command
+ lines", and "command script" to "recipe".
+ * NEWS: Ditto.
+ * commands.c, file.c, job.c, remake.c, read.c, variable.c, main.c:
+ Ditto.
+
+2007-10-27 Bruno Haible <bruno@clisp.org>
+
+ * remake.c (f_mtime): Print time difference values between 100 and
+ ULONG_MAX in fixed-point notation rather than in exponention notation.
+
+2007-10-12 Eli Zaretskii <eliz@gnu.org>
+
+ * variable.c (do_variable_definition): Allow $(SHELL) to expand to
+ a more complex value than a simple shell: if it's not a default
+ shell now then expand it and see if is a default shell then.
+
+2007-10-10 Eli Zaretskii <eliz@gnu.org>
+
+ * dir.c (find_directory) [WINDOWS32]: Remove trailing slashes from
+ pathnames, with const strings.
+ * build_w32.bat [WINDOWS32]: If no config.h.W32 exists, create one
+ from the template (used for building from CVS, not a dist).
+
+2007-10-10 Paul Smith <psmith@gnu.org>
+
+ * make.h: Add a prototype for w32_kill() (change suggested by
+ Yongwei Wu <wuyongwei@gmail.com>).
+
+2007-09-21 Eli Zaretskii <eliz@gnu.org>
+
+ * w32/pathstuff.c (convert_Path_to_windows32): Handle quoted
+ directories in Path.
+
+2007-09-12 Paul Smith <psmith@gnu.org>
+
+ * doc/make.texi: Applied wording cleanups from Savannah patch #6195.
+ Provided by Diego Biurrun <diego@biurrun.de>
+ (Complex Makefile): Remove .PHONY setting for tar: patch #6196.
+ Provided by Diego Biurrun <diego@biurrun.de>
+
+2007-09-11 Paul Smith <psmith@gnu.org>
+
+ * doc/make.texi (Special Variables): Moved this into the "How to
+ Use Variables" chapter. Added a table entry for .RECIPEPREFIX.
+ (MAKEFILE_LIST) No longer a section; this was added into the
+ "Special Variables" section.
+ (Rule Introduction): Reference .RECIPEPREFIX.
+ (Simple Makefile): Ditto.
+ (Rule Syntax): Ditto.
+ (Command Syntax): Ditto.
+ (Error Messages): Ditto.
+
+2007-09-10 Paul Smith <psmith@gnu.org>
+
+ * commands.c (print_commands): Don't print an extra line in the
+ command scripts. Prefix the command scripts with cmd_prefix, not \t.
+
+ * read.c (construct_include_path): Add the full string to the cache; we
+ were chopping the last char.
+
+ * NEWS: Announce the .RECIPEPREFIX special variable.
+ * variable.c (lookup_special_var): Rename from handle_special_var().
+ (lookup_variable): Call the new name.
+ (set_special_var): New function: handle setting of special variables.
+ When setting .RECIPEPREFIX, reset the cmd_prefix global variable.
+ (do_variable_definition): Call it.
+ * make.h (RECIPEPREFIX_DEFAULT): Define the default command prefix char.
+ (RECIPEPREFIX_NAME): Define the command prefix special variable name.
+ * main.c (main): Create the .RECIPEPREFIX special variable.
+ * read.c (eval): Remove the cmd_prefix characters from the command
+ scripts here, so they're not stored in the commands array at all,
+ rather than waiting and stripping them out during command construction.
+ * job.c (construct_command_argv_internal): Don't skip cmd_prefix here.
+
+2007-08-15 Paul Smith <psmith@gnu.org>
+
+ * doc/make.texi (GNU Free Documentation License): The fdl.texi
+ file has had the section info removed, so add some to make.texi
+ before we include it.
+
+2007-08-15 Icarus Sparry <savannah@icarus.freeuk.com>
+
+ * remake.c (check_dep): Reset the target state for intermediate
+ files. They might have been considered before but not updated
+ then (order-only for example) but they will be this time.
+ Fixes Savannah bug #'s 3330 and 15919.
+
+2007-07-21 Eli Zaretskii <eliz@gnu.org>
+
+ Fix Savannah bug #20549:
+ * function.c (func_shell): Call construct_command_argv with zero
+ value of FLAGS.
+ * job.c (construct_command_argv_internal): New argument FLAGS; all
+ callers changed.
+ [WINDOWS32]: If FLAGS has the COMMANDS_RECURSE bit set, ignore
+ just_print_flag.
+ * job.h (construct_command_argv_internal): Update prototype.
+
+2007-07-13 Paul Smith <psmith@gnu.org>
+
+ * file.c (expand_deps): Use variable_buffer as the start of the
+ buffer, not the original pointer (in case it was reallocated).
+ Fix suggested by Rafi Einstein <rafi.einstein@formalism-labs.com>.
+ Fixes Savannah bug #20452.
+
+2007-07-04 Paul Smith <psmith@gnu.org>
+
+ * (ALL FILES): Update to GPLv3.
+ * (ALL FILES): Update copyright for 2007.
+
+ * main.c (print_version): Move the host type info to the second line.
+
+2007-06-29 Thiemo Seufer <ths@mips.com>
+
+ * maintMakefile: Update Translation Project location.
+
+2007-06-13 Paul Smith <psmith@gnu.org>
+
+ * doc/make.texi (Reading Makefiles): "Expansion of deferred" ->
+ "Expansion of a deferred"
+ Fixes Savannah bug #20018.
+
+ * expand.c (variable_expand_for_file): Preserve the value of
+ reading_file rather than setting it to 0 at the end.
+ Fixes Savannah bug #20033.
+
+2007-05-11 Paul Smith <psmith@gnu.org>
+
+ * job.c (new_job): Add debug info to specify where make found the
+ command script it is running to build a target.
+ Fixes Savannah bug #18617.
+
+ * default.c (default_suffixes,default_suffix_rules,default_variables):
+ Add support for Objective C. Fixes Savannah bug #16389.
+ Based on a patch provided by Peter O'Gorman <peter@pogma.com>.
+
+ * function.c (func_lastword): Initialize p.
+
+ * doc/make.texi (Eval Function, Implicit Variables, Special Targets):
+ Doc fixes noticed by Bob <twobanjobob@sbcglobal.net>. Patch from
+ Dave Korn <dave.korn@artimi.com>
+
+2007-05-08 Paul Smith <psmith@gnu.org>
+
+ Fix Savannah bug #19656:
+
+ * configure.in: Check for strcasecmp(), strcmpi(), and stricmp().
+
+ * make.h: Change all case-insensitive string compares to use
+ strcasecmp() (from POSIX). If we don't have that but do have one
+ of the others, define strcasecmp to be one of those instead. If
+ we don't have any, declare a prototype for our own version.
+
+ * misc.c (strcasecmp): Use this if we can't find any native
+ case-insensitive string comparison function.
+ * vmsfunctions.c: Remove strcmpi(); we'll use misc.c:strcasecmp().
+ * main.c (find_and_set_default_shell): Use strcasecmp() instead of
+ strcmpi().
+ * job.c (_is_unixy_shell, construct_command_argv_internal): Use
+ strcasecmp() instead of stricmp().
+ * hash.h (ISTRING_COMPARE, return_ISTRING_COMPARE): Use strcasecmp()
+ instead of strcmpi().
+ * acinclude.m4: Remove the strcasecmp() check from here.
+
+2007-03-21 Paul Smith <psmith@gnu.org>
+
+ * configure.in: Don't turn on case-insensitive file system support
+ if --disable-... is given. Fixes Savannah bug #19348.
+
+2007-03-19 Paul Smith <psmith@gnu.org>
+
+ * ALL: Use the strcache for all file name strings, or other
+ strings which we will never free. The goal is to save memory by
+ avoiding duplicate copies of strings. However, at the moment this
+ doesn't save much memory in most situations: due to secondary
+ expansion we actually save prerequisite lists twice (once before
+ the secondary expansion, and then again after it's been parsed
+ into individual file names in the dep list). We will resolve this
+ in a future change, by doing the parsing up-front for targets
+ where secondary expansion is not set.
+
+ Moving things into the strcache also allows us to use const
+ pointers in many more places.
+
+2007-01-03 Paul Smith <psmith@gnu.org>
+
+ * make.h (ENULLLOOP): Reset errno after each failed invocation of
+ the function, not just the first. Fixes Savannah bug #18680.
+
+2006-11-18 Paul Smith <psmith@gnu.org>
+
+ * strcache.c (strcache_add_len): Don't allocate a new buffer
+ unless the string is not already nil-terminated. Technically this
+ is a violation of the standard, since we may be passed an array
+ that is not long enough to test one past. However, in make this
+ is never true since we only use nil-terminated strings or
+ sub-strings thereof.
+
+ * read.c (eval, do_define): Use cmd_prefix instead of '\t'.
+
+ * main.c: New global cmd_prefix, defaults to '\t'.
+ * job.c (construct_command_argv_internal): Use cmd_prefix instead
+ of '\t'.
+
+ * dir.c: Constified.
+ (dir_contents_file_exists_p): Check for an error return from
+ readdir(), just in case.
+
+ * commands.c: Constified.
+ * default.c: Constified.
+ * expand.c: Constified.
+ * function.c: Partial constification.
+ * variable.c: Partial constification.
+ * vmsify.c: Constification. Hard to test this but I hope I didn't
+ screw it up!
+ * vpath.c: Partial constification.
+ * w32/pathstuff.c: Partial constification.
+
+2006-11-16 Eli Zaretskii <eliz@gnu.org>
+
+ * main.c (main) [HAVE_DOS_PATHS]: Treat DOS style argv[0] with
+ backslashes and drive letters as absolute.
+
+2006-10-22 Paul Smith <psmith@gnu.org>
+
+ * main.c (struct command_switch): Use const and void*.
+
+2006-10-21 Paul Smith <psmith@gnu.org>
+
+ * ar.c: Constified.
+ * arscan.c: Constified.
+
+2006-09-30 Paul Smith <psmith@gnu.org>
+
+ * doc/make.texi (MAKEFILE_LIST Variable): Modify reference to
+ point to lastword since the example was updated.
+ Fixes Savannah bug #16304.
+ (Secondary Expansion): Correct example description.
+ Fixes Savannah bug #16468.
+ (Makefile Contents): Clarify that comments cannot appear within
+ variable references or function calls.
+ Fixes Savannah bug #16577.
+ (Special Targets): Clarify how .NOTPARALLEL works in recursion.
+ Fixes Savannah bug #17701.
+ Reported by Ralf Wildenhues <Ralf.Wildenhues@gmx.de>:
+ (Prerequisite Types): Added an example of using order-only
+ prerequisites. Fixes Savannah bug #17880.
+ (Rule Syntax): "lise" -> "list"
+ (Multiple Rules): ... -> @dots{}
+ (Splitting Lines): ditto.
+
+ * remake.c (update_file_1): Prereqs that don't exist should be
+ considered changed, for the purposes of $?.
+ Fixes Savannah bug #16051.
+
+ * make.1: Remove extraneous "+".
+ Fixes Savannah bug #16652.
+
+2006-09-06 Paul D. Smith <psmith@gnu.org>
+
+ * configure.in: Include sys/types.h when checking for sys/wait.h.
+
+2006-08-18 Eli Zaretskii <eliz@gnu.org>
+
+ * configure.in (PATH_SEPARATOR_CHAR): Define to the value of
+ $PATH_SEPARATOR.
+
+ * make.h (PATH_SEPARATOR_CHAR): Define only if still undefined.
+ Normally, it is defined in config.h.
+
+ * config/dospaths.m4 <ac_cv_dos_paths>: Define to yes on Cygwin as
+ well.
+
+ * job.c (construct_command_argv_internal) [HAVE_DOS_PATHS]: Define
+ sh_chars_sh for Windows platforms that emulate Unix.
+
+2006-05-07 Paul D. Smith <psmith@gnu.org>
+
+ * README.OS2.template: Updates provided by Andreas Buening
+ <andreas.buening@nexgo.de>.
+
+2006-04-30 Paul D. Smith <psmith@gnu.org>
+
+ * make.h: Include <direct.h> if HAVE_DIRECT_H.
+ * config.h.W32.template (HAVE_DIRECT_H): Set it if it's available.
+
+2006-04-26 Paul D. Smith <psmith@gnu.org>
+
+ * README.cvs: Add a reminder to notify the GNU translation robot.
+
+ * doc/make.texi: Change @direcategory (requested by Karl Berry).
+
+2006-04-20 Paul D. Smith <psmith@gnu.org>
+
+ * maintMakefile (po-check): Use Perl instead of grep -E, for systems
+ that don't have extended grep.
+ (cvsclean): Use $(PERL) instead of perl.
+
+2006-04-09 Paul D. Smith <psmith@gnu.org>
+
+ * maintMakefile: Add some extra warning options (GCC 4.1 only?)
+
+ * expand.c, implicit.c, main.c, read.c: Rename variables so that
+ inner-scope variables don't mask outer-scope variables.
+
+ * ar.c, arscan.c, commands.c, default.c, dir.c, expand.c, file.c:
+ * function.c, getloadavg.c, implicit.c, job.c, main.c, misc.c, read.c:
+ * remake.c, remote-cstms.c, rule.c, strcache.c, variable.c:
+ * vmsfunctions.c, vmsify.c, vpath.c: Remove all casts of returned
+ values from memory allocation functions: they return void* and so
+ don't need to be cast. Also remove (char *) casts of arguments to
+ xrealloc().
+
+ * configure.in: Remove checks for memcpy/memmove/strchr.
+
+ * make.h: Remove bcmp/bcopy/bzero/strchr/strrchr macros.
+
+ * ar.c, arscan.c, commands.c, dir.c: Convert all bzero/bcopy/bcmp
+ calls to memset/memcpy/memmove/memcmp calls.
+ * expand.c, file.c, function.c, getloadavg.c, implicit.c: Ditto.
+ * job.c, main.c, misc.c, read.c, remake.c, rule.c: Ditto.
+ * variable.c, vpath.c: Ditto.
+
+ * make.h (EXIT_FAILURE): Should be 1, not 0.
+
+2006-04-06 Paul D. Smith <psmith@gnu.org>
+
+ * configure.in: Removed AM_C_PROTOTYPES. Starting now on we
+ require an ISO C 1989 standard compiler and runtime library.
+
+ * Makefile.am: Remove the ansi2knr feature.
+
+ * make.h: Remove the PARAMS() macro definition and all uses of it.
+
+ * amiga.h, ar.c, arscan.c: Remove all uses of the PARAMS() macro.
+ * commands.c, commands.h, config.h-vms.template: Ditto.
+ * dep.h, dir.c, expand.c, filedef.h, function.c: Ditto.
+ * implicit.c, job.c, job.h, main.c, read.c, remake.c: Ditto.
+ * rule.c, rule.h, variable.h, vmsdir.h, vmsjobs.c, vpath.c: Ditto.
+
+ * NEWS: Update.
+
+2006-04-01 Paul D. Smith <psmith@gnu.org>
+
+ Version 3.81 released.
+
+ * NEWS: Updated for 3.81.
+
+ * README.cvs: Mention that vpath builds are not supported out of
+ CVS. Fixes Savannah bug #16236.
+ Remove update of make.texi from the list of things to do; we use
+ version.texi now.
+
+2006-03-26 Paul D. Smith <psmith@gnu.org>
+
+ * doc/make.texi: Clean up licensing. Use @copying and version.texi
+ support from automake, as described in the Texinfo manual.
+
+2006-03-25 Eli Zaretskii <eliz@gnu.org>
+
+ * implicit.c (pattern_search) [HAVE_DOS_PATHS]: Don't compare b
+ with lastslash, since the latter points to filename, not to
+ target.
+ * job.c (construct_command_argv_internal) [HAVE_DOS_PATHS]:
+ Declare and define sh_chars_sh[].
+
+2006-03-23 Paul D. Smith <psmith@gnu.org>
+
+ * configure.in: Look for build.sh.in in $srcdir so it will be
+ built for remote configurations as well.
+
+ * Makefile.am: Make sure to clean up build.sh during distclean.
+ Fixes Savannah bug #16166.
+
+ * misc.c (log_access): Takes a const char *.
+ * function.c (fold_newlines): Takes an unsigned int *.
+ Both fixes for Savannah bug #16170.
+
+2006-03-22 Boris Kolpackov <boris@kolpackov.net>
+
+ * implicit.c (pattern_search): Call set_file_variables only
+ if we have prerequisites that need second expansion. Fixes
+ Savannah bug #16140.
+
+2006-03-19 Paul D. Smith <psmith@gnu.org>
+
+ * remake.c (update_file): Add alloca(0) to clean up alloca'd
+ memory on hosts that don't support it directly.
+
+ * README.cvs: Add information on steps for making a release (to
+ make sure I don't forget any).
+
+ * main.c (clean_jobserver): Move jobserver cleanup code into a new
+ function.
+ (die): Cleanup code was removed from here; call the new function.
+ (main): If we are re-execing, clean up the jobserver first so we
+ don't leak file descriptors.
+ Reported by Craig Fithian <craig.fithian@citigroup.com>
+
+2006-03-17 Paul D. Smith <psmith@gnu.org>
+
+ * maintMakefile (do-po-update): Rewrite this rule to clean up and
+ allow multiple concurrent runs.
+ Patch from Joseph Myers <joseph@codesourcery.com>
+
+2006-03-17 Boris Kolpackov <boris@kolpackov.net>
+
+ * dep.h (struct dep): Add the stem field.
+ * misc.c (alloc_dep, free_dep): New functions.
+ (copy_dep_chain): Copy stem.
+ (free_dep_chain): Use free_dep.
+ * read.c (record_files): Store stem in the dependency line.
+ * file.c (expand_deps): Use stem stored in the dependency line. Use
+ free_dep_chain instead of free_ns_chain.
+ * implicit.c (pattern_search): Use alloc_dep and free_dep.
+ * read.c (read_all_makefiles, eval_makefile, eval): Ditto.
+ * main.c (main, handle_non_switch_argument): Ditto.
+ * remake.c (check_dep): Ditto.
+ * rule.c (convert_suffix_rule, freerule): Ditto.
+
+2006-03-14 Paul D. Smith <psmith@gnu.org>
+
+ * expand.c (variable_append): Instead of appending everything then
+ expanding the result, we expand (or not, if it's simple) each part
+ as we add it.
+ (allocated_variable_append): Don't expand the final result.
+ Fixes Savannah bug #15913.
+
+2006-03-09 Paul Smith <psmith@gnu.org>
+
+ * remake.c (update_file_1): Revert the change of 3 Jan 2006 which
+ listed non-existent files as changed. Turns out there's a bug in
+ the Linux kernel builds which means that this change causes
+ everything to rebuild every time. We will re-introduce this fix
+ in the next release, to give them time to fix their build system.
+ Fixes Savannah bug #16002.
+ Introduces Savannah bug #16051.
+
+ * implicit.c (pattern_search) [DOS_PATHS]: Look for DOS paths if
+ we *don't* find UNIX "/".
+ Reported by David Ergo <david.ergo@alterface.com>
+
+2006-03-04 Eli Zaretskii <eliz@gnu.org>
+
+ * variable.c (do_variable_definition) [WINDOWS32]: Call the shell
+ locator function find_and_set_default_shell if SHELL came from the
+ command line.
+
+2006-02-20 Paul D. Smith <psmith@gnu.org>
+
+ * variable.c (merge_variable_set_lists): It's legal for *setlist0
+ to be null; don't core in that case.
+
+2006-02-19 Paul D. Smith <psmith@gnu.org>
+
+ * commands.c (set_file_variables): Realloc, not malloc, the static
+ string values to avoid memory leaks.
+
+ * expand.c (recursively_expand_for_file): Only set reading_file to
+ an initialized value.
+
+ * implicit.c (pattern_search): We need to make a copy of the stem
+ if we get it from an intermediate dep, since those get freed.
+
+ * file.c (lookup_file) [VMS]: Don't lowercase special targets that
+ begin with ".".
+ (enter_file) [VMS]: Ditto.
+ Patch provided by Hartmut Becker <Hartmut.Becker@hp.com>.
+
+2006-02-24 Eli Zaretskii <eliz@gnu.org>
+
+ * job.c (construct_command_argv_internal): Fix last change.
+
+ * w32/subproc/sub_proc.c (process_pipe_io): Make dwStdin,
+ dwStdout, and dwStderr unsigned int: avoids compiler warnings in
+ the calls to _beginthreadex.
+
+ * expand.c (recursively_expand_for_file): Initialize `save' to
+ prevent compiler warnings.
+
+2006-02-18 Eli Zaretskii <eliz@gnu.org>
+
+ * job.c (construct_command_argv_internal): Don't create a temporary
+ script/batch file if we are under -n. Call _setmode to switch the
+ script file stream to text mode.
+
+2006-02-17 Paul D. Smith <psmith@gnu.org>
+
+ * variable.c (merge_variable_set_lists): Don't try to merge the
+ global_setlist. Not only is this useless, but it can lead to
+ circularities in the linked list, if global_setlist->next in one
+ list gets set to point to another list which also ends in
+ global_setlist.
+ Fixes Savannah bug #15757.
+
+2006-02-15 Paul D. Smith <psmith@gnu.org>
+
+ Fix for Savannah bug #106.
+
+ * expand.c (expanding_var): Keep track of which variable we're
+ expanding. If no variable is being expanded, it's the same as
+ reading_file.
+ * make.h (expanding_var): Declare it.
+ * expand.c (recursively_expand_for_file): Set expanding_var to the
+ current variable we're expanding, unless there's no file info in
+ it (could happen if it comes from the command line or a default
+ variable). Restore it before we exit.
+ * expand.c (variable_expand_string): Use the expanding_var file
+ info instead of the reading_file info.
+ * function.c (check_numeric): Ditto.
+ (func_word): Ditto.
+ (func_wordlist): Ditto.
+ (func_error): Ditto.
+ (expand_builtin_function): Ditto.
+ (handle_function): Ditto.
+
+2006-02-14 Paul D. Smith <psmith@gnu.org>
+
+ * read.c (eval): Even if the included filenames expands to the
+ empty string we still need to free the allocated buffer.
+
+ * implicit.c (pattern_search): If we allocated a variable set for
+ an impossible file, free it.
+ * variable.c (free_variable_set): New function.
+ * variable.h: Declare it.
+
+ * read.c (read_all_makefiles): Makefile names are kept in the
+ strcache, so there's never any need to alloc/free them.
+ (eval): Ditto.
+
+ * main.c (main): Add "archives" to the .FEATURES variable if
+ archive support is enabled.
+ * doc/make.texi (Special Variables): Document it.
+
+2006-02-13 Paul D. Smith <psmith@gnu.org>
+
+ * implicit.c (pattern_search): Add checking for DOS pathnames to
+ the pattern rule target LASTSLASH manipulation.
+ Fixes Savannah bug #11183.
+
+2006-02-11 Paul D. Smith <psmith@gnu.org>
+
+ * (ALL FILES): Updated copyright and license notices.
+
+2006-02-10 Paul D. Smith <psmith@gnu.org>
+
+ A new internal capability: the string cache is a read-only cache
+ of strings, with a hash table interface for fast lookup. Nothing
+ in the cache will ever be freed, so there's no need for reference
+ counting, etc. This is the beginning of a full solution for
+ Savannah bug #15182, but for now we only store makefile names here.
+
+ * strcache.c: New file. Implement a read-only string cache.
+ * make.h: Add prototypes for new functions.
+ * main.c (initialize_global_hash_tables): Initialize the string cache.
+ (print_data_base): Print string cache stats.
+ * read.c (eval_makefile): Use the string cache to store makefile
+ names. Rewrite the string allocation to be sure we free everything.
+
+2006-02-10 Eli Zaretskii <eliz@gnu.org>
+
+ * dir.c (dir_contents_file_exists_p): Don't opendir if the
+ directory time stamp didn't change, except on FAT filesystems.
+ Suggested by J. David Bryan <jdbryan@acm.org>.
+
+2006-02-09 Paul D. Smith <psmith@gnu.org>
+
+ * function.c (func_or): Implement a short-circuiting OR function.
+ (func_and): Implement a short-circuiting AND function.
+ (function_table_init): Update the table with the new functions.
+ * doc/make.texi (Conditional Functions): Changed the "if" section
+ to one on general conditional functions. Added documentation for
+ $(and ...) and $(or ...) functions.
+ * NEWS: Note new $(and ...) and $(or ...) functions.
+
+2006-02-08 Boris Kolpackov <boris@kolpackov.net>
+
+ * job.h (struct child): Add the dontcare bitfield.
+ * job.c (new_job): Cache dontcare flag.
+ * job.c (reap_children): Use cached dontcare flag instead of the
+ one in struct file. Fixes Savannah bug #15641.
+
+2006-02-06 Paul D. Smith <psmith@gnu.org>
+
+ * vpath.c (selective_vpath_search): If the file we find has a
+ timestamp from -o or -W, use that instead of the real time.
+ * remake.c (f_mtime): If the mtime is a special token from -o or
+ -W, don't overwrite it with the real mtime.
+ Fixes Savannah bug #15341.
+
+ Updates from Markus Mauhart <qwe123@chello.at>:
+
+ * w32/subproc/sub_proc.c (process_begin): Remove no-op tests.
+ (process_signal, process_last_err, process_exit_code): Manage
+ invalid handle values.
+ (process_{outbuf,errbuf,outcnt,errcnt,pipes}): Unused and don't
+ manage invalid handles; remove them.
+ * job.c (start_job_command) [WINDOWS32]: Jump out on error.
+ * config.h.W32.template [WINDOWS32]: Set flags for Windows builds.
+ * README.cvs: Updates for building from CVS.
+
+2006-02-05 Paul D. Smith <psmith@gnu.org>
+
+ * file.c (enter_file): Keep track of the last double_colon entry,
+ to avoid walking the list every time we want to add a new one.
+ Fixes Savannah bug #15533.
+ * filedef.h (struct file): Add a new LAST pointer.
+
+ * dir.c (directory_contents_hash_cmp): Don't use subtraction to do
+ the comparison. For 64-bits systems the result of the subtraction
+ might not fit into an int. Use comparison instead.
+ Fixes Savannah bug #15534.
+
+ * doc/make.texi: Update the chapter on writing commands to reflect
+ the changes made in 3.81 for backslash/newline and SHELL handling.
+
+2006-02-01 Paul D. Smith <psmith@gnu.org>
+
+ * dir.c (dir_contents_file_exists_p) [WINDOWS32]: Make sure
+ variable st is not used when it's not initialized.
+ Patch from Eli Zaretskii <eliz@gnu.org>.
+
+2006-01-31 Paul D. Smith <psmith@gnu.org>
+
+ * README.W32.template: Applied patch #4785 from
+ Markus Mauhart <qwe123@chello.at>.
+ * README.cvs: Applied patch #4786 from
+ Markus Mauhart <qwe123@chello.at>.
+ * make_msvc_net2003.vcproj [WINDOWS32]: New version from
+ J. Grant <jg@jguk.org>.
+
+ * main.c: Update the copyright year in the version output.
+ * prepare_w32.bat: Remove this file from the distribution.
+
+2006-01-21 Eli Zaretskii <eliz@gnu.org>
+
+ * remake.c (update_goal_chain): Set g->changed instead of
+ incrementing it, as it is only 8-bit wide, and could overflow if
+ many commands got started in update_file.
+
+ * w32/include/sub_proc.h: Add a prototype for process_used_slots.
+
+ * w32/subproc/sub_proc.c: Change dimension of proc_array[] to
+ MAXIMUM_WAIT_OBJECTS.
+ (process_wait_for_any_private): Change dimension of handles[]
+ array to MAXIMUM_WAIT_OBJECTS.
+ (process_used_slots): New function.
+ (process_register): Don't register more processes than the
+ available number of slots.
+ (process_easy): Don't start new processes if all slots are used up.
+
+ * job.c (load_too_high, start_waiting_jobs) [WINDOWS32]: If there
+ are already more children than sub_proc.c can handle, behave as if
+ the load were too high.
+ (start_job_command): Fix a typo in error message when process_easy
+ fails.
+
+2006-01-14 Eli Zaretskii <eliz@gnu.org>
+
+ * main.c (main) [WINDOWS32]: Don't refuse to run with -jN, even if
+ the shell is not sh.exe.
+
+ * job.c (create_batch_file): Renamed from create_batch_filename;
+ all callers changed. Don't close the temporary file; return its
+ file descriptor instead. New arg FD allows to return the file
+ descriptor.
+ (construct_command_argv_internal): Use _fdopen instead of fopen to
+ open the batch file.
+
+2006-01-04 Paul D. Smith <psmith@gnu.org>
+
+ * readme.vms: Updates for case-insensitive VMS file systems from
+ Hartmut Becker <Hartmut.Becker@hp.com>.
+ * dir.c (vms_hash): Ditto.
+ * vmsify.c (copyto): Ditto.
+ * vmsfunctions.c (readdir): Ditto.
+
+ * make.1: Add a section on the exit codes for make.
+
+ * doc/make.texi: A number of minor updates to the documentation.
+
+2006-01-03 Paul D. Smith <psmith@gnu.org>
+
+ * remake.c (update_file_1): Mark a prerequisite changed if it
+ doesn't exist.
+
+ * read.c (eval): Be sure to strip off trailing whitespace from the
+ prerequisites list properly. Also, initialize all fields in
+ struct dep when creating a new one.
+
+2005-12-28 Paul D. Smith <psmith@gnu.org>
+
+ * config.h.W32.template [WINDOWS32]: Add in some pragmas to
+ disable warnings for MSC.
+ Patch by Rob Tulloh <rtulloh@yahoo.com>.
+
+2005-12-17 Eli Zaretskii <eliz@gnu.org>
+
+ * doc/make.texi (Execution): Add a footnote about changes in
+ handling of backslash-newline sequences. Mention the differences
+ on MS-DOS and MS-Windows.
+
+ * NEWS: More details about building the MinGW port and a pointer
+ to README.W32. Fix the section name that describes the new
+ backward-incompatible processing of backslash-newline sequences.
+ The special processing of SHELL set to "cmd" is only relevant to
+ MS-Windows, not MS-DOS.
+
+2005-12-17 Eli Zaretskii <eliz@gnu.org>
+
+ * main.c (handle_runtime_exceptions): Cast exrec->ExceptionAddress
+ to DWORD, to avoid compiler warnings.
+ * job.c (exec_command): Cast hWaitPID and hPID to DWORD, and
+ use %ld in format, to avoid compiler warnings.
+
+ * doc/make.texi (Special Targets): Fix a typo.
+ (Appending): Fix cross-reference to Setting.
+ (Special Variables, Secondary Expansion, File Name Functions)
+ (Flavor Function, Pattern Match, Quick Reference): Ensure two
+ periods after a sentence.
+ (Execution): Add @: after "e.g.".
+ (Environment): Fix punctuation.
+ (Target-specific, Call Function, Quick Reference): Add @: after "etc."
+ (Shell Function, Target-specific): Add @: after "vs."
+
+2005-12-14 Boris Kolpackov <boris@kolpackov.net>
+
+ * read.c (record_target_var): Initialize variable's export field
+ with v_default instead of leaving it "initialized" by whatever
+ garbage happened to be on the heap.
+
+2005-12-12 Paul D. Smith <psmith@gnu.org>
+
+ * make.1: Fix some display errors and document all existing options.
+ Patch by Mike Frysinger <vapier@gentoo.org>.
+
+2005-12-11 Paul D. Smith <psmith@gnu.org>
+
+ * implicit.c (pattern_search): If 2nd expansion is not set for
+ this implicit rule, replace the pattern with the stem directly,
+ and don't re-expand the variable list. Along with the other
+ .SECONDEXPANSION changes below, fixes bug #13781.
+
+2005-12-09 Boris Kolpackov <boris@kolpackov.net>
+
+ * implicit.c (pattern_search): Mark other files that this rule
+ builds as targets so that they are not treated as intermediates
+ by the pattern rule search algorithm. Fixes bug #13022.
+
+2005-12-07 Boris Kolpackov <boris@kolpackov.net>
+
+ * remake.c (notice_finished_file): Propagate the change of
+ modification time to all the double-colon entries only if
+ it is the last one to be updated. Fixes bug #14334.
+
+2005-11-17 Boris Kolpackov <boris@kolpackov.net>
+
+ * function.c (func_flavor): Implement the flavor function which
+ returns the flavor of a variable.
+ * doc/make.texi (Functions for Transforming Text): Document it.
+ * NEWS: Add it to the list of new functions.
+
+2005-11-14 Boris Kolpackov <boris@kolpackov.net>
+
+ * read.c (construct_include_path): Set the .INCLUDE_DIRS special
+ variable.
+ * doc/make.texi (Special Variables): Document .INCLUDE_DIRS.
+ * NEWS: Add .INCLUDE_DIRS to the list of new special variables.
+
+2005-10-26 Paul Smith <psmith@gnu.org>
+
+ * read.c (record_files): Don't set deps flags if there are no deps.
+ * maintMakefile: We only need to build the templates when we are
+ creating a distribution, so don't do it for "all".
+
+2005-10-24 Paul D. Smith <psmith@gnu.org>
+
+ Make secondary expansion optional: its enabled by declaring the
+ special target .SECONDEXPANSION.
+
+ * NEWS: Update information on second expansion capabilities.
+ * doc/make.texi (Secondary Expansion): Document the
+ .SECONDEXPANSION special target and its behavior.
+ * dep.h (struct dep): Add a flag STATICPATTERN, set to true if the
+ prerequisite list was found in a static pattern rule.
+ (free_dep_chain): Declare a prototype.
+ * file.c (parse_prereqs): New function: break out some complexity
+ from expand_deps().
+ (expand_deps): If we aren't doing second expansion, replace % with
+ the stem for static pattern rules. Call the new function.
+ * filedef.h (parse_prereqs): Declare a prototype.
+ * implicit.c (pattern_search): Initialize the new staticpattern
+ field.
+ * main.c (second_expansion): Declare a global variable to remember
+ if the special target has been seen. Initialize the new
+ staticpattern field for prerequisites.
+ * make.h: Extern for second_expansion.
+ * misc.c (free_dep_chain): New function: frees a struct dep list.
+ * read.c (read_all_makefiles): Initialize the staticpattern field.
+ (eval_makefile): Ditto.
+ (record_files): Check for the .SECONDEXPANSION target and set
+ second_expansion global if it's found.
+ Use the new free_dep_chain() instead of doing it by hand.
+ Set the staticpattern field for prereqs of static pattern targets.
+
+2005-10-16 Paul D. Smith <psmith@gnu.org>
+
+ * main.c (main): Set CURDIR to be a file variable instead of a
+ default, so that values of CURDIR inherited from the environment
+ won't override the make value.
+
+2005-09-26 Paul D. Smith <psmith@gnu.org>
+
+ * job.c (construct_command_argv_internal): If the line is empty
+ remember to free the temporary argv strings.
+ Fixes bug # 14527.
+
+2005-09-16 Paul D. Smith <psmith@gnu.org>
+
+ * job.c (start_job_command): The noerror flag is a boolean (single
+ bit); set it appropriately.
+ Reported by Mark Eichin <eichin@metacarta.com>
+
+2005-08-29 Paul D. Smith <psmith@gnu.org>
+
+ * function.c (func_error): On Windows, output from $(info ...)
+ seems to come in the wrong order. Try to force it with fflush().
+
+2005-08-10 Boris Kolpackov <boris@kolpackov.net>
+
+ * read.c (record_files): Move code that sets stem for static
+ pattern rules out of the if (!two_colon) condition so it is
+ also executed for two-colon rules. Fixes Savannah bug #13881.
+
+2005-08-08 Paul D. Smith <psmith@gnu.org>
+
+ * make.h: Don't test that __STDC__ is non-0. Some compilers
+ (Windows for example) set it to 0 to denote "ISO C + extensions".
+ Fixes bug # 13594.
+
+2005-08-07 Paul D. Smith <psmith@gnu.org>
+
+ * w32/pathstuff.c (getcwd_fs): Fix warning about assignment in a
+ conditional (slightly different version of a fix from Eli).
+
+ Fix a bug reported by Michael Matz <matz@suse.de>: patch included.
+ If make is running in parallel without -k and two jobs die in a
+ row, but not too close to each other, then make will quit without
+ waiting for the rest of the jobs to die.
+
+ * main.c (die): Don't reset err before calling reap_children() the
+ second time: we still want it to be in the error condition.
+ * job.c (reap_children): Use a static variable, rather than err,
+ to control whether or not the error message should be printed.
+
+2005-08-06 Eli Zaretskii <eliz@gnu.org>
+
+ * w32/subproc/sub_proc.c: Include signal.h.
+ (process_pipe_io, process_file_io): Pass a pointer to a local
+ DWORD variable to GetExitCodeProcess. If the exit code is
+ CONTROL_C_EXIT, put SIGINT into pproc->signal.
+
+ * job.c [WINDOWS32]: Include windows.h.
+ (main_thread) [WINDOWS32]: New global variable.
+ (reap_children) [WINDOWS32]: Get the handle for the main thread
+ and store it in main_thread.
+
+ * commands.c [WINDOWS32]: Include windows.h and w32err.h.
+ (fatal_error_signal) [WINDOWS32]: Suspend the main thread before
+ doing anything else. When we are done, close the main thread
+ handle and exit with status 130.
+
+2005-07-30 Eli Zaretskii <eliz@gnu.org>
+
+ * w32/subproc/sub_proc.c (process_begin): Don't pass a NULL
+ pointer to fprintf.
+
+ * main.c (find_and_set_default_shell): If found a DOSish shell,
+ set sh_found and the value of default_shell, and report the
+ findings in debug mode.
+
+ * job.c (construct_command_argv_internal): Check unixy_shell, not
+ no_default_sh_exe, to decide whether to use Unixy or DOSish
+ builtin commands.
+
+ * README.W32: Update with info about the MinGW build.
+
+ * build_w32.bat: Support MinGW.
+
+ * w32/subproc/build.bat: Likewise.
+
+ * w32/subproc/sub_proc.c (process_easy): Fix format strings for
+ printing DWORD args.
+
+ * function.c (windows32_openpipe): Fix format strings for printing
+ DWORD args.
+
+ * job.c (reap_children) [WINDOWS32]: Don't declare 'status' and
+ 'reap_mode'.
+ (start_job_command): Fix format string for printing the result of
+ process_easy.
+ (start_job_command) [WINDOWS32]: Do not define.
+ (exec_command): Fix format string for printing HANDLE args.
+
+ * main.c (handle_runtime_exceptions): Fix sprintf format strings
+ to avoid compiler warnings.
+ (open_tmpfile): Declare fd only if HAVE_FDOPEN is defined.
+ (Note: some of these fixes were submitted independently by J. Grant)
+
+2005-07-30 J. Grant <jg@jguk.org>
+
+ * prepare_w32.bat: Copy config.h.w32 to config.h if not exist.
+ * make_msvc_net2003.vcproj, make_msvc_net2003.sln: MSVC Project files.
+ * Makefile.am (EXTRA_DIST): Add MSVC Project files.
+
+2005-07-15 Paul Smith <psmith@gnu.org>
+
+ * job.c (construct_command_argv_internal) [DOS,WINDOWS32,OS/2]: If
+ we don't have a POSIX shell, then revert to the old
+ backslash-newline behavior (where they are stripped).
+ Fixes bug #13665.
+
+2005-07-08 Paul D. Smith <psmith@gnu.org>
+
+ * config.h.W32.template: Reorder to match the standard config.h,
+ for easier comparisons.
+ From J. Grant <jg@jguk.org>
+
+ * maintMakefile: Remove .dep_segment before overwriting it, in
+ case it's not writable or noclobber is set.
+ * expand.c (variable_expand_string): Cast result of pointer
+ arithmetic to avoid a warning.
+ * main.c (switches): Add full-fledged final initializer.
+
+2005-07-06 Paul D. Smith <psmith@gnu.org>
+
+ * configure.in: IRIX has _sys_siglist. Tru64 UNIX has __sys_siglist.
+ * signame.c (strsignal): If we found _sys_siglist[] or
+ __sys_siglist[] use those instead of sys_siglist[].
+ From Albert Chin <china@thewrittenword.com>
+
+2005-07-04 Paul D. Smith <psmith@gnu.org>
+
+ * config.h-vms.template [VMS]: Latest VMS has its own glob() and
+ globfree(); set up to use the GNU versions.
+ From Martin Zinser <zinser@zinser.no-ip.info>
+
+2005-07-03 Paul D. Smith <psmith@gnu.org>
+
+ From J. Grant <jg@jguk.org>:
+
+ * README.W32.template: Update the Windows and tested MSVC versions.
+ * NMakefile.template (CFLAGS_any): Change warning level from W3 to W4.
+ * w32/subproc/NMakefile (CFLAGS_any): Ditto.
+ * build_w32.bat: Ditto.
+ * w32/subproc/build.bat: Ditto.
+
+2005-06-28 Paul D. Smith <psmith@gnu.org>
+
+ * signame.c: HAVE_DECL_* macros are set to 0, not undef, if the
+ declaration was checked but not present.
+
+2005-06-27 Paul D. Smith <psmith@gnu.org>
+
+ * dir.c (find_directory): Change type of fs_serno/fs_flags/fs_len
+ to unsigned long. Fixes Savannah bug #13550.
+
+ * w32/subproc/sub_proc.c: Remove (HANDLE) casts on lvalues.
+ (process_pipe_io): Initialize tStdin/tStdout/tStderr variables.
+ Fixes Savannah bug #13551.
+
+2005-06-26 Paul D. Smith <psmith@gnu.org>
+
+ * make.h: Fix bug in ANSI_STRING/strerror() handling; only define
+ it if ANSI_STRING is not set.
+
+2005-06-25 Paul D. Smith <psmith@gnu.org>
+
+ * read.c (eval): If no filenames are passed to any of the
+ "include" variants, don't print an error.
+ * doc/make.texi (Include): Document this.
+ Fixes Savannah bug #1761.
+
+ * job.c (construct_command_argv_internal): Sanitize handling of
+ backslash/newline pairs according to POSIX: that is, keep the
+ backslash-newline in the command script, but remove a following
+ TAB character, if present. In the fast path, make sure that the
+ behavior matches what the shell would do both inside and outside
+ of quotes. In the slow path, quote the backslash and put a
+ literal newline in the string.
+ Fixes Savannah bug #1332.
+ * doc/make.texi (Execution): Document the new behavior and give
+ some examples.
+ * NEWS: Make a note of the new behavior.
+
+ * make.h [WINDOWS32]: #include <direct.h>.
+ Fixes Savannah bug #13478.
+
+ * remake.c (name_mtime): If the stat() of a file fails and the -L
+ option was given and the file is a symlink, take the best mtime of
+ the symlink we can get as the mtime of the file and don't fail.
+ Fixes Savannah bug #13280.
+
+ * read.c (find_char_unquote): Accept a new argument IGNOREVARS.
+ If it's set, then don't stop on STOPCHARs or BLANKs if they're
+ inside a variable reference. Make this function static as it's
+ only used here.
+ (eval): Call find_char_unquote() with IGNOREVARS set when we're
+ parsing an unexpanded line looking for semicolons.
+ Fixes Savannah bug #1454.
+ * misc.c (remove_comments): Move this to read.c and make it static
+ as it's only used there. Call find_char_unquote() with new arg.
+ * make.h: Remove prototypes for find_char_unquote() and
+ remove_comments() since they're static now.
+
+ * main.c (main): If we see MAKE_RESTARTS in the environment, unset
+ its export flag and obtain its value. When we need to re-exec,
+ increment the value and add it into the environment.
+ * doc/make.texi (Special Variables): Document MAKE_RESTARTS.
+ * NEWS: Mention MAKE_RESTARTS.
+ * main.c (always_make_set): New variable. Change the -B option to
+ set this one instead.
+ (main): When checking makefiles, only set always_make_flag if
+ always_make_set is set AND the restarts flag is 0. When building
+ normal targets, set it IFF always_make_set is set.
+ (main): Avoid infinite recursion with -W, too: only set what-if
+ files to NEW before we check makefiles if we've never restarted
+ before. If we have restarted, set what-if files to NEW _after_ we
+ check makefiles.
+ Fixes Savannah bug #7566:
+
+2005-06-17 Paul D. Smith <psmith@gnu.org>
+
+ * default.c: Change VMS implicit rules to use $$$$ instead of $$
+ in the prerequisites list.
+
+2005-06-12 Paul D. Smith <psmith@gnu.org>
+
+ Fix Savannah bug # 1328.
+
+ * configure.in: Check for atexit().
+ * misc.c (close_stdout): Test stdout to see if writes to it have
+ failed. If so, be sure to exit with a non-0 error code. Based on
+ code found in gnulib.
+ * make.h: Prototype.
+ * main.c (main): Install close_stdout() with atexit().
+
+2005-06-10 Paul D. Smith <psmith@gnu.org>
+
+ VMS build updates from Hartmut Becker <Hartmut.Becker@hp.com>:
+
+ * vmsjobs.c [VMS]: Updates to compile on VMS: add some missing
+ headers; make vmsWaitForChildren() static; extern vmsify().
+ * job.c [VMS]: Move vmsWaitForChildren() prototype to be global.
+ Don't create child_execute_job() here (it's in vmsjobs.c).
+ * makefile.vms (job.obj) [VMS]: Add vmsjobs.c as a prerequisite.
+
+2005-06-09 Paul D. Smith <psmith@gnu.org>
+
+ * variable.c (push_new_variable_scope): File variables point
+ directly to the global_setlist variable. So, inserting a new
+ scope in front of that has no effect on those variables: they
+ don't go through current_variable_set_list. If we're pushing a
+ scope and the current scope is global, push it "the other way" so
+ that the new setlist is in the global_setlist variable, and
+ next points to a new setlist with the global variable set.
+ (pop_variable_scope): Properly undo a push with the new
+ semantics.
+ Fixes Savannah bug #11913.
+
+2005-05-31 Boris Kolpackov <boris@kolpackov.net>
+
+ * job.c (reap_children): Don't die of the command failed but
+ the dontcare flag is set. Fixes Savannah bug #13216.
+
+ * implicit.c (pattern_search): When creating a target from
+ an implicit rule match, lookup pattern target and set precious
+ flag in a newly created target. Fixes Savannah bug #13218.
+
+2005-05-13 Paul D. Smith <psmith@gnu.org>
+
+ Implement "if... else if... endif" syntax.
+
+ * read.c (eval): Push all checks for conditional words ("ifeq",
+ "else", etc.) down into the conditional_line() function.
+ (conditional_line): Rework to allow "else if..." clause. New
+ return value -2 for lines which are not conditionals. The
+ ignoring flag can now also be 2, which means "already parsed a
+ true branch". If that value is seen no other branch of this
+ conditional can be considered true. In the else parsing if there
+ is extra text after the else, invoke conditional_line()
+ recursively to see if it's another conditional. If not, it's an
+ error. If so, raise the conditional value to this level instead
+ of creating a new conditional nesting level. Special check for
+ "else" and "endif", which aren't allowed on the "else" line.
+ * doc/make.texi (Conditional Syntax): Document the new syntax.
+
+2005-05-09 Paul D. Smith <psmith@gnu.org>
+
+ * Makefile.am (EXTRA_make_SOURCES): Add vmsjobs.c
+ (MAYBE_W32): Rework how SUBDIRS are handled so that "make dist"
+ recurses to the w32 directory, even on non-Windows systems. Use
+ the method suggested in the automake manual.
+ * configure.in: Add w32/Makefile to AC_CONFIG_FILES.
+ * maintMakefile (gnulib-url): They moved the texinfo.tex files.
+
+2005-05-07 Paul D. Smith <psmith@gnu.org>
+
+ * main.c (die): If we're dying with a fatal error (not that a
+ command has failed), write back any leftover tokens before we go.
+
+ * job.c (set_child_handler_action_flags): If there are jobs
+ waiting for the load to go down, set an alarm to go off in 1
+ second. This allows us to wake up from a potentially long-lasting
+ read() and start a new job if the load has gone down. Turn it off
+ after the read.
+ (job_noop): Dummy signal handler function.
+ (new_job): Invoke it with the new semantics.
+
+ * docs/make.texi: Document secondary expansion. Various cleanups
+ and random work.
+
+2005-05-03 Paul D. Smith <psmith@gnu.org>
+
+ Rename .DEFAULT_TARGET to .DEFAULT_GOAL: in GNU make terminology
+ the targets which are to ultimately be made are called "goals";
+ see the GNU make manual. Also, MAKECMDGOALS, etc.
+
+ * filedef.h, read.c, main.c: Change .DEFAULT_TARGET to
+ .DEFAULT_GOAL, and default_target_name to default_goal_name.
+ * doc/make.texi (Special Variables): Document .DEFAULT_GOAL.
+
+2005-05-02 Paul D. Smith <psmith@gnu.org>
+
+ * job.c, vmsjobs.c (vmsWaitForChildren, vms_redirect,
+ vms_handle_apos, vmsHandleChildTerm, reEnableAst, astHandler,
+ tryToSetupYAst, child_execute_job) [VMS]: Move VMS-specific
+ functions to vmsjobs.c. #include it into jobs.c.
+
+ Grant Taylor <gtaylor@picante.com> reports that -j# can lose
+ jobserver tokens. I found that this happens when an exported
+ recursive variable contains a $(shell ...) function reference: in
+ this situation we could "forget" to write back a token.
+
+ * job.c, job.h: Add variable jobserver_tokens: counts the tokens
+ we have. It's not reliable to depend on the number of children in
+ our linked list so keep a separate count.
+ (new_job): Check jobserver_tokens rather than children &&
+ waiting_jobs. Increment jobserver_tokens when we get one.
+ (free_child): If jobserver_tokens is 0, internal error. If it's
+ >1, write a token back to the jobserver pipe (we don't write a
+ token for the "free" job). Decrement jobserver_tokens.
+
+ * main.c: Add variable master_job_slots.
+ (main): Set it to hold the number of jobs requested if we're the
+ master process, when using the jobserver.
+ (die): Sanity checks: first test jobserver_tokens to make sure
+ this process isn't holding any tokens we didn't write back.
+ Second, if master_job_slots is set count the tokens left in the
+ jobserver pipe and ensure it's the same as master_job_slots (- 1).
+
+2005-04-24 Paul D. Smith <psmith@gnu.org>
+
+ Grant Taylor <gtaylor@picante.com> reports that -j# in conjunction
+ with -l# can lose jobserver tokens, because waiting jobs are not
+ consulted properly when checking for the "free" token.
+
+ * job.c (free_child): Count waiting_jobs as having tokens.
+ * job.c (new_job): Ditto. Plus, call start_waiting_jobs() here to
+ handle jobs waiting for the load to drop.
+
+2005-04-23 Paul D. Smith <psmith@gnu.org>
+
+ * main.c (main): Be careful to not core if a variable setting in
+ the environment doesn't contain an '='. This is illegal but can
+ happen in broken setups.
+ Reported by Joerg Schilling <schilling@fokus.fraunhofer.de>.
+
+2005-04-12 Paul D. Smith <psmith@gnu.org>
+
+ The second expansion feature causes significant slowdown. Timing
+ a complex makefile (GCC 4.1) shows a slowdown from .25s to just
+ read the makefile before the feature, to 11+s to do the same
+ operations after the feature. Additionally, memory usage
+ increased drastically. To fix this I added some intelligence that
+ avoids the overhead of the second expansion unless it's required.
+
+ * dep.h: Add a new boolean field, need_2nd_expansion.
+
+ * read.c (eval): When creating the struct dep for the target,
+ check if the name contains a "$"; if so set need_2nd_expansion to 1.
+ (record_files): If there's a "%" in a static pattern rule, it gets
+ converted to "$*" so set need_2nd_expansion to 1.
+
+ * file.c (expand_deps): Rework to be more efficient. Only perform
+ initialize_file_variables(), set_file_variables(), and
+ variable_expand_for_file() if the need_2nd_expansion is set.
+
+ * implicit.c (pattern_search): Default need_2nd_expansion to 0.
+ (pattern_search): Ditto.
+ * main.c (handle_non_switch_argument): Ditto.
+ (main): Ditto.
+ * read.c (read_all_makefiles): Ditto.
+ (eval_makefile): Ditto.
+
+2005-04-07 Paul D. Smith <psmith@gnu.org>
+
+ * main.c (main) [WINDOWS32]: Export PATH to sub-shells, not Path.
+ * variable.c (sync_Path_environment): Ditto.
+ Patch by Alessandro Vesely. Fixes Savannah bug #12209.
+
+ * main.c (main): Define the .FEATURES variable.
+ * NEWS: Announce .FEATURES.
+ * doc/make.texi (Special Variables): Document .FEATURES.
+
+ * remake.c (check_dep): If a file is .PHONY, update it even if
+ it's marked intermediate. Fixes Savannah bug #12331.
+
+2005-03-15 Boris Kolpackov <boris@kolpackov.net>
+
+ * file.c (expand_deps): Factor out the second expansion and
+ prerequisite line parsing logic from snap_deps().
+
+ * file.c (snap_deps): Use expand_deps(). Expand and parse
+ prerequisites of the .SUFFIXES special target first. Fixes
+ Savannah bug #12320.
+
+2005-03-13 Paul D. Smith <psmith@gnu.org>
+
+ * main.c (main) [MSDOS]: Export SHELL in MSDOS. Requested by Eli
+ Zaretskii.
+
+2005-03-11 Paul D. Smith <psmith@gnu.org>
+
+ * signame.c (strsignal): HAVE_DECL_SYS_SIGLIST is 0 when not
+ available, not undefined (from Earnie Boyd).
+
+2005-03-10 Boris Kolpackov <boris@kolpackov.net>
+
+ * implicit.c (pattern_search): Mark an intermediate target as
+ precious if it happened to be a prerequisite of some (other)
+ target. Fixes Savannah bug #12267.
+
+2005-03-09 Paul D. Smith <psmith@gnu.org>
+
+ * read.c (eval_makefile): Add alloca(0).
+ (eval_buffer): Ditto.
+
+2005-03-09 Boris Kolpackov <boris@kolpackov.net>
+
+ * main.c (main): Use o_file instead of o_default when defining
+ the .DEFAULT_TARGET special variable.
+ * read.c (eval): Use define_variable_global() instead of
+ define_variable() when setting new value for the .DEFAULT_TARGET
+ special variable. Fixes Savannah bug #12266.
+
+2005-03-04 Boris Kolpackov <boris@kolpackov.net>
+
+ * imlicit.c (pattern_search): Mark files for which an implicit
+ rule has been found as targets. Fixes Savannah bug #12202.
+
+2005-03-04 Paul D. Smith <psmith@gnu.org>
+
+ * AUTHORS: Update.
+ * doc/make.texi (Automatic Variables): Document $|.
+
+2005-03-03 Boris Kolpackov <boris@kolpackov.net>
+
+ * read.c (record_files): Instead of substituting % with
+ actual stem value in dependency list replace it with $*.
+ This fixes stem triple expansion bug.
+
+ * implicit.c (pattern_search): Copy stem to a separate
+ buffer and make it a properly terminated string. Assign
+ this buffer instead of STEM (which is not terminated) to
+ f->stem. Instead of substituting % with actual stem value
+ in dependency list replace it with $*. This fixes stem
+ triple expansion bug.
+
+2005-03-01 Paul D. Smith <psmith@gnu.org>
+
+ * commands.c (fatal_error_signal) [WINDOWS32]: Don't call kill()
+ on Windows, as it takes a handle not a pid. Just exit.
+ Fix from patch #3679, provided by Alessandro Vesely.
+
+ * configure.in: Update check for sys_siglist[] from autoconf manual.
+ * signame.c (strsignal): Update to use the new autoconf macro.
+
+2005-03-01 Boris Kolpackov <boris@kolpackov.net>
+
+ * read.c (record_files): Add a check for the list of prerequisites
+ of a static pattern rule being empty. Fixes Savannah bug #12180.
+
+2005-02-28 Paul D. Smith <psmith@gnu.org>
+
+ * doc/make.texi (Text Functions): Update docs to allow the end
+ ordinal for $(wordlist ...) to be 0.
+ * function.c (func_wordlist): Fail if the start ordinal for
+ $(wordlist ...) is <1. Matches documentation.
+ Resolves Savannah support request #103195.
+
+ * remake.c (update_goal_chain): Fix logic for stopping in -q:
+ previously we were stopping when !-q, exactly the opposite. This
+ has been wrong since version 1.34, in 1994!
+ (update_file): If we got an error don't break out to run more
+ double-colon rules: just return immediately.
+ Fixes Savannah bug #7144.
+
+2005-02-27 Paul D. Smith <psmith@gnu.org>
+
+ * misc.c (end_of_token): Make argument const.
+ * make.h: Update prototype.
+
+ * function.c (abspath, func_realpath, func_abspath): Use
+ PATH_VAR() and GET_PATH_MAX instead of PATH_MAX.
+ * dir.c (downcase): Use PATH_VAR() instead of PATH_MAX.
+ * read.c (record_files): Ditto.
+ * variable.c (do_variable_definition): Ditto.
+
+ * function.c (func_error): Create a new function $(info ...) that
+ simply prints the message to stdout with no extras.
+ (function_table_init): Add new function to the table.
+ * NEWS: Add $(info ...) reference.
+ * doc/make.texi (Make Control Functions): Document it.
+
+ New feature: if the system supports symbolic links, and the user
+ provides the -L/--check-symlink-time flag, then use the latest
+ mtime between the symlink(s) and the target file.
+
+ * configure.in (MAKE_SYMLINKS): Check for lstat() and
+ readlink(). If both are available, define MAKE_SYMLINKS.
+ * main.c: New variable: check_symlink_flag.
+ (usage): Add a line for -L/--check-symlink-times to the help string.
+ (switches): Add -L/--check-symlink-times command line argument.
+ (main): If MAKE_SYMLINKS is not defined but the user specified -L,
+ print a warning and disable it again.
+ * make.h: Declare check_symlink_flag.
+ * remake.c (name_mtime): If MAKE_SYMLINKS and check_symlink_flag,
+ if the file is a symlink then check each link in the chain and
+ choose the NEWEST mtime we find as the mtime for the file. The
+ newest mtime might be the file itself!
+ * NEWS: Add information about this new feature.
+ * doc/make.texi (Options Summary): Add -L/--check-symlink-times docs.
+
+ Avoid core dumps described in Savannah bug # 12124:
+
+ * file.c: New variable snapped_deps remember whether we've run
+ snap_deps().
+ (snap_deps): Set it.
+ * filedef.h: Extern it.
+ * read.c (record_files): Check snapped_deps; if it's set then
+ we're trying to eval a new target/prerequisite relationship from
+ within a command script, which we don't support. Fatal.
+
+2005-02-28 Boris Kolpackov <boris@kolpackov.net>
+
+ Implementation of the .DEFAULT_TARGET special variable.
+
+ * read.c (eval): If necessary, update default_target_name when
+ reading rules.
+ * read.c (record_files): Update default_target_file if
+ default_target_name has changed.
+ * main.c (default_target_name): Define.
+ * main.c (main): Enter .DEFAULT_TARGET as make variable. If
+ default_target_name is set use default_target_file as a root
+ target to make.
+ * filedef.h (default_target_name): Declare.
+ * dep.h (free_dep_chain):
+ * misc.c (free_dep_chain): Change to operate on struct nameseq
+ and change name to free_ns_chain.
+ * file.c (snap_deps): Update to use free_ns_chain.
+
+2005-02-27 Boris Kolpackov <boris@kolpackov.net>
+
+ Implementation of the second expansion in explicit rules,
+ static pattern rules and implicit rules.
+
+ * read.c (eval): Refrain from chopping up rule's dependencies.
+ Store them in a struct dep as a single dependency line. Remove
+ the code that implements SySV-style automatic variables.
+
+ * read.c (record_files): Adjust the code that handles static
+ pattern rules to expand all percents instead of only the first
+ one. Reverse the order in which dependencies are stored so that
+ when the second expansion reverses them again they appear in
+ the makefile order (with some exceptions, see comments in
+ the code). Remove the code that implements SySV-style automatic
+ variables.
+
+ * file.c (snap_deps): Implement the second expansion and chopping
+ of dependency lines for explicit rules.
+
+ * implicit.c (struct idep): Define an auxiliary data type to hold
+ implicit rule's dependencies after stem substitution and
+ expansion.
+
+ * implicit.c (free_idep_chain): Implement.
+
+ * implicit.c (get_next_word): Implement helper function for
+ parsing implicit rule's dependency lines into words taking
+ into account variable expansion requests. Used in the stem
+ splitting code.
+
+ * implicit.c (pattern_search): Implement the second expansion
+ for implicit rules. Also fixes bug #12091.
+
+ * commands.h (set_file_variables): Declare.
+ * commands.c (set_file_variables): Remove static specifier.
+
+ * dep.h (free_dep_chain): Declare.
+ * misc.c (free_dep_chain): Implement.
+
+ * variable.h (variable_expand_for_file): Declare.
+ * expand.c (variable_expand_for_file): Remove static specifier.
+
+ * make.h (strip_whitespace): Declare.
+ * function.c (strip_whitespace): Remove static specifier.
+
+2005-02-26 Paul D. Smith <psmith@gnu.org>
+
+ * main.c (main): Check for ferror() when reading makefiles from stdin.
+ Apparently some shells in Windows don't close pipes properly and
+ require this check.
+
+2005-02-24 Jonathan Grant <jg@jguk.org>
+
+ * configure.in: Add MinGW configuration options, and extra w32 code
+ directory.
+ * Makefile.am: Add MinGW configuration options, and extra w32 code
+ directory.
+ * main.c: Determine correct program string (after last \ without .exe).
+ * subproc/sub_proc.c: `GetExitCodeProcess' from incompatible pointer
+ type fix x2
+ * w32/Makefile.am: Import to build win32 lib of sub_proc etc.
+ * subproc/w32err.c: MSVC thread directive not applied to MinGW builds.
+ * tests/run_make_tests.pl, tests/test_driver.pl: MSYS testing
+ environment support.
+
+2004-04-16 Dmitry V. Levin <ldv@altlinux.org>
+
+ * function.c (func_shell): When initializing error_prefix, check
+ that reading file name is not null. This fixes long-standing
+ segfault in cases like "make 'a1=$(shell :)' 'a2:=$(a1)'".
+
+2005-02-09 Paul D. Smith <psmith@gnu.org>
+
+ * maintMakefile: Update the CVS download URL to simplify them.
+ Also, the ftp://ftp.gnu.org/GNUinfo site was removed so I'm
+ downloading the .texi files from Savannah now.
+
+ Fixed these issues reported by Markus Mauhart <qwe123@chello.at>:
+
+ * main.c (handle_non_switch_argument): Only add variables to
+ command_variables if they're not already there: duplicate settings
+ waste space and can be confusing to read.
+
+ * w32/include/sub_proc.h: Remove WINDOWS32. It's not needed since
+ this header is never included by non-WINDOWS32 code, and it
+ requires <config.h> to define which isn't always included first.
+
+ * dir.c (read_dirstream) [MINGW]: Use proper macro names when
+ testing MINGW32 versions.
+
+ * main.c (log_working_directory): flush stdout to be sure the WD
+ change is printed before any stderr messages show up.
+
+2005-02-01 Paul D. Smith <psmith@gnu.org>
+
+ * maintMakefile (po_repo): Update the GNU translation site URL.
+
+2004-12-01 Paul D. Smith <psmith@gnu.org>
+
+ * main.c (main): Change char* env_shell to struct variable shell_var.
+ * variable.c (target_environment): Use new shell_var.
+
+2004-11-30 Paul D. Smith <psmith@gnu.org>
+
+ * configure.in: The old way we avoided creating build.sh from
+ build.sh.in before build.sh.in exists doesn't work anymore; we
+ have to use raw M4 (thanks to Andreas Schwab <schwab@suse.de> for
+ the help!). This also keeps automake from complaining.
+ * Makefile.am (README): Add a dummy target so automake won't
+ complain that this file doesn't exist when we checkout from CVS.
+ * maintMakefile (.dep_segment): Rewrite this rule since newer
+ versions of automake don't provide DEP_FILES.
+
+2004-11-30 Boris Kolpackov <boris@kolpackov.net>
+
+ Implementation of `realpath' and `abspath' built-in functions.
+
+ * configure.in: Check for realpath.
+ * function.c (abspath): Return an absolute file name that does
+ not contain any `.' or `..' components, nor repeated `/'.
+ * function.c (func_abspath): For each name call abspath.
+ * function.c (func_realpath): For each name call realpath
+ from libc or delegate to abspath if realpath is not available.
+ * doc/make.texi (Functions for File Names): Document new functions.
+ * doc/make.texi (Quick Reference): Ditto.
+
+2004-11-28 Paul D. Smith <psmith@gnu.org>
+
+ * main.c (main) [WINDOWS32]: Remove any trailing slashes from -C
+ arguments. Fixes bug #10252.
+
+ Fix for bug #1276: Handle SHELL according to POSIX requirements.
+
+ * main.c (main): Set SHELL to v_noexport by default. Remember the
+ original environment setting of SHELL in the env_shell variable.
+ * main.h: Export new env_shell variable.
+ * variable.c (target_environment): If we find a v_noexport
+ variable for SHELL, add a SHELL variable with the env_shell value.
+ * doc/make.texi (Quick Reference): Document the POSIX behavior.
+ * doc/make.texi (Variables/Recursion): Ditto.
+
+2004-11-28 Paul D. Smith <psmith@gnu.org>
+
+ * main.c (find_and_set_default_shell) [WINDOWS32]: check for
+ equality of "cmd"/"cmd.exe", not inequality. Fixes bug #11155.
+ Patch by Alessandro Vesely.
+
+2004-11-12 Paul D. Smith <psmith@gnu.org>
+
+ * job.c (child_execute_job) [VMS]: Don't treat "#" as a comment on
+ the command line if it's inside a string.
+ Patch by: Hartmut Becker <Hartmut.Becker@hp.com>
+
+2004-10-21 Boris Kolpackov <boris@kolpackov.net>
+
+ * function.c (func_lastword): New function: return last word
+ from the list of words.
+ * doc/make.texi: Document $(lastword ). Fix broken links in
+ Quick Reference section.
+
+2004-10-06 Paul D. Smith <psmith@gnu.org>
+
+ Apply patch from Alessandro Vesely, provided with bug # 9748.
+ Fix use of tmpnam() to work with Borland C.
+
+ * job.c (construct_command_argv_internal) [WINDOWS32]: Remove
+ construction of a temporary filename, and call new function
+ create_batch_filename().
+ (create_batch_filename) [WINDOWS32]: New function to create a
+ temporary filename.
+
+2004-10-05 Boris Kolpackov <boris@kolpackov.net>
+
+ * read.c (record_target_var): Expand simple pattern-specific
+ variable.
+ * variable.c (initialize_file_variables): Do not expand simple
+ pattern-specific variable.
+
+2004-09-28 Boris Kolpackov <boris@kolpackov.net>
+
+ * remake.c (update_file_1): When rebuilding makefiles inherit
+ dontcare flag from a target that triggered update.
+
+2004-09-27 Boris Kolpackov <boris@kolpackov.net>
+
+ * variable.c (initialize_file_variables): Mark pattern-specific
+ variable as a per-target and copy export status.
+
+2004-09-21 Boris Kolpackov <boris@kolpackov.net>
+
+ * file.c (snap_deps): Mark .PHONY prerequisites as targets.
+
+ * implicit.c (pattern_search): When considering an implicit rule's
+ prerequisite check that it is actually a target rather then
+ just an entry in the file hashtable.
+
+2004-09-21 Paul D. Smith <psmith@gnu.org>
+
+ * read.c (readstring): Fix some logic errors in backslash handling.
+ (eval): Remove some unnecessary processing in buffer handling.
+ (record_target_var): Assert that parse_variable_definition() succeeded.
+ Reported by: Markus Mauhart <qwe123@chello.at>.
+
+ * misc.c: Removed the sindex() function. All instances of this
+ function were trivially replaceable by the standard strstr()
+ function, and that function will always have better (or certainly
+ no worse) performance than the very simple-minded algorithm
+ sindex() used. This can matter with complex makefiles.
+ * make.h: Remove the prototype for sindex().
+ * function.c (subst_expand): Convert sindex() call to strstr().
+ This means we no longer need to track the TLEN value so remove that.
+ (func_findstring): Convert sindex() to strstr().
+ * commands.c (chop_commands): Convert sindex() calls to strstr().
+ Suggested by: Markus Mauhart <qwe123@chello.at>.
+
+ * main.c (find_and_set_default_shell) [WINDOWS32]: Implement the
+ idea behind Savannah Patch #3144 from david.baird@homemail.com.
+ If SHELL is set to CMD.EXE then assume it's batch-mode and
+ non-unixy. I wrote the code differently from the patch, though,
+ to make it safer. This also resolves bug #9174.
+
+2004-09-20 Paul D. Smith <psmith@gnu.org>
+
+ * expand.c (variable_expand_string): Modify to invoke
+ patsubst_expand() instead of subst_expand(); the latter didn't
+ handle suffix patterns correctly.
+ * function.c (subst_expand): Remove the SUFFIX_ONLY parameter; it
+ was used only from variable_expand_string() and is no longer used
+ there.
+ (func_subst): Ditto, on call to subst_expand().
+ (patsubst_expand): Require the percent pointers to point to the
+ character after the %, not to the % itself.
+ * read.c (record_files): New call criteria for patsubst_expand().
+ * variable.h: Remove SUFFIX_ONLY from subst_expand() prototype.
+ This is to fix a bug reported by Markus Mauhart <qwe123@chello.at>.
+
+2004-09-19 Paul D. Smith <psmith@gnu.org>
+
+ * function.c (subst_expand): Fix a check in by_word: look for a
+ previous blank if we're beyond the beginning of the string, not
+ the beginning of the word.
+ Bugs reported by Markus Mauhart <qwe123@chello.at>.
+
+2004-05-16 Paul D. Smith <psmith@gnu.org>
+
+ * remake.c (update_goal_chain): Change the argument specifying
+ whether we're rebuilding makefiles to be a global variable,
+ REBUILDING_MAKEFILES.
+ (complain): Extract the code that complains about no rules to make
+ a target into a separate function.
+ (update_file_1): If we tried to rebuild a file during the makefile
+ rebuild phase and it was dontcare, then no message was printed.
+ If we then try to build the same file during the normal build,
+ print a message this time.
+ (remake_file): Don't complain about un-remake-able files when
+ we're rebuilding makefiles.
+
+2004-05-11 Paul D. Smith <psmith@gnu.org>
+
+ * job.c (construct_command_argv_internal): OS/2 patches from
+ Andreas Buening <andreas.buening@nexgo.de>.
+
+2004-05-10 Paul D. Smith <psmith@gnu.org>
+
+ * remake.c (update_file): Don't walk the double-colon chain unless
+ this is a double-colon rule. Fix suggested by Boris Kolpackov
+ <boris@kolpackov.net>.
+
+ * makefile.vms (CFLAGS): Remove glob/globfree (see readme.vms docs)
+ * readme.vms: New section describing OpenVMS support and issues.
+ * default.c (default_variables): Add support for IA64.
+ * job.c (tryToSetupYAst) [VMS]: On VMS running make in batch mode
+ without some privilege aborts make with the error
+ %SYSTEM-F-NOPRIV. It happens when setting up a handler for
+ pressing Ctrl+Y and the input device is no terminal. The change
+ catches this error and just continues.
+
+ Patches by Hartmut Becker <Hartmut.Becker@hp.com>
+
+2004-04-25 Paul D. Smith <psmith@gnu.org>
+
+ * commands.c (set_file_variables): Set $< properly in the face of
+ order-only prerequisites.
+ Patch from Boris Kolpackov <boris@kolpackov.net>
+
+2004-04-21 Bob Byrnes <byrnes@curl.com>
+
+ * main.c (main): Notice failures to remake makefiles.
+
+2004-03-28 Paul D. Smith <psmith@gnu.org>
+
+ Patches for Acorn RISC OS by Peter Naulls <peter@chocky.org>
+
+ * job.c: No default shell for RISC OS.
+ (load_too_high): Hard-code the return to 1.
+ (construct_command_argv_internal): No sh_chars or sh_cmds.
+ * getloadavg.c: Don't set LOAD_AVE_TYPE on RISC OS.
+
+2004-03-20 Paul D. Smith <psmith@gnu.org>
+
+ * variable.c (do_variable_definition): Don't append from the
+ global set if a previous non-appending target-specific variable
+ definition exists. Reported by Oliver Schmidt <oschmidt@gmx.net>
+ (with fix).
+
+ * expand.c (reference_variable): Don't give up on variables with
+ no value that have the target-specific append flag set: they might
+ have a value after all. Reported by Oliver Schmidt
+ <oschmidt@gmx.net> (with fix) and also by Maksim A. Nikulin
+ <nikulin@dx1cmd.inp.nsk.su>.
+
+ * rule.c (count_implicit_rule_limits): Don't delete patterns which
+ refer to absolute pathnames in directories that don't exist: some
+ portion of the makefile could create those directories before we
+ match the pattern. Fixes bugs #775 and #108.
+
+ Fixes from Jonathan R. Grant <jg-make@jguk.org>:
+
+ * main.c (main): Free makefile_mtimes if we have any.
+ * README.W32.template: Update documentation for the current status
+ of the MS-Windows port.
+ * NMakefile.template (MAKE): Add "MAKE = nmake". A conflicting
+ environment variable is sometimes already defined which causes the
+ build to fail.
+ * main.c (debug_signal_handler): Only define this function if
+ SIGUSR1 is available.
+
+ Fixes for OS/2 from Andreas Beuning <andreas.buening@nexgo.de>:
+
+ * configure.in [OS/2]: Relocate setting of HAVE_SA_RESTART for OS/2.
+ * README.OS2.template: Documentation updates.
+ * build.template: Add LIBINTL into LOADLIBES. Add $CFLAGS to the
+ link line for safety.
+ * maintMakefile (build.sh.in): Remove an extraneous ")".
+ * job.c (child_execute_job): Close saved FDs.
+ * job.c (exec_command) [OS/2]: exec_command(): If the command
+ can't be exec'ed and if the shell is not Unix-sh, then try again
+ with argv = { "cmd", "/c", ... }. Normally, this code is never
+ reached for the cmd shell unless the command really doesn't exist.
+ (construct_command_argv_internal) [OS/2]: The code for cmd
+ handling now uses new_argv = { "cmd", "/c", "original line", NULL}.
+ The CMD builtin commands are case insensitive so use strcasecmp().
+
+2004-03-19 Paul D. Smith <psmith@gnu.org>
+
+ * read.c (do_define): Re-order line counter increment so the count
+ is accurate (we were losing one line per define). Reported by
+ Dave Yost <Dave@Yost.com>.
+
+2004-03-06 Paul D. Smith <psmith@gnu.org>
+
+ * configure.in (HAVE_ANSI_COMPILER): Define if we have an ANSI/ISO
+ compiler.
+ * make.h: Convert uses of __STDC__ to HAVE_ANSI_COMPILER.
+ * misc.c (message,error,fatal): Ditto.
+ * configh.dos.template: Define HAVE_ANSI_COMPILER.
+ * config.h.W32.template: Ditto.
+ * config.h-vms.template: Ditto.
+ * config.ami.template: Ditto.
+
+2004-03-04 Paul D. Smith <psmith@gnu.org>
+
+ * README.template: Add a note about broken /bin/sh on SunOS
+ 4.1.3_U1 & 4.1.4. Fix up Savannah links.
+
+ * misc.c (message, error, fatal): Don't use "..." if we're using
+ varargs. ansi2knr should handle this but it doesn't work: it
+ translates "..." to va_dcl etc. but _AFTER_ the preprocessor is
+ done. On many systems (SunOS for example) va_dcl is a #define.
+ So, force the use of the non-"..." version on pre-ANSI compilers.
+
+ * maintMakefile (sign-dist): Create some rules to help automate
+ the new GNU ftp upload method.
+
+2004-02-24 Paul D. Smith <psmith@gnu.org>
+
+ * config.h.W32.template: Add HAVE_STDARG_H
+ * config.h-vms.template: Ditto.
+ * config.ami.template: Ditto.
+
+2004-02-23 Jonathan Grant <jg-make@jguk.org>
+
+ * README.W32.template: Add a notation about -j with BATCH_MODE_ONLY.
+ * build_w32.bat: Remove extra "+".
+
+2004-02-23 Paul D. Smith <psmith@gnu.org>
+
+ * make.h: Create an UNUSED macro to mark unused parameters.
+ * (many): Clean up warnings by applying UNUSED, fixing
+ signed/unsigned incompatibilities, etc.
+
+ * acinclude.m4 (AC_STRUCT_ST_MTIM_NSEC): Add quoting to silence
+ autoconf warnings.
+ * filedef.h: Name the command_state enumeration.
+ * file.c (set_command_state): Use the enumeration in the function
+ argument.
+
+ * configure.in: Explicitly set SET_MAKE to empty, to disable
+ MAKE=make even when no make already exists. Fix bug #3823.
+
+2004-02-22 Paul D. Smith <psmith@gnu.org>
+
+ * maintMakefile: Perl script to clean up all non-CVS files. Use
+ it on all the subdirectories for the cvs-clean target.
+
+ * main.c (decode_switches): Require non-empty strings for all our
+ string command-line options. Fixes Debian bug # 164165.
+
+ * configure.in: Check for stdarg.h and varargs.h.
+ * make.h (USE_VARIADIC): Set this if we can use variadic functions
+ for printing messages.
+ * misc.c: Check USE_VARIADIC instead of (obsolete) HAVE_STDVARARGS.
+ (message): Ditto.
+ (error): Ditto.
+ (fatal): Ditto.
+
+ A number of patches for OS/2 support from Andreas Buening
+ <andreas.buening@nexgo.de>:
+
+ * job.c (child_handler) [OS/2]: Allow this on OS/2 but we have to
+ disable the SIGCHLD handler.
+ (reap_children) [OS/2]: Remove special handling of job_rfd.
+ (set_child_handler_action_flags) [OS/2]: Use this function in OS/2.
+ (new_job) [OS/2]: Disable the SIGCHLD handler on OS/2.
+ * main.c (main) [OS/2]: Special handling for paths in OS/2.
+ * configure.in [OS/2]: Force SA_RESTART for OS/2.
+ * Makefile.am (check-regression): Use $(EXEEXT) for Windows-type
+ systems.
+
+2004-02-21 Paul D. Smith <psmith@gnu.org>
+
+ * w32/subproc/sub_proc.c (process_easy) [W32]: Christoph Schulz
+ <mail@kristov.de> reports that if process_begin() fails we don't
+ handle the error condition correctly in all cases.
+ * w32/subproc/w32err.c (map_windows32_error_to_string): Make sure
+ to have a newline on the message.
+
+ * job.c (construct_command_argv_internal): Add "test" to UNIX
+ sh_cmds[]. Fixes Savannah bug # 7606.
+
+2004-02-04 Paul D. Smith <psmith@gnu.org>
+
+ * job.c (vms_handle_apos) [VMS]: Fix various string handling
+ situations in VMS DCL. Fixes Savannah bug #5533. Fix provided by
+ Hartmut Becker <Hartmut.Becker@hp.com>.
+
+2004-01-21 Paul D. Smith <psmith@gnu.org>
+
+ * job.c (load_too_high): Implement an algorithm to control the
+ "thundering herd" problem when using -l to control job creation
+ via the load average. The system only recomputes the load once a
+ second but we can start many jobs in a second. To solve this we
+ keep track of the number of jobs started in the last second and
+ apply a weight to try to guess what a correct load would be.
+ The algorithm was provided by Thomas Riedl <thomas.riedl@siemens.com>.
+ Also fixes bug #4693.
+ (reap_children): Decrease the job count for this second.
+ (start_job_command): Increase the job count for this second.
+
+ * read.c (conditional_line): Expand the text after ifn?def before
+ checking to see if it's a single word. Fixes bug #7257.
+
+2004-01-09 Paul D. Smith <psmith@gnu.org>
+
+ * file.c (print_file): Recurse to print all targets in
+ double-colon rules. Fixes bug #4518, reported (with patch) by
+ Andrew Chatham <chatham@google.com>.
+
+2004-01-07 Paul D. Smith <psmith@gnu.org>
+
+ * acinclude.m4: Remove make_FUNC_SETVBUF_REVERSED.
+ * configure.in: Change make_FUNC_SETVBUF_REVERSED to
+ AC_FUNC_SETVBUF_REVERSED.
+
+ * doc/make.texi (Target-specific): Fix Savannah bug #1772.
+ (MAKE Variable): Fix Savannah bug #4898.
+
+ * job.c (construct_command_argv_internal): Add "!" to the list of
+ shell escape chars. POSIX sh allows it to appear before a
+ command, to negate the exit code. Fixes bug #6404.
+
+ * implicit.c (pattern_search): When matching an implicit rule,
+ remember which dependencies have the ignore_mtime flag set.
+ Original fix provided in Savannah patch #2349, by Benoit
+ Poulot-Cazajous <Benoit.Poulot-Cazajous@jaluna.com>.
+
+2003-11-22 Paul D. Smith <psmith@gnu.org>
+
+ * README.W32.template (Outputs): Clarification on -j with
+ BATCH_MODE_ONLY_SEHLL suggested by Jonathan R. Grant
+ <jg-make@jguk.org>.
+
+2003-11-02 Paul D. Smith <psmith@gnu.org>
+
+ * function.c (func_if): Strip all the trailing whitespace from the
+ condition, then don't expand it. Fixed bug # 5798.
+
+ * expand.c (recursively_expand_for_file): If we're expanding a
+ variable with no file context, then use the variable's context.
+ Fixes bug # 6195.
+
+2003-10-21 Paul D. Smith <psmith@gnu.org>
+
+ * main.c (log_working_directory): Add newlines to printf()s.
+
+ * README.cvs: Add a note to ignore warnings during autoreconf.
+
+ * maintMakefile (po_repo): Set a new URL for PO file updates.
+ (get-config/config.guess get-config/config.sub): Get these files
+ from the Savannah config project instead of ftp.gnu.org.
+
+2003-10-05 Paul Eggert <eggert@twinsun.com>
+
+ * main.c (main): Avoid potential subscript error if environ has
+ short strings.
+
+2003-08-22 Paul D. Smith <psmith@gnu.org>
+
+ * misc.c (xmalloc, xrealloc): Add one to 0 sizes, to cater to
+ systems which don't yet implement the C89 standard :-/.
+
+2003-07-18 Paul D. Smith <psmith@gnu.org>
+
+ * dir.c (directory_contents_hash_1, directory_contents_hash_1)
+ [WINDOWS32]: Initialize hash.
+
+2003-06-19 Earnie Boyd <earnie@uses.sf.net>
+
+ * dir.c (read_dirstream): Provide a workaround for broken versions of
+ the MinGW dirent structure.
+
+2003-05-30 Earnie Boyd <earnie@users.sf.net>
+
+ * w32/include/dirent.h: Add __MINGW32__ filter.
+
+2003-05-30 Earnie Boyd <earnie@users.sf.net>
+
+ * make.h: Add global declaration of *make_host.
+ * main.c (print_usage): Remove local declaration of *make_host.
+ (print_version): Display "This program built for ..." after Copyright
+ notice.
+
+2003-05-30 Earnie Boyd <earnie@users.sf.net>
+
+ * doc/make.texi: Change "ifinfo" to "ifnottex" as suggested by the
+ execution of "makeinfo --html make.texi".
+
+2003-04-30 Paul D. Smith <psmith@gnu.org>
+
+ * build.template: Make some changes to maybe allow this script to
+ work on DOS/Windows/OS2 systems. Suggested by Andreas Buening.
+
+ * README.OS2.template: New file for OS/2 support. Original
+ contributed by Andreas Buening.
+ * configure.in: Invoke new pds_AC_DOS_PATHS macro to test for
+ DOS-style paths.
+
+2003-04-19 Paul D. Smith <psmith@gnu.org>
+
+ Fix bug #1405: allow a target to match multiple pattern-specific
+ variables.
+
+ * rule.c (create_pattern_var, lookup_pattern_var): Move these to
+ variable.c, where they've always belonged.
+ * rule.h: Move the prototypes and struct pattern_var as well.
+ * variable.c (initialize_file_variables): Invoke
+ lookup_pattern_var() in a loop, until no more matches are found.
+ If a match is found, create a new variable set for the target's
+ pattern variables. Then merge the contents of each matching
+ pattern variable set into the target's pattern variable set.
+ (lookup_pattern_var): Change this function to be usable
+ in a loop. It takes a starting position: if NULL, start at the
+ beginning; if non-NULL, start with the pattern variable after that
+ position, and return the next matching pattern.
+ (create_pattern_var): Create a unique instance of
+ pattern-specific variables for every definition in the makefile.
+ Don't combine the same pattern together. This allows us to
+ process the variable handling properly even when the same pattern
+ is used multiple times.
+ (parse_variable_definition): New function: break out the parsing
+ of a variable definition line from try_variable_definition.
+ (try_variable_definition): Call parse_variable_definition to
+ parse.
+ (print_variable_data_base): Print out pattern-specific variables.
+ * variable.h (struct variable): Remember when a variable is
+ conditional. Also remember its flavor.
+ (struct pattern_var): Instead of keeping a variable set, we just
+ keep a single variable for each pattern.
+ * read.c (record_target_var): Each pattern variable contains only a
+ single variable, not a set, so create it properly.
+ * doc/make.texi (Pattern-specific): Document the new behavior.
+
+2003-04-17 Paul D. Smith <psmith@gnu.org>
+
+ * dir.c (file_exists_p) [VMS]: Patch provided with Bug #3018 by
+ Jean-Pierre Portier <portierjp2@free.fr>. I don't understand the
+ file/directory naming rules for VMS so I can't tell whether this
+ is correct or not.
+
+2003-04-09 Paul D. Smith <psmith@gnu.org>
+
+ * configure.in (HAVE_DOS_PATHS): Define this on systems that need
+ DOS-style pathnames: backslash separators and drive specifiers.
+
+2003-03-28 Paul D. Smith <psmith@gnu.org>
+
+ * file.c (snap_deps): If .SECONDARY with no targets is given, set
+ the intermediate flag on all targets. Fixes bug #2515.
+
+2003-03-24 Paul D. Smith <psmith@gnu.org>
+
+ * configure.in, Makefile.am, glob/Makefile.am, doc/Makefile.am:
+ Upgrade to autoconf 2.57 and automake 1.7.3.
+
+ * job.c: More OS/2 changes from Andreas Buening.
+
+ * file.c (print_file): Fix variable initialization.
+ Fixes bug #2892.
+
+ * remake.c (notice_finished_file):
+
+ * make.h (ENULLLOOP): Set errno = 0 before invoking the command;
+ some calls (like readdir()) return NULL in valid situations
+ without resetting errno. Fixes bug #2846.
+
+2003-02-25 Paul D. Smith <psmith@gnu.org>
+
+ Port to OS/2 (__EMX__) by Andreas Buening <andreas.buening@nexgo.de>.
+
+ * job.c (_is_unixy_shell) [OS/2]: New function.
+ Set default shell to /bin/sh.
+ (reap_children): Close the job_rfd pipe here since we don't use a
+ SIGCHLD handler.
+ (set_child_handler_action_flags): define this to empty on OS/2.
+ (start_job_command): Close the jobserver pipe and use
+ child_execute_job() instead of fork/exec.
+ (child_execute_job): Rewrite to handle stdin/stdout FDs and spawn
+ rather than exec'ing, then reconfigure stdin/stdout.
+ (exec_command): Rewrite to use spawn instead of exec. Return the
+ PID of the child.
+
+ * main.c (main) [OS/2]: Call initialize_main(). Handle argv[0] as
+ in DOS. Handle the TEMP environment variable as in DOS. Don't
+ use a SIGCHLD handler on OS/2. Choose a shell as in DOS. Don't
+ use -j in DOS mode. Use child_execute_job() instead of
+ exec_command().
+
+ * function.c (func_shell) [OS/2]: Can't use fork/exec on OS/2: use
+ spawn() instead.
+
+ * job.h [OS/2]: Move CLOSE_ON_EXEC here from job.c. Add
+ prototypes that return values.
+
+ * remake.c (f_mtime) [OS/2]: Handle FAT timestamp offsets for OS/2.
+
+ * read.c (readline) [OS/2]: Don't handle CRLF specially on OS/2.
+ * default.c (default_suffixes) [OS/2]: Set proper default suffixes
+ for OS/2.
+ * vpath.c (construct_vpath_list) [OS/2]: Handle OS/2 paths like
+ DOS paths.
+
+2003-02-24 Paul D. Smith <psmith@gnu.org>
+
+ * default.c [VMS]: New default rules for .cxx -> .obj compiles.
+ * job.c (child_execute_job) [VMS]: New code for handling spawn().
+ (child_execute_job) [VMS]: Handle error status properly.
+ Patches provided by Hartmut Becker <Hartmut.Becker@compaq.com>.
+
+ * function.c (func_shell): Use EINTRLOOP() while reading from the
+ subshell pipe (Fixes bug #2502).
+ * job.c (free_child): Use EINTRLOOP() while writing tokens to the
+ jobserver pipe.
+ * main.c (main): Ditto.
+
+2003-01-30 Paul D. Smith <psmith@gnu.org>
+
+ * read.c (eval): eval() was not fully reentrant, because the
+ collapsed buffer was static. Change it to be an automatic
+ variable so that eval() can be invoked recursively.
+ Fixes bug # 2238.
+ (eval): Apply patch # 1022: fix memory reference error on long
+ target-specific variable lines.
+ Patch provided by Steve Brown <Steve.Brown@macquarie.com>.
+
+ * function.c (check_numeric): Combine the is_numeric() function
+ into this function, since it's only called from one place.
+ Constify this function. Have it print the incorrect string in the
+ error message. Fixes bug #2407.
+ (strip_whitespace): Constify.
+ (func_if): Constify.
+ * expand.c (expand_argument): Constify.
+
+2003-01-29 Paul D. Smith <psmith@gnu.org>
+
+ Fix bug # 2169, also reported by other people on various systems.
+
+ * make.h: Some systems, such as Solaris and PTX, do not fully
+ implement POSIX-compliant SA_RESTART functionality; important
+ system calls like stat() and readdir() can still fail with EINTR
+ even if SA_RESTART has been set on the signal handler. So,
+ introduce macros EINTRLOOP() and ENULLLOOP() which can loop on
+ EINTR for system calls which return -1 or 0 (NULL), respectively,
+ on error.
+ Also, remove the old atomic_stat()/atomic_readdir() and
+ HAVE_BROKEN_RESTART handling.
+
+ * configure.in: Remove setting of HAVE_BROKEN_RESTART.
+
+ * arscan.c (ar_member_touch): Use EINTRLOOP() to wrap fstat().
+ * remake.c (touch_file): Ditto.
+
+ * commands.c (delete_target): Use EINTRLOOP() to wrap stat().
+ * read.c (construct_include_path): Ditto.
+ * remake.c (name_mtime): Ditto.
+ * vpath.c (selective_vpath_search): Ditto.
+ * dir.c (find_directory): Ditto.
+ (local_stat): Ditto.
+ (find_directory): Use ENULLLOOP() to wrap opendir().
+ (dir_contents_file_exists_p): Use ENULLLOOP() to wrap readdir().
+
+ * misc.c: Remove HAVE_BROKEN_RESTART, atomic_stat(), and
+ atomic_readdir() handling.
+
+2003-01-22 Paul D. Smith <psmith@gnu.org>
+
+ * function.c (func_call): Fix Bug #1744. If we're inside a
+ recursive invocation of $(call ...), mask any of the outer
+ invocation's arguments that aren't used by this one, so that this
+ invocation doesn't "inherit" them accidentally.
+
+2002-12-05 Paul D. Smith <psmith@gnu.org>
+
+ * function.c (subst_expand): Valery Khamenia reported a
+ pathological performance hit when doing substitutions on very
+ large values with lots of words: turns out we were invoking
+ strlen() a ridiculous number of times. Instead of having each
+ call to sindex() call strlen() again, keep track of how much of
+ the text we've seen and pass the length to sindex().
+
+2002-11-19 Paul D. Smith <psmith@gnu.org>
+
+ * README.cvs, configure.in: Upgrade to require autoconf 2.56.
+
+
+2002-11-16 Paul D. Smith <psmith@gnu.org>
+
+ * NMakefile.template (OBJS): Add hash.c object file.
+ * SMakefile.template (srcs): Ditto.
+ * Makefile.ami (objs): Ditto.
+ * build_w32.bat: Ditto.
+
+ * Makefile.DOS.template: Remove extra dependencies.
+
+2002-10-25 Paul D. Smith <psmith@gnu.org>
+
+ * expand.c (install_variable_buffer): New function. Install a new
+ variable_buffer context and return the previous one.
+ (restore_variable_buffer): New function. Free the current
+ variable_buffer context and put a previously saved one back.
+ * variable.h: Prototypes for {install,restore}_variable_buffer.
+ * function.c (func_eval): Push a new variable_buffer context
+ before we eval, then restore the old one when we're done.
+ Fixes Bug #1517.
+
+ * read.c (install_conditionals): New function. Install a new
+ conditional context and return the previous one.
+ (restore_conditionals): New function. Free the current
+ conditional context and put a previously saved one back.
+ (eval): Use the {install,restore}_conditionals for "include"
+ handling.
+ (eval_buffer): Use {install,restore}_conditionals to preserve the
+ present conditional state before we evaluate the buffer.
+ Fixes Bug #1516.
+
+ * doc/make.texi (Quick Reference): Add references to $(eval ...)
+ and $(value ...).
+ (Recursion): Add a variable index entry for CURDIR.
+
+ * README.cvs: Update to appropriate versions.
+ * Makefile.am (nodist_loadavg_SOURCES): automake gurus point out I
+ don't need to copy loadavg.c: automake is smart enough to create
+ it for me. Still have a bug in automake related to ansi2knr tho.
+
+2002-10-14 Paul D. Smith <psmith@gnu.org>
+
+ * remake.c (notice_finished_file): Only touch targets if they have
+ at least one command (as per POSIX). Resolve Bug #1418.
+
+ * *.c: Convert to using ANSI C-style function definitions.
+ * Makefile.am: Enable the ansi2knr feature of automake.
+ * configure.in: ditto.
+
+2002-10-13 Paul D. Smith <psmith@gnu.org>
+
+ * commands.c (set_file_variables): Bug #1379: Don't use alloca()
+ for automatic variable values like $^, etc. In the case of very
+ large lists of prerequisites this causes problems. Instead reuse
+ a static buffer (resizeable) for each variable.
+
+ * read.c (eval): Fix Bug #1391: allow "export" keyword in
+ target-specific variable definitions. Check for it and set an
+ "exported" flag.
+ (record_target_var): Set the export field to v_export if the
+ "exported" flag is set.
+ * doc/make.texi (Target-specific): Document the ability to use
+ "export".
+
+ * doc/make.texi: Change the name of the section on automatic
+ variables from "Automatic" to "Automatic Variables". Added text
+ clarifying the scope of automatic variables.
+
+2002-10-04 Paul D. Smith <psmith@gnu.org>
+
+ * read.c (eval): Allow SysV $$@ variables to use {} braces as well
+ as () braces.
+ (record_files): Ditto.
+
+ * expand.c (variable_expand_string): In $(A:x=y) expansion limit
+ the search for the '=' to only within the enclosing parens.
+
+2002-10-03 Paul D. Smith <psmith@gnu.org>
+
+ Version 3.80 released.
+
+ * dir.c: Change hash functions to use K&R function definition style.
+ * function.c: Ditto.
+ * read.c: Ditto.
+ * variable.c: Ditto.
+
+ Update to automake 1.7.
+
+ * Makefile.am (AUTOMAKE_OPTIONS): Update to require 1.7.
+ (pdf): Remove this target as automake now provides one.
+
+ * configure.in: Change AM_CONFIG_HEADER to AC_CONFIG_HEADERS.
+
+2002-09-30 Martin P.J. Zinser <zinser@decus.de>
+
+ * makefile.com: Updates for GNU make 3.80.
+ * makefile.vms: Ditto.
+
+2002-09-23 Paul D. Smith <psmith@gnu.org>
+
+ * read.c (enum make_word_type): Remove w_comment.
+ (get_next_mword): Don't treat comment characters as special; where
+ this function is used we will never see a comment (it's stripped
+ before we get here) and treating comments specially means that
+ targets like "foo\#bar" aren't handled properly.
+
+2002-09-18 Paul D. Smith <psmith@gnu.org>
+
+ * doc/make.texi (Bugs): Update with some info on Savannah, etc.
+
+ * read.c (eval): Expansion of arguments to export/unexport was
+ ignoring all arguments after the first one. Change the algorithm
+ to expand the whole line once, then parse the results.
+
+2002-09-17 Paul D. Smith <psmith@gnu.org>
+
+ Fix Bug #940 (plus another bug I found while looking at this):
+
+ * read.c (record_target_var): enter_file() will add a new entry if
+ it's a double-colon target: we don't want to do that in this
+ situation. Invoke lookup_file() and only enter_file() if it does
+ not already exist. If the file we get back is a double-colon then
+ add this variable to the "root" double-colon target.
+
+ * variable.c (initialize_file_variables): If this file is a
+ double-colon target but is not the "root" target, then initialize
+ the root and make the root's variable list the parent of our
+ variable list.
+
+2002-09-13 Paul D. Smith <psmith@gnu.org>
+
+ * doc/make.texi (MAKE Variable): Add some indexing for "+".
+
+ * hash.c (round_up_2): Get rid of a warning.
+
+2002-09-12 Paul D. Smith <psmith@gnu.org>
+
+ * Makefile.am (loadavg_SOURCES, loadavg.c): Tiptoe around automake
+ so it doesn't complain about getloadavg.c.
+
+ * commands.c (set_file_variables): Make sure we always alloca() at
+ least 1 character for the value of $? (for '\0').
+
+2002-09-11 Paul D. Smith <psmith@gnu.org>
+
+ * hash.h (STRING_COMPARE, ISTRING_COMPARE, STRING_N_COMPARE): Fix
+ macro to use RESULT instead of the incorrect _RESULT_.
+
+ * make.h (HAVE_BROKEN_RESTART): Add prototypes for atomic_stat()
+ and atomic_readdir(). We need to #include dirent.h to get this to
+ work.
+ * misc.c (atomic_readdir): Fix typos.
+
+2002-09-10 Paul D. Smith <psmith@gnu.org>
+
+ * read.c (eval): Expand variable lists given to export and
+ unexport, so that "export $(LIST_OF_VARIABLES)" (etc.) works.
+ (conditional_line): Ditto for "ifdef". Fixes bug #103.
+
+ * doc/make.texi (Variables/Recursion): Document this.
+ (Conditional Syntax): And here.
+
+2002-09-09 Paul D. Smith <psmith@gnu.org>
+
+ * configure.in: Check for memmove().
+
+2002-09-07 Paul D. Smith <psmith@gnu.org>
+
+ * configure.in (HAVE_BROKEN_RESTART): Define this on PTX systems;
+ Michael Sterrett <msterret@coat.com> reports that while it has
+ SA_RESTART, it does not work properly.
+
+ * misc.c (atomic_stat): If HAVE_BROKEN_RESTART, create a function
+ that invokes stat() and loops to do it again if it returns EINTR.
+ (atomic_readdir): Ditto, with readdir().
+
+ * make.h (stat, readdir): If HAVE_BROKEN_RESTART, alias stat()
+ and readdir() to atomic_stat() and atomic_readdir().
+
+2002-09-04 Paul D. Smith <psmith@gnu.org>
+
+ * implicit.c (pattern_search): Daniel <barkalow@reputation.com>
+ reports that GNU make sometimes doesn't recognize that targets can
+ be made, when directories can be created as prerequisites. He
+ reports that changing the order of predicates in the DEP->changed
+ flag test so that lookup_file() is always performed, solves this
+ problem.
+
+2002-08-08 Paul D. Smith <psmith@gnu.org>
+
+ * configure.in: Require a newer version of gettext.
+
+ * misc.c (perror_with_name): Translate the format string (for
+ right-to-left language support).
+ (pfatal_with_name): Ditto.
+
+ * main.c: Create a static array of strings to store the usage
+ text. This is done to facilitate translations.
+ (struct command_switch): Remove argdesc and description fields.
+ (switches): Remove values for obsolete fields.
+ (print_usage): Print each element of the usage array.
+
+ * hash.c: Change function definitions to be K&R style.
+
+2002-08-02 Paul D. Smith <psmith@gnu.org>
+
+ * NEWS: Remove the mention of .TARGETS; we aren't going to publish
+ this one because it's too hard to get right. We'll look at it for
+ a future release.
+ * main.c (main): Don't create the .TARGETS variable.
+ * variable.c (handle_special_var): Don't handle .TARGETS.
+
+2002-08-01 Paul D. Smith <psmith@gnu.org>
+
+ * main.c (switches): Add a new option, -B (--always-make). If
+ specified, make will rebuild all targets that it encounters even
+ if they don't appear to be out of date.
+ (always_make_flag): New flag.
+ * make.h: Extern always_make_flag.
+ * remake.c (update_file_1): Check always_make_flag; if it's set we
+ will always rebuild any target we can, even if none of its
+ prerequisites are newer.
+ * NEWS: Mention it.
+
+ * doc/make.texi (Shell Function): Make it clear that make
+ variables marked as "export" are not passed to instances of the
+ shell function.
+
+ Add new introspection variable .VARIABLES and .TARGETS.
+
+ * variable.c (handle_special_var): New function. If the variable
+ reference passed in is "special" (.VARIABLES or .TARGETS),
+ calculate the new value if necessary. .VARIABLES is handled here:
+ walk through the hash of defined variables and construct a value
+ which is a list of the names. .TARGETS is handled by
+ build_target_list().
+ (lookup_variable): Invoke handle_special_var().
+ * file.c (build_target_list): Walk through the hask of known files
+ and construct a list of the names of all the ones marked as
+ targets.
+ * main.c (main): Initialize them to empty (and as simple variables).
+ * doc/make.texi (Special Variables): Document them.
+ * NEWS: Mention them.
+
+ * variable.h (struct variable): Add a new flag "exportable" which
+ is true if the variable name is valid for export.
+ * variable.c (define_variable_in_set): Set "exportable" when a new
+ variable is defined.
+ (target_environment): Use the "exportable" flag instead of
+ re-checking the name here... an efficiency improvement.
+
+2002-07-31 Paul D. Smith <psmith@gnu.org>
+
+ * config.h-vms.template: Updates to build on VMS. Thanks to
+ Brian_Benning@aksteel.com for helping verify the build.
+ * makefile.com: Build the new hash.c file.
+ * hash.h: Use strcpmi(), not stricmp(), in the
+ HAVE_CASE_INSENSITIVE_FS case.
+
+2002-07-30 Paul D. Smith <psmith@gnu.org>
+
+ * hash.h (ISTRING_COMPARE, return_ISTRING_COMPARE): Add missing
+ backslashes to the HAVE_CASE_INSENSITIVE_FS case.
+ Reported by <Brian_Benning@aksteel.com>.
+
+2002-07-10 Paul D. Smith <psmith@gnu.org>
+
+ * variable.c (pop_variable_scope): Remove variable made unused by
+ new hash infrastructure.
+ * read.c (dep_hash_cmp): Rewrite this to handle ignore_mtime
+ comparisons as well as name comparisons.
+ * variable.h: Add a prototype for new hash_init_function_table().
+ * file.c (lookup_file): Remove variables made unused by new hash
+ infrastructure.
+ * dir.c (directory_contents_hash_2): Missing return of hash value.
+ (dir_contents_file_exists_p): Remove variables made unused by new
+ hash infrastructure.
+
+
+ Installed Greg McGary's integration of the hash functions from the
+ GNU id-utils package:
+
+2002-07-10 Greg McGary <greg@mcgary.org>
+
+ * scripts/functions/filter-out: Add literals to to the
+ pattern space in order to add complexity, and trigger
+ use of an internal hash table. Fix documentation strings.
+ * scripts/targets/INTERMEDIATE: Reverse order of files
+ passed to expected `rm' command.
+
+2002-07-10 Greg McGary <greg@mcgary.org>
+
+ * Makefile.am (SRCS): Add hash.c (noinst_HEADERS): Add hash.h
+ * hash.c: New file, taken from id-utils.
+ * hash.h: New file, taken from id-utils.
+
+ * make.h (HASH, HASHI): Remove macros.
+ (find_char_unquote): Change arglist in decl.
+ (hash_init_directories): New function decl.
+ * variable.h (hash.h): New #include.
+ (MAKELEVEL_NAME, MAKELEVEL_LENGTH): New constants.
+ * filedef.h (hash.h): New #include.
+ (struct file) [next]: Remove member.
+ (file_hash_enter): Remove function decl.
+ (init_hash_files): New function decl.
+
+ * ar.c (ar_name): Delay call to strlen until needed.
+ * main.c (initialize_global_hash_tables): New function.
+ (main): Call it. Use MAKELEVEL_NAME & MAKELEVEL_LENGTH.
+ * misc.c (remove_comments): Pass char constants to find_char_unquote.
+ * remake.c (notice_finished_file): Update last_mtime on `prev' chain.
+
+ * dir.c (hash.h): New #include.
+ (struct directory_contents) [next, files]: Remove members.
+ [ctime]: Add member for VMS. [dirfiles]: Add hash-table member.
+ (directory_contents_hash_1, directory_contents_hash_2,
+ directory_contents_hash_cmp): New functions.
+ (directories_contents): Change type to `struct hash_table'.
+ (struct directory) [next]: Remove member.
+ (directory_hash_1, directory_hash_2, directory_hash_cmp): New funcs.
+ (directory): Change type to `struct hash_table'.
+ (struct dirfile) [next]: Remove member.
+ [length]: Add member. [impossible]: widen type to fill alignment gap.
+ (dirfile_hash_1, dirfile_hash_2, dirfile_hash_cmp): New functions.
+ (find_directory): Use new hash table package.
+ (dir_contents_file_exists_p): Likewise.
+ (file_impossible): Likewise.
+ (file_impossible_p): Likewise.
+ (print_dir_data_base): Likewise.
+ (open_dirstream): Likewise.
+ (read_dirstream): Likewise.
+ (hash_init_directories): New function.
+
+ * file.c (hash.h): New #include.
+ (file_hash_1, file_hash_2, file_hash_cmp): New functions.
+ (files): Change type to `struct hash_table'.
+ (lookup_file): Use new hash table package.
+ (enter_file): Likewise.
+ (remove_intermediates): Likewise.
+ (snap_deps): Likewise.
+ (print_file_data_base): Likewise.
+
+ * function.c
+ (function_table_entry_hash_1, function_table_entry_hash_2,
+ function_table_entry_hash_cmp): New functions.
+ (lookup_function): Remove `table' argument.
+ Use new hash table package.
+ (struct a_word) [chain, length]: New members.
+ (a_word_hash_1, a_word_hash_2, a_word_hash_cmp): New functions.
+ (struct a_pattern): New struct.
+ (func_filter_filterout): Pass through patterns noting boundaries
+ and '%', if present. Note a_word length. Use a hash table if
+ arglists are large enough to justify cost.
+ (function_table_init): Renamed from function_table.
+ (function_table): Declare as `struct hash_table'.
+ (FUNCTION_TABLE_ENTRIES): New constant.
+ (hash_init_function_table): New function.
+
+ * read.c (hash.h): New #include.
+ (read_makefile): Pass char constants to find_char_unquote.
+ (dep_hash_1, dep_hash_2, dep_hash_cmp): New functions.
+ (uniquize_deps): Use hash table to efficiently identify duplicates.
+ (find_char_unquote): Accept two char-constant stop chars, rather
+ than a string constant, avoiding zillions of calls to strchr.
+ Tighten inner search loops to test only for desired delimiters.
+
+ * variable.c (variable_hash_1, variable_hash_2,
+ variable_hash_cmp): New functions.
+ (variable_table): Declare as `struct hash_table'.
+ (global_variable_set): Remove initialization.
+ (init_hash_global_variable_set): New function.
+ (define_variable_in_set): Use new hash table package.
+ (lookup_variable): Likewise.
+ (lookup_variable_in_set): Likewise.
+ (initialize_file_variables): Likewise.
+ (pop_variable_scope): Likewise.
+ (create_new_variable_set): Likewise.
+ (merge_variable_sets): Likewise.
+ (define_automatic_variables): Likewise.
+ (target_environment): Likewise.
+ (print_variable_set): Likewise.
+
+2002-07-10 Paul D. Smith <psmith@gnu.org>
+
+ Implement the SysV make syntax $$@, $$(@D), and $$(@F) in the
+ prerequisite list. A real SysV make will expand the entire
+ prerequisites list _twice_: we don't do that as it's a big
+ backward-compatibility problem. We only replace those specific
+ variables.
+
+ * read.c (record_files): Replace any $@, $(@D), and $(@F) variable
+ references left in the list of prerequisites. Check for .POSIX as
+ we record targets, so we can disable non-POSIX behavior while
+ reading makefiles as well as running them.
+ (eval): Check the prerequisite list to see if we have anything
+ that looks like a SysV prerequisite variable reference.
+
+2002-07-09 Paul D. Smith <psmith@gnu.org>
+
+ * doc/make.texi (Prerequisite Types): Add a new section describing
+ order-only prerequisites.
+
+ * read.c (uniquize_deps): If we have the same file as both a
+ normal and order-only prereq, get rid of the order-only prereq,
+ since the normal one supersedes it.
+
+2002-07-08 Paul D. Smith <psmith@gnu.org>
+
+ * AUTHORS: Added Greg McGary to the AUTHORS file.
+ * NEWS: Blurbed order-only prerequisites.
+ * file.c (print_file): Show order-only deps properly when printing
+ the database.
+
+ * maintMakefile: Add "update" targets for wget'ing the latest
+ versions of various external files. Taken from Makefile.maint in
+ autoconf, etc.
+
+ * dosbuild.bat: Somehow we got _double_ ^M's. Remove them.
+ Reported by Eli Zaretskii <eliz@is.elta.co.il>.
+
+2002-07-07 Paul D. Smith <psmith@gnu.org>
+
+ * po/*.po: Remove. We'll use wget to retrieve them at release
+ time.
+
+ * variable.c (do_variable_definition) [W32]: On W32 using cmd
+ rather than a shell you get an exception. Make sure we look up
+ the variable. Patch provided by Eli Zaretskii <eliz@is.elta.co.il>.
+
+ * remake.c (notice_finished_file): Fix handling of -t flag.
+ Patch provided by Henning Makholm <henning@makholm.net>.
+
+ * implicit.c (pattern_search): Some systems apparently run short
+ of stack space, and using alloca() in this function caused an
+ overrun. I modified it to use xmalloc() on the two variables
+ which seemed like they might get large. Fixes Bug #476.
+
+ * main.c (print_version): Update copyright notice to conform with
+ GNU standards.
+ (print_usage): Update help output.
+
+ * function.c (func_eval): Create a new make function, $(eval
+ ...). Expand the arguments, put them into a buffer, then invoke
+ eval_buffer() on the resulting string.
+ (func_quote): Create a new function, $(quote VARNAME). Inserts
+ the value of the variable VARNAME without expanding it any
+ further.
+
+ * read.c (struct ebuffer): Change the linebuffer structure to an
+ "eval buffer", which can be either a file or a buffer.
+ (eval_makefile): Move the code in the old read_makefile() which
+ located a makefile into here: create a struct ebuffer with that
+ information. Have it invoke the new function eval() with that
+ ebuffer.
+ (eval_buffer): Create a new function that creates a struct ebuffer
+ that holds a string buffer instead of a file. Have it invoke
+ eval() with that ebuffer.
+ (eval): New function that contains the guts of the old
+ read_makefile() function: this function parses makefiles. Obtains
+ data to parse from the provided ebuffer. Some modifications to
+ make the flow of the function cleaner and clearer. Still could
+ use some work here...
+ (do_define): Takes a struct ebuffer instead of a FILE*. Read the
+ contents of the define/endef variable from the ebuffer.
+ (readstring): Read the next line from a string-style ebuffer.
+ (readline): Read the next line from an ebuffer. If it's a string
+ ebuffer, invoke readstring(). If it's a FILE* ebuffer, read it
+ from the file.
+
+ * dep.h (eval_buffer): Prototype eval_buffer();
+
+ * variable.c (do_variable_definition): Make sure that all
+ non-target-specific variables are registered in the global set.
+ If we're invoked from an $(eval ...) we might be inside a $(call
+ ...) or other function which has pushed a variable scope; we still
+ want to define our variables from evaluated makefile code in the
+ global scope.
+
+2002-07-03 Greg McGary <greg@mcgary.org>
+
+ * dep.h (struct dep) [ignore_mtime]: New member.
+ [changed]: convert to a bitfield.
+ * implicit.c (pattern_search): Zero ignore_mtime.
+ * main.c (main, handle_non_switch_argument): Likewise.
+ * rule.c (convert_suffix_rule): Likewise.
+ * read.c (read_all_makefiles, read_makefile, multi_glob): Likewise.
+ (read_makefile): Parse '|' in prerequisite list.
+ (uniquize_deps): Consider ignore_mtime when comparing deps.
+ * remake.c (update_file_1, check_dep): Don't force remake for
+ dependencies that have d->ignore_mtime.
+ * commands.c (FILE_LIST_SEPARATOR): New constant.
+ (set_file_variables): Don't include a
+ prerequisite in $+, $^ or $? if d->ignore_mtime.
+ Define $|.
+
+2002-06-18 Paul D. Smith <psmith@gnu.org>
+
+ * make.texinfo: Updates for next revision. New date/rev/etc.
+ Recreate all Info menus. Change license on the manual to the GNU
+ Free Documentation License. A number of typos.
+ (Variables Simplify): Don't use "-" before it's defined.
+ (Automatic Prerequisites): Rewrite the target example to work
+ properly if the compile fails. Remove incorrect comments about
+ how "set -e" behaves.
+ (Text Functions): Move the "word", "wordlist", "words", and
+ "firstword" functions here, from "File Name Functions".
+ * make-stds.texi: Update from latest GNU version.
+ * fdl.texi: (created) Import the latest GNU version.
+
+2002-06-06 Paul D. Smith <psmith@gnu.org>
+
+ * variable.c (do_variable_definition): New function: extract the
+ part of try_variable_definition() that actually sets the value
+ into a separate function.
+ (try_variable_definition): Call do_variable_definition() after
+ parsing the variable definition string.
+ (define_variable_in_set): Make the name argument const.
+
+ * variable.h (enum variable_flavor): Make public.
+ (do_variable_definition): Create prototype.
+
+ * read.c (read_all_makefiles): Create a new built-in variable,
+ MAKEFILE_LIST.
+ (read_makefile): Add each makefile read in to this variable value.
+
+2002-05-18 Eli Zaretskii <eliz@is.elta.co.il>
+
+ * Makefile.DOS.template: Tweak according to changes in the
+ distribution. Add back the dependencies of *.o files.
+
+ * configh.dos.template: Synchronize with config.h.in.
+
+2002-05-09 Paul D. Smith <psmith@gnu.org>
+
+ * file.c (file_timestamp_now): Use K&R function declaration.
+
+ * getloadavg.c (getloadavg): Merge setlocale() fix from sh-utils
+ getloadavg.c. Autoconf thinks QNX is SVR4-like, but it isn't, so
+ #undef it. Remove predefined setup of NLIST_STRUCT. Decide
+ whether to include nlist.h based on HAVE_NLIST_H. Change obsolete
+ NLIST_NAME_UNION to new HAVE_STRUCT_NLIST_N_UN_N_NAME.
+ * configure.in (NLIST_STRUCT): Define this if we have nlist.h and
+ nlist.n_name is a pointer rather than an array.
+
+ * acinclude.m4 (make_FUNC_SETVBUF_REVERSED): Grab the latest
+ version of AC_FUNC_SETVBUF_REVERSED from autoconf CVS.
+ * configure.in: Use it instead of the old version.
+
+ * main.c (main): Prefer setvbuf() to setlinebuf().
+
+2002-05-08 Paul D. Smith <psmith@gnu.org>
+
+ * Makefile.am (make_LDADD): Add GETLOADAVG_LIBS.
+ (loadavg_LDADD): Ditto.
+
+2002-04-29 Paul D. Smith <psmith@gnu.org>
+
+ * expand.c (recursively_expand_for_file): Rename
+ recursively_expand() to recursively_expand_for_file() and provide
+ an extra argument, struct file. If the argument is provided, set
+ the variable scope to that of the file before expanding.
+ * variable.h (recursively_expand): Make this a macro that invokes
+ recursively_expand_for_file() with a NULL file pointer.
+ * variable.c (target_environment): Call the renamed function and
+ provide the current file context.
+ Fixes Debian bug #144306.
+
+2002-04-28 Paul D. Smith <psmith@gnu.org>
+
+ Allow $(call ...) user-defined variables to be self-referencing
+ without throwing an error. Allows implementation of transitive
+ closures, among other possibly useful things.
+ Requested by: Philip Guenther <guenther@sendmail.com>
+
+ * variable.h (struct variable): Add a new field: exp_count, and
+ new macros to hold its size and maximum value.
+ (warn_undefined): Make this a macro.
+ * variable.c (define_variable_in_set): Initialize it.
+ * expand.c (recursively_expand): If we detect recursive expansion
+ of a variable, check the exp_count field. If it's greater than 0
+ allow the recursion and decrement the count.
+ (warn_undefined): Remove this (now a macro in variable.h).
+ * function.c (func_call): Before we expand the user-defined
+ function, modify its exp_count field to contain the maximum
+ number of recursive calls we'll allow. After the call, reset it
+ to 0.
+
+2002-04-21 Paul D. Smith <psmith@gnu.org>
+
+ Modified to use latest autoconf (2.53), automake (1.6.1), and
+ gettext (0.11.1). We're using gettext's new "external" support,
+ to avoid including libintl source with GNU make.
+
+ * README.cvs: New file. Explain how to build GNU make from CVS.
+
+ * configure.in: Modify checking for the system glob library.
+ Use AC_EGREP_CPP instead of AC_TRY_CPP. Remove the setting of
+ GLOBDIR (we will always put "glob" in SUBDIRS, so automake
+ etc. will manage it correctly). Set an automake conditional
+ USE_LOCAL_GLOB to decide whether to compile the glob library.
+
+ * getloadavg.c (main): Include make.h in the "TEST" program to
+ avoid warnings.
+
+ * Makefile.am: Remove special rules for loadavg. Replace them
+ with Automake capabilities for building extra programs.
+
+ * signame.c: This file does nothing if the system provide
+ strsignal(). If not, it implements strsignal(). If the system
+ doesn't define sys_siglist, then we make our own; otherwise we use
+ the system version.
+ * signame.h: Removed.
+
+ * main.c (main): No need to invoke signame_init(). Update copyright.
+
+ * ABOUT-NLS: Removed.
+ * gettext.c: Removed.
+ * gettext.h: Get a simplified copy from the gettext package.
+ * po/*: Created.
+ * i18n/*.po: Moved to po/.
+ * i18n/: Removed.
+
+ * config/*: Created. Contains package configuration helper files.
+ * config.guess, config.sub: Moved to config directory.
+
+ * configure.in (AC_CONFIG_FILES): Add po/Makefile.in, config/Makefile.
+ Rework to use new-style autoconf features. Use the "external"
+ mode for gettext. Make the build.sh config file conditional on
+ whether build.sh.in exists, to avoid autoconf errors.
+ * acinclude.m4: Removed almost all macros as being obsolete.
+ Rewrote remaining macros to use AC_DEFINE.
+ * acconfig.h: Removed.
+
+ * Makefile.am (EXTRA_DIST): Add config/config.rpath. Use a
+ conditional to handle customs support. Remove special handling
+ for i18n features.
+
+2002-04-20 Paul D. Smith <psmith@gnu.org>
+
+ * function.c (func_call): Don't mark the argument variables $1,
+ etc. as recursive. They've already been fully expanded so
+ there's no need to do it again, and doing so strips escaped $'s.
+ Reported by Sebastian Glita <glseba@yahoo.com>.
+
+ * remake.c (notice_finished_file): Walk through double-colon
+ entries via the prev field, not the next field!
+ Reported by Greg McGary <greg@mcgary.org>.
+
+ * main.c (main): If the user specifies -q and asks for a specific
+ target which is a makefile, we got an assert. In that case it
+ turns out we should continue normally instead.
+
+ * i18n/de.po, i18n/fr.po: Installed an updated translation.
+
+ * i18n/he.po: Installed a new translation.
+
+2002-01-07 Paul D. Smith <psmith@gnu.org>
+
+ * i18n/es.po, i18n/ru.po: Installed an updated translation.
+
+2001-12-04 Paul D. Smith <psmith@gnu.org>
+
+ * i18n/ja.po: Installed an updated translation.
+
+2001-09-06 Paul Eggert <eggert@twinsun.com>
+
+ * configure.in (AC_CHECK_HEADERS): Add sys/resource.h.
+ (AC_CHECK_FUNCS): Add getrlimit, setrlimit.
+
+ * main.c: Include <sys/resource.h> if it, getrlimit, and setrlimit
+ are available.
+ (main): Get rid of any avoidable limit on stack size.
+
+2001-09-04 Paul D. Smith <psmith@gnu.org>
+
+ * i18n/da.po: Installed an updated translation.
+
+2001-08-03 Paul D. Smith <psmith@gnu.org>
+
+ * i18n/fr.po: Installed an updated translation.
+ Resolves Debian bug #106720.
+
+2001-06-13 Paul D. Smith <psmith@gnu.org>
+
+ * i18n/da.po, configure.in (ALL_LINGUAS): Installed a new
+ translation.
+
+2001-06-11 Paul D. Smith <psmith@gnu.org>
+
+ * i18n/ko.po: Installed a new translation.
+
+2001-05-06 Paul D. Smith <psmith@gnu.org>
+
+ Modify the EINTR handling.
+
+ * job.c (new_job): Reorganize the jobserver algorithm. Reorder
+ the way in which we manage the file descriptor/signal handler race
+ trap to be more efficient.
+
+2001-05-06 Paul Eggert <eggert@twinsun.com>
+
+ Restart almost all system calls that are interrupted, instead
+ of worrying about EINTR. The lone exception is the read() for
+ job tokens.
+
+ * configure.in (HAVE_SA_RESTART): New macro.
+ (MAKE_JOBSERVER): Define to 1 only if HAVE_SA_RESTART.
+ * main.c (main): Use SA_RESTART instead of the old,
+ nonstandard SA_INTERRUPT.
+
+ * configure.in (AC_CHECK_FUNCS): Add bsd_signal.
+ * main.c (bsd_signal): New function or macro,
+ if the implementation doesn't supply it.
+ (The bsd_signal function will be in POSIX 1003.1-200x.)
+ (HANDLESIG): Remove.
+ (main, FATAL_SIG): Use bsd_signal instead of signal or HANDLESIG.
+
+ * make.h (EINTR_SET): Remove.
+ (SA_RESTART): New macro.
+
+ * arscan.c (ar_member_touch): Don't worry about EINTR.
+ * function.c (func_shell): Likewise.
+ * job.c (reap_children, free_child, new_job): Likewise.
+ * main.c (main): Likewise.
+ * remake.c (touch_file, name_mtime): Likewise.
+
+ * arscan.c (ar_member_touch): Fix bug uncovered by EINTR removal;
+ if fstat failed with errno!=EINTR, the error was ignored.
+
+ * job.c (set_child_handler_action_flags): New function.
+ (new_job): Use it to temporarily clear the SIGCHLD action flags
+ while reading the token.
+
+2001-05-02 Paul D. Smith <psmith@gnu.org>
+
+ * job.c (start_job_command): Don't add define/endef per-line flags
+ to the top-level flags setting.
+
+2001-04-03 Paul D. Smith <psmith@gnu.org>
+
+ * arscan.c (VMS_get_member_info,ar_scan) [VMS]: VMS sets the low
+ bit on error, so check for odd return values, not non-0 return
+ values.
+ (VMS_get_member_info): Calculate the timezone differences correctly.
+ Reported by John Fowler <jfowler@nyx.net>.
+
+
+2001-03-14 Paul D. Smith <psmith@gnu.org>
+
+ * variable.c (lookup_variable) [VMS]: Null-terminate the variable
+ value before invoking define_variable().
+ Reported by John Fowler <jfowler@nyx.net>.
+
+2001-02-07 Paul D. Smith <psmith@gnu.org>
+
+ * read.c (record_target_var): If we reset the variable due to a
+ command-line variable setting overriding it, turn off the "append"
+ flag.
+
+2001-01-17 Paul D. Smith <psmith@gnu.org>
+
+ * variable.c (lookup_variable) [VMS]: When getting values from the
+ environment, allocate enough space for the _value_ plus escapes,
+ not enough space for the name plus escapes :-/.
+ Reported by John Fowler <jfowler@nyx.net>.
+
+ * remake.c (f_mtime): Removed the "***" prefix from the mod time
+ warnings that make generates, so it doesn't look like an error.
+ Reported by Karl Berry <karl@gnu.org>.
+
+
+ Fix for PR/2020: Rework appended target-specific variables. I'm
+ fairly confident this algorithm is finally correct.
+
+ * expand.c (allocated_variable_append): Rewrite. Instead of
+ expanding each appended variable then adding all the expanded
+ strings together, we append all the unexpanded values going up
+ through the variable set contexts, then expand the final result.
+ This behaves just like non-target-specific appended variable
+ values, while the old way didn't in various corner cases.
+ (variable_append): New function: recursively append the unexpanded
+ value of a variable, walking from the outermost variable scope to
+ the innermost.
+ * variable.c (lookup_variable): Remove the code that looked up the
+ variable set list if the found variable was "append". We don't
+ need this anymore.
+ (lookup_variable_in_set): Make this non-static so we can use it
+ elsewhere.
+ (try_variable_definition): Use lookup_variable_in_set() rather
+ than faking out current_variable_set_list by hand (cleanup).
+ * variable.h: Add a prototype for the now non-static
+ lookup_variable_in_set().
+
+2000-11-17 Paul D. Smith <psmith@gnu.org>
+
+ * remake.c (f_mtime) [WINDOWS32]: On various advice, I changed the
+ WINDOWS32 port to assume timestamps can be up to 3 seconds away
+ before throwing a fit.
+
+2000-11-17 Paul D. Smith <psmith@gnu.org>
+
+ * read.c (readline): CRLF calculations had a hole, if you hit the
+ buffer grow scenario just right. Reworked the algorithm to avoid
+ the need for len or lastlen at all. Problem description with
+ sample code chages provided by Chris Faylor <cgf@redhat.com>.
+
+2000-10-24 Paul D. Smith <psmith@gnu.org>
+
+ * gettext.c (SWAP): Declare this with the prototype, otherwise
+ some systems don't work (non-32-bit? Reported for Cray T3E).
+ Reported by Thorstein Thorsteinsson <thor@signe.teokem.lu.se>.
+
+2000-10-05 Paul D. Smith <psmith@gnu.org>
+
+ * acinclude.m4 (AM_LC_MESSAGES): Remove undefined macro
+ AM_LC_MESSAGES; it doesn't seem to do anything anyway??
+
+ * i18n/gl.po, configure.in (ALL_LINGUAS): New Galician translation.
+
+2000-09-22 Paul D. Smith <psmith@gnu.org>
+
+ * gettext.c: Don't #define _GETTEXT_H here; we only include some
+ parts of the real gettext.h here, and we expect to really include
+ the real gettext.h later. If we keep this #define, it's ignored.
+
+2000-09-21 Paul D. Smith <psmith@gnu.org>
+
+ * main.c (log_working_directory): Rework the text to use complete
+ sentences, to make life simpler for the translators.
+
+2000-08-29 Paul D. Smith <psmith@gnu.org>
+
+ * file.c (remove_intermediates): Print a debug message before we
+ remove intermediate files, so the user (if she uses -d) knows
+ what's going on.
+
+2000-08-21 Paul D. Smith <psmith@gnu.org>
+
+ * variable.c (try_variable_definition): Change how we handle
+ target-specific append variable defns: instead of just setting the
+ value, expand it as an append _but_ only within the current
+ target's context. Otherwise we lose all but the last value if the
+ variable is appended more than once within the current target
+ context. Fixes PR/1831.
+
+2000-08-16 Paul D. Smith <psmith@gnu.org>
+
+ * function.c (func_shell): Nul-terminate the buffer before
+ printing an exec error message (just in case it's not!).
+ Fixes PR/1860, reported by Joey Hess <joey@valinux.com>.
+
+2000-07-25 Paul D. Smith <psmith@gnu.org>
+
+ * job.c (construct_command_argv_internal): Add "~" to the list of
+ sh_chars[] which disallow optimizing out the shell call.
+
+2000-07-23 Paul Eggert <eggert@twinsun.com>
+
+ * NEWS, make.texinfo: Document .LOW_RESOLUTION_TIME, which
+ supersedes --disable-nsec-timestamps.
+ * make.texinfo: Consistently use "time stamp" instead of "timestamp".
+ * README: Remove --disable-nsec-timestamps.
+
+ * filedef.h (struct file.low_resolution_time): New member.
+ * file.c (snap_deps): Add support for .LOW_RESOLUTION_TIME.
+ * remake.c (update_file_1):
+ Avoid spurious rebuilds due to low resolution time stamps,
+ generalizing the earlier code that applied only to archive members.
+ (f_mtime): Archive members always have low resolution time stamps.
+
+ * configure.in: Remove --disable-nsec-timestamps, as this has
+ been superseded by .LOW_RESOLUTION_TIME.
+
+2000-07-23 Paul Eggert <eggert@twinsun.com>
+
+ * configure.in (enable_nsec_timestamps): Renamed from
+ make_cv_nsec_timestamps, since enable/disable options
+ shouldn't be cached.
+
+2000-07-23 Bruno Haible <haible@clisp.cons.org>
+ and Paul Eggert <eggert@twinsun.com>
+
+ * file.c (file_timestamp_now):
+ Use preprocessor-time check for FILE_TIMESTAMP_HI_RES
+ so that clock_gettime is not linked unless needed.
+
+ * filedef.h (FILE_TIMESTAMP_HI_RES):
+ Remove definition; "configure" now does this.
+
+ * configure.in (jm_AC_TYPE_UINTMAX_T): Move up,
+ to before high resolution file timestamp check,
+ since that check now uses uintmax_t.
+ (FILE_TIMESTAMP_HI_RES): Define to nonzero if the code should use
+ high resolution file timestamps.
+ (HAVE_CLOCK_GETTIME): Do not define if !FILE_TIMESTAMP_HI_RES,
+ so that we don't link in clock_gettime unnecessarily.
+
+2000-07-17 Paul D. Smith <psmith@gnu.org>
+
+ * i18n/ja.po: New version of the translation file.
+
+2000-07-07 Paul D. Smith <psmith@gnu.org>
+
+ * remake.c (f_mtime): If NO_FLOAT is defined, don't bother with
+ the offset calculation.
+ (name_mtime): Replace EINTR test with EINTR_SET macro.
+
+2000-07-07 Paul Eggert <eggert@twinsun.com>
+
+ Fix for PR/1811:
+
+ * remake.c (update_file_1):
+ Avoid spurious rebuilds of archive members due to their
+ timestamp resolution being only one second.
+ (f_mtime): Avoid spurious warnings of timestamps in the future due to
+ the clock's resolution being lower than file timestamps'.
+ When warning about future timestamps, report only the discrepancy,
+ not the absolute value of the timestamp and the current time.
+
+ * file.c (file_timestamp_now): New arg RESOLUTION.
+ * filedef.h (file_timestamp_now): Likewise.
+ (FILE_TIMESTAMP_NS): Now returns int. All uses changed.
+
+2000-07-05 Paul D. Smith <psmith@gnu.org>
+
+ * variable.c (lookup_variable) [VMS]: Remove vestigial references
+ to listp. Fixes PR/1793.
+
+2000-06-26 Paul Eggert <eggert@twinsun.com>
+
+ * Makefile.am (MAINTAINERCLEANFILES): New macro, with stamp-pot in it.
+
+ * dir.c (vms_hash): Ensure ctype macro args are nonnegative.
+
+ * remake.c (f_mtime): Remove unused var memtime.
+
+2000-06-25 Martin Buchholz <martin@xemacs.org>
+
+ * make.texinfo, NEWS, TODO.private: Minor spelling corrections.
+ Ran spell-check on make.texinfo.
+
+2000-06-23 Paul D. Smith <psmith@gnu.org>
+
+ * main.c (main): Replace EXIT_SUCCESS, EXIT_FAILURE, and
+ EXIT_TROUBLE with MAKE_SUCCESS, MAKE_FAILURE, and MAKE_TROUBLE.
+ * make.h: Define these macros.
+
+ * Version 3.79.1 released.
+
+ * configure.in: Add a new option, --disable-nsec-timestamps, to
+ avoid using sub-second timestamps on systems that support it. It
+ can lead to problems, e.g. if your makefile relies on "cp -p".
+ * README.template: Document the issue with "cp -p".
+
+ * config.guess, config.sub: Updated.
+
+
+
+See ChangeLog.2, available in the Git repository at:
+
+ http://git.savannah.gnu.org/cgit/make.git/tree/
+
+for earlier changes.
+
+
+Copyright (C) 2000-2013 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
+terms of the GNU General Public License as published by the Free Software
+Foundation; either version 3 of the License, or (at your option) any later
+version.
+
+GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License along with
+this program. If not, see <http://www.gnu.org/licenses/>.
diff --git a/Makefile.DOS.template b/Makefile.DOS.template
new file mode 100644
index 00000000..47d83eb8
--- /dev/null
+++ b/Makefile.DOS.template
@@ -0,0 +1,587 @@
+# -*-Makefile-*- template for DJGPP
+# Makefile.in generated automatically by automake 1.2 from Makefile.am
+#
+# Copyright (C) 1994-2016 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 terms of the GNU General Public License as published by the Free Software
+# Foundation; either version 3 of the License, or (at your option) any later
+# version.
+#
+# GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+# details.
+#
+# You should have received a copy of the GNU General Public License along with
+# this program. If not, see <http://www.gnu.org/licenses/>.
+
+SHELL = /bin/sh
+
+srcdir = .
+VPATH = $(srcdir)
+# $DJDIR is defined automatically by DJGPP to point
+# to the root of the DJGPP installation tree.
+prefix = /dev/env/DJDIR
+exec_prefix = ${prefix}
+
+bindir = /bin
+datadir = /share
+libdir = /lib
+infodir = /info
+mandir = /man
+includedir = /include
+oldincludedir = c:/djgpp/include
+
+DESTDIR = /dev/env/DJDIR
+
+pkgdatadir = $(datadir)/make
+pkglibdir = $(libdir)/make
+pkgincludedir = $(includedir)/make
+localedir = $(datadir)/locale
+
+INSTALL = ${exec_prefix}/bin/ginstall -c
+INSTALL_PROGRAM = ${exec_prefix}/bin/ginstall -c
+INSTALL_DATA = ${exec_prefix}/bin/ginstall -c -m 644
+INSTALL_SCRIPT = ${exec_prefix}/bin/ginstall -c
+transform = s,x,x,
+
+# This will fail even if they don't have a Unix-like shell (stock DOS
+# shell doesn't know about `false'). The only difference is that they
+# get "Error -1" instead of "Error 1".
+EXIT_FAIL = false
+
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+EXEEXT = .exe
+OBJEXT = o
+
+AR = ar
+AWK = gawk
+CC = gcc
+CPP = gcc -E
+LIBOBJS =
+MAKEINFO = ${exec_prefix}/bin/makeinfo
+PACKAGE = make
+PERL = perl
+RANLIB = ranlib
+REMOTE = stub
+VERSION = %VERSION%
+
+AUTOMAKE_OPTIONS = 1.2
+
+bin_PROGRAMS = %PROGRAMS%$(EXEEXT)
+
+make_SOURCES = %SOURCES%
+# This should include the glob/ prefix
+libglob_a_SOURCES = %GLOB_SOURCES%
+make_LDADD = glob/libglob.a
+
+man_MANS = make.1
+
+INCLUDES = -I$(srcdir)/glob -DLIBDIR=\"$(prefix)$(libdir)\" -DINCLUDEDIR=\"$(prefix)$(includedir)\" -DLOCALEDIR=\"$(prefix)$(localedir)\"
+
+BUILT_SOURCES = README build.sh-in
+
+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 gmk-default.scm gmk-default.h
+
+SUBDIRS = glob doc
+mkinstalldirs = ${exec_prefix}/bin/gmkdir -p
+CONFIG_HEADER = config.h
+CONFIG_CLEAN_FILES = build.sh
+PROGRAMS = $(bin_PROGRAMS)
+
+MAKE_HOST = i386-pc-msdosdjgpp
+
+
+DEFS = -I. -I$(srcdir) -I.
+CPPFLAGS = -DHAVE_CONFIG_H
+LDFLAGS =
+LIBS =
+make_OBJECTS = %OBJECTS%
+make_DEPENDENCIES = glob/libglob.a
+make_LDFLAGS =
+libglob_a_LIBADD =
+libglob_a_OBJECTS = %GLOB_OBJECTS%
+noinst_LIBRARIES = glob/libglob.a
+CFLAGS = -O2 -g
+COMPILE = $(CC) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS)
+LINK = $(CC) $(CFLAGS) $(LDFLAGS) -o $@
+TEXI2DVI = texi2dvi
+TEXINFO_TEX = $(srcdir)/config/texinfo.tex
+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)
+
+NROFF = nroff
+DIST_COMMON = README ABOUT-NLS AUTHORS COPYING ChangeLog INSTALL Makefile.am Makefile.in NEWS acconfig.h aclocal.m4 alloca.c build.sh-in config.h-in configure configure.ac getloadavg.c
+
+DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
+
+TAR = gtar
+GZIP = --best
+SOURCES = $(make_SOURCES)
+OBJECTS = $(make_OBJECTS)
+HEADERS = $(wildcard $(srcdir)/*.h)
+
+default: all
+
+.SUFFIXES:
+.SUFFIXES: .c .dvi .info .o .obj .ps .texi .tex .html
+
+mostlyclean-hdr:
+
+clean-hdr:
+
+distclean-hdr:
+ -rm -f config.h
+
+maintainer-clean-hdr:
+
+mostlyclean-binPROGRAMS:
+
+clean-binPROGRAMS:
+ -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
+
+distclean-binPROGRAMS:
+
+maintainer-clean-binPROGRAMS:
+
+install-binPROGRAMS: $(bin_PROGRAMS)
+ @$(NORMAL_INSTALL)
+ $(mkinstalldirs) $(DESTDIR)$(bindir)
+ @list='$(bin_PROGRAMS)'; for p in $$list; do if test -f $$p; then echo " $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p | sed '$(transform)'`"; $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p | sed '$(transform)'`; else :; fi; done
+
+uninstall-binPROGRAMS:
+ $(NORMAL_UNINSTALL)
+ list='$(bin_PROGRAMS)'; for p in $$list; do rm -f $(DESTDIR)$(bindir)/`echo $$p|sed '$(transform)'`.exe; done
+
+.c.o:
+ $(COMPILE) -c $<
+
+clean-noinstLIBRARIES:
+ -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES)
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT) *$(EXEEXT) make.new core
+
+clean-compile:
+
+distclean-compile:
+ -rm -f *.tab.c *_tab.c
+
+maintainer-clean-compile:
+
+make$(EXEEXT): $(make_OBJECTS) $(make_DEPENDENCIES)
+ @command.com /c if exist make del make
+ @command.com /c if exist make.exe del make.exe
+ $(LINK) $(make_LDFLAGS) $(make_OBJECTS) $(make_LDADD) $(LIBS)
+
+# Documentation
+
+make.info: make.texi
+make.dvi: make.texi
+make.ps: make.dvi make.texi
+make.html: make.texi
+
+
+DVIPS = dvips
+
+.texi.info:
+ @command.com /c if exist make.info* del make.info*
+ @command.com /c if exist make.i* del make.i*
+ $(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) --no-split $< -o ./$@
+
+.texi.dvi:
+ TEXINPUTS="$(srcdir);$$TEXINPUTS" MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $<
+
+.dvi.ps:
+ $(DVIPS) $< -o $@
+
+# Other documentation formats
+
+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 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 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:
+ $(PRE_UNINSTALL)
+ @if $(SHELL) -c 'install-info --version | sed 1q | fgrep -s -v -i debian' >/dev/null 2>&1; then ii=yes; else ii=; fi; for file in $(INFO_DEPS); do test -z $ii || install-info --info-dir=$(DESTDIR)$(infodir) --remove $$file; done
+ $(NORMAL_UNINSTALL)
+ for file in $(INFO_DEPS); do (cd $(DESTDIR)$(infodir) && rm -f $$file); done
+
+dist-info: $(INFO_DEPS)
+ for base in $(INFO_DEPS); do d=$(srcdir); for file in `cd $$d && eval echo $$base*`; do test -f $(distdir)/$$file || ln $$d/$$file $(distdir)/$$file 2> /dev/null || cp -p $$d/$$file $(distdir)/$$file; done; done
+
+mostlyclean-aminfo:
+ -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:
+
+distclean-aminfo:
+
+maintainer-clean-aminfo:
+ for i in $(INFO_DEPS); do rm -f $$i*; done
+
+install-man1:
+ $(mkinstalldirs) $(DESTDIR)$(man1dir)
+ @list='$(man1_MANS)'; \
+ l2='$(man_MANS)'; for i in $$l2; do \
+ case "$$i" in \
+ *.1*) list="$$list $$i" ;; \
+ esac; \
+ done; \
+ for i in $$list; do \
+ if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \
+ else file=$$i; fi; \
+ ext=`echo $$i | sed -e 's/^.*\\.//'`; \
+ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
+ inst=`echo $$inst | sed '$(transform)'`.$$ext; \
+ echo " $(INSTALL_DATA) $$file $(DESTDIR)$(man1dir)/$$inst"; \
+ $(INSTALL_DATA) $$file $(DESTDIR)$(man1dir)/$$inst; \
+ done
+
+uninstall-man1:
+ @list='$(man1_MANS)'; \
+ l2='$(man_MANS)'; for i in $$l2; do \
+ case "$$i" in \
+ *.1*) list="$$list $$i" ;; \
+ esac; \
+ done; \
+ for i in $$list; do \
+ ext=`echo $$i | sed -e 's/^.*\\.//'`; \
+ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
+ inst=`echo $$inst | sed '$(transform)'`.$$ext; \
+ echo " rm -f $(DESTDIR)$(man1dir)/$$inst"; \
+ rm -f $(DESTDIR)$(man1dir)/$$inst; \
+ done
+install-man: $(MANS)
+ @$(NORMAL_INSTALL)
+ $(MAKE) install-man1
+uninstall-man:
+ @$(NORMAL_UNINSTALL)
+ $(MAKE) uninstall-man1
+
+# Assume that the only thing to do in glob is to build libglob.a,
+# but do a sanity check: if $SUBDIRS will ever have more than
+# a single directory, yell bloody murder.
+all-recursive:
+ifeq ($(findstring glob, $(SUBDIRS)), glob)
+ @command.com /c if not exist glob\\nul md glob
+ @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
+
+$(SUBDIRS):
+ command.com /c md $@
+
+libglob.a: $(libglob_a_OBJECTS)
+ command.com /c if exist libglob.a del libglob.a
+ $(AR) cru libglob.a $(libglob_a_OBJECTS) $(libglob_a_LIBADD)
+ $(RANLIB) libglob.a
+
+mostlyclean-recursive clean-recursive distclean-recursive \
+maintainer-clean-recursive check-recursive:
+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 two directory in "($(SUBDIRS))"
+ @$(EXIT_FAIL)
+endif
+
+tags-in-glob: $(libglob_a_SOURCES)
+ etags $(addprefix $(srcdir)/,$^) -o ./glob/TAGS
+
+tags-recursive:
+ifeq ($(words $(SUBDIRS)), 2)
+ $(MAKE) tags-in-glob
+else
+ @echo FATAL: There is more than two directory in "($(SUBDIRS))"
+ @$(EXIT_FAIL)
+endif
+
+tags: TAGS
+
+ID: $(HEADERS) $(SOURCES)
+ mkid $(srcdir)/$(SOURCES) $(srcdir)/$(libglob_a_SOURCES) ./config.h $(HEADERS)
+
+TAGS: tags-recursive $(HEADERS) $(srcdir)/$(SOURCES) config.h $(TAGS_DEPENDENCIES)
+ etags -i ./glob/TAGS $(ETAGS_ARGS) $(srcdir)/$(SOURCES) ./config.h $(HEADERS)
+
+mostlyclean-tags:
+
+clean-tags:
+
+distclean-tags:
+ -rm -f TAGS ID
+
+maintainer-clean-tags:
+
+distdir = $(PACKAGE)-$(VERSION)
+top_distdir = $(distdir)
+
+# This target untars the dist file and tries a VPATH configuration. Then
+# it guarantees that the distribution is self-contained by making another
+# tarfile.
+distcheck: dist
+ rm -rf $(distdir)
+ GZIP=$(GZIP) $(TAR) zxf $(distdir).tar.gz
+ mkdir $(distdir)/=build
+ mkdir $(distdir)/=inst
+ dc_install_base=`cd $(distdir)/=inst && pwd`; cd $(distdir)/=build && ../configure --srcdir=.. --prefix=$$dc_install_base && $(MAKE) && $(MAKE) dvi && $(MAKE) check && $(MAKE) install && $(MAKE) installcheck && $(MAKE) dist
+ rm -rf $(distdir)
+ @echo "========================"; echo "$(distdir).tar.gz is ready for distribution"; echo "========================"
+dist: distdir
+ -chmod -R a+r $(distdir)
+ GZIP=$(GZIP) $(TAR) chozf $(distdir).tar.gz $(distdir)
+ rm -rf $(distdir)
+dist-all: distdir
+ -chmod -R a+r $(distdir)
+ GZIP=$(GZIP) $(TAR) chozf $(distdir).tar.gz $(distdir)
+ rm -rf $(distdir)
+distdir: $(DISTFILES)
+ rm -rf $(distdir)
+ mkdir $(distdir)
+ -chmod 777 $(distdir)
+ @for file in $(DISTFILES); do d=$(srcdir); test -f $(distdir)/$$file || ln $$d/$$file $(distdir)/$$file 2> /dev/null || cp -p $$d/$$file $(distdir)/$$file; done; for subdir in $(SUBDIRS); do test -d $(distdir)/$$subdir || mkdir $(distdir)/$$subdir || exit 1; chmod 777 $(distdir)/$$subdir; (cd $$subdir && $(MAKE) top_distdir=../$(top_distdir)/$$subdir distdir=../$(distdir)/$$subdir distdir) || exit 1; done
+ $(MAKE) top_distdir="$(top_distdir)" distdir="$(distdir)" dist-info
+ $(MAKE) top_distdir="$(top_distdir)" distdir="$(distdir)" dist-hook
+
+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
+ @:
+installcheck: installcheck-recursive
+all-recursive-am: config.h
+ $(MAKE) all-recursive
+
+all-am: Makefile $(PROGRAMS) config.h info
+
+install-exec-am: install-binPROGRAMS
+
+install-data-am: install-info-am
+
+uninstall-am: uninstall-binPROGRAMS uninstall-info
+
+install-exec: install-exec-recursive install-exec-am
+ @$(NORMAL_INSTALL)
+
+install-data: install-data-recursive install-data-am
+ @$(NORMAL_INSTALL)
+
+install-recursive uninstall-recursive:
+ @:
+
+install: install-recursive install-exec-am install-data-am
+ @:
+
+uninstall: uninstall-recursive uninstall-am
+
+all: all-recursive-am all-am
+
+install-strip:
+ $(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' INSTALL_SCRIPT='$(INSTALL_PROGRAM)' install
+installdirs: installdirs-recursive
+ $(mkinstalldirs) $(bindir) $(infodir)
+
+
+mostlyclean-generic:
+ -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES)
+
+clean-generic:
+ -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
+
+distclean-generic:
+ -rm -f Makefile $(DISTCLEANFILES)
+ -rm -f config.cache config.log stamp-h stamp-h[0-9]*
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+ -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
+ -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
+mostlyclean-am: mostlyclean-hdr mostlyclean-binPROGRAMS mostlyclean-compile mostlyclean-aminfo mostlyclean-tags mostlyclean-generic
+
+clean-am: clean-hdr clean-binPROGRAMS clean-compile clean-aminfo clean-tags clean-generic mostlyclean-am
+
+distclean-am: distclean-hdr distclean-binPROGRAMS distclean-compile distclean-aminfo distclean-tags distclean-generic clean-am
+
+maintainer-clean-am: maintainer-clean-hdr maintainer-clean-binPROGRAMS maintainer-clean-compile maintainer-clean-aminfo maintainer-clean-tags maintainer-clean-generic distclean-am
+
+mostlyclean: mostlyclean-recursive mostlyclean-am
+
+clean: clean-noinstLIBRARIES clean-recursive clean-am
+
+distclean: distclean-recursive distclean-am
+ rm -f config.status
+
+maintainer-clean: maintainer-clean-recursive maintainer-clean-am
+ @echo "This command is intended for maintainers to use;"
+ @echo "it deletes files that may require special tools to rebuild."
+ rm -f config.status
+
+.PHONY: default mostlyclean-hdr distclean-hdr clean-hdr \
+maintainer-clean-hdr mostlyclean-binPROGRAMS distclean-binPROGRAMS \
+clean-binPROGRAMS maintainer-clean-binPROGRAMS uninstall-binPROGRAMS \
+install-binPROGRAMS mostlyclean-compile distclean-compile clean-compile \
+maintainer-clean-compile install-info-am uninstall-info \
+mostlyclean-aminfo distclean-aminfo clean-aminfo \
+maintainer-clean-aminfo install-data-recursive uninstall-data-recursive \
+install-exec-recursive uninstall-exec-recursive installdirs-recursive \
+uninstalldirs-recursive all-recursive check-recursive check-am \
+installcheck-recursive info-recursive dvi-recursive \
+mostlyclean-recursive distclean-recursive clean-recursive \
+maintainer-clean-recursive tags tags-recursive mostlyclean-tags \
+distclean-tags clean-tags maintainer-clean-tags distdir \
+mostlyclean-depend distclean-depend clean-depend \
+maintainer-clean-depend info dvi check-local installcheck \
+all-recursive-am all-am install-exec-am install-data-am uninstall-am \
+install-exec install-data install uninstall all installdirs \
+mostlyclean-generic distclean-generic clean-generic \
+maintainer-clean-generic clean mostlyclean distclean maintainer-clean \
+html
+
+
+# --------------- Local DIST Section
+
+# Install the w32 subdirectory
+#
+dist-hook:
+ (cd $(srcdir); \
+ w32=`find w32 -follow \( -name .git -prune \) -o -type f -print`; \
+ tar chf - $$w32) \
+ | (cd $(distdir); tar xfBp -)
+
+# --------------- Local CHECK Section
+
+# Note: check-loadavg is NOT a prerequisite of check-local, since
+# there's no uptime utility, and the test it does doesn't make sense
+# on MSDOS anyway.
+check-local: check-shell check-regression
+ @banner=" Regression PASSED: GNU Make $(VERSION) ($(MAKE_HOST)) built with $(CC) "; \
+ dashes=`echo "$$banner" | sed s/./=/g`; \
+ echo; \
+ echo "$$dashes"; \
+ echo "$$banner"; \
+ echo "$$dashes"; \
+ echo
+
+.PHONY: check-loadavg check-shell check-regression
+
+# > check-shell
+#
+# check-shell is designed to fail if they don't have a Unixy shell
+# installed. The test suite requires such a shell.
+check-shell:
+ @echo If Make says Error -1, you do not have Unix-style shell installed
+ @foo=bar.exe :
+
+# > check-loadavg
+#
+loadavg: loadavg.c config.h
+ @rm -f loadavg
+ $(LINK) -DTEST $(make_LDFLAGS) loadavg.c $(LIBS)
+# We copy getloadavg.c into a different file rather than compiling it
+# directly because some compilers clobber getloadavg.o in the process.
+loadavg.c: getloadavg.c
+ ln $(srcdir)/getloadavg.c loadavg.c || \
+ cp $(srcdir)/getloadavg.c loadavg.c
+check-loadavg: loadavg
+ @echo The system uptime program believes the load average to be:
+ -uptime
+ @echo The GNU load average checking code believes:
+ -./loadavg
+
+# > check-regression
+#
+# Look for the make test suite, and run it if found. Look in MAKE_TEST if
+# specified, or else in the srcdir or the distdir, their parents, and _their_
+# parents.
+#
+check-regression:
+ @if test -f "$(srcdir)/tests/run_make_tests"; then \
+ if $(PERL) -v >/dev/null 2>&1; then \
+ case `cd $(srcdir); pwd` in `pwd`) : ;; \
+ *) test -d tests || mkdir tests; \
+ for f in run_make_tests run_make_tests.pl test_driver.pl scripts; do \
+ rm -rf tests/$$f; cp -pr $(srcdir)/tests/$$f tests; \
+ done ;; \
+ esac; \
+ echo "cd tests && $(PERL) ./run_make_tests.pl -make ../make.exe $(MAKETESTFLAGS)"; \
+ cd tests && $(PERL) ./run_make_tests.pl -make ../make.exe $(MAKETESTFLAGS); \
+ else \
+ echo "Can't find a working Perl ($(PERL)); the test suite requires Perl."; \
+ fi; \
+ else \
+ echo "Can't find the GNU Make test suite ($(srcdir)/tests)."; \
+ fi
+
+# --------------- Maintainer's Section
+
+# Note this requires GNU make. Not to worry, since it will only be included
+# in the Makefile if we're in the maintainer's environment.
+#include $(srcdir)/maintMakefile
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
+
+# --------------- DEPENDENCIES
diff --git a/Makefile.am b/Makefile.am
index 204ab320..c88c465e 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,6 +1,6 @@
# This is a -*-Makefile-*-, or close enough
#
-# Copyright (C) 1997-2014 Free Software Foundation, Inc.
+# Copyright (C) 1997-2016 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
@@ -16,8 +16,8 @@
# You should have received a copy of the GNU General Public License along with
# this program. If not, see <http://www.gnu.org/licenses/>.
-AUTOMAKE_OPTIONS = 1.8 dist-bzip2 check-news
-ACLOCAL_AMFLAGS = -I config
+AUTOMAKE_OPTIONS = dist-bzip2 silent-rules std-options
+ACLOCAL_AMFLAGS = -I config
MAKE_HOST = @MAKE_HOST@
@@ -26,6 +26,9 @@ if WINDOWSENV
MAYBE_W32 = w32
W32INC = -I $(top_srcdir)/w32/include
W32LIB = -Lw32 -lw32
+ ossrc =
+else
+ ossrc = posixos.c
endif
SUBDIRS = glob config po doc $(MAYBE_W32)
@@ -41,14 +44,14 @@ endif
make_SOURCES = ar.c arscan.c commands.c default.c dir.c expand.c file.c \
function.c getopt.c getopt1.c guile.c implicit.c job.c load.c \
- loadapi.c main.c misc.c output.c read.c remake.c rule.c \
- signame.c strcache.c variable.c version.c vpath.c hash.c \
- $(remote)
+ loadapi.c main.c misc.c $(ossrc) output.c read.c remake.c \
+ rule.c signame.c strcache.c variable.c version.c vpath.c \
+ hash.c $(remote)
EXTRA_make_SOURCES = vmsjobs.c remote-stub.c remote-cstms.c
noinst_HEADERS = commands.h dep.h filedef.h job.h makeint.h rule.h variable.h \
- debug.h getopt.h gettext.h hash.h output.h
+ debug.h getopt.h gettext.h hash.h output.h os.h
make_LDADD = @LIBOBJS@ @ALLOCA@ $(GLOBLIB) @GETLOADAVG_LIBS@ @LIBINTL@ \
$(GUILE_LIBS)
@@ -71,7 +74,7 @@ endif
# Extra stuff to include in the distribution.
-EXTRA_DIST = README build.sh.in $(man_MANS) \
+EXTRA_DIST = ChangeLog README build.sh.in $(man_MANS) \
README.customs README.OS2 \
SCOPTIONS SMakefile \
README.Amiga Makefile.ami config.ami make.lnk amiga.c amiga.h \
@@ -79,7 +82,8 @@ EXTRA_DIST = README build.sh.in $(man_MANS) \
README.W32 NMakefile config.h.W32 build_w32.bat subproc.bat \
make_msvc_net2003.sln make_msvc_net2003.vcproj \
README.VMS makefile.vms makefile.com config.h-vms \
- vmsdir.h vmsfunctions.c vmsify.c \
+ vmsdir.h vmsfunctions.c vmsify.c vms_exit.c vms_progname.c \
+ vms_export_symbol.c vms_export_symbol_test.com \
gmk-default.scm gmk-default.h
# This is built during configure, but behind configure's back
@@ -125,8 +129,8 @@ guile.$(OBJEXT): gmk-default.h
gmk-default.h: $(srcdir)/gmk-default.scm
(echo 'static const char *const GUILE_module_defn = " '\\ \
&& sed -e 's/;.*//' -e '/^[ \t]*$$/d' -e 's/"/\\"/g' -e 's/$$/ \\/' \
- $(srcdir)/gmk-default.scm \
- && echo '";') > $@
+ $(srcdir)/gmk-default.scm \
+ && echo '";') > $@
# --------------- Local DIST Section
@@ -174,6 +178,7 @@ MAKETESTFLAGS =
check-regression: tests/config-flags.pm
@if test -f '$(srcdir)/tests/run_make_tests'; then \
+ ulimit -n 128; \
if $(PERL) -v >/dev/null 2>&1; then \
case `cd '$(srcdir)'; pwd` in `pwd`) : ;; \
*) test -d tests || mkdir tests; \
@@ -188,9 +193,9 @@ check-regression: tests/config-flags.pm
else \
echo "Can't find a working Perl ($(PERL)); the test suite requires Perl."; \
fi; \
- else \
+ else \
echo "Can't find the GNU Make test suite ($(srcdir)/tests)."; \
- fi
+ fi
# --------------- Maintainer's Section
diff --git a/Makefile.ami b/Makefile.ami
index 7c561a32..39a9788e 100644
--- a/Makefile.ami
+++ b/Makefile.ami
@@ -3,7 +3,7 @@
# NOTE: If you have no 'make' program at all to process this makefile, run
# 'build.sh' instead.
#
-# Copyright (C) 1995-2014 Free Software Foundation, Inc.
+# Copyright (C) 1995-2016 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
diff --git a/NEWS b/NEWS
index 7e11787e..0b042456 100644
--- a/NEWS
+++ b/NEWS
@@ -1,6 +1,6 @@
GNU make NEWS -*-indented-text-*-
History of user-visible changes.
- 05 Oct 2014
+ 10 June 2016
See the end of this file for copyrights and conditions.
@@ -9,6 +9,54 @@ manual, which is contained in this distribution as the file doc/make.texi.
See the README file and the GNU make manual for instructions for
reporting bugs.
+Version 4.2.1 (10 Jun 2016)
+
+A complete list of bugs fixed in this version is available here:
+h
+ttp://sv.gnu.org/bugs/index.php?group=make&report_id=111&fix_release_id=107&set=custom
+
+This release is a bug-fix release.
+
+
+Version 4.2 (22 May 2016)
+
+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=106&set=custom
+
+* New variable: $(.SHELLSTATUS) is set to the exit status of the last != or
+ $(shell ...) function invoked in this instance of make. This will be "0" if
+ successful or not "0" if not successful. The variable value is unset if no
+ != or $(shell ...) function has been invoked.
+
+* The $(file ...) function can now read from a file with $(file <FILE).
+ The function is expanded to the contents of the file. The contents are
+ expanded verbatim except that the final newline, if any, is stripped.
+
+* The makefile line numbers shown by GNU make now point directly to the
+ specific line in the recipe where the failure or warning occurred.
+ Sample changes suggested by Brian Vandenberg <phantall@gmail.com>
+
+* The interface to GNU make's "jobserver" is stable as documented in the
+ manual, for tools which may want to access it.
+
+ WARNING: Backward-incompatibility! The internal-only command line option
+ --jobserver-fds has been renamed for publishing, to --jobserver-auth.
+
+* The amount of parallelism can be determined by querying MAKEFLAGS, even when
+ the job server is enabled (previously MAKEFLAGS would always contain only
+ "-j", with no number, when job server was enabled).
+
+* VMS-specific changes:
+
+ * Perl test harness now works.
+
+ * Full support for converting Unix exit status codes to VMS exit status
+ codes. BACKWARD INCOMPATIBILITY Notice: On a child failure the VMS exit
+ code is now the encoded Unix exit status that Make usually generates, not
+ the VMS exit status of the child.
+
+
Version 4.1 (05 Oct 2014)
A complete list of bugs fixed in this version is available here:
@@ -29,6 +77,33 @@ http://sv.gnu.org/bugs/index.php?group=make&report_id=111&fix_release_id=105&set
make. Makefiles that rely on this syntax should be fixed.
See https://savannah.gnu.org/bugs/?33034
+* VMS-specific changes:
+
+ * Support for library files added, including support for using the GNV ar
+ utility.
+
+ * Partial support for properly encoding Unix exit status codes into VMS exit
+ status codes.
+
+ WARNING: Backward-incompatibility! These are different exit status codes
+ than Make exited with in the past.
+
+ * Macros to hold the current make command are set up to translate the
+ argv[0] string to a VMS format path name and prefix it with "MCR " so that
+ the macro has a space in it.
+
+ WARNING: Backward-incompatibility! This may break complex makefiles that
+ do processing on those macros. This is unlikely because so much in that
+ area was not and is still not currently working on VMS, it is unlikely to
+ find such a complex makefile, so this is more likely to impact
+ construction of a future makefile.
+
+ * A command file is always used to run the commands for a recipe.
+
+ WARNING: Backward-incompatibility! Running the make self tests has
+ exposed that there are significant differences in behavior when running
+ with the command file mode. It is unknown if this will be noticed by most
+ existing VMS makefiles.
Version 4.0 (09 Oct 2013)
@@ -237,6 +312,57 @@ http://sv.gnu.org/bugs/index.php?group=make&report_id=111&fix_release_id=104&set
after the variable name, to allow for simple, conditional, or appending
multi-line variable assignment.
+* VMS-specific changes:
+
+ * 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.
+
+ * 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. The CtrlY handler now uses $delprc to
+ delete all children. This way also actions with DCL commands will be
+ stopped. As before the CtrlY handler then sends SIGQUIT to itself,
+ which is handled in common code.
+
+ * Change in deleteing temporary command files. Temporary command files
+ are now deleted in the vms child termination handler. That deletes
+ 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.
+
Version 3.81 (01 Apr 2006)
@@ -456,6 +582,42 @@ Version 3.80 (03 Oct 2002)
* Updated to autoconf 2.54 and automake 1.7. Users should not be impacted.
+* VMS-specific changes:
+
+ * In default.c define variable ARCH as IA64 for VMS on Itanium systems.
+
+ * In makefile.vms avoid name collision for glob and globfree.
+
+ * This is the VMS port of GNU Make done by Hartmut.Becker@compaq.com.
+
+ It is based on the specific version 3.77k and on 3.78.1. 3.77k was done
+ by Klaus Kämpf <kkaempf@rmi.de>, the code was based on the VMS port of
+ GNU Make 3.60 by Mike Moretti.
+
+ It was ported on OpenVMS/Alpha V7.1, DECC V5.7-006. It was re-build and
+ tested on OpenVMS/Alpha V7.2, OpenVMS/VAX 7.1 and 5.5-2. Different
+ versions of DECC were used. VAXC was tried: it fails; but it doesn't
+ seem worth to get it working. There are still some PTRMISMATCH warnings
+ during the compile. Although perl is working on VMS the test scripts
+ don't work. The function $shell is still missing.
+
+ There is a known bug in some of the VMS CRTLs. It is in the shipped
+ versions of VMS V7.2 and V7.2-1 and in the currently (October 1999)
+ available ECOs for VMS V7.1 and newer versions. It is fixed in versions
+ shipped with newer VMS versions and all ECO kits after October 1999. It
+ only shows up during the daylight saving time period (DST): stat()
+ returns a modification time 1 hour ahead. This results in GNU make
+ warning messages. For a just created source you will see:
+
+ $ gmake x.exe
+ gmake.exe;1: *** Warning: File 'x.c' has modification time in the future
+ (940582863 > 940579269)
+ cc /obj=x.obj x.c
+ link x.obj /exe=x.exe
+ gmake.exe;1: *** Warning: Clock skew detected. Your build may be
+ incomplete.
+
+
A complete list of bugs fixed in this version is available here:
http://savannah.gnu.org/bugs/index.php?group=make&report_id=111&fix_release_id=102
@@ -512,6 +674,56 @@ Version 3.79 (04 Apr 2000)
* Hartmut Becker provided many updates for the VMS port of GNU make.
See the README.VMS file for more details.
+
+* VMS-specific changes:
+
+ * Fix a problem with automatically remaking makefiles. GNU make uses an
+ execve to restart itself after a successful remake of the makefile. On
+ UNIX systems execve replaces the running program with a new one and
+ resets all signal handling to the default. On VMS execve creates a child
+ process, signal and exit handlers of the parent are still active, and,
+ unfortunately, corrupt the exit code from the child. Fix in job.c:
+ ignore SIGCHLD.
+
+ * Added some switches to reflect latest features of DECC. Modifications in
+ makefile.vms.
+
+ * Set some definitions to reflect latest features of DECC. Modifications in
+ config.h-vms (which is copied to config.h).
+
+ * Added extern strcmpi declaration to avoid 'implicitly declared' messages.
+ Modification in make.h.
+
+ * Default rule for C++, conditionals for gcc (GCC_IS_NATIVE) or DEC/Digital/
+ Compaq c/c++ compilers. Modifications in default.c.
+
+ * Usage of opendir() and friends, suppress file version. Modifications in
+ dir.c.
+
+ * Added VMS specific code to handle ctrl+c and ctrl+y to abort make.
+ Modifications in job.c.
+
+ * Added support to have case sensitive targets and dependencies but to
+ still use case blind file names. This is especially useful for Java
+ makefiles on VMS:
+
+ .SUFFIXES :
+ .SUFFIXES : .class .java
+ .java.class :
+ javac "$<
+ HelloWorld.class : HelloWorld.java
+
+ * A new macro WANT_CASE_SENSITIVE_TARGETS in config.h-vms was introduced.
+ It needs to be enabled to get this feature; default is disabled. The
+ macro HAVE_CASE_INSENSITIVE_FS must not be touched: it is still enabled.
+ Modifications in file.c and config.h-vms.
+
+ * Bootstrap make to start building make is still makefile.com, but make
+ needs to be re-made with a make to make a correct version: ignore all
+ possible warnings, delete all objects, rename make.exe to a different
+ name and run it.
+
+ * Made some minor modifications to the bootstrap build makefile.com.
Version 3.78 (22 Sep 1999)
@@ -614,6 +826,45 @@ Version 3.77 (28 Jul 1998)
* Updates to the Windows 95/NT port from Rob Tulloh (see README.W32),
and to the DOS port from Eli Zaretski (see README.DOS).
+
+* VMS-specific changes:
+
+ * This is the VMS port of GNU Make.
+ It is based on the VMS port of GNU Make 3.60 by Mike Moretti.
+ This port was done by Klaus Kämpf <kkaempf@rmi.de>
+
+ * There is first-level support available from proGIS Software, Germany.
+ Visit their web-site at http://www.progis.de to get information
+ about other vms software and forthcoming updates to gnu make.
+
+ * /bin/sh style I/O redirection is supported. You can now write lines like
+ mcr sys$disk:[]program.exe < input.txt > output.txt &> error.txt
+
+ * Makefile variables are looked up in the current environment. You can set
+ symbols or logicals in DCL and evaluate them in the Makefile via
+ $(<name-of-symbol-or-logical>). Variables defined in the Makefile
+ override VMS symbols/logicals !
+
+ * Functions for file names are working now. See the GNU Make manual for
+ $(dir ...) and $(wildcard ...). Unix-style and VMS-style names are
+ supported as arguments.
+
+ * The default rules are set up for GNU C. Building an executable from a
+ single source file is as easy as 'make file.exe'.
+
+ * The variable $(ARCH) is predefined as ALPHA or VAX resp. Makefiles for
+ different VMS systems can now be written by checking $(ARCH) as in
+ ifeq ($(ARCH),ALPHA)
+ $(ECHO) "On the Alpha"
+ else
+ $(ECHO) "On the VAX"
+ endif
+
+ * Command lines of excessive length are correctly broken and written to a
+ batch file in sys$scratch for later execution. There's no limit to the
+ lengths of commands (and no need for .opt files :-) any more.
+
+ * Empty commands are handled correctly and don't end in a new DCL process.
Version 3.76.1 (19 Sep 1997)
@@ -662,8 +913,54 @@ Version 3.76 (16 Sep 1997)
concerning this port to Eli Zaretskii <eliz@is.elta.co.il> or DJ
Delorie <dj@delorie.com>.
-* John W. Eaton has updated the VMS port to support libraries and VPATH.
-
+* VMS-specific changes:
+
+ * John W. Eaton has updated the VMS port to support libraries and VPATH.
+
+ * The cd command is supported if it's called as $(CD). This invokes
+ the 'builtin_cd' command which changes the directory.
+ Calling 'set def' doesn't do the trick, since a sub-shell is
+ spawned for this command, the directory is changed *in this sub-shell*
+ and the sub-shell ends.
+
+ * Libraries are not supported. They were in GNU Make 3.60 but somehow I
+ didn't care porting the code. If there is enough interest, I'll do it at
+ some later time.
+
+ * The variable $^ separates files with commas instead of spaces (It's the
+ natural thing to do for VMS).
+
+ * See defaults.c for VMS default suffixes and my definitions for default
+ rules and variables.
+
+ * The shell function is not implemented yet.
+
+ * Load average routines haven't been implemented for VMS yet.
+
+ * The default include directory for including other makefiles is
+ SYS$SYSROOT:[SYSLIB] (I don't remember why I didn't just use
+ SYS$LIBRARY: instead; maybe it wouldn't work that way).
+
+ * The default makefiles make looks for are: makefile.vms, gnumakefile,
+ makefile., and gnumakefile. .
+
+ * The stat() function and handling of time stamps in VMS is broken, so I
+ replaced it with a hack in vmsfunctions.c. I will provide a full rewrite
+ somewhere in the future. Be warned, the time resolution inside make is
+ less than what vms provides. This might be a problem on the faster Alphas.
+
+ * You can use a : in a filename only if you precede it with a backslash ('\').
+ E.g.- hobbes\:[bogas.files]
+
+ * Make ignores success, informational, or warning errors (-S-, -I-, or -W-).
+ But it will stop on -E- and -F- errors. (unless you do something
+ to override this in your makefile, or whatever).
+
+ * Remote stuff isn't implemented yet.
+
+ * Multiple line DCL commands, such as "if" statements, must be put inside
+ command files. You can run a command file by using \@.
+
Version 3.75 (27 Aug 1996)
* The directory messages printed by `-w' and implicitly in sub-makes,
@@ -684,6 +981,14 @@ Version 3.75 (27 Aug 1996)
* Rob Tulloh of Tivoli Systems has contributed a port to Windows NT or 95.
See README.W32 for details, and direct all Windows-related questions to
<rob_tulloh@tivoli.com>.
+
+* VMS-specific changes:
+
+ * Lots of default settings are adapted for VMS. See default.c.
+
+ * Long command lines are now converted to command files.
+
+ * Comma (',') as a separator is now allowed. See makefile.vms for an example.
Version 3.73 (05 Apr 1995)
@@ -1219,7 +1524,7 @@ Version 3.05
(Changes from versions 1 through 3.05 were never recorded. Sorry.)
-------------------------------------------------------------------------------
-Copyright (C) 1988-2014 Free Software Foundation, Inc.
+Copyright (C) 1988-2016 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
diff --git a/NMakefile.template b/NMakefile.template
new file mode 100644
index 00000000..2007a3b5
--- /dev/null
+++ b/NMakefile.template
@@ -0,0 +1,132 @@
+# -*-Makefile-*- to build GNU make with nmake
+#
+# NOTE: If you have no 'make' program at all to process this makefile,
+# run 'build_w32.bat' instead.
+#
+# Copyright (C) 1996-2016 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 terms of the GNU General Public License as published by the Free Software
+# Foundation; either version 3 of the License, or (at your option) any later
+# version.
+#
+# GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+# details.
+#
+# You should have received a copy of the GNU General Public License along with
+# this program. If not, see <http://www.gnu.org/licenses/>.
+
+LINK = link
+CC = cl
+MAKE = nmake
+
+OUTDIR=.
+MAKEFILE=NMakefile
+SUBPROC_MAKEFILE=NMakefile
+
+CFLAGS_any = /nologo /MT /W4 /GX /Zi /YX /I . /I glob /I w32/include /D WIN32 /D WINDOWS32 /D _CONSOLE /D HAVE_CONFIG_H
+CFLAGS_debug = $(CFLAGS_any) /Od /D DEBUG /D _DEBUG /FR.\WinDebug/ /Fp.\WinDebug/make.pch /Fo.\WinDebug/ /Fd.\WinDebug/make.pdb
+CFLAGS_release = $(CFLAGS_any) /O2 /D NDEBUG /FR.\WinRel/ /Fp.\WinRel/make.pch /Fo.\WinRel/
+
+LDFLAGS_debug = w32\subproc\WinDebug\subproc.lib /NOLOGO /SUBSYSTEM:console\
+ /STACK:0x400000 /INCREMENTAL:no /PDB:WinDebug/make.pdb /OUT:WinDebug/make.exe /DEBUG
+LDFLAGS_release = w32\subproc\WinRel\subproc.lib /NOLOGO /SUBSYSTEM:console\
+ /STACK:0x400000 /INCREMENTAL:no /OUT:WinRel/make.exe
+
+all: config.h subproc Release Debug
+
+#
+# Make sure we build the subproc library first. It has it's own
+# makefile. To be portable to Windows 95, we put the instructions
+# on how to build the library into a batch file. On NT, we could
+# simply have done foo && bar && dog, but this doesn't port.
+#
+subproc: w32/subproc/WinDebug/subproc.lib w32/subproc/WinRel/subproc.lib
+
+w32/subproc/WinDebug/subproc.lib w32/subproc/WinRel/subproc.lib: w32/subproc/misc.c w32/subproc/sub_proc.c w32/subproc/w32err.c
+ subproc.bat $(SUBPROC_MAKEFILE) $(MAKE)
+ if exist WinDebug\make.exe erase WinDebug\make.exe
+ if exist WinRel\make.exe erase WinRel\make.exe
+
+config.h: config.h.W32
+ copy $? $@
+
+Release:
+ $(MAKE) /f $(MAKEFILE) LDFLAGS="$(LDFLAGS_release)" CFLAGS="$(CFLAGS_release)" OUTDIR=WinRel WinRel/make.exe
+Debug:
+ $(MAKE) /f $(MAKEFILE) LDFLAGS="$(LDFLAGS_debug)" CFLAGS="$(CFLAGS_debug)" OUTDIR=WinDebug WinDebug/make.exe
+
+clean:
+ if exist WinDebug\nul rmdir /s /q WinDebug
+ if exist WinRel\nul rmdir /s /q WinRel
+ if exist w32\subproc\WinDebug\nul rmdir /s /q w32\subproc\WinDebug
+ if exist w32\subproc\WinRel\nul rmdir /s /q w32\subproc\WinRel
+ if exist config.h erase config.h
+ erase *.pdb
+
+$(OUTDIR):
+ if not exist .\$@\nul mkdir .\$@
+
+LIBS = kernel32.lib user32.lib advapi32.lib
+
+guile = $(OUTDIR)/guile.obj
+
+OBJS = \
+ $(OUTDIR)/ar.obj \
+ $(OUTDIR)/arscan.obj \
+ $(OUTDIR)/commands.obj \
+ $(OUTDIR)/default.obj \
+ $(OUTDIR)/dir.obj \
+ $(OUTDIR)/expand.obj \
+ $(OUTDIR)/file.obj \
+ $(OUTDIR)/function.obj \
+ $(OUTDIR)/getloadavg.obj \
+ $(OUTDIR)/getopt.obj \
+ $(OUTDIR)/getopt1.obj \
+ $(OUTDIR)/hash.obj \
+ $(OUTDIR)/implicit.obj \
+ $(OUTDIR)/job.obj \
+ $(OUTDIR)/load.obj \
+ $(OUTDIR)/main.obj \
+ $(OUTDIR)/misc.obj \
+ $(OUTDIR)/output.obj \
+ $(OUTDIR)/read.obj \
+ $(OUTDIR)/remake.obj \
+ $(OUTDIR)/remote-stub.obj \
+ $(OUTDIR)/rule.obj \
+ $(OUTDIR)/signame.obj \
+ $(OUTDIR)/strcache.obj \
+ $(OUTDIR)/variable.obj \
+ $(OUTDIR)/version.obj \
+ $(OUTDIR)/vpath.obj \
+ $(OUTDIR)/glob.obj \
+ $(OUTDIR)/fnmatch.obj \
+ $(OUTDIR)/dirent.obj \
+ $(OUTDIR)/pathstuff.obj \
+ $(OUTDIR)/posixfcn.obj \
+ $(OUTDIR)/w32os.obj \
+ $(guile)
+
+$(OUTDIR)/make.exe: $(OUTDIR) $(OBJS)
+ $(LINK) @<<
+ $(LDFLAGS) $(LIBS) $(OBJS)
+<<
+
+.c{$(OUTDIR)}.obj:
+ $(CC) $(CFLAGS) /c $<
+
+$(OUTDIR)/glob.obj : glob/glob.c
+ $(CC) $(CFLAGS) /c $?
+$(OUTDIR)/fnmatch.obj : glob/fnmatch.c
+ $(CC) $(CFLAGS) /c $?
+$(OUTDIR)/dirent.obj : w32/compat/dirent.c
+ $(CC) $(CFLAGS) /c $?
+$(OUTDIR)/posixfcn.obj : w32/compat/posixfcn.c
+ $(CC) $(CFLAGS) /c $?
+$(OUTDIR)/pathstuff.obj : w32/pathstuff.c
+ $(CC) $(CFLAGS) /c $?
+$(OUTDIR)/w32os.obj : w32/w32os.c
+ $(CC) $(CFLAGS) /c $?
diff --git a/README.Amiga b/README.Amiga
index f9be3484..68d3ea74 100644
--- a/README.Amiga
+++ b/README.Amiga
@@ -61,7 +61,7 @@ If you plan to use recursive makes, install make resident:
-------------------------------------------------------------------------------
-Copyright (C) 1995-2014 Free Software Foundation, Inc.
+Copyright (C) 1995-2016 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
diff --git a/README.DOS.template b/README.DOS.template
new file mode 100644
index 00000000..bc31adb9
--- /dev/null
+++ b/README.DOS.template
@@ -0,0 +1,340 @@
+Port of GNU Make to 32-bit protected mode on MSDOS and MS-Windows.
+
+Builds with DJGPP v2 port of GNU C/C++ compiler and utilities.
+
+
+New (since 3.74) DOS-specific features:
+
+ 1. Supports long filenames when run from DOS box on Windows 9x.
+
+ 2. Supports both stock DOS COMMAND.COM and Unix-style shells
+ (details in 'Notes' below).
+
+ 3. Supports DOS drive letters in dependencies and pattern rules.
+
+ 4. Better support for DOS-style backslashes in pathnames (but see
+ 'Notes' below).
+
+ 5. The $(shell) built-in can run arbitrary complex commands,
+ including pipes and redirection, even when COMMAND.COM is your
+ shell.
+
+ 6. Can be built without floating-point code (see below).
+
+ 7. Supports signals in child programs and restores the original
+ directory if the child was interrupted.
+
+ 8. Can be built without (a previous version of) Make.
+
+ 9. The build process requires only standard tools. (Optional
+ targets like "install:" and "clean:" still need additional
+ programs, though, see below.)
+
+ 10. Beginning with v3.78, the test suite works in the DJGPP
+ environment (requires Perl and auxiliary tools; see below).
+
+
+To install a binary distribution:
+
+ Simply unzip the makNNNb.zip file (where NNN is the version number)
+ preserving the directory structure (-d switch if you use PKUNZIP).
+ If you are installing Make on Windows 9X or Windows 2000, use an
+ unzip program that supports long filenames in zip files. After
+ unzipping, make sure the directory with make.exe is on your PATH,
+ and that's all you need to use Make.
+
+
+To build from sources:
+
+ 1. Unzip the archive, preserving the directory structure (-d switch
+ if you use PKUNZIP). If you build Make on Windows 9X or Windows
+ 2000, use an unzip program that supports long filenames in zip
+ files.
+
+ If you are unpacking an official GNU source distribution, use
+ either DJTAR (which is part of the DJGPP development
+ environment), or the DJGPP port of GNU Tar.
+
+ 2. Invoke the 'configure.bat' batch file.
+
+ If you are building Make in-place, i.e. in the same directory
+ where its sources are kept, just type "configure.bat" and press
+ [Enter]. Otherwise, you need to supply the path to the source
+ directory as an argument to the batch file, like this:
+
+ c:\djgpp\gnu\make-%VERSION%\configure.bat c:/djgpp/gnu/make-%VERSION%
+
+ Note the forward slashes in the source path argument: you MUST
+ use them here.
+
+ 3. If configure.bat doesn't find a working Make, it will suggest to
+ use the 'dosbuild.bat' batch file to build Make. Either do as it
+ suggests or install another Make program (a pre-compiled binary
+ should be available from the usual DJGPP sites) and rerun
+ configure.bat.
+
+ 4. If you will need to run Make on machines without an FPU, you
+ might consider building a version of Make which doesn't issue
+ floating-point instructions (they don't help much on MSDOS
+ anyway). To this end, edit the Makefile created by
+ configure.bat and add -DNO_FLOAT to the value of CPPFLAGS.
+
+ 5. Invoke Make.
+
+ If you are building from outside of the source directory, you
+ need to tell Make where the sources are, like this:
+
+ make srcdir=c:/djgpp/gnu/make-%VERSION%
+
+ (configure.bat will tell you this when it finishes). You MUST
+ use a full, not relative, name of the source directory here, or
+ else Make might fail.
+
+ 6. After Make finishes, if you have a Unix-style shell installed,
+ you can use the 'install' target to install the package. You
+ will also need GNU Fileutils and GNU Sed for this (they should
+ be available from the DJGPP sites).
+
+ By default, GNU make will install into your DJGPP installation
+ area. If you wish to use a different directory, override the
+ DESTDIR variable when invoking "make install", like this:
+
+ make install DESTDIR=c:/other/dir
+
+ This causes the make executable to be placed in c:/other/dir/bin,
+ the man pages in c:/other/dir/man, etc.
+
+ Without a Unix-style shell, you will have to install programs
+ and the docs manually. Copy make.exe to a directory on your
+ PATH, make.i* info files to your Info directory, and update the
+ file 'dir' in your Info directory by adding the following item
+ to the main menu:
+
+ * Make: (make.info). The GNU make utility.
+
+ If you have the 'install-info' program (from the GNU Texinfo
+ package), it will do that for you if you invoke it like this:
+
+ install-info --info-dir=c:/djgpp/info c:/djgpp/info/make.info
+
+ (If your Info directory is other than C:\DJGPP\INFO, change this
+ command accordingly.)
+
+ 7. The 'clean' targets also require Unix-style shell, and GNU Sed
+ and 'rm' programs (the latter from Fileutils).
+
+ 8. To run the test suite, type "make check". This requires a Unix
+ shell (I used the DJGPP port of Bash 2.03), Perl, Sed, Fileutils
+ and Sh-utils.
+
+
+Notes:
+-----
+
+ 1. The shell issue.
+
+ This is probably the most significant improvement, first
+ introduced in the port of GNU Make 3.75.
+
+ The original behavior of GNU Make is to invoke commands
+ directly, as long as they don't include characters special to
+ the shell or internal shell commands, because that is faster.
+ When shell features like redirection or filename wildcards are
+ involved, Make calls the shell.
+
+ This port supports both DOS shells (the stock COMMAND.COM and its
+ 4DOS/NDOS replacements), and Unix-style shells (tested with the
+ venerable Stewartson's 'ms_sh' 2.3 and the DJGPP port of 'bash' by
+ Daisuke Aoyama <jack@st.rim.or.jp>).
+
+ When the $SHELL variable points to a Unix-style shell, Make
+ works just like you'd expect on Unix, calling the shell for any
+ command that involves characters special to the shell or
+ internal shell commands. The only difference is that, since
+ there is no standard way to pass command lines longer than the
+ infamous DOS 126-character limit, this port of Make writes the
+ command line to a temporary disk file and then invokes the shell
+ on that file.
+
+ If $SHELL points to a DOS-style shell, however, Make will not
+ call it automatically, as it does with Unix shells. Stock
+ COMMAND.COM is too dumb and would unnecessarily limit the
+ functionality of Make. For example, you would not be able to
+ use long command lines in commands that use redirection or
+ pipes. Therefore, when presented with a DOS shell, this port of
+ Make will emulate most of the shell functionality, like
+ redirection and pipes, and shall only call the shell when a
+ batch file or a command internal to the shell is invoked. (Even
+ when a command is an internal shell command, Make will first
+ search the $PATH for it, so that if a Makefile calls 'mkdir',
+ you can install, say, a port of GNU 'mkdir' and have it called
+ in that case.)
+
+ The key to all this is the extended functionality of 'spawn' and
+ 'system' functions from the DJGPP library; this port just calls
+ 'system' where it would invoke the shell on Unix. The most
+ important aspect of these functions is that they use a special
+ mechanism to pass long (up to 16KB) command lines to DJGPP
+ programs. In addition, 'system' emulates some internal
+ commands, like 'cd' (so that you can now use forward slashes
+ with it, and can also change the drive if the directory is on
+ another drive). Another aspect worth mentioning is that you can
+ call Unix shell scripts directly, provided that the shell whose
+ name is mentioned on the first line of the script is installed
+ anywhere along the $PATH. It is impossible to tell here
+ everything about these functions; refer to the DJGPP library
+ reference for more details.
+
+ The $(shell) built-in is implemented in this port by calling
+ 'popen'. Since 'popen' calls 'system', the above considerations
+ are valid for $(shell) as well. In particular, you can put
+ arbitrary complex commands, including pipes and redirection,
+ inside $(shell), which is in many cases a valid substitute for
+ the Unix-style command substitution (`command`) feature.
+
+
+ 2. "SHELL=/bin/sh" -- or is it?
+
+ Many Unix Makefiles include a line which sets the SHELL, for
+ those versions of Make which don't have this as the default.
+ Since many DOS systems don't have 'sh' installed (in fact, most
+ of them don't even have a '/bin' directory), this port takes
+ such directives with a grain of salt. It will only honor such a
+ directive if the basename of the shell name (like 'sh' in the
+ above example) can indeed be found in the directory that is
+ mentioned in the SHELL= line ('/bin' in the above example), or
+ in the current working directory, or anywhere on the $PATH (in
+ that order). If the basename doesn't include a filename
+ extension, Make will look for any known extension that indicates
+ an executable file (.exe, .com, .bat, .btm, .sh, and even .sed
+ and .pl). If any such file is found, then $SHELL will be
+ defined to the exact pathname of that file, and that shell will
+ hence be used for the rest of processing. But if the named
+ shell is *not* found, the line which sets it will be effectively
+ ignored, leaving the value of $SHELL as it was before. Since a
+ lot of decisions that this port makes depend on the gender of
+ the shell, I feel it doesn't make any sense to tailor Make's
+ behavior to a shell which is nowhere to be found.
+
+ Note that the above special handling of "SHELL=" only happens
+ for Makefiles; if you set $SHELL in the environment or on the
+ Make command line, you are expected to give the complete
+ pathname of the shell, including the filename extension.
+
+ The default value of $SHELL is computed as on Unix (see the Make
+ manual for details), except that if $SHELL is not defined in the
+ environment, $COMSPEC is used. Also, if an environment variable
+ named $MAKESHELL is defined, it takes precedence over both
+ $COMSPEC and $SHELL. Note that, unlike Unix, $SHELL in the
+ environment *is* used to set the shell (since on MSDOS, it's
+ unlikely that the interactive shell will not be suitable for
+ Makefile processing).
+
+ The bottom line is that you can now write Makefiles where some
+ of the targets require a real (i.e. Unix-like) shell, which will
+ nevertheless work when such shell is not available (provided, of
+ course, that the commands which should always work, don't
+ require such a shell). More important, you can convert Unix
+ Makefiles to MSDOS and leave the line which sets the shell
+ intact, so that people who do have Unixy shell could use it for
+ targets which aren't converted to DOS (like 'install' and
+ 'uninstall', for example).
+
+
+ 3. Default directories.
+
+ GNU Make knows about standard directories where it searches for
+ library and include files mentioned in the Makefile. Since
+ MSDOS machines don't have standard places for these, this port
+ will search ${DJDIR}/lib and ${DJDIR}/include respectively.
+ $DJDIR is defined automatically by the DJGPP startup code as the
+ root of the DJGPP installation tree (unless you've tampered with
+ the DJGPP.ENV file). This should provide reasonable default
+ values, unless you moved parts of DJGPP to other directories.
+
+
+ 4. Letter-case in filenames.
+
+ If you run Make on Windows 9x, you should be aware of the
+ letter-case issue. Make is internally case-sensitive, but all
+ file operations are case-insensitive on Windows 9x, so
+ e.g. files 'FAQ', 'faq' and 'Faq' all refer to the same file, as
+ far as Windows is concerned. The underlying DJGPP C library
+ functions honor the letter-case of the filenames they get from
+ the OS, except that by default, they down-case 8+3 DOS filenames
+ which are stored in upper case in the directory and would break
+ many Makefiles otherwise. (The details of which filenames are
+ converted to lower case are explained in the DJGPP libc docs,
+ under the '_preserve_fncase' and '_lfn_gen_short_fname'
+ functions, but as a thumb rule, any filename that is stored in
+ upper case in the directory, is a valid DOS 8+3 filename and
+ doesn't include characters invalid on MSDOS FAT filesystems,
+ will be automatically down-cased.) User reports that I have
+ indicate that this default behavior is generally what you'd
+ expect; however, your input is most welcome.
+
+ In any case, if you hit a situation where you must force Make to
+ get the 8+3 DOS filenames in upper case, set FNCASE=y in the
+ environment or in the Makefile.
+
+
+ 5. DOS-style pathnames.
+
+ There are a lot of places throughout the program sources which
+ make implicit assumptions about the pathname syntax. In
+ particular, the directories are assumed to be separated by '/',
+ and any pathname which doesn't begin with a '/' is assumed to be
+ relative to the current directory. This port attempts to
+ support DOS-style pathnames which might include the drive letter
+ and use backslashes instead of forward slashes. However, this
+ support is not complete; I feel that pursuing this support too
+ far might break some more important features, particularly if
+ you use a Unix-style shell (where a backslash is a quote
+ character). I only consider support of backslashes desirable
+ because some Makefiles invoke non-DJGPP programs which don't
+ understand forward slashes. A notable example of such programs
+ is the standard programs which come with MSDOS. Otherwise, you
+ are advised to stay away from backslashes whenever possible. In
+ particular, filename globbing won't work on pathnames with
+ backslashes, because the GNU 'glob' library doesn't support them
+ (backslash is special in filename wildcards, and I didn't want
+ to break that).
+
+ One feature which *does* work with backslashes is the filename-
+ related built-in functions such as $(dir), $(notdir), etc.
+ Drive letters in pathnames are also fully supported.
+
+
+
+Bug reports:
+-----------
+
+ Bugs that are clearly related to the MSDOS/DJGPP port should be
+ reported first on the comp.os.msdos.djgpp news group (if you cannot
+ post to Usenet groups, write to the DJGPP mailing list,
+ <djgpp@delorie.com>, which is an email gateway into the above news
+ group). For other bugs, please follow the procedure explained in
+ the "Bugs" chapter of the Info docs. If you don't have an Info
+ reader, look up that chapter in the 'make.i1' file with any text
+ browser/editor.
+
+
+ Enjoy,
+ Eli Zaretskii <eliz@is.elta.co.il>
+
+
+-------------------------------------------------------------------------------
+Copyright (C) 1996-2016 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
+terms of the GNU General Public License as published by the Free Software
+Foundation; either version 3 of the License, or (at your option) any later
+version.
+
+GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License along with
+this program. If not, see <http://www.gnu.org/licenses/>.
diff --git a/README.OS2.template b/README.OS2.template
new file mode 100644
index 00000000..0ce81b44
--- /dev/null
+++ b/README.OS2.template
@@ -0,0 +1,176 @@
+Port of GNU make to OS/2.
+
+Features of GNU make that do not work under OS/2:
+ - remote job execution
+ - dynamic load balancing
+
+
+Special features of the OS/2 version:
+
+Due to the fact that some people might want to use sh syntax in
+Makefiles while others might want to use OS/2's native shell cmd.exe,
+GNU make supports both shell types. The following list defines the order
+that is used to determine the shell:
+
+ 1. The shell specified by the environment variable MAKESHELL.
+ 2. The shell specified by the SHELL variable within a Makefile. Like
+ Unix, SHELL is NOT taken from the environment.
+ 3. The shell specified by the COMSPEC environment variable.
+ 4. The shell specified by the OS2_SHELL environment variable.
+ 5. If none of the above is defined /bin/sh is used as default. This
+ happens e.g. in the make testsuite.
+
+Note: - Points 3 and 4 can be turned off at compile time by adding
+ -DNO_CMD_DEFAULT to the CPPFLAGS.
+ - DOS support is not tested for EMX and therefore might not work.
+ - The UNIXROOT environment variable is supported to find /bin/sh
+ if it is not on the current drive.
+
+
+COMPILATION OF GNU MAKE FOR OS/2:
+
+I. ***** SPECIAL OPTIONS *****
+
+ - At compile time you can turn off that cmd is used as default shell
+ (but only /bin/sh). Simply set CPPFLAGS="-DNO_CMD_DEFAULT" and make
+ will not use cmd unless you cause it to do so by setting MAKESHELL to
+ cmd or by specifying SHELL=cmd in your Makefile.
+
+ - At compile time you can set CPPFLAGS="-DNO_CHDIR2" to turn off that
+ GNU make prints drive letters. This is necessary if you want to run
+ the testsuite.
+
+
+II. ***** REQUIREMENTS FOR THE COMPILATION *****
+
+A standard Unix like build environment:
+
+ - sh compatible shell (ksh, bash, ash, but tested only with pdksh 5.2.14
+ release 2)
+ If you use pdksh it is recommended to update to 5.2.14 release 2. Older
+ versions may not work! You can get this version at
+ http://www.math.ohio-state.edu/~ilya/software/os2/pdksh-5.2.14-bin-2.zip
+ - GNU file utilities (make sure that install.exe from the file utilities
+ is in front of your PATH before X:\OS2\INSTALL\INSTALL.EXE. I recommend
+ also to change the filename to ginstall.exe instead of install.exe
+ to avoid confusion with X:\OS2\INSTALL\INSTALL.EXE)
+ - GNU shell utilities
+ - GNU text utilities
+ - gawk
+ - grep
+ - sed
+ - GNU make 3.79.1 (special OS/2 patched version) or higher
+ - perl 5.005 or higher
+ - GNU texinfo (you can use 3.1 (gnuinfo.zip), but I recommend 4.0)
+
+If you want to recreate the configuration files (developers only!)
+you need also: GNU m4 1.4, autoconf 2.59, automake 1.9.6 (or compatible)
+
+
+III. ***** COMPILATION AND INSTALLATION *****
+
+ a) ** Developers only - Everyone else should skip this section **
+ To recreate the configuration files use:
+
+ export EMXSHELL=ksh
+ aclocal -I config
+ automake
+ autoconf
+ autoheader
+
+
+b) Installation into x:/usr
+
+ Note: Although it is possible to compile make using "./configure",
+ "make", "make install" this is not recommended. In particular,
+ you must ALWAYS use LDFLAGS="-Zstack 0x6000" because the default
+ stack size is far to small and make will not work properly!
+
+Recommended environment variables and installation options:
+
+ export ac_executable_extensions=".exe"
+ export CPPFLAGS="-D__ST_MT_ERRNO__"
+ export CFLAGS="-O2 -Zomf -Zmt"
+ export LDFLAGS="-Zcrtdll -Zlinker /exepack:2 -Zlinker /pm:vio -Zstack 0x6000"
+ export RANLIB="echo"
+ ./configure --prefix=x:/usr --infodir=x:/usr/share/info --mandir=x:/usr/share/man --without-included-gettext
+ make AR=emxomfar
+ make install
+
+Note: If you use gcc 2.9.x I recommend to set also LIBS="-lgcc"
+
+Note: You can add -DNO_CMD_DEFAULT and -DNO_CHDIR2 to CPPFLAGS.
+ See section I. for details.
+
+
+IV. ***** NLS support *****
+
+GNU make has NLS (National Language Support), with the following
+caveats:
+
+ a) It will only work with GNU gettext, and
+ b) GNU gettext support is not included in the GNU make package.
+
+Therefore, if you wish to enable the internationalization features of
+GNU make you must install GNU gettext on your system before configuring
+GNU make.
+
+You can choose the languages to be installed. To install support for
+English, German and French only enter:
+
+ export LINGUAS="en de fr"
+
+If you don't specify LINGUAS all languages are installed.
+
+If you don't want NLS support (English only) use the option
+--disable-nls for the configure script. Note if GNU gettext is not
+installed then NLS will not be enabled regardless of this flag.
+
+
+V. ***** Running the make test suite *****
+
+To run the included make test suite you have to set
+
+ CPPFLAGS="-D__ST_MT_ERRNO__ -DNO_CMD_DEFAULT -DNO_CHDIR2"
+
+before you compile make. This is due to some restrictions of the
+testsuite itself. -DNO_CMD_DEFAULT causes make to use /bin/sh as default
+shell in every case. Normally you could simply set MAKESHELL="/bin/sh"
+to do this but the testsuite ignores the environment. -DNO_CHDIR2 causes
+make not to use drive letters for directory names (i.e. _chdir2() and
+_getcwd2() are NOT used). The testsuite interpretes the whole output of
+make, especially statements like make[1]: Entering directory
+'C:/somewhere/make-3.79.1/tests' where the testsuite does not expect the
+drive letter. This would be interpreted as an error even if there is
+none.
+
+To run the testsuite do the following:
+
+ export CPPFLAGS="-D__ST_MT_ERRNO__ -DNO_CMD_DEFAULT -DNO_CHDIR2"
+ export CFLAGS="-Zomf -O2 -Zmt"
+ export LDFLAGS="-Zcrtdll -s -Zlinker /exepack:2 -Zlinker /pm:vio -Zstack 0x6000"
+ export RANLIB="echo"
+ ./configure --prefix=x:/usr --disable-nls
+ make AR=emxomfar
+ make check
+
+All tests should work fine with the exception of one of the "INCLUDE_DIRS"
+tests which will fail if your /usr/include directory is on a drive different
+from the make source tree.
+
+
+-------------------------------------------------------------------------------
+Copyright (C) 2003-2016 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
+terms of the GNU General Public License as published by the Free Software
+Foundation; either version 3 of the License, or (at your option) any later
+version.
+
+GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License along with
+this program. If not, see <http://www.gnu.org/licenses/>.
diff --git a/README.VMS b/README.VMS
index 2ff553cd..5532b018 100644
--- a/README.VMS
+++ b/README.VMS
@@ -1,284 +1,515 @@
-This version of GNU make has been tested on
-OpenVMS V8.3 (Alpha) and V8.4 (Integrity).
+Overview: -*-text-mode-*-
+---------
+
+ This version of GNU make has been tested on:
+ OpenVMS V8.3/V8.4 (Alpha) and V8.4 (Integrity) AND V7.3 (VAX)
+
+ This version of GNU Make is intended to be run from DCL to run
+ make scripts with a special syntax that is described below. It
+ likely will not be able to run unmodified Unix makefiles.
+
+ There is an older implementation of GNU Make that was ported to GNV.
+ Work is now in progress to merge that port to get a single version
+ of GNU Make available. When that merge is done, GNU Make will auto
+ detect that it is running under a Posix shell and then operate as close to
+ GNU Make on Unix as possible.
+
+ The descriptions below are for running GNU make from DCL or equivalent.
+
+Recipe differences:
+-------------------
+
+ GNU Make for OpenVMS can not currently run native Unix make files because of
+ differences in the implementation.
+
+ I am trying to document the current behavior in this section. This is based
+ on the information in the file NEWS. and running the test suite.
+ TODO: More tests are needed to validate and demonstrate the OpenVMS
+ expected behavior.
+
+ In some cases the older behavior of GNU Make when run from DCL is not
+ compatible with standard makefile behavior.
+
+ This behavior can be changed when running GNU Make from DCL by setting
+ either DCL symbols or logical names of the format GNV$. The settings
+ are enabled with a string starting with one of '1', 'T', or 'E' for "1",
+ "TRUE", or "ENABLE". They are disabled with a '0', 'F', or 'D' for "1",
+ "FALSE", or "DISABLE". If they are not explicitly set to one of these
+ values, then they will be set to their default values.
+
+ The value of the setting DECC$FILENAME_UNIX_REPORT or
+ DECC$FILENAME_UNIX_ONLY will now cause the $(dir x) function to return
+ './' or '[]' as appropriate.
+
+ The name GNV$MAKE_OLD_VMS when enabled will cause GNU Make to behave as
+ much as the older method as can be done with out disabling VMS features.
+ When it is disabled GNU Make have the new behavior which more closely
+ matches Unix Make behavior.
+
+ The default is currently the old behavior when running GNU Make from DCL.
+ In the future this may change. When running make from GNV Bash the new
+ behavior is the default.
+
+ This is a global setting that sets the default behavior for several other
+ options that can be individually changed. Many of the individual settings
+ are to make it so that the self tests for GNU Make need less VMS specific
+ modifications.
+
+ The name GNV$MAKE_COMMA when enabled will cause GNU Make to expect a comma
+ for a path separator and use a comma for the separator for a list of files.
+ When disabled, it will cause GNU Make to use a colon for a path separator
+ and a space for the separator for a list of files. The default is to be
+ enabled if the GNU Make is set to the older behavior.
+
+ The name GNV$MAKE_SHELL_SIM when enabled will cause GNU Make to try to
+ simulate a Posix shell more closely. The following behaviors occur:
+
+ * Single quotes are converted to double quotes and any double
+ quotes inside of them are doubled. No environment variable expansion
+ is simulated.
+ * A exit command status will be converted to a Posix Exit
+ where 0 is success and non-zero is failure.
+ * The $ character will cause environment variable expansion.
+ * Environent variables can be set on the command line before a command.
+
+ VMS generally uses logical name search lists instead of path variables
+ where the resolution is handled by VMS independent of the program. Which
+ means that it is likely that nothing will notice if the default path
+ specifier is changed in the future.
+
+ Currently the built in VMS specific macros and recipes depend on the comma
+ being used as a file list separator.
+ TODO: Remove this dependency as other functions in GNU Make depend on a
+ space being used as a separator.
+
+ The format for recipes are a combination of Unix macros, a subset of
+ simulated UNIX commands, some shell emulation, and OpenVMS commands.
+ This makes the resulting makefiles unique to the OpenVMS port of GNU make.
+
+ If you are creating a OpenVMS specific makefile from scratch, you should also
+ look at MMK (Madgoat Make) available at https://github.com/endlesssoftware/mmk
+ MMK uses full OpenVMS syntax and a persistent subprocess is used for the
+ recipe lines, allowing multiple line rules.
+
+ The default makefile search order is "makefile.vms", "gnumakefile",
+ "makefile". TODO: See if that lookup is case sensitive.
+
+ When Make is invoked from DCL, it will create a foreign command
+ using the name of executable image, with any facility prefix removed,
+ for the duration of the make program, so it can be used internally
+ to recursively run make(). The macro MAKE_COMMAND will be set to
+ this foreign command.
+
+ When make is launched from an exec*() command from a C program,
+ the foreign command is not created. The macro MAKE_COMMAND will be
+ set to the actual command passed as argv[0] to the exec*() function.
+
+ If the DCL symbol or logical name GNV$MAKE_USE_MCR exists, then
+ the macro MAKE_COMMAND will be set to be an "MCR" command with the
+ absolute path used by DCL to launch make. The foreign command
+ will not be created.
+
+ The macro MAKE is set to be the same value as the macro MAKE_COMMAND
+ on all platforms.
+
+ Each recipe command is normally run as a separate spawned processes,
+ except for the cases documented below where a temporary DCL command
+ file may be used.
+
+ BUG: Testing has shown that the commands in the temporary command files
+ are not always created properly. This issue is still under investigation.
+
+ Any macros marked as exported are temporarily created as DCL symbols
+ for child images to use. DCL symbol substitution is not done with these
+ commands.
+ Untested: Symbol substitution.
+
+ When a temporary DCL command file is used, DCL symbol substitution
+ will work.
+
+ For VMS 7.3-1 and earlier, command lines are limited to 255 characters
+ or 1024 characters in a command file.
+ For VMS 7.3-2 and later, command lines are limited to 4059 characters
+ or 8192 characters in a command file.
+
+ VMS limits each token of a command line to 256 characters, and limits
+ a command line to 127 tokens.
+
+ Command lines above the limit length are written to a command file
+ in sys$scratch:.
+
+ In order to handle Unix style extensions to VMS DCL, GNU Make has
+ parsed the recipe commands and them modified them as needed. The
+ parser has been re-written to resolve numerous bugs in handling
+ valid VMS syntax and potential buffer overruns.
+
+ The new parser may need whitespace characters where DCL does not require
+ it, and also may require that quotes are matched were DCL forgives if
+ they are not. There is a small chance that existing VMS specific makefiles
+ will be affected.
+
+ The '<', '>' was previously implemented using command files. Now
+ GNU Make will check to see if the is already a VMS "PIPE" command and
+ if it is not, will convert the command to a VMS "PIPE" command.
+
+ The '>>' redirection has been implemented by using a temporary command file.
+ This will be described later.
-Build instructions
-------------------
-Make a 1st version
- $ @makefile.com ! ignore any compiler and/or linker warning
- $ copy make.exe 1st-make.exe
- Use the 1st version to generate a 2nd version
- $ mc sys$disk:[]1st-make clean ! ignore any file not found messages
- $ mc sys$disk:[]1st-make
- Verify your 2nd version
- $ copy make.exe 2nd-make.exe
- $ mc sys$disk:[]2nd-make clean
- $ mc sys$disk:[]2nd-make
- Don't use the HP C V7.2-001 compiler, which has an incompatible change
- how __STDC__ is defined. This results at least in compile time warnings.
-
-Changes since GNU make 3.82
----------------------------
+ The DCL symbol or logical name GNV$MAKE_USE_CMD_FILE when set to a
+ string starting with one of '1','T', or 'E' for "1", "TRUE", or "ENABLE",
+ then temporary DCL command files are always used for running commands.
+
+ Some recipe strings with embedded new lines will not be handled correctly
+ when a command file is used.
+
+ GNU Make generally does text comparisons for the targets and sources. The
+ make program itself can handle either Unix or OpenVMS format filenames, but
+ normally does not do any conversions from one format to another.
+ TODO: The OpenVMS format syntax handling is incomplete.
+ TODO: ODS-5 EFS support is missing.
+ BUG: The internal routines to convert filenames to and from OpenVMS format
+ do not work correctly.
+
+ Note: In the examples below, line continuations such as a backslash may have
+ been added to make the examples easier to read in this format.
+ BUG: That feature does not completely work at this time.
+
+ Since the OpenVMS utilities generally expect OpenVMS format paths, you will
+ usually have to use OpenVMS format paths for rules and targets.
+ BUG: Relative OpenVMS paths may not work in targets, especially combined
+ with vpaths. This is because GNU make will just concatenate the directories
+ as it does on Unix.
+
+ The variables $^ and $@ separate files with commas instead of spaces.
+ This is controlled by the name GNV$MAKE_COMMA as documented in the
+ previous section.
+
+ While this may seem the natural thing to do with OpenVMS, it actually
+ causes problems when trying to use other make functions that expect the
+ files to be separated by spaces. If you run into this, you need the
+ following workaround to convert the output.
+ TODO: Look at have the $^ and $@ use spaces like on Unix and have
+ and easy to use function to do the conversions and have the built
+ in OpenVMS specific recipes and macros use it.
-Fix build problems.
-
-The new feature "Loadable objects" is not yet supported. If you need it,
-please send a change request or submit a bug report.
-
-The new option --output-sync (-O) is accepted but has no effect: GNU make
-for VMS does not support running multiple commands simultaneously.
-
-Changes for GNU make 3.82
-
-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.
-
-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. The CtrlY handler now uses $delprc to delete all
-children. This way also actions with DCL commands will be stopped. As before
-the CtrlY handler then sends SIGQUIT to itself, which is handled in common
-code.
-
-Change in deleteing temporary command files. Temporary command files are now
-deleted in the vms child termination handler. That deletes 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 for GNU make 3.80
-
-. In default.c define variable ARCH as IA64 for VMS on Itanium systems.
-
-. In makefile.vms avoid name collision for glob and globfree.
-
-This is the VMS port of GNU Make done by Hartmut.Becker@compaq.com.
-
-It is based on the specific version 3.77k and on 3.78.1. 3.77k was done
-by Klaus Kämpf <kkaempf@rmi.de>, the code was based on the VMS port of
-GNU Make 3.60 by Mike Moretti.
-
-It was ported on OpenVMS/Alpha V7.1, DECC V5.7-006. It was re-build and
-tested on OpenVMS/Alpha V7.2, OpenVMS/VAX 7.1 and 5.5-2. Different
-versions of DECC were used. VAXC was tried: it fails; but it doesn't
-seem worth to get it working. There are still some PTRMISMATCH warnings
-during the compile. Although perl is working on VMS the test scripts
-don't work. The function $shell is still missing.
-
-There is a known bug in some of the VMS CRTLs. It is in the shipped
-versions of VMS V7.2 and V7.2-1 and in the currently (October 1999)
-available ECOs for VMS V7.1 and newer versions. It is fixed in versions
-shipped with newer VMS versions and all ECO kits after October 1999. It
-only shows up during the daylight saving time period (DST): stat()
-returns a modification time 1 hour ahead. This results in GNU make
-warning messages. For a just created source you will see:
+ Example:
- $ gmake x.exe
- gmake.exe;1: *** Warning: File 'x.c' has modification time in the future (940582863 > 940579269)
- cc /obj=x.obj x.c
- link x.obj /exe=x.exe
- gmake.exe;1: *** Warning: Clock skew detected. Your build may be incomplete.
+comma := ,
+empty :=
+space := $(empty) $(empty)
+foo: $(addsuffix .3,$(subs $(comma),$(space),$^)
-New in 3.78.1:
-Fix a problem with automatically remaking makefiles. GNU make uses an
-execve to restart itself after a successful remake of the makefile. On
-UNIX systems execve replaces the running program with a new one and
-resets all signal handling to the default. On VMS execve creates a child
-process, signal and exit handlers of the parent are still active, and,
-unfortunately, corrupt the exit code from the child. Fix in job.c:
-ignore SIGCHLD.
+ Makefile variables are looked up in the current environment. You can set
+ symbols or logicals in DCL and evaluate them in the Makefile via
+ $(<name-of-symbol-or-logical>). Variables defined in the Makefile
+ override OpenVMS symbols/logicals.
-Added some switches to reflect latest features of DECC. Modifications in
-makefile.vms.
+ OpenVMS logical and symbols names show up as "environment" using the
+ origin function. when the "-e" option is specified, the origion function
+ shows them as "environment override". On Posix the test scripts indicate
+ that they should show up just as "environment".
-Set some definitions to reflect latest features of DECC. Modifications in
-config.h-vms (which is copied to config.h).
+ When GNU make reads in a symbol or logical name into the environment, it
+ converts any dollar signs found to double dollar signs for convenience in
+ using DCL symbols and logical names in recipes. When GNU make exports a
+ DCL symbol for a child process, if the first dollar sign found is followed
+ by second dollar sign, then all double dollar signs will be convirted to
+ single dollar signs.
-Added extern strcmpi declaration to avoid 'implicitly declared' messages.
-Modification in make.h.
+ The variable $(ARCH) is predefined as IA64, ALPHA or VAX respectively.
+ Makefiles for different OpenVMS systems can now be written by checking
+ $(ARCH). Since IA64 and ALPHA are similar, usually just a check for
+ VAX or not VAX is sufficient.
-Default rule for C++, conditionals for gcc (GCC_IS_NATIVE) or DEC/Digital/
-Compaq c/c++ compilers. Modifications in default.c.
+ You may have to update makefiles that assume VAX if not ALPHA.
-Usage of opendir() and friends, suppress file version. Modifications in dir.c.
+ifeq ($(ARCH),VAX)
+ $(ECHO) "On the VAX"
+else
+ $(ECHO) "On the ALPHA or IA64"
+endif
-Added VMS specific code to handle ctrl+c and ctrl+y to abort make.
-Modifications in job.c.
+ Empty commands are handled correctly and don't end in a new DCL process.
-Added support to have case sensitive targets and dependencies but to
-still use case blind file names. This is especially useful for Java
-makefiles on VMS:
+ The exit command needs to have OpenVMS exit codes. To pass a Posix code
+ back to the make script, you need to encode it by multiplying it by 8
+ and then adding %x1035a002 for a failure code and %x1035a001 for a
+ success. Make will interpret any posix code other than 0 as a failure.
+ TODO: Add an option have simulate Posix exit commands in recipes.
- .SUFFIXES :
- .SUFFIXES : .class .java
- .java.class :
- javac "$<
- HelloWorld.class : HelloWorld.java
+ Lexical functions can be used in pipes to simulate shell file test rules.
-A new macro WANT_CASE_SENSITIVE_TARGETS in config.h-vms was introduced.
-It needs to be enabled to get this feature; default is disabled. The
-macro HAVE_CASE_INSENSITIVE_FS must not be touched: it is still enabled.
-Modifications in file.c and config.h-vms.
+ Example:
-Bootstrap make to start building make is still makefile.com, but make
-needs to be re-made with a make to make a correct version: ignore all
-possible warnings, delete all objects, rename make.exe to a different
-name and run it.
+ Posix:
+b : c ; [ -f $@ ] || echo >> $@
-Made some minor modifications to the bootstrap build makefile.com.
-
-This is the VMS port of GNU Make.
+ OpenVMS:
+b : c ; if f$$search("$@") then pipe open/append xx $@ ; write xx "" ; close xx
-It is based on the VMS port of GNU Make 3.60 by Mike Moretti.
-This port was done by Klaus Kämpf <kkaempf@rmi.de>
+ You can also use pipes and turning messages off to silently test for a
+ failure.
-There is first-level support available from proGIS Software, Germany.
-Visit their web-site at http://www.progis.de to get information
-about other vms software and forthcoming updates to gnu make.
+x = %x1035a00a
-New for 3.77:
+%.b : %.c
+<tab>pipe set mess/nofac/noiden/nosev/notext ; type $^/output=$@ || exit $(x)
-/bin/sh style I/O redirection is supported. You can now write lines like
- mcr sys$disk:[]program.exe < input.txt > output.txt &> error.txt
-Makefile variables are looked up in the current environment. You can set
-symbols or logicals in DCL and evaluate them in the Makefile via
-$(<name-of-symbol-or-logical>). Variables defined in the Makefile
-override VMS symbols/logicals !
+Runtime issues:
-Functions for file names are working now. See the GNU Make manual for
-$(dir ...) and $(wildcard ...). Unix-style and VMS-style names are
-supported as arguments.
+ The OpenVMS C Runtime has a convention for encoding a Posix exit status into
+ to OpenVMS exit codes. These status codes will have the hex value of
+ 0x35a000. OpenVMS exit code may also have a hex value of %x10000000 set on
+ them. This is a flag to tell DCL not to write out the exit code.
-The default rules are set up for GNU C. Building an executable from a
-single source file is as easy as 'make file.exe'.
+ To convert an OpenVMS encoded Posix exit status code to the original code
+ You subtract %x35a000 and any flags from the OpenVMS code and divide it by 8.
+
+ WARNING: Backward-incompatibility!
+ The make program exit now returns the same encoded Posix exit code as on
+ Unix. Previous versions returned the OpenVMS exit status code if that is what
+ caused the recipe to fail.
+ TODO: Provide a way for scripts calling make to obtain that OpenVMS status
+ code.
+
+ Make internally has two error codes, MAKE_FAILURE and MAKE_TROUBLE. These
+ will have the error "-E-" severity set on exit.
+
+ MAKE_TROUBLE is returned only if the option "-q" or "--question" is used and
+ has a Posix value of 1 and an OpenVMS status of %x1035a00a.
+
+ MAKE_FAILURE has a Posix value of 2 and an OpenVMS status of %x1035a012.
+
+ Output from GNU make may have single quotes around some values where on
+ other platforms it does not. Also output that would be in double quotes
+ on some platforms may show up as single quotes on VMS.
+
+ There may be extra blank lines in the output on VMS.
+ https://savannah.gnu.org/bugs/?func=detailitem&item_id=41760
+
+ There may be a "Waiting for unfinished jobs..." show up in the output.
+
+ Error messages generated by Make or Unix utilities may slightly vary from
+ Posix platforms. Typically the case may be different.
+
+ When make deletes files, on posix platforms it writes out 'rm' and the list
+ of files. On VMS, only the files are writen out, one per line.
+ TODO: VMS
+
+ There may be extra leading white space or additional or missing whitespace
+ in the output of recipes.
+
+ GNU Make uses sys$scratch: for the tempfiles that it creates.
+
+ The OpenVMS CRTL library maps /tmp to sys$scratch if the TMP: logical name
+ does not exist. As the CRTL may use both sys$scratch: and /tmp internally,
+ if you define the TMP logical name to be different than SYS$SCRATCH:,
+ you may end up with only some temporary files in TMP: and some in SYS$SCRATCH:
+
+ The default include directory for including other makefiles is
+ SYS$SYSROOT:[SYSLIB] (I don't remember why I didn't just use
+ SYS$LIBRARY: instead; maybe it wouldn't work that way).
+ TODO: A better default may be desired.
+
+ If the device for a file in a recipe does not exist, on OpenVMS an error
+ message of "stat: <file>: no such device or address" will be output.
+
+ Make ignores success, informational, or warning errors (-S-, -I-, or
+ -W-). But it will stop on -E- and -F- errors. (unless you do something
+ to override this in your makefile, or whatever).
+
+
+Unix compatibilty features:
+---------------------------
-The variable $(ARCH) is predefined as ALPHA or VAX resp. Makefiles for
-different VMS systems can now be written by checking $(ARCH) as in
- ifeq ($(ARCH),ALPHA)
- $(ECHO) "On the Alpha"
- else
- $(ECHO) "On the VAX"
- endif
+ If the command 'echo' is seen, any single quotes on the line will be
+ converted to double quotes.
-Command lines of excessive length are correctly broken and written to a
-batch file in sys$scratch for later execution. There's no limit to the
-lengths of commands (and no need for .opt files :-) any more.
+ The variable $(CD) is implemented as a built in Change Directory
+ command. This invokes the 'builtin_cd' Executing a 'set default'
+ recipe doesn't do the trick, since it only affects the subprocess
+ spawned for that command.
-Empty commands are handled correctly and don't end in a new DCL process.
+ The 'builtin_cd' is generally expected to be on its own line.
+ The 'builtin_cd' either from the expansion of $(CD) or directly
+ put in a recipe line will be executed before any other commands in
+ that recipe line. DCL parameter substitution will not work for the
+ 'builtin_cd' command.
+ Putting a 'builtin_cd' in a pipeline or an IF-THEN line should not be
+ done because the 'builtin_cd' is always executed
+ and executed first. The directory change is persistent.
-New for 3.76:
+ Unix shell style I/O redirection is supported. You can now write lines like:
+ "<tab>mcr sys$disk:[]program.exe < input.txt > output.txt &> error.txt"
-John W. Eaton has updated the VMS port to support libraries and VPATH.
+ Posix shells have ":" as a null command. These are now handled.
+ https://savannah.gnu.org/bugs/index.php?41761
+ A note on appending the redirected output. A simple mechanism is
+ implemented to make ">>" work in action lines. In OpenVMS there is no simple
+ feature like ">>" to have DCL command or program output redirected and
+ appended to a file. GNU make for OpenVMS implements the redirection
+ of ">>" by using a command procedure.
-To build Make, simply type @makefile. This should compile all the
-necessary files and link Make. There is also a file called
-makefile.vms. If you already have GNU Make built you can just use
-Make with this makefile to rebuild.
+ The current algorithm creates the output file if it does not exist and
+ then uses the DCL open/append to extend it. SYS$OUTPUT is then directed
+ to that file.
-Here are some notes about GNU Make for VMS:
+ The implementation supports only one redirected append output to a file
+ and that redirection is done before any other commands in that line
+ are executed, so it redirects all output for that command.
-The cd command is supported if it's called as $(CD). This invokes
-the 'builtin_cd' command which changes the directory.
-Calling 'set def' doesn't do the trick, since a sub-shell is
-spawned for this command, the directory is changed *in this sub-shell*
-and the sub-shell ends.
+ The older implementation wrote the output to a temporary file in
+ in sys$scratch: and then attempted to append the file to the existing file.
+ The temporary file names looked like "CMDxxxxx.". Any time the created
+ command procedure can not complete, this happens. Pressing Ctrl+Y to
+ abort make is one case.
-Libraries are not supported. They were in GNU Make 3.60 but somehow I
-didn't care porting the code. If there is enough interest, I'll do it at
-some later time.
+ In case of Ctrl+Y the associated command procedure is left in SYS$SCRATCH:.
+ The command procedures will be named gnv$make_cmd*.com.
-The variable $^ separates files with commas instead of spaces (It's the
-natural thing to do for VMS).
+ The CtrlY handler now uses $delprc to delete all children. This way also
+ actions with DCL commands will be stopped. As before the CtrlY handler
+ then sends SIGQUIT to itself, which is handled in common code.
-See defaults.c for VMS default suffixes and my definitions for default
-rules and variables.
+ Temporary command files are now deleted in the OpenVMS child termination
+ handler. That deletes them even if a Ctrl+C was pressed.
+ TODO: Does the previous section about >> leaving files still apply?
-The shell function is not implemented yet.
+ 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.
-Load average routines haven't been implemented for VMS yet.
-The default include directory for including other makefiles is
-SYS$SYSROOT:[SYSLIB] (I don't remember why I didn't just use
-SYS$LIBRARY: instead; maybe it wouldn't work that way).
+Build Options:
+
+ Added support to have case sensitive targets and dependencies but to
+ still use case blind file names. This is especially useful for Java
+ makefiles on VMS:
+
+<TAB>.SUFFIXES :
+<TAB>.SUFFIXES : .class .java
+<TAB>.java.class :
+<TAB><TAB>javac "$<"
+<TAB>HelloWorld.class : HelloWorld.java
+
+ A new macro WANT_CASE_SENSITIVE_TARGETS in config.h-vms was introduced.
+ It needs to be enabled to get this feature; default is disabled.
+ TODO: This should be a run-time setting based on if the process
+ has been set to case sensitive.
+
+
+Unimplemented functionality:
+
+ The new feature "Loadable objects" is not yet supported. If you need it,
+ please send a change request or submit a bug report.
+
+ The new option --output-sync (-O) is accepted but has no effect: GNU make
+ for OpenVMS does not support running multiple commands simultaneously.
+
+
+Self test failures and todos:
+-----------------------------
+
+ The test harness can not handle testing some of the VMS specific modes
+ because of the features needed for to be set for the Perl to run.
+ Need to find a way to set the VMS features before running make as a
+ child.
+
+ GNU make was not currently translating the OpenVMS encoded POSIX values
+ returned to it back to the Posix values. I have temporarily modified the
+ Perl test script to compensate for it. This should be being handled
+ internally to Make.
+ TODO: Verify and update the Perl test script.
+
+ The features/parallelism test was failing. OpenVMS is executing the rules
+ in sequence not in parallel as this feature was not implemented.
+ GNU Make on VMS no longer claims it is implemented.
+ TODO: Implement it.
+
+ Symlink support is not present. Symlinks are supported by OpenVMS 8.3 and
+ later.
+
+ Error messages should be supressed with the "-" at the beginning of a line.
+ On openVMS they were showing up. TODO: Is this still an issue?
+
+ The internal vmsify and unixify OpenVMS to/from UNIX are not handling logical
+ names correctly.
+
+
+Build instructions:
+------------------
+
+ Don't use the HP C V7.2-001 compiler, which has an incompatible change
+ how __STDC__ is defined. This results at least in compile time warnings.
+
+Make a 1st version
+ $ @makefile.com ! ignore any compiler and/or linker warning
+ $ copy make.exe 1st-make.exe
+
+ Use the 1st version to generate a 2nd version as a test.
+ $ mc sys$disk:[]1st-make clean ! ignore any file not found messages
+ $ mc sys$disk:[]1st-make
+
+ Verify your 2nd version by building Make again.
+ $ copy make.exe 2nd-make.exe
+ $ mc sys$disk:[]2nd-make clean
+ $ mc sys$disk:[]2nd-make
+
+
+Running the tests:
+------------------
-The default makefiles make looks for are: makefile.vms, gnumakefile,
-makefile., and gnumakefile. .
+ Running the tests on OpenVMS requires the following software to be installed
+ as most of the tests are Unix oriented.
-The stat() function and handling of time stamps in VMS is broken, so I
-replaced it with a hack in vmsfunctions.c. I will provide a full rewrite
-somewhere in the future. Be warned, the time resolution inside make is
-less than what vms provides. This might be a problem on the faster Alphas.
+ * Perl 5.18 or later.
+ https://sourceforge.net/projects/vmsperlkit/files/
+ * GNV 2.1.3 + Updates including a minimum of:
+ * Bash 4.3.30
+ * ld_tools 3.0.2
+ * coreutils 8.21
+ https://sourceforge.net/p/gnv/wiki/InstallingGNVPackages/
+ https://sourceforge.net/projects/gnv/files/
-You can use a : in a filename only if you precede it with a backslash ('\').
-E.g.- hobbes\:[bogas.files]
+ As the test scripts need to create some foreign commands that persist
+ after the test is run, it is recommend that either you use a subprocess or
+ a dedicated login to run the tests.
-Make ignores success, informational, or warning errors (-S-, -I-, or
--W-). But it will stop on -E- and -F- errors. (unless you do something
-to override this in your makefile, or whatever).
+ To get detailed information for running the tests:
-Remote stuff isn't implemented yet.
+ $ set default [.tests]
+ $ @run_make_tests help
-Multiple line DCL commands, such as "if" statements, must be put inside
-command files. You can run a command file by using \@.
+ Running the script with no parameters will run all the tests.
+ After the the test script has been run once in a session, assuming
+ that you built make in sys$disk:[make], you can redefined the
+ "bin" logical name as follows:
-VMS changes made for 3.74.3
+ $ define bin sys$disk:[make],gnv$gnu:[bin]
-Lots of default settings are adapted for VMS. See default.c.
+ Then you can use Perl to run the scripts.
-Long command lines are now converted to command files.
+ $ perl run_make_tests.pl
-Comma (',') as a separator is now allowed. See makefile.vms for an example.
--------------------------------------------------------------------------------
-Copyright (C) 1996-2014 Free Software Foundation, Inc.
-This file is part of GNU Make.
+Acknowlegements:
+----------------
-GNU Make is free software; you can redistribute it and/or modify it under the
-terms of the GNU General Public License as published by the Free Software
-Foundation; either version 3 of the License, or (at your option) any later
-version.
+See NEWS. for details of past changes.
-GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
-A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+ These are the currently known contributers to this port.
-You should have received a copy of the GNU General Public License along with
-this program. If not, see <http://www.gnu.org/licenses/>.
+ Hartmut Becker
+ John Malmberg
+ Michael Gehre
+ John Eisenbraun
+ Klaus Kaempf
+ Mike Moretti
+ John W. Eaton
diff --git a/README.W32.template b/README.W32.template
new file mode 100644
index 00000000..3ac3354f
--- /dev/null
+++ b/README.W32.template
@@ -0,0 +1,314 @@
+This version of GNU make has been tested on:
+ Microsoft Windows 2000/XP/2003/Vista/7/8/10
+It has also been used on Windows 95/98/NT, and on OS/2.
+
+It builds with the MinGW port of GCC (tested with GCC 3.4.2, 4.8.1,
+and 4.9.3).
+
+It also builds with MSVC 2.x, 4.x, 5.x, 6.x, 2003, and 14 (2015) as
+well as with .NET 7.x and .NET 2003.
+
+As of version 4.0, a build with Guile is supported (tested with Guile
+2.0.3). To build with Guile, you will need, in addition to Guile
+itself, its dependency libraries and the pkg-config program. The
+latter is used to figure out which compilation and link switches and
+libraries need to be mentioned on the compiler command lines to
+correctly link with Guile. A Windows port of pkg-config can be found
+on ezwinports site:
+
+ http://sourceforge.net/projects/ezwinports/
+
+The libraries on which Guile depends can vary depending on your
+version and build of Guile. At the very least, the Boehm's GC library
+will be needed, and typically also GNU MP, libffi, libunistring, and
+libtool's libltdl. Whoever built the port of Guile you have should
+also provide you with these dependencies or a URL where to download
+them. A precompiled 32-bit Windows build of Guile is available from
+the ezwinports site mentioned above.
+
+The Windows port of GNU make is maintained jointly by various people.
+It was originally made by Rob Tulloh.
+It is currently maintained by Eli Zaretskii.
+
+
+Do this first, regardless of the build method you choose:
+---------------------------------------------------------
+
+ 1. Edit config.h.W32 to your liking (especially the few shell-related
+ defines near the end, or HAVE_CASE_INSENSITIVE_FS which corresponds
+ to './configure --enable-case-insensitive-file-system'). (We don't
+ recommend to define HAVE_CASE_INSENSITIVE_FS, but you may wish to
+ consider that if you have a lot of files whose names are in upper
+ case, while Makefile rules are written for lower-case versions.)
+
+
+Using make_msvc_net2003.vcproj
+------------------------------
+
+ 2. Open make_msvc_net2003.vcproj in MSVS71 or MSVC71 or any compatible IDE,
+ then build this project as usual. There's also a solution file for
+ Studio 2003.
+
+
+Building with (MinGW-)GCC using build_w32.bat
+---------------------------------------------
+
+ 2. Open a W32 command prompt for your installed (MinGW-)GCC, setup a
+ correct PATH and other environment variables for it, then execute ...
+
+ build_w32.bat gcc
+
+ This produces gnumake.exe in the GccRel directory.
+ If you want a version of GNU make built with debugging enabled,
+ add the --debug option.
+
+ The batch file will probe for Guile installation, and will build
+ gnumake.exe with Guile if it finds it. If you have Guile
+ installed, but want to build Make without Guile support, type
+
+ build_w32.bat --without-guile gcc
+
+
+Building with (MSVC++-)cl using build_w32.bat or NMakefile
+----------------------------------------------------------
+
+ 2. Open a W32 command prompt for your installed (MSVC++-)cl, setup a
+ correct PATH and other environment variables for it (usually via
+ executing vcvars32.bat or vsvars32.bat from the cl-installation,
+ e.g. "%VS71COMNTOOLS%vsvars32.bat"; or using a corresponding start
+ menue entry from the cl-installation), then execute EITHER ...
+
+ build_w32.bat
+
+ This produces gnumake.exe in the WinRel directory.
+ If you want a version of GNU make built with debugging enabled,
+ add the --debug option.
+
+ ... OR ...
+
+ nmake /f NMakefile
+
+ (this produces WinDebug/make.exe and WinRel/make.exe).
+
+ The batch file will probe for Guile installation, and will build
+ gnumake.exe with Guile if it finds it. If you have Guile
+ installed, but want to build Make without Guile support, type
+
+ build_w32.bat --without-guile
+
+-------------------
+-- Notes/Caveats --
+-------------------
+
+GNU make on Windows 32-bit platforms:
+
+ This version of make is ported natively to Windows32 platforms
+ (Windows NT 3.51, Windows NT 4.0, Windows 2000, Windows XP,
+ Windows 95, and Windows 98). It does not rely on any 3rd party
+ software or add-on packages for building. The only thing
+ needed is a Windows compiler. Two compilers supported
+ officially are the MinGW port of GNU GCC, and the various
+ versions of the Microsoft C compiler.
+
+ Do not confuse this port of GNU make with other Windows32 projects
+ which provide a GNU make binary. These are separate projects
+ and are not connected to this port effort.
+
+GNU make and sh.exe:
+
+ This port prefers if you have a working sh.exe somewhere on
+ your system. If you don't have sh.exe, the port falls back to
+ MSDOS mode for launching programs (via a batch file). The
+ MSDOS mode style execution has not been tested that carefully
+ though (The author uses GNU bash as sh.exe).
+
+ There are very few true ports of Bourne shell for NT right now.
+ There is a version of GNU bash available from Cygnus "Cygwin"
+ porting effort (http://www.cygwin.com/).
+ Other possibilities are the MKS version of sh.exe, or building
+ your own with a package like NutCracker (DataFocus) or Portage
+ (Consensys). Also MinGW includes sh (http://mingw.org/).
+
+GNU make and brain-dead shells (BATCH_MODE_ONLY_SHELL):
+
+ Some versions of Bourne shell do not behave well when invoked
+ as 'sh -c' from CreateProcess(). The main problem is they seem
+ to have a hard time handling quoted strings correctly. This can
+ be circumvented by writing commands to be executed to a batch
+ file and then executing the command by calling 'sh file'.
+
+ To work around this difficulty, this version of make supports
+ a batch mode. When BATCH_MODE_ONLY_SHELL is defined at compile
+ time, make forces all command lines to be executed via script
+ files instead of by command line. In this mode you must have a
+ working sh.exe in order to use parallel builds (-j).
+
+ A native Windows32 system with no Bourne shell will also run
+ in batch mode. All command lines will be put into batch files
+ and executed via $(COMSPEC) (%COMSPEC%). However, parallel
+ builds ARE supported with Windows shells (cmd.exe and
+ command.com). See the next section about some peculiarities
+ of parallel builds on Windows.
+
+Support for parallel builds
+
+ Parallel builds (-jN) are supported in this port, with 1
+ limitation: The number of concurrent processes has a hard
+ limit of 64, due to the way this port implements waiting for
+ its subprocesses.
+
+GNU make and Cygnus GNU Windows32 tools:
+
+ Good news! Make now has native support for Cygwin sh. To enable,
+ define the HAVE_CYGWIN_SHELL in config.h and rebuild make
+ from scratch. This version of make tested with B20.1 of Cygwin.
+ Do not define BATCH_MODE_ONLY_SHELL if you use HAVE_CYGWIN_SHELL.
+
+GNU make and the MKS shell:
+
+ There is now semi-official support for the MKS shell. To turn this
+ support on, define HAVE_MKS_SHELL in the config.h.W32 before you
+ build make. Do not define BATCH_MODE_ONLY_SHELL if you turn
+ on HAVE_MKS_SHELL.
+
+GNU make handling of drive letters in pathnames (PATH, vpath, VPATH):
+
+ There is a caveat that should be noted with respect to handling
+ single character pathnames on Windows systems. When colon is
+ used in PATH variables, make tries to be smart about knowing when
+ you are using colon as a separator versus colon as a drive
+ letter. Unfortunately, something as simple as the string 'x:/'
+ could be interpreted 2 ways: (x and /) or (x:/).
+
+ Make chooses to interpret a letter plus colon (e.g. x:/) as a
+ drive letter pathname. If it is necessary to use single
+ character directories in paths (VPATH, vpath, Path, PATH), the
+ user must do one of two things:
+
+ a. Use semicolon as the separator to disambiguate colon. For
+ example use 'x;/' if you want to say 'x' and '/' are
+ separate components.
+
+ b. Qualify the directory name so that there is more than
+ one character in the path(s) used. For example, none
+ of these settings are ambiguous:
+
+ ./x:./y
+ /some/path/x:/some/path/y
+ x:/some/path/x:x:/some/path/y
+
+ Please note that you are free to mix colon and semi-colon in the
+ specification of paths. Make is able to figure out the intended
+ result and convert the paths internally to the format needed
+ when interacting with the operating system, providing the path
+ is not within quotes, e.g. "x:/test/test.c".
+
+ You are encouraged to use colon as the separator character.
+ This should ease the pain of deciding how to handle various path
+ problems which exist between platforms. If colon is used on
+ both Unix and Windows systems, then no ifdef'ing will be
+ necessary in the makefile source.
+
+GNU make test suite:
+
+ I verified all functionality with a slightly modified version
+ of make-test-%VERSION% (modifications to get test suite to run
+ on Windows NT). All tests pass in an environment that includes
+ sh.exe. Tests were performed on both Windows NT and Windows 95.
+
+Pathnames and white space:
+
+ Unlike Unix, Windows 95/NT systems encourage pathnames which
+ contain white space (e.g. C:\Program Files\). These sorts of
+ pathnames are valid on Unix too, but are never encouraged.
+ There is at least one place in make (VPATH/vpath handling) where
+ paths containing white space will simply not work. There may be
+ others too. I chose to not try and port make in such a way so
+ that these sorts of paths could be handled. I offer these
+ suggestions as workarounds:
+
+ 1. Use 8.3 notation. i.e. "x:/long~1/", which is actually
+ "x:\longpathtest". Type "dir /x" to view these filenames
+ within the cmd.exe shell.
+ 2. Rename the directory so it does not contain white space.
+
+ If you are unhappy with this choice, this is free software
+ and you are free to take a crack at making this work. The code
+ in w32/pathstuff.c and vpath.c would be the places to start.
+
+Pathnames and Case insensitivity:
+
+ Unlike Unix, Windows 95/NT systems are case insensitive but case
+ preserving. For example if you tell the file system to create a
+ file named "Target", it will preserve the case. Subsequent access to
+ the file with other case permutations will succeed (i.e. opening a
+ file named "target" or "TARGET" will open the file "Target").
+
+ By default, GNU make retains its case sensitivity when comparing
+ target names and existing files or directories. It can be
+ configured, however, into a case preserving and case insensitive
+ mode by adding a define for HAVE_CASE_INSENSITIVE_FS to
+ config.h.W32.
+
+ For example, the following makefile will create a file named
+ Target in the directory subdir which will subsequently be used
+ to satisfy the dependency of SUBDIR/DepTarget on SubDir/TARGET.
+ Without HAVE_CASE_INSENSITIVE_FS configured, the dependency link
+ will not be made:
+
+ subdir/Target:
+ touch $@
+
+ SUBDIR/DepTarget: SubDir/TARGET
+ cp $^ $@
+
+ Reliance on this behavior also eliminates the ability of GNU make
+ to use case in comparison of matching rules. For example, it is
+ not possible to set up a C++ rule using %.C that is different
+ than a C rule using %.c. GNU make will consider these to be the
+ same rule and will issue a warning.
+
+SAMBA/NTFS/VFAT:
+
+ I have not had any success building the debug version of this
+ package using SAMBA as my file server. The reason seems to be
+ related to the way VC++ 4.0 changes the case name of the pdb
+ filename it is passed on the command line. It seems to change
+ the name always to to lower case. I contend that the VC++
+ compiler should not change the casename of files that are passed
+ as arguments on the command line. I don't think this was a
+ problem in MSVC 2.x, but I know it is a problem in MSVC 4.x.
+
+ The package builds fine on VFAT and NTFS filesystems.
+
+ Most all of the development I have done to date has been using
+ NTFS and long file names. I have not done any considerable work
+ under VFAT. VFAT users may wish to be aware that this port of
+ make does respect case sensitivity.
+
+FAT:
+
+ Version 3.76 added support for FAT filesystems. Make works
+ around some difficulties with stat'ing of files and caching of
+ filenames and directories internally.
+
+Bug reports:
+
+ Please submit bugs via the normal bug reporting mechanism which
+ is described in the GNU make manual and the base README.
+
+-------------------------------------------------------------------------------
+Copyright (C) 1996-2016 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
+terms of the GNU General Public License as published by the Free Software
+Foundation; either version 3 of the License, or (at your option) any later
+version.
+
+GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License along with
+this program. If not, see <http://www.gnu.org/licenses/>.
diff --git a/README.customs b/README.customs
index 30d98ac4..67e1252b 100644
--- a/README.customs
+++ b/README.customs
@@ -96,7 +96,7 @@ SunOS 4.1.x:
-------------------------------------------------------------------------------
-Copyright (C) 1998-2014 Free Software Foundation, Inc.
+Copyright (C) 1998-2016 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
diff --git a/README.git b/README.git
new file mode 100644
index 00000000..41a7675d
--- /dev/null
+++ b/README.git
@@ -0,0 +1,292 @@
+ -*-text-*-
+
+-------------------------------------------------------------------------------
+Copyright (C) 2002-2016 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
+terms of the GNU General Public License as published by the Free Software
+Foundation; either version 3 of the License, or (at your option) any later
+version.
+
+GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License along with
+this program. If not, see <http://www.gnu.org/licenses/>.
+-------------------------------------------------------------------------------
+
+Obtaining Git Code
+------------------
+
+This seems redundant, since if you're reading this you most likely have
+already performed this step; however, for completeness, you can obtain the GNU
+make source code via Git from the FSF's Savannah project
+<http://savannah.gnu.org/projects/make/>:
+
+ $ git clone git://git.savannah.gnu.org/make.git
+
+
+Changes using Git
+-----------------
+
+For non-developers, you can continue to provide patches as before, or if you
+make a public repository I can pull from that if you prefer.
+
+Starting with GNU make 4.0 we no longer keep a separate ChangeLog file in
+source control. We use the Gnulib git-to-changelog conversion script to
+convert the Git comments into ChangeLog-style entries for release. As a
+result, please format your Git comments carefully so they will look clean
+after conversion. In particular, each line of your comment will have a TAB
+added before it so be sure your comment lines are not longer than 72
+characters; prefer 70 or less. Please use standard ChangeLog formats for
+your commit messages (sans the leading TAB of course).
+
+Rule #1: Don't rewrite pushed history (don't use "git push --force").
+
+Typical simple workflow might be:
+
+ * Edit files
+ * Use "git status" and "git diff" to verify your changes
+ * Use "git add" to stage the changes you want to make
+ * Use "git commit" to commit the staged changes to your local repository
+ * Use "git pull" to accept & merge new changes from the Savannah repository
+ * Use "git push" to push your commits back to the Savannah repository
+
+For Emacs users, there are many options for Git integration but I strongly
+recommend the Magit package: http://www.emacswiki.org/emacs/Magit
+It makes the workflow much clearer, and has advanced features such as
+constructing multiple commits from various files and even from different
+diff chunks in the same file. There is a video available which helps a lot.
+
+
+Coding Standards
+----------------
+
+GNU make code adheres to the GNU Coding Standards. Please use only spaces and
+no TAB characters in source code.
+
+Additionally, GNU make is a foundational bootstrap package for the GNU
+project; as such it is very conservative about language features it expects.
+It should build with any C compiler conforming to the ANSI C89 / ISO C90
+standard.
+
+
+Building From Git
+-----------------
+
+To build GNU make from Git, you will need Autoconf, Automake, and
+Gettext, and any tools that those utilities require (GNU m4, Perl,
+etc.). See the configure.ac file to find the minimum versions of each
+of these tools. You will also need a copy of wget and gnulib.
+
+When building from Git you must build in the source directory: "VPATH
+builds" from remote directories are not supported. Once you've created
+a distribution, of course, you can unpack it and do a VPATH build from
+there.
+
+After checking out the code, you will need to perform these steps to get
+to the point where you can run "make".
+
+ 1) $ autoreconf -i
+
+ This rebuilds all the things that need rebuilding, installing
+ missing files as symbolic links.
+
+ You may get warnings here about missing files like README, etc.
+ Ignore them, they are harmless.
+
+ 2) $ ./configure
+
+ Generate a Makefile
+
+ 3) $ make update
+
+ Use wget to retrieve various other files that GNU make relies on,
+ but does not keep in its own source tree.
+
+ NB: You may need GNU make to correctly perform this step; if you use
+ a platform-local make you may get problems with missing files in doc/.
+
+At this point you have successfully brought your Git copy of the GNU
+make source directory up to the point where it can be treated
+more-or-less like the official package you would get from ftp.gnu.org.
+That is, you can just run:
+
+ $ make && make check && make install
+
+to build and install GNU make.
+
+
+Windows builds from Git
+-----------------------
+
+If you have a UNIX emulation like CYGWIN you can opt to run the general
+build procedure above; it will work. Be sure to read
+README.W32.template for information on options you might want to use
+when running ./configure.
+
+If you can't or don't want to do that, then rename the file
+README.W32.template to README.W32 and follow those instructions.
+
+
+Creating a Package
+------------------
+
+Once you have performed the above steps (including the configuration and
+build) you can create a GNU make package. This is very simple, just
+run:
+
+ $ make dist-gzip
+
+and, if you like:
+
+ $ make dist-bzip2
+
+Even better, you should run this:
+
+ $ make distcheck
+
+Which will build both .gz and .bz2 package files, then unpack them into
+a temporary location, try to build them, and repack them, verifying that
+everything works, you get the same results, _and_ no extraneous files
+are left over after the "distclean" rule--whew!! Now, _that_ is why
+converting to Automake is worth the trouble! A big "huzzah!" to Tom
+T. and the AutoToolers!
+
+
+Steps to Release
+----------------
+
+Here are the things that need to be done (in more or less this order)
+before making an official release. If something breaks such that you need to
+change code, be sure to start over again sufficiently that everything is
+consistent (that's why we don't finalize the Git tag, etc. until the end).
+
+ * Update the configure.ac file with the new release number.
+ * Update the EDITION value in the doc/make.texi file.
+ * Update the NEWS file with the release number and date.
+ * Ensure the Savannah bug list URL in the NEWS file uses the correct
+ "Fixed Release" ID number.
+ * Run "make distcheck" to be sure it all works.
+ * Run "make check-alt-config" to be sure alternative configurations work
+ * Run "make update-makeweb" to get a copy of the GNU make web pages
+ * Run "make update-gnuweb" to get a copy of the GNU website boilerplate pages
+ * Update the web page boilerplate if necessary:
+ ../gnu-www/www/server/standards/patch-from-parent ../make-web/make.html \
+ ../gnu-www/www/server/standards/boilerplate.html
+ * Run "make gendocs" (requires gnulib) to generate the manual files for
+ the GNU make web pages.
+ * Follow the directions from gendocs for the web page repository
+ * run "make tag-release" to create a Git tag for the release
+ * Push everything:
+ git push --tags origin master
+
+Manage the Savannah project for GNU make:
+
+ >>> This is only for real releases, not release candidate builds <<<
+
+ * In Savannah modify the "Value", "Rank", and "Description" values for the
+ current "SCM" entry in both "Component Version" and "Fix Release" fields
+ to refer to the new release. The "Rank" field should be 10 less than the
+ previous release so it orders properly.
+ * In Savannah create a new entry for the "Component Version" and "Fix
+ Release" fields:
+ - Value: SCM
+ - Rank: 20
+ - Descr: Issues found in code retrieved from Source Code Management (Git), rather than a distributed version. Please include the SHA you are working with.
+
+ - Descr: Fixed in Source Code Management (Git). The fix will be included in the next release of GNU make.
+
+Start the next release:
+
+ * Update configure.ac and add a ".90" to the release number.
+ * Update the NEWS file with a new section for the release / date.
+ * Update the Savannah URL for the bugs fixed in the NEWS section.
+
+
+Publishing a Package
+--------------------
+
+In order to publish a package on the FSF FTP site, either the release
+site ftp://ftp.gnu.org, or the prerelease site ftp://alpha.gnu.org, you
+first need to have my GPG private key and my passphrase to unlock it.
+And, you can't have them! So there! But, just so I remember here's
+what to do:
+
+ Make sure the "Steps to Release" are complete and committed and tagged.
+
+ git clone git://git.savannah.gnu.org/make.git make-release
+
+ cd make-release
+
+ <run the commands above to build the release>
+
+ make upload-alpha # for alpha.gnu.org (pre-releases)
+ -OR-
+ make upload-ftp # for ftp.gnu.org (official releases)
+
+Depending on your distribution (whether GnuPG is integrated with your keyring
+etc.) it will either pop up a window asking for your GPG key passphrase one
+time, or else it will use the CLI to ask for the GPG passphrase _THREE_ times.
+Sigh.
+
+
+For both final releases and pre-releases, send an email with the URL of
+the package to the GNU translation robot to allow the translators to
+work on it:
+
+ <coordinator@translationproject.org>
+
+
+Where to Announce
+-----------------
+
+Create the announcement in a text file, using 'git shortlog',
+then sign it with GPG:
+
+ gpg --clearsign <announcement.txt>
+
+Or, use your mail client's PGP/GPG signing capabilities.
+
+Announce the release:
+
+ * For release candidate builds:
+ To: bug-make@gnu.org
+ CC: coordinator@translationproject.org
+ BCC: help-make@gnu.org, make-w32@gnu.org, make-alpha@gnu.org
+
+ * For release builds
+ To: info-gnu@gnu.org, bug-make@gnu.org
+ CC: coordinator@translationproject.org
+ BCC: help-make@gnu.org, make-w32@gnu.org, make-alpha@gnu.org
+
+ * Add a news item to the Savannah project site.
+ * Add an update to freecode.com (nee freshmeat.net)
+
+
+Appendix A - For The Brave
+--------------------------
+
+For those of you who trust me implicitly, or are just brave (or
+foolhardy), here is a canned sequence of commands to build a GNU make
+distribution package from a virgin Git source checkout (assuming all the
+prerequisites are available of course).
+
+This list is eminently suitable for a quick swipe o' the mouse and a
+swift click o' mouse-2 into an xterm. Go for it!
+
+autoreconf -i
+./configure
+make update
+make
+make check
+
+Or, for a debugging version:
+
+autoreconf -i && ./configure CFLAGS=-g && make update && make && make check
+
+Or, all-in-one:
+
+autoreconf -i && ./configure && make update && make && make check
diff --git a/README.template b/README.template
new file mode 100644
index 00000000..7739faad
--- /dev/null
+++ b/README.template
@@ -0,0 +1,178 @@
+This directory contains the %VERSION% release of GNU Make.
+
+See the file NEWS for the user-visible changes from previous releases.
+In addition, there have been bugs fixed.
+
+Please check the system-specific notes below for any caveats related to
+your operating system.
+
+For general building and installation instructions, see the file INSTALL.
+
+If you need to build GNU Make and have no other 'make' program to use,
+you can use the shell script 'build.sh' instead. To do this, first run
+'configure' as described in INSTALL. Then, instead of typing 'make' to
+build the program, type 'sh build.sh'. This should compile the program
+in the current directory. Then you will have a Make program that you can
+use for './make install', or whatever else.
+
+Some systems' Make programs are broken and cannot process the Makefile for
+GNU Make. If you get errors from your system's Make when building GNU
+Make, try using 'build.sh' instead.
+
+
+GNU Make is free software. See the file COPYING for copying conditions.
+GNU Make is copyright by the Free Software Foundation. Copyright notices
+condense sequential years into a range; e.g. "1987-1994" means all years
+from 1987 to 1994 inclusive.
+
+Downloading
+-----------
+
+GNU Make can be obtained in many different ways. See a description here:
+
+ http://www.gnu.org/software/software.html
+
+
+Documentation
+-------------
+
+GNU make is fully documented in the GNU Make manual, which is contained
+in this distribution as the file make.texinfo. You can also find
+on-line and preformatted (PostScript and DVI) versions at the FSF's web
+site. There is information there about ordering hardcopy documentation.
+
+ http://www.gnu.org/
+ http://www.gnu.org/doc/doc.html
+ http://www.gnu.org/manual/manual.html
+
+
+Development
+-----------
+
+GNU Make development is hosted by Savannah, the FSF's online development
+management tool. Savannah is here:
+
+ http://savannah.gnu.org
+
+And the GNU Make development page is here:
+
+ http://savannah.gnu.org/projects/make/
+
+You can find most information concerning the development of GNU Make at
+this site.
+
+
+Bug Reporting
+-------------
+
+You can send GNU make bug reports to <bug-make@gnu.org>. Please see the
+section of the GNU make manual entitled 'Problems and Bugs' for
+information on submitting useful and complete bug reports.
+
+You can also use the online bug tracking system in the Savannah GNU Make
+project to submit new problem reports or search for existing ones:
+
+ http://savannah.gnu.org/bugs/?group=make
+
+If you need help using GNU make, try these forums:
+
+ help-make@gnu.org
+ help-utils@gnu.org
+ news:gnu.utils.help
+ news:gnu.utils.bug
+
+
+Git Access
+----------
+
+The GNU make source repository is available via Git from the
+GNU Savannah Git server; look here for details:
+
+ http://savannah.gnu.org/git/?group=make
+
+Please note: you won't be able to build GNU make from Git without
+installing appropriate maintainer's tools, such as GNU m4, automake,
+autoconf, Perl, GNU make, and GCC. See the README.git file for hints on
+how to build GNU make once these tools are available. We make no
+guarantees about the contents or quality of the latest code in the Git
+repository: it is not unheard of for code that is known to be broken to
+be checked in. Use at your own risk.
+
+
+System-specific Notes
+---------------------
+
+It has been reported that the XLC 1.2 compiler on AIX 3.2 is buggy such
+that if you compile make with 'cc -O' on AIX 3.2, it will not work
+correctly. It is said that using 'cc' without '-O' does work.
+
+The standard /bin/sh on SunOS 4.1.3_U1 and 4.1.4 is broken and cannot be
+used to configure GNU make. Please install a different shell such as
+bash or pdksh in order to run "configure". See this message for more
+information:
+ http://mail.gnu.org/archive/html/bug-autoconf/2003-10/msg00190.html
+
+One area that is often a problem in configuration and porting is the code
+to check the system's current load average. To make it easier to test and
+debug this code, you can do 'make check-loadavg' to see if it works
+properly on your system. (You must run 'configure' beforehand, but you
+need not build Make itself to run this test.)
+
+Another potential source of porting problems is the support for large
+files (LFS) in configure for those operating systems that provide it.
+Please report any bugs that you find in this area. If you run into
+difficulties, then as a workaround you should be able to disable LFS by
+adding the '--disable-largefile' option to the 'configure' script.
+
+On systems that support micro- and nano-second timestamp values and
+where stat(2) provides this information, GNU make will use it when
+comparing timestamps to get the most accurate possible result. However,
+note that many current implementations of tools that *set* timestamps do
+not preserve micro- or nano-second granularity. This means that "cp -p"
+and other similar tools (tar, etc.) may not exactly duplicate timestamps
+with micro- and nano-second granularity on some systems. If your build
+system contains rules that depend on proper behavior of tools like "cp
+-p", you should consider using the .LOW_RESOLUTION_TIME pseudo-target to
+force make to treat them properly. See the manual for details.
+
+
+Ports
+-----
+
+ - See README.customs for details on integrating GNU make with the
+ Customs distributed build environment from the Pmake distribution.
+
+ - See README.VMS for details about GNU Make on OpenVMS.
+
+ - See README.Amiga for details about GNU Make on AmigaDOS.
+
+ - See README.W32 for details about GNU Make on Windows NT, 95, or 98.
+
+ - See README.DOS for compilation instructions on MS-DOS and MS-Windows
+ using DJGPP tools.
+
+ A precompiled binary of the MSDOS port of GNU Make is available as part
+ of DJGPP; see the WWW page http://www.delorie.com/djgpp/ for more
+ information.
+
+Please note there are two _separate_ ports of GNU make for Microsoft
+systems: a native Windows tool built with (for example) MSVC or Cygwin,
+and a DOS-based tool built with DJGPP. Please be sure you are looking
+at the right README!
+
+
+-------------------------------------------------------------------------------
+Copyright (C) 1988-2016 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
+terms of the GNU General Public License as published by the Free Software
+Foundation; either version 3 of the License, or (at your option) any later
+version.
+
+GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License along with
+this program. If not, see <http://www.gnu.org/licenses/>.
diff --git a/SMakefile.template b/SMakefile.template
new file mode 100644
index 00000000..1b60d857
--- /dev/null
+++ b/SMakefile.template
@@ -0,0 +1,218 @@
+# -*-Makefile-*- for building GNU make with smake
+#
+# NOTE: If you have no 'make' program at all to process this makefile,
+# run 'build.sh' instead.
+#
+# Copyright (C) 1995-2016 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 terms of the GNU General Public License as published by the Free Software
+# Foundation; either version 3 of the License, or (at your option) any later
+# version.
+#
+# GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+# details.
+#
+# You should have received a copy of the GNU General Public License along with
+# this program. If not, see <http://www.gnu.org/licenses/>.
+
+#
+# Makefile for GNU Make
+#
+
+# Ultrix 2.2 make doesn't expand the value of VPATH.
+VPATH = /make-%VERSION%/
+# This must repeat the value, because configure will remove 'VPATH = .'.
+srcdir = /make-%VERSION%/
+
+CC = sc
+RM = delete
+MAKE = smake
+
+CFLAGS =
+CPPFLAGS =
+LDFLAGS =
+
+# Define these for your system as follows:
+# -DNO_ARCHIVES To disable 'ar' archive support.
+# -DNO_FLOAT To avoid using floating-point numbers.
+# -DENUM_BITFIELDS If the compiler isn't GCC but groks enum foo:2.
+# Some compilers apparently accept this
+# without complaint but produce losing code,
+# so beware.
+# NeXT 1.0a uses an old version of GCC, which required -D__inline=inline.
+# See also 'config.h'.
+defines =
+
+# Which flavor of remote job execution support to use.
+# The code is found in 'remote-$(REMOTE).c'.
+REMOTE = stub
+
+# If you are using the GNU C library, or have the GNU getopt functions in
+# your C library, you can comment these out.
+GETOPT = getopt.o getopt1.o
+GETOPT_SRC = $(srcdir)getopt.c $(srcdir)getopt1.c $(srcdir)getopt.h
+
+# If you are using the GNU C library, or have the GNU glob functions in
+# your C library, you can comment this out. GNU make uses special hooks
+# into the glob functions to be more efficient (by using make's directory
+# cache for globbing), so you must use the GNU functions even if your
+# system's C library has the 1003.2 glob functions already. Also, the glob
+# functions in the AIX and HPUX C libraries are said to be buggy.
+GLOB = Lib glob/glob.lib
+
+# If your system doesn't have alloca, or the one provided is bad, define this.
+ALLOCA = alloca.o
+ALLOCA_SRC = $(srcdir)alloca.c
+
+# If your system needs extra libraries loaded in, define them here.
+# System V probably need -lPW for alloca. HP-UX 7.0's alloca in
+# libPW.a is broken on HP9000s300 and HP9000s400 machines. Use
+# alloca.c instead on those machines.
+LOADLIBES =
+
+# Any extra object files your system needs.
+extras = amiga.o
+
+# Common prefix for machine-independent installed files.
+prefix =
+# Common prefix for machine-dependent installed files.
+exec_prefix =
+
+# Directory to install 'make' in.
+bindir = sc:c
+# Directory to find libraries in for '-lXXX'.
+libdir = lib:
+# Directory to search by default for included makefiles.
+includedir = include:
+# Directory to install the Info files in.
+infodir = doc:
+# Directory to install the man page in.
+mandir = t:
+# Number to put on the man page filename.
+manext = 1
+# Prefix to put on installed 'make' binary file name.
+binprefix =
+# Prefix to put on installed 'make' man page file name.
+manprefix = $(binprefix)
+
+# Whether or not make needs to be installed setgid.
+# The value should be either 'true' or 'false'.
+# On many systems, the getloadavg function (used to implement the '-l'
+# switch) will not work unless make is installed setgid kmem.
+install_setgid = false
+# Install make setgid to this group so it can read /dev/kmem.
+group = sys
+
+# Program to install 'make'.
+INSTALL_PROGRAM = copy
+# Program to install the man page.
+INSTALL_DATA = copy
+# Generic install program.
+INSTALL = copy
+
+# Program to format Texinfo source into Info files.
+MAKEINFO = makeinfo
+# Program to format Texinfo source into DVI files.
+TEXI2DVI = texi2dvi
+
+# Programs to make tags files.
+ETAGS = etags -w
+CTAGS = ctags -w
+
+#guile = guile.o
+
+objs = commands.o job.o dir.o file.o misc.o main.o read.o remake.o \
+ rule.o implicit.o default.o variable.o expand.o function.o \
+ vpath.o version.o ar.o arscan.o signame.o strcache.o hash.o \
+ output.o remote-$(REMOTE).o $(GLOB) $(GETOPT) $(ALLOCA) \
+ $(extras) $(guile)
+
+srcs = $(srcdir)commands.c $(srcdir)job.c $(srcdir)dir.c \
+ $(srcdir)file.c $(srcdir)getloadavg.c $(srcdir)misc.c \
+ $(srcdir)main.c $(srcdir)read.c $(srcdir)remake.c \
+ $(srcdir)rule.c $(srcdir)implicit.c $(srcdir)default.c \
+ $(srcdir)variable.c $(srcdir)expand.c $(srcdir)function.c \
+ $(srcdir)vpath.c $(srcdir)version.c $(srcdir)hash.c \
+ $(srcdir)guile.c $(srcdir)remote-$(REMOTE).c \
+ $(srcdir)ar.c $(srcdir)arscan.c $(srcdir)strcache.c \
+ $(srcdir)signame.c $(srcdir)signame.h $(GETOPT_SRC) \
+ $(srcdir)commands.h $(srcdir)dep.h $(srcdir)file.h \
+ $(srcdir)job.h $(srcdir)makeint.h $(srcdir)rule.h \
+ $(srcdir)output.c $(srcdir)output.h \
+ $(srcdir)variable.h $(ALLOCA_SRC) $(srcdir)config.h.in
+
+
+.SUFFIXES:
+.SUFFIXES: .o .c .h .ps .dvi .info .texinfo
+
+all: make
+info: make.info
+dvi: make.dvi
+# Some makes apparently use .PHONY as the default goal if it is before 'all'.
+.PHONY: all check info dvi
+
+make.info: make.texinfo
+ $(MAKEINFO) -I$(srcdir) $(srcdir)make.texinfo -o make.info
+
+make.dvi: make.texinfo
+ $(TEXI2DVI) $(srcdir)make.texinfo
+
+make.ps: make.dvi
+ dvi2ps make.dvi > make.ps
+
+make: $(objs) glob/glob.lib
+ $(CC) Link $(LDFLAGS) $(objs) $(LOADLIBES) To make.new
+ -delete quiet make
+ rename make.new make
+
+# -I. is needed to find config.h in the build directory.
+.c.o:
+ $(CC) $(defines) IDir "" IDir $(srcdir)glob \
+ $(CPPFLAGS) $(CFLAGS) $< $(OUTPUT_OPTION)
+
+glob/glob.lib:
+ execute <<
+ cd glob
+ smake
+<
+
+tagsrcs = $(srcs) $(srcdir)remote-*.c
+TAGS: $(tagsrcs)
+ $(ETAGS) $(tagsrcs)
+tags: $(tagsrcs)
+ $(CTAGS) $(tagsrcs)
+
+.PHONY: install installdirs
+install:
+ copy make sc:c
+
+loadavg: loadavg.c config.h
+ $(CC) $(defines) -DTEST -I. -I$(srcdir) $(CFLAGS) $(LDFLAGS) \
+ loadavg.c $(LOADLIBES) -o $@
+
+clean: glob-clean
+ -$(RM) -f make loadavg *.o core make.dvi
+
+distclean: clean glob-realclean
+ -$(RM) -f Makefile config.h config.status build.sh
+ -$(RM) -f config.log config.cache
+ -$(RM) -f TAGS tags
+ -$(RM) -f make.?? make.??s make.log make.toc make.*aux
+ -$(RM) -f loadavg.c
+
+realclean: distclean
+ -$(RM) -f make.info*
+
+mostlyclean: clean
+
+.PHONY: glob-clean glob-realclean
+
+glob-clean glob-realclean:
+ execute <<
+ cd glob
+ smake $@
+<
diff --git a/TODO.private b/TODO.private
new file mode 100644
index 00000000..a56827ad
--- /dev/null
+++ b/TODO.private
@@ -0,0 +1,117 @@
+ -*-Indented-Text-*-
+GNU Make TODO List
+------------------
+
+This list comes both from the authors and from users of GNU make.
+
+They are listed in no particular order!
+
+Also, I don't guarantee that all of them will be ultimately deemed "good
+ideas" and implemented. These are just the ones that, at first blush,
+seem to have some merit (and that I can remember).
+
+However, if you see something here you really, really want, speak up.
+All other things being equal, I will tend to implement things that seem
+to maximize user satisfaction.
+
+If you want to implement some of them yourself, barring the ones I've
+marked below, have at it! Please contact me first to let me know you're
+working on it, and give me some info about the design--and, critically,
+information about any user-visible syntax change, etc.
+
+
+The Top Item
+------------
+
+If you know perl (or want to learn DejaGNU or similar), the number one
+priority on my list of things I don't have time to do right now is
+fixing up the GNU make test suite. Most importantly it needs to be made
+"parallelizable", so more than one regression can run at the same time
+(essentially, make the "work" directory local). Also, the CWD during
+the test should be in the work directory or, better, a test-specific
+temporary directory so each test gets a new directory; right now
+sometimes tests leak files into the main directory which causes
+subsequent tests to fail (some tests may need to be tweaked). Beyond
+that, any cleanup done to make writing, reading, or handling tests
+simpler would be great! Please feel free to make whatever changes you
+like to the current tests, given some high-level goals, and that you'll
+port the current tests to whatever you do :).
+
+
+The Rest of the List
+--------------------
+
+ 1) Option to check more than timestamps to determine if targets have
+ changed. This is also a very big one. It's _close_ to my plate :),
+ and I have very definite ideas about how I would like it done.
+ Please pick something else unless you must have this feature. If
+ you try it, please work _extremely_ closely with me on it.
+
+ 1a) Possibly a special case of this is the .KEEP_STATE feature of Sun's
+ make. Some great folks at W U. in Canada did an implementation of
+ this for a class project. Their approach is reasonable and
+ workable, but doesn't really fit into my ideas for #2. Maybe
+ that's OK. I have paperwork for their work so if you want to do
+ this one talk to me to get what they've already done.
+
+ [K R Praveen <praveen@cair.res.in>]
+
+ 2) Currently you can use "%.foo %.bar : %.baz" to mean that one
+ invocation of the rule builds both targets. GNU make needs a way to
+ do that for explicit rules, too. I heard a rumor that some versions
+ of make all you to say "a.foo + a.bar : a.baz" to do this (i.e., a
+ "+" means one invocation builds both). Don't know if this is the
+ best syntax or not... what if you say "a.foo + a.bar a.bam : a.baz";
+ what does that mean?
+
+ 3) Multi-token pattern rule matching (allow %1/%2.c : %1/obj/%2.o,
+ etc., or something like that). Maybe using regex?
+
+ 4) Provide a .TARGETS variable, containing the names of the targets
+ defined in the makefile.
+
+ Actually, I now think a $(targets ...) function, at least, might be
+ better than a MAKETARGETS variable. The argument would be types of
+ targets to list: "phony" is the most useful one. I suppose
+ "default" might also be useful. Maybe some others; check the
+ bitfields to see what might be handy.
+
+ 5) Some sort of operating-system independent way of handling paths
+ would be outstanding, so makefiles can be written for UNIX, VMS,
+ DOS, MS-Windows, Amiga, etc. with a minimum of specialization.
+
+ Or, perhaps related/instead of, some sort of meta-quoting syntax so
+ make can deal with filenames containing spaces, colons, etc. I
+ dunno, maybe something like $[...]? This may well not be worth
+ doing until #1 is done.
+
+ 6) Right now the .PRECIOUS, .INTERMEDIATE, and .SECONDARY
+ pseudo-targets have different capabilities. For example, .PRECIOUS
+ can take a "%", the others can't. Etc. These should all work the
+ same, insofar as that makes sense.
+
+ 7) Improved debugging/logging/etc. capabilities. Part of this is done:
+ I introduced a number of debugging enhancements. Tim Magill is (I
+ think) looking into options to control output more selectively.
+ One thing I want to do in debugging is add a flag to allow debugging
+ of variables as they're expanded (!). This would be incredibly
+ verbose, but could be invaluable when nothing else seems to work and
+ you just can't figure it out. The way variables are expanded now
+ means this isn't 100% trivial, but it probably won't be hard.
+
+
+-------------------------------------------------------------------------------
+Copyright (C) 1997-2016 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
+terms of the GNU General Public License as published by the Free Software
+Foundation; either version 3 of the License, or (at your option) any later
+version.
+
+GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License along with
+this program. If not, see <http://www.gnu.org/licenses/>.
diff --git a/acinclude.m4 b/acinclude.m4
index 53d7ef13..0ac68aa4 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -1,7 +1,7 @@
dnl acinclude.m4 -- Extra macros needed for GNU make.
dnl
dnl Automake will incorporate this into its generated aclocal.m4.
-dnl Copyright (C) 1998-2014 Free Software Foundation, Inc.
+dnl Copyright (C) 1998-2016 Free Software Foundation, Inc.
dnl This file is part of GNU Make.
dnl
dnl GNU Make is free software; you can redistribute it and/or modify it under
diff --git a/amiga.c b/amiga.c
index 1ef949ce..cfd0d080 100644
--- a/amiga.c
+++ b/amiga.c
@@ -1,5 +1,5 @@
/* Running commands on Amiga
-Copyright (C) 1995-2014 Free Software Foundation, Inc.
+Copyright (C) 1995-2016 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
diff --git a/amiga.h b/amiga.h
index 00bca4f3..afc910ad 100644
--- a/amiga.h
+++ b/amiga.h
@@ -1,5 +1,5 @@
/* Definitions for amiga specific things
-Copyright (C) 1995-2014 Free Software Foundation, Inc.
+Copyright (C) 1995-2016 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
diff --git a/ar.c b/ar.c
index 675572a1..b9c1cf72 100644
--- a/ar.c
+++ b/ar.c
@@ -1,5 +1,5 @@
/* Interface to 'ar' archives for GNU Make.
-Copyright (C) 1988-2014 Free Software Foundation, Inc.
+Copyright (C) 1988-2016 Free Software Foundation, Inc.
This file is part of GNU Make.
@@ -73,7 +73,7 @@ static long int
ar_member_date_1 (int desc UNUSED, const char *mem, int truncated,
long int hdrpos UNUSED, long int datapos UNUSED,
long int size UNUSED, long int date,
- int uid UNUSED, int gid UNUSED, int mode UNUSED,
+ int uid UNUSED, int gid UNUSED, unsigned int mode UNUSED,
const void *name)
{
return ar_name_equal (name, mem, truncated) ? date : 0;
@@ -198,7 +198,7 @@ static long int
ar_glob_match (int desc UNUSED, const char *mem, int truncated UNUSED,
long int hdrpos UNUSED, long int datapos UNUSED,
long int size UNUSED, long int date UNUSED, int uid UNUSED,
- int gid UNUSED, int mode UNUSED, const void *arg)
+ int gid UNUSED, unsigned int mode UNUSED, const void *arg)
{
struct ar_glob_state *state = (struct ar_glob_state *)arg;
@@ -224,7 +224,7 @@ ar_glob_match (int desc UNUSED, const char *mem, int truncated UNUSED,
/* Return nonzero if PATTERN contains any metacharacters.
Metacharacters can be quoted with backslashes if QUOTE is nonzero. */
static int
-glob_pattern_p (const char *pattern, int quote)
+ar_glob_pattern_p (const char *pattern, int quote)
{
const char *p;
int opened = 0;
@@ -267,7 +267,7 @@ ar_glob (const char *arname, const char *member_pattern, unsigned int size)
#ifdef VMS
char *vms_member_pattern;
#endif
- if (! glob_pattern_p (member_pattern, 1))
+ if (! ar_glob_pattern_p (member_pattern, 1))
return 0;
/* Scan the archive for matches.
diff --git a/arscan.c b/arscan.c
index 24286fde..549fe1ec 100644
--- a/arscan.c
+++ b/arscan.c
@@ -1,5 +1,5 @@
/* Library function for scanning an archive file.
-Copyright (C) 1987-2014 Free Software Foundation, Inc.
+Copyright (C) 1987-2016 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
@@ -38,12 +38,18 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
#include <ssdef.h>
#include <stsdef.h>
#include <rmsdef.h>
-globalvalue unsigned int LBR$_HDRTRUNC;
-#if __DECC
+/* This symbol should be present in lbrdef.h. */
+#ifndef LBR$_HDRTRUNC
+#pragma extern_model save
+#pragma extern_model globalvalue
+extern unsigned int LBR$_HDRTRUNC;
+#pragma extern_model restore
+#endif
+
#include <unixlib.h>
#include <lbr$routines.h>
-#endif
+
const char *
vmsify (const char *name, int type);
@@ -414,7 +420,8 @@ ar_scan (const char *archive, ar_member_func_t function, const void *arg)
#ifdef SARMAG
{
char buf[SARMAG];
- register int nread = read (desc, buf, SARMAG);
+ int nread;
+ EINTRLOOP (nread, read (desc, buf, SARMAG));
if (nread != SARMAG || memcmp (buf, ARMAG, SARMAG))
{
(void) close (desc);
@@ -424,8 +431,8 @@ ar_scan (const char *archive, ar_member_func_t function, const void *arg)
#else
#ifdef AIAMAG
{
- register int nread = read (desc, &fl_header, FL_HSZ);
-
+ int nread;
+ EINTRLOOP (nread, read (desc, &fl_header, FL_HSZ));
if (nread != FL_HSZ)
{
(void) close (desc);
@@ -436,17 +443,20 @@ ar_scan (const char *archive, ar_member_func_t function, const void *arg)
re-read the header into the "big" structure. */
if (!memcmp (fl_header.fl_magic, AIAMAGBIG, SAIAMAG))
{
+ off_t o;
+
big_archive = 1;
/* seek back to beginning of archive */
- if (lseek (desc, 0, 0) < 0)
+ EINTRLOOP (o, lseek (desc, 0, 0));
+ if (o < 0)
{
(void) close (desc);
return -2;
}
/* re-read the header into the "big" structure */
- nread = read (desc, &fl_header_big, FL_HSZ_BIG);
+ EINTRLOOP (nread, read (desc, &fl_header_big, FL_HSZ_BIG));
if (nread != FL_HSZ_BIG)
{
(void) close (desc);
@@ -469,7 +479,8 @@ ar_scan (const char *archive, ar_member_func_t function, const void *arg)
#else
unsigned short int buf;
#endif
- register int nread = read (desc, &buf, sizeof (buf));
+ int nread;
+ EINTRLOOP (nread, read (desc, &buf, sizeof (buf)));
if (nread != sizeof (buf) || buf != ARMAG)
{
(void) close (desc);
@@ -536,10 +547,12 @@ ar_scan (const char *archive, ar_member_func_t function, const void *arg)
int long_name = 0;
#endif
long int eltsize;
- int eltmode;
+ unsigned int eltmode;
long int fnval;
+ off_t o;
- if (lseek (desc, member_offset, 0) < 0)
+ EINTRLOOP (o, lseek (desc, member_offset, 0));
+ if (o < 0)
{
(void) close (desc);
return -2;
@@ -551,8 +564,8 @@ ar_scan (const char *archive, ar_member_func_t function, const void *arg)
#ifdef AIAMAGBIG
if (big_archive)
{
- nread = read (desc, &member_header_big,
- AR_MEMHDR_SZ(member_header_big) );
+ EINTRLOOP (nread, read (desc, &member_header_big,
+ AR_MEMHDR_SZ(member_header_big)));
if (nread != AR_MEMHDR_SZ(member_header_big))
{
@@ -561,7 +574,7 @@ ar_scan (const char *archive, ar_member_func_t function, const void *arg)
}
sscanf (member_header_big.ar_namlen, "%4d", &name_len);
- nread = read (desc, name, name_len);
+ EINTRLOOP (nread, read (desc, name, name_len));
if (nread != name_len)
{
@@ -583,8 +596,8 @@ ar_scan (const char *archive, ar_member_func_t function, const void *arg)
else
#endif
{
- nread = read (desc, &member_header,
- AR_MEMHDR_SZ(member_header) );
+ EINTRLOOP (nread, read (desc, &member_header,
+ AR_MEMHDR_SZ(member_header)));
if (nread != AR_MEMHDR_SZ(member_header))
{
@@ -593,7 +606,7 @@ ar_scan (const char *archive, ar_member_func_t function, const void *arg)
}
sscanf (member_header.ar_namlen, "%4d", &name_len);
- nread = read (desc, name, name_len);
+ EINTRLOOP (nread, read (desc, name, name_len));
if (nread != name_len)
{
@@ -621,7 +634,7 @@ ar_scan (const char *archive, ar_member_func_t function, const void *arg)
eltmode, arg);
#else /* Not AIAMAG. */
- nread = read (desc, &member_header, AR_HDR_SIZE);
+ EINTRLOOP (nread, read (desc, &member_header, AR_HDR_SIZE));
if (nread == 0)
/* No data left means end of file; that is OK. */
break;
@@ -690,7 +703,7 @@ ar_scan (const char *archive, ar_member_func_t function, const void *arg)
int namesize = atoi (name + 3);
name = alloca (namesize + 1);
- nread = read (desc, name, namesize);
+ EINTRLOOP (nread, read (desc, name, namesize));
if (nread != namesize)
{
close (desc);
@@ -761,7 +774,7 @@ ar_scan (const char *archive, ar_member_func_t function, const void *arg)
char *limit;
namemap = alloca (eltsize);
- nread = read (desc, namemap, eltsize);
+ EINTRLOOP (nread, read (desc, namemap, eltsize));
if (nread != eltsize)
{
(void) close (desc);
@@ -859,7 +872,7 @@ static long int
ar_member_pos (int desc UNUSED, const char *mem, int truncated,
long int hdrpos, long int datapos UNUSED, long int size UNUSED,
long int date UNUSED, int uid UNUSED, int gid UNUSED,
- int mode UNUSED, const void *name)
+ unsigned int mode UNUSED, const void *name)
{
if (!ar_name_equal (name, mem, truncated))
return 0;
@@ -879,7 +892,8 @@ ar_member_touch (const char *arname, const char *memname)
long int pos = ar_scan (arname, ar_member_pos, memname);
int fd;
struct ar_hdr ar_hdr;
- int i;
+ off_t o;
+ int r;
unsigned int ui;
struct stat statbuf;
@@ -888,28 +902,32 @@ ar_member_touch (const char *arname, const char *memname)
if (!pos)
return 1;
- fd = open (arname, O_RDWR, 0666);
+ EINTRLOOP (fd, open (arname, O_RDWR, 0666));
if (fd < 0)
return -3;
/* Read in this member's header */
- if (lseek (fd, pos, 0) < 0)
+ EINTRLOOP (o, lseek (fd, pos, 0));
+ if (o < 0)
goto lose;
- if (AR_HDR_SIZE != read (fd, &ar_hdr, AR_HDR_SIZE))
+ EINTRLOOP (r, read (fd, &ar_hdr, AR_HDR_SIZE));
+ if (r != AR_HDR_SIZE)
goto lose;
/* Write back the header, thus touching the archive file. */
- if (lseek (fd, pos, 0) < 0)
+ EINTRLOOP (o, lseek (fd, pos, 0));
+ if (o < 0)
goto lose;
- if (AR_HDR_SIZE != write (fd, &ar_hdr, AR_HDR_SIZE))
+ EINTRLOOP (r, write (fd, &ar_hdr, AR_HDR_SIZE));
+ if (r != AR_HDR_SIZE)
goto lose;
/* The file's mtime is the time we we want. */
- EINTRLOOP (i, fstat (fd, &statbuf));
- if (i < 0)
+ EINTRLOOP (r, fstat (fd, &statbuf));
+ if (r < 0)
goto lose;
#if defined(ARFMAG) || defined(ARFZMAG) || defined(AIAMAG) || defined(WINDOWS32)
/* Advance member's time to that time */
for (ui = 0; ui < sizeof ar_hdr.ar_date; ui++)
ar_hdr.ar_date[ui] = ' ';
- sprintf (TOCHAR (ar_hdr.ar_date), "%ld", (long int) statbuf.st_mtime);
+ sprintf (TOCHAR (ar_hdr.ar_date), "%lu", (long unsigned) statbuf.st_mtime);
#ifdef AIAMAG
ar_hdr.ar_date[strlen (ar_hdr.ar_date)] = ' ';
#endif
@@ -917,17 +935,19 @@ ar_member_touch (const char *arname, const char *memname)
ar_hdr.ar_date = statbuf.st_mtime;
#endif
/* Write back this member's header */
- if (lseek (fd, pos, 0) < 0)
+ EINTRLOOP (o, lseek (fd, pos, 0));
+ if (o < 0)
goto lose;
- if (AR_HDR_SIZE != write (fd, &ar_hdr, AR_HDR_SIZE))
+ EINTRLOOP (r, write (fd, &ar_hdr, AR_HDR_SIZE));
+ if (r != AR_HDR_SIZE)
goto lose;
close (fd);
return 0;
lose:
- i = errno;
+ r = errno;
close (fd);
- errno = i;
+ errno = r;
return -3;
}
#endif
@@ -937,7 +957,8 @@ ar_member_touch (const char *arname, const char *memname)
long int
describe_member (int desc, const char *name, int truncated,
long int hdrpos, long int datapos, long int size,
- long int date, int uid, int gid, int mode, const void *arg)
+ long int date, int uid, int gid, unsigned int mode,
+ const void *arg)
{
extern char *ctime ();
diff --git a/build.template b/build.template
new file mode 100644
index 00000000..4b01b469
--- /dev/null
+++ b/build.template
@@ -0,0 +1,81 @@
+#!/bin/sh
+# Shell script to build GNU Make in the absence of any 'make' program.
+# @configure_input@
+
+# Copyright (C) 1993-2016 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 terms of the GNU General Public License as published by the Free Software
+# Foundation; either version 3 of the License, or (at your option) any later
+# version.
+#
+# GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+# details.
+#
+# You should have received a copy of the GNU General Public License along with
+# this program. If not, see <http://www.gnu.org/licenses/>.
+
+# See Makefile.in for comments describing these variables.
+
+srcdir='@srcdir@'
+CC='@CC@'
+CFLAGS='@CFLAGS@ @GUILE_CFLAGS@'
+CPPFLAGS='@CPPFLAGS@'
+LDFLAGS='@AM_LDFLAGS@ @LDFLAGS@'
+ALLOCA='@ALLOCA@'
+LOADLIBES='@LIBS@ @GUILE_LIBS@ @LIBINTL@'
+eval extras=\'@LIBOBJS@\'
+REMOTE='@REMOTE@'
+GLOBLIB='@GLOBLIB@'
+PATH_SEPARATOR='@PATH_SEPARATOR@'
+OBJEXT='@OBJEXT@'
+EXEEXT='@EXEEXT@'
+
+# Common prefix for machine-independent installed files.
+prefix='@prefix@'
+# Common prefix for machine-dependent installed files.
+exec_prefix=`eval echo @exec_prefix@`
+# Directory to find libraries in for '-lXXX'.
+libdir=${exec_prefix}/lib
+# Directory to search by default for included makefiles.
+includedir=${prefix}/include
+
+localedir=${prefix}/share/locale
+aliaspath=${localedir}${PATH_SEPARATOR}.
+
+defines="-DLOCALEDIR=\"${localedir}\" -DLIBDIR=\"${libdir}\" -DINCLUDEDIR=\"${includedir}\""' @DEFS@'
+
+# Exit as soon as any command fails.
+set -e
+
+# These are all the objects we need to link together.
+objs="%objs% remote-${REMOTE}.${OBJEXT} ${extras} ${ALLOCA}"
+
+if [ x"$GLOBLIB" != x ]; then
+ objs="$objs %globobjs%"
+ globinc=-I${srcdir}/glob
+fi
+
+# Compile the source files into those objects.
+for file in `echo ${objs} | sed 's/\.'${OBJEXT}'/.c/g'`; do
+ echo compiling ${file}...
+ $CC $defines $CPPFLAGS $CFLAGS \
+ -c -I. -I${srcdir} ${globinc} ${srcdir}/$file
+done
+
+# The object files were actually all put in the current directory.
+# Remove the source directory names from the list.
+srcobjs="$objs"
+objs=
+for obj in $srcobjs; do
+ objs="$objs `basename $obj`"
+done
+
+# Link all the objects together.
+echo linking make...
+$CC $CFLAGS $LDFLAGS $objs $LOADLIBES -o makenew${EXEEXT}
+echo done
+mv -f makenew${EXEEXT} make${EXEEXT}
diff --git a/build_w32.bat b/build_w32.bat
index 00632a75..a88d5fec 100644
--- a/build_w32.bat
+++ b/build_w32.bat
@@ -1,310 +1,250 @@
-@echo off
-rem Copyright (C) 1996-2014 Free Software Foundation, Inc.
-rem This file is part of GNU Make.
-rem
-rem GNU Make is free software; you can redistribute it and/or modify it under
-rem the terms of the GNU General Public License as published by the Free
-rem Software Foundation; either version 3 of the License, or (at your option)
-rem any later version.
-rem
-rem GNU Make is distributed in the hope that it will be useful, but WITHOUT
-rem ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-rem FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for.
-rem more details.
-rem
-rem You should have received a copy of the GNU General Public License along
-rem with this program. If not, see <http://www.gnu.org/licenses/>.
-
-if "%1" == "-h" GoTo Usage
-if "%1" == "--help" GoTo Usage
-if not exist config.h.W32.template GoTo NotSCM
-sed -n "s/^AC_INIT(\[GNU make\],\[\([^]]\+\)\].*/s,%%VERSION%%,\1,g/p" configure.ac > config.h.W32.sed
-echo s,%%PACKAGE%%,make,g >> config.h.W32.sed
-sed -f config.h.W32.sed config.h.W32.template > config.h.W32
-echo static const char *const GUILE_module_defn = ^" \> gmk-default.h
-sed -e "s/;.*//" -e "/^[ \t]*$/d" -e "s/\"/\\\\\"/g" -e "s/$/ \\/" gmk-default.scm >> gmk-default.h
-echo ^";>> gmk-default.h
-:NotSCM
-copy config.h.W32 config.h
-
-rem Guile configuration
-set GUILECFLAGS=
-set GUILELIBS=
-set NOGUILE=
-set OPT=-O2
-set COMPILER=
-set PKGMSC=
-:ParseSW
-if "%1" == "--debug" GoTo SetOpt
-if "%1" == "--without-guile" GoTo NoGuile
-if "%1" == "gcc" GoTo SetCC
-if "%1" == "" GoTo ChkGuile
-:SetOpt
-set OPT=-O0
-shift
-GoTo ParseSW
-:NoGuile
-set NOGUILE=Y
-echo "Building without Guile"
-shift
-GoTo ParseSW
-:SetCC
-set COMPILER=gcc
-echo "Building with GCC"
-shift
-GoTo ParseSW
-rem Build with Guile is supported only on NT and later versions
-:ChkGuile
-if "%NOGUILE%" == "Y" GoTo GuileDone
-if not "%OS%" == "Windows_NT" GoTo NoGuile
-pkg-config --help > guile.tmp 2> NUL
-if ERRORLEVEL 1 GoTo NoPkgCfg
-echo "Checking for Guile 2.0"
-if not "%COMPILER%" == "gcc" set PKGMSC=--msvc-syntax
-pkg-config --cflags --short-errors "guile-2.0" > guile.tmp
-if not ERRORLEVEL 1 set /P GUILECFLAGS= < guile.tmp
-pkg-config --libs --static --short-errors %PKGMSC% "guile-2.0" > guile.tmp
-if not ERRORLEVEL 1 set /P GUILELIBS= < guile.tmp
-if not "%GUILECFLAGS%" == "" GoTo GuileDone
-echo "Checking for Guile 1.8"
-pkg-config --cflags --short-errors "guile-1.8" > guile.tmp
-if not ERRORLEVEL 1 set /P GUILECFLAGS= < guile.tmp
-pkg-config --libs --static --short-errors %PKGMSC% "guile-1.8" > guile.tmp
-if not ERRORLEVEL 1 set /P GUILELIBS= < guile.tmp
-if not "%GUILECFLAGS%" == "" GoTo GuileDone
-echo "No Guile found, building without Guile"
-GoTo GuileDone
-:NoPkgCfg
-echo "pkg-config not found, building without Guile"
-:GuileDone
-if not "%GUILECFLAGS%" == "" echo "Guile found, building with Guile"
-if not "%GUILECFLAGS%" == "" set GUILECFLAGS=%GUILECFLAGS% -DHAVE_GUILE
-if "%COMPILER%" == "gcc" if "%OPT%" == "-O0" echo "Building without compiler optimizations"
-cd w32\subproc
-echo.
-echo "Creating the subproc library"
-%ComSpec% /c build.bat
-cd ..\..
-
-if exist link.dbg del link.dbg
-if exist link.rel del link.rel
-echo.
-echo "Creating GNU Make for Windows 9X/NT/2K/XP/Vista/7/8"
-if "%COMPILER%" == "gcc" GoTo GCCBuild
-set make=gnumake
-echo on
-if not exist .\WinDebug\nul mkdir .\WinDebug
-cl.exe /nologo /MT /W4 /GX /Zi /YX /Od /I . /I glob /I w32/include /D TIVOLI /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c variable.c
-echo WinDebug\variable.obj >>link.dbg
-cl.exe /nologo /MT /W4 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c rule.c
-echo WinDebug\rule.obj >>link.dbg
-cl.exe /nologo /MT /W4 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c remote-stub.c
-echo WinDebug\remote-stub.obj >>link.dbg
-cl.exe /nologo /MT /W4 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c commands.c
-echo WinDebug\commands.obj >>link.dbg
-cl.exe /nologo /MT /W4 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c file.c
-echo WinDebug\file.obj >>link.dbg
-cl.exe /nologo /MT /W4 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c getloadavg.c
-echo WinDebug\getloadavg.obj >>link.dbg
-cl.exe /nologo /MT /W4 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c default.c
-echo WinDebug\default.obj >>link.dbg
-cl.exe /nologo /MT /W4 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c signame.c
-echo WinDebug\signame.obj >>link.dbg
-cl.exe /nologo /MT /W4 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c expand.c
-echo WinDebug\expand.obj >>link.dbg
-cl.exe /nologo /MT /W4 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c dir.c
-echo WinDebug\dir.obj >>link.dbg
-cl.exe /nologo /MT /W4 /GX /Zi /YX /Od %GUILECFLAGS% /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c main.c
-echo WinDebug\main.obj >>link.dbg
-cl.exe /nologo /MT /W4 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c getopt1.c
-echo WinDebug\getopt1.obj >>link.dbg
-cl.exe /nologo /MT /W4 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c job.c
-echo WinDebug\job.obj >>link.dbg
-cl.exe /nologo /MT /W4 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c output.c
-echo WinDebug\output.obj >>link.dbg
-cl.exe /nologo /MT /W4 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c read.c
-echo WinDebug\read.obj >>link.dbg
-cl.exe /nologo /MT /W4 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c version.c
-echo WinDebug\version.obj >>link.dbg
-cl.exe /nologo /MT /W4 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c getopt.c
-echo WinDebug\getopt.obj >>link.dbg
-cl.exe /nologo /MT /W4 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c arscan.c
-echo WinDebug\arscan.obj >>link.dbg
-cl.exe /nologo /MT /W4 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c hash.c
-echo WinDebug\hash.obj >>link.dbg
-cl.exe /nologo /MT /W4 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c strcache.c
-echo WinDebug\strcache.obj >>link.dbg
-cl.exe /nologo /MT /W4 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c remake.c
-echo WinDebug\remake.obj >>link.dbg
-cl.exe /nologo /MT /W4 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c misc.c
-echo WinDebug\misc.obj >>link.dbg
-cl.exe /nologo /MT /W4 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c ar.c
-echo WinDebug\ar.obj >>link.dbg
-cl.exe /nologo /MT /W4 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c function.c
-echo WinDebug\function.obj >>link.dbg
-cl.exe /nologo /MT /W4 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c vpath.c
-echo WinDebug\vpath.obj >>link.dbg
-cl.exe /nologo /MT /W4 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c implicit.c
-echo WinDebug\implicit.obj >>link.dbg
-cl.exe /nologo /MT /W4 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c loadapi.c
-echo WinDebug\loadapi.obj >>link.dbg
-cl.exe /nologo /MT /W4 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c load.c
-echo WinDebug\load.obj >>link.dbg
-cl.exe /nologo /MT /W4 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c .\w32\compat\dirent.c
-echo WinDebug\dirent.obj >>link.dbg
-cl.exe /nologo /MT /W4 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c .\w32\compat\posixfcn.c
-echo WinDebug\posixfcn.obj >>link.dbg
-cl.exe /nologo /MT /W4 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c .\glob\glob.c
-echo WinDebug\glob.obj >>link.dbg
-cl.exe /nologo /MT /W4 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c .\glob\fnmatch.c
-echo WinDebug\fnmatch.obj >>link.dbg
-cl.exe /nologo /MT /W4 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c .\w32\pathstuff.c
-echo WinDebug\pathstuff.obj >>link.dbg
-cl.exe /nologo /MT /W4 /GX /Zi /YX /Od %GUILECFLAGS% /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c guile.c
-echo WinDebug\guile.obj >>link.dbg
-:LinkDbg
-echo off
-echo "Linking WinDebug/%make%.exe"
-rem link.exe %GUILELIBS% 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/output.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 %GUILELIBS% 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 /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!"
-if not exist .\WinRel\nul mkdir .\WinRel
-echo on
-cl.exe /nologo /MT /W4 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D TIVOLI /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c variable.c
-echo WinRel\variable.obj >>link.rel
-cl.exe /nologo /MT /W4 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c rule.c
-echo WinRel\rule.obj >>link.rel
-cl.exe /nologo /MT /W4 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c remote-stub.c
-echo WinRel\remote-stub.obj >>link.rel
-cl.exe /nologo /MT /W4 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c commands.c
-echo WinRel\commands.obj >>link.rel
-cl.exe /nologo /MT /W4 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c file.c
-echo WinRel\file.obj >>link.rel
-cl.exe /nologo /MT /W4 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c getloadavg.c
-echo WinRel\getloadavg.obj >>link.rel
-cl.exe /nologo /MT /W4 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c default.c
-echo WinRel\default.obj >>link.rel
-cl.exe /nologo /MT /W4 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c signame.c
-echo WinRel\signame.obj >>link.rel
-cl.exe /nologo /MT /W4 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c expand.c
-echo WinRel\expand.obj >>link.rel
-cl.exe /nologo /MT /W4 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c dir.c
-echo WinRel\dir.obj >>link.rel
-cl.exe /nologo /MT /W4 /GX /YX /O2 %GUILECFLAGS% /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c main.c
-echo WinRel\main.obj >>link.rel
-cl.exe /nologo /MT /W4 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c getopt1.c
-echo WinRel\getopt1.obj >>link.rel
-cl.exe /nologo /MT /W4 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c job.c
-echo WinRel\job.obj >>link.rel
-cl.exe /nologo /MT /W4 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c output.c
-echo WinRel\output.obj >>link.rel
-cl.exe /nologo /MT /W4 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c read.c
-echo WinRel\read.obj >>link.rel
-cl.exe /nologo /MT /W4 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c version.c
-echo WinRel\version.obj >>link.rel
-cl.exe /nologo /MT /W4 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c getopt.c
-echo WinRel\getopt.obj >>link.rel
-cl.exe /nologo /MT /W4 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c arscan.c
-echo WinRel\arscan.obj >>link.rel
-cl.exe /nologo /MT /W4 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c remake.c
-echo WinRel\remake.obj >>link.rel
-cl.exe /nologo /MT /W4 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c hash.c
-echo WinRel\hash.obj >>link.rel
-cl.exe /nologo /MT /W4 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c strcache.c
-echo WinRel\strcache.obj >>link.rel
-cl.exe /nologo /MT /W4 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c misc.c
-echo WinRel\misc.obj >>link.rel
-cl.exe /nologo /MT /W4 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c ar.c
-echo WinRel\ar.obj >>link.rel
-cl.exe /nologo /MT /W4 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c function.c
-echo WinRel\function.obj >>link.rel
-cl.exe /nologo /MT /W4 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c vpath.c
-echo WinRel\vpath.obj >>link.rel
-cl.exe /nologo /MT /W4 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c implicit.c
-echo WinRel\implicit.obj >>link.rel
-cl.exe /nologo /MT /W4 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c loadapi.c
-echo WinRel\loadapi.obj >>link.rel
-cl.exe /nologo /MT /W4 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c load.c
-echo WinRel\load.obj >>link.rel
-cl.exe /nologo /MT /W4 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c .\w32\compat\dirent.c
-echo WinRel\dirent.obj >>link.rel
-cl.exe /nologo /MT /W4 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c .\w32\compat\posixfcn.c
-echo WinRel\posixfcn.obj >>link.rel
-cl.exe /nologo /MT /W4 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c .\glob\glob.c
-echo WinRel\glob.obj >>link.rel
-cl.exe /nologo /MT /W4 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c .\glob\fnmatch.c
-echo WinRel\fnmatch.obj >>link.rel
-cl.exe /nologo /MT /W4 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c .\w32\pathstuff.c
-echo WinRel\pathstuff.obj >>link.rel
-cl.exe /nologo /MT /W4 /GX /YX /O2 %GUILECFLAGS% /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c guile.c
-echo WinRel\guile.obj >>link.rel
-:LinkRel
-echo off
-echo "Linking WinRel/%make%.exe"
-rem link.exe %GUILELIBS% 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/output.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 %GUILELIBS% 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 /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!"
-set make=
-GoTo BuildEnd
-:GCCBuild
-echo on
-gcc -mthreads -Wall -gdwarf-2 -g3 %OPT% -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c variable.c
-gcc -mthreads -Wall -gdwarf-2 -g3 %OPT% -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c rule.c
-gcc -mthreads -Wall -gdwarf-2 -g3 %OPT% -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c remote-stub.c
-gcc -mthreads -Wall -gdwarf-2 -g3 %OPT% -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c commands.c
-gcc -mthreads -Wall -gdwarf-2 -g3 %OPT% -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c file.c
-gcc -mthreads -Wall -gdwarf-2 -g3 %OPT% -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c getloadavg.c
-gcc -mthreads -Wall -gdwarf-2 -g3 %OPT% -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c default.c
-gcc -mthreads -Wall -gdwarf-2 -g3 %OPT% -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c signame.c
-gcc -mthreads -Wall -gdwarf-2 -g3 %OPT% -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c expand.c
-gcc -mthreads -Wall -gdwarf-2 -g3 %OPT% -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c dir.c
-gcc -mthreads -Wall -gdwarf-2 -g3 %OPT% -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H %GUILECFLAGS% -c main.c
-gcc -mthreads -Wall -gdwarf-2 -g3 %OPT% -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c getopt1.c
-gcc -mthreads -Wall -gdwarf-2 -g3 %OPT% -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c job.c
-gcc -mthreads -Wall -gdwarf-2 -g3 %OPT% -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c output.c
-gcc -mthreads -Wall -gdwarf-2 -g3 %OPT% -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c read.c
-gcc -mthreads -Wall -gdwarf-2 -g3 %OPT% -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c version.c
-gcc -mthreads -Wall -gdwarf-2 -g3 %OPT% -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c getopt.c
-gcc -mthreads -Wall -gdwarf-2 -g3 %OPT% -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c arscan.c
-gcc -mthreads -Wall -gdwarf-2 -g3 %OPT% -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c remake.c
-gcc -mthreads -Wall -gdwarf-2 -g3 %OPT% -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c hash.c
-gcc -mthreads -Wall -gdwarf-2 -g3 %OPT% -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c strcache.c
-gcc -mthreads -Wall -gdwarf-2 -g3 %OPT% -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c misc.c
-gcc -mthreads -Wall -gdwarf-2 -g3 %OPT% -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c ar.c
-gcc -mthreads -Wall -gdwarf-2 -g3 %OPT% -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c function.c
-gcc -mthreads -Wall -gdwarf-2 -g3 %OPT% -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c vpath.c
-gcc -mthreads -Wall -gdwarf-2 -g3 %OPT% -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c implicit.c
-gcc -mthreads -Wall -gdwarf-2 -g3 %OPT% -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c loadapi.c
-gcc -mthreads -Wall -gdwarf-2 -g3 %OPT% -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c load.c
-gcc -mthreads -Wall -gdwarf-2 -g3 %OPT% -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c ./glob/glob.c -o glob.o
-gcc -mthreads -Wall -gdwarf-2 -g3 %OPT% -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c ./glob/fnmatch.c -o fnmatch.o
-gcc -mthreads -Wall -gdwarf-2 -g3 %OPT% -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c ./w32/pathstuff.c -o pathstuff.o
-gcc -mthreads -Wall -gdwarf-2 -g3 %OPT% -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c ./w32/compat/posixfcn.c -o posixfcn.o
-gcc -mthreads -Wall -gdwarf-2 -g3 %OPT% %GUILECFLAGS% -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c guile.c
-:LinkGCC
-@echo off
-Rem The version NN of libgnumake-NN.dll.a should be bumped whenever
-Rem the API changes in binary-incompatible manner.
-@echo on
-gcc -mthreads -gdwarf-2 -g3 -o gnumake.exe variable.o rule.o remote-stub.o commands.o file.o getloadavg.o default.o signame.o expand.o dir.o main.o getopt1.o guile.o job.o output.o read.o version.o getopt.o arscan.o remake.o misc.o hash.o strcache.o ar.o function.o vpath.o implicit.o loadapi.o load.o glob.o fnmatch.o pathstuff.o posixfcn.o w32_misc.o sub_proc.o w32err.o %GUILELIBS% -lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -luuid -lodbc32 -lodbccp32 -Wl,--out-implib=libgnumake-1.dll.a
-@GoTo BuildEnd
-:Usage
-echo Usage: %0 [options] [gcc]
-echo Options:
-echo. --debug For GCC only, make a debug build
-echo. (MSVC build always makes both debug and release)
-echo. --without-guile Do not compile Guile support even if found
-echo. --help Display these instructions and exit
-:BuildEnd
-@echo off
-set GUILELIBS=
-set GUILECFLAGS=
-set PKGMSC=
-set OPT=
-set COMPILER=
-set NOGUILE=
-echo on
+@echo off
+rem Copyright (C) 1996-2016 Free Software Foundation, Inc.
+rem This file is part of GNU Make.
+rem
+rem GNU Make is free software; you can redistribute it and/or modify it under
+rem the terms of the GNU General Public License as published by the Free
+rem Software Foundation; either version 3 of the License, or (at your option)
+rem any later version.
+rem
+rem GNU Make is distributed in the hope that it will be useful, but WITHOUT
+rem ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+rem FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for.
+rem more details.
+rem
+rem You should have received a copy of the GNU General Public License along
+rem with this program. If not, see <http://www.gnu.org/licenses/>.
+
+call :Reset
+
+if "%1" == "-h" goto Usage
+if "%1" == "--help" goto Usage
+
+set MAKE=gnumake
+set GUILE=Y
+set COMPILER=msvc
+
+:ParseSW
+if "%1" == "--debug" goto SetDebug
+if "%1" == "--without-guile" goto NoGuile
+if "%1" == "gcc" goto SetCC
+if "%1" == "" goto DoneSW
+
+:SetDebug
+set DEBUG=Y
+shift
+goto ParseSW
+
+:NoGuile
+set GUILE=N
+echo Building without Guile
+shift
+goto ParseSW
+
+:SetCC
+set COMPILER=gcc
+echo Building with GCC
+shift
+goto ParseSW
+
+rem Build with Guile is supported only on NT and later versions
+:DoneSW
+echo.
+echo Creating GNU Make for Windows 9X/NT/2K/XP/Vista/7/8
+if "%DEBUG%" == "Y" echo Building without compiler optimizations
+
+if "%COMPILER%" == "gcc" goto GccBuild
+
+set OUTDIR=.\WinRel
+set "OPTS=/O2 /D NDEBUG"
+set LINKOPTS=
+if "%DEBUG%" == "Y" set OUTDIR=.\WinDebug
+if "%DEBUG%" == "Y" set "OPTS=/Zi /Od /D _DEBUG"
+if "%DEBUG%" == "Y" set LINKOPTS=/DEBUG
+call :Build
+goto Done
+
+:GccBuild
+set OUTDIR=.\GccRel
+set OPTS=-O2
+if "%DEBUG%" == "Y" set OPTS=-O0
+if "%DEBUG%" == "Y" set OUTDIR=.\GccDebug
+call :Build
+goto Done
+
+:Done
+call :Reset
+goto :EOF
+
+:Build
+:: Clean the directory if it exists
+if exist %OUTDIR%\nul rmdir /S /Q %OUTDIR%
+
+:: Recreate it
+mkdir %OUTDIR%
+mkdir %OUTDIR%\glob
+mkdir %OUTDIR%\w32
+mkdir %OUTDIR%\w32\compat
+mkdir %OUTDIR%\w32\subproc
+
+if "%GUILE%" == "Y" call :ChkGuile
+
+echo.
+echo Compiling %OUTDIR% version
+
+if exist config.h.W32.template call :ConfigSCM
+copy config.h.W32 %OUTDIR%\config.h
+
+call :Compile ar
+call :Compile arscan
+call :Compile commands
+call :Compile default
+call :Compile dir
+call :Compile expand
+call :Compile file
+call :Compile function
+call :Compile getloadavg
+call :Compile getopt
+call :Compile getopt1
+call :Compile glob\fnmatch
+call :Compile glob\glob
+call :Compile guile GUILE
+call :Compile hash
+call :Compile implicit
+call :Compile job
+call :Compile load
+call :Compile loadapi
+call :Compile main GUILE
+call :Compile misc
+call :Compile output
+call :Compile read
+call :Compile remake
+call :Compile remote-stub
+call :Compile rule
+call :Compile signame
+call :Compile strcache
+call :Compile variable
+call :Compile version
+call :Compile vpath
+call :Compile w32\compat\posixfcn
+call :Compile w32\pathstuff
+call :Compile w32\subproc\misc
+call :Compile w32\subproc\sub_proc
+call :Compile w32\subproc\w32err
+call :Compile w32\w32os
+
+if not "%COMPILER%" == "gcc" call :Compile w32\compat\dirent
+
+call :Link
+
+echo.
+if not exist %OUTDIR%\%MAKE%.exe echo %OUTDIR% build FAILED!
+if exist %OUTDIR%\%MAKE%.exe echo %OUTDIR% build succeeded.
+goto :EOF
+
+:Compile
+set EXTRAS=
+if "%2" == "GUILE" set "EXTRAS=%GUILECFLAGS%"
+if "%COMPILER%" == "gcc" goto GccCompile
+
+:: MSVC Compile
+echo on
+cl.exe /nologo /MT /W4 /EHsc %OPTS% /I %OUTDIR% /I . /I glob /I w32/include /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR%OUTDIR% /Fp%OUTDIR%\%MAKE%.pch /Fo%OUTDIR%\%1.obj /Fd%OUTDIR%\%MAKE%.pdb %EXTRAS% /c %1.c
+@echo off
+echo %OUTDIR%\%1.obj >>%OUTDIR%\link.sc
+goto :EOF
+
+:GccCompile
+:: GCC Compile
+echo on
+gcc -mthreads -Wall -std=gnu99 -gdwarf-2 -g3 %OPTS% -I%OUTDIR% -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H %EXTRAS% -o %OUTDIR%\%1.o -c %1.c
+@echo off
+goto :EOF
+
+:Link
+echo Linking %OUTDIR%/%MAKE%.exe
+if "%COMPILER%" == "gcc" goto GccLink
+
+:: MSVC Link
+echo %GUILELIBS% kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib >>%OUTDIR%\link.sc
+echo on
+link.exe /NOLOGO /SUBSYSTEM:console /PDB:%OUTDIR%\%MAKE%.pdb %LINKOPTS% /OUT:%OUTDIR%\%MAKE%.exe @%OUTDIR%\link.sc
+@echo off
+goto :EOF
+
+:GccLink
+:: GCC Link
+echo on
+gcc -mthreads -gdwarf-2 -g3 -o %OUTDIR%\%MAKE%.exe %OUTDIR%\variable.o %OUTDIR%\rule.o %OUTDIR%\remote-stub.o %OUTDIR%\commands.o %OUTDIR%\file.o %OUTDIR%\getloadavg.o %OUTDIR%\default.o %OUTDIR%\signame.o %OUTDIR%\expand.o %OUTDIR%\dir.o %OUTDIR%\main.o %OUTDIR%\getopt1.o %OUTDIR%\guile.o %OUTDIR%\job.o %OUTDIR%\output.o %OUTDIR%\read.o %OUTDIR%\version.o %OUTDIR%\getopt.o %OUTDIR%\arscan.o %OUTDIR%\remake.o %OUTDIR%\misc.o %OUTDIR%\hash.o %OUTDIR%\strcache.o %OUTDIR%\ar.o %OUTDIR%\function.o %OUTDIR%\vpath.o %OUTDIR%\implicit.o %OUTDIR%\loadapi.o %OUTDIR%\load.o %OUTDIR%\glob\glob.o %OUTDIR%\glob\fnmatch.o %OUTDIR%\w32\pathstuff.o %OUTDIR%\w32\compat\posixfcn.o %OUTDIR%\w32\w32os.o %OUTDIR%\w32\subproc\misc.o %OUTDIR%\w32\subproc\sub_proc.o %OUTDIR%\w32\subproc\w32err.o %GUILELIBS% -lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -luuid -lodbc32 -lodbccp32 -Wl,--out-implib=%OUTDIR%\libgnumake-1.dll.a
+@echo off
+goto :EOF
+
+:ConfigSCM
+echo Generating config from SCM templates
+sed -n "s/^AC_INIT(\[GNU make\],\[\([^]]\+\)\].*/s,%%VERSION%%,\1,g/p" configure.ac > %OUTDIR%\config.h.W32.sed
+echo s,%%PACKAGE%%,make,g >> %OUTDIR%\config.h.W32.sed
+sed -f %OUTDIR%\config.h.W32.sed config.h.W32.template > config.h.W32
+echo static const char *const GUILE_module_defn = ^" \> gmk-default.h
+sed -e "s/;.*//" -e "/^[ \t]*$/d" -e "s/\"/\\\\\"/g" -e "s/$/ \\\/" gmk-default.scm >> gmk-default.h
+echo ^";>> gmk-default.h
+goto :EOF
+
+:ChkGuile
+if not "%OS%" == "Windows_NT" goto NoGuile
+pkg-config --help > %OUTDIR%\guile.tmp 2> NUL
+if ERRORLEVEL 1 goto NoPkgCfg
+
+echo Checking for Guile 2.0
+if not "%COMPILER%" == "gcc" set PKGMSC=--msvc-syntax
+pkg-config --cflags --short-errors "guile-2.0" > %OUTDIR%\guile.tmp
+if not ERRORLEVEL 1 set /P GUILECFLAGS= < %OUTDIR%\guile.tmp
+
+pkg-config --libs --static --short-errors %PKGMSC% "guile-2.0" > %OUTDIR%\guile.tmp
+if not ERRORLEVEL 1 set /P GUILELIBS= < %OUTDIR%\guile.tmp
+
+if not "%GUILECFLAGS%" == "" goto GuileDone
+
+echo Checking for Guile 1.8
+pkg-config --cflags --short-errors "guile-1.8" > %OUTDIR%\guile.tmp
+if not ERRORLEVEL 1 set /P GUILECFLAGS= < %OUTDIR%\guile.tmp
+
+pkg-config --libs --static --short-errors %PKGMSC% "guile-1.8" > %OUTDIR%\guile.tmp
+if not ERRORLEVEL 1 set /P GUILELIBS= < %OUTDIR%\guile.tmp
+
+if not "%GUILECFLAGS%" == "" goto GuileDone
+
+echo No Guile found, building without Guile
+goto GuileDone
+
+:NoPkgCfg
+echo pkg-config not found, building without Guile
+
+:GuileDone
+if "%GUILECFLAGS%" == "" goto :EOF
+
+echo Guile found, building with Guile
+set "GUILECFLAGS=%GUILECFLAGS% -DHAVE_GUILE"
+goto :EOF
+
+:Usage
+echo Usage: %0 [options] [gcc]
+echo Options:
+echo. --debug For GCC only, make a debug build
+echo. (MSVC build always makes both debug and release)
+echo. --without-guile Do not compile Guile support even if found
+echo. --help Display these instructions and exit
+goto :EOF
+
+:Reset
+set COMPILER=
+set DEBUG=
+set GUILE=
+set GUILECFLAGS=
+set GUILELIBS=
+set LINKOPTS=
+set MAKE=
+set NOGUILE=
+set OPTS=
+set OUTDIR=
+set PKGMSC=
+goto :EOF
diff --git a/commands.c b/commands.c
index 7123021f..124b93e3 100644
--- a/commands.c
+++ b/commands.c
@@ -1,5 +1,5 @@
/* Command processing for GNU Make.
-Copyright (C) 1988-2014 Free Software Foundation, Inc.
+Copyright (C) 1988-2016 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
@@ -26,13 +26,11 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
#endif
#if VMS
-# define FILE_LIST_SEPARATOR ','
+# define FILE_LIST_SEPARATOR (vms_comma_separator ? ',' : ' ')
#else
# define FILE_LIST_SEPARATOR ' '
#endif
-int remote_kill (int id, int sig);
-
#ifndef HAVE_UNISTD_H
int getpid ();
#endif
@@ -411,10 +409,10 @@ chop_commands (struct commands *cmds)
for (idx = 0; idx < nlines; ++idx)
{
- int flags = 0;
+ unsigned char flags = 0;
const char *p = lines[idx];
- while (isblank (*p) || *p == '-' || *p == '@' || *p == '+')
+ while (ISBLANK (*p) || *p == '-' || *p == '@' || *p == '+')
switch (*(p++))
{
case '+':
@@ -451,7 +449,7 @@ execute_file_commands (struct file *file)
the commands are nothing but whitespace. */
for (p = file->cmds->commands; *p != '\0'; ++p)
- if (!isspace ((unsigned char)*p) && *p != '-' && *p != '@')
+ if (!ISSPACE (*p) && *p != '-' && *p != '@' && *p != '+')
break;
if (*p == '\0')
{
diff --git a/commands.h b/commands.h
index 0d58f22d..18d8c285 100644
--- a/commands.h
+++ b/commands.h
@@ -1,5 +1,5 @@
/* Definition of data structures describing shell commands for GNU Make.
-Copyright (C) 1988-2014 Free Software Foundation, Inc.
+Copyright (C) 1988-2016 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
@@ -19,10 +19,10 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
struct commands
{
- gmk_floc fileinfo; /* Where commands were defined. */
+ floc fileinfo; /* Where commands were defined. */
char *commands; /* Commands text. */
char **command_lines; /* Commands chopped up into lines. */
- char *lines_flags; /* One set of flag bits for each line. */
+ unsigned char *lines_flags; /* One set of flag bits for each line. */
unsigned short ncommand_lines;/* Number of command lines. */
char recipe_prefix; /* Recipe prefix for this command set. */
unsigned int any_recurse:1; /* Nonzero if any 'lines_flags' elt has */
@@ -34,6 +34,7 @@ struct commands
#define COMMANDS_SILENT 2 /* Silent: @. */
#define COMMANDS_NOERROR 4 /* No errors: -. */
+RETSIGTYPE fatal_error_signal (int sig);
void execute_file_commands (struct file *file);
void print_commands (const struct commands *cmds);
void delete_child_targets (struct child *child);
diff --git a/config.ami.template b/config.ami.template
new file mode 100644
index 00000000..4c5bb78b
--- /dev/null
+++ b/config.ami.template
@@ -0,0 +1,337 @@
+/* config.h -- hand-massaged for Amiga -*-C-*-
+Copyright (C) 1995-2016 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
+terms of the GNU General Public License as published by the Free Software
+Foundation; either version 3 of the License, or (at your option) any later
+version.
+
+GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License along with
+this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Define if on AIX 3.
+ System headers sometimes define this.
+ We just want to avoid a redefinition error message. */
+#ifndef _ALL_SOURCE
+/* #undef _ALL_SOURCE */
+#endif
+
+/* Define if using alloca.c. */
+#define C_ALLOCA
+
+/* Define if the closedir function returns void instead of int. */
+/* #undef CLOSEDIR_VOID */
+
+/* Define to empty if the keyword does not work. */
+/* #undef const */
+
+/* Define to one of _getb67, GETB67, getb67 for Cray-2 and Cray-YMP systems.
+ This function is required for alloca.c support on those systems. */
+/* #undef CRAY_STACKSEG_END */
+
+/* Define for DGUX with <sys/dg_sys_info.h>. */
+/* #undef DGUX */
+
+/* Define if the 'getloadavg' function needs to be run setuid or setgid. */
+/* #undef GETLOADAVG_PRIVILEGED */
+
+/* Define to 'unsigned long' or 'unsigned long long'
+ if <inttypes.h> doesn't define. */
+#define uintmax_t unsigned long
+
+/* Define to 'int' if <sys/types.h> doesn't define. */
+#define gid_t int
+
+/* Define if you have alloca, as a function or macro. */
+/* #undef HAVE_ALLOCA */
+
+/* Define if you have <alloca.h> and it should be used (not on Ultrix). */
+/* #undef HAVE_ALLOCA_H */
+
+/* Define if your system has a working fnmatch function. */
+/* #undef HAVE_FNMATCH */
+
+/* Define if your system has its own 'getloadavg' function. */
+/* #undef HAVE_GETLOADAVG */
+
+/* Define if you have the getmntent function. */
+/* #undef HAVE_GETMNTENT */
+
+/* Embed GNU Guile support */
+/* #undef HAVE_GUILE */
+
+/* Define if the 'long double' type works. */
+/* #undef HAVE_LONG_DOUBLE */
+
+/* Define if you support file names longer than 14 characters. */
+#define HAVE_LONG_FILE_NAMES 1
+
+/* Define if you have a working 'mmap' system call. */
+/* #undef HAVE_MMAP */
+
+/* Define if system calls automatically restart after interruption
+ by a signal. */
+/* #undef HAVE_RESTARTABLE_SYSCALLS */
+
+/* Define if your struct stat has st_blksize. */
+/* #undef HAVE_ST_BLKSIZE */
+
+/* Define if your struct stat has st_blocks. */
+/* #undef HAVE_ST_BLOCKS */
+
+/* Define if you have the strcoll function and it is properly defined. */
+#define HAVE_STRCOLL 1
+
+/* Define if your struct stat has st_rdev. */
+#define HAVE_ST_RDEV 1
+
+/* Define if you have the strftime function. */
+#define HAVE_STRFTIME 1
+
+/* Define if you have <sys/wait.h> that is POSIX.1 compatible. */
+/* #undef HAVE_SYS_WAIT_H */
+
+/* Define if your struct tm has tm_zone. */
+/* #undef HAVE_TM_ZONE */
+
+/* Define if you don't have tm_zone but do have the external array
+ tzname. */
+#define HAVE_TZNAME 1
+
+/* Define if you have <unistd.h>. */
+#define HAVE_UNISTD_H 1
+
+/* Define if utime(file, NULL) sets file's timestamp to the present. */
+/* #undef HAVE_UTIME_NULL */
+
+/* Define if you have the wait3 system call. */
+/* #undef HAVE_WAIT3 */
+
+/* Define if on MINIX. */
+/* #undef _MINIX */
+
+/* Define if your struct nlist has an n_un member. */
+/* #undef NLIST_NAME_UNION */
+
+/* Define if you have <nlist.h>. */
+/* #undef NLIST_STRUCT */
+
+/* Define if your C compiler doesn't accept -c and -o together. */
+/* #undef NO_MINUS_C_MINUS_O */
+
+/* Define to 'int' if <sys/types.h> doesn't define. */
+#define pid_t int
+
+/* Define if the system does not provide POSIX.1 features except
+ with this defined. */
+/* #undef _POSIX_1_SOURCE */
+
+/* Define if you need to in order for stat and other things to work. */
+/* #undef _POSIX_SOURCE */
+
+/* Define as the return type of signal handlers (int or void). */
+#define RETSIGTYPE void
+
+/* Define if the setvbuf function takes the buffering type as its second
+ argument and the buffer pointer as the third, as on System V
+ before release 3. */
+/* #undef SETVBUF_REVERSED */
+
+/* If using the C implementation of alloca, define if you know the
+ direction of stack growth for your system; otherwise it will be
+ automatically deduced at run-time.
+ STACK_DIRECTION > 0 => grows toward higher addresses
+ STACK_DIRECTION < 0 => grows toward lower addresses
+ STACK_DIRECTION = 0 => direction of growth unknown
+ */
+#define STACK_DIRECTION -1
+
+/* Define if the 'S_IS*' macros in <sys/stat.h> do not work properly. */
+/* #undef STAT_MACROS_BROKEN */
+
+/* Define if you have the ANSI C header files. */
+#define STDC_HEADERS
+
+/* Define on System V Release 4. */
+/* #undef SVR4 */
+
+/* Define if 'sys_siglist' is declared by <signal.h>. */
+/* #undef SYS_SIGLIST_DECLARED */
+
+/* Define to 'int' if <sys/types.h> doesn't define. */
+#define uid_t int
+
+/* Define for Encore UMAX. */
+/* #undef UMAX */
+
+/* Define for Encore UMAX 4.3 that has <inq_status/cpustats.h>
+ instead of <sys/cpustats.h>. */
+/* #undef UMAX4_3 */
+
+/* Name of this package (needed by automake) */
+#define PACKAGE "%PACKAGE%"
+
+/* Version of this package (needed by automake) */
+#define VERSION "%VERSION%"
+
+/* Define to the name of the SCCS 'get' command. */
+#define SCCS_GET "get"
+
+/* Define this if the SCCS 'get' command understands the '-G<file>' option. */
+/* #undef SCCS_GET_MINUS_G */
+
+/* Define this to enable job server support in GNU make. */
+/* #undef MAKE_JOBSERVER */
+
+/* Define to be the nanoseconds member of struct stat's st_mtim,
+ if it exists. */
+/* #undef ST_MTIM_NSEC */
+
+/* Define this if the C library defines the variable 'sys_siglist'. */
+/* #undef HAVE_SYS_SIGLIST */
+
+/* Define this if the C library defines the variable '_sys_siglist'. */
+/* #undef HAVE__SYS_SIGLIST */
+
+/* Define this if you have the 'union wait' type in <sys/wait.h>. */
+/* #undef HAVE_UNION_WAIT */
+
+/* Define if you have the dup2 function. */
+/* #undef HAVE_DUP2 */
+
+/* Define if you have the getcwd function. */
+#define HAVE_GETCWD 1
+
+/* Define if you have the getgroups function. */
+/* #undef HAVE_GETGROUPS */
+
+/* Define if you have the gethostbyname function. */
+/* #undef HAVE_GETHOSTBYNAME */
+
+/* Define if you have the gethostname function. */
+/* #undef HAVE_GETHOSTNAME */
+
+/* Define if you have the memmove function. */
+#define HAVE_MEMMOVE 1
+
+/* Define if you have the mktemp function. */
+#define HAVE_MKTEMP 1
+
+/* Define if you have the psignal function. */
+/* #undef HAVE_PSIGNAL */
+
+/* Define if you have the pstat_getdynamic function. */
+/* #undef HAVE_PSTAT_GETDYNAMIC */
+
+/* Define if you have the setegid function. */
+/* #undef HAVE_SETEGID */
+
+/* Define if you have the seteuid function. */
+/* #undef HAVE_SETEUID */
+
+/* Define if you have the setlinebuf function. */
+/* #undef HAVE_SETLINEBUF */
+
+/* Define if you have the setregid function. */
+/* #undef HAVE_SETREGID */
+
+/* Define if you have the setreuid function. */
+/* #undef HAVE_SETREUID */
+
+/* Define if you have the sigsetmask function. */
+/* #undef HAVE_SIGSETMASK */
+
+/* Define if you have the socket function. */
+/* #undef HAVE_SOCKET */
+
+/* Define to 1 if you have the strcasecmp function. */
+/* #undef HAVE_STRCASECMP */
+
+/* Define to 1 if you have the strcmpi function. */
+/* #undef HAVE_STRCMPI */
+
+/* Define to 1 if you have the stricmp function. */
+/* #undef HAVE_STRICMP */
+
+/* Define if you have the strerror function. */
+#define HAVE_STRERROR 1
+
+/* Define if you have the strsignal function. */
+/* #undef HAVE_STRSIGNAL */
+
+/* Define if you have the wait3 function. */
+/* #undef HAVE_WAIT3 */
+
+/* Define if you have the waitpid function. */
+/* #undef HAVE_WAITPID */
+
+/* Define if you have the <dirent.h> header file. */
+#define HAVE_DIRENT_H 1
+
+/* Define if you have the <fcntl.h> header file. */
+#define HAVE_FCNTL_H 1
+
+/* Define if you have the <limits.h> header file. */
+#define HAVE_LIMITS_H 1
+
+/* Define if you have the <mach/mach.h> header file. */
+/* #undef HAVE_MACH_MACH_H */
+
+/* Define if you have the <memory.h> header file. */
+/* #undef HAVE_MEMORY_H */
+
+/* Define if you have the <ndir.h> header file. */
+/* #undef HAVE_NDIR_H */
+
+/* Define if you have the <stdlib.h> header file. */
+/* #undef HAVE_STDLIB_H */
+
+/* Define if you have the <string.h> header file. */
+#define HAVE_STRING_H 1
+
+/* Define if you have the <sys/dir.h> header file. */
+#define HAVE_SYS_DIR_H 1
+
+/* Define if you have the <sys/ndir.h> header file. */
+/* #undef HAVE_SYS_NDIR_H */
+
+/* Define if you have the <sys/param.h> header file. */
+/* #undef HAVE_SYS_PARAM_H */
+
+/* Define if you have the <sys/timeb.h> header file. */
+/* #undef HAVE_SYS_TIMEB_H */
+
+/* Define if you have the <sys/wait.h> header file. */
+/* #undef HAVE_SYS_WAIT_H */
+
+/* Define if you have the <unistd.h> header file. */
+#define HAVE_UNISTD_H 1
+
+/* Define if you have the dgc library (-ldgc). */
+/* #undef HAVE_LIBDGC */
+
+/* Define if you have the kstat library (-lkstat). */
+/* #undef HAVE_LIBKSTAT */
+
+/* Define to 1 if you have the `isatty' function. */
+/* #undef HAVE_ISATTY */
+
+/* Define to 1 if you have the `ttyname' function. */
+/* #undef HAVE_TTYNAME */
+
+/* Define if you have the sun library (-lsun). */
+/* #undef HAVE_LIBSUN */
+
+/* Output sync sypport */
+#define NO_OUTPUT_SYNC
+
+/* Define for Case Insensitve behavior */
+#define HAVE_CASE_INSENSITIVE_FS
+
+/* Build host information. */
+#define MAKE_HOST "Amiga"
diff --git a/config.h-vms.template b/config.h-vms.template
new file mode 100644
index 00000000..2a4a943d
--- /dev/null
+++ b/config.h-vms.template
@@ -0,0 +1,432 @@
+/* config.h-vms. Generated by hand by Klaus Kämpf <kkaempf@rmi.de> -*-C-*-
+
+Copyright (C) 1996-2016 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
+terms of the GNU General Public License as published by the Free Software
+Foundation; either version 3 of the License, or (at your option) any later
+version.
+
+GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License along with
+this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* config.h. Generated automatically by configure. */
+/* config.h.in. Generated automatically from configure.ac by autoheader. */
+
+/* Pull in types.h here to get __CRTL_VER defined for old versions of the
+ compiler which don't define it. */
+#ifdef __DECC
+# include <types.h>
+#endif
+
+/* Define to 1 if on AIX 3.
+ System headers sometimes define this.
+ We just want to avoid a redefinition error message. */
+#ifndef _ALL_SOURCE
+/* #undef _ALL_SOURCE */
+#endif
+
+/* Define to 1 if NLS is requested. */
+/* #undef ENABLE_NLS */
+
+/* Define as 1 if you have dcgettext. */
+/* #undef HAVE_DCGETTEXT */
+
+/* Define as 1 if you have gettext and don't want to use GNU gettext. */
+/* #undef HAVE_GETTEXT */
+
+/* Embed GNU Guile support */
+/* #undef HAVE_GUILE */
+
+/* Define to 1 if your locale.h file contains LC_MESSAGES. */
+/* #undef HAVE_LC_MESSAGES */
+
+/* Define to the installation directory for locales. */
+#define LOCALEDIR ""
+
+/* Define as 1 if you have the stpcpy function. */
+/* #undef HAVE_STPCPY */
+
+/* Define to 1 if the closedir function returns void instead of int. */
+/* #undef CLOSEDIR_VOID */
+
+/* Define to empty if the keyword does not work. */
+/* #undef const */
+
+/* Define to one of _getb67, GETB67, getb67 for Cray-2 and Cray-YMP systems.
+ This function is required for alloca.c support on those systems. */
+/* #undef CRAY_STACKSEG_END */
+
+/* Define for DGUX with <sys/dg_sys_info.h>. */
+/* #undef DGUX */
+
+/* Define to 1 if the 'getloadavg' function needs to be run setuid or setgid. */
+/* #undef GETLOADAVG_PRIVILEGED */
+
+/* Define to 'unsigned long' or 'unsigned long long'
+ if <inttypes.h> doesn't define. */
+#define uintmax_t unsigned long
+
+/* Define to 'int' if <sys/types.h> doesn't define. */
+/* #undef gid_t */
+
+/* Define to 1 if you have alloca, as a function or macro. */
+#define HAVE_ALLOCA 1
+
+/* Define to 1 if you have <alloca.h> and it should be used (not on Ultrix). */
+/* #undef HAVE_ALLOCA_H */
+
+/* Define to 1 if you have the fdopen function. */
+#define HAVE_FDOPEN 1
+
+/* Define to 1 if your system has a working fnmatch function. */
+/* #undef HAVE_FNMATCH */
+
+/* Define to 1 if your system has its own 'getloadavg' function. */
+/* #undef HAVE_GETLOADAVG */
+
+/* Define to 1 if you have the getmntent function. */
+/* #undef HAVE_GETMNTENT */
+
+/* Define to 1 if the 'long double' type works. */
+/* #undef HAVE_LONG_DOUBLE */
+
+/* Define to 1 if you support file names longer than 14 characters. */
+#define HAVE_LONG_FILE_NAMES 1
+
+/* Define to 1 if you have a working 'mmap' system call. */
+/* #undef HAVE_MMAP */
+
+/* Define to 1 if system calls automatically restart after interruption
+ by a signal. */
+/* #undef HAVE_RESTARTABLE_SYSCALLS */
+
+/* Define to 1 if your struct stat has st_blksize. */
+/* #undef HAVE_ST_BLKSIZE */
+
+/* Define to 1 if your struct stat has st_blocks. */
+/* #undef HAVE_ST_BLOCKS */
+
+/* Define to 1 if you have the strcoll function and it is properly defined. */
+/* #undef HAVE_STRCOLL */
+
+/* Define to 1 if you have the strncasecmp' function. */
+#if __CRTL_VER >= 70000000
+#define HAVE_STRNCASECMP 1
+#endif
+
+/* Define to 1 if your struct stat has st_rdev. */
+/* #undef HAVE_ST_RDEV */
+
+/* Define to 1 if you have the strftime function. */
+/* #undef HAVE_STRFTIME */
+
+/* Define to 1 if you have <sys/wait.h> that is POSIX.1 compatible. */
+/* #undef HAVE_SYS_WAIT_H */
+
+/* Define to 1 if your struct tm has tm_zone. */
+/* #undef HAVE_TM_ZONE */
+
+/* Define to 1 if you don't have tm_zone but do have the external array
+ tzname. */
+/* #undef HAVE_TZNAME */
+
+/* Define to 1 if you have <unistd.h>. */
+#ifdef __DECC
+#define HAVE_UNISTD_H 1
+#endif
+
+/* Define to 1 if utime(file, NULL) sets file's timestamp to the present. */
+/* #undef HAVE_UTIME_NULL */
+
+/* Define to 1 if you have the wait3 system call. */
+/* #undef HAVE_WAIT3 */
+
+/* Define to 1 if on MINIX. */
+/* #undef _MINIX */
+
+/* Define to 1 if your struct nlist has an n_un member. */
+/* #undef NLIST_NAME_UNION */
+
+/* Define to 1 if you have <nlist.h>. */
+/* #undef NLIST_STRUCT */
+
+/* Define to 1 if your C compiler doesn't accept -c and -o together. */
+/* #undef NO_MINUS_C_MINUS_O */
+
+/* Define to 'int' if <sys/types.h> doesn't define. */
+/* I assume types.h is available for all 5.0 cc/cxx compilers */
+#if __DECC_VER < 50090000
+#define pid_t int
+#endif
+
+/* Define to 1 if the system does not provide POSIX.1 features except
+ with this defined. */
+/* #undef _POSIX_1_SOURCE */
+
+/* Define to 1 if you need to in order for stat and other things to work. */
+/* #undef _POSIX_SOURCE */
+
+/* Define as the return type of signal handlers (int or void). */
+#define RETSIGTYPE void
+
+/* Define to 1 if the setvbuf function takes the buffering type as its second
+ argument and the buffer pointer as the third, as on System V
+ before release 3. */
+/* #undef SETVBUF_REVERSED */
+
+/* If using the C implementation of alloca, define if you know the
+ direction of stack growth for your system; otherwise it will be
+ automatically deduced at run-time.
+ STACK_DIRECTION > 0 => grows toward higher addresses
+ STACK_DIRECTION < 0 => grows toward lower addresses
+ STACK_DIRECTION = 0 => direction of growth unknown
+ */
+/* #undef STACK_DIRECTION */
+
+/* Define to 1 if the 'S_IS*' macros in <sys/stat.h> do not work properly. */
+/* #undef STAT_MACROS_BROKEN */
+
+/* Define to 1 if you have the ANSI C header files. */
+/* #undef STDC_HEADERS */
+
+/* Define on System V Release 4. */
+/* #undef SVR4 */
+
+/* Define to 1 if 'sys_siglist' is declared by <signal.h>. */
+/* #undef SYS_SIGLIST_DECLARED */
+
+/* Define to 'int' if <sys/types.h> doesn't define. */
+#if __DECC_VER < 50090000
+#define uid_t int
+#endif
+
+/* Define for Encore UMAX. */
+/* #undef UMAX */
+
+/* Define for Encore UMAX 4.3 that has <inq_status/cpustats.h>
+ instead of <sys/cpustats.h>. */
+/* #undef UMAX4_3 */
+
+/* Name of this package (needed by automake) */
+#define PACKAGE "%PACKAGE%"
+
+/* Version of this package (needed by automake) */
+#define VERSION "%VERSION%"
+
+/* Define to the name of the SCCS 'get' command. */
+/* #undef SCCS_GET */
+
+/* Define this if the SCCS 'get' command understands the '-G<file>' option. */
+/* #undef SCCS_GET_MINUS_G */
+
+/* Define this to enable job server support in GNU make. */
+/* #undef MAKE_JOBSERVER */
+
+/* Define to be the nanoseconds member of struct stat's st_mtim,
+ if it exists. */
+/* #undef ST_MTIM_NSEC */
+
+/* Define to 1 if the C library defines the variable 'sys_siglist'. */
+/* #undefine HAVE_SYS_SIGLIST */
+
+/* Define to 1 if the C library defines the variable '_sys_siglist'. */
+/* #undef HAVE__SYS_SIGLIST */
+
+/* Define to 1 if you have the 'union wait' type in <sys/wait.h>. */
+/* #undef HAVE_UNION_WAIT */
+
+/* Define to 1 if you have the dup2 function. */
+#define HAVE_DUP2 1
+
+/* Define to 1 if you have the getcwd function. */
+#define HAVE_GETCWD 1
+
+/* Define to 1 if you have the getgroups function. */
+/* #undef HAVE_GETGROUPS */
+
+/* Define to 1 if you have the gethostbyname function. */
+/* #undef HAVE_GETHOSTBYNAME */
+
+/* Define to 1 if you have the gethostname function. */
+/* #undef HAVE_GETHOSTNAME */
+
+/* Define to 1 if you have the memmove function. */
+#define HAVE_MEMMOVE 1
+
+/* Define to 1 if you have the mktemp function. */
+#define HAVE_MKTEMP 1
+
+/* Define to 1 if you have the psignal function. */
+/* #undef HAVE_PSIGNAL */
+
+/* Define to 1 if you have the pstat_getdynamic function. */
+/* #undef HAVE_PSTAT_GETDYNAMIC */
+
+/* Define to 1 if you have the setegid function. */
+/* #undef HAVE_SETEGID */
+
+/* Define to 1 if you have the seteuid function. */
+/* #undef HAVE_SETEUID */
+
+/* Define to 1 if you have the setlinebuf function. */
+/* #undef HAVE_SETLINEBUF */
+
+/* Define to 1 if you have the setregid function. */
+/* #undefine HAVE_SETREGID */
+
+/* Define to 1 if you have the setreuid function. */
+/* #define HAVE_SETREUID */
+
+/* Define to 1 if you have the sigsetmask function. */
+#define HAVE_SIGSETMASK 1
+
+/* Define to 1 if you have the socket function. */
+/* #undef HAVE_SOCKET */
+
+/* Define to 1 if you have the strcasecmp function. */
+#define HAVE_STRCASECMP 1
+
+/* Define to 1 if you have the strcmpi function. */
+/* #undef HAVE_STRCMPI */
+
+/* Define to 1 if you have the stricmp function. */
+/* #undef HAVE_STRICMP */
+
+/* Define to 1 if you have the strerror function. */
+#define HAVE_STRERROR 1
+
+/* Define to 1 if you have the strsignal function. */
+/* #undef HAVE_STRSIGNAL */
+
+/* Define to 1 if you have the wait3 function. */
+/* #undef HAVE_WAIT3 */
+
+/* Define to 1 if you have the waitpid function. */
+/* #undef HAVE_WAITPID */
+
+/* Define to 1 if you have the <dirent.h> header file. */
+#define HAVE_DIRENT_H 1
+
+/* Define to 1 if you have the <fcntl.h> header file. */
+#ifdef __DECC
+#define HAVE_FCNTL_H 1
+#endif
+
+/* Define to 1 if you have the <limits.h> header file. */
+#define HAVE_LIMITS_H 1
+
+/* Define to 1 if you have the <mach/mach.h> header file. */
+/* #undef HAVE_MACH_MACH_H */
+
+/* Define to 1 if you have the <memory.h> header file. */
+/* #undef HAVE_MEMORY_H */
+
+/* Define to 1 if you have the <ndir.h> header file. */
+/* #undef HAVE_NDIR_H */
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#define HAVE_STDLIB_H 1
+
+/* Define to 1 if you have the <string.h> header file. */
+#define HAVE_STRING_H 1
+
+/* Define to 1 if you have the <sys/dir.h> header file. */
+/* #undef HAVE_SYS_DIR_H */
+
+/* Define to 1 if you have the <sys/ndir.h> header file. */
+/* #undef HAVE_SYS_NDIR_H */
+
+/* Define to 1 if you have the <sys/param.h> header file. */
+/* #undef HAVE_SYS_PARAM_H */
+
+/* Define to 1 if you have the <sys/timeb.h> header file. */
+#ifndef __GNUC__
+#define HAVE_SYS_TIMEB_H 1
+#endif
+
+/* Define to 1 if you have the <sys/wait.h> header file. */
+/* #undef HAVE_SYS_WAIT_H */
+
+/* Define to 1 if you have the dgc library (-ldgc). */
+/* #undef HAVE_LIBDGC */
+
+/* Define to 1 if you have the kstat library (-lkstat). */
+/* #undef HAVE_LIBKSTAT *
+
+/* Define to 1 if you have the sun library (-lsun). */
+/* #undef HAVE_LIBSUN */
+
+/* Define to 1 if you have the `isatty' function. */
+/* #undef HAVE_ISATTY */
+
+/* Define to 1 if you have the `ttyname' function. */
+/* #undef HAVE_TTYNAME */
+
+/* Use high resolution file timestamps if nonzero. */
+#define FILE_TIMESTAMP_HI_RES 0
+
+/* Define for case insensitve filenames */
+#define HAVE_CASE_INSENSITIVE_FS 1
+
+/* VMS specific, define it if you want to use case sensitive targets */
+/* #undef WANT_CASE_SENSITIVE_TARGETS */
+
+/* VMS specific, V7.0 has opendir() and friends, so it's undefined */
+/* If you want to use non-VMS code for opendir() etc. on V7.0 and greater
+ define the first or both macros AND change the compile command to get the
+ non-VMS versions linked: (prefix=(all,except=(opendir,... */
+/* #undef HAVE_VMSDIR_H */
+/* #undef _DIRENT_HAVE_D_NAMLEN */
+
+/* On older systems without 7.0 backport of CRTL use non-VMS code for opendir() etc. */
+#if __CRTL_VER < 70000000
+# define HAVE_VMSDIR_H 1
+#endif
+
+#if defined(HAVE_VMSDIR_H) && defined(HAVE_DIRENT_H)
+#undef HAVE_DIRENT_H
+#endif
+
+#define HAVE_STDLIB_H 1
+#define INCLUDEDIR "sys$sysroot:[syslib]"
+#define LIBDIR "sys$sysroot:[syslib]"
+
+/* Don't use RTL functions of OpenVMS */
+#ifdef __DECC
+#include <stdio.h>
+#include <unistd.h>
+#define getopt gnu_getopt
+#define optarg gnu_optarg
+#define optopt gnu_optopt
+#define optind gnu_optind
+#define opterr gnu_opterr
+#define globfree gnu_globfree
+#define glob gnu_glob
+#endif
+
+/* Define if using alloca.c. */
+/* #undef C_ALLOCA */
+/* maybe this should be placed into makeint.h */
+#if defined(__VAX) && defined(__DECC)
+#define alloca(n) __ALLOCA(n)
+#endif
+
+/* Output sync sypport */
+#define NO_OUTPUT_SYNC
+
+/* Define to 1 to write even short single-line actions into a VMS/DCL command
+ file; this also enables exporting make environment variables into the
+ (sub-)process, which executes the action.
+ The usual make rules apply whether a shell variable - here a DCL symbol or
+ VMS logical [see CRTL getenv()] - is added to the make environment and
+ is exported. */
+#define USE_DCL_COM_FILE 1
+
+/* Build host information. */
+#define MAKE_HOST "VMS"
diff --git a/config.h.W32.template b/config.h.W32.template
new file mode 100644
index 00000000..d72e79a3
--- /dev/null
+++ b/config.h.W32.template
@@ -0,0 +1,532 @@
+/* config.h.W32 -- hand-massaged config.h file for Windows builds -*-C-*-
+
+Copyright (C) 1996-2016 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
+terms of the GNU General Public License as published by the Free Software
+Foundation; either version 3 of the License, or (at your option) any later
+version.
+
+GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License along with
+this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Suppress some Visual C++ warnings.
+ Maybe after the code cleanup for ISO C we can remove some/all of these. */
+#if _MSC_VER > 1000
+# pragma warning(disable:4100) /* unreferenced formal parameter */
+# pragma warning(disable:4102) /* unreferenced label */
+# pragma warning(disable:4127) /* conditional expression is constant */
+# 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
+
+/* Define to 1 if the 'closedir' function returns void instead of 'int'. */
+/* #undef CLOSEDIR_VOID */
+
+/* Define to one of '_getb67', 'GETB67', 'getb67' for Cray-2 and Cray-YMP
+ systems. This function is required for 'alloca.c' support on those systems.
+ */
+/* #undef CRAY_STACKSEG_END */
+
+/* Define to 1 if using 'alloca.c'. */
+/* #undef C_ALLOCA */
+
+/* Define to 1 if using 'getloadavg.c'. */
+#define C_GETLOADAVG 1
+
+/* Define to 1 for DGUX with <sys/dg_sys_info.h>. */
+/* #undef DGUX */
+
+/* Define to 1 if translation of program messages to the user's native
+ language is requested. */
+/* #undef ENABLE_NLS */
+
+/* Use high resolution file timestamps if nonzero. */
+#define FILE_TIMESTAMP_HI_RES 0
+
+/* Define to 1 if the 'getloadavg' function needs to be run setuid or setgid.
+ */
+/* #undef GETLOADAVG_PRIVILEGED */
+
+/* Define to 1 if you have 'alloca', as a function or macro. */
+#define HAVE_ALLOCA 1
+
+/* Define to 1 if you have <alloca.h> and it should be used (not on Ultrix).
+ */
+/* #undef HAVE_ALLOCA_H */
+
+/* Define to 1 if you have the 'atexit' function. */
+#define HAVE_ATEXIT 1
+
+/* Use case insensitive file names */
+/* #undef HAVE_CASE_INSENSITIVE_FS */
+
+/* Define to 1 if you have the clock_gettime function. */
+/* #undef HAVE_CLOCK_GETTIME */
+
+/* Embed GNU Guile support. Windows build sets this on the
+ compilation command line. */
+/* #undef HAVE_GUILE */
+
+/* Define if the GNU dcgettext() function is already present or preinstalled.
+ */
+/* #undef HAVE_DCGETTEXT */
+
+/* Define to 1 if you have the declaration of 'bsd_signal', and to 0 if you
+ don't. */
+#define HAVE_DECL_BSD_SIGNAL 0
+
+/* Define to 1 if you have the declaration of 'sys_siglist', and to 0 if you
+ don't. */
+#define HAVE_DECL_SYS_SIGLIST 0
+
+/* Define to 1 if you have the declaration of '_sys_siglist', and to 0 if you
+ don't. */
+#define HAVE_DECL__SYS_SIGLIST 0
+
+/* Define to 1 if you have the declaration of '__sys_siglist', and to 0 if you
+ don't. */
+#define HAVE_DECL___SYS_SIGLIST 0
+
+/* Define to 1 if you have the <dirent.h> header file, and it defines 'DIR'.
+ */
+#define HAVE_DIRENT_H 1
+
+/* Define to 1 if you have the <direct.h> header file, and it defines getcwd()
+ and chdir().
+ */
+#if (defined(_MSC_VER) || defined(__BORLANDC__)) && !defined(__INTERIX)
+# define HAVE_DIRECT_H 1
+#endif
+
+/* Use platform specific coding */
+#define HAVE_DOS_PATHS 1
+
+/* Define to 1 if you have the 'dup2' function. */
+#define HAVE_DUP2 1
+
+/* Define to 1 if you have the <fcntl.h> header file. */
+#define HAVE_FCNTL_H 1
+
+/* Define to 1 if you have the 'fdopen' function. */
+#ifdef __MINGW32__
+#define HAVE_FDOPEN 1
+#endif
+
+/* Define to 1 if you have the 'fileno' function. */
+#define HAVE_FILENO 1
+
+/* Define to 1 if you have the 'getcwd' function. */
+#define HAVE_GETCWD 1
+
+/* Define to 1 if you have the 'getgroups' function. */
+/* #undef HAVE_GETGROUPS */
+
+/* Define to 1 if you have the 'gethostbyname' function. */
+/* #undef HAVE_GETHOSTBYNAME */
+
+/* Define to 1 if you have the 'gethostname' function. */
+/* #undef HAVE_GETHOSTNAME */
+
+/* Define to 1 if you have the 'getloadavg' function. */
+/* #undef HAVE_GETLOADAVG */
+
+/* Define to 1 if you have the 'getrlimit' function. */
+/* #undef HAVE_GETRLIMIT */
+
+/* Define if the GNU gettext() function is already present or preinstalled. */
+/* #undef HAVE_GETTEXT */
+
+/* Define to 1 if you have a standard gettimeofday function */
+#ifdef __MINGW32__
+#define HAVE_GETTIMEOFDAY 1
+#endif
+
+/* Define if you have the iconv() function. */
+/* #undef HAVE_ICONV */
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#ifdef __MINGW32__
+#define HAVE_INTTYPES_H 1
+#endif
+
+/* Define to 1 if you have the 'dgc' library (-ldgc). */
+/* #undef HAVE_LIBDGC */
+
+/* Define to 1 if you have the 'kstat' library (-lkstat). */
+/* #undef HAVE_LIBKSTAT */
+
+/* Define to 1 if you have the <limits.h> header file. */
+#define HAVE_LIMITS_H 1
+
+/* Define to 1 if you have the <locale.h> header file. */
+/*#define HAVE_LOCALE_H 1*/
+
+/* Define to 1 if you have the 'lstat' function. */
+/* #undef HAVE_LSTAT */
+
+/* Define to 1 if you have the <mach/mach.h> header file. */
+/* #undef HAVE_MACH_MACH_H */
+
+/* Define to 1 if you have the <memory.h> header file. */
+#define HAVE_MEMORY_H 1
+
+/* Define to 1 if you have the 'mkstemp' function. */
+/* #undef HAVE_MKSTEMP */
+
+/* Define to 1 if you have the 'mktemp' function. */
+#define HAVE_MKTEMP 1
+
+/* Define to 1 if you have the <ndir.h> header file, and it defines 'DIR'. */
+/* #undef HAVE_NDIR_H */
+
+/* Define to 1 if you have the <nlist.h> header file. */
+/* #undef HAVE_NLIST_H */
+
+/* Define to 1 if you have the 'pipe' function. */
+/* #undef HAVE_PIPE */
+
+/* Define to 1 if you have the 'pstat_getdynamic' function. */
+/* #undef HAVE_PSTAT_GETDYNAMIC */
+
+/* Define to 1 if you have the 'readlink' function. */
+/* #undef HAVE_READLINK */
+
+/* Define to 1 if you have the 'realpath' function. */
+/* #undef HAVE_REALPATH */
+
+/* Define to 1 if <signal.h> defines the SA_RESTART constant. */
+/* #undef HAVE_SA_RESTART */
+
+/* Define to 1 if you have the 'setegid' function. */
+/* #undef HAVE_SETEGID */
+
+/* Define to 1 if you have the 'seteuid' function. */
+/* #undef HAVE_SETEUID */
+
+/* Define to 1 if you have the 'setlinebuf' function. */
+/* #undef HAVE_SETLINEBUF */
+
+/* Define to 1 if you have the 'setlocale' function. */
+/*#define HAVE_SETLOCALE 1*/
+
+/* Define to 1 if you have the 'setregid' function. */
+/* #undef HAVE_SETREGID */
+
+/* Define to 1 if you have the 'setreuid' function. */
+/* #undef HAVE_SETREUID */
+
+/* Define to 1 if you have the 'setrlimit' function. */
+/* #undef HAVE_SETRLIMIT */
+
+/* Define to 1 if you have the 'setvbuf' function. */
+#define HAVE_SETVBUF 1
+
+/* Define to 1 if you have the 'sigaction' function. */
+/* #undef HAVE_SIGACTION */
+
+/* Define to 1 if you have the 'sigsetmask' function. */
+/* #undef HAVE_SIGSETMASK */
+
+/* Define to 1 if you have the 'socket' function. */
+/* #undef HAVE_SOCKET */
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#ifdef __MINGW32__
+#define HAVE_STDINT_H 1
+#endif
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#define HAVE_STDLIB_H 1
+
+/* Define to 1 if you have the 'strcasecmp' function. */
+#ifdef __MINGW32__
+#define HAVE_STRCASECMP 1
+#endif
+
+/* Define to 1 if you have the 'strcmpi' function. */
+#define HAVE_STRCMPI 1
+
+/* Define to 1 if you have the 'strcoll' function and it is properly defined.
+ */
+#define HAVE_STRCOLL 1
+
+/* Define to 1 if you have the 'strdup' function. */
+#define HAVE_STRDUP 1
+
+/* Define to 1 if you have the 'strerror' function. */
+#define HAVE_STRERROR 1
+
+/* Define to 1 if you have the 'stricmp' function. */
+#define HAVE_STRICMP 1
+
+/* Define to 1 if you have the <strings.h> header file. */
+/* #define HAVE_STRINGS_H 1 */
+
+/* Define to 1 if you have the <string.h> header file. */
+#define HAVE_STRING_H 1
+
+/* Define to 1 if you have the 'strncasecmp' function. */
+#ifdef __MINGW32__
+#define HAVE_STRNCASECMP 1
+#endif
+
+/* Define to 1 if you have the 'strncmpi' function. */
+/* #undef HAVE_STRNCMPI */
+
+/* Define to 1 if you have the 'strndup' function. */
+/* #undef HAVE_STRNDUP */
+
+/* Define to 1 if you have the 'strnicmp' function. */
+#ifdef __MINGW32__
+#define HAVE_STRNICMP 1
+#endif
+
+/* Define to 1 if you have the 'strsignal' function. */
+/* #undef HAVE_STRSIGNAL */
+
+/* Define to 1 if you have the `isatty' function. */
+#define HAVE_ISATTY 1
+
+/* Define to 1 if you have the `ttyname' function. */
+#define HAVE_TTYNAME 1
+char *ttyname (int);
+
+/* Define to 1 if 'n_un.n_name' is a member of 'struct nlist'. */
+/* #undef HAVE_STRUCT_NLIST_N_UN_N_NAME */
+
+/* Define to 1 if you have the <sys/dir.h> header file, and it defines 'DIR'.
+ */
+/* #undef HAVE_SYS_DIR_H */
+
+/* Define to 1 if you have the <sys/ndir.h> header file, and it defines 'DIR'.
+ */
+/* #undef HAVE_SYS_NDIR_H */
+
+/* Define to 1 if you have the <sys/param.h> header file. */
+#ifdef __MINGW32__
+#define HAVE_SYS_PARAM_H 1
+#endif
+
+/* Define to 1 if you have the <sys/resource.h> header file. */
+/* #undef HAVE_SYS_RESOURCE_H */
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#define HAVE_SYS_STAT_H 1
+
+/* Define to 1 if you have the <sys/timeb.h> header file. */
+#define HAVE_SYS_TIMEB_H 1
+
+/* Define to 1 if you have the <sys/time.h> header file. */
+#ifdef __MINGW32__
+#define HAVE_SYS_TIME_H 1
+#endif
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#define HAVE_SYS_TYPES_H 1
+
+/* Define to 1 if you have the <sys/wait.h> header file. */
+/* #undef HAVE_SYS_WAIT_H */
+
+/* Define to 1 if you have the \'union wait' type in <sys/wait.h>. */
+/* #undef HAVE_UNION_WAIT */
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#ifdef __MINGW32__
+#define HAVE_UNISTD_H 1
+#endif
+
+/* Define to 1 if you have the 'wait3' function. */
+/* #undef HAVE_WAIT3 */
+
+/* Define to 1 if you have the 'waitpid' function. */
+/* #undef HAVE_WAITPID */
+
+/* Build host information. */
+#define MAKE_HOST "Windows32"
+
+/* Define to 1 to enable job server support in GNU make. */
+#define MAKE_JOBSERVER 1
+
+/* Define to 1 to enable 'load' support in GNU make. */
+#define MAKE_LOAD 1
+
+/* Define to 1 to enable symbolic link timestamp checking. */
+/* #undef MAKE_SYMLINKS */
+
+/* Define to 1 if your 'struct nlist' has an 'n_un' member. Obsolete, depend
+ on 'HAVE_STRUCT_NLIST_N_UN_N_NAME */
+/* #undef NLIST_NAME_UNION */
+
+/* Define to 1 if struct nlist.n_name is a pointer rather than an array. */
+/* #undef NLIST_STRUCT */
+
+/* Define to 1 if your C compiler doesn't accept -c and -o together. */
+/* #undef NO_MINUS_C_MINUS_O */
+
+/* Name of this package (needed by automake) */
+#define PACKAGE "%PACKAGE%"
+
+/* Define to the address where bug reports for this package should be sent. */
+#define PACKAGE_BUGREPORT "bug-make@gnu.org"
+
+/* Define to the full name of this package. */
+#define PACKAGE_NAME "GNU make"
+
+/* Define to the home page for this package. */
+#define PACKAGE_URL "http://www.gnu.org/software/make/"
+
+/* Define to the version of this package. */
+#define PACKAGE_VERSION "%VERSION%"
+
+/* Define to the character that separates directories in PATH. */
+#define PATH_SEPARATOR_CHAR ';'
+
+/* Define as the return type of signal handlers ('int' or 'void'). */
+#define RETSIGTYPE void
+
+/* Define to the name of the SCCS 'get' command. */
+#define SCCS_GET "echo no sccs get"
+
+/* Define this if the SCCS 'get' command understands the '-G<file>' option. */
+/* #undef SCCS_GET_MINUS_G */
+
+/* Define to 1 if the 'setvbuf' function takes the buffering type as its
+ second argument and the buffer pointer as the third, as on System V before
+ release 3. */
+/* #undef SETVBUF_REVERSED */
+
+/* If using the C implementation of alloca, define if you know the
+ direction of stack growth for your system; otherwise it will be
+ automatically deduced at run time.
+ STACK_DIRECTION > 0 => grows toward higher addresses
+ STACK_DIRECTION < 0 => grows toward lower addresses
+ STACK_DIRECTION = 0 => direction of growth unknown */
+/* #undef STACK_DIRECTION */
+
+/* Define to 1 if the 'S_IS*' macros in <sys/stat.h> do not work properly. */
+/* #undef STAT_MACROS_BROKEN */
+
+/* Define to 1 if you have the ANSI C header files. */
+#define STDC_HEADERS 1
+
+/* Define if struct stat contains a nanoseconds field */
+/* #undef ST_MTIM_NSEC */
+
+/* Define to 1 on System V Release 4. */
+/* #undef SVR4 */
+
+/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
+#ifdef __MINGW32__
+#define TIME_WITH_SYS_TIME 1
+#endif
+
+/* Define to 1 for Encore UMAX. */
+/* #undef UMAX */
+
+/* Define to 1 for Encore UMAX 4.3 that has <inq_status/cpustats.h> instead of
+ <sys/cpustats.h>. */
+/* #undef UMAX4_3 */
+
+/* Version number of package */
+#define VERSION "%VERSION%"
+
+/* Define if using the dmalloc debugging malloc package */
+/* #undef WITH_DMALLOC */
+
+/* Define to 1 if on AIX 3.
+ System headers sometimes define this.
+ We just want to avoid a redefinition error message. */
+#ifndef _ALL_SOURCE
+/* # undef _ALL_SOURCE */
+#endif
+
+/* Number of bits in a file offset, on hosts where this is settable. */
+/* #undef _FILE_OFFSET_BITS */
+
+/* Define for large files, on AIX-style hosts. */
+/* #undef _LARGE_FILES */
+
+/* Define to 1 if on MINIX. */
+/* #undef _MINIX */
+
+/* Define to 2 if the system does not provide POSIX.1 features except with
+ this defined. */
+/* #undef _POSIX_1_SOURCE */
+
+/* Define to 1 if you need to in order for 'stat' and other things to work. */
+/* #undef _POSIX_SOURCE */
+
+/* Define to empty if 'const' does not conform to ANSI C. */
+/* #undef const */
+
+#include <sys/types.h>
+
+/* Define to 'int' if <sys/types.h> doesn't define. */
+#define gid_t int
+
+/* Define to 'int' if <sys/types.h> does not define. */
+/* GCC 4.x reportedly defines pid_t. */
+#ifndef _PID_T_
+#ifdef _WIN64
+#define pid_t __int64
+#else
+#define pid_t int
+#endif
+#endif
+
+/* Define to 'int' if <sys/types.h> doesn't define. */
+#define uid_t int
+
+/* Define uintmax_t if not defined in <stdint.h> or <inttypes.h>. */
+#if !HAVE_STDINT_H && !HAVE_INTTYPES_H
+#define uintmax_t unsigned long
+#endif
+
+/* Define if you have <sys/wait.h> that is POSIX.1 compatible. */
+/* #undef HAVE_SYS_WAIT_H */
+
+/* Define to the installation directory for locales. */
+#define LOCALEDIR ""
+
+/*
+ * Refer to README.W32 for info on the following settings
+ */
+
+
+/*
+ * If you have a shell that does not grok 'sh -c quoted-command-line'
+ * correctly, you need this setting. Please see below for specific
+ * shell support.
+ */
+/*#define BATCH_MODE_ONLY_SHELL 1 */
+
+/*
+ * Define if you have the Cygnus "Cygwin" GNU Windows32 tool set.
+ * Do NOT define BATCH_MODE_ONLY_SHELL if you define HAVE_CYGWIN_SHELL
+ */
+/*#define HAVE_CYGWIN_SHELL 1 */
+
+/*
+ * Define if you have the MKS tool set or shell. Do NOT define
+ * BATCH_MODE_ONLY_SHELL if you define HAVE_MKS_SHELL
+ */
+/*#define HAVE_MKS_SHELL 1 */
+
+/*
+ * Enforce the mutual exclusivity restriction.
+ */
+#ifdef HAVE_MKS_SHELL
+#undef BATCH_MODE_ONLY_SHELL
+#endif
+
+#ifdef HAVE_CYGWIN_SHELL
+#undef BATCH_MODE_ONLY_SHELL
+#endif
diff --git a/config/.gitignore b/config/.gitignore
new file mode 100644
index 00000000..d11a4881
--- /dev/null
+++ b/config/.gitignore
@@ -0,0 +1,12 @@
+ar-lib
+compile
+config.guess
+config.rpath
+config.sub
+depcomp
+install-sh
+mdate-sh
+missing
+texinfo.tex
+*.m4
+!dospaths.m4
diff --git a/config/ChangeLog.1 b/config/ChangeLog.1
new file mode 100644
index 00000000..85495010
--- /dev/null
+++ b/config/ChangeLog.1
@@ -0,0 +1,49 @@
+2012-01-15 Paul Smith <psmith@gnu.org>
+
+ * dospaths.m4: Use AC_LANG_PROGRAM to encapsulate the test code.
+ Fixes Savannah bug #35256. Patch from Sebastian Pipping.
+
+2006-03-09 Paul Smith <psmith@gnu.org>
+
+ * dospaths.m4: Add MSYS to the list of targets allowing DOS-style
+ pathnames. Reported by David Ergo <david.ergo@alterface.com>.
+
+2005-07-01 Paul D. Smith <psmith@gnu.org>
+
+ * Makefile.am (EXTRA_DIST): Added more M4 files to EXTRA_DIST, so
+ users can re-run aclocal.
+
+2003-04-30 Paul D. Smith <psmith@gnu.org>
+
+ * dospaths.m4: New macro to test for DOS-style pathnames, based on
+ coreutils 5.0 "dos.m4" by Jim Meyering.
+
+2002-04-21 gettextize <bug-gnu-gettext@gnu.org>
+
+ * codeset.m4: New file, from gettext-0.11.1.
+ * gettext.m4: New file, from gettext-0.11.1.
+ * glibc21.m4: New file, from gettext-0.11.1.
+ * iconv.m4: New file, from gettext-0.11.1.
+ * isc-posix.m4: New file, from gettext-0.11.1.
+ * lcmessage.m4: New file, from gettext-0.11.1.
+ * lib-ld.m4: New file, from gettext-0.11.1.
+ * lib-link.m4: New file, from gettext-0.11.1.
+ * lib-prefix.m4: New file, from gettext-0.11.1.
+ * progtest.m4: New file, from gettext-0.11.1.
+ * Makefile.am: New file.
+
+
+Copyright (C) 2002-2016 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
+terms of the GNU General Public License as published by the Free Software
+Foundation; either version 3 of the License, or (at your option) any later
+version.
+
+GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License along with
+this program. If not, see <http://www.gnu.org/licenses/>.
diff --git a/config/Makefile.am b/config/Makefile.am
index 396c234b..7bce036e 100644
--- a/config/Makefile.am
+++ b/config/Makefile.am
@@ -1,5 +1,5 @@
# -*-Makefile-*-, or close enough
-# Copyright (C) 2002-2014 Free Software Foundation, Inc.
+# Copyright (C) 2002-2016 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
diff --git a/config/dospaths.m4 b/config/dospaths.m4
index 92fb5402..9aa98148 100644
--- a/config/dospaths.m4
+++ b/config/dospaths.m4
@@ -1,7 +1,7 @@
# Test if the system uses DOS-style pathnames (drive specs and backslashes)
# By Paul Smith <psmith@gnu.org>. Based on dos.m4 by Jim Meyering.
#
-# Copyright (C) 1993-2014 Free Software Foundation, Inc.
+# Copyright (C) 1993-2016 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
diff --git a/configh.dos.template b/configh.dos.template
new file mode 100644
index 00000000..c43e6442
--- /dev/null
+++ b/configh.dos.template
@@ -0,0 +1,113 @@
+/* configh.dos -- hand-massaged config.h file for MS-DOS builds -*-C-*-
+
+Copyright (C) 1994-2016 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
+terms of the GNU General Public License as published by the Free Software
+Foundation; either version 3 of the License, or (at your option) any later
+version.
+
+GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License along with
+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>
+
+#if __DJGPP__ > 2 || __DJGPP_MINOR__ > 1
+
+/* Define to 1 if 'sys_siglist' is declared by <signal.h> or <unistd.h>. */
+# define SYS_SIGLIST_DECLARED 1
+
+/* Define to 1 if the C library defines the variable '_sys_siglist'. */
+# define HAVE_DECL_SYS_SIGLIST 1
+
+#else
+
+/* Define NSIG. */
+# define NSIG SIGMAX
+
+#endif
+
+/* Use high resolution file timestamps if nonzero. */
+#define FILE_TIMESTAMP_HI_RES 0
+
+/* Define to 1 if you have 'alloca', as a function or macro. */
+#define HAVE_ALLOCA 1
+
+/* Define to 1 if you have the fdopen function. */
+#define HAVE_FDOPEN 1
+
+/* Define to 1 if you have the 'getgroups' function. */
+#define HAVE_GETGROUPS 1
+
+/* Define to 1 if you have the <memory.h> header file. */
+#define HAVE_MEMORY_H 1
+
+/* Define to 1 if you have the mkstemp function. */
+#define HAVE_MKSTEMP 1
+
+/* Define to 1 if you have the 'mktemp' function. */
+#define HAVE_MKTEMP 1
+
+/* Define to 1 if you have the 'setlinebuf' function. */
+#define HAVE_SETLINEBUF 1
+
+/* Define to 1 if you have the 'setvbuf' function. */
+#define HAVE_SETVBUF 1
+
+#define SCCS_GET "get"
+
+/* Define to 'unsigned long' or 'unsigned long long'
+ if <inttypes.h> doesn't define. */
+#define uintmax_t unsigned long long
+
+/* Define the type of the first arg to select(). */
+#define fd_set_size_t int
+
+/* Define to 1 if you have the select function. */
+#define HAVE_SELECT 1
+
+/* Define to 1 if you have the stricmp function. */
+#define HAVE_STRICMP 1
+
+/* Define to 1 if you have the 'strncasecmp' function. */
+#define HAVE_STRNCASECMP 1
+
+/* Name of the package */
+#define PACKAGE "%PACKAGE%"
+
+/* Define to the address where bug reports for this package should be sent. */
+#define PACKAGE_BUGREPORT "bug-%PACKAGE%@gnu.org"
+
+/* Define to the full name of this package. */
+#define PACKAGE_NAME "GNU %PACKAGE%"
+
+/* Define to the full name and version of this package. */
+#define PACKAGE_STRING "GNU %PACKAGE% %VERSION%"
+
+/* Define to the one symbol short name of this package. */
+#define PACKAGE_TARNAME "%PACKAGE%"
+
+/* Define to the version of this package. */
+#define PACKAGE_VERSION "%VERSION%"
+
+/* Output sync sypport */
+#define NO_OUTPUT_SYNC
+
+/* Version number of package */
+#define VERSION "%VERSION%"
+
+/* Build host information. */
+#define MAKE_HOST "i386-pc-msdosdjgpp"
+
+/* Grok DOS paths (drive specs and backslash path element separators) */
+#define HAVE_DOS_PATHS
diff --git a/configure.ac b/configure.ac
index fab9a2da..64ec8701 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,6 +1,6 @@
# Process this file with autoconf to produce a configure script.
#
-# Copyright (C) 1993-2014 Free Software Foundation, Inc.
+# Copyright (C) 1993-2016 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
@@ -16,9 +16,9 @@
# You should have received a copy of the GNU General Public License along with
# this program. If not, see <http://www.gnu.org/licenses/>.
-AC_INIT([GNU make],[4.1],[bug-make@gnu.org])
+AC_INIT([GNU make],[4.2.1],[bug-make@gnu.org])
-AC_PREREQ([2.62])
+AC_PREREQ([2.69])
# Autoconf setup
AC_CONFIG_AUX_DIR([config])
@@ -29,7 +29,7 @@ AC_CONFIG_HEADERS([config.h])
# We have to enable "foreign" because ChangeLog is auto-generated
# We cannot enable -Werror because gettext 0.18.1 has invalid content
# When we update gettext to 0.18.3 or better we can add it again.
-AM_INIT_AUTOMAKE([1.11.1 silent-rules foreign -Wall])
+AM_INIT_AUTOMAKE([1.15 foreign -Werror -Wall])
# Checks for programs.
AC_USE_SYSTEM_EXTENSIONS
@@ -51,7 +51,7 @@ AC_ISC_POSIX
AC_MINIX
# Enable gettext, in "external" mode.
-AM_GNU_GETTEXT_VERSION([0.18.1])
+AM_GNU_GETTEXT_VERSION([0.19.4])
AM_GNU_GETTEXT([external])
# This test must come as early as possible after the compiler configuration
@@ -68,22 +68,18 @@ AC_HEADER_DIRENT
AC_HEADER_STAT
AC_HEADER_TIME
AC_CHECK_HEADERS([stdlib.h locale.h unistd.h limits.h fcntl.h string.h \
- memory.h sys/param.h sys/resource.h sys/time.h sys/timeb.h])
+ memory.h sys/param.h sys/resource.h sys/time.h sys/timeb.h \
+ sys/select.h])
AM_PROG_CC_C_O
AC_C_CONST
AC_TYPE_SIGNAL
AC_TYPE_UID_T
AC_TYPE_PID_T
-
-# Find some definition for uintmax_t
-
-AC_CHECK_TYPE([uintmax_t],[],
-[ uintmax_t="unsigned long"
- AC_CHECK_TYPE([unsigned long long],[uintmax_t="unsigned long long"])
- AC_DEFINE_UNQUOTED([uintmax_t], [$uintmax_t],
- [Define uintmax_t if not defined in <stdint.h> or <inttypes.h>.])
-])
+AC_TYPE_OFF_T
+AC_TYPE_SIZE_T
+AC_TYPE_SSIZE_T
+AC_TYPE_UINTMAX_T
# Find out whether our struct stat returns nanosecond resolution timestamps.
@@ -140,7 +136,7 @@ AC_CHECK_FUNCS([strdup strndup mkstemp mktemp fdopen fileno \
dup dup2 getcwd realpath sigsetmask sigaction \
getgroups seteuid setegid setlinebuf setreuid setregid \
getrlimit setrlimit setvbuf pipe strerror strsignal \
- lstat readlink atexit isatty ttyname])
+ lstat readlink atexit isatty ttyname pselect])
# We need to check declarations, not just existence, because on Tru64 this
# function is not declared without special flags, which themselves cause
@@ -148,6 +144,8 @@ AC_CHECK_FUNCS([strdup strndup mkstemp mktemp fdopen fileno \
AC_CHECK_DECLS([bsd_signal], [], [], [[#define _GNU_SOURCE 1
#include <signal.h>]])
+AC_FUNC_FORK
+
AC_FUNC_SETVBUF_REVERSED
# Rumor has it that strcasecmp lives in -lresolv on some odd systems.
diff --git a/configure.bat b/configure.bat
index e54ba843..061ef5b2 100644
--- a/configure.bat
+++ b/configure.bat
@@ -1,60 +1,60 @@
-@echo off
-rem Copyright (C) 1994-2014 Free Software Foundation, Inc.
-rem This file is part of GNU Make.
-rem
-rem GNU Make is free software; you can redistribute it and/or modify it under
-rem the terms of the GNU General Public License as published by the Free
-rem Software Foundation; either version 3 of the License, or (at your option)
-rem any later version.
-rem
-rem GNU Make is distributed in the hope that it will be useful, but WITHOUT
-rem ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-rem FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for.
-rem more details.
-rem
-rem You should have received a copy of the GNU General Public License along
-rem with this program. If not, see <http://www.gnu.org/licenses/>.
-
-echo Configuring MAKE for DJGPP
-
-rem The SmallEnv trick protects against too small environment block,
-rem in which case the values will be truncated and the whole thing
-rem goes awry. COMMAND.COM will say "Out of environment space", but
-rem many people don't care, so we force them to care by refusing to go.
-
-rem Where is the srcdir?
-set XSRC=.
-if not "%XSRC%"=="." goto SmallEnv
-if "%1%"=="" goto SrcDone
-set XSRC=%1
-if not "%XSRC%"=="%1" goto SmallEnv
-
-:SrcDone
-
-update %XSRC%/configh.dos ./config.h
-
-rem Do they have Make?
-redir -o junk.$$$ -eo make -n -f NUL
-rem REDIR will return 1 if it cannot run Make.
-rem If it can run Make, it will usually return 2,
-rem but 0 is also OK with us.
-if errorlevel 2 goto MakeOk
-if not errorlevel 1 goto MakeOk
-if exist junk.$$$ del junk.$$$
-echo No Make program found--use DOSBUILD.BAT to build Make.
-goto End
-
-rem They do have Make. Generate the Makefile.
-
-:MakeOk
-del junk.$$$
-update %XSRC%/Makefile.DOS ./Makefile
-echo Done.
-if not "%XSRC%"=="." echo Invoke Make thus: "make srcdir=%XSRC%"
-goto End
-
-:SmallEnv
-echo Your environment is too small. Please enlarge it and run me again.
-
-:End
-set XRSC=
+@echo off
+rem Copyright (C) 1994-2016 Free Software Foundation, Inc.
+rem This file is part of GNU Make.
+rem
+rem GNU Make is free software; you can redistribute it and/or modify it under
+rem the terms of the GNU General Public License as published by the Free
+rem Software Foundation; either version 3 of the License, or (at your option)
+rem any later version.
+rem
+rem GNU Make is distributed in the hope that it will be useful, but WITHOUT
+rem ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+rem FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for.
+rem more details.
+rem
+rem You should have received a copy of the GNU General Public License along
+rem with this program. If not, see <http://www.gnu.org/licenses/>.
+
+echo Configuring MAKE for DJGPP
+
+rem The SmallEnv trick protects against too small environment block,
+rem in which case the values will be truncated and the whole thing
+rem goes awry. COMMAND.COM will say "Out of environment space", but
+rem many people don't care, so we force them to care by refusing to go.
+
+rem Where is the srcdir?
+set XSRC=.
+if not "%XSRC%"=="." goto SmallEnv
+if "%1%"=="" goto SrcDone
+set XSRC=%1
+if not "%XSRC%"=="%1" goto SmallEnv
+
+:SrcDone
+
+update %XSRC%/configh.dos ./config.h
+
+rem Do they have Make?
+redir -o junk.$$$ -eo make -n -f NUL
+rem REDIR will return 1 if it cannot run Make.
+rem If it can run Make, it will usually return 2,
+rem but 0 is also OK with us.
+if errorlevel 2 goto MakeOk
+if not errorlevel 1 goto MakeOk
+if exist junk.$$$ del junk.$$$
+echo No Make program found--use DOSBUILD.BAT to build Make.
+goto End
+
+rem They do have Make. Generate the Makefile.
+
+:MakeOk
+del junk.$$$
+update %XSRC%/Makefile.DOS ./Makefile
+echo Done.
+if not "%XSRC%"=="." echo Invoke Make thus: "make srcdir=%XSRC%"
+goto End
+
+:SmallEnv
+echo Your environment is too small. Please enlarge it and run me again.
+
+:End
+set XRSC=
diff --git a/debug.h b/debug.h
index 9d2ec04a..17c394ba 100644
--- a/debug.h
+++ b/debug.h
@@ -1,5 +1,5 @@
/* Debugging macros and interface.
-Copyright (C) 1999-2014 Free Software Foundation, Inc.
+Copyright (C) 1999-2016 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
diff --git a/default.c b/default.c
index 3b6f7ae7..3d865c7a 100644
--- a/default.c
+++ b/default.c
@@ -1,5 +1,5 @@
/* Data base of default implicit rules for GNU Make.
-Copyright (C) 1988-2014 Free Software Foundation, Inc.
+Copyright (C) 1988-2016 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
@@ -131,10 +131,47 @@ static struct pspec default_terminal_rules[] =
static const char *default_suffix_rules[] =
{
#ifdef VMS
+ ".o",
+ "$(LINK.obj) $^ $(LOADLIBES) $(LDLIBS) -o $@",
+ ".obj",
+ "$(LINK.obj) $^ $(LOADLIBES) $(LDLIBS) -o $@",
+ ".s",
+ "$(LINK.s) $^ $(LOADLIBES) $(LDLIBS) -o $@",
+ ".S",
+ "$(LINK.S) $^ $(LOADLIBES) $(LDLIBS) -o $@",
+ ".c",
+ "$(LINK.c) $^ $(LOADLIBES) $(LDLIBS) -o $@",
+ ".cc",
+ "$(LINK.cc) $^ $(LOADLIBES) $(LDLIBS) -o $@",
+ ".C",
+ "$(LINK.C) $^ $(LOADLIBES) $(LDLIBS) -o $@",
+ ".cpp",
+ "$(LINK.cpp) $^ $(LOADLIBES) $(LDLIBS) -o $@",
+ ".f",
+ "$(LINK.f) $^ $(LOADLIBES) $(LDLIBS) -o $@",
+ ".m",
+ "$(LINK.m) $^ $(LOADLIBES) $(LDLIBS) -o $@",
+ ".p",
+ "$(LINK.p) $^ $(LOADLIBES) $(LDLIBS) -o $@",
+ ".F",
+ "$(LINK.F) $^ $(LOADLIBES) $(LDLIBS) -o $@",
+ ".r",
+ "$(LINK.r) $^ $(LOADLIBES) $(LDLIBS) -o $@",
+ ".mod",
+ "$(COMPILE.mod) -o $@ -e $@ $^",
+
+ ".def.sym",
+ "$(COMPILE.def) -o $@ $<",
+
+ ".sh",
+ "copy $< >$@",
+
".obj.exe",
"$(LINK.obj) $^ $(LOADLIBES) $(LDLIBS) $(CRT0) /exe=$@",
".mar.exe",
"$(COMPILE.mar) $^ \n $(LINK.obj) $(subst .mar,.obj,$^) $(LOADLIBES) $(LDLIBS) $(CRT0) /exe=$@",
+ ".s.o",
+ "$(COMPILE.s) -o $@ $<",
".s.exe",
"$(COMPILE.s) $^ \n $(LINK.obj) $(subst .s,.obj,$^) $(LOADLIBES) $(LDLIBS) $(CRT0) /exe=$@",
".c.exe",
@@ -205,6 +242,27 @@ static const char *default_suffix_rules[] =
".tex.dvi",
"$(TEX) $<",
+ ".cpp.o",
+ "$(COMPILE.cpp) $(OUTPUT_OPTION) $<",
+ ".f.o",
+ "$(COMPILE.f) $(OUTPUT_OPTION) $<",
+ ".m.o",
+ "$(COMPILE.m) $(OUTPUT_OPTION) $<",
+ ".p.o",
+ "$(COMPILE.p) $(OUTPUT_OPTION) $<",
+ ".r.o",
+ "$(COMPILE.r) $(OUTPUT_OPTION) $<",
+ ".mod.o",
+ "$(COMPILE.mod) -o $@ $<",
+
+ ".c.ln",
+ "$(LINT.c) -C$* $<",
+ ".y.ln",
+ "$(YACC.y) $< \n rename y_tab.c $@",
+
+ ".l.ln",
+ "@$(RM) $*.c\n $(LEX.l) $< > $*.c\n$(LINT.c) -i $*.c -o $@\n $(RM) $*.c",
+
#else /* ! VMS */
".o",
@@ -413,19 +471,44 @@ static const char *default_variables[] =
"LDLIBS", "",
#endif
+ "LINK.o", "$(LD) $(LDFLAGS)",
"LINK.obj", "$(LD) $(LDFLAGS)",
#ifndef GCC_IS_NATIVE
"CXXLINK.obj", "$(CXXLD) $(LDFLAGS)",
"COMPILE.cxx", "$(CXX) $(CXXFLAGS) $(CPPFLAGS) $(TARGET_ARCH)",
#endif
"COMPILE.c", "$(CC) $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH)",
+ "LINK.c", "$(CC) $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH)",
+ "COMPILE.m", "$(OBJC) $(OBJCFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c",
+ "LINK.m", "$(OBJC) $(OBJCFLAGS) $(CPPFLAGS) $(LDFLAGS) $(TARGET_ARCH)",
"COMPILE.cc", "$(CXX) $(CXXFLAGS) $(CPPFLAGS) $(TARGET_ARCH)",
+ "COMPILE.C", "$(COMPILE.cc)",
+ "COMPILE.cpp", "$(COMPILE.cc)",
+ "LINK.C", "$(LINK.cc)",
+ "LINK.cpp", "$(LINK.cc)",
"YACC.y", "$(YACC) $(YFLAGS)",
"LEX.l", "$(LEX) $(LFLAGS)",
+ "YACC.m", "$(YACC) $(YFLAGS)",
+ "LEX.m", "$(LEX) $(LFLAGS) -t",
"COMPILE.for", "$(FC) $(FFLAGS) $(TARGET_ARCH)",
+ "COMPILE.f", "$(FC) $(FFLAGS) $(TARGET_ARCH) -c",
+ "LINK.f", "$(FC) $(FFLAGS) $(LDFLAGS) $(TARGET_ARCH)",
+ "COMPILE.F", "$(FC) $(FFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c",
+ "LINK.F", "$(FC) $(FFLAGS) $(CPPFLAGS) $(LDFLAGS) $(TARGET_ARCH)",
+ "COMPILE.r", "$(FC) $(FFLAGS) $(RFLAGS) $(TARGET_ARCH) -c",
+ "LINK.r", "$(FC) $(FFLAGS) $(RFLAGS) $(LDFLAGS) $(TARGET_ARCH)",
"COMPILE.pas", "$(PC) $(PFLAGS) $(CPPFLAGS) $(TARGET_ARCH)",
+ "COMPILE.def", "$(M2C) $(M2FLAGS) $(DEFFLAGS) $(TARGET_ARCH)",
+ "COMPILE.mod", "$(M2C) $(M2FLAGS) $(MODFLAGS) $(TARGET_ARCH)",
+ "COMPILE.p", "$(PC) $(PFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c",
+ "LINK.p", "$(PC) $(PFLAGS) $(CPPFLAGS) $(LDFLAGS) $(TARGET_ARCH)",
"COMPILE.mar", "$(MACRO) $(MACROFLAGS)",
"COMPILE.s", "$(AS) $(ASFLAGS) $(TARGET_MACH)",
+ "LINK.S", "$(CC) $(ASFLAGS) $(CPPFLAGS) $(LDFLAGS) $(TARGET_MACH)",
+ "COMPILE.S", "$(CC) $(ASFLAGS) $(CPPFLAGS) $(TARGET_MACH) -c",
+ "PREPROCESS.S", "$(CC) -E $(CPPFLAGS)",
+ "PREPROCESS.F", "$(FC) $(FFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -F",
+ "PREPROCESS.r", "$(FC) $(FFLAGS) $(RFLAGS) $(TARGET_ARCH) -F",
"LINT.c", "$(LINT) $(LINTFLAGS) $(CPPFLAGS) $(TARGET_ARCH)",
"MV", "rename/new_version",
@@ -519,10 +602,21 @@ static const char *default_variables[] =
"COMPILE.m", "$(OBJC) $(OBJCFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c",
"LINK.m", "$(OBJC) $(OBJCFLAGS) $(CPPFLAGS) $(LDFLAGS) $(TARGET_ARCH)",
"COMPILE.cc", "$(CXX) $(CXXFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c",
+#ifndef HAVE_CASE_INSENSITIVE_FS
+ /* On case-insensitive filesystems, treat *.C files as *.c files,
+ to avoid erroneously compiling C sources as C++, which will
+ probably fail. */
"COMPILE.C", "$(COMPILE.cc)",
+#else
+ "COMPILE.C", "$(COMPILE.c)",
+#endif
"COMPILE.cpp", "$(COMPILE.cc)",
"LINK.cc", "$(CXX) $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS) $(TARGET_ARCH)",
+#ifndef HAVE_CASE_INSENSITIVE_FS
"LINK.C", "$(LINK.cc)",
+#else
+ "LINK.C", "$(LINK.c)",
+#endif
"LINK.cpp", "$(LINK.cc)",
"YACC.y", "$(YACC) $(YFLAGS)",
"LEX.l", "$(LEX) $(LFLAGS) -t",
diff --git a/dep.h b/dep.h
index b8c0d29b..7f5076ea 100644
--- a/dep.h
+++ b/dep.h
@@ -1,5 +1,5 @@
/* Definitions of dependency data structures for GNU Make.
-Copyright (C) 1988-2014 Free Software Foundation, Inc.
+Copyright (C) 1988-2016 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
@@ -14,9 +14,21 @@ A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with
this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Structure used in chains of names, for parsing and globbing. */
+
+#define NAMESEQ(_t) \
+ _t *next; \
+ const char *name
+
+struct nameseq
+ {
+ NAMESEQ (struct nameseq);
+ };
+
/* Flag bits for the second argument to 'read_makefile'.
- These flags are saved in the 'changed' field of each
- 'struct dep' in the chain returned by 'read_all_makefiles'. */
+ These flags are saved in the 'flags' field of each
+ 'struct goaldep' in the chain returned by 'read_all_makefiles'. */
#define RM_NO_DEFAULT_GOAL (1 << 0) /* Do not set default goal. */
#define RM_INCLUDED (1 << 1) /* Search makefile search path. */
@@ -25,34 +37,37 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
#define RM_NOFLAG 0
/* Structure representing one dependency of a file.
- Each struct file's 'deps' points to a chain of these,
- chained through the 'next'. 'stem' is the stem for this
- dep line of static pattern rule or NULL.
-
- Note that the first two words of this match a struct nameseq. */
+ Each struct file's 'deps' points to a chain of these, through 'next'.
+ 'stem' is the stem for this dep line of static pattern rule or NULL. */
+
+#define DEP(_t) \
+ NAMESEQ (_t); \
+ struct file *file; \
+ const char *stem; \
+ unsigned short flags : 8; \
+ unsigned short changed : 1; \
+ unsigned short ignore_mtime : 1; \
+ unsigned short staticpattern : 1; \
+ unsigned short need_2nd_expansion : 1
struct dep
{
- struct dep *next;
- const char *name;
- const char *stem;
- struct file *file;
- unsigned int changed : 8;
- unsigned int ignore_mtime : 1;
- unsigned int staticpattern : 1;
- unsigned int need_2nd_expansion : 1;
- unsigned int dontcare : 1;
+ DEP (struct dep);
};
+/* Structure representing one goal.
+ The goals to be built constitute a chain of these, chained through 'next'.
+ 'stem' is not used, but it's simpler to include and ignore it. */
-/* Structure used in chains of names, for parsing and globbing. */
-
-struct nameseq
+struct goaldep
{
- struct nameseq *next;
- const char *name;
+ DEP (struct goaldep);
+ unsigned short error;
+ floc floc;
};
+/* Options for parsing lists of filenames. */
+
#define PARSEFS_NONE 0x0000
#define PARSEFS_NOSTRIP 0x0001
#define PARSEFS_NOAR 0x0002
@@ -78,15 +93,39 @@ char *tilde_expand (const char *name);
struct nameseq *ar_glob (const char *arname, const char *member_pattern, unsigned int size);
#endif
-#define dep_name(d) ((d)->name == 0 ? (d)->file->name : (d)->name)
+#define dep_name(d) ((d)->name ? (d)->name : (d)->file->name)
+
+#define alloc_seq_elt(_t) xcalloc (sizeof (_t))
+void free_ns_chain (struct nameseq *n);
+
+#if defined(MAKE_MAINTAINER_MODE) && defined(__GNUC__)
+/* Use inline to get real type-checking. */
+#define SI static inline
+SI struct nameseq *alloc_ns() { return alloc_seq_elt (struct nameseq); }
+SI struct dep *alloc_dep() { return alloc_seq_elt (struct dep); }
+SI struct goaldep *alloc_goaldep() { return alloc_seq_elt (struct goaldep); }
+
+SI void free_ns(struct nameseq *n) { free (n); }
+SI void free_dep(struct dep *d) { free_ns ((struct nameseq *)d); }
+SI void free_goaldep(struct goaldep *g) { free_dep ((struct dep *)g); }
-#define alloc_dep() (xcalloc (sizeof (struct dep)))
-#define free_ns(_n) free (_n)
-#define free_dep(_d) free_ns (_d)
+SI void free_dep_chain(struct dep *d) { free_ns_chain((struct nameseq *)d); }
+SI void free_goal_chain(struct goaldep *g) { free_dep_chain((struct dep *)g); }
+#else
+# define alloc_ns() alloc_seq_elt (struct nameseq)
+# define alloc_dep() alloc_seq_elt (struct dep)
+# define alloc_goaldep() alloc_seq_elt (struct goaldep)
+
+# define free_ns(_n) free (_n)
+# define free_dep(_d) free_ns (_d)
+# define free_goaldep(_g) free_dep (_g)
+
+# define free_dep_chain(_d) free_ns_chain ((struct nameseq *)(_d))
+# define free_goal_chain(_g) free_ns_chain ((struct nameseq *)(_g))
+#endif
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);
-void eval_buffer (char *buffer, const gmk_floc *floc);
-enum update_status update_goal_chain (struct dep *goals);
+
+struct goaldep *read_all_makefiles (const char **makefiles);
+void eval_buffer (char *buffer, const floc *floc);
+enum update_status update_goal_chain (struct goaldep *goals);
diff --git a/dir.c b/dir.c
index 7e00b8f7..f34bbf58 100644
--- a/dir.c
+++ b/dir.c
@@ -1,5 +1,5 @@
/* Directory hashing for GNU Make.
-Copyright (C) 1988-2014 Free Software Foundation, Inc.
+Copyright (C) 1988-2016 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
@@ -142,6 +142,32 @@ downcase (const char *filename)
#ifdef VMS
+static char *
+downcase_inplace(char *filename)
+{
+ char *name;
+ name = filename;
+ while (*name != '\0')
+ {
+ *name = tolower ((unsigned char)*name);
+ ++name;
+ }
+ return filename;
+}
+
+#ifndef _USE_STD_STAT
+/* VMS 8.2 fixed the VMS stat output to have unique st_dev and st_ino
+ when _USE_STD_STAT is used on the compile line.
+
+ Prior to _USE_STD_STAT support, the st_dev is a pointer to thread
+ static memory containing the device of the last filename looked up.
+
+ Todo: find out if the ino_t still needs to be faked on a directory.
+ */
+
+/* Define this if the older VMS_INO_T is needed */
+#define VMS_INO_T 1
+
static int
vms_hash (const char *name)
{
@@ -200,6 +226,10 @@ vmsstat_dir (const char *name, struct stat *st)
return 0;
}
+
+# define stat(__path, __sbuf) vmsstat_dir (__path, __sbuf)
+
+#endif /* _USE_STD_STAT */
#endif /* VMS */
/* Hash table of directories. */
@@ -218,14 +248,14 @@ struct directory_contents
* qualified name of the directory. Beware though, this is also
* unreliable. I'm open to suggestion on a better way to emulate inode. */
char *path_key;
- int ctime;
- int mtime; /* controls check for stale directory cache */
- int fs_flags; /* FS_FAT, FS_NTFS, ... */
+ time_t ctime;
+ time_t mtime; /* controls check for stale directory cache */
+ int fs_flags; /* FS_FAT, FS_NTFS, ... */
# define FS_FAT 0x1
# define FS_NTFS 0x2
# define FS_UNKNOWN 0x4
#else
-# ifdef VMS
+# ifdef VMS_INO_T
ino_t ino[3];
# else
ino_t ino;
@@ -246,7 +276,7 @@ directory_contents_hash_1 (const void *key_0)
ISTRING_HASH_1 (key->path_key, hash);
hash ^= ((unsigned int) key->dev << 4) ^ (unsigned int) key->ctime;
#else
-# ifdef VMS
+# ifdef VMS_INO_T
hash = (((unsigned int) key->dev << 4)
^ ((unsigned int) key->ino[0]
+ (unsigned int) key->ino[1]
@@ -269,7 +299,7 @@ directory_contents_hash_2 (const void *key_0)
ISTRING_HASH_2 (key->path_key, hash);
hash ^= ((unsigned int) key->dev << 4) ^ (unsigned int) ~key->ctime;
#else
-# ifdef VMS
+# ifdef VMS_INO_T
hash = (((unsigned int) key->dev << 4)
^ ~((unsigned int) key->ino[0]
+ (unsigned int) key->ino[1]
@@ -308,7 +338,7 @@ directory_contents_hash_cmp (const void *xv, const void *yv)
if (result)
return result;
#else
-# ifdef VMS
+# ifdef VMS_INO_T
result = MAKECMP(x->ino[0], y->ino[0]);
if (result)
return result;
@@ -375,7 +405,7 @@ static unsigned int open_directories = 0;
struct dirfile
{
const char *name; /* Name of the file. */
- short length;
+ size_t length;
short impossible; /* This file is impossible. */
};
@@ -419,13 +449,6 @@ find_directory (const char *name)
struct directory **dir_slot;
struct directory dir_key;
-#ifdef VMS
- if ((*name == '.') && (*(name+1) == 0))
- name = "[]";
- else
- name = vmsify (name,1);
-#endif
-
dir_key.name = name;
dir_slot = (struct directory **) hash_find_slot (&directories, &dir_key);
dir = *dir_slot;
@@ -439,7 +462,12 @@ find_directory (const char *name)
dir = xmalloc (sizeof (struct directory));
#if defined(HAVE_CASE_INSENSITIVE_FS) && defined(VMS)
- dir->name = strcache_add_len (downcase (name), p - name);
+ /* Todo: Why is this only needed on VMS? */
+ {
+ char *lname = downcase_inplace (xstrdup (name));
+ dir->name = strcache_add_len (lname, p - name);
+ free (lname);
+ }
#else
dir->name = strcache_add_len (name, p - name);
#endif
@@ -447,9 +475,7 @@ find_directory (const char *name)
/* The directory is not in the name hash table.
Find its device and inode numbers, and look it up by them. */
-#ifdef VMS
- r = vmsstat_dir (name, &st);
-#elif defined(WINDOWS32)
+#if defined(WINDOWS32)
{
char tem[MAXPATHLEN], *tstart, *tend;
@@ -492,7 +518,7 @@ find_directory (const char *name)
dc_key.path_key = w32_path = w32ify (name, 1);
dc_key.ctime = st.st_ctime;
#else
-# ifdef VMS
+# ifdef VMS_INO_T
dc_key.ino[0] = st.st_ino[0];
dc_key.ino[1] = st.st_ino[1];
dc_key.ino[2] = st.st_ino[2];
@@ -537,7 +563,7 @@ find_directory (const char *name)
else
dc->fs_flags = FS_UNKNOWN;
#else
-# ifdef VMS
+# ifdef VMS_INO_T
dc->ino[0] = st.st_ino[0];
dc->ino[1] = st.st_ino[1];
dc->ino[2] = st.st_ino[2];
@@ -602,11 +628,6 @@ dir_contents_file_exists_p (struct directory_contents *dir,
if (filename != 0)
_fnlwr (filename); /* lower case for FAT drives */
#endif
-
-#ifdef VMS
- filename = vmsify (filename,0);
-#endif
-
if (filename != 0)
{
struct dirfile dirfile_key;
@@ -679,7 +700,9 @@ dir_contents_file_exists_p (struct directory_contents *dir,
}
#if defined(VMS) && defined(HAVE_DIRENT_H)
- /* In VMS we get file versions too, which have to be stripped off */
+ /* In VMS we get file versions too, which have to be stripped off.
+ Some versions of VMS return versions on Unix files even when
+ the feature option to strip them is set. */
{
char *p = strrchr (d->d_name, ';');
if (p)
@@ -703,7 +726,8 @@ dir_contents_file_exists_p (struct directory_contents *dir,
{
df = xmalloc (sizeof (struct dirfile));
#if defined(HAVE_CASE_INSENSITIVE_FS) && defined(VMS)
- df->name = strcache_add_len (downcase (d->d_name), len);
+ /* TODO: Why is this only needed on VMS? */
+ df->name = strcache_add_len (downcase_inplace (d->d_name), len);
#else
df->name = strcache_add_len (d->d_name, len);
#endif
@@ -734,6 +758,15 @@ dir_contents_file_exists_p (struct directory_contents *dir,
int
dir_file_exists_p (const char *dirname, const char *filename)
{
+#ifdef VMS
+ if ((filename != NULL) && (dirname != NULL))
+ {
+ int want_vmsify;
+ want_vmsify = (strpbrk (dirname, ":<[") != NULL);
+ if (want_vmsify)
+ filename = vmsify (filename, 0);
+ }
+#endif
return dir_contents_file_exists_p (find_directory (dirname)->contents,
filename);
}
@@ -752,14 +785,24 @@ file_exists_p (const char *name)
return ar_member_date (name) != (time_t) -1;
#endif
+ dirend = strrchr (name, '/');
#ifdef VMS
- dirend = strrchr (name, ']');
if (dirend == 0)
- dirend = strrchr (name, ':');
+ {
+ dirend = strrchr (name, ']');
+ dirend == NULL ? dirend : dirend++;
+ }
if (dirend == 0)
- return dir_file_exists_p ("[]", name);
-#else /* !VMS */
- dirend = strrchr (name, '/');
+ {
+ dirend = strrchr (name, '>');
+ dirend == NULL ? dirend : dirend++;
+ }
+ if (dirend == 0)
+ {
+ dirend = strrchr (name, ':');
+ dirend == NULL ? dirend : dirend++;
+ }
+#endif /* VMS */
#ifdef HAVE_DOS_PATHS
/* Forward and backslashes might be mixed. We need the rightmost one. */
{
@@ -774,10 +817,9 @@ file_exists_p (const char *name)
if (dirend == 0)
#ifndef _AMIGA
return dir_file_exists_p (".", name);
-#else /* !VMS && !AMIGA */
+#else /* !AMIGA */
return dir_file_exists_p ("", name);
#endif /* AMIGA */
-#endif /* VMS */
slash = dirend;
if (dirend == name)
@@ -796,7 +838,13 @@ file_exists_p (const char *name)
p[dirend - name] = '\0';
dirname = p;
}
- return dir_file_exists_p (dirname, slash + 1);
+#ifdef VMS
+ if (*slash == '/')
+ slash++;
+#else
+ slash++;
+#endif
+ return dir_file_exists_p (dirname, slash);
}
/* Mark FILENAME as 'impossible' for 'file_impossible_p'.
@@ -811,16 +859,25 @@ file_impossible (const char *filename)
struct directory *dir;
struct dirfile *new;
-#ifdef VMS
- dirend = strrchr (p, ']');
- if (dirend == 0)
- dirend = strrchr (p, ':');
- dirend++;
- if (dirend == (char *)1)
- dir = find_directory ("[]");
-#else
dirend = strrchr (p, '/');
-# ifdef HAVE_DOS_PATHS
+#ifdef VMS
+ if (dirend == NULL)
+ {
+ dirend = strrchr (p, ']');
+ dirend == NULL ? dirend : dirend++;
+ }
+ if (dirend == NULL)
+ {
+ dirend = strrchr (p, '>');
+ dirend == NULL ? dirend : dirend++;
+ }
+ if (dirend == NULL)
+ {
+ dirend = strrchr (p, ':');
+ dirend == NULL ? dirend : dirend++;
+ }
+#endif
+#ifdef HAVE_DOS_PATHS
/* Forward and backslashes might be mixed. We need the rightmost one. */
{
const char *bslash = strrchr (p, '\\');
@@ -830,14 +887,13 @@ file_impossible (const char *filename)
if (!dirend && p[0] && p[1] == ':')
dirend = p + 1;
}
-# endif /* HAVE_DOS_PATHS */
+#endif /* HAVE_DOS_PATHS */
if (dirend == 0)
-# ifdef _AMIGA
+#ifdef _AMIGA
dir = find_directory ("");
-# else /* !VMS && !AMIGA */
+#else /* !AMIGA */
dir = find_directory (".");
-# endif /* AMIGA */
-#endif /* VMS */
+#endif /* AMIGA */
else
{
const char *dirname;
@@ -859,7 +915,14 @@ file_impossible (const char *filename)
dirname = cp;
}
dir = find_directory (dirname);
+#ifdef VMS
+ if (*slash == '/')
+ filename = p = slash + 1;
+ else
+ filename = p = slash;
+#else
filename = p = slash + 1;
+#endif
}
if (dir->contents == 0)
@@ -878,6 +941,7 @@ file_impossible (const char *filename)
new = xmalloc (sizeof (struct dirfile));
new->length = strlen (filename);
#if defined(HAVE_CASE_INSENSITIVE_FS) && defined(VMS)
+ /* todo: Why is this only needed on VMS? */
new->name = strcache_add_len (downcase (filename), new->length);
#else
new->name = strcache_add_len (filename, new->length);
@@ -895,13 +959,22 @@ file_impossible_p (const char *filename)
struct directory_contents *dir;
struct dirfile *dirfile;
struct dirfile dirfile_key;
-
#ifdef VMS
- dirend = strrchr (filename, ']');
- if (dirend == 0)
- dir = find_directory ("[]")->contents;
-#else
+ int want_vmsify = 0;
+#endif
+
dirend = strrchr (filename, '/');
+#ifdef VMS
+ if (dirend == NULL)
+ {
+ want_vmsify = (strpbrk (filename, "]>:^") != NULL);
+ dirend = strrchr (filename, ']');
+ }
+ if (dirend == NULL && want_vmsify)
+ dirend = strrchr (filename, '>');
+ if (dirend == NULL && want_vmsify)
+ dirend = strrchr (filename, ':');
+#endif
#ifdef HAVE_DOS_PATHS
/* Forward and backslashes might be mixed. We need the rightmost one. */
{
@@ -916,10 +989,9 @@ file_impossible_p (const char *filename)
if (dirend == 0)
#ifdef _AMIGA
dir = find_directory ("")->contents;
-#else /* !VMS && !AMIGA */
+#else /* !AMIGA */
dir = find_directory (".")->contents;
#endif /* AMIGA */
-#endif /* VMS */
else
{
const char *dirname;
@@ -941,7 +1013,14 @@ file_impossible_p (const char *filename)
dirname = cp;
}
dir = find_directory (dirname)->contents;
+#ifdef VMS
+ if (*slash == '/')
+ filename = slash + 1;
+ else
+ filename = slash;
+#else
filename = slash + 1;
+#endif
}
if (dir == 0 || dir->dirfiles.ht_vec == 0)
@@ -955,7 +1034,8 @@ file_impossible_p (const char *filename)
filename = downcase (filename);
#endif
#ifdef VMS
- filename = vmsify (filename, 1);
+ if (want_vmsify)
+ filename = vmsify (filename, 1);
#endif
dirfile_key.name = filename;
@@ -1002,10 +1082,11 @@ print_dir_data_base (void)
else if (dir->contents->dirfiles.ht_vec == 0)
{
#ifdef WINDOWS32
- printf (_("# %s (key %s, mtime %d): could not be opened.\n"),
- dir->name, dir->contents->path_key,dir->contents->mtime);
+ printf (_("# %s (key %s, mtime %I64u): could not be opened.\n"),
+ dir->name, dir->contents->path_key,
+ (unsigned long long)dir->contents->mtime);
#else /* WINDOWS32 */
-#ifdef VMS
+#ifdef VMS_INO_T
printf (_("# %s (device %d, inode [%d,%d,%d]): could not be opened.\n"),
dir->name, dir->contents->dev,
dir->contents->ino[0], dir->contents->ino[1],
@@ -1038,10 +1119,11 @@ print_dir_data_base (void)
}
}
#ifdef WINDOWS32
- printf (_("# %s (key %s, mtime %d): "),
- dir->name, dir->contents->path_key, dir->contents->mtime);
+ printf (_("# %s (key %s, mtime %I64u): "),
+ dir->name, dir->contents->path_key,
+ (unsigned long long)dir->contents->mtime);
#else /* WINDOWS32 */
-#ifdef VMS
+#ifdef VMS_INO_T
printf (_("# %s (device %d, inode [%d,%d,%d]): "),
dir->name, dir->contents->dev,
dir->contents->ino[0], dir->contents->ino[1],
@@ -1087,8 +1169,6 @@ print_dir_data_base (void)
/* Hooks for globbing. */
-#include <glob.h>
-
/* Structure describing state of iterating through a directory hash table. */
struct dirstream
@@ -1179,9 +1259,16 @@ read_dirstream (__ptr_t stream)
* On MS-Windows, stat() "succeeds" for foo/bar/. where foo/bar is a
* regular file; fix that here.
*/
-#if !defined(stat) && !defined(WINDOWS32)
+#if !defined(stat) && !defined(WINDOWS32) || defined(VMS)
# ifndef VMS
+# ifndef HAVE_SYS_STAT_H
int stat (const char *path, struct stat *sbuf);
+# endif
+# else
+ /* We are done with the fake stat. Go back to the real stat */
+# ifdef stat
+# undef stat
+# endif
# endif
# define local_stat stat
#else
diff --git a/doc/.gitignore b/doc/.gitignore
new file mode 100644
index 00000000..ca68d2d1
--- /dev/null
+++ b/doc/.gitignore
@@ -0,0 +1,22 @@
+manual/
+gendocs_template
+fdl.texi
+make-stds.texi
+stamp-vti
+version.texi
+make.info*
+make*.html
+make.aux
+make.cp
+make.cps
+make.dvi
+make.fn
+make.fns
+make.ky
+make.log
+make.pdf
+make.pg
+make.ps
+make.toc
+make.tp
+make.vr
diff --git a/doc/Makefile.am b/doc/Makefile.am
index 03977bac..11aa4d45 100644
--- a/doc/Makefile.am
+++ b/doc/Makefile.am
@@ -1,5 +1,5 @@
# -*-Makefile-*-, or close enough
-# Copyright (C) 2000-2014 Free Software Foundation, Inc.
+# Copyright (C) 2000-2016 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
diff --git a/doc/make.texi b/doc/make.texi
index b0f5af73..fe0afafd 100644
--- a/doc/make.texi
+++ b/doc/make.texi
@@ -3,7 +3,7 @@
@setfilename make.info
@include version.texi
-@set EDITION 0.73
+@set EDITION 0.74
@settitle GNU @code{make}
@setchapternewpage odd
@@ -26,7 +26,8 @@ of @cite{The GNU Make Manual}, for GNU @code{make} version @value{VERSION}.
Copyright @copyright{} 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995,
1996, 1997, 1998, 1999, 2000, 2002, 2003, 2004, 2005, 2006, 2007,
-2008, 2009, 2010, 2011, 2012, 2013, 2014 Free Software Foundation, Inc.
+2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016 Free Software
+Foundation, Inc.
@quotation
Permission is granted to copy, distribute and/or modify this document
@@ -100,6 +101,7 @@ Cover art by Etienne Suvasa.
based on their file names.
* Archives:: How @code{make} can update library archives.
* Extending make:: Using extensions to @code{make}.
+* Integrating make:: Integrating @code{make} with other tools.
* Features:: Features GNU @code{make} has over other @code{make}s.
* Missing:: What GNU @code{make} lacks from other @code{make}s.
* Makefile Conventions:: Conventions for writing makefiles for
@@ -356,6 +358,16 @@ Loading Dynamic Objects
* Loaded Object API:: Programmatic interface for loaded objects.
* Loaded Object Example:: Example of a loaded object
+Integrating GNU @code{make}
+
+* Job Slots:: Share job slots with GNU @code{make}.
+* Terminal Output:: Control output to terminals.
+
+Sharing Job Slots with GNU @code{make}
+
+* POSIX Jobserver:: Using the jobserver on POSIX systems.
+* Windows Jobserver:: Using the jobserver on Windows systems.
+
@end detailmenu
@end menu
@@ -4709,9 +4721,9 @@ 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!)
If your operating system doesn't support the above communication, then
-@samp{-j 1} is always put into @code{MAKEFLAGS} instead of the value you
-specified. This is because if the @w{@samp{-j}} option were passed down
-to sub-@code{make}s, you would get many more jobs running in parallel
+no @samp{-j} is added to @code{MAKEFLAGS}, so that sub-@code{make}s
+run in non-parallel mode. If the @w{@samp{-j}} option were passed down
+to sub-@code{make}s you would get many more jobs running in parallel
than you asked for. If you give @samp{-j} with no numeric argument,
meaning to run as many jobs as possible in parallel, this is passed
down, since multiple infinities are no more than one.@refill
@@ -4970,27 +4982,24 @@ beginning with a recipe prefix character to define an empty recipe,
but this would be confusing because such a line looks empty.
@findex .DEFAULT@r{, and empty recipes}
-You may be wondering why you would want to define a recipe that
-does nothing. The only reason this is useful is to prevent a target
-from getting implicit recipes (from implicit rules or the
-@code{.DEFAULT} special target; @pxref{Implicit Rules} and
-@pxref{Last Resort, ,Defining Last-Resort Default Rules}).@refill
-
-@c !!! another reason is for canonical stamp files:
-@ignore
-@example
-foo: stamp-foo ;
-stamp-foo: foo.in
- create foo frm foo.in
- touch $@
-@end example
-@end ignore
-
-You may be inclined to define empty recipes for targets that are
-not actual files, but only exist so that their prerequisites can be
+You may be wondering why you would want to define a recipe that does
+nothing. One reason this is useful is to prevent a target from
+getting implicit recipes (from implicit rules or the @code{.DEFAULT}
+special target; @pxref{Implicit Rules} and @pxref{Last Resort,
+,Defining Last-Resort Default Rules}).@refill
+
+Empty recipes can also be used to avoid errors for targets that will
+be created as a side-effect of another recipe: if the target does not
+exist the empty recipe ensures that @code{make} won't complain that it
+doesn't know how to build the target, and @code{make} will assume the
+target is out of date.
+
+You may be inclined to define empty recipes for targets that are not
+actual files, but only exist so that their prerequisites can be
remade. However, this is not the best way to do that, because the
-prerequisites may not be remade properly if the target file actually does exist.
-@xref{Phony Targets, ,Phony Targets}, for a better way to do this.
+prerequisites may not be remade properly if the target file actually
+does exist. @xref{Phony Targets, ,Phony Targets}, for a better way to
+do this.
@node Using Variables, Conditionals, Recipes, Top
@chapter How to Use Variables
@@ -5616,7 +5625,7 @@ Several variables have constant initial values.
@cindex !=
To set a variable from the makefile, write a line starting with the
-variable name followed by @samp{=} @samp{:=}, or @samp{::=}. Whatever
+variable name followed by @samp{=}, @samp{:=}, or @samp{::=}. Whatever
follows the @samp{=}, @samp{:=}, or @samp{::=} on the line becomes the
value. For example,
@@ -5669,7 +5678,7 @@ endif
@end example
The shell assignment operator @samp{!=} can be used to execute a
-program and set a variable to its output. This operator first
+shell script and set a variable to its output. This operator first
evaluates the right-hand side, then passes that result to the shell
for execution. If the result of the execution ends in a newline, that
one newline is removed; all other newlines are replaced by spaces.
@@ -5694,6 +5703,9 @@ hash := $(shell printf '\043')
var := $(shell find . -name "*.c")
@end example
+As with the @code{shell} function, the exit status of the just-invoked
+shell script is stored in the @code{.SHELLSTATUS} variable.
+
@node Appending, Override Directive, Setting, Using Variables
@section Appending More Text to Variables
@@ -6636,12 +6648,12 @@ effective; otherwise, the @var{text-if-false}, if any, is effective.
@item ifdef @var{variable-name}
The @code{ifdef} form takes the @emph{name} of a variable as its
-argument, not a reference to a variable. The value of that variable
-has a non-empty value, the @var{text-if-true} is effective; otherwise,
-the @var{text-if-false}, if any, is effective. Variables that have
-never been defined have an empty value. The text @var{variable-name}
-is expanded, so it could be a variable or function that expands
-to the name of a variable. For example:
+argument, not a reference to a variable. If the value of that
+variable has a non-empty value, the @var{text-if-true} is effective;
+otherwise, the @var{text-if-false}, if any, is effective. Variables
+that have never been defined have an empty value. The text
+@var{variable-name} is expanded, so it could be a variable or function
+that expands to the name of a variable. For example:
@example
bar = true
@@ -7520,13 +7532,22 @@ no?), but it is more likely to be a mistake.
@findex file
@cindex writing to a file
@cindex file, writing to
-
-The @code{file} function allows the makefile to write to a file. Two
-modes of writing are supported: overwrite, where the text is written
-to the beginning of the file and any existing content is lost, and
-append, where the text is written to the end of the file, preserving
-the existing content. In all cases the file is created if it does not
-exist.
+@cindex reading from a file
+@cindex file, reading from
+
+The @code{file} function allows the makefile to write to or read from
+a file. Two modes of writing are supported: overwrite, where the text
+is written to the beginning of the file and any existing content is
+lost, and append, where the text is written to the end of the file,
+preserving the existing content. In both cases the file is created if
+it does not exist. It is a fatal error if the file cannot be opened
+for writing, or if the write operation fails. The @code{file}
+function expands to the empty string when writing to a file.
+
+When reading from a file, the @code{file} function expands to the
+verbatim contents of the file, except that the final newline (if there
+is one) will be stripped. Attempting to read from a non-existent file
+expands to the empty string.
The syntax of the @code{file} function is:
@@ -7534,21 +7555,23 @@ The syntax of the @code{file} function is:
$(file @var{op} @var{filename}[,@var{text}])
@end example
-The operator @var{op} can be either @code{>} which indicates overwrite
-mode, or @code{>>} which indicates append mode. The @var{filename}
-indicates the file to be written to. There may optionally be
+When the @code{file} function is evaluated all its arguments are
+expanded first, then the file indicated by @var{filename} will be
+opened in the mode described by @var{op}.
+
+The operator @var{op} can be @code{>} to indicate the file will be
+overwritten with new content, @code{>>} to indicate the current
+contents of the file will be appended to, or @code{<} to indicate the
+contents of the file will be read in. The @var{filename} specifies
+the file to be written to or read from. There may optionally be
whitespace between the operator and the file name.
-When the @code{file} function is expanded all its arguments are
-expanded first, then the file indicated by @var{filename} will be
-opened in the mode described by @var{op}. Finally @var{text} will be
-written to the file. If @var{text} does not already end in a newline,
-even if empty, a final newline will be written. If the @var{text}
-argument is not given, nothing will be written. The result of
-evaluating the @code{file} function is always the empty string.
+When reading files, it is an error to provide a @var{text} value.
-It is a fatal error if the file cannot be opened for writing, or if
-the write operation fails.
+When writing files, @var{text} will be written to the file. If
+@var{text} does not already end in a newline a final newline will be
+written (even if @var{text} is the empty string). If the @var{text}
+argument is not given at all, nothing will be written.
For example, the @code{file} function can be useful if your build
system has a limited command line size and your recipe runs a command
@@ -8024,6 +8047,10 @@ implications of using the @code{shell} function within recursively
expanded variables vs.@: simply expanded variables (@pxref{Flavors, ,The
Two Flavors of Variables}).
+@vindex .SHELLSTATUS
+After the @code{shell} function or @samp{!=} assignment operator is
+used, its exit status is placed in the @code{.SHELLSTATUS} variable.
+
Here are some examples of the use of the @code{shell} function:
@example
@@ -10690,7 +10717,7 @@ in the normal way (@pxref{Suffix Rules}). Thus a double-suffix rule
@w{@samp{.@var{x}.a}} produces two pattern rules: @samp{@w{(%.o):}
@w{%.@var{x}}} and @samp{@w{%.a}: @w{%.@var{x}}}.@refill
-@node Extending make, Features, Archives, Top
+@node Extending make, Integrating make, Archives, Top
@chapter Extending GNU @code{make}
@cindex make extensions
@@ -11331,7 +11358,225 @@ cc -shared -fPIC -o mk_temp.so mk_temp.c
Temporary filename: tmpfile.A7JEwd
@end example
-@node Features, Missing, Extending make, Top
+@node Integrating make, Features, Extending make, Top
+@chapter Integrating GNU @code{make}
+@cindex make integration
+
+GNU @code{make} is often one component in a larger system of tools,
+including integrated development environments, compiler toolchains,
+and others. The role of @code{make} is to start commands and
+determine whether they succeeded or not: no special integration is
+needed to accomplish that. However, sometimes it is convenient to
+bind @code{make} more tightly with other parts of the system, both
+higher-level (tools that invoke @code{make}) and lower-level (tools
+that @code{make} invokes).
+
+@menu
+* Job Slots:: Share job slots with GNU @code{make}.
+* Terminal Output:: Control output to terminals.
+@end menu
+
+@node Job Slots, Terminal Output, Integrating make, Integrating make
+@section Sharing Job Slots with GNU @code{make}
+@cindex job slots, sharing
+@cindex tools, sharing job slots
+
+GNU @code{make} has the ability to run multiple recipes in parallel
+(@pxref{Parallel, ,Parallel Execution}) and to cap the total number of
+parallel jobs even across recursive invocations of @code{make}
+(@pxref{Options/Recursion, ,Communicating Options to a
+Sub-@code{make}}). Tools that @code{make} invokes which are also able
+to run multiple operations in parallel, either using multiple threads
+or multiple processes, can be enhanced to participate in GNU
+@code{make}'s job management facility to ensure that the total number
+of active threads/processes running on the system does not exceed the
+maximum number of slots provided to GNU @code{make}. @refill
+
+@cindex jobserver
+GNU @code{make} uses a method called the ``jobserver'' to control the
+number of active jobs across recursive invocations. The actual
+implementation of the jobserver varies across different operating
+systems, but some fundamental aspects are always true.
+
+First, only command lines that @code{make} understands to be recursive
+invocations of @code{make} (@pxref{MAKE Variable, ,How the @code{MAKE}
+Variable Works}) will have access to the jobserver. When writing
+makefiles you must be sure to mark the command as recursive (most
+commonly by prefixing the command line with the @code{+} indicator
+(@pxref{Recursion, ,Recursive Use of @code{make}}).
+
+Second, @code{make} will provide information necessary for accessing
+the jobserver through the environment to its children, in the
+@code{MAKEFLAGS} environment variable. Tools which want to
+participate in the jobserver protocol will need to parse this
+environment variable, as described in subsequent sections.
+
+Third, every command @code{make} starts has one implicit job slot
+reserved for it before it starts. Any tool which wants to participate
+in the jobserver protocol should assume it can always run one job
+without having to contact the jobserver at all.
+
+Finally, it's critical that tools that participate in the jobserver
+protocol return the exact number of slots they obtained from the
+jobserver back to the jobserver before they exit, even under error
+conditions. Remember that the implicit job slot should @strong{not}
+be returned to the jobserver! Returning too few slots means that
+those slots will be lost for the rest of the build process; returning
+too many slots means that extra slots will be available. The
+top-level @code{make} command will print an error message at the end
+of the build if it detects an incorrect number of slots available in
+the jobserver.
+
+As an example, suppose you are implementing a linker which provides
+for multithreaded operation. You would like to enhance the linker so
+that if it is invoked by GNU @code{make} it can participate in the
+jobserver protocol to control how many threads are used during link.
+First you will need to modify the linker to determine if the
+@code{MAKEFLAGS} environment variable is set. Next you will need to
+parse the value of that variable to determine if the jobserver is
+available, and how to access it. If it is available then you can
+access it to obtain job slots controlling how much parallelism your
+tool can use. Once done your tool must return those job slots back to
+the jobserver.
+
+@menu
+* POSIX Jobserver:: Using the jobserver on POSIX systems.
+* Windows Jobserver:: Using the jobserver on Windows systems.
+@end menu
+
+@node POSIX Jobserver, Windows Jobserver, Job Slots, Job Slots
+@subsection POSIX Jobserver Interaction
+@cindex jobserver on POSIX
+
+On POSIX systems the jobserver is implemented as a simple UNIX pipe.
+The pipe will be pre-loaded with one single-character token for each
+available job. To obtain an extra slot you must read a single
+character from the jobserver pipe; to release a slot you must write a
+single character back into the jobserver pipe.
+
+To access the pipe you must parse the @code{MAKEFLAGS} variable and
+look for the argument string @code{--jobserver-auth=R,W} where
+@samp{R} and @samp{W} are non-negative integers representing file
+descriptors: @samp{R} is the read file descriptor and @samp{W} is the
+write file descriptor.
+
+It's important that when you release the job slot, you write back the
+same character you read from the pipe for that slot. Don't assume
+that all tokens are the same character; different characters may have
+different meanings to GNU @code{make}. The order is not important,
+since @code{make} has no idea in what order jobs will complete anyway.
+
+There are various error conditions you must consider to ensure your
+implementation is robust:
+
+@itemize @bullet
+@item
+Usually you will have a command-line argument controlling the parallel
+operation of your tool. Consider whether your tool should detect
+situations where both the jobserver and the command-line argument are
+specified, and how it should react.
+
+@item
+If your tool determines that the @code{--jobserver-auth} option is
+available in @code{MAKEFLAGS} but that the file descriptors specified
+are closed, this means that the calling @code{make} process did not
+think that your tool was a recursive @code{make} invocation (e.g., the
+command line was not prefixed with a @code{+} character). You should
+notify your users of this situation.
+
+@item
+Your tool should also examine the first word of the @code{MAKEFLAGS}
+variable and look for the character @code{n}. If this character is
+present then @code{make} was invoked with the @samp{-n} option and
+your tool should stop without performing any operations.
+
+@item
+Your tool should be sure to write back the tokens it read, even under
+error conditions. This includes not only errors in your tool but also
+outside influences such as interrupts (@code{SIGINT}), etc. You may
+want to install signal handlers to manage this write-back.
+@end itemize
+
+@node Windows Jobserver, , POSIX Jobserver, Job Slots
+@subsection Windows Jobserver Interaction
+@cindex jobserver on Windows
+
+On Windows systems the jobserver is implemented as a named semaphore.
+The semaphore will be set with an initial count equal to the number of
+available slots; to obtain a slot you must wait on the semaphore (with
+or without a timeout). To release a slot, release the semaphore.
+
+To access the semaphore you must parse the @code{MAKEFLAGS} variable and
+look for the argument string @code{--jobserver-auth=NAME} where
+@samp{NAME} is the name of the named semaphore. Use this name with
+@code{OpenSemaphore} to create a handle to the semaphore.
+
+There are various error conditions you must consider to ensure your
+implementation is robust:
+
+@itemize @bullet
+@item
+Usually you will have a command-line argument controlling the parallel
+operation of your tool. Consider whether your tool should detect
+situations where both the jobserver and the command-line argument are
+specified, and how it should react.
+
+@item
+Your tool should be sure to release the semaphore for the tokens it
+read, even under error conditions. This includes not only errors in
+your tool but also outside influences such as interrupts
+(@code{SIGINT}), etc. You may want to install signal handlers to
+manage this write-back.
+@end itemize
+
+@node Terminal Output, , Job Slots, Integrating make
+@section Synchronized Terminal Output
+@cindex parallel output to terminal
+@cindex terminal, output to
+
+Normally GNU @code{make} will invoke all commands with access to the
+same standard and error outputs that @code{make} itself was started
+with. A number of tools will detect whether the output is a terminal
+or not-a-terminal, and use this information to change the output
+style. For example if the output goes to a terminal the tool may add
+control characters that set color, or even change the location of the
+cursor. If the output is not going to a terminal then these special
+control characters are not emitted so that they don't corrupt log
+files, etc.
+
+The @code{--output-sync} (@pxref{Parallel Output, ,Output During
+Parallel Output}) option will defeat the terminal detection. When
+output synchronization is enabled GNU @code{make} arranges for all
+command output to be written to a file, so that its output can be
+written as a block without interference from other commands. This
+means that all tools invoked by @code{make} will believe that their
+output is not going to be displayed on a terminal, even when it will
+be (because @code{make} will display it there after the command is
+completed).
+
+In order to facilitate tools which would like to determine whether or
+not their output will be displayed on a terminal, GNU @code{make} will
+set the @code{MAKE_TERMOUT} and @code{MAKE_TERMERR} environment
+variables before invoking any commands. Tools which would like to
+determine whether standard or error output (respectively) will be
+displayed on a terminal can check these environment variables to
+determine if they exist and contain a non-empty value. If so the tool
+can assume that the output will (eventually) be displayed on a
+terminal. If the variables are not set or have an empty value, then
+the tool should fall back to its normal methods of detecting whether
+output is going to a terminal or not.
+
+The content of the variables can be parsed to determine the type of
+terminal which will be used to display the output.
+
+Similarly, environments which invoke @code{make} and would like to
+capture the output and eventually display it on a terminal (or some
+display which can interpret terminal control characters) can set these
+variables before invoking @code{make}. GNU @code{make} will not
+modify these environment variables if they already exist when it
+starts.
+
+@node Features, Missing, Integrating make, Top
@chapter Features of GNU @code{make}
@cindex features of GNU @code{make}
@cindex portability
@@ -12087,9 +12332,9 @@ variable has no effect on the operation of @code{make}.@*
@item CURDIR
-Set to the pathname of the current working directory (after all
-@code{-C} options are processed, if any). Setting this variable has no
-effect on the operation of @code{make}.@*
+nlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlSet to the absolute pathname of the current working directory (after
+all @code{-C} options are processed, if any). Setting this variable
+has no effect on the operation of @code{make}.@*
@xref{Recursion, ,Recursive Use of @code{make}}.
@item SUFFIXES
diff --git a/dosbuild.bat b/dosbuild.bat
index fac2e881..4afe0cff 100644
--- a/dosbuild.bat
+++ b/dosbuild.bat
@@ -1,65 +1,65 @@
-@echo off
-rem Copyright (C) 1998-2014 Free Software Foundation, Inc.
-rem This file is part of GNU Make.
-rem
-rem GNU Make is free software; you can redistribute it and/or modify it under
-rem the terms of the GNU General Public License as published by the Free
-rem Software Foundation; either version 3 of the License, or (at your option)
-rem any later version.
-rem
-rem GNU Make is distributed in the hope that it will be useful, but WITHOUT
-rem ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-rem FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for.
-rem more details.
-rem
-rem You should have received a copy of the GNU General Public License along
-rem with this program. If not, see <http://www.gnu.org/licenses/>.
-
-echo Building Make for MSDOS
-
-rem Echo ON so they will see what is going on.
-@echo on
-gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g commands.c -o commands.o
-gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g output.c -o output.o
-gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g job.c -o job.o
-gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g dir.c -o dir.o
-gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g file.c -o file.o
-gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g misc.c -o misc.o
-gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g main.c -o main.o
-gcc -c -I. -I./glob -DHAVE_CONFIG_H -DINCLUDEDIR=\"c:/djgpp/include\" -O2 -g read.c -o read.o
-gcc -c -I. -I./glob -DHAVE_CONFIG_H -DLIBDIR=\"c:/djgpp/lib\" -O2 -g remake.c -o remake.o
-gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g rule.c -o rule.o
-gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g implicit.c -o implicit.o
-gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g default.c -o default.o
-gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g variable.c -o variable.o
-gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g expand.c -o expand.o
-gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g function.c -o function.o
-gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g vpath.c -o vpath.o
-gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g hash.c -o hash.o
-gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g strcache.c -o strcache.o
-gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g version.c -o version.o
-gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g ar.c -o ar.o
-gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g arscan.c -o arscan.o
-gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g signame.c -o signame.o
-gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g remote-stub.c -o remote-stub.o
-gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g getopt.c -o getopt.o
-gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g getopt1.c -o getopt1.o
-@cd glob
-@if exist libglob.a del libglob.a
-gcc -I. -c -DHAVE_CONFIG_H -I.. -O2 -g glob.c -o glob.o
-gcc -I. -c -DHAVE_CONFIG_H -I.. -O2 -g fnmatch.c -o fnmatch.o
-ar rv libglob.a glob.o fnmatch.o
-@echo off
-cd ..
-echo commands.o > respf.$$$
-for %%f in (job output dir file misc main read remake rule implicit default variable) do echo %%f.o >> respf.$$$
-for %%f in (expand function vpath hash strcache version ar arscan signame remote-stub getopt getopt1) do echo %%f.o >> respf.$$$
-echo glob/libglob.a >> respf.$$$
-rem gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g guile.c -o guile.o
-rem echo guile.o >> respf.$$$
-@echo Linking...
-@echo on
-gcc -o make.new @respf.$$$
-@if exist make.exe echo Make.exe is now built!
-@if not exist make.exe echo Make.exe build failed...
-@if exist make.exe del respf.$$$
+@echo off
+rem Copyright (C) 1998-2016 Free Software Foundation, Inc.
+rem This file is part of GNU Make.
+rem
+rem GNU Make is free software; you can redistribute it and/or modify it under
+rem the terms of the GNU General Public License as published by the Free
+rem Software Foundation; either version 3 of the License, or (at your option)
+rem any later version.
+rem
+rem GNU Make is distributed in the hope that it will be useful, but WITHOUT
+rem ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+rem FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for.
+rem more details.
+rem
+rem You should have received a copy of the GNU General Public License along
+rem with this program. If not, see <http://www.gnu.org/licenses/>.
+
+echo Building Make for MSDOS
+
+rem Echo ON so they will see what is going on.
+@echo on
+gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g commands.c -o commands.o
+gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g output.c -o output.o
+gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g job.c -o job.o
+gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g dir.c -o dir.o
+gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g file.c -o file.o
+gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g misc.c -o misc.o
+gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g main.c -o main.o
+gcc -c -I. -I./glob -DHAVE_CONFIG_H -DINCLUDEDIR=\"c:/djgpp/include\" -O2 -g read.c -o read.o
+gcc -c -I. -I./glob -DHAVE_CONFIG_H -DLIBDIR=\"c:/djgpp/lib\" -O2 -g remake.c -o remake.o
+gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g rule.c -o rule.o
+gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g implicit.c -o implicit.o
+gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g default.c -o default.o
+gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g variable.c -o variable.o
+gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g expand.c -o expand.o
+gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g function.c -o function.o
+gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g vpath.c -o vpath.o
+gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g hash.c -o hash.o
+gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g strcache.c -o strcache.o
+gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g version.c -o version.o
+gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g ar.c -o ar.o
+gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g arscan.c -o arscan.o
+gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g signame.c -o signame.o
+gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g remote-stub.c -o remote-stub.o
+gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g getopt.c -o getopt.o
+gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g getopt1.c -o getopt1.o
+@cd glob
+@if exist libglob.a del libglob.a
+gcc -I. -c -DHAVE_CONFIG_H -I.. -O2 -g glob.c -o glob.o
+gcc -I. -c -DHAVE_CONFIG_H -I.. -O2 -g fnmatch.c -o fnmatch.o
+ar rv libglob.a glob.o fnmatch.o
+@echo off
+cd ..
+echo commands.o > respf.$$$
+for %%f in (job output dir file misc main read remake rule implicit default variable) do echo %%f.o >> respf.$$$
+for %%f in (expand function vpath hash strcache version ar arscan signame remote-stub getopt getopt1) do echo %%f.o >> respf.$$$
+echo glob/libglob.a >> respf.$$$
+rem gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g guile.c -o guile.o
+rem echo guile.o >> respf.$$$
+@echo Linking...
+@echo on
+gcc -o make.new @respf.$$$
+@if exist make.exe echo Make.exe is now built!
+@if not exist make.exe echo Make.exe build failed...
+@if exist make.exe del respf.$$$
diff --git a/expand.c b/expand.c
index 1c87db10..0b5fd011 100644
--- a/expand.c
+++ b/expand.c
@@ -1,5 +1,5 @@
/* Variable expansion functions for GNU Make.
-Copyright (C) 1988-2014 Free Software Foundation, Inc.
+Copyright (C) 1988-2016 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
@@ -26,7 +26,7 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
/* Initially, any errors reported when expanding strings will be reported
against the file where the error appears. */
-const gmk_floc **expanding_var = &reading_file;
+const floc **expanding_var = &reading_file;
/* The next two describe the variable output buffer.
This buffer is used to hold the variable-expansion of a line of the
@@ -96,8 +96,8 @@ char *
recursively_expand_for_file (struct variable *v, struct file *file)
{
char *value;
- const gmk_floc *this_var;
- const gmk_floc **saved_varp;
+ const floc *this_var;
+ const floc **saved_varp;
struct variable_set_list *save = 0;
int set_reading = 0;
@@ -235,8 +235,10 @@ variable_expand_string (char *line, const char *string, long length)
switch (*p)
{
case '$':
- /* $$ seen means output one $ to the variable output buffer. */
- o = variable_buffer_output (o, p, 1);
+ case '\0':
+ /* $$ or $ at the end of the string means output one $ to the
+ variable output buffer. */
+ o = variable_buffer_output (o, p1, 1);
break;
case '(':
@@ -381,11 +383,8 @@ variable_expand_string (char *line, const char *string, long length)
}
break;
- case '\0':
- break;
-
default:
- if (isblank ((unsigned char)p[-1]))
+ if (ISSPACE (p[-1]))
break;
/* A $ followed by a random char is a variable reference:
@@ -459,7 +458,7 @@ variable_expand_for_file (const char *line, struct file *file)
{
char *result;
struct variable_set_list *savev;
- const gmk_floc *savef;
+ const floc *savef;
if (file == 0)
return variable_expand (line);
diff --git a/file.c b/file.c
index e1a8e800..ae1c2857 100644
--- a/file.c
+++ b/file.c
@@ -1,5 +1,5 @@
/* Target file management for GNU Make.
-Copyright (C) 1988-2014 Free Software Foundation, Inc.
+Copyright (C) 1988-2016 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
@@ -57,9 +57,6 @@ file_hash_cmp (const void *x, const void *y)
((struct file const *) y)->hname);
}
-#ifndef FILE_BUCKETS
-#define FILE_BUCKETS 1007
-#endif
static struct hash_table files;
/* Whether or not .SECONDARY with no prerequisites was given. */
@@ -75,9 +72,12 @@ lookup_file (const char *name)
{
struct file *f;
struct file file_key;
-#if defined(VMS) && !defined(WANT_CASE_SENSITIVE_TARGETS)
+#ifdef VMS
+ int want_vmsify;
+#ifndef WANT_CASE_SENSITIVE_TARGETS
char *lname;
#endif
+#endif
assert (*name != '\0');
@@ -85,6 +85,7 @@ lookup_file (const char *name)
for names read from makefiles. It is here for names passed
on the command line. */
#ifdef VMS
+ want_vmsify = (strpbrk (name, "]>:^") != NULL);
# ifndef WANT_CASE_SENSITIVE_TARGETS
if (*name != '.')
{
@@ -100,6 +101,8 @@ lookup_file (const char *name)
while (name[0] == '[' && name[1] == ']' && name[2] != '\0')
name += 2;
+ while (name[0] == '<' && name[1] == '>' && name[2] != '\0')
+ name += 2;
#endif
while (name[0] == '.'
#ifdef HAVE_DOS_PATHS
@@ -120,15 +123,19 @@ lookup_file (const char *name)
}
if (*name == '\0')
- /* It was all slashes after a dot. */
-#if defined(VMS)
- name = "[]";
-#elif defined(_AMIGA)
- name = "";
+ {
+ /* It was all slashes after a dot. */
+#if defined(_AMIGA)
+ name = "";
#else
- name = "./";
+ name = "./";
#endif
-
+#if defined(VMS)
+ /* TODO - This section is probably not needed. */
+ if (want_vmsify)
+ name = "[]";
+#endif
+ }
file_key.hname = name;
f = hash_find_item (&files, &file_key);
#if defined(VMS) && !defined(WANT_CASE_SENSITIVE_TARGETS)
diff --git a/filedef.h b/filedef.h
index b8973db1..14b41871 100644
--- a/filedef.h
+++ b/filedef.h
@@ -1,5 +1,5 @@
/* Definition of target file data structures for GNU Make.
-Copyright (C) 1988-2014 Free Software Foundation, Inc.
+Copyright (C) 1988-2016 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
@@ -58,6 +58,8 @@ struct file
FILE_TIMESTAMP last_mtime; /* File's modtime, if already known. */
FILE_TIMESTAMP mtime_before_update; /* File's modtime before any updating
has been performed. */
+ unsigned int considered; /* equal to 'considered' if file has been
+ considered on current scan of goal chain */
int command_flags; /* Flags OR'd in for cmds; see commands.h. */
enum update_status /* Status of the last attempt to update. */
{
@@ -96,14 +98,12 @@ struct file
unsigned int ignore_vpath:1;/* Nonzero if we threw out VPATH name. */
unsigned int pat_searched:1;/* Nonzero if we already searched for
pattern-specific variables. */
- 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 *suffix_file, *default_file;
+extern struct file *default_file;
struct file *lookup_file (const char *name);
@@ -117,9 +117,12 @@ void rehash_file (struct file *file, const char *name);
void set_command_state (struct file *file, enum cmd_state state);
void notice_finished_file (struct file *file);
void init_hash_files (void);
+void verify_file_data_base (void);
char *build_target_list (char *old_list);
void print_prereqs (const struct dep *deps);
void print_file_data_base (void);
+int try_implicit_rule (struct file *file, unsigned int depth);
+int stemlen_compare (const void *v1, const void *v2);
#if FILE_TIMESTAMP_HI_RES
# define FILE_TIMESTAMP_STAT_MODTIME(fname, st) \
diff --git a/function.c b/function.c
index 169c3a17..b7f0e56b 100644
--- a/function.c
+++ b/function.c
@@ -1,5 +1,5 @@
/* Builtin function expansion for GNU Make.
-Copyright (C) 1988-2014 Free Software Foundation, Inc.
+Copyright (C) 1988-2016 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
@@ -115,8 +115,8 @@ subst_expand (char *o, const char *text, const char *subst, const char *replace,
/* If we're substituting only by fully matched words,
or only at the ends of words, check that this case qualifies. */
if (by_word
- && ((p > text && !isblank ((unsigned char)p[-1]))
- || ! STOP_SET (p[slen], MAP_BLANK|MAP_NUL)))
+ && ((p > text && !ISSPACE (p[-1]))
+ || ! STOP_SET (p[slen], MAP_SPACE|MAP_NUL)))
/* Struck out. Output the rest of the string that is
no longer to be replaced. */
o = variable_buffer_output (o, subst, slen);
@@ -566,10 +566,12 @@ func_notdir_suffix (char *o, char **argv, const char *funcname)
if (is_notdir || p >= p2)
{
#ifdef VMS
- o = variable_buffer_output (o, ",", 1);
-#else
- o = variable_buffer_output (o, " ", 1);
+ if (vms_comma_separator)
+ o = variable_buffer_output (o, ",", 1);
+ else
#endif
+ o = variable_buffer_output (o, " ", 1);
+
doneany = 1;
}
}
@@ -596,7 +598,7 @@ func_basename_dir (char *o, char **argv, const char *funcname)
int stop = MAP_DIRSEP | (is_basename ? MAP_DOT : 0) | MAP_NUL;
#ifdef VMS
/* As in func_notdir_suffix ... */
- char *vms_p3 = alloca(strlen(p3) + 1);
+ char *vms_p3 = alloca (strlen(p3) + 1);
int i;
for (i = 0; p3[i]; i++)
if (p3[i] == ',')
@@ -624,7 +626,13 @@ func_basename_dir (char *o, char **argv, const char *funcname)
#endif
else if (is_dir)
#ifdef VMS
- o = variable_buffer_output (o, "[]", 2);
+ {
+ extern int vms_report_unix_paths;
+ if (vms_report_unix_paths)
+ o = variable_buffer_output (o, "./", 2);
+ else
+ o = variable_buffer_output (o, "[]", 2);
+ }
#else
#ifndef _AMIGA
o = variable_buffer_output (o, "./", 2);
@@ -637,10 +645,12 @@ func_basename_dir (char *o, char **argv, const char *funcname)
o = variable_buffer_output (o, p2, len);
#ifdef VMS
- o = variable_buffer_output (o, ",", 1);
-#else
- o = variable_buffer_output (o, " ", 1);
+ if (vms_comma_separator)
+ o = variable_buffer_output (o, ",", 1);
+ else
#endif
+ o = variable_buffer_output (o, " ", 1);
+
doneany = 1;
}
@@ -745,9 +755,9 @@ func_words (char *o, char **argv, const char *funcname UNUSED)
char *
strip_whitespace (const char **begpp, const char **endpp)
{
- while (*begpp <= *endpp && isspace ((unsigned char)**begpp))
+ while (*begpp <= *endpp && ISSPACE (**begpp))
(*begpp) ++;
- while (*endpp >= *begpp && isspace ((unsigned char)**endpp))
+ while (*endpp >= *begpp && ISSPACE (**endpp))
(*endpp) --;
return (char *)*begpp;
}
@@ -860,8 +870,12 @@ func_foreach (char *o, char **argv, const char *funcname UNUSED)
unsigned int len;
struct variable *var;
+ /* Clean up the variable name by removing whitespace. */
+ char *vp = next_token (varname);
+ end_of_token (vp)[0] = '\0';
+
push_new_variable_scope ();
- var = define_variable (varname, strlen (varname), "", o_automatic, 0);
+ var = define_variable (vp, strlen (vp), "", o_automatic, 0);
/* loop through LIST, put the value in VAR and expand BODY */
while ((p = find_next_token (&list_iterator, &len)) != 0)
@@ -1071,10 +1085,9 @@ func_strip (char *o, char **argv, const char *funcname UNUSED)
int i=0;
const char *word_start;
- while (isspace ((unsigned char)*p))
- ++p;
+ NEXT_TOKEN (p);
word_start = p;
- for (i=0; *p != '\0' && !isspace ((unsigned char)*p); ++p, ++i)
+ for (i=0; *p != '\0' && !ISSPACE (*p); ++p, ++i)
{}
if (!i)
break;
@@ -1440,10 +1453,23 @@ fold_newlines (char *buffer, unsigned int *length, int trim_newlines)
*length = last_nonnl - buffer;
}
+pid_t shell_function_pid = 0;
+static int shell_function_completed;
+void
+shell_completed (int exit_code, int exit_sig)
+{
+ char buf[256];
-int shell_function_pid = 0, shell_function_completed;
+ shell_function_pid = 0;
+ if (exit_sig == 0 && exit_code == 127)
+ shell_function_completed = -1;
+ else
+ shell_function_completed = 1;
+ sprintf (buf, "%d", exit_code);
+ define_variable_cname (".SHELLSTATUS", buf, o_override, 0);
+}
#ifdef WINDOWS32
/*untested*/
@@ -1592,8 +1618,7 @@ msdos_openpipe (int* pipedes, int *pidp, char *text)
extern int dos_command_running, dos_status;
/* Make sure not to bother processing an empty line. */
- while (isblank ((unsigned char)*text))
- ++text;
+ NEXT_TOKEN (text);
if (*text == '\0')
return 0;
@@ -1623,14 +1648,15 @@ msdos_openpipe (int* pipedes, int *pidp, char *text)
errno = EINTR;
else if (errno == 0)
errno = ENOMEM;
- shell_function_completed = -1;
+ if (fpipe)
+ pclose (fpipe);
+ shell_completed (127, 0);
}
else
{
pipedes[0] = fileno (fpipe);
*pidp = 42; /* Yes, the Meaning of Life, the Universe, and Everything! */
errno = e;
- shell_function_completed = 1;
}
return fpipe;
}
@@ -1689,7 +1715,7 @@ func_shell_base (char *o, char **argv, int trim_newlines)
#endif
return o;
}
-#endif
+#endif /* !__MSDOS__ */
/* Using a target environment for 'shell' loses in cases like:
export var = $(shell echo foobie)
@@ -1709,7 +1735,8 @@ func_shell_base (char *o, char **argv, int trim_newlines)
if (reading_file && reading_file->filenm)
{
char *p = alloca (strlen (reading_file->filenm)+11+4);
- sprintf (p, "%s:%lu: ", reading_file->filenm, reading_file->lineno);
+ sprintf (p, "%s:%lu: ", reading_file->filenm,
+ reading_file->lineno + reading_file->offset);
error_prefix = p;
}
else
@@ -1728,6 +1755,7 @@ func_shell_base (char *o, char **argv, int trim_newlines)
perror_with_name (error_prefix, "pipe");
return o;
}
+
#elif defined(WINDOWS32)
windows32_openpipe (pipedes, errfd, &pid, command_argv, envp);
/* Restore the value of just_print_flag. */
@@ -1736,11 +1764,11 @@ func_shell_base (char *o, char **argv, int trim_newlines)
if (pipedes[0] < 0)
{
/* Open of the pipe failed, mark as failed execution. */
- shell_function_completed = -1;
+ shell_completed (127, 0);
perror_with_name (error_prefix, "pipe");
return o;
}
- else
+
#else
if (pipe (pipedes) < 0)
{
@@ -1748,115 +1776,113 @@ func_shell_base (char *o, char **argv, int trim_newlines)
return o;
}
-# ifdef __EMX__
- /* close some handles that are unnecessary for the child process */
+ /* Close handles that are unnecessary for the child process. */
CLOSE_ON_EXEC(pipedes[1]);
CLOSE_ON_EXEC(pipedes[0]);
- /* Never use fork()/exec() here! Use spawn() instead in exec_command() */
- pid = child_execute_job (FD_STDIN, pipedes[1], errfd, command_argv, envp);
- if (pid < 0)
- perror_with_name (error_prefix, "spawn");
-# else /* ! __EMX__ */
- pid = fork ();
+
+ {
+ struct output out;
+ out.syncout = 1;
+ out.out = pipedes[1];
+ out.err = errfd;
+
+ pid = child_execute_job (&out, 1, command_argv, envp);
+ }
+
if (pid < 0)
- perror_with_name (error_prefix, "fork");
- else if (pid == 0)
{
-# ifdef SET_STACK_SIZE
- /* Reset limits, if necessary. */
- if (stack_limit.rlim_cur)
- setrlimit (RLIMIT_STACK, &stack_limit);
-# endif
- child_execute_job (FD_STDIN, pipedes[1], errfd, command_argv, envp);
+ perror_with_name (error_prefix, "fork");
+ return o;
}
- else
-# endif
#endif
- {
- /* We are the parent. */
- char *buffer;
- unsigned int maxlen, i;
- int cc;
- /* Record the PID for reap_children. */
- shell_function_pid = pid;
+ {
+ char *buffer;
+ unsigned int maxlen, i;
+ int cc;
+
+ /* Record the PID for reap_children. */
+ shell_function_pid = pid;
#ifndef __MSDOS__
- shell_function_completed = 0;
+ shell_function_completed = 0;
- /* Free the storage only the child needed. */
- free (command_argv[0]);
- free (command_argv);
+ /* Free the storage only the child needed. */
+ free (command_argv[0]);
+ free (command_argv);
- /* 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]);
+ /* 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
- /* Set up and read from the pipe. */
+ /* Set up and read from the pipe. */
- maxlen = 200;
- buffer = xmalloc (maxlen + 1);
+ maxlen = 200;
+ buffer = xmalloc (maxlen + 1);
- /* Read from the pipe until it gets EOF. */
- for (i = 0; ; i += cc)
- {
- if (i == maxlen)
- {
- maxlen += 512;
- buffer = xrealloc (buffer, maxlen + 1);
- }
+ /* Read from the pipe until it gets EOF. */
+ for (i = 0; ; i += cc)
+ {
+ if (i == maxlen)
+ {
+ maxlen += 512;
+ buffer = xrealloc (buffer, maxlen + 1);
+ }
- EINTRLOOP (cc, read (pipedes[0], &buffer[i], maxlen - i));
- if (cc <= 0)
- break;
- }
- buffer[i] = '\0';
+ EINTRLOOP (cc, read (pipedes[0], &buffer[i], maxlen - i));
+ if (cc <= 0)
+ break;
+ }
+ buffer[i] = '\0';
- /* Close the read side of the pipe. */
+ /* Close the read side of the pipe. */
#ifdef __MSDOS__
- if (fpipe)
- (void) pclose (fpipe);
+ if (fpipe)
+ {
+ int st = pclose (fpipe);
+ shell_completed (st, 0);
+ }
#else
- (void) close (pipedes[0]);
+ (void) close (pipedes[0]);
#endif
- /* Loop until child_handler or reap_children() sets
- shell_function_completed to the status of our child shell. */
- while (shell_function_completed == 0)
- reap_children (1, 0);
+ /* Loop until child_handler or reap_children() sets
+ shell_function_completed to the status of our child shell. */
+ while (shell_function_completed == 0)
+ reap_children (1, 0);
- if (batch_filename)
- {
- DB (DB_VERBOSE, (_("Cleaning up temporary batch file %s\n"),
- batch_filename));
- remove (batch_filename);
- free (batch_filename);
- }
- shell_function_pid = 0;
+ if (batch_filename)
+ {
+ DB (DB_VERBOSE, (_("Cleaning up temporary batch file %s\n"),
+ batch_filename));
+ remove (batch_filename);
+ free (batch_filename);
+ }
+ shell_function_pid = 0;
- /* The child_handler function will set shell_function_completed
- to 1 when the child dies normally, or to -1 if it
- dies with status 127, which is most likely an exec fail. */
+ /* shell_completed() will set shell_function_completed to 1 when the
+ child dies normally, or to -1 if it dies with status 127, which is
+ most likely an exec fail. */
- if (shell_function_completed == -1)
- {
- /* This likely means that the execvp failed, so we should just
- write the error message in the pipe from the child. */
- fputs (buffer, stderr);
- fflush (stderr);
- }
- else
- {
- /* The child finished normally. Replace all newlines in its output
- with spaces, and put that in the variable output buffer. */
- fold_newlines (buffer, &i, trim_newlines);
- o = variable_buffer_output (o, buffer, i);
- }
+ if (shell_function_completed == -1)
+ {
+ /* This likely means that the execvp failed, so we should just
+ write the error message in the pipe from the child. */
+ fputs (buffer, stderr);
+ fflush (stderr);
+ }
+ else
+ {
+ /* The child finished normally. Replace all newlines in its output
+ with spaces, and put that in the variable output buffer. */
+ fold_newlines (buffer, &i, trim_newlines);
+ o = variable_buffer_output (o, buffer, i);
+ }
- free (buffer);
- }
+ free (buffer);
+ }
return o;
}
@@ -1950,7 +1976,7 @@ func_shell_base (char *o, char **argv, int trim_newlines)
}
#endif /* _AMIGA */
-char *
+static char *
func_shell (char *o, char **argv, const char *funcname UNUSED)
{
return func_shell_base (o, argv, 1);
@@ -1979,8 +2005,7 @@ func_not (char *o, char **argv, char *funcname UNUSED)
{
const char *s = argv[0];
int result = 0;
- while (isspace ((unsigned char)*s))
- s++;
+ NEXT_TOKEN (s);
result = ! (*s);
o = variable_buffer_output (o, result ? "1" : "", result);
return o;
@@ -2184,29 +2209,70 @@ func_file (char *o, char **argv, const char *funcname UNUSED)
mode = "a";
++fn;
}
- fn = next_token (fn);
+ NEXT_TOKEN (fn);
- fp = fopen (fn, mode);
+ if (fn[0] == '\0')
+ O (fatal, *expanding_var, _("file: missing filename"));
+
+ ENULLLOOP (fp, fopen (fn, mode));
if (fp == NULL)
- {
- const char *err = strerror (errno);
- OSS (fatal, reading_file, _("open: %s: %s"), fn, err);
- }
+ OSS (fatal, reading_file, _("open: %s: %s"), fn, strerror (errno));
+
if (argv[1])
{
int l = strlen (argv[1]);
int nl = l == 0 || argv[1][l-1] != '\n';
if (fputs (argv[1], fp) == EOF || (nl && fputc ('\n', fp) == EOF))
- {
- const char *err = strerror (errno);
- OSS (fatal, reading_file, _("write: %s: %s"), fn, err);
- }
+ OSS (fatal, reading_file, _("write: %s: %s"), fn, strerror (errno));
}
- fclose (fp);
+ if (fclose (fp))
+ OSS (fatal, reading_file, _("close: %s: %s"), fn, strerror (errno));
+ }
+ else if (fn[0] == '<')
+ {
+ char *preo = o;
+ FILE *fp;
+
+ ++fn;
+ NEXT_TOKEN (fn);
+ if (fn[0] == '\0')
+ O (fatal, *expanding_var, _("file: missing filename"));
+
+ if (argv[1])
+ O (fatal, *expanding_var, _("file: too many arguments"));
+
+ ENULLLOOP (fp, fopen (fn, "r"));
+ if (fp == NULL)
+ {
+ if (errno == ENOENT)
+ return o;
+ OSS (fatal, reading_file, _("open: %s: %s"), fn, strerror (errno));
+ }
+
+ while (1)
+ {
+ char buf[1024];
+ size_t l = fread (buf, 1, sizeof (buf), fp);
+ if (l > 0)
+ o = variable_buffer_output (o, buf, l);
+
+ if (ferror (fp))
+ if (errno != EINTR)
+ OSS (fatal, reading_file, _("read: %s: %s"), fn, strerror (errno));
+ if (feof (fp))
+ break;
+ }
+ if (fclose (fp))
+ OSS (fatal, reading_file, _("close: %s: %s"), fn, strerror (errno));
+
+ /* Remove trailing newline. */
+ if (o > preo && o[-1] == '\n')
+ if (--o > preo && o[-1] == '\r')
+ --o;
}
else
- OS (fatal, reading_file, _("Invalid file operation: %s"), fn);
+ OS (fatal, *expanding_var, _("file: invalid file operation: %s"), fn);
return o;
}
@@ -2379,7 +2445,8 @@ handle_function (char **op, const char **stringp)
/* We found a builtin function. Find the beginning of its arguments (skip
whitespace after the name). */
- beg = next_token (beg + entry_p->len);
+ beg += entry_p->len;
+ NEXT_TOKEN (beg);
/* Find the end of the function invocation, counting nested use of
whichever kind of parens we use. Since we're looking, count commas
@@ -2479,7 +2546,6 @@ func_call (char *o, char **argv, const char *funcname UNUSED)
{
static int max_args = 0;
char *fname;
- char *cp;
char *body;
int flen;
int i;
@@ -2487,16 +2553,9 @@ func_call (char *o, char **argv, const char *funcname UNUSED)
const struct function_table_entry *entry_p;
struct variable *v;
- /* There is no way to define a variable with a space in the name, so strip
- leading and trailing whitespace as a favor to the user. */
- fname = argv[0];
- while (isspace ((unsigned char)*fname))
- ++fname;
-
- cp = fname + strlen (fname) - 1;
- while (cp > fname && isspace ((unsigned char)*cp))
- --cp;
- cp[1] = '\0';
+ /* Clean up the name of the variable to be invoked. */
+ fname = next_token (argv[0]);
+ end_of_token (fname)[0] = '\0';
/* Calling nothing is a no-op */
if (*fname == '\0')
@@ -2575,7 +2634,7 @@ func_call (char *o, char **argv, const char *funcname UNUSED)
}
void
-define_new_function (const gmk_floc *flocp, const char *name,
+define_new_function (const floc *flocp, const char *name,
unsigned int min, unsigned int max, unsigned int flags,
gmk_func_ptr func)
{
@@ -2595,10 +2654,10 @@ define_new_function (const gmk_floc *flocp, const char *name,
OS (fatal, flocp, _("Function name too long: %s"), name);
if (min > 255)
ONS (fatal, flocp,
- _("Invalid minimum argument count (%d) for function %s"), min, name);
+ _("Invalid minimum argument count (%u) for function %s"), min, name);
if (max > 255 || (max && max < min))
ONS (fatal, flocp,
- _("Invalid maximum argument count (%d) for function %s"), max, name);
+ _("Invalid maximum argument count (%u) for function %s"), max, name);
ent = xmalloc (sizeof (struct function_table_entry));
ent->name = name;
diff --git a/getloadavg.c b/getloadavg.c
index a755b6d8..10ae56ab 100644
--- a/getloadavg.c
+++ b/getloadavg.c
@@ -1,5 +1,5 @@
/* Get the system load averages.
-Copyright (C) 1985-2014 Free Software Foundation, Inc.
+Copyright (C) 1985-2016 Free Software Foundation, Inc.
GNU Make is free software; you can redistribute it and/or modify it under the
terms of the GNU General Public License as published by the Free Software
diff --git a/getopt.c b/getopt.c
index a8051fcc..e3538d44 100644
--- a/getopt.c
+++ b/getopt.c
@@ -3,7 +3,7 @@ NOTE: getopt is now part of the C library, so if you don't know what
"Keep this file name-space clean" means, talk to drepper@gnu.org
before changing it!
-Copyright (C) 1987-2014 Free Software Foundation, Inc.
+Copyright (C) 1987-2016 Free Software Foundation, Inc.
NOTE: The canonical source of this file is maintained with the GNU C Library.
Bugs can be reported to bug-glibc@gnu.org.
diff --git a/getopt.h b/getopt.h
index adef9a53..4acd4ee7 100644
--- a/getopt.h
+++ b/getopt.h
@@ -1,5 +1,5 @@
/* Declarations for getopt.
-Copyright (C) 1989-2014 Free Software Foundation, Inc.
+Copyright (C) 1989-2016 Free Software Foundation, Inc.
NOTE: The canonical source of this file is maintained with the GNU C Library.
Bugs can be reported to bug-glibc@gnu.org.
diff --git a/getopt1.c b/getopt1.c
index 42dea223..0e38b2fe 100644
--- a/getopt1.c
+++ b/getopt1.c
@@ -1,5 +1,5 @@
/* getopt_long and getopt_long_only entry points for GNU getopt.
-Copyright (C) 1987-1994, 1996-2014 Free Software Foundation, Inc.
+Copyright (C) 1987-1994, 1996-2016 Free Software Foundation, Inc.
NOTE: The canonical source of this file is maintained with the GNU C Library.
Bugs can be reported to bug-glibc@gnu.org.
diff --git a/gettext.h b/gettext.h
index c2030ff5..c48ffa0a 100644
--- a/gettext.h
+++ b/gettext.h
@@ -1,5 +1,5 @@
/* Convenience header for conditional use of GNU <libintl.h>.
-Copyright (C) 1995-2014 Free Software Foundation, Inc.
+Copyright (C) 1995-2016 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
diff --git a/gmk-default.scm b/gmk-default.scm
index fa19d3c4..e7353f94 100644
--- a/gmk-default.scm
+++ b/gmk-default.scm
@@ -1,5 +1,5 @@
;; Contents of the (gnu make) Guile module
-;; Copyright (C) 2011-2014 Free Software Foundation, Inc.
+;; Copyright (C) 2011-2016 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
diff --git a/gnumake.h b/gnumake.h
index fd0b3a49..b508562f 100644
--- a/gnumake.h
+++ b/gnumake.h
@@ -1,7 +1,7 @@
/* External interfaces usable by dynamic objects loaded into GNU Make.
--THIS API IS A "TECHNOLOGY PREVIEW" ONLY. IT IS NOT A STABLE INTERFACE--
-Copyright (C) 2013-2014 Free Software Foundation, Inc.
+Copyright (C) 2013-2016 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
diff --git a/guile.c b/guile.c
index 7c9a0157..1b055c3d 100644
--- a/guile.c
+++ b/guile.c
@@ -1,5 +1,5 @@
/* GNU Guile interface for GNU Make.
-Copyright (C) 2011-2014 Free Software Foundation, Inc.
+Copyright (C) 2011-2016 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
@@ -140,7 +140,7 @@ func_guile (const char *funcname UNUSED, unsigned int argc UNUSED, char **argv)
/* We could send the flocp to define_new_function(), but since guile is
"kind of" built-in, that didn't seem so useful. */
int
-guile_gmake_setup (const gmk_floc *flocp UNUSED)
+guile_gmake_setup (const floc *flocp UNUSED)
{
/* Create a make function "guile". */
gmk_add_function ("guile", func_guile, 0, 1, GMK_FUNC_DEFAULT);
@@ -151,7 +151,7 @@ guile_gmake_setup (const gmk_floc *flocp UNUSED)
#else
int
-guile_gmake_setup (const gmk_floc *flocp UNUSED)
+guile_gmake_setup (const floc *flocp UNUSED)
{
return 1;
}
diff --git a/implicit.c b/implicit.c
index 8e1d5416..ed49bd16 100644
--- a/implicit.c
+++ b/implicit.c
@@ -1,5 +1,5 @@
/* Implicit rule searching for GNU Make.
-Copyright (C) 1988-2014 Free Software Foundation, Inc.
+Copyright (C) 1988-2016 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
@@ -72,8 +72,7 @@ get_next_word (const char *buffer, unsigned int *length)
char c;
/* Skip any leading whitespace. */
- while (isblank ((unsigned char)*p))
- ++p;
+ NEXT_TOKEN (p);
beg = p;
c = *(p++);
@@ -266,12 +265,15 @@ pattern_search (struct file *file, int archive,
/* 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/.) */
+ lastslash = strrchr (filename, '/');
#ifdef VMS
- lastslash = strrchr (filename, ']');
- if (lastslash == 0)
+ if (lastslash == NULL)
+ lastslash = strrchr (filename, ']');
+ if (lastslash == NULL)
+ lastslash = strrchr (filename, '>');
+ if (lastslash == NULL)
lastslash = strrchr (filename, ':');
-#else
- lastslash = strrchr (filename, '/');
+#endif
#ifdef HAVE_DOS_PATHS
/* Handle backslashes (possibly mixed with forward slashes)
and the case of "d:file". */
@@ -283,7 +285,6 @@ pattern_search (struct file *file, int archive,
lastslash = filename + 1;
}
#endif
-#endif
if (lastslash != 0 && lastslash[1] == '\0')
lastslash = 0;
}
@@ -315,7 +316,7 @@ pattern_search (struct file *file, int archive,
{
const char *target = rule->targets[ti];
const char *suffix = rule->suffixes[ti];
- int check_lastslash;
+ char check_lastslash;
/* Rules that can match any filename and are not terminal
are ignored if we're recursing, so that they cannot be
@@ -339,10 +340,10 @@ pattern_search (struct file *file, int archive,
if (lastslash)
{
#ifdef VMS
- check_lastslash = (strchr (target, ']') == 0
- && strchr (target, ':') == 0);
+ check_lastslash = strpbrk (target, "/]>:") == NULL;
#else
check_lastslash = strchr (target, '/') == 0;
+#endif
#ifdef HAVE_DOS_PATHS
/* Didn't find it yet: check for DOS-type directories. */
if (check_lastslash)
@@ -351,7 +352,6 @@ pattern_search (struct file *file, int archive,
check_lastslash = !(b || (target[0] && target[1] == ':'));
}
#endif
-#endif
}
if (check_lastslash)
{
@@ -437,7 +437,7 @@ pattern_search (struct file *file, int archive,
for (ri = 0; ri < nrules; ri++)
{
struct dep *dep;
- int check_lastslash;
+ char check_lastslash;
unsigned int failed = 0;
int file_variables_set = 0;
unsigned int deps_found = 0;
@@ -863,9 +863,10 @@ pattern_search (struct file *file, int archive,
/* We don't want to delete an intermediate file that happened
to be a prerequisite of some (other) target. Mark it as
- precious. */
+ secondary. We don't want it to be precious as that disables
+ DELETE_ON_ERROR etc. */
if (f != 0)
- f->precious = 1;
+ f->secondary = 1;
else
f = enter_file (imf->name);
diff --git a/job.c b/job.c
index 29892490..f3a9fdbe 100644
--- a/job.c
+++ b/job.c
@@ -1,5 +1,5 @@
/* Job execution and handling for GNU Make.
-Copyright (C) 1988-2014 Free Software Foundation, Inc.
+Copyright (C) 1988-2016 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
@@ -23,7 +23,7 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
#include "filedef.h"
#include "commands.h"
#include "variable.h"
-#include "debug.h"
+#include "os.h"
#include <string.h>
@@ -59,13 +59,19 @@ int batch_mode_shell = 0;
#elif defined (VMS)
# include <descrip.h>
+# include <stsdef.h>
const char *default_shell = "";
int batch_mode_shell = 0;
-#elif defined (__riscos__)
+#define strsignal vms_strsignal
+char * vms_strsignal (int status);
-const char *default_shell = "";
-int batch_mode_shell = 0;
+#ifndef C_FACILITY_NO
+# define C_FACILITY_NO 0x350000
+#endif
+#ifndef VMS_POSIX_EXIT_MASK
+# define VMS_POSIX_EXIT_MASK (C_FACILITY_NO | 0xA000)
+#endif
#else
@@ -201,14 +207,10 @@ pid2str (pid_t pid)
return pidstring;
}
+#ifndef HAVE_GETLOADAVG
int getloadavg (double loadavg[], int nelem);
-int start_remote_job (char **argv, char **envp, int stdin_fd, int *is_remote,
- int *id_ptr, int *used_stdin);
-int start_remote_job_p (int);
-int remote_status (int *exit_code_ptr, int *signal_ptr, int *coredump_ptr,
- int block);
+#endif
-RETSIGTYPE child_handler (int);
static void free_child (struct child *);
static void start_job_command (struct child *child);
static int load_too_high (void);
@@ -472,9 +474,9 @@ child_error (struct child *child,
const char *post = "";
const char *dump = "";
const struct file *f = child->file;
- const gmk_floc *flocp = &f->cmds->fileinfo;
+ const floc *flocp = &f->cmds->fileinfo;
const char *nm;
- size_t l = strlen (f->name);
+ size_t l;
if (ignored && silent_flag)
return;
@@ -493,42 +495,25 @@ child_error (struct child *child,
else
{
char *a = alloca (strlen (flocp->filenm) + 1 + 11 + 1);
- sprintf (a, "%s:%lu", flocp->filenm, flocp->lineno);
+ sprintf (a, "%s:%lu", flocp->filenm, flocp->lineno + flocp->offset);
nm = a;
}
- OUTPUT_SET (&child->output);
+ l = strlen (pre) + strlen (nm) + strlen (f->name) + strlen (post);
- message (0, l + strlen (nm),
- _("%s: recipe for target '%s' failed"), nm, f->name);
+ OUTPUT_SET (&child->output);
- l += strlen (pre) + strlen (post);
+ show_goal_error ();
-#ifdef VMS
- if ((exit_code & 1) != 0)
- {
- OUTPUT_UNSET ();
- return;
- }
- /* Check for a Posix compatible VMS style exit code:
- decode and print the Posix exit code */
- if ((exit_code & 0x35a000) == 0x35a000)
- error(NILF, l + INTSTR_LENGTH, _("%s[%s] Error %d%s"), pre, f->name,
- ((exit_code & 0x7f8) >> 3), post);
- else
- error(NILF, l + INTSTR_LENGTH, _("%s[%s] Error 0x%x%s"), pre, f->name,
- exit_code, post);
-#else
if (exit_sig == 0)
error (NILF, l + INTSTR_LENGTH,
- _("%s[%s] Error %d%s"), pre, f->name, exit_code, post);
+ _("%s[%s: %s] Error %d%s"), pre, nm, f->name, exit_code, post);
else
{
const char *s = strsignal (exit_sig);
error (NILF, l + strlen (s) + strlen (dump),
- _("%s[%s] %s%s%s"), pre, f->name, s, dump, post);
+ "%s[%s: %s] %s%s%s", pre, nm, f->name, s, dump, post);
}
-#endif /* VMS */
OUTPUT_UNSET ();
}
@@ -536,10 +521,11 @@ child_error (struct child *child,
/* Handle a dead child. This handler may or may not ever be installed.
- If we're using the jobserver feature, we need it. First, installing it
- ensures the read will interrupt on SIGCHLD. Second, we close the dup'd
- read FD to ensure we don't enter another blocking read without reaping all
- the dead children. In this case we don't need the dead_children count.
+ If we're using the jobserver feature without pselect(), we need it.
+ First, installing it ensures the read will interrupt on SIGCHLD. Second,
+ we close the dup'd read FD to ensure we don't enter another blocking read
+ without reaping all the dead children. In this case we don't need the
+ dead_children count.
If we don't have either waitpid or wait3, then make is unreliable, but we
use the dead_children count to reap children as best we can. */
@@ -551,23 +537,15 @@ child_handler (int sig UNUSED)
{
++dead_children;
- if (job_rfd >= 0)
- {
- close (job_rfd);
- job_rfd = -1;
- }
+ jobserver_signal ();
#ifdef __EMX__
/* The signal handler must called only once! */
signal (SIGCHLD, SIG_DFL);
#endif
-
- /* This causes problems if the SIGCHLD interrupts a printf().
- DB (DB_JOBS, (_("Got a SIGCHLD; %u unreaped children.\n"), dead_children));
- */
}
-extern int shell_function_pid, shell_function_completed;
+extern pid_t shell_function_pid;
/* Reap all dead children, storing the returned status and the new command
state ('cs_finished') in the 'file' member of the 'struct child' for the
@@ -602,7 +580,7 @@ reap_children (int block, int err)
while ((children != 0 || shell_function_pid != 0)
&& (block || REAP_MORE))
{
- int remote = 0;
+ unsigned int remote = 0;
pid_t pid;
int exit_code, exit_sig, coredump;
struct child *lastc, *c;
@@ -678,15 +656,24 @@ reap_children (int block, int err)
if (any_local)
{
#ifdef VMS
+ /* Todo: This needs more untangling multi-process support */
+ /* Just do single child process support now */
vmsWaitForChildren (&status);
pid = c->pid;
+
+ /* VMS failure status can not be fully translated */
+ status = $VMS_STATUS_SUCCESS (c->cstatus) ? 0 : (1 << 8);
+
+ /* A Posix failure can be exactly translated */
+ if ((c->cstatus & VMS_POSIX_EXIT_MASK) == VMS_POSIX_EXIT_MASK)
+ status = (c->cstatus >> 3 & 255) << 8;
#else
#ifdef WAIT_NOHANG
if (!block)
pid = WAIT_NOHANG (&status);
else
#endif
- EINTRLOOP(pid, wait (&status));
+ EINTRLOOP (pid, wait (&status));
#endif /* !VMS */
}
else
@@ -816,16 +803,10 @@ reap_children (int block, int err)
/* Check if this is the child of the 'shell' function. */
if (!remote && pid == shell_function_pid)
{
- /* It is. Leave an indicator for the 'shell' function. */
- if (exit_sig == 0 && exit_code == 127)
- shell_function_completed = -1;
- else
- shell_function_completed = 1;
+ shell_completed (exit_code, exit_sig);
break;
}
- child_failed = exit_sig != 0 || exit_code != 0;
-
/* Search for a child matching the deceased one. */
lastc = 0;
for (c = children; c != 0; lastc = c, c = c->next)
@@ -837,6 +818,15 @@ reap_children (int block, int err)
Ignore it; it was inherited from our invoker. */
continue;
+ /* Determine the failure status: 0 for success, 1 for updating target in
+ question mode, 2 for anything else. */
+ if (exit_sig == 0 && exit_code == 0)
+ child_failed = MAKE_SUCCESS;
+ else if (exit_sig == 0 && exit_code == 1 && question_flag && c->recursive)
+ child_failed = MAKE_TROUBLE;
+ else
+ child_failed = MAKE_FAILURE;
+
DB (DB_JOBS, (child_failed
? _("Reaping losing child %p PID %s %s\n")
: _("Reaping winning child %p PID %s %s\n"),
@@ -872,10 +862,10 @@ reap_children (int block, int err)
delete non-precious targets, and abort. */
static int delete_on_error = -1;
- if (!dontcare)
+ if (!dontcare && child_failed == MAKE_FAILURE)
child_error (c, exit_code, exit_sig, coredump, 0);
- c->file->update_status = us_failed;
+ c->file->update_status = child_failed == MAKE_FAILURE ? us_failed : us_question;
if (delete_on_error == -1)
{
struct file *f = lookup_file (".DELETE_ON_ERROR");
@@ -987,7 +977,7 @@ reap_children (int block, int err)
if (!err && child_failed && !dontcare && !keep_going_flag &&
/* fatal_error_signal will die with the right signal. */
!handling_fatal_signal)
- die (MAKE_FAILURE);
+ die (child_failed);
/* Only block for one child. */
block = 0;
@@ -1010,35 +1000,12 @@ free_child (struct child *child)
/* If we're using the jobserver and this child is not the only outstanding
job, put a token back into the pipe for it. */
-#ifdef WINDOWS32
- if (has_jobserver_semaphore () && jobserver_tokens > 1)
+ if (jobserver_enabled () && jobserver_tokens > 1)
{
- if (! release_jobserver_semaphore ())
- {
- DWORD err = GetLastError ();
- const char *estr = map_windows32_error_to_string (err);
- ONS (fatal, NILF,
- _("release jobserver semaphore: (Error %ld: %s)"), err, estr);
- }
-
- DB (DB_JOBS, (_("Released token for child %p (%s).\n"), child, child->file->name));
- }
-#else
- if (job_fds[1] >= 0 && jobserver_tokens > 1)
- {
- char token = '+';
- int r;
-
- /* Write a job token back to the pipe. */
-
- EINTRLOOP (r, write (job_fds[1], &token, 1));
- if (r != 1)
- pfatal_with_name (_("write jobserver"));
-
+ jobserver_release (1);
DB (DB_JOBS, (_("Released token for child %p (%s).\n"),
child, child->file->name));
}
-#endif
--jobserver_tokens;
@@ -1090,56 +1057,6 @@ unblock_sigs (void)
}
#endif
-#if defined(MAKE_JOBSERVER) && !defined(WINDOWS32)
-RETSIGTYPE
-job_noop (int sig UNUSED)
-{
-}
-/* Set the child handler action flags to FLAGS. */
-static void
-set_child_handler_action_flags (int set_handler, int set_alarm)
-{
- struct sigaction sa;
-
-#ifdef __EMX__
- /* The child handler must be turned off here. */
- signal (SIGCHLD, SIG_DFL);
-#endif
-
- memset (&sa, '\0', sizeof sa);
- sa.sa_handler = child_handler;
- sa.sa_flags = set_handler ? 0 : SA_RESTART;
-#if defined SIGCHLD
- sigaction (SIGCHLD, &sa, NULL);
-#endif
-#if defined SIGCLD && SIGCLD != SIGCHLD
- sigaction (SIGCLD, &sa, NULL);
-#endif
-#if defined SIGALRM
- if (set_alarm)
- {
- /* If we're about to enter the read(), set an alarm to wake up in a
- second so we can check if the load has dropped and we can start more
- work. On the way out, turn off the alarm and set SIG_DFL. */
- if (set_handler)
- {
- sa.sa_handler = job_noop;
- sa.sa_flags = 0;
- sigaction (SIGALRM, &sa, NULL);
- alarm (1);
- }
- else
- {
- alarm (0);
- sa.sa_handler = SIG_DFL;
- sa.sa_flags = 0;
- sigaction (SIGALRM, &sa, NULL);
- }
- }
-#endif
-}
-#endif
-
/* Start a job to run the commands specified in CHILD.
CHILD is updated to reflect the commands and ID of the child process.
@@ -1151,17 +1068,12 @@ set_child_handler_action_flags (int set_handler, int set_alarm)
static void
start_job_command (struct child *child)
{
-#if !defined(_AMIGA) && !defined(WINDOWS32)
- static int bad_stdin = -1;
-#endif
int flags;
char *p;
#ifdef VMS
char *argv;
#else
char **argv;
- int outfd = FD_STDOUT;
- int errfd = FD_STDERR;
#endif
/* If we have a completely empty commandset, stop now. */
@@ -1184,19 +1096,21 @@ start_job_command (struct child *child)
flags |= COMMANDS_RECURSE;
else if (*p == '-')
child->noerror = 1;
- else if (!isblank ((unsigned char)*p))
+ /* Don't skip newlines. */
+ else if (!ISBLANK (*p))
break;
++p;
}
+ child->recursive = ((flags & COMMANDS_RECURSE) != 0);
+
/* Update the file's command flags with any new ones we found. We only
keep the COMMANDS_RECURSE setting. Even this isn't 100% correct; we are
now marking more commands recursive than should be in the case of
multiline define/endef scripts where only one line is marked "+". In
order to really fix this, we'll have to keep a lines_flags for every
actual line, after expansion. */
- child->file->cmds->lines_flags[child->command_line - 1]
- |= flags & COMMANDS_RECURSE;
+ child->file->cmds->lines_flags[child->command_line - 1] |= flags & COMMANDS_RECURSE;
/* POSIX requires that a recipe prefix after a backslash-newline should
be ignored. Remove it now so the output is correct. */
@@ -1218,6 +1132,19 @@ start_job_command (struct child *child)
{
char *end = 0;
#ifdef VMS
+ /* Skip any leading whitespace */
+ while (*p)
+ {
+ if (!ISSPACE (*p))
+ {
+ if (*p != '\\')
+ break;
+ if ((p[1] != '\n') && (p[1] != 'n') && (p[1] != 't'))
+ break;
+ }
+ p++;
+ }
+
argv = p;
/* Although construct_command_argv contains some code for VMS, it was/is
not called/used. Please note, for VMS argv is a string (not an array
@@ -1267,9 +1194,17 @@ start_job_command (struct child *child)
free (argv[0]);
free (argv);
#endif
- child->file->update_status = us_question;
- notice_finished_file (child->file);
- return;
+#ifdef VMS
+ /* On VMS, argv[0] can be a null string here */
+ if (argv[0] != 0)
+ {
+#endif
+ child->file->update_status = us_question;
+ notice_finished_file (child->file);
+ return;
+#ifdef VMS
+ }
+#endif
}
if (touch_flag && !(flags & COMMANDS_RECURSE))
@@ -1383,32 +1318,6 @@ start_job_command (struct child *child)
fflush (stdout);
fflush (stderr);
-#ifndef VMS
-#if !defined(WINDOWS32) && !defined(_AMIGA) && !defined(__MSDOS__)
-
- /* Set up a bad standard input that reads from a broken pipe. */
-
- if (bad_stdin == -1)
- {
- /* Make a file descriptor that is the read end of a broken pipe.
- This will be used for some children's standard inputs. */
- int pd[2];
- if (pipe (pd) == 0)
- {
- /* Close the write side. */
- (void) close (pd[1]);
- /* Save the read side. */
- bad_stdin = pd[0];
-
- /* Set the descriptor to close on exec, so it does not litter any
- child's descriptor table. When it is dup2'd onto descriptor 0,
- that descriptor will not close on exec. */
- CLOSE_ON_EXEC (bad_stdin);
- }
- }
-
-#endif /* !WINDOWS32 && !_AMIGA && !__MSDOS__ */
-
/* Decide whether to give this child the 'good' standard input
(one that points to the terminal or whatever), or the 'bad' one
that points to the read side of a broken pipe. */
@@ -1417,8 +1326,6 @@ start_job_command (struct child *child)
if (child->good_stdin)
good_stdin_used = 1;
-#endif /* !VMS */
-
child->deleted = 0;
#ifndef _AMIGA
@@ -1435,7 +1342,7 @@ start_job_command (struct child *child)
{
int is_remote, id, used_stdin;
if (start_remote_job (argv, child->environment,
- child->good_stdin ? 0 : bad_stdin,
+ child->good_stdin ? 0 : get_bad_stdin (),
&is_remote, &id, &used_stdin))
/* Don't give up; remote execution may fail for various reasons. If
so, simply run the job locally. */
@@ -1464,7 +1371,7 @@ start_job_command (struct child *child)
child->remote = 0;
#ifdef VMS
- if (!child_execute_job (argv, child))
+ if (!child_execute_job (child, argv))
{
/* Fork failed! */
perror_with_name ("fork", "");
@@ -1475,83 +1382,20 @@ start_job_command (struct child *child)
parent_environ = environ;
-#ifndef NO_OUTPUT_SYNC
- /* Divert child output if output_sync in use. */
- if (child->output.syncout)
- {
- if (child->output.out >= 0)
- outfd = child->output.out;
- if (child->output.err >= 0)
- errfd = child->output.err;
- }
-#endif
-# ifdef __EMX__
- /* If we aren't running a recursive command and we have a jobserver
- pipe, close it before exec'ing. */
- if (!(flags & COMMANDS_RECURSE) && job_fds[0] >= 0)
- {
- CLOSE_ON_EXEC (job_fds[0]);
- CLOSE_ON_EXEC (job_fds[1]);
- }
- if (job_rfd >= 0)
- CLOSE_ON_EXEC (job_rfd);
-
- /* Never use fork()/exec() here! Use spawn() instead in exec_command() */
- child->pid = child_execute_job (child->good_stdin ? FD_STDIN : bad_stdin,
- outfd, errfd,
- argv, child->environment);
- if (child->pid < 0)
- {
- /* spawn failed! */
- unblock_sigs ();
- perror_with_name ("spawn", "");
- goto error;
- }
+ jobserver_pre_child (flags & COMMANDS_RECURSE);
- /* undo CLOSE_ON_EXEC() after the child process has been started */
- if (!(flags & COMMANDS_RECURSE) && job_fds[0] >= 0)
- {
- fcntl (job_fds[0], F_SETFD, 0);
- fcntl (job_fds[1], F_SETFD, 0);
- }
- if (job_rfd >= 0)
- fcntl (job_rfd, F_SETFD, 0);
+ child->pid = child_execute_job (&child->output, child->good_stdin, argv, child->environment);
-#else /* !__EMX__ */
-
- child->pid = fork ();
environ = parent_environ; /* Restore value child may have clobbered. */
- if (child->pid == 0)
- {
- /* We are the child side. */
- unblock_sigs ();
-
- /* If we aren't running a recursive command and we have a jobserver
- pipe, close it before exec'ing. */
- if (!(flags & COMMANDS_RECURSE) && job_fds[0] >= 0)
- {
- close (job_fds[0]);
- close (job_fds[1]);
- }
- if (job_rfd >= 0)
- close (job_rfd);
+ jobserver_post_child (flags & COMMANDS_RECURSE);
-#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 ? FD_STDIN : bad_stdin,
- outfd, errfd, argv, child->environment);
- }
- else if (child->pid < 0)
+ if (child->pid < 0)
{
/* Fork failed! */
unblock_sigs ();
perror_with_name ("fork", "");
goto error;
}
-# endif /* !__EMX__ */
#endif /* !VMS */
}
@@ -1627,6 +1471,8 @@ start_job_command (struct child *child)
{
HANDLE hPID;
char* arg0;
+ int outfd = FD_STDOUT;
+ int errfd = FD_STDERR;
/* make UNC paths safe for CreateProcess -- backslash format */
arg0 = argv[0];
@@ -1864,14 +1710,13 @@ new_job (struct file *file)
*out++ = *in++;
else
{
- /* Skip the backslash, newline and
- any following whitespace. */
- in = next_token (in + 2);
+ /* Skip the backslash, newline, and whitespace. */
+ in += 2;
+ NEXT_TOKEN (in);
/* Discard any preceding whitespace that has
already been written to the output. */
- while (out > outref
- && isblank ((unsigned char)out[-1]))
+ while (out > outref && ISBLANK (out[-1]))
--out;
/* Replace it all with a single space. */
@@ -1895,10 +1740,12 @@ new_job (struct file *file)
memmove (out, in, strlen (in) + 1);
/* Finally, expand the line. */
+ cmds->fileinfo.offset = i;
lines[i] = allocated_variable_expand_for_file (cmds->command_lines[i],
file);
}
+ cmds->fileinfo.offset = 0;
c->command_lines = lines;
/* Fetch the first command line to be run. */
@@ -1924,18 +1771,10 @@ new_job (struct file *file)
just once). Also more thought needs to go into the entire algorithm;
this is where the old parallel job code waits, so... */
-#ifdef WINDOWS32
- else if (has_jobserver_semaphore ())
-#else
- else if (job_fds[0] >= 0)
-#endif
+ else if (jobserver_enabled ())
while (1)
{
int got_token;
-#ifndef WINDOWS32
- char token;
- int saved_errno;
-#endif
DB (DB_JOBS, ("Need a job token; we %shave children\n",
children ? "" : "don't "));
@@ -1944,36 +1783,8 @@ new_job (struct file *file)
if (!jobserver_tokens)
break;
-#ifndef WINDOWS32
- /* Read a token. As long as there's no token available we'll block.
- We enable interruptible system calls before the read(2) so that if
- we get a SIGCHLD while we're waiting, we'll return with EINTR and
- we can process the death(s) and return tokens to the free pool.
-
- Once we return from the read, we immediately reinstate restartable
- system calls. This allows us to not worry about checking for
- EINTR on all the other system calls in the program.
-
- There is one other twist: there is a span between the time
- reap_children() does its last check for dead children and the time
- the read(2) call is entered, below, where if a child dies we won't
- notice. This is extremely serious as it could cause us to
- deadlock, given the right set of events.
-
- To avoid this, we do the following: before we reap_children(), we
- dup(2) the read FD on the jobserver pipe. The read(2) call below
- uses that new FD. In the signal handler, we close that FD. That
- way, if a child dies during the section mentioned above, the
- read(2) will be invoked with an invalid FD and will return
- immediately with EBADF. */
-
- /* Make sure we have a dup'd FD. */
- if (job_rfd < 0)
- {
- DB (DB_JOBS, ("Duplicate the job FD\n"));
- job_rfd = dup (job_fds[0]);
- }
-#endif
+ /* Prepare for jobserver token acquisition. */
+ jobserver_pre_acquire ();
/* Reap anything that's currently waiting. */
reap_children (0, 0);
@@ -1982,8 +1793,7 @@ new_job (struct file *file)
can run now (i.e., waiting for load). */
start_waiting_jobs ();
- /* If our "free" slot has become available, use it; we don't need an
- actual token. */
+ /* If our "free" slot is available, use it; we don't need a token. */
if (!jobserver_tokens)
break;
@@ -1992,26 +1802,8 @@ new_job (struct file *file)
if (!children)
O (fatal, NILF, "INTERNAL: no children as we go to sleep on read\n");
-#ifdef WINDOWS32
- /* On Windows we simply wait for the jobserver semaphore to become
- * signalled or one of our child processes to terminate.
- */
- got_token = wait_for_semaphore_or_child_process ();
- if (got_token < 0)
- {
- DWORD err = GetLastError ();
- const char *estr = map_windows32_error_to_string (err);
- ONS (fatal, NILF,
- _("semaphore or child process wait: (Error %ld: %s)"),
- err, estr);
- }
-#else
- /* Set interruptible system calls, and read() for a job token. */
- set_child_handler_action_flags (1, waiting_jobs != NULL);
- got_token = read (job_rfd, &token, 1);
- saved_errno = errno;
- set_child_handler_action_flags (0, waiting_jobs != NULL);
-#endif
+ /* Get a token. */
+ got_token = jobserver_acquire (waiting_jobs != NULL);
/* If we got one, we're done here. */
if (got_token == 1)
@@ -2020,16 +1812,6 @@ new_job (struct file *file)
c, c->file->name));
break;
}
-
-#ifndef WINDOWS32
- /* If the error _wasn't_ expected (EINTR or EBADF), punt. Otherwise,
- go back and reap_children(), and try again. */
- errno = saved_errno;
- if (errno != EINTR && errno != EBADF)
- pfatal_with_name (_("read jobs pipe"));
- if (errno == EBADF)
- DB (DB_JOBS, ("Read returned EBADF.\n"));
-#endif
}
#endif
@@ -2088,12 +1870,15 @@ job_next_command (struct child *child)
{
/* There are no more lines to be expanded. */
child->command_ptr = 0;
+ child->file->cmds->fileinfo.offset = 0;
return 0;
}
else
/* Get the next line to run. */
child->command_ptr = child->command_lines[child->command_line++];
}
+
+ child->file->cmds->fileinfo.offset = child->command_line - 1;
return 1;
}
@@ -2233,82 +2018,93 @@ start_waiting_jobs (void)
/* EMX: Start a child process. This function returns the new pid. */
# if defined __EMX__
int
-child_execute_job (int stdin_fd, int stdout_fd, int stderr_fd,
- char **argv, char **envp)
+child_execute_job (struct output *out, int good_stdin, char **argv, char **envp)
{
int pid;
- int save_stdin = -1;
- int save_stdout = -1;
- int save_stderr = -1;
+ int fdin = good_stdin ? FD_STDIN : get_bad_stdin ();
+ int fdout = FD_STDOUT;
+ int fderr = FD_STDERR;
+ int save_fdin = -1;
+ int save_fdout = -1;
+ int save_fderr = -1;
+
+ /* Divert child output if we want to capture output. */
+ if (out && out->syncout)
+ {
+ if (out->out >= 0)
+ fdout = out->out;
+ if (out->err >= 0)
+ fderr = out->err;
+ }
/* For each FD which needs to be redirected first make a dup of the standard
FD to save and mark it close on exec so our child won't see it. Then
dup2() the standard FD to the redirect FD, and also mark the redirect FD
as close on exec. */
- if (stdin_fd != FD_STDIN)
+ if (fdin != FD_STDIN)
{
- save_stdin = dup (FD_STDIN);
- if (save_stdin < 0)
+ save_fdin = dup (FD_STDIN);
+ if (save_fdin < 0)
O (fatal, NILF, _("no more file handles: could not duplicate stdin\n"));
- CLOSE_ON_EXEC (save_stdin);
+ CLOSE_ON_EXEC (save_fdin);
- dup2 (stdin_fd, FD_STDIN);
- CLOSE_ON_EXEC (stdin_fd);
+ dup2 (fdin, FD_STDIN);
+ CLOSE_ON_EXEC (fdin);
}
- if (stdout_fd != FD_STDOUT)
+ if (fdout != FD_STDOUT)
{
- save_stdout = dup (FD_STDOUT);
- if (save_stdout < 0)
+ save_fdout = dup (FD_STDOUT);
+ if (save_fdout < 0)
O (fatal, NILF,
_("no more file handles: could not duplicate stdout\n"));
- CLOSE_ON_EXEC (save_stdout);
+ CLOSE_ON_EXEC (save_fdout);
- dup2 (stdout_fd, FD_STDOUT);
- CLOSE_ON_EXEC (stdout_fd);
+ dup2 (fdout, FD_STDOUT);
+ CLOSE_ON_EXEC (fdout);
}
- if (stderr_fd != FD_STDERR)
+ if (fderr != FD_STDERR)
{
- if (stderr_fd != stdout_fd)
+ if (fderr != fdout)
{
- save_stderr = dup (FD_STDERR);
- if (save_stderr < 0)
+ save_fderr = dup (FD_STDERR);
+ if (save_fderr < 0)
O (fatal, NILF,
_("no more file handles: could not duplicate stderr\n"));
- CLOSE_ON_EXEC (save_stderr);
+ CLOSE_ON_EXEC (save_fderr);
}
- dup2 (stderr_fd, FD_STDERR);
- CLOSE_ON_EXEC (stderr_fd);
+ dup2 (fderr, FD_STDERR);
+ CLOSE_ON_EXEC (fderr);
}
/* Run the command. */
pid = exec_command (argv, envp);
/* Restore stdout/stdin/stderr of the parent and close temporary FDs. */
- if (save_stdin >= 0)
+ if (save_fdin >= 0)
{
- if (dup2 (save_stdin, FD_STDIN) != FD_STDIN)
+ if (dup2 (save_fdin, FD_STDIN) != FD_STDIN)
O (fatal, NILF, _("Could not restore stdin\n"));
else
- close (save_stdin);
+ close (save_fdin);
}
- if (save_stdout >= 0)
+ if (save_fdout >= 0)
{
- if (dup2 (save_stdout, FD_STDOUT) != FD_STDOUT)
+ if (dup2 (save_fdout, FD_STDOUT) != FD_STDOUT)
O (fatal, NILF, _("Could not restore stdout\n"));
else
- close (save_stdout);
+ close (save_fdout);
}
- if (save_stderr >= 0)
+ if (save_fderr >= 0)
{
- if (dup2 (save_stderr, FD_STDERR) != FD_STDERR)
+ if (dup2 (save_fderr, FD_STDERR) != FD_STDERR)
O (fatal, NILF, _("Could not restore stderr\n"));
else
- close (save_stderr);
+ close (save_fderr);
}
return pid;
@@ -2316,30 +2112,48 @@ child_execute_job (int stdin_fd, int stdout_fd, int stderr_fd,
#elif !defined (_AMIGA) && !defined (__MSDOS__) && !defined (VMS)
-/* UNIX:
- Replace the current process with one executing the command in ARGV.
- STDIN_FD/STDOUT_FD/STDERR_FD are used as the process's stdin/stdout/stderr;
- ENVP is the environment of the new program. This function does not return. */
-void
-child_execute_job (int stdin_fd, int stdout_fd, int stderr_fd,
- char **argv, char **envp)
+/* POSIX:
+ Create a child process executing the command in ARGV.
+ ENVP is the environment of the new program. Returns the PID or -1. */
+int
+child_execute_job (struct output *out, int good_stdin, char **argv, char **envp)
{
- /* For any redirected FD, dup2() it to the standard FD then close it. */
- if (stdin_fd != FD_STDIN)
+ int r;
+ int pid;
+ int fdin = good_stdin ? FD_STDIN : get_bad_stdin ();
+ int fdout = FD_STDOUT;
+ int fderr = FD_STDERR;
+
+ /* Divert child output if we want to capture it. */
+ if (out && out->syncout)
{
- dup2 (stdin_fd, FD_STDIN);
- close (stdin_fd);
+ if (out->out >= 0)
+ fdout = out->out;
+ if (out->err >= 0)
+ fderr = out->err;
}
- if (stdout_fd != FD_STDOUT)
- dup2 (stdout_fd, FD_STDOUT);
- if (stderr_fd != FD_STDERR)
- dup2 (stderr_fd, FD_STDERR);
+ pid = vfork();
+ if (pid != 0)
+ return pid;
+
+ /* We are the child. */
+ unblock_sigs ();
+
+#ifdef SET_STACK_SIZE
+ /* Reset limits, if necessary. */
+ if (stack_limit.rlim_cur)
+ setrlimit (RLIMIT_STACK, &stack_limit);
+#endif
- if (stdout_fd != FD_STDOUT)
- close (stdout_fd);
- if (stderr_fd != FD_STDERR && stderr_fd != stdout_fd)
- close (stderr_fd);
+ /* For any redirected FD, dup2() it to the standard FD.
+ They are all marked close-on-exec already. */
+ if (fdin != FD_STDIN)
+ EINTRLOOP (r, dup2 (fdin, FD_STDIN));
+ if (fdout != FD_STDOUT)
+ EINTRLOOP (r, dup2 (fdout, FD_STDOUT));
+ if (fderr != FD_STDERR)
+ EINTRLOOP (r, dup2 (fderr, FD_STDERR));
/* Run the command. */
exec_command (argv, envp);
@@ -2455,12 +2269,17 @@ exec_command (char **argv, char **envp)
switch (errno)
{
case ENOENT:
- OS (error, NILF, _("%s: Command not found"), argv[0]);
+ /* We are in the child: don't use the output buffer.
+ It's not right to run fprintf() here! */
+ if (makelevel == 0)
+ fprintf (stderr, _("%s: %s: Command not found\n"), program, argv[0]);
+ else
+ fprintf (stderr, _("%s[%u]: %s: Command not found\n"),
+ program, makelevel, argv[0]);
break;
case ENOEXEC:
{
/* The file is not executable. Try it as a shell script. */
- extern char *getenv ();
const char *shell;
char **new_argv;
int argc;
@@ -2731,8 +2550,8 @@ construct_command_argv_internal (char *line, char **restp, const char *shell,
if (restp != NULL)
*restp = NULL;
- /* Make sure not to bother processing an empty line. */
- while (isblank ((unsigned char)*line))
+ /* Make sure not to bother processing an empty line but stop at newline. */
+ while (ISBLANK (*line))
++line;
if (*line == '\0')
return 0;
@@ -2863,6 +2682,10 @@ construct_command_argv_internal (char *line, char **restp, const char *shell,
else if (instring == '"' && strchr ("\\$`", *p) != 0 && unixy_shell)
goto slow;
#ifdef WINDOWS32
+ /* Quoted wildcard characters must be passed quoted to the
+ command, so give up the fast route. */
+ else if (instring == '"' && strchr ("*?", *p) != 0 && !unixy_shell)
+ goto slow;
else if (instring == '"' && strncmp (p, "\\\"", 2) == 0)
*ap++ = *++p;
#endif
@@ -2903,15 +2726,16 @@ construct_command_argv_internal (char *line, char **restp, const char *shell,
/* Throw out the backslash and newline. */
++p;
- /* If there's nothing in this argument yet, skip any
- whitespace before the start of the next word. */
+ /* At the beginning of the argument, skip any whitespace other
+ than newline before the start of the next word. */
if (ap == new_argv[i])
- p = next_token (p + 1) - 1;
+ while (ISBLANK (p[1]))
+ ++p;
}
#ifdef WINDOWS32
/* Backslash before whitespace is not special if our shell
is not Unixy. */
- else if (isspace (p[1]) && !unixy_shell)
+ else if (ISSPACE (p[1]) && !unixy_shell)
{
*ap++ = *p;
break;
@@ -2938,7 +2762,7 @@ construct_command_argv_internal (char *line, char **restp, const char *shell,
else
#endif
if (p[1] != '\\' && p[1] != '\''
- && !isspace ((unsigned char)p[1])
+ && !ISSPACE (p[1])
&& strchr (sh_chars_sh, p[1]) == 0)
/* back up one notch, to copy the backslash */
--p;
@@ -3002,8 +2826,9 @@ construct_command_argv_internal (char *line, char **restp, const char *shell,
}
}
- /* Ignore multiple whitespace chars. */
- p = next_token (p) - 1;
+ /* Skip whitespace chars, but not newlines. */
+ while (ISBLANK (p[1]))
+ ++p;
break;
default:
@@ -3096,8 +2921,7 @@ construct_command_argv_internal (char *line, char **restp, const char *shell,
*/
/* Make sure not to bother processing an empty line. */
- while (isspace ((unsigned char)*line))
- ++line;
+ NEXT_TOKEN (line);
if (*line == '\0')
return 0;
#endif /* WINDOWS32 */
@@ -3157,9 +2981,9 @@ construct_command_argv_internal (char *line, char **restp, const char *shell,
{
int esc = 0;
- /* This is the start of a new recipe line.
- Skip whitespace and prefix characters. */
- while (isblank (*f) || *f == '-' || *f == '@' || *f == '+')
+ /* This is the start of a new recipe line. Skip whitespace
+ and prefix characters but not newlines. */
+ while (ISBLANK (*f) || *f == '-' || *f == '@' || *f == '+')
++f;
/* Copy until we get to the next logical recipe line. */
@@ -3209,21 +3033,21 @@ construct_command_argv_internal (char *line, char **restp, const char *shell,
[@+-]: they're meaningless in .ONESHELL mode. */
while (*f != '\0')
{
- /* This is the start of a new recipe line.
- Skip whitespace and prefix characters. */
- while (isblank (*f) || *f == '-' || *f == '@' || *f == '+')
+ /* This is the start of a new recipe line. Skip whitespace
+ and prefix characters but not newlines. */
+ while (ISBLANK (*f) || *f == '-' || *f == '@' || *f == '+')
++f;
/* Copy until we get to the next logical recipe line. */
while (*f != '\0')
{
- /* Remove the escaped newlines in the command, and
- the whitespace that follows them. Windows
- shells cannot handle escaped newlines. */
+ /* Remove the escaped newlines in the command, and the
+ blanks that follow them. Windows shells cannot handle
+ escaped newlines. */
if (*f == '\\' && f[1] == '\n')
{
f += 2;
- while (isblank (*f))
+ while (ISBLANK (*f))
++f;
}
*(t++) = *(f++);
@@ -3235,7 +3059,7 @@ construct_command_argv_internal (char *line, char **restp, const char *shell,
/* Write another line into the batch file. */
if (t > tstart)
{
- int c = *t;
+ char c = *t;
*t = '\0';
fputs (tstart, batch);
DB (DB_JOBS, ("\t%s", tstart));
@@ -3335,7 +3159,7 @@ construct_command_argv_internal (char *line, char **restp, const char *shell,
/* DOS shells don't know about backslash-escaping. */
if (unixy_shell && !batch_mode_shell &&
(*p == '\\' || *p == '\'' || *p == '"'
- || isspace ((unsigned char)*p)
+ || ISSPACE (*p)
|| strchr (sh_chars, *p) != 0))
*ap++ = '\\';
#ifdef __MSDOS__
@@ -3540,13 +3364,11 @@ construct_command_argv (char *line, char **restp, struct file *file,
cptr = line;
for (;;)
{
- while ((*cptr != 0)
- && (isspace ((unsigned char)*cptr)))
+ while ((*cptr != 0) && (ISSPACE (*cptr)))
cptr++;
if (*cptr == 0)
break;
- while ((*cptr != 0)
- && (!isspace ((unsigned char)*cptr)))
+ while ((*cptr != 0) && (!ISSPACE (*cptr)))
cptr++;
argc++;
}
@@ -3559,15 +3381,13 @@ construct_command_argv (char *line, char **restp, struct file *file,
argc = 0;
for (;;)
{
- while ((*cptr != 0)
- && (isspace ((unsigned char)*cptr)))
+ while ((*cptr != 0) && (ISSPACE (*cptr)))
cptr++;
if (*cptr == 0)
break;
DB (DB_JOBS, ("argv[%d] = [%s]\n", argc, cptr));
argv[argc++] = cptr;
- while ((*cptr != 0)
- && (!isspace ((unsigned char)*cptr)))
+ while ((*cptr != 0) && (!ISSPACE (*cptr)))
cptr++;
if (*cptr != 0)
*cptr++ = 0;
@@ -3658,7 +3478,7 @@ dup2 (int old, int new)
int fd;
(void) close (new);
- fd = dup (old);
+ EINTRLOOP (fd, dup (old));
if (fd != new)
{
(void) close (fd);
diff --git a/job.h b/job.h
index 3c921bae..37cceb6d 100644
--- a/job.h
+++ b/job.h
@@ -1,5 +1,5 @@
/* Definitions for managing subprocesses in GNU Make.
-Copyright (C) 1992-2014 Free Software Foundation, Inc.
+Copyright (C) 1992-2016 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
@@ -24,7 +24,7 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
/* How to set close-on-exec for a file descriptor. */
-#if !defined F_SETFD
+#if !defined(F_SETFD) || !defined(F_GETFD)
# ifdef WINDOWS32
# define CLOSE_ON_EXEC(_d) process_noinherit(_d)
# else
@@ -99,6 +99,7 @@ struct child
char *comname; /* Temporary command file name */
int efn; /* Completion event flag number */
int cstatus; /* Completion status */
+ int vms_launch_status; /* non-zero if lib$spawn, etc failed */
#endif
unsigned int command_line; /* Index into command_lines. */
@@ -108,11 +109,14 @@ struct child
unsigned int noerror:1; /* Nonzero if commands contained a '-'. */
unsigned int good_stdin:1; /* Nonzero if this child has a good stdin. */
unsigned int deleted:1; /* Nonzero if targets have been deleted. */
+ unsigned int recursive:1; /* Nonzero for recursive command ('+' etc.) */
unsigned int dontcare:1; /* Saved dontcare flag. */
};
extern struct child *children;
+/* A signal handler for SIGCHLD, if needed. */
+RETSIGTYPE child_handler (int sig);
int is_bourne_compatible_shell(const char *path);
void new_job (struct file *file);
void reap_children (int block, int err);
@@ -120,20 +124,16 @@ void start_waiting_jobs (void);
char **construct_command_argv (char *line, char **restp, struct file *file,
int cmd_flags, char** batch_file);
+
#ifdef VMS
-int child_execute_job (char *argv, struct child *child);
+int child_execute_job (struct child *child, char *argv);
#else
# define FD_STDIN (fileno (stdin))
# define FD_STDOUT (fileno (stdout))
# define FD_STDERR (fileno (stderr))
-# if defined(__EMX__)
-int child_execute_job (int stdin_fd, int stdout_fd, int stderr_fd,
- char **argv, char **envp);
-# else
-void child_execute_job (int stdin_fd, int stdout_fd, int stderr_fd,
- char **argv, char **envp) __attribute__ ((noreturn));
-# endif
+int child_execute_job (struct output *out, int good_stdin, char **argv, char **envp);
#endif
+
#ifdef _AMIGA
void exec_command (char **argv) __attribute__ ((noreturn));
#elif defined(__EMX__)
diff --git a/load.c b/load.c
index 79294b33..37e7b8ea 100644
--- a/load.c
+++ b/load.c
@@ -1,5 +1,5 @@
/* Loading dynamic objects for GNU Make.
-Copyright (C) 2012-2014 Free Software Foundation, Inc.
+Copyright (C) 2012-2016 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
@@ -45,8 +45,8 @@ struct load_list
static struct load_list *loaded_syms = NULL;
static load_func_t
-load_object (const gmk_floc *flocp, int noerror,
- const char *ldname, const char *symname)
+load_object (const floc *flocp, int noerror, const char *ldname,
+ const char *symname)
{
static void *global_dl = NULL;
load_func_t symp;
@@ -119,7 +119,7 @@ load_object (const gmk_floc *flocp, int noerror,
}
int
-load_file (const gmk_floc *flocp, const char **ldname, int noerror)
+load_file (const floc *flocp, const char **ldname, int noerror)
{
int nmlen = strlen (*ldname);
char *new = alloca (nmlen + CSTRLEN (SYMBOL_EXTENSION) + 1);
@@ -168,9 +168,8 @@ load_file (const gmk_floc *flocp, const char **ldname, int noerror)
loaded = allocated_variable_expand ("$(.LOADED)");
fp = strstr (loaded, *ldname);
r = fp && (fp==loaded || fp[-1]==' ') && (fp[nmlen]=='\0' || fp[nmlen]==' ');
- free (loaded);
if (r)
- return 1;
+ goto exit;
/* If we didn't find a symbol name yet, construct it from the ldname. */
if (! symname)
@@ -214,8 +213,21 @@ load_file (const gmk_floc *flocp, const char **ldname, int noerror)
/* If it succeeded, add the load file to the loaded variable. */
if (r > 0)
- do_variable_definition (flocp, ".LOADED", *ldname, o_default, f_append, 0);
+ {
+ size_t loadlen = strlen (loaded);
+ char *newval = alloca (loadlen + strlen (*ldname) + 2);
+ /* Don't add a space if it's empty. */
+ if (loadlen)
+ {
+ memcpy (newval, loaded, loadlen);
+ newval[loadlen++] = ' ';
+ }
+ strcpy (&newval[loadlen], *ldname);
+ do_variable_definition (flocp, ".LOADED", newval, o_default, f_simple, 0);
+ }
+ exit:
+ free (loaded);
return r;
}
@@ -237,7 +249,7 @@ unload_file (const char *name)
#else
int
-load_file (const gmk_floc *flocp, const char **ldname, int noerror)
+load_file (const floc *flocp, const char **ldname UNUSED, int noerror)
{
if (! noerror)
O (fatal, flocp,
@@ -247,7 +259,7 @@ load_file (const gmk_floc *flocp, const char **ldname, int noerror)
}
void
-unload_file (const char *name)
+unload_file (const char *name UNUSED)
{
O (fatal, NILF, "INTERNAL: Cannot unload when load is not supported!");
}
diff --git a/loadapi.c b/loadapi.c
index fb275dd1..14b75f8f 100644
--- a/loadapi.c
+++ b/loadapi.c
@@ -1,5 +1,5 @@
/* API for GNU Make dynamic objects.
-Copyright (C) 2013-2014 Free Software Foundation, Inc.
+Copyright (C) 2013-2016 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
@@ -37,17 +37,29 @@ gmk_free (char *s)
/* Evaluate a buffer as make syntax.
Ideally eval_buffer() will take const char *, but not yet. */
void
-gmk_eval (const char *buffer, const gmk_floc *floc)
+gmk_eval (const char *buffer, const gmk_floc *gfloc)
{
/* Preserve existing variable buffer context. */
char *pbuf;
unsigned int plen;
char *s;
+ floc fl;
+ floc *flp;
+
+ if (gfloc)
+ {
+ fl.filenm = gfloc->filenm;
+ fl.lineno = gfloc->lineno;
+ fl.offset = 0;
+ flp = &fl;
+ }
+ else
+ flp = NULL;
install_variable_buffer (&pbuf, &plen);
s = xstrdup (buffer);
- eval_buffer (s, floc);
+ eval_buffer (s, flp);
free (s);
restore_variable_buffer (pbuf, plen);
diff --git a/main.c b/main.c
index 7f14cba5..fa8045fd 100644
--- a/main.c
+++ b/main.c
@@ -1,5 +1,5 @@
/* Argument parsing and main program of GNU Make.
-Copyright (C) 1988-2014 Free Software Foundation, Inc.
+Copyright (C) 1988-2016 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
@@ -15,6 +15,7 @@ You should have received a copy of the GNU General Public License along with
this program. If not, see <http://www.gnu.org/licenses/>. */
#include "makeint.h"
+#include "os.h"
#include "filedef.h"
#include "dep.h"
#include "variable.h"
@@ -47,18 +48,41 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
#ifdef _AMIGA
int __stack = 20000; /* Make sure we have 20K of stack space */
#endif
+#ifdef VMS
+int vms_use_mcr_command = 0;
+int vms_always_use_cmd_file = 0;
+int vms_gnv_shell = 0;
+int vms_legacy_behavior = 0;
+int vms_comma_separator = 0;
+int vms_unix_simulation = 0;
+int vms_report_unix_paths = 0;
+
+/* Evaluates if a VMS environment option is set, only look at first character */
+static int
+get_vms_env_flag (const char *name, int default_value)
+{
+char * value;
+char x;
-void init_dir (void);
-void remote_setup (void);
-void remote_cleanup (void);
-RETSIGTYPE fatal_error_signal (int sig);
-
-void print_variable_data_base (void);
-void print_dir_data_base (void);
-void print_rule_data_base (void);
-void print_vpath_data_base (void);
+ value = getenv (name);
+ if (value == NULL)
+ return default_value;
-void verify_file_data_base (void);
+ x = toupper (value[0]);
+ switch (x)
+ {
+ case '1':
+ case 'T':
+ case 'E':
+ return 1;
+ break;
+ case '0':
+ case 'F':
+ case 'D':
+ return 0;
+ }
+}
+#endif
#if defined HAVE_WAITPID || defined HAVE_WAIT3
# define HAVE_WAIT_NOHANG
@@ -223,27 +247,28 @@ struct rlimit stack_limit;
#endif
-/* Number of job slots (commands that can be run at once). */
+/* Number of job slots for parallelism. */
+
+unsigned int job_slots;
-unsigned int job_slots = 1;
-unsigned int default_job_slots = 1;
+#define INVALID_JOB_SLOTS (-1)
static unsigned int master_job_slots = 0;
+static int arg_job_slots = INVALID_JOB_SLOTS;
-/* Value of job_slots that means no limit. */
+static const int default_job_slots = INVALID_JOB_SLOTS;
-static unsigned int inf_jobs = 0;
+/* Value of job_slots that means no limit. */
-/* File descriptors for the jobs pipe. */
+static const int inf_jobs = 0;
-char *jobserver_fds = 0;
+/* Authorization for the jobserver. */
-int job_fds[2] = { -1, -1 };
-int job_rfd = -1;
+static char *jobserver_auth = NULL;
/* Handle for the mutex used on Windows to synchronize output of our
children under -O. */
-char *sync_mutex = 0;
+char *sync_mutex = NULL;
/* Maximum load average at which multiple jobs will be run.
Negative values mean unlimited, while zero means limit to
@@ -423,7 +448,7 @@ static const struct command_switch switches[] =
{ 'f', filename, &makefiles, 0, 0, 0, 0, 0, "file" },
{ 'I', filename, &include_directories, 1, 1, 0, 0, 0,
"include-dir" },
- { 'j', positive_int, &job_slots, 1, 1, 0, &inf_jobs, &default_job_slots,
+ { 'j', positive_int, &arg_job_slots, 1, 1, 0, &inf_jobs, &default_job_slots,
"jobs" },
#ifndef NO_FLOAT
{ 'l', floating, &max_load_average, 1, 1, 0, &default_load_average,
@@ -438,7 +463,7 @@ static const struct command_switch switches[] =
/* These are long-style options. */
{ CHAR_MAX+1, strlist, &db_flags, 1, 1, 0, "basic", 0, "debug" },
- { CHAR_MAX+2, string, &jobserver_fds, 1, 1, 0, 0, 0, "jobserver-fds" },
+ { CHAR_MAX+2, string, &jobserver_auth, 1, 1, 0, 0, 0, "jobserver-auth" },
{ CHAR_MAX+3, flag, &trace_flag, 1, 1, 0, 0, 0, "trace" },
{ CHAR_MAX+4, flag, &inhibit_print_directory_flag, 1, 1, 0, 0, 0,
"no-print-directory" },
@@ -466,7 +491,7 @@ static struct option long_option_aliases[] =
/* List of goal targets. */
-static struct dep *goals, *lastgoal;
+static struct goaldep *goals, *lastgoal;
/* List of variables which were defined on the command line
(or, equivalently, in MAKEFLAGS). */
@@ -565,7 +590,7 @@ struct output make_sync;
/* Mask of signals that are being caught with fatal_error_signal. */
-#ifdef POSIX
+#ifdef POSIX
sigset_t fatal_signal_set;
#else
# ifdef HAVE_SIGSETMASK
@@ -608,7 +633,7 @@ initialize_global_hash_tables (void)
Each element is true if we should stop parsing on that character. */
static void
-initialize_stopchar_map ()
+initialize_stopchar_map (void)
{
int i;
@@ -626,21 +651,25 @@ initialize_stopchar_map ()
stopchar_map[(int)'-'] = MAP_USERFUNC;
stopchar_map[(int)'_'] = MAP_USERFUNC;
+ stopchar_map[(int)' '] = MAP_BLANK;
+ stopchar_map[(int)'\t'] = MAP_BLANK;
+
stopchar_map[(int)'/'] = MAP_DIRSEP;
#if defined(VMS)
- stopchar_map[(int)']'] = MAP_DIRSEP;
+ stopchar_map[(int)':'] |= MAP_DIRSEP;
+ stopchar_map[(int)']'] |= MAP_DIRSEP;
+ stopchar_map[(int)'>'] |= MAP_DIRSEP;
#elif defined(HAVE_DOS_PATHS)
- stopchar_map[(int)'\\'] = MAP_DIRSEP;
+ stopchar_map[(int)'\\'] |= MAP_DIRSEP;
#endif
for (i = 1; i <= UCHAR_MAX; ++i)
{
- if (isblank(i))
- stopchar_map[i] = MAP_BLANK;
- if (isspace(i))
- stopchar_map[i] |= MAP_SPACE;
- if (isalnum(i))
- stopchar_map[i] = MAP_USERFUNC;
+ if (isspace (i) && NONE_SET (stopchar_map[i], MAP_BLANK))
+ /* Don't mark blank characters as newline characters. */
+ stopchar_map[i] |= MAP_NEWLINE;
+ else if (isalnum (i))
+ stopchar_map[i] |= MAP_USERFUNC;
}
}
@@ -759,6 +788,9 @@ decode_debug_flags (void)
static void
decode_output_sync_flags (void)
{
+#ifdef NO_OUTPUT_SYNC
+ output_sync = OUTPUT_SYNC_NONE;
+#else
if (output_sync_option)
{
if (streq (output_sync_option, "none"))
@@ -776,6 +808,7 @@ decode_output_sync_flags (void)
if (sync_mutex)
RECORD_SYNC_MUTEX (sync_mutex);
+#endif
}
#ifdef WINDOWS32
@@ -1017,6 +1050,14 @@ msdos_return_to_initial_directory (void)
}
#endif /* __MSDOS__ */
+static void
+reset_jobserver (void)
+{
+ jobserver_clear ();
+ free (jobserver_auth);
+ jobserver_auth = NULL;
+}
+
#ifdef _AMIGA
int
main (int argc, char **argv)
@@ -1027,10 +1068,11 @@ main (int argc, char **argv, char **envp)
{
static char *stdin_nm = 0;
int makefile_status = MAKE_SUCCESS;
- struct dep *read_files;
+ struct goaldep *read_files;
PATH_VAR (current_directory);
unsigned int restarts = 0;
unsigned int syncing = 0;
+ int argv_slots;
#ifdef WINDOWS32
const char *unix_path = NULL;
const char *windows32_path = NULL;
@@ -1190,14 +1232,58 @@ main (int argc, char **argv, char **envp)
}
}
#endif
- if (program == 0)
#ifdef VMS
- program = vms_progname(argv[0]);
+ set_program_name (argv[0]);
+ program = program_name;
+ {
+ const char *shell;
+ char pwdbuf[256];
+ char *pwd;
+ shell = getenv ("SHELL");
+ if (shell != NULL)
+ vms_gnv_shell = 1;
+
+ /* Need to know if CRTL set to report UNIX paths. Use getcwd as
+ it works on all versions of VMS. */
+ pwd = getcwd(pwdbuf, 256);
+ if (pwd[0] == '/')
+ vms_report_unix_paths = 1;
+
+ vms_use_mcr_command = get_vms_env_flag ("GNV$MAKE_USE_MCR", 0);
+
+ vms_always_use_cmd_file = get_vms_env_flag ("GNV$MAKE_USE_CMD_FILE", 0);
+
+ /* Legacy behavior is on VMS is older behavior that needed to be
+ changed to be compatible with standard make behavior.
+ For now only completely disable when running under a Bash shell.
+ TODO: Update VMS built in recipes and macros to not need this
+ behavior, at which time the default may change. */
+ vms_legacy_behavior = get_vms_env_flag ("GNV$MAKE_OLD_VMS",
+ !vms_gnv_shell);
+
+ /* VMS was changed to use a comma separator in the past, but that is
+ incompatible with built in functions that expect space separated
+ lists. Allow this to be selectively turned off. */
+ vms_comma_separator = get_vms_env_flag ("GNV$MAKE_COMMA",
+ vms_legacy_behavior);
+
+ /* Some Posix shell syntax options are incompatible with VMS syntax.
+ VMS requires double quotes for strings and escapes quotes
+ differently. When this option is active, VMS will try
+ to simulate Posix shell simulations instead of using
+ VMS DCL behavior. */
+ vms_unix_simulation = get_vms_env_flag ("GNV$MAKE_SHELL_SIM",
+ !vms_legacy_behavior);
+
+ }
+ if (need_vms_symbol () && !vms_use_mcr_command)
+ create_foreign_command (program_name, argv[0]);
#else
+ if (program == 0)
program = argv[0];
-#endif
else
++program;
+#endif
}
/* Set up to access user data (files). */
@@ -1234,6 +1320,7 @@ main (int argc, char **argv, char **envp)
/* 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);
+ define_variable_cname (".LOADED", "", o_default, 0);
/* Set up .FEATURES
Use a separate variable because define_variable_cname() is a macro and
@@ -1381,6 +1468,13 @@ main (int argc, char **argv, char **envp)
decode_env_switches (STRING_SIZE_TUPLE ("MAKEFLAGS"));
+#if 0
+ /* People write things like:
+ MFLAGS="CC=gcc -pipe" "CFLAGS=-g"
+ and we set the -p, -i and -e switches. Doesn't seem quite right. */
+ decode_env_switches (STRING_SIZE_TUPLE ("MFLAGS"));
+#endif
+
/* In output sync mode we need to sync any output generated by reading the
makefiles, such as in $(info ...) or stderr from $(shell ...) etc. */
@@ -1388,26 +1482,34 @@ main (int argc, char **argv, char **envp)
|| output_sync == OUTPUT_SYNC_TARGET);
OUTPUT_SET (&make_sync);
-#if 0
- /* People write things like:
- MFLAGS="CC=gcc -pipe" "CFLAGS=-g"
- and we set the -p, -i and -e switches. Doesn't seem quite right. */
- decode_env_switches (STRING_SIZE_TUPLE ("MFLAGS"));
-#endif
+ /* Remember the job slots set through the environment vs. command line. */
+ {
+ int env_slots = arg_job_slots;
+ arg_job_slots = INVALID_JOB_SLOTS;
+
+ decode_switches (argc, (const char **)argv, 0);
+ argv_slots = arg_job_slots;
- decode_switches (argc, (const char **)argv, 0);
+ if (arg_job_slots == INVALID_JOB_SLOTS)
+ arg_job_slots = env_slots;
+ }
- /* Set a variable specifying whether stdout/stdin is hooked to a TTY. */
+ /* Set a variable specifying whether stdout/stdin is hooked to a TTY. */
#ifdef HAVE_ISATTY
- if (isatty (fileno (stdout)))
- if (! lookup_variable (STRING_SIZE_TUPLE ("MAKE_TERMOUT")))
- define_variable_cname ("MAKE_TERMOUT", TTYNAME (fileno (stdout)),
+ if (isatty (fileno (stdout)))
+ if (! lookup_variable (STRING_SIZE_TUPLE ("MAKE_TERMOUT")))
+ {
+ const char *tty = TTYNAME (fileno (stdout));
+ define_variable_cname ("MAKE_TERMOUT", tty ? tty : DEFAULT_TTYNAME,
o_default, 0)->export = v_export;
-
- if (isatty (fileno (stderr)))
- if (! lookup_variable (STRING_SIZE_TUPLE ("MAKE_TERMERR")))
- define_variable_cname ("MAKE_TERMERR", TTYNAME (fileno (stderr)),
+ }
+ if (isatty (fileno (stderr)))
+ if (! lookup_variable (STRING_SIZE_TUPLE ("MAKE_TERMERR")))
+ {
+ const char *tty = TTYNAME (fileno (stderr));
+ define_variable_cname ("MAKE_TERMERR", tty ? tty : DEFAULT_TTYNAME,
o_default, 0)->export = v_export;
+ }
#endif
/* Reset in case the switches changed our minds. */
@@ -1507,94 +1609,52 @@ main (int argc, char **argv, char **envp)
/* We may move, but until we do, here we are. */
starting_directory = current_directory;
-#ifdef MAKE_JOBSERVER
- /* If the jobserver-fds option is seen, make sure that -j is reasonable.
- This can't be usefully set in the makefile, and we want to verify the
- FDs are valid before any other aspect of make has a chance to start
- using them for something else. */
+ /* Set up the job_slots value and the jobserver. This can't be usefully set
+ in the makefile, and we want to verify the authorization is valid before
+ make has a chance to start using it for something else. */
- if (jobserver_fds)
+ if (jobserver_auth)
{
- /* Make sure the jobserver option has the proper format. */
- const char *cp = jobserver_fds;
-
-#ifdef WINDOWS32
- if (! open_jobserver_semaphore (cp))
- {
- DWORD err = GetLastError ();
- const char *estr = map_windows32_error_to_string (err);
- fatal (NILF, strlen (cp) + INTSTR_LENGTH + strlen (estr),
- _("internal error: unable to open jobserver semaphore '%s': (Error %ld: %s)"),
- cp, err, estr);
- }
- DB (DB_JOBS, (_("Jobserver client (semaphore %s)\n"), cp));
-#else
- if (sscanf (cp, "%d,%d", &job_fds[0], &job_fds[1]) != 2)
- OS (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]));
-#endif
-
- /* 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 we've restarted, we already printed this the first time. */
-
- if (job_slots > 0)
+ if (argv_slots == INVALID_JOB_SLOTS)
{
- if (! restarts)
- O (error, NILF,
- _("warning: -jN forced in submake: disabling jobserver mode."));
- }
-#ifndef WINDOWS32
-#ifdef HAVE_FCNTL
-# define FD_OK(_f) ((fcntl ((_f), F_GETFD) != -1) || (errno != EBADF))
-#else
-# define FD_OK(_f) 1
-#endif
- /* 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 (!FD_OK (job_fds[0]) || !FD_OK (job_fds[1])
- || (job_rfd = dup (job_fds[0])) < 0)
- {
- if (errno != EBADF)
- pfatal_with_name (_("dup jobserver"));
+ if (jobserver_parse_auth (jobserver_auth))
+ {
+ /* Success! Use the jobserver. */
+ job_slots = 0;
+ goto job_setup_complete;
+ }
- O (error, NILF,
- _("warning: jobserver unavailable: using -j1. Add '+' to parent make rule."));
- job_slots = 1;
- job_fds[0] = job_fds[1] = -1;
+ O (error, NILF, _("warning: jobserver unavailable: using -j1. Add '+' to parent make rule."));
+ arg_job_slots = 1;
}
-#endif
- if (job_slots > 0)
- {
-#ifdef WINDOWS32
- free_jobserver_semaphore ();
-#else
- if (job_fds[0] >= 0)
- close (job_fds[0]);
- if (job_fds[1] >= 0)
- close (job_fds[1]);
-#endif
- job_fds[0] = job_fds[1] = -1;
+ /* The user provided a -j setting on the command line: use it. */
+ else if (!restarts)
+ /* If restarts is >0 we already printed this message. */
+ O (error, NILF,
+ _("warning: -jN forced in submake: disabling jobserver mode."));
- free (jobserver_fds);
- jobserver_fds = 0;
- }
+ /* We failed to use our parent's jobserver. */
+ reset_jobserver ();
+ job_slots = (unsigned int)arg_job_slots;
}
-#endif
+ else if (arg_job_slots == INVALID_JOB_SLOTS)
+ /* The default is one job at a time. */
+ job_slots = 1;
+ else
+ /* Use whatever was provided. */
+ job_slots = (unsigned int)arg_job_slots;
+
+ job_setup_complete:
/* The extra indirection through $(MAKE_COMMAND) is done
for hysterical raisins. */
+
#ifdef VMS
- define_variable_cname("MAKE_COMMAND", vms_command(argv[0]), o_default, 0);
+ if (vms_use_mcr_command)
+ define_variable_cname ("MAKE_COMMAND", vms_command (argv[0]), o_default, 0);
+ else
+ define_variable_cname ("MAKE_COMMAND", program, o_default, 0);
#else
define_variable_cname ("MAKE_COMMAND", argv[0], o_default, 0);
#endif
@@ -1646,6 +1706,9 @@ main (int argc, char **argv, char **envp)
a reference to this hidden variable is written instead. */
define_variable_cname ("MAKEOVERRIDES", "${-*-command-variables-*-}",
o_env, 1);
+#ifdef VMS
+ vms_export_dcl_symbol ("MAKEOVERRIDES", "${-*-command-variables-*-}");
+#endif
}
/* If there were -C flags, move ourselves about. */
@@ -1742,7 +1805,7 @@ main (int argc, char **argv, char **envp)
_("Makefile from standard input specified twice."));
#ifdef VMS
-# define DEFAULT_TMPDIR "sys$scratch:"
+# define DEFAULT_TMPDIR "/sys$scratch/"
#else
# ifdef P_tmpdir
# define DEFAULT_TMPDIR P_tmpdir
@@ -1806,7 +1869,7 @@ main (int argc, char **argv, char **envp)
}
#ifndef __EMX__ /* Don't use a SIGCHLD handler for OS/2 */
-#if defined(MAKE_JOBSERVER) || !defined(HAVE_WAIT_NOHANG)
+#if !defined(HAVE_WAIT_NOHANG) || defined(MAKE_JOBSERVER)
/* Set up to handle children dying. This must be done before
reading in the makefiles so that 'shell' function calls will work.
@@ -1814,13 +1877,12 @@ main (int argc, char **argv, char **envp)
functionality here and rely on the signal handler and counting
children.
- If we're using the jobs pipe we need a signal handler so that
- SIGCHLD is not ignored; we need it to interrupt the read(2) of the
- jobserver pipe in job.c if we're waiting for a token.
+ If we're using the jobs pipe we need a signal handler so that SIGCHLD is
+ not ignored; we need it to interrupt the read(2) of the jobserver pipe if
+ we're waiting for a token.
If none of these are true, we don't need a signal handler at all. */
{
- RETSIGTYPE child_handler (int sig);
# if defined SIGCHLD
bsd_signal (SIGCHLD, child_handler);
# endif
@@ -1828,6 +1890,18 @@ main (int argc, char **argv, char **envp)
bsd_signal (SIGCLD, child_handler);
# endif
}
+
+#ifdef HAVE_PSELECT
+ /* If we have pselect() then we need to block SIGCHLD so it's deferred. */
+ {
+ sigset_t block;
+ sigemptyset (&block);
+ sigaddset (&block, SIGCHLD);
+ if (sigprocmask (SIG_SETMASK, &block, NULL) < 0)
+ pfatal_with_name ("sigprocmask(SIG_SETMASK, SIGCHLD)");
+ }
+#endif
+
#endif
#endif
@@ -1900,7 +1974,7 @@ main (int argc, char **argv, char **envp)
no_default_sh_exe = !find_and_set_default_shell (NULL);
#endif /* WINDOWS32 */
-#if defined (__MSDOS__) || defined (__EMX__)
+#if defined (__MSDOS__) || defined (__EMX__) || defined (VMS)
/* We need to know what kind of shell we will be using. */
{
extern int _is_unixy_shell (const char *_path);
@@ -1964,7 +2038,7 @@ main (int argc, char **argv, char **envp)
}
#if defined (__MSDOS__) || defined (__EMX__) || defined (VMS)
- if (job_slots != 1
+ if (arg_job_slots != 1
# ifdef __EMX__
&& _osmode != OS2_MODE /* turn off -j if we are in DOS mode */
# endif
@@ -1973,73 +2047,40 @@ main (int argc, char **argv, char **envp)
O (error, NILF,
_("Parallel jobs (-j) are not supported on this platform."));
O (error, NILF, _("Resetting to single job (-j1) mode."));
- job_slots = 1;
+ arg_job_slots = job_slots = 1;
}
#endif
-#ifdef MAKE_JOBSERVER
- /* If we have >1 slot but no jobserver-fds, then we're a top-level make.
- Set up the pipe and install the fds option for our children. */
+ /* If we have >1 slot at this point, then we're a top-level make.
+ Set up the jobserver.
- if (job_slots > 1)
- {
-#ifdef WINDOWS32
- /* sub_proc.c cannot wait for more than MAXIMUM_WAIT_OBJECTS objects
- * and one of them is the job-server semaphore object. Limit the
- * number of available job slots to (MAXIMUM_WAIT_OBJECTS - 1). */
-
- if (job_slots >= MAXIMUM_WAIT_OBJECTS)
- {
- job_slots = MAXIMUM_WAIT_OBJECTS - 1;
- DB (DB_JOBS, (_("Jobserver slots limited to %d\n"), job_slots));
- }
-
- if (! create_jobserver_semaphore (job_slots - 1))
- {
- DWORD err = GetLastError ();
- const char *estr = map_windows32_error_to_string (err);
- ONS (fatal, NILF,
- _("creating jobserver semaphore: (Error %ld: %s)"), err, estr);
- }
-#else
- char c = '+';
-
- if (pipe (job_fds) < 0 || (job_rfd = dup (job_fds[0])) < 0)
- pfatal_with_name (_("creating jobs pipe"));
-#endif
+ Every make assumes that it always has one job it can run. For the
+ submakes it's the token they were given by their parent. For the top
+ make, we just subtract one from the number the user wants. */
- /* Every make assumes that it always has one job it can run. For the
- submakes it's the token they were given by their parent. For the
- top make, we just subtract one from the number the user wants. We
- want job_slots to be 0 to indicate we're using the jobserver. */
-
- master_job_slots = job_slots;
+ if (job_slots > 1 && jobserver_setup (job_slots - 1))
+ {
+ /* Fill in the jobserver_auth for our children. */
+ jobserver_auth = jobserver_get_auth ();
-#ifdef WINDOWS32
- /* We're using the jobserver so set job_slots to 0. */
- job_slots = 0;
-#else
- while (--job_slots)
+ if (jobserver_auth)
{
- int r;
-
- EINTRLOOP (r, write (job_fds[1], &c, 1));
- if (r != 1)
- pfatal_with_name (_("init jobserver pipe"));
+ /* We're using the jobserver so set job_slots to 0. */
+ master_job_slots = job_slots;
+ job_slots = 0;
}
-#endif
-
- /* Fill in the jobserver_fds for our children. */
+ }
-#ifdef WINDOWS32
- jobserver_fds = xmalloc (MAX_PATH + 1);
- strcpy (jobserver_fds, get_jobserver_semaphore_name ());
-#else
- jobserver_fds = xmalloc ((INTSTR_LENGTH * 2) + 2);
- sprintf (jobserver_fds, "%d,%d", job_fds[0], job_fds[1]);
-#endif
+ /* If we're not using parallel jobs, then we don't need output sync.
+ This is so people can enable output sync in GNUMAKEFLAGS or similar, but
+ not have it take effect unless parallel builds are enabled. */
+ if (syncing && job_slots == 1)
+ {
+ OUTPUT_UNSET ();
+ output_close (&make_sync);
+ syncing = 0;
+ output_sync = OUTPUT_SYNC_NONE;
}
-#endif
#ifndef MAKE_SYMLINKS
if (check_symlink_flag)
@@ -2053,7 +2094,7 @@ main (int argc, char **argv, char **envp)
define_makeflags (1, 0);
- /* Make each 'struct dep' point at the 'struct file' for the file
+ /* Make each 'struct goaldep' point at the 'struct file' for the file
depended on. Also do magic for special targets. */
snap_deps ();
@@ -2124,18 +2165,14 @@ main (int argc, char **argv, char **envp)
char **aargv = NULL;
const char **nargv;
int nargc;
- int orig_db_level = db_level;
enum update_status status;
- if (! ISDB (DB_MAKEFILES))
- db_level = DB_NONE;
-
DB (DB_BASIC, (_("Updating makefiles....\n")));
/* Remove any makefiles we don't want to try to update.
Also record the current modtimes so we can compare them later. */
{
- register struct dep *d, *last;
+ register struct goaldep *d, *last;
last = 0;
d = read_files;
while (d != 0)
@@ -2164,13 +2201,14 @@ main (int argc, char **argv, char **envp)
last->next = d->next;
/* Free the storage. */
- free_dep (d);
+ free_goaldep (d);
d = last == 0 ? read_files : last->next;
break;
}
}
+
if (f == NULL || !f->double_colon)
{
makefile_mtimes = xrealloc (makefile_mtimes,
@@ -2186,18 +2224,26 @@ main (int argc, char **argv, char **envp)
/* Set up 'MAKEFLAGS' specially while remaking makefiles. */
define_makeflags (1, 1);
- rebuilding_makefiles = 1;
- status = update_goal_chain (read_files);
- rebuilding_makefiles = 0;
+ {
+ int orig_db_level = db_level;
+
+ if (! ISDB (DB_MAKEFILES))
+ db_level = DB_NONE;
+
+ rebuilding_makefiles = 1;
+ status = update_goal_chain (read_files);
+ rebuilding_makefiles = 0;
+
+ db_level = orig_db_level;
+ }
switch (status)
{
case us_question:
/* The only way this can happen is if the user specified -q and asked
- * for one of the makefiles to be remade as a target on the command
- * line. Since we're not actually updating anything with -q we can
- * treat this as "did nothing".
- */
+ for one of the makefiles to be remade as a target on the command
+ line. Since we're not actually updating anything with -q we can
+ treat this as "did nothing". */
case us_none:
/* Did nothing. */
@@ -2212,14 +2258,10 @@ main (int argc, char **argv, char **envp)
in updating or could not be found at all. */
int any_failed = 0;
unsigned int i;
- struct dep *d;
+ struct goaldep *d;
for (i = 0, d = read_files; d != 0; ++i, d = d->next)
{
- /* Reset the considered flag; we may need to look at the file
- again to print an error. */
- d->file->considered = 0;
-
if (d->file->updated)
{
/* This makefile was updated. */
@@ -2229,7 +2271,7 @@ main (int argc, char **argv, char **envp)
any_remade |= (file_mtime_no_search (d->file)
!= makefile_mtimes[i]);
}
- else if (! (d->changed & RM_DONTCARE))
+ else if (! (d->flags & RM_DONTCARE))
{
FILE_TIMESTAMP mtime;
/* The update failed and this makefile was not
@@ -2244,13 +2286,13 @@ main (int argc, char **argv, char **envp)
}
else
/* This makefile was not found at all. */
- if (! (d->changed & RM_DONTCARE))
+ if (! (d->flags & RM_DONTCARE))
{
const char *dnm = dep_name (d);
size_t l = strlen (dnm);
/* This is a makefile we care about. See how much. */
- if (d->changed & RM_INCLUDED)
+ if (d->flags & RM_INCLUDED)
/* An included makefile. We don't need to die, but we
do want to complain. */
error (NILF, l,
@@ -2332,11 +2374,6 @@ main (int argc, char **argv, char **envp)
++restarts;
- /* If we're re-exec'ing the first make, put back the number of
- job slots so define_makefiles() will get it right. */
- if (master_job_slots)
- job_slots = master_job_slots;
-
if (ISDB (DB_BASIC))
{
const char **p;
@@ -2344,6 +2381,7 @@ main (int argc, char **argv, char **envp)
for (p = nargv; *p != 0; ++p)
printf (" %s", *p);
putchar ('\n');
+ fflush (stdout);
}
#ifndef _AMIGA
@@ -2355,6 +2393,9 @@ main (int argc, char **argv, char **envp)
{
*p = alloca (40);
sprintf (*p, "%s=%u", MAKELEVEL_NAME, makelevel);
+#ifdef VMS
+ vms_putenv_symbol (*p);
+#endif
}
else if (strneq (*p, "MAKE_RESTARTS=", CSTRLEN ("MAKE_RESTARTS=")))
{
@@ -2390,10 +2431,6 @@ main (int argc, char **argv, char **envp)
fflush (stdout);
fflush (stderr);
- /* Close the dup'd jobserver pipe if we opened one. */
- if (job_rfd >= 0)
- close (job_rfd);
-
#ifdef _AMIGA
exec_command (nargv);
exit (0);
@@ -2407,8 +2444,7 @@ main (int argc, char **argv, char **envp)
termination. */
int pid;
int r;
- pid = child_execute_job (FD_STDIN, FD_STDOUT, FD_STDERR,
- nargv, environ);
+ pid = child_execute_job (NULL, 1, nargv, environ);
/* is this loop really necessary? */
do {
@@ -2418,14 +2454,17 @@ main (int argc, char **argv, char **envp)
exit (WIFEXITED(r) ? WEXITSTATUS(r) : EXIT_FAILURE);
}
#else
+#ifdef SET_STACK_SIZE
+ /* Reset limits, if necessary. */
+ if (stack_limit.rlim_cur)
+ setrlimit (RLIMIT_STACK, &stack_limit);
+#endif
exec_command ((char **)nargv, environ);
#endif
free (aargv);
break;
}
- db_level = orig_db_level;
-
/* Free the makefile mtimes. */
free (makefile_mtimes);
}
@@ -2494,7 +2533,7 @@ main (int argc, char **argv, char **envp)
if (f)
{
- goals = alloc_dep ();
+ goals = alloc_goaldep ();
goals->file = f;
}
}
@@ -2529,8 +2568,7 @@ main (int argc, char **argv, char **envp)
makefile_status = MAKE_TROUBLE;
break;
case us_failed:
- /* Updating failed. POSIX.2 specifies exit status >1 for this;
- but in VMS, there is only success and failure. */
+ /* Updating failed. POSIX.2 specifies exit status >1 for this; */
makefile_status = MAKE_FAILURE;
break;
}
@@ -2626,6 +2664,31 @@ handle_non_switch_argument (const char *arg, int env)
/* Ignore plain '-' for compatibility. */
return;
+#ifdef VMS
+ {
+ /* VMS DCL quoting can result in foo="bar baz" showing up here.
+ Need to remove the double quotes from the value. */
+ char * eq_ptr;
+ char * new_arg;
+ eq_ptr = strchr (arg, '=');
+ if ((eq_ptr != NULL) && (eq_ptr[1] == '"'))
+ {
+ int len;
+ int seg1;
+ int seg2;
+ len = strlen(arg);
+ new_arg = alloca(len);
+ seg1 = eq_ptr - arg + 1;
+ strncpy(new_arg, arg, (seg1));
+ seg2 = len - seg1 - 1;
+ strncpy(&new_arg[seg1], &eq_ptr[2], seg2);
+ new_arg[seg1 + seg2] = 0;
+ if (new_arg[seg1 + seg2 - 1] == '"')
+ new_arg[seg1 + seg2 - 1] = 0;
+ arg = new_arg;
+ }
+ }
+#endif
v = try_variable_definition (0, arg, o_command, 0);
if (v != 0)
{
@@ -2656,12 +2719,12 @@ handle_non_switch_argument (const char *arg, int env)
if (goals == 0)
{
- goals = alloc_dep ();
+ goals = alloc_goaldep ();
lastgoal = goals;
}
else
{
- lastgoal->next = alloc_dep ();
+ lastgoal->next = alloc_goaldep ();
lastgoal = lastgoal->next;
}
@@ -2940,7 +3003,7 @@ decode_env_switches (const char *envar, unsigned int len)
value = variable_expand (varref);
/* Skip whitespace, and check for an empty value. */
- value = next_token (value);
+ NEXT_TOKEN (value);
len = strlen (value);
if (len == 0)
return;
@@ -2963,14 +3026,14 @@ decode_env_switches (const char *envar, unsigned int len)
{
if (*value == '\\' && value[1] != '\0')
++value; /* Skip the backslash. */
- else if (isblank ((unsigned char)*value))
+ else if (ISBLANK (*value))
{
/* End of the word. */
*p++ = '\0';
argv[++argc] = p;
do
++value;
- while (isblank ((unsigned char)*value));
+ while (ISBLANK (*value));
continue;
}
*p++ = *value++;
@@ -3001,7 +3064,7 @@ quote_for_env (char *out, const char *in)
{
if (*in == '$')
*out++ = '$';
- else if (isblank ((unsigned char)*in) || *in == '\\')
+ else if (ISBLANK (*in) || *in == '\\')
*out++ = '\\';
*out++ = *in++;
}
@@ -3068,7 +3131,7 @@ define_makeflags (int all, int makefile)
case flag:
case flag_off:
- if (!*(int *) cs->value_ptr == (cs->type == flag_off)
+ if ((!*(int *) cs->value_ptr) == (cs->type == flag_off)
&& (cs->default_value == 0
|| *(int *) cs->value_ptr != *(int *) cs->default_value))
ADD_FLAG (0, 0);
@@ -3276,7 +3339,7 @@ print_version (void)
year, and none of the rest of it should be translated (including the
word "Copyright"), so it hardly seems worth it. */
- printf ("%sCopyright (C) 1988-2014 Free Software Foundation, Inc.\n",
+ printf ("%sCopyright (C) 1988-2016 Free Software Foundation, Inc.\n",
precede);
printf (_("%sLicense GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>\n\
@@ -3294,7 +3357,7 @@ print_version (void)
/* Print a bunch of information about this and that. */
static void
-print_data_base ()
+print_data_base (void)
{
time_t when = time ((time_t *) 0);
@@ -3321,13 +3384,7 @@ clean_jobserver (int status)
have written all our tokens so do that now. If tokens are left
after any other error code, that's bad. */
-#ifdef WINDOWS32
- if (has_jobserver_semaphore () && jobserver_tokens)
-#else
- char token = '+';
-
- if (job_fds[0] != -1 && jobserver_tokens)
-#endif
+ if (jobserver_enabled() && jobserver_tokens)
{
if (status != 2)
ON (error, NILF,
@@ -3336,18 +3393,7 @@ clean_jobserver (int status)
else
/* Don't write back the "free" token */
while (--jobserver_tokens)
- {
-#ifdef WINDOWS32
- if (! release_jobserver_semaphore ())
- perror_with_name ("release_jobserver_semaphore", "");
-#else
- int r;
-
- EINTRLOOP (r, write (job_fds[1], &token, 1));
- if (r != 1)
- perror_with_name ("write", "");
-#endif
- }
+ jobserver_release (0);
}
@@ -3356,36 +3402,14 @@ clean_jobserver (int status)
if (master_job_slots)
{
/* We didn't write one for ourself, so start at 1. */
- unsigned int tcnt = 1;
+ unsigned int tokens = 1 + jobserver_acquire_all ();
-#ifdef WINDOWS32
- while (acquire_jobserver_semaphore ())
- ++tcnt;
-#else
- /* Close the write side, so the read() won't hang. */
- close (job_fds[1]);
-
- while (read (job_fds[0], &token, 1) == 1)
- ++tcnt;
-#endif
-
- if (tcnt != master_job_slots)
+ if (tokens != master_job_slots)
ONN (error, NILF,
"INTERNAL: Exiting with %u jobserver tokens available; should be %u!",
- tcnt, master_job_slots);
-
-#ifdef WINDOWS32
- free_jobserver_semaphore ();
-#else
- close (job_fds[0]);
-#endif
+ tokens, master_job_slots);
- /* 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;
- free (jobserver_fds);
- jobserver_fds = 0;
+ reset_jobserver ();
}
}
diff --git a/maintMakefile b/maintMakefile
new file mode 100644
index 00000000..c1d45097
--- /dev/null
+++ b/maintMakefile
@@ -0,0 +1,410 @@
+# Maintainer-only makefile segment. This contains things that are relevant
+# only if you have the full copy of the GNU make sources from the Git
+# tree, not a dist copy.
+
+BUGLIST := bug-make@gnu.org
+
+# These are related to my personal setup.
+GPG_FINGERPRINT := 6338B6D4
+
+# SRCROOTDIR is just a handy location to keep source files in
+SRCROOTDIR ?= $(HOME)/src
+
+# Where the gnulib project has been locally cloned
+GNULIBDIR ?= $(SRCROOTDIR)/gnulib
+
+# Where to put the CVS checkout of the GNU web repository
+GNUWEBDIR ?= $(SRCROOTDIR)/gnu-www
+
+# Where to put the CVS checkout of the GNU make web repository
+MAKEWEBDIR ?= $(SRCROOTDIR)/make/make-web
+
+# We like mondo-warnings!
+AM_CFLAGS += -Wall -Wwrite-strings -Wextra -Wdeclaration-after-statement -Wshadow -Wpointer-arith -Wbad-function-cast
+
+MAKE_MAINTAINER_MODE := -DMAKE_MAINTAINER_MODE
+AM_CPPFLAGS += $(MAKE_MAINTAINER_MODE)
+
+# I want this one but I have to wait for the const cleanup!
+# -Wwrite-strings
+
+# Find the glob source files... this might be dangerous, but we're maintainers!
+globsrc := $(wildcard glob/*.c)
+globhdr := $(wildcard glob/*.h)
+
+TEMPLATES = README README.DOS README.W32 README.OS2 \
+ config.ami configh.dos config.h.W32 config.h-vms
+MTEMPLATES = Makefile.DOS SMakefile
+
+# These are built as a side-effect of the dist rule
+#all-am: $(TEMPLATES) $(MTEMPLATES) build.sh.in
+
+# Create preprocessor output files--GCC specific!
+%.i : %.c
+ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) -E -dD -o $@ $<
+
+# General rule for turning a .template into a regular file.
+#
+$(TEMPLATES) : % : %.template Makefile
+ rm -f $@
+ sed -e 's@%VERSION%@$(VERSION)@g' \
+ -e 's@%PACKAGE%@$(PACKAGE)@g' \
+ $< > $@
+ chmod a-w $@
+
+# Construct Makefiles by adding on dependencies, etc.
+#
+$(MTEMPLATES) : % : %.template .dep_segment Makefile
+ rm -f $@
+ sed -e 's@%VERSION%@$(VERSION)@g' \
+ -e 's@%PROGRAMS%@$(bin_PROGRAMS)@g' \
+ -e 's@%SOURCES%@$(filter-out remote-%,$(make_SOURCES)) remote-$$(REMOTE).c@g' \
+ -e 's@%OBJECTS%@$(filter-out remote-%,$(make_OBJECTS)) remote-$$(REMOTE).o@g' \
+ -e 's@%GLOB_SOURCES%@$(globsrc) $(globhdr)@g' \
+ -e 's@%GLOB_OBJECTS%@$(globsrc:glob/%.c=%.o)@g' \
+ $< > $@
+ echo >>$@; echo '# --------------- DEPENDENCIES' >>$@; echo '#' >>$@; \
+ cat $(word 2,$^) >>$@
+ chmod a-w $@
+
+NMakefile: NMakefile.template .dep_segment Makefile
+ rm -f $@
+ cp $< $@
+ echo >>$@; echo '# --------------- DEPENDENCIES' >>$@; echo '#' >>$@; \
+ sed 's/^\([^ ]*\)\.o:/$$(OUTDIR)\/\1.obj:/' $(word 2,$^) >>$@
+ chmod a-w $@
+
+# Construct build.sh.in
+#
+build.sh.in: build.template Makefile
+ rm -f $@
+ sed -e 's@%objs%@$(patsubst %.o,%.$${OBJEXT},$(filter-out remote-%,$(make_OBJECTS)))@g' \
+ -e 's@%globobjs%@$(patsubst %.c,%.$${OBJEXT},$(globsrc))@g' \
+ $< > $@
+ chmod a-w+x $@
+
+
+# Use automake to build a dependency list file, for "foreign" makefiles like
+# Makefile.DOS.
+#
+# Automake used to have a --generate-deps flag, but it's gone now, so we have
+# to do it ourselves.
+#
+DEP_FILES := $(wildcard $(DEPDIR)/*.Po)
+.dep_segment: Makefile.am maintMakefile $(DEP_FILES)
+ rm -f $@
+ (for f in $(DEPDIR)/*.Po; do \
+ echo ""; \
+ echo "# $$f"; \
+ sed -e '/^[^:]*\.[ch] *:/d' \
+ -e 's, /usr/[^ ]*,,g' \
+ -e 's, $(srcdir)/, ,g' \
+ -e '/^ *\\$$/d' \
+ -e '/^ *$$/d' \
+ < $$f; \
+ done) > $@
+
+# Cleaning
+
+GIT := git
+
+# git-clean: Clean all "ignored" files. Leave untracked files.
+# git-very-clean: Clean all files that aren't stored in source control.
+
+.PHONY: git-clean git-very-clean
+git-clean:
+ -$(GIT) clean -fdX
+git-very-clean: git-clean
+ -$(GIT) clean -fd
+
+
+
+## ---------------------- ##
+## Generating ChangeLog. ##
+## ---------------------- ##
+
+gl2cl-date := 2013-10-10
+gl2cl := $(GNULIBDIR)/build-aux/gitlog-to-changelog
+
+# Rebuild the changelog whenever a new commit is added
+ChangeLog: .check-git-HEAD
+ if test -f '$(gl2cl)'; then \
+ '$(gl2cl)' --since='$(gl2cl-date)' > '$@'; \
+ else \
+ echo "WARNING: $(gl2cl) is not available. No $@ generated."; \
+ fi
+
+.PHONY: .check-git-HEAD
+.check-git-HEAD:
+ sha="`git rev-parse HEAD`"; \
+ [ -f '$@' ] && [ "`cat '$@' 2>/dev/null`" = "$$sha" ] \
+ || echo "$$sha" > '$@'
+
+
+## ---------------- ##
+## Updating files. ##
+## ---------------- ##
+RSYNC = rsync -Lrtvz
+WGET = wget --passive-ftp -np -nv
+ftp-gnu = ftp://ftp.gnu.org/gnu
+
+move_if_change = if test -r $(target) && cmp -s $(target).t $(target); then \
+ echo $(target) is unchanged; rm -f $(target).t; \
+ else \
+ mv -f $(target).t $(target); \
+ fi
+
+# ------------------- #
+# Updating PO files. #
+# ------------------- #
+
+# PO archive mirrors --- Be careful; some might not be fully populated!
+# ftp://ftp.unex.es/pub/gnu-i18n/po/maint/
+# http://translation.sf.net/maint/
+# ftp://tiger.informatik.hu-berlin.de/pub/po/maint/
+
+po_wget_flags = --recursive --level=1 --no-directories --no-check-certificate
+po_repo = http://translationproject.org/latest/$(PACKAGE)
+po_sync = translationproject.org::tp/latest/$(PACKAGE)/
+
+.PHONY: do-po-update po-update
+do-po-update:
+ tmppo="/tmp/po-$(PACKAGE)-$(VERSION).$$$$" \
+ && rm -rf "$$tmppo" \
+ && mkdir "$$tmppo" \
+ && $(RSYNC) $(po_sync) "$$tmppo" \
+ && cp "$$tmppo"/*.po $(top_srcdir)/po \
+ && rm -rf "$$tmppo"
+ cd po && $(MAKE) update-po
+ $(MAKE) po-check
+
+po-update:
+ [ -d "po" ] && $(MAKE) do-po-update
+
+# -------------------------- #
+# Updating GNU build files. #
+# -------------------------- #
+
+# The following pseudo table associates a local directory and a URL
+# with each of the files that belongs to some other package and is
+# regularly updated from the specified URL.
+
+cvs-url = http://savannah.gnu.org/cgi-bin/viewcvs/~checkout~
+git-url = http://git.savannah.gnu.org/cgit
+target = $(patsubst get-%,%,$@)
+
+config-url = $(git-url)/config.git/plain/$(patsubst get-config/%,%,$@)
+get-config/config.guess get-config/config.sub:
+ @echo $(WGET) $(config-url) -O $(target) \
+ && $(WGET) $(config-url) -O $(target).t \
+ && $(move_if_change)
+
+gnulib-url = $(git-url)/gnulib.git/plain/build-aux/$(patsubst get-config/%,%,$@)
+get-config/texinfo.tex:
+ @echo $(WGET) $(gnulib-url) -O $(target) \
+ && $(WGET) $(gnulib-url) -O $(target).t \
+ && $(move_if_change)
+
+gnustandards-url = $(cvs-url)/gnustandards/gnustandards/$(patsubst get-doc/%,%,$@)
+get-doc/make-stds.texi get-doc/fdl.texi:
+ @echo $(WGET) $(gnustandards-url) -O $(target) \
+ && $(WGET) $(gnustandards-url) -O $(target).t \
+ && $(move_if_change)
+
+.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
+
+
+# --------------------- #
+# Updating everything. #
+# --------------------- #
+
+.PHONY: update
+update: po-update scm-update
+
+
+# ---------------------------------- #
+# Alternative configuration checks. #
+# ---------------------------------- #
+
+.PHONY: check-alt-config
+check-alt-config: \
+ checkcfg.--disable-job-server \
+ checkcfg.--disable-load \
+ checkcfg.--without-guile \
+ checkcfg.CPPFLAGS^-DNO_OUTPUT_SYNC \
+ checkcfg.CPPFLAGS^-DNO_ARCHIVES
+
+# Trick GNU make so it doesn't run the submake as a recursive make.
+NR_MAKE = $(MAKE)
+
+# Check builds both with build.sh and with make
+checkcfg.%: distdir
+ @echo "Building $@ (output in checkcfg.$*.log)"
+ @exec >'checkcfg.$*.log' 2>&1; \
+ rm -rf $(distdir)/_build \
+ && mkdir $(distdir)/_build \
+ && cd $(distdir)/_build \
+ && echo "Testing configure with $(subst ^,=,$*)" \
+ && ../configure --srcdir=.. $(subst ^,=,$*) \
+ $(AM_DISTCHECK_CONFIGURE_FLAGS) $(DISTCHECK_CONFIGURE_FLAGS) \
+ CFLAGS='$(AM_CFLAGS)' \
+ && ./build.sh \
+ && ./make $(AM_MAKEFLAGS) check \
+ && rm -f *.o make \
+ && $(NR_MAKE) $(AM_MAKEFLAGS) \
+ && ./make $(AM_MAKEFLAGS) check
+
+
+## --------------- ##
+## Sanity checks. ##
+## --------------- ##
+
+# Before we build a distribution be sure we run our local checks
+#distdir: local-check
+
+.PHONY: local-check po-check changelog-check
+
+# Checks that don't require Git. Run 'changelog-check' last as
+# previous test may reveal problems requiring new ChangeLog entries.
+local-check: po-check changelog-check
+
+# copyright-check writable-files
+
+changelog-check:
+ if head $(top_srcdir)/ChangeLog | grep 'Version $(VERSION)' >/dev/null; then \
+ :; \
+ else \
+ echo "$(VERSION) not in ChangeLog" 1>&2; \
+ exit 1; \
+ fi
+
+# Verify that all source files using _() are listed in po/POTFILES.in.
+# Ignore makeint.h; it defines _().
+po-check:
+ if test -f po/POTFILES.in; then \
+ grep '^[^#]' po/POTFILES.in | sort > $@-1; \
+ $(PERL) -wn -e 'if (/\b_\(/) { $$ARGV eq "./makeint.h" || print "$$ARGV\n" and close ARGV }' `find . -name '*.[ch]'` | sed 's,^\./,,' | sort > $@-2; \
+ diff -u $@-1 $@-2 || exit 1; \
+ rm -f $@-1 $@-2; \
+ fi
+
+
+## --------------- ##
+## Generate docs. ##
+## --------------- ##
+
+.PHONY: update-makeweb gendocs
+
+CVS = cvs
+
+makeweb-repo = $(USER)@cvs.sv.gnu.org:/web/make
+gnuweb-repo = :pserver:anonymous@cvs.sv.gnu.org:/web/www
+gnuweb-dir = www/server/standards
+
+# Get the GNU make web page boilerplate etc.
+update-makeweb:
+ [ -d '$(MAKEWEBDIR)' ] || mkdir -p '$(MAKEWEBDIR)'
+ [ -d '$(MAKEWEBDIR)'/CVS ] \
+ && { cd '$(MAKEWEBDIR)' && $(CVS) update; } \
+ || { mkdir -p '$(dir $(MAKEWEBDIR))' && cd '$(dir $(MAKEWEBDIR))' \
+ && $(CVS) -d $(makeweb-repo) co -d '$(notdir $(MAKEWEBDIR))' make; }
+
+# Get the GNU web page boilerplate etc.
+update-gnuweb:
+ [ -d '$(GNUWEBDIR)' ] || mkdir -p '$(GNUWEBDIR)'
+ [ -d '$(GNUWEBDIR)/$(gnuweb-dir)'/CVS ] \
+ && { cd '$(GNUWEBDIR)/$(gnuweb-dir)' && $(CVS) update; } \
+ || { cd '$(GNUWEBDIR)' && $(CVS) -d $(gnuweb-repo) co '$(gnuweb-dir)'; }
+
+gendocs: update-gnuweb update-makeweb
+ cp $(GNULIBDIR)/doc/gendocs_template doc
+ cd doc \
+ && rm -rf doc/manual \
+ && $(GNULIBDIR)/build-aux/gendocs.sh --email '$(BUGLIST)' \
+ make 'GNU Make Manual'
+ find '$(MAKEWEBDIR)'/manual \( -name CVS -prune \) -o \( -name '[!.]*' -type f -exec rm -f '{}' \; \)
+ cp -r doc/manual '$(MAKEWEBDIR)'
+ @echo 'Status of $(MAKEWEBDIR) repo:' && cd '$(MAKEWEBDIR)' \
+ && cvs -q -n update | grep -v '^M ' \
+ && echo '- cvs add <new files>' \
+ && echo '- cvs remove <deleted files>' \
+ && echo '- cvs commit' \
+ && echo '- cvs tag make-$(subst .,-,$(VERSION))'
+
+## ------------------------- ##
+## Make release targets. ##
+## ------------------------- ##
+
+.PHONY: tag-release
+tag-release:
+ case '$(VERSION)' in \
+ (*.*.9*) message=" candidate" ;; \
+ (*) message= ;; \
+ esac; \
+ $(GIT) tag -m "GNU Make release$$message $(VERSION)" -u '$(GPG_FINGERPRINT)' '$(VERSION)'
+
+## ------------------------- ##
+## GNU FTP upload artifacts. ##
+## ------------------------- ##
+
+# This target creates the upload artifacts.
+# Sign it with my key. If you don't have my key/passphrase then sorry,
+# you're SOL! :)
+
+GPG = gpg
+GPGFLAGS = -u $(GPG_FINGERPRINT)
+
+DIST_ARCHIVES_SIG = $(addsuffix .sig,$(DIST_ARCHIVES))
+DIST_ARCHIVES_DIRECTIVE = $(addsuffix .directive.asc,$(DIST_ARCHIVES))
+
+# A simple rule to test signing, etc.
+.PHONY: distsign
+distsign: $(DIST_ARCHIVES_SIG) $(DIST_ARCHIVES_DIRECTIVE)
+
+%.sig : %
+ @echo "Signing file '$<':"
+ $(GPG) $(GPGFLAGS) -o "$@" -b "$<"
+
+%.directive.asc: %
+ @echo "Creating directive file '$@':"
+ @( \
+ echo 'version: 1.1'; \
+ echo 'directory: make'; \
+ echo 'filename: $*'; \
+ echo 'comment: Official upload of GNU make version $(VERSION)'; \
+ ) > "$*.directive"
+ $(GPG) $(GPGFLAGS) -o "$@" --clearsign "$*.directive"
+ @rm -f "$*.directive"
+
+# Upload the artifacts
+
+FTPPUT = ncftpput
+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-upload-host)" "$(gnu-upload-dir)/$(@:upload-%=%)" $^
+
+
+# Rebuild Makefile.in if this file is modifed.
+Makefile.in: maintMakefile
+
+# Copyright (C) 1997-2016 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 terms of the GNU General Public License as published by the Free Software
+# Foundation; either version 3 of the License, or (at your option) any later
+# version.
+#
+# GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+# details.
+#
+# You should have received a copy of the GNU General Public License along with
+# this program. If not, see <http://www.gnu.org/licenses/>.
diff --git a/make.1 b/make.1
index ed04db90..d4bd2846 100644
--- a/make.1
+++ b/make.1
@@ -1,4 +1,4 @@
-.TH MAKE 1 "03 March 2012" "GNU" "User Commands"
+.TH MAKE 1 "28 February 2016" "GNU" "User Commands"
.SH NAME
make \- GNU make utility to maintain groups of programs
.SH SYNOPSIS
@@ -363,7 +363,7 @@ This manual page contributed by Dennis Morse of Stanford University.
Further updates contributed by Mike Frysinger. It has been reworked by Roland
McGrath. Maintained by Paul Smith.
.SH "COPYRIGHT"
-Copyright \(co 1992-1993, 1996-2014 Free Software Foundation, Inc.
+Copyright \(co 1992-1993, 1996-2016 Free Software Foundation, Inc.
This file is part of
.IR "GNU make" .
.LP
diff --git a/make_msvc_net2003.vcproj b/make_msvc_net2003.vcproj
index 01b1f0d2..32fe8332 100644
--- a/make_msvc_net2003.vcproj
+++ b/make_msvc_net2003.vcproj
@@ -1,337 +1,340 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
- ProjectType="Visual C++"
- Version="7.10"
- Name="make_msvc.net2003"
- ProjectGUID="{E96B5060-3240-4723-91C9-E64F1C877A04}"
- Keyword="Win32Proj">
- <Platforms>
- <Platform
- Name="Win32"/>
- </Platforms>
- <Configurations>
- <Configuration
- Name="Debug|Win32"
- OutputDirectory="Debug"
- IntermediateDirectory="Debug"
- ConfigurationType="1"
- CharacterSet="2">
- <Tool
- Name="VCCLCompilerTool"
- Optimization="0"
- AdditionalIncludeDirectories=".;w32/include;glob"
- PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_H=1;WINDOWS32=1"
- MinimalRebuild="TRUE"
- BasicRuntimeChecks="3"
- RuntimeLibrary="1"
- ForceConformanceInForLoopScope="TRUE"
- UsePrecompiledHeader="0"
- WarningLevel="4"
- SuppressStartupBanner="TRUE"
- Detect64BitPortabilityProblems="FALSE"
- DebugInformationFormat="4"/>
- <Tool
- Name="VCCustomBuildTool"/>
- <Tool
- Name="VCLinkerTool"
- OutputFile="$(OutDir)/make_msvc.net2003.exe"
- LinkIncremental="2"
- GenerateDebugInformation="TRUE"
- ProgramDatabaseFile="$(OutDir)/make_msvc.net2003.pdb"
- SubSystem="1"
- TargetMachine="1"/>
- <Tool
- Name="VCMIDLTool"/>
- <Tool
- Name="VCPostBuildEventTool"/>
- <Tool
- Name="VCPreBuildEventTool"
- Description="Copying config.h.W32 to config.h"
- CommandLine="if not exist config.h copy config.h.W32 config.h"/>
- <Tool
- Name="VCPreLinkEventTool"/>
- <Tool
- Name="VCResourceCompilerTool"/>
- <Tool
- Name="VCWebServiceProxyGeneratorTool"/>
- <Tool
- Name="VCXMLDataGeneratorTool"/>
- <Tool
- Name="VCWebDeploymentTool"/>
- <Tool
- Name="VCManagedWrapperGeneratorTool"/>
- <Tool
- Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
- </Configuration>
- <Configuration
- Name="Release|Win32"
- OutputDirectory="Release"
- IntermediateDirectory="Release"
- ConfigurationType="1"
- CharacterSet="2">
- <Tool
- Name="VCCLCompilerTool"
- AdditionalIncludeDirectories=".;w32/include;glob"
- PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;HAVE_CONFIG_H=1;WINDOWS32=1"
- RuntimeLibrary="0"
- ForceConformanceInForLoopScope="TRUE"
- UsePrecompiledHeader="0"
- WarningLevel="4"
- Detect64BitPortabilityProblems="FALSE"
- DebugInformationFormat="3"/>
- <Tool
- Name="VCCustomBuildTool"/>
- <Tool
- Name="VCLinkerTool"
- OutputFile="$(OutDir)/make_msvc.net2003.exe"
- LinkIncremental="1"
- GenerateDebugInformation="TRUE"
- SubSystem="1"
- OptimizeReferences="2"
- EnableCOMDATFolding="2"
- TargetMachine="1"/>
- <Tool
- Name="VCMIDLTool"/>
- <Tool
- Name="VCPostBuildEventTool"/>
- <Tool
- Name="VCPreBuildEventTool"
- Description="Copying config.h.W32 to config.h"
- CommandLine="if not exist config.h copy config.h.W32 config.h"/>
- <Tool
- Name="VCPreLinkEventTool"/>
- <Tool
- Name="VCResourceCompilerTool"/>
- <Tool
- Name="VCWebServiceProxyGeneratorTool"/>
- <Tool
- Name="VCXMLDataGeneratorTool"/>
- <Tool
- Name="VCWebDeploymentTool"/>
- <Tool
- Name="VCManagedWrapperGeneratorTool"/>
- <Tool
- Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
- </Configuration>
- </Configurations>
- <References>
- </References>
- <Files>
- <Filter
- Name="src"
- Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
- UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
- <File
- RelativePath=".\ar.c">
- </File>
- <File
- RelativePath=".\arscan.c">
- </File>
- <File
- RelativePath=".\commands.c">
- </File>
- <File
- RelativePath=".\default.c">
- </File>
- <File
- RelativePath=".\dir.c">
- </File>
- <File
- RelativePath=".\expand.c">
- </File>
- <File
- RelativePath=".\file.c">
- </File>
- <File
- RelativePath=".\function.c">
- </File>
- <File
- RelativePath=".\getloadavg.c">
- </File>
- <File
- RelativePath=".\getopt.c">
- </File>
- <File
- RelativePath=".\getopt1.c">
- </File>
-
- <File
- RelativePath=".\guile.c">
- </File>
-
- <File
- RelativePath=".\hash.c">
- </File>
- <File
- RelativePath=".\strcache.c">
- </File>
- <File
- RelativePath=".\implicit.c">
- </File>
- <File
- RelativePath=".\job.c">
- </File>
- <File
- RelativePath=".\load.c">
- </File>
- <File
- RelativePath=".\output.c">
- </File>
- <File
- RelativePath=".\main.c">
- </File>
- <File
- RelativePath=".\misc.c">
- </File>
- <File
- RelativePath=".\read.c">
- </File>
- <File
- RelativePath=".\remake.c">
- </File>
- <File
- RelativePath=".\remote-stub.c">
- </File>
- <File
- RelativePath=".\rule.c">
- </File>
- <File
- RelativePath=".\signame.c">
- </File>
- <File
- RelativePath=".\variable.c">
- </File>
- <File
- RelativePath=".\version.c">
- </File>
- <File
- RelativePath=".\vpath.c">
- </File>
- <Filter
- Name="w32"
- Filter="">
- <File
- RelativePath=".\w32\compat\dirent.c">
- </File>
- <File
- RelativePath=".\w32\compat\posixfcn.c">
- </File>
- <File
- RelativePath=".\w32\subproc\misc.c">
- <FileConfiguration
- Name="Debug|Win32">
- <Tool
- Name="VCCLCompilerTool"
- ObjectFile="$(IntDir)/$(InputName)1.obj"/>
- </FileConfiguration>
- <FileConfiguration
- Name="Release|Win32">
- <Tool
- Name="VCCLCompilerTool"
- ObjectFile="$(IntDir)/$(InputName)1.obj"/>
- </FileConfiguration>
- </File>
- <File
- RelativePath=".\w32\pathstuff.c">
- </File>
- <File
- RelativePath=".\w32\subproc\sub_proc.c">
- </File>
- <File
- RelativePath=".\w32\subproc\w32err.c">
- </File>
- </Filter>
- <Filter
- Name="glob"
- Filter="">
- <File
- RelativePath=".\glob\fnmatch.c">
- </File>
- <File
- RelativePath=".\glob\glob.c">
- </File>
- </Filter>
- </Filter>
- <Filter
- Name="include"
- Filter="h;hpp;hxx;hm;inl;inc;xsd"
- UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
- <File
- RelativePath=".\commands.h">
- </File>
- <File
- RelativePath=".\config.h">
- </File>
- <File
- RelativePath=".\debug.h">
- </File>
- <File
- RelativePath=".\dep.h">
- </File>
- <File
- RelativePath=".\filedef.h">
- </File>
- <File
- RelativePath=".\getopt.h">
- </File>
- <File
- RelativePath=".\gettext.h">
- </File>
- <File
- RelativePath=".\gmk-default.h">
- </File>
- <File
- RelativePath=".\hash.h">
- </File>
- <File
- RelativePath=".\job.h">
- </File>
- <File
- RelativePath=".\output.h">
- </File>
- <File
- RelativePath=".\makeint.h">
- </File>
- <File
- RelativePath=".\rule.h">
- </File>
- <File
- RelativePath=".\variable.h">
- </File>
- <File
- RelativePath=".\vmsdir.h">
- </File>
- <Filter
- Name="w32"
- Filter="">
- <File
- RelativePath=".\w32\include\dirent.h">
- </File>
- <File
- RelativePath=".\w32\include\pathstuff.h">
- </File>
- <File
- RelativePath=".\w32\subproc\proc.h">
- </File>
- <File
- RelativePath=".\w32\include\sub_proc.h">
- </File>
- <File
- RelativePath=".\w32\include\w32err.h">
- </File>
- </Filter>
- <Filter
- Name="glob"
- Filter="">
- <File
- RelativePath=".\glob\fnmatch.h">
- </File>
- <File
- RelativePath=".\glob\glob.h">
- </File>
- </Filter>
- </Filter>
- </Files>
- <Globals>
- </Globals>
-</VisualStudioProject>
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="7.10"
+ Name="make_msvc.net2003"
+ ProjectGUID="{E96B5060-3240-4723-91C9-E64F1C877A04}"
+ Keyword="Win32Proj">
+ <Platforms>
+ <Platform
+ Name="Win32"/>
+ </Platforms>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="Debug"
+ IntermediateDirectory="Debug"
+ ConfigurationType="1"
+ CharacterSet="2">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories=".;w32/include;glob"
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_H=1;WINDOWS32=1"
+ MinimalRebuild="TRUE"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="1"
+ ForceConformanceInForLoopScope="TRUE"
+ UsePrecompiledHeader="0"
+ WarningLevel="4"
+ SuppressStartupBanner="TRUE"
+ Detect64BitPortabilityProblems="FALSE"
+ DebugInformationFormat="4"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile="$(OutDir)/make_msvc.net2003.exe"
+ LinkIncremental="2"
+ GenerateDebugInformation="TRUE"
+ ProgramDatabaseFile="$(OutDir)/make_msvc.net2003.pdb"
+ SubSystem="1"
+ TargetMachine="1"/>
+ <Tool
+ Name="VCMIDLTool"/>
+ <Tool
+ Name="VCPostBuildEventTool"/>
+ <Tool
+ Name="VCPreBuildEventTool"
+ Description="Copying config.h.W32 to config.h"
+ CommandLine="if not exist config.h copy config.h.W32 config.h"/>
+ <Tool
+ Name="VCPreLinkEventTool"/>
+ <Tool
+ Name="VCResourceCompilerTool"/>
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"/>
+ <Tool
+ Name="VCXMLDataGeneratorTool"/>
+ <Tool
+ Name="VCWebDeploymentTool"/>
+ <Tool
+ Name="VCManagedWrapperGeneratorTool"/>
+ <Tool
+ Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="Release"
+ IntermediateDirectory="Release"
+ ConfigurationType="1"
+ CharacterSet="2">
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=".;w32/include;glob"
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;HAVE_CONFIG_H=1;WINDOWS32=1"
+ RuntimeLibrary="0"
+ ForceConformanceInForLoopScope="TRUE"
+ UsePrecompiledHeader="0"
+ WarningLevel="4"
+ Detect64BitPortabilityProblems="FALSE"
+ DebugInformationFormat="3"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile="$(OutDir)/make_msvc.net2003.exe"
+ LinkIncremental="1"
+ GenerateDebugInformation="TRUE"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"/>
+ <Tool
+ Name="VCMIDLTool"/>
+ <Tool
+ Name="VCPostBuildEventTool"/>
+ <Tool
+ Name="VCPreBuildEventTool"
+ Description="Copying config.h.W32 to config.h"
+ CommandLine="if not exist config.h copy config.h.W32 config.h"/>
+ <Tool
+ Name="VCPreLinkEventTool"/>
+ <Tool
+ Name="VCResourceCompilerTool"/>
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"/>
+ <Tool
+ Name="VCXMLDataGeneratorTool"/>
+ <Tool
+ Name="VCWebDeploymentTool"/>
+ <Tool
+ Name="VCManagedWrapperGeneratorTool"/>
+ <Tool
+ Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="src"
+ Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
+ UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
+ <File
+ RelativePath=".\ar.c">
+ </File>
+ <File
+ RelativePath=".\arscan.c">
+ </File>
+ <File
+ RelativePath=".\commands.c">
+ </File>
+ <File
+ RelativePath=".\default.c">
+ </File>
+ <File
+ RelativePath=".\dir.c">
+ </File>
+ <File
+ RelativePath=".\expand.c">
+ </File>
+ <File
+ RelativePath=".\file.c">
+ </File>
+ <File
+ RelativePath=".\function.c">
+ </File>
+ <File
+ RelativePath=".\getloadavg.c">
+ </File>
+ <File
+ RelativePath=".\getopt.c">
+ </File>
+ <File
+ RelativePath=".\getopt1.c">
+ </File>
+
+ <File
+ RelativePath=".\guile.c">
+ </File>
+
+ <File
+ RelativePath=".\hash.c">
+ </File>
+ <File
+ RelativePath=".\strcache.c">
+ </File>
+ <File
+ RelativePath=".\implicit.c">
+ </File>
+ <File
+ RelativePath=".\job.c">
+ </File>
+ <File
+ RelativePath=".\load.c">
+ </File>
+ <File
+ RelativePath=".\output.c">
+ </File>
+ <File
+ RelativePath=".\main.c">
+ </File>
+ <File
+ RelativePath=".\misc.c">
+ </File>
+ <File
+ RelativePath=".\read.c">
+ </File>
+ <File
+ RelativePath=".\remake.c">
+ </File>
+ <File
+ RelativePath=".\remote-stub.c">
+ </File>
+ <File
+ RelativePath=".\rule.c">
+ </File>
+ <File
+ RelativePath=".\signame.c">
+ </File>
+ <File
+ RelativePath=".\variable.c">
+ </File>
+ <File
+ RelativePath=".\version.c">
+ </File>
+ <File
+ RelativePath=".\vpath.c">
+ </File>
+ <Filter
+ Name="w32"
+ Filter="">
+ <File
+ RelativePath=".\w32\compat\dirent.c">
+ </File>
+ <File
+ RelativePath=".\w32\compat\posixfcn.c">
+ </File>
+ <File
+ RelativePath=".\w32\subproc\misc.c">
+ <FileConfiguration
+ Name="Debug|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ ObjectFile="$(IntDir)/$(InputName)1.obj"/>
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ ObjectFile="$(IntDir)/$(InputName)1.obj"/>
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath=".\w32\pathstuff.c">
+ </File>
+ <File
+ RelativePath=".\w32\w32os.c">
+ </File>
+ <File
+ RelativePath=".\w32\subproc\sub_proc.c">
+ </File>
+ <File
+ RelativePath=".\w32\subproc\w32err.c">
+ </File>
+ </Filter>
+ <Filter
+ Name="glob"
+ Filter="">
+ <File
+ RelativePath=".\glob\fnmatch.c">
+ </File>
+ <File
+ RelativePath=".\glob\glob.c">
+ </File>
+ </Filter>
+ </Filter>
+ <Filter
+ Name="include"
+ Filter="h;hpp;hxx;hm;inl;inc;xsd"
+ UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
+ <File
+ RelativePath=".\commands.h">
+ </File>
+ <File
+ RelativePath=".\config.h">
+ </File>
+ <File
+ RelativePath=".\debug.h">
+ </File>
+ <File
+ RelativePath=".\dep.h">
+ </File>
+ <File
+ RelativePath=".\filedef.h">
+ </File>
+ <File
+ RelativePath=".\getopt.h">
+ </File>
+ <File
+ RelativePath=".\gettext.h">
+ </File>
+ <File
+ RelativePath=".\gmk-default.h">
+ </File>
+ <File
+ RelativePath=".\hash.h">
+ </File>
+ <File
+ RelativePath=".\job.h">
+ </File>
+ <File
+ RelativePath=".\output.h">
+ </File>
+ <File
+ RelativePath=".\makeint.h">
+ </File>
+ <File
+ RelativePath=".\rule.h">
+ </File>
+ <File
+ RelativePath=".\variable.h">
+ </File>
+ <File
+ RelativePath=".\vmsdir.h">
+ </File>
+ <Filter
+ Name="w32"
+ Filter="">
+ <File
+ RelativePath=".\w32\include\dirent.h">
+ </File>
+ <File
+ RelativePath=".\w32\include\pathstuff.h">
+ </File>
+ <File
+ RelativePath=".\w32\subproc\proc.h">
+ </File>
+ <File
+ RelativePath=".\w32\include\sub_proc.h">
+ </File>
+ <File
+ RelativePath=".\w32\include\w32err.h">
+ </File>
+ </Filter>
+ <Filter
+ Name="glob"
+ Filter="">
+ <File
+ RelativePath=".\glob\fnmatch.h">
+ </File>
+ <File
+ RelativePath=".\glob\glob.h">
+ </File>
+ </Filter>
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/makefile.com b/makefile.com
index fe37c05d..f5796954 100644
--- a/makefile.com
+++ b/makefile.com
@@ -74,8 +74,9 @@ $ endif
$ filelist = "alloca ar arscan commands default dir expand file function " + -
"guile hash implicit job load main misc read remake " + -
"remote-stub rule output signame variable version " + -
- "vmsfunctions vmsify vpath " + -
- "[.glob]glob [.glob]fnmatch getopt1 getopt strcache"
+ "vmsfunctions vmsify vpath vms_progname vms_exit " + -
+ "vms_export_symbol [.glob]glob [.glob]fnmatch getopt1 " + -
+ "getopt strcache"
$!
$ copy config.h-vms config.h
$ n=0
@@ -131,6 +132,7 @@ $!-----------------------------------------------------------------------------
$!
$ compileit : subroutine
$ ploc = f$locate("]",p1)
+$! filnam = p1
$ if ploc .lt. f$length(p1)
$ then
$ objdir = f$extract(0, ploc+1, p1)
@@ -139,14 +141,15 @@ $ else
$ objdir := []
$ write optf objdir+p1
$ endif
-$ cc'ccopt'/include=([],[.glob])/obj='objdir' -
- /define=("allocated_variable_expand_for_file=alloc_var_expand_for_file","unlink=remove","HAVE_CONFIG_H","VMS") -
+$ cc'ccopt'/nested=none/include=([],[.glob])/obj='objdir' -
+ /define=("allocated_variable_expand_for_file=alloc_var_expand_for_file",-
+ "unlink=remove","HAVE_CONFIG_H","VMS") -
'p1'
$ exit
$ endsubroutine : compileit
$!
$!-----------------------------------------------------------------------------
-$!Copyright (C) 1996-2014 Free Software Foundation, Inc.
+$!Copyright (C) 1996-2016 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
diff --git a/makefile.vms b/makefile.vms
index ad5ded7f..37702d5c 100644
--- a/makefile.vms
+++ b/makefile.vms
@@ -1,6 +1,6 @@
# -*-Makefile-*- to build GNU make on VMS
#
-# Copyright (C) 1996-2014 Free Software Foundation, Inc.
+# Copyright (C) 1996-2016 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
@@ -32,9 +32,12 @@ CP = copy
#
ifeq ($(CC),cc)
-CFLAGS = $(defines) /include=([],[.glob])/prefix=(all,except=(glob,globfree))/standard=relaxed/warn=(disable=questcompare)
+cinclude = /nested=none/include=([],[.glob])
+cprefix = /prefix=(all,except=(glob,globfree))
+cwarn = /standard=relaxed/warn=(disable=questcompare)
+CFLAGS = $(defines) $(cinclude)$(cprefix)$(cwarn)
else
-CFLAGS = $(defines) /include=([],[.glob])
+CFLAGS = $(defines) $(cinclude)
endif
#LDFLAGS = /deb
LDFLAGS =
@@ -93,13 +96,14 @@ guile = ,guile.obj
objs = commands.obj,job.obj,output.obj,dir.obj,file.obj,misc.obj,hash.obj,\
load.obj,main.obj,read.obj,remake.obj,rule.obj,implicit.obj,\
default.obj,variable.obj,expand.obj,function.obj,strcache.obj,\
- vpath.obj,version.obj$(guile)\
- $(ARCHIVES)$(ALLOCA)$(extras)$(getopt)$(glob)
+ vpath.obj,version.obj,vms_progname.obj,vms_exit.obj,\
+ vms_export_symbol.obj$(guile)$(ARCHIVES)$(extras)$(getopt)$(glob)
srcs = commands.c job.c output.c dir.c file.c misc.c guile.c hash.c \
load.c main.c read.c remake.c rule.c implicit.c \
default.c variable.c expand.c function.c strcache.c \
- vpath.c version.c vmsfunctions.c vmsify.c $(ARCHIVES_SRC) $(ALLOCASRC) \
+ vpath.c version.c vmsfunctions.c vmsify.c vms_progname.c vms_exit.c \
+ vms_export_symbol.c $(ARCHIVES_SRC) $(ALLOCASRC) \
commands.h dep.h filedef.h job.h output.h makeint.h rule.h variable.h
@@ -168,6 +172,9 @@ vmsfunctions.obj: vmsfunctions.c makeint.h config.h gnumake.h gettext.h \
vmsify.obj: vmsify.c
vpath.obj: vpath.c makeint.h config.h gnumake.h gettext.h filedef.h hash.h \
variable.h
+vms_progname.obj: vms_progname.c
+vms_exit.obj: vms_exit.c
+vms_export_symbol.obj: vms_export_symbol.c
config.h: config.h-vms
$(CP) $< $@
diff --git a/makeint.h b/makeint.h
index fdcae75b..8f718ebf 100644
--- a/makeint.h
+++ b/makeint.h
@@ -1,5 +1,5 @@
/* Miscellaneous global declarations and portability cruft for GNU Make.
-Copyright (C) 1988-2014 Free Software Foundation, Inc.
+Copyright (C) 1988-2016 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
@@ -95,8 +95,13 @@ char *alloca ();
extern int errno;
#endif
-#ifndef isblank
-# define isblank(c) ((c) == ' ' || (c) == '\t')
+#ifdef __VMS
+/* In strict ANSI mode, VMS compilers should not be defining the
+ VMS macro. Define it here instead of a bulk edit for the correct code.
+ */
+# ifndef VMS
+# define VMS
+# endif
#endif
#ifdef HAVE_UNISTD_H
@@ -129,6 +134,10 @@ extern int errno;
# define SA_RESTART 0
#endif
+#ifdef HAVE_VFORK_H
+# include <vfork.h>
+#endif
+
#ifdef HAVE_LIMITS_H
# include <limits.h>
#endif
@@ -201,6 +210,13 @@ unsigned int get_path_max (void);
# include <perror.h>
/* Needed to use alloca on VMS. */
# include <builtins.h>
+
+extern int vms_use_mcr_command;
+extern int vms_always_use_cmd_file;
+extern int vms_gnv_shell;
+extern int vms_comma_separator;
+extern int vms_legacy_behavior;
+extern int vms_unix_simulation;
#endif
#ifndef __attribute__
@@ -325,21 +341,6 @@ char *strsignal (int signum);
#define N_(msgid) gettext_noop (msgid)
#define S_(msg1,msg2,num) ngettext (msg1,msg2,num)
-/* Handle other OSs.
- To overcome an issue parsing paths in a DOS/Windows environment when
- built in a unix based environment, override the PATH_SEPARATOR_CHAR
- definition unless being built for Cygwin. */
-#if defined(HAVE_DOS_PATHS) && !defined(__CYGWIN__)
-# undef PATH_SEPARATOR_CHAR
-# define PATH_SEPARATOR_CHAR ';'
-#elif !defined(PATH_SEPARATOR_CHAR)
-# if defined (VMS)
-# define PATH_SEPARATOR_CHAR ','
-# else
-# define PATH_SEPARATOR_CHAR ':'
-# endif
-#endif
-
/* This is needed for getcwd() and chdir(), on some W32 systems. */
#if defined(HAVE_DIRECT_H)
# include <direct.h>
@@ -375,7 +376,7 @@ extern int unixy_shell;
# endif
/* Include only the minimal stuff from windows.h. */
-#define WIN32_LEAN_AND_MEAN
+# define WIN32_LEAN_AND_MEAN
#endif /* WINDOWS32 */
#define ANY_SET(_v,_m) (((_v)&(_m)) != 0)
@@ -383,7 +384,7 @@ extern int unixy_shell;
#define MAP_NUL 0x0001
#define MAP_BLANK 0x0002
-#define MAP_SPACE 0x0004
+#define MAP_NEWLINE 0x0004
#define MAP_COMMENT 0x0008
#define MAP_SEMI 0x0010
#define MAP_EQUALS 0x0020
@@ -406,7 +407,40 @@ extern int unixy_shell;
# define MAP_VMSCOMMA 0x0000
#endif
-#define STOP_SET(_v,_m) ANY_SET (stopchar_map[(unsigned char)(_v)],(_m))
+#define MAP_SPACE (MAP_BLANK|MAP_NEWLINE)
+
+/* Handle other OSs.
+ To overcome an issue parsing paths in a DOS/Windows environment when
+ built in a unix based environment, override the PATH_SEPARATOR_CHAR
+ definition unless being built for Cygwin. */
+#if defined(HAVE_DOS_PATHS) && !defined(__CYGWIN__)
+# undef PATH_SEPARATOR_CHAR
+# define PATH_SEPARATOR_CHAR ';'
+# define MAP_PATHSEP MAP_SEMI
+#elif !defined(PATH_SEPARATOR_CHAR)
+# if defined (VMS)
+# define PATH_SEPARATOR_CHAR (vms_comma_separator ? ',' : ':')
+# define MAP_PATHSEP (vms_comma_separator ? MAP_COMMA : MAP_SEMI)
+# else
+# define PATH_SEPARATOR_CHAR ':'
+# define MAP_PATHSEP MAP_COLON
+# endif
+#elif PATH_SEPARATOR_CHAR == ':'
+# define MAP_PATHSEP MAP_COLON
+#elif PATH_SEPARATOR_CHAR == ';'
+# define MAP_PATHSEP MAP_SEMI
+#elif PATH_SEPARATOR_CHAR == ','
+# define MAP_PATHSEP MAP_COMMA
+#else
+# error "Unknown PATH_SEPARATOR_CHAR"
+#endif
+
+#define STOP_SET(_v,_m) ANY_SET(stopchar_map[(unsigned char)(_v)],(_m))
+
+#define ISBLANK(c) STOP_SET((c),MAP_BLANK)
+#define ISSPACE(c) STOP_SET((c),MAP_SPACE)
+#define NEXT_TOKEN(s) while (ISSPACE (*(s))) ++(s)
+#define END_OF_TOKEN(s) while (! STOP_SET (*(s), MAP_SPACE|MAP_NUL)) ++(s)
#if defined(HAVE_SYS_RESOURCE_H) && defined(HAVE_GETRLIMIT) && defined(HAVE_SETRLIMIT)
# define SET_STACK_SIZE
@@ -416,7 +450,9 @@ extern int unixy_shell;
extern struct rlimit stack_limit;
#endif
-#define NILF ((gmk_floc *)0)
+#include <glob.h>
+
+#define NILF ((floc *)0)
#define CSTRLEN(_s) (sizeof (_s)-1)
#define STRING_SIZE_TUPLE(_s) (_s), CSTRLEN(_s)
@@ -424,20 +460,30 @@ extern struct rlimit stack_limit;
/* The number of bytes needed to represent the largest integer as a string. */
#define INTSTR_LENGTH CSTRLEN ("18446744073709551616")
+#define DEFAULT_TTYNAME "true"
#ifdef HAVE_TTYNAME
# define TTYNAME(_f) ttyname (_f)
#else
-# define TTYNAME(_f) "true"
+# define TTYNAME(_f) DEFAULT_TTYNAME
#endif
+
+/* Specify the location of elements read from makefiles. */
+typedef struct
+ {
+ const char *filenm;
+ unsigned long lineno;
+ unsigned long offset;
+ } floc;
+
const char *concat (unsigned int, ...);
void message (int prefix, size_t length, const char *fmt, ...)
__attribute__ ((__format__ (__printf__, 3, 4)));
-void error (const gmk_floc *flocp, size_t length, const char *fmt, ...)
+void error (const floc *flocp, size_t length, const char *fmt, ...)
__attribute__ ((__format__ (__printf__, 3, 4)));
-void fatal (const gmk_floc *flocp, size_t length, const char *fmt, ...)
- __attribute__ ((noreturn, __format__ (__printf__, 3, 4)));
+void fatal (const floc *flocp, size_t length, const char *fmt, ...)
+ __attribute__ ((noreturn, __format__ (__printf__, 3, 4)));
#define O(_t,_a,_f) _t((_a), 0, (_f))
#define OS(_t,_a,_f,_s) _t((_a), strlen (_s), (_f), (_s))
@@ -483,7 +529,8 @@ time_t ar_member_date (const char *);
typedef long int (*ar_member_func_t) (int desc, const char *mem, int truncated,
long int hdrpos, long int datapos,
long int size, long int date, int uid,
- int gid, int mode, const void *arg);
+ int gid, unsigned int mode,
+ const void *arg);
long int ar_scan (const char *archive, ar_member_func_t function, const void *arg);
int ar_name_equal (const char *name, const char *mem, int truncated);
@@ -497,6 +544,8 @@ int file_exists_p (const char *);
int file_impossible_p (const char *);
void file_impossible (const char *);
const char *dir_name (const char *);
+void print_dir_data_base (void);
+void dir_setup_glob (glob_t *);
void hash_init_directories (void);
void define_default_variables (void);
@@ -519,20 +568,21 @@ void child_access (void);
char *strip_whitespace (const char **begpp, const char **endpp);
+void show_goal_error (void);
+
/* String caching */
void strcache_init (void);
void strcache_print_stats (const char *prefix);
int strcache_iscached (const char *str);
const char *strcache_add (const char *str);
const char *strcache_add_len (const char *str, unsigned int len);
-int strcache_setbufsize (unsigned int size);
/* Guile support */
-int guile_gmake_setup (const gmk_floc *flocp);
+int guile_gmake_setup (const floc *flocp);
/* Loadable object support. Sets to the strcached name of the loaded file. */
-typedef int (*load_func_t)(const gmk_floc *flocp);
-int load_file (const gmk_floc *flocp, const char **filename, int noerror);
+typedef int (*load_func_t)(const floc *flocp);
+int load_file (const floc *flocp, const char **filename, int noerror);
void unload_file (const char *name);
/* We omit these declarations on non-POSIX systems which define _POSIX_VERSION,
@@ -545,16 +595,16 @@ long int atol ();
long int lseek ();
# endif
-#endif /* Not GNU C library or POSIX. */
-
-#ifdef HAVE_GETCWD
-# if !defined(VMS) && !defined(__DECC)
+# ifdef HAVE_GETCWD
+# if !defined(VMS) && !defined(__DECC)
char *getcwd ();
-# endif
-#else
+# endif
+# else
char *getwd ();
-# define getcwd(buf, len) getwd (buf)
-#endif
+# define getcwd(buf, len) getwd (buf)
+# endif
+
+#endif /* Not GNU C library or POSIX. */
#if !HAVE_STRCASECMP
# if HAVE_STRICMP
@@ -583,11 +633,12 @@ int strncasecmp (const char *s1, const char *s2, int n);
#define OUTPUT_SYNC_TARGET 2
#define OUTPUT_SYNC_RECURSE 3
-extern const gmk_floc *reading_file;
-extern const gmk_floc **expanding_var;
-
+/* Non-GNU systems may not declare this in unistd.h. */
extern char **environ;
+extern const floc *reading_file;
+extern const floc **expanding_var;
+
extern unsigned short stopchar_map[];
extern int just_print_flag, silent_flag, ignore_errors_flag, keep_going_flag;
@@ -598,6 +649,8 @@ extern int warn_undefined_variables_flag, trace_flag, posix_pedantic;
extern int not_parallel, second_expansion, clock_skew_detected;
extern int rebuilding_makefiles, one_shell, output_sync, verify_flag;
+extern const char *default_shell;
+
/* can we run commands via 'sh -c xxx' or must we use batch files? */
extern int batch_mode_shell;
@@ -607,8 +660,6 @@ extern int batch_mode_shell;
extern char cmd_prefix;
extern unsigned int job_slots;
-extern int job_fds[2];
-extern int job_rfd;
#ifndef NO_FLOAT
extern double max_load_average;
#else
@@ -622,10 +673,46 @@ extern const char *program;
#endif
#ifdef VMS
-const char *vms_command(const char *argv0);
-const char *vms_progname(const char *argv0);
+const char *vms_command (const char *argv0);
+const char *vms_progname (const char *argv0);
+
+void vms_exit (int);
+# define _exit(foo) vms_exit(foo)
+# define exit(foo) vms_exit(foo)
+
+extern char *program_name;
+
+void
+set_program_name (const char *arv0);
+
+int
+need_vms_symbol (void);
+
+int
+create_foreign_command (const char *command, const char *image);
+
+int
+vms_export_dcl_symbol (const char *name, const char *value);
+
+int
+vms_putenv_symbol (const char *string);
+
+void
+vms_restore_symbol (const char *string);
+
#endif
+void remote_setup (void);
+void remote_cleanup (void);
+int start_remote_job_p (int);
+int start_remote_job (char **, char **, int, int *, int *, int *);
+int remote_status (int *, int *, int *, int);
+void block_remote_children (void);
+void unblock_remote_children (void);
+int remote_kill (int id, int sig);
+void print_variable_data_base (void);
+void print_vpath_data_base (void);
+
extern char *starting_directory;
extern unsigned int makelevel;
extern char *version_string, *remote_description, *make_host;
@@ -643,18 +730,9 @@ extern int handling_fatal_signal;
#endif
-#ifdef VMS
-/* These are the VMS __posix_exit compliant exit codes, constructed out of
- STS$M_INHIB_MSG, C facility code, a POSIX condition code mask, MAKE_NNN<<3 and
- the coresponding VMS severity, here STS$K_SUCCESS and STS$K_ERROR. */
-# define MAKE_SUCCESS 0x1035a001
-# define MAKE_TROUBLE 0x1035a00a
-# define MAKE_FAILURE 0x1035a012
-#else
-# define MAKE_SUCCESS 0
-# define MAKE_TROUBLE 1
-# define MAKE_FAILURE 2
-#endif
+#define MAKE_SUCCESS 0
+#define MAKE_TROUBLE 1
+#define MAKE_FAILURE 2
/* Set up heap debugging library dmalloc. */
diff --git a/misc.c b/misc.c
index 00a3210a..e7ab8092 100644
--- a/misc.c
+++ b/misc.c
@@ -1,5 +1,5 @@
/* Miscellaneous generic support functions for GNU Make.
-Copyright (C) 1988-2014 Free Software Foundation, Inc.
+Copyright (C) 1988-2016 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
@@ -91,12 +91,13 @@ collapse_continuations (char *line)
{
/* Backslash/newline handling:
In traditional GNU make all trailing whitespace, consecutive
- backslash/newlines, and any leading whitespace on the next line
- is reduced to a single space.
+ backslash/newlines, and any leading non-newline whitespace on the
+ next line is reduced to a single space.
In POSIX, each backslash/newline and is replaced by a space. */
- in = next_token (in);
+ while (ISBLANK (*in))
+ ++in;
if (! posix_pedantic)
- while (out > line && isblank ((unsigned char)out[-1]))
+ while (out > line && ISBLANK (out[-1]))
--out;
*out++ = ' ';
}
@@ -314,8 +315,7 @@ lindex (const char *s, const char *limit, int c)
char *
end_of_token (const char *s)
{
- while (! STOP_SET (*s, MAP_BLANK|MAP_NUL))
- ++s;
+ END_OF_TOKEN (s);
return (char *)s;
}
@@ -324,8 +324,7 @@ end_of_token (const char *s)
char *
next_token (const char *s)
{
- while (isblank ((unsigned char)*s))
- ++s;
+ NEXT_TOKEN (s);
return (char *)s;
}
@@ -377,19 +376,6 @@ copy_dep_chain (const struct dep *d)
return firstnew;
}
-/* Free a chain of 'struct dep'. */
-
-void
-free_dep_chain (struct dep *d)
-{
- while (d != 0)
- {
- struct dep *df = d;
- d = d->next;
- free_dep (df);
- }
-}
-
/* Free a chain of struct nameseq.
For struct dep chains use free_dep_chain. */
@@ -400,7 +386,7 @@ free_ns_chain (struct nameseq *ns)
{
struct nameseq *t = ns;
ns = ns->next;
- free (t);
+ free_ns (t);
}
}
diff --git a/os.h b/os.h
new file mode 100644
index 00000000..c1a19e1b
--- /dev/null
+++ b/os.h
@@ -0,0 +1,84 @@
+/* Declarations for operating system interfaces for GNU Make.
+Copyright (C) 2016 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
+terms of the GNU General Public License as published by the Free Software
+Foundation; either version 3 of the License, or (at your option) any later
+version.
+
+GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License along with
+this program. If not, see <http://www.gnu.org/licenses/>. */
+
+
+/* This section provides OS-specific functions to support the jobserver. */
+
+#ifdef MAKE_JOBSERVER
+
+/* Returns 1 if the jobserver is enabled, else 0. */
+unsigned int jobserver_enabled (void);
+
+/* Called in the master instance to set up the jobserver initially. */
+unsigned int jobserver_setup (int job_slots);
+
+/* Called in a child instance to connect to the jobserver. */
+unsigned int jobserver_parse_auth (const char* auth);
+
+/* Returns an allocated buffer used to pass to child instances. */
+char *jobserver_get_auth (void);
+
+/* Clear this instance's jobserver configuration. */
+void jobserver_clear (void);
+
+/* Recover all the jobserver tokens and return the number we got. */
+unsigned int jobserver_acquire_all (void);
+
+/* Release a jobserver token. If it fails and is_fatal is 1, fatal. */
+void jobserver_release (int is_fatal);
+
+/* Notify the jobserver that a child exited. */
+void jobserver_signal (void);
+
+/* Get ready to start a non-recursive child. */
+void jobserver_pre_child (int);
+
+/* Complete starting a non-recursive child. */
+void jobserver_post_child (int);
+
+/* Set up to acquire a new token. */
+void jobserver_pre_acquire (void);
+
+/* Wait until we can acquire a jobserver token.
+ TIMEOUT is 1 if we have other jobs waiting for the load to go down;
+ in this case we won't wait forever, so we can check the load.
+ Returns 1 if we got a token, or 0 if we stopped waiting due to a child
+ exiting or a timeout. */
+unsigned int jobserver_acquire (int timeout);
+
+#else
+
+#define jobserver_enabled() (0)
+#define jobserver_setup(_slots) (0)
+#define jobserver_parse_auth(_auth) (0)
+#define jobserver_get_auth() (NULL)
+#define jobserver_clear() (void)(0)
+#define jobserver_release(_fatal) (void)(0)
+#define jobserver_acquire_all() (0)
+#define jobserver_signal() (void)(0)
+#define jobserver_pre_child(_r) (void)(0)
+#define jobserver_post_child(_r) (void)(0)
+#define jobserver_pre_acquire() (void)(0)
+#define jobserver_acquire(_tmout) (0)
+
+#endif
+
+/* Create a "bad" file descriptor for stdin when parallel jobs are run. */
+#if !defined(VMD) && !defined(WINDOWS32) && !defined(_AMIGA) && !defined(__MSDOS__)
+int get_bad_stdin (void);
+#else
+# define get_bad_stdin() (-1)
+#endif
diff --git a/output.c b/output.c
index e537f3a6..65182c4b 100644
--- a/output.c
+++ b/output.c
@@ -1,5 +1,5 @@
/* Output to stdout / stderr for GNU make
-Copyright (C) 2013-2014 Free Software Foundation, Inc.
+Copyright (C) 2013-2016 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
@@ -46,7 +46,7 @@ unsigned int stdio_traced = 0;
#define OUTPUT_ISSET(_out) ((_out)->out >= 0 || (_out)->err >= 0)
-#ifdef HAVE_FCNTL
+#ifdef HAVE_FCNTL_H
# define STREAM_OK(_s) ((fcntl (fileno (_s), F_GETFD) != -1) || (errno != EBADF))
#else
# define STREAM_OK(_s) 1
@@ -174,7 +174,7 @@ static sync_handle_t sync_handle = -1;
/* Set up the sync handle. Disables output_sync on error. */
static int
-sync_init ()
+sync_init (void)
{
int combined_output = 0;
@@ -283,7 +283,7 @@ release_semaphore (void *sem)
/* Returns a file descriptor to a temporary file. The file is automatically
closed/deleted on exit. Don't use a FILE* stream. */
int
-output_tmpfd ()
+output_tmpfd (void)
{
int fd = -1;
FILE *tfile = tmpfile ();
@@ -344,7 +344,7 @@ setup_tmpfile (struct output *out)
/* If we failed to create a temp file, disable output sync going forward. */
error:
output_close (out);
- output_sync = 0;
+ output_sync = OUTPUT_SYNC_NONE;
}
/* Synchronize the output of jobs in -j mode to keep the results of
@@ -441,7 +441,7 @@ output_tmpfile (char **name, const char *template)
# ifdef HAVE_FDOPEN
/* Can't use mkstemp(), but guard against a race condition. */
- fd = open (*name, O_CREAT|O_EXCL|O_WRONLY, 0600);
+ EINTRLOOP (fd, open (*name, O_CREAT|O_EXCL|O_WRONLY, 0600));
if (fd == -1)
return 0;
return fdopen (fd, "w");
@@ -558,7 +558,7 @@ output_close (struct output *out)
/* We're about to generate output: be sure it's set up. */
void
-output_start ()
+output_start (void)
{
#ifndef NO_OUTPUT_SYNC
/* If we're syncing output make sure the temporary file is set up. */
@@ -640,7 +640,7 @@ message (int prefix, size_t len, const char *fmt, ...)
/* Print an error message. */
void
-error (const gmk_floc *flocp, size_t len, const char *fmt, ...)
+error (const floc *flocp, size_t len, const char *fmt, ...)
{
va_list args;
char *p;
@@ -651,7 +651,7 @@ error (const gmk_floc *flocp, size_t len, const char *fmt, ...)
p = get_buffer (len);
if (flocp && flocp->filenm)
- sprintf (p, "%s:%lu: ", flocp->filenm, flocp->lineno);
+ sprintf (p, "%s:%lu: ", flocp->filenm, flocp->lineno + flocp->offset);
else if (makelevel == 0)
sprintf (p, "%s: ", program);
else
@@ -671,7 +671,7 @@ error (const gmk_floc *flocp, size_t len, const char *fmt, ...)
/* Print an error message and exit. */
void
-fatal (const gmk_floc *flocp, size_t len, const char *fmt, ...)
+fatal (const floc *flocp, size_t len, const char *fmt, ...)
{
va_list args;
const char *stop = _(". Stop.\n");
@@ -683,7 +683,7 @@ fatal (const gmk_floc *flocp, size_t len, const char *fmt, ...)
p = get_buffer (len);
if (flocp && flocp->filenm)
- sprintf (p, "%s:%lu: *** ", flocp->filenm, flocp->lineno);
+ sprintf (p, "%s:%lu: *** ", flocp->filenm, flocp->lineno + flocp->offset);
else if (makelevel == 0)
sprintf (p, "%s: *** ", program);
else
diff --git a/output.h b/output.h
index 7c5332cf..f4fe0653 100644
--- a/output.h
+++ b/output.h
@@ -1,5 +1,5 @@
/* Output to stdout / stderr for GNU make
-Copyright (C) 2013-2014 Free Software Foundation, Inc.
+Copyright (C) 2013-2016 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
diff --git a/po/.gitignore b/po/.gitignore
new file mode 100644
index 00000000..d7261f59
--- /dev/null
+++ b/po/.gitignore
@@ -0,0 +1,15 @@
+Makefile.in.in
+Makevars.template
+POTFILES
+Rules-quot
+boldquot.sed
+en@boldquot.header
+en@quot.header
+insert-header.sin
+make.pot
+quot.sed
+remove-potcdate.sin
+remove-potcdate.sed
+stamp-po
+*.gmo
+*.po
diff --git a/po/Makevars b/po/Makevars
index b69192ee..ee018843 100644
--- a/po/Makevars
+++ b/po/Makevars
@@ -1,5 +1,5 @@
# This is a -*-Makefile-*-
-# Copyright (C) 2002-2014 Free Software Foundation, Inc.
+# Copyright (C) 2002-2016 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
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 4287c5de..061ff2b9 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -1,5 +1,5 @@
# List of source files containing translatable strings.
-# Copyright (C) 2000-2014 Free Software Foundation, Inc.
+# Copyright (C) 2000-2016 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
@@ -32,6 +32,7 @@ load.c
main.c
misc.c
output.c
+posixos.c
read.c
remake.c
remote-cstms.c
@@ -43,3 +44,4 @@ variable.h
vmsfunctions.c
vmsjobs.c
vpath.c
+w32/w32os.c
diff --git a/posixos.c b/posixos.c
new file mode 100644
index 00000000..4a787e4d
--- /dev/null
+++ b/posixos.c
@@ -0,0 +1,431 @@
+/* POSIX-based operating system interface for GNU Make.
+Copyright (C) 2016 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
+terms of the GNU General Public License as published by the Free Software
+Foundation; either version 3 of the License, or (at your option) any later
+version.
+
+GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License along with
+this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#include "makeint.h"
+
+#include <stdio.h>
+
+#ifdef HAVE_FCNTL_H
+# include <fcntl.h>
+#endif
+#if defined(HAVE_PSELECT) && defined(HAVE_SYS_SELECT_H)
+# include <sys/select.h>
+#endif
+
+#include "debug.h"
+#include "job.h"
+#include "os.h"
+
+#ifdef MAKE_JOBSERVER
+
+/* This section provides OS-specific functions to support the jobserver. */
+
+/* These track the state of the jobserver pipe. Passed to child instances. */
+static int job_fds[2] = { -1, -1 };
+
+/* Used to signal read() that a SIGCHLD happened. Always CLOEXEC.
+ If we use pselect() this will never be created and always -1.
+ */
+static int job_rfd = -1;
+
+/* Token written to the pipe (could be any character...) */
+static char token = '+';
+
+static int
+make_job_rfd (void)
+{
+#ifdef HAVE_PSELECT
+ /* Pretend we succeeded. */
+ return 0;
+#else
+ EINTRLOOP (job_rfd, dup (job_fds[0]));
+ if (job_rfd >= 0)
+ CLOSE_ON_EXEC (job_rfd);
+
+ return job_rfd;
+#endif
+}
+
+unsigned int
+jobserver_setup (int slots)
+{
+ int r;
+
+ EINTRLOOP (r, pipe (job_fds));
+ if (r < 0)
+ pfatal_with_name (_("creating jobs pipe"));
+
+ if (make_job_rfd () < 0)
+ pfatal_with_name (_("duping jobs pipe"));
+
+ while (slots--)
+ {
+ EINTRLOOP (r, write (job_fds[1], &token, 1));
+ if (r != 1)
+ pfatal_with_name (_("init jobserver pipe"));
+ }
+
+ return 1;
+}
+
+unsigned int
+jobserver_parse_auth (const char *auth)
+{
+ /* Given the command-line parameter, parse it. */
+ if (sscanf (auth, "%d,%d", &job_fds[0], &job_fds[1]) != 2)
+ OS (fatal, NILF,
+ _("internal error: invalid --jobserver-auth string '%s'"), auth);
+
+ DB (DB_JOBS,
+ (_("Jobserver client (fds %d,%d)\n"), job_fds[0], job_fds[1]));
+
+#ifdef HAVE_FCNTL_H
+# define FD_OK(_f) (fcntl ((_f), F_GETFD) != -1)
+#else
+# define FD_OK(_f) 1
+#endif
+
+ /* Make sure our pipeline is valid, and (possibly) 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, warn and default to -j1. */
+
+ if (!FD_OK (job_fds[0]) || !FD_OK (job_fds[1]) || make_job_rfd () < 0)
+ {
+ if (errno != EBADF)
+ pfatal_with_name (_("jobserver pipeline"));
+
+ job_fds[0] = job_fds[1] = -1;
+
+ return 0;
+ }
+
+ return 1;
+}
+
+char *
+jobserver_get_auth (void)
+{
+ char *auth = xmalloc ((INTSTR_LENGTH * 2) + 2);
+ sprintf (auth, "%d,%d", job_fds[0], job_fds[1]);
+ return auth;
+}
+
+unsigned int
+jobserver_enabled (void)
+{
+ return job_fds[0] >= 0;
+}
+
+void
+jobserver_clear (void)
+{
+ if (job_fds[0] >= 0)
+ close (job_fds[0]);
+ if (job_fds[1] >= 0)
+ close (job_fds[1]);
+ if (job_rfd >= 0)
+ close (job_rfd);
+
+ job_fds[0] = job_fds[1] = job_rfd = -1;
+}
+
+void
+jobserver_release (int is_fatal)
+{
+ int r;
+ EINTRLOOP (r, write (job_fds[1], &token, 1));
+ if (r != 1)
+ {
+ if (is_fatal)
+ pfatal_with_name (_("write jobserver"));
+ perror_with_name ("write", "");
+ }
+}
+
+unsigned int
+jobserver_acquire_all (void)
+{
+ unsigned int tokens = 0;
+
+ /* Close the write side, so the read() won't hang. */
+ close (job_fds[1]);
+ job_fds[1] = -1;
+
+ while (1)
+ {
+ char intake;
+ int r;
+ EINTRLOOP (r, read (job_fds[0], &intake, 1));
+ if (r != 1)
+ return tokens;
+ ++tokens;
+ }
+}
+
+/* Prepare the jobserver to start a child process. */
+void
+jobserver_pre_child (int recursive)
+{
+ /* If it's not a recursive make, avoid polutting the jobserver pipes. */
+ if (!recursive && job_fds[0] >= 0)
+ {
+ CLOSE_ON_EXEC (job_fds[0]);
+ CLOSE_ON_EXEC (job_fds[1]);
+ }
+}
+
+void
+jobserver_post_child (int recursive)
+{
+#if defined(F_GETFD) && defined(F_SETFD)
+ if (!recursive && job_fds[0] >= 0)
+ {
+ unsigned int i;
+ for (i = 0; i < 2; ++i)
+ {
+ int flags;
+ EINTRLOOP (flags, fcntl (job_fds[i], F_GETFD));
+ if (flags >= 0)
+ {
+ int r;
+ EINTRLOOP (r, fcntl (job_fds[i], F_SETFD, flags & ~FD_CLOEXEC));
+ }
+ }
+ }
+#endif
+}
+
+void
+jobserver_signal (void)
+{
+ if (job_rfd >= 0)
+ {
+ close (job_rfd);
+ job_rfd = -1;
+ }
+}
+
+void
+jobserver_pre_acquire (void)
+{
+ /* Make sure we have a dup'd FD. */
+ if (job_rfd < 0 && job_fds[0] >= 0 && make_job_rfd () < 0)
+ pfatal_with_name (_("duping jobs pipe"));
+}
+
+#ifdef HAVE_PSELECT
+
+/* Use pselect() to atomically wait for both a signal and a file descriptor.
+ It also provides a timeout facility so we don't need to use SIGALRM.
+
+ This method relies on the fact that SIGCHLD will be blocked everywhere,
+ and only unblocked (atomically) within the pselect() call, so we can
+ never miss a SIGCHLD.
+ */
+unsigned int
+jobserver_acquire (int timeout)
+{
+ sigset_t empty;
+ fd_set readfds;
+ struct timespec spec;
+ struct timespec *specp = NULL;
+ int r;
+ char intake;
+
+ sigemptyset (&empty);
+
+ FD_ZERO (&readfds);
+ FD_SET (job_fds[0], &readfds);
+
+ if (timeout)
+ {
+ /* Alarm after one second (is this too granular?) */
+ spec.tv_sec = 1;
+ spec.tv_nsec = 0;
+ specp = &spec;
+ }
+
+ r = pselect (job_fds[0]+1, &readfds, NULL, NULL, specp, &empty);
+
+ if (r == -1)
+ {
+ /* Better be SIGCHLD. */
+ if (errno != EINTR)
+ pfatal_with_name (_("pselect jobs pipe"));
+ return 0;
+ }
+
+ if (r == 0)
+ /* Timeout. */
+ return 0;
+
+ /* The read FD is ready: read it! */
+ EINTRLOOP (r, read (job_fds[0], &intake, 1));
+ if (r < 0)
+ pfatal_with_name (_("read jobs pipe"));
+
+ /* What does it mean if read() returns 0? It shouldn't happen because only
+ the master make can reap all the tokens and close the write side...?? */
+ return r > 0;
+}
+
+#else
+
+/* This method uses a "traditional" UNIX model for waiting on both a signal
+ and a file descriptor. However, it's complex and since we have a SIGCHLD
+ handler installed we need to check ALL system calls for EINTR: painful!
+
+ Read a token. As long as there's no token available we'll block. We
+ enable interruptible system calls before the read(2) so that if we get a
+ SIGCHLD while we're waiting, we'll return with EINTR and we can process the
+ death(s) and return tokens to the free pool.
+
+ Once we return from the read, we immediately reinstate restartable system
+ calls. This allows us to not worry about checking for EINTR on all the
+ other system calls in the program.
+
+ There is one other twist: there is a span between the time reap_children()
+ does its last check for dead children and the time the read(2) call is
+ entered, below, where if a child dies we won't notice. This is extremely
+ serious as it could cause us to deadlock, given the right set of events.
+
+ To avoid this, we do the following: before we reap_children(), we dup(2)
+ the read FD on the jobserver pipe. The read(2) call below uses that new
+ FD. In the signal handler, we close that FD. That way, if a child dies
+ during the section mentioned above, the read(2) will be invoked with an
+ invalid FD and will return immediately with EBADF. */
+
+static RETSIGTYPE
+job_noop (int sig UNUSED)
+{
+}
+
+/* Set the child handler action flags to FLAGS. */
+static void
+set_child_handler_action_flags (int set_handler, int set_alarm)
+{
+ struct sigaction sa;
+
+#ifdef __EMX__
+ /* The child handler must be turned off here. */
+ signal (SIGCHLD, SIG_DFL);
+#endif
+
+ memset (&sa, '\0', sizeof sa);
+ sa.sa_handler = child_handler;
+ sa.sa_flags = set_handler ? 0 : SA_RESTART;
+
+#if defined SIGCHLD
+ if (sigaction (SIGCHLD, &sa, NULL) < 0)
+ pfatal_with_name ("sigaction: SIGCHLD");
+#endif
+
+#if defined SIGCLD && SIGCLD != SIGCHLD
+ if (sigaction (SIGCLD, &sa, NULL) < 0)
+ pfatal_with_name ("sigaction: SIGCLD");
+#endif
+
+#if defined SIGALRM
+ if (set_alarm)
+ {
+ /* If we're about to enter the read(), set an alarm to wake up in a
+ second so we can check if the load has dropped and we can start more
+ work. On the way out, turn off the alarm and set SIG_DFL. */
+ if (set_handler)
+ {
+ sa.sa_handler = job_noop;
+ sa.sa_flags = 0;
+ if (sigaction (SIGALRM, &sa, NULL) < 0)
+ pfatal_with_name ("sigaction: SIGALRM");
+ alarm (1);
+ }
+ else
+ {
+ alarm (0);
+ sa.sa_handler = SIG_DFL;
+ sa.sa_flags = 0;
+ if (sigaction (SIGALRM, &sa, NULL) < 0)
+ pfatal_with_name ("sigaction: SIGALRM");
+ }
+ }
+#endif
+}
+
+unsigned int
+jobserver_acquire (int timeout)
+{
+ char intake;
+ int got_token;
+ int saved_errno;
+
+ /* Set interruptible system calls, and read() for a job token. */
+ set_child_handler_action_flags (1, timeout);
+
+ EINTRLOOP (got_token, read (job_rfd, &intake, 1));
+ saved_errno = errno;
+
+ set_child_handler_action_flags (0, timeout);
+
+ if (got_token == 1)
+ return 1;
+
+ /* If the error _wasn't_ expected (EINTR or EBADF), fatal. Otherwise,
+ go back and reap_children(), and try again. */
+ errno = saved_errno;
+
+ if (errno != EINTR && errno != EBADF)
+ pfatal_with_name (_("read jobs pipe"));
+
+ if (errno == EBADF)
+ DB (DB_JOBS, ("Read returned EBADF.\n"));
+
+ return 0;
+}
+
+#endif
+
+#endif /* MAKE_JOBSERVER */
+
+/* Create a "bad" file descriptor for stdin when parallel jobs are run. */
+int
+get_bad_stdin (void)
+{
+ static int bad_stdin = -1;
+
+ /* Set up a bad standard input that reads from a broken pipe. */
+
+ if (bad_stdin == -1)
+ {
+ /* Make a file descriptor that is the read end of a broken pipe.
+ This will be used for some children's standard inputs. */
+ int pd[2];
+ if (pipe (pd) == 0)
+ {
+ /* Close the write side. */
+ (void) close (pd[1]);
+ /* Save the read side. */
+ bad_stdin = pd[0];
+
+ /* Set the descriptor to close on exec, so it does not litter any
+ child's descriptor table. When it is dup2'd onto descriptor 0,
+ that descriptor will not close on exec. */
+ CLOSE_ON_EXEC (bad_stdin);
+ }
+ }
+
+ return bad_stdin;
+}
diff --git a/prepare_vms.com b/prepare_vms.com
new file mode 100644
index 00000000..04f581f5
--- /dev/null
+++ b/prepare_vms.com
@@ -0,0 +1,59 @@
+$!
+$! prepare_vms.com - Build config.h-vms from master on VMS.
+$!
+$! This is used for building off the master instead of a release tarball.
+$!
+$!
+$!
+$! First try ODS-5, Pathworks V6 or UNZIP name.
+$!
+$ config_template = f$search("sys$disk:[]config*h-vms.template")
+$ if config_template .eqs. ""
+$ then
+$!
+$! Try NFS, VMStar, or Pathworks V5 ODS-2 encoded name.
+$!
+$ config_template = f$search("sys$disk:[]config.h-vms*template")
+$ if config_template .eqs. ""
+$ then
+$ write sys$output "Could not find config.h-vms*template!"
+$ exit 44
+$ endif
+$ endif
+$ config_template_file = f$parse(config_template,,,"name")
+$ config_template_type = f$parse(config_template,,,"type")
+$ config_template = "sys$disk:[]" + config_template_file + config_template_type
+$!
+$!
+$! Pull the package and version from configure.ac
+$!
+$ open/read ac_file sys$disk:[]configure.ac
+$ac_read_loop:
+$ read ac_file/end=ac_read_loop_end line_in
+$ key = f$extract(0, 7, line_in)
+$ if key .nes. "AC_INIT" then goto ac_read_loop
+$ package = f$element (1,"[",line_in)
+$ package = f$element (0,"]",package)
+$ version = f$element (2,"[",line_in)
+$ version = f$element (0,"]",version)
+$ac_read_loop_end:
+$ close ac_file
+$!
+$ if (package .eqs. "") .or. (version .eqs. "")
+$ then
+$ write sys$output "Unable to determine package and/or version!"
+$ exit 44
+$ endif
+$!
+$!
+$ outfile = "sys$disk:[]config.h-vms"
+$!
+$! Note the pipe command is close to the length of 255, which is the
+$! maximum token length prior to VMS V8.2:
+$! %DCL-W-TKNOVF, command element is too long - shorten
+$ pipe (write sys$output "sub/%PACKAGE%/''package'/WHOLE/NOTYPE" ;-
+ write sys$output "sub/%VERSION%/''version'/WHOLE/NOTYPE" ;-
+ write sys$output "exit") |-
+ edit/edt 'config_template'/out='outfile'/command=sys$pipe >nla0:
+$!
+$ write sys$output package, ", version: ", version, " prepared for VMS"
diff --git a/prepare_w32.bat b/prepare_w32.bat
new file mode 100644
index 00000000..7591e27d
--- /dev/null
+++ b/prepare_w32.bat
@@ -0,0 +1,6 @@
+@echo off
+@echo Windows32 SCM build preparation of config.h.W32 and NMakefile.
+if not exist config.h.W32 copy config.h.W32.template config.h.W32
+if not exist config.h copy config.h.W32 config.h
+if not exist NMakefile copy NMakefile.template NMakefile
+@echo Preparation complete. Run build_w32.bat to compile and link.
diff --git a/read.c b/read.c
index 6ff4bcc3..b870aa85 100644
--- a/read.c
+++ b/read.c
@@ -1,5 +1,5 @@
/* Reading and parsing of makefiles for GNU Make.
-Copyright (C) 1988-2014 Free Software Foundation, Inc.
+Copyright (C) 1988-2016 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
@@ -18,8 +18,6 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
#include <assert.h>
-#include <glob.h>
-
#include "filedef.h"
#include "dep.h"
#include "job.h"
@@ -54,7 +52,7 @@ struct ebuffer
char *bufstart; /* Start of the entire buffer. */
unsigned int size; /* Malloc'd size of buffer. */
FILE *fp; /* File, or NULL if this is an internal buffer. */
- gmk_floc floc; /* Info on the file in fp (if any). */
+ floc floc; /* Info on the file in fp (if any). */
};
/* Track the modifiers we can have on variable assignments */
@@ -128,13 +126,13 @@ static unsigned int max_incl_len;
/* The filename and pointer to line number of the
makefile currently being read in. */
-const gmk_floc *reading_file = 0;
+const floc *reading_file = 0;
/* The chain of files read by read_all_makefiles. */
-static struct dep *read_files = 0;
+static struct goaldep *read_files = 0;
-static int eval_makefile (const char *filename, int flags);
+static struct goaldep *eval_makefile (const char *filename, int flags);
static void eval (struct ebuffer *buffer, int flags);
static long readline (struct ebuffer *ebuf);
@@ -142,16 +140,16 @@ 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 gmk_floc *flocp);
+static int conditional_line (char *line, int len, const floc *flocp);
static void record_files (struct nameseq *filenames, const char *pattern,
const char *pattern_percent, char *depstr,
unsigned int cmds_started, char *commands,
unsigned int commands_idx, int two_colon,
- char prefix, const gmk_floc *flocp);
+ char prefix, const floc *flocp);
static void record_target_var (struct nameseq *filenames, char *defn,
enum variable_origin origin,
struct vmodifiers *vmod,
- const gmk_floc *flocp);
+ const floc *flocp);
static enum make_word_type get_next_mword (char *buffer, char *delim,
char **startp, unsigned int *length);
static void remove_comments (char *line);
@@ -167,7 +165,7 @@ static char *unescape_char (char *string, int c);
/* Read in all the makefiles and return a chain of targets to rebuild. */
-struct dep *
+struct goaldep *
read_all_makefiles (const char **makefiles)
{
unsigned int num_makefiles = 0;
@@ -217,17 +215,11 @@ read_all_makefiles (const char **makefiles)
if (makefiles != 0)
while (*makefiles != 0)
{
- struct dep *tail = read_files;
- struct dep *d;
+ struct goaldep *d = eval_makefile (*makefiles, 0);
- if (! eval_makefile (*makefiles, 0))
+ if (errno)
perror_with_name ("", *makefiles);
- /* Find the first element eval_makefile() added to read_files. */
- d = read_files;
- while (d->next != tail)
- d = d->next;
-
/* Reuse the storage allocated for the read_file. */
*makefiles = dep_name (d);
++num_makefiles;
@@ -241,7 +233,8 @@ read_all_makefiles (const char **makefiles)
static const char *default_makefiles[] =
#ifdef VMS
/* all lower case since readdir() (the vms version) 'lowercasifies' */
- { "makefile.vms", "gnumakefile.", "makefile.", 0 };
+ /* TODO: Above is not always true, this needs more work */
+ { "makefile.vms", "gnumakefile", "makefile", 0 };
#else
#ifdef _AMIGA
{ "GNUmakefile", "Makefile", "SMakefile", 0 };
@@ -259,25 +252,25 @@ read_all_makefiles (const char **makefiles)
if (*p != 0)
{
- if (! eval_makefile (*p, 0))
+ eval_makefile (*p, 0);
+ if (errno)
perror_with_name ("", *p);
}
else
{
/* No default makefile was found. Add the default makefiles to the
'read_files' chain so they will be updated if possible. */
- struct dep *tail = read_files;
+ struct goaldep *tail = read_files;
/* Add them to the tail, after any MAKEFILES variable makefiles. */
while (tail != 0 && tail->next != 0)
tail = tail->next;
for (p = default_makefiles; *p != 0; ++p)
{
- struct dep *d = alloc_dep ();
+ struct goaldep *d = alloc_goaldep ();
d->file = enter_file (strcache_add (*p));
- 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. */
- d->changed = RM_DONTCARE;
+ d->flags = RM_DONTCARE;
if (tail == 0)
read_files = d;
else
@@ -318,17 +311,18 @@ restore_conditionals (struct conditionals *saved)
conditionals = saved;
}
-static int
+static struct goaldep *
eval_makefile (const char *filename, int flags)
{
- struct dep *deps;
+ struct goaldep *deps;
struct ebuffer ebuf;
- const gmk_floc *curfile;
+ const floc *curfile;
char *expanded = 0;
int makefile_errno;
ebuf.floc.filenm = filename; /* Use the original file name. */
ebuf.floc.lineno = 1;
+ ebuf.floc.offset = 0;
if (ISDB (DB_VERBOSE))
{
@@ -400,16 +394,14 @@ eval_makefile (const char *filename, int flags)
filename = strcache_add (filename);
/* Add FILENAME to the chain of read makefiles. */
- deps = alloc_dep ();
+ deps = alloc_goaldep ();
deps->next = read_files;
read_files = deps;
deps->file = lookup_file (filename);
if (deps->file == 0)
deps->file = enter_file (filename);
filename = deps->file->name;
- deps->changed = flags;
- if (flags & RM_DONTCARE)
- deps->dontcare = 1;
+ deps->flags = flags;
free (expanded);
@@ -418,10 +410,10 @@ eval_makefile (const char *filename, int flags)
if (ebuf.fp == 0)
{
/* If we did some searching, errno has the error from the last
- attempt, rather from FILENAME itself. Restore it in case the
+ attempt, rather from FILENAME itself. Store it in case the
caller wants to use it in a message. */
errno = makefile_errno;
- return 0;
+ return deps;
}
/* Set close-on-exec to avoid leaking the makefile to children, such as
@@ -451,16 +443,17 @@ eval_makefile (const char *filename, int flags)
free (ebuf.bufstart);
alloca (0);
- return 1;
+ errno = 0;
+ return deps;
}
void
-eval_buffer (char *buffer, const gmk_floc *floc)
+eval_buffer (char *buffer, const floc *flocp)
{
struct ebuffer ebuf;
struct conditionals *saved;
struct conditionals new;
- const gmk_floc *curfile;
+ const floc *curfile;
/* Evaluate the buffer */
@@ -468,14 +461,15 @@ eval_buffer (char *buffer, const gmk_floc *floc)
ebuf.buffer = ebuf.bufnext = ebuf.bufstart = buffer;
ebuf.fp = NULL;
- if (floc)
- ebuf.floc = *floc;
+ if (flocp)
+ ebuf.floc = *flocp;
else if (reading_file)
ebuf.floc = *reading_file;
else
{
ebuf.floc.filenm = NULL;
ebuf.floc.lineno = 1;
+ ebuf.floc.offset = 0;
}
curfile = reading_file;
@@ -510,7 +504,7 @@ parse_var_assignment (const char *line, struct vmodifiers *vmod)
memset (vmod, '\0', sizeof (*vmod));
/* Find the start of the next token. If there isn't one we're done. */
- line = next_token (line);
+ NEXT_TOKEN (line);
if (*line == '\0')
return (char *)line;
@@ -589,8 +583,8 @@ eval (struct ebuffer *ebuf, int set_default)
char prefix = cmd_prefix;
const char *pattern = 0;
const char *pattern_percent;
- gmk_floc *fstart;
- gmk_floc fi;
+ floc *fstart;
+ floc fi;
#define record_waiting_files() \
do \
@@ -598,6 +592,7 @@ eval (struct ebuffer *ebuf, int set_default)
if (filenames != 0) \
{ \
fi.lineno = tgts_started; \
+ fi.offset = 0; \
record_files (filenames, pattern, pattern_percent, depstr, \
cmds_started, commands, commands_idx, two_colon, \
prefix, &fi); \
@@ -719,8 +714,7 @@ eval (struct ebuffer *ebuf, int set_default)
/* Get rid if starting space (including formfeed, vtab, etc.) */
p = collapsed;
- while (isspace ((unsigned char)*p))
- ++p;
+ NEXT_TOKEN (p);
/* See if this is a variable assignment. We need to do this early, to
allow variables with names like 'ifdef', 'export', 'private', etc. */
@@ -730,9 +724,6 @@ eval (struct ebuffer *ebuf, int set_default)
struct variable *v;
enum variable_origin origin = vmod.override_v ? o_override : o_file;
- /* Variable assignment ends the previous rule. */
- record_waiting_files ();
-
/* If we're ignoring then we're done now. */
if (ignoring)
{
@@ -741,6 +732,9 @@ eval (struct ebuffer *ebuf, int set_default)
continue;
}
+ /* Variable assignment ends the previous rule. */
+ record_waiting_files ();
+
if (vmod.undefine_v)
{
do_undefine (p, origin, ebuf);
@@ -768,7 +762,7 @@ eval (struct ebuffer *ebuf, int set_default)
p2 = end_of_token (p);
wlen = p2 - p;
- p2 = next_token (p2);
+ NEXT_TOKEN (p2);
/* If we're in an ignored define, skip this line (but maybe get out). */
if (in_ignored_define)
@@ -903,21 +897,20 @@ eval (struct ebuffer *ebuf, int set_default)
while (files != 0)
{
struct nameseq *next = files->next;
- const char *name = files->name;
- int r;
+ int flags = (RM_INCLUDED | RM_NO_TILDE
+ | (noerror ? RM_DONTCARE : 0)
+ | (set_default ? 0 : RM_NO_DEFAULT_GOAL));
- free_ns (files);
- files = next;
+ struct goaldep *d = eval_makefile (files->name, flags);
- r = eval_makefile (name,
- (RM_INCLUDED | RM_NO_TILDE
- | (noerror ? RM_DONTCARE : 0)
- | (set_default ? 0 : RM_NO_DEFAULT_GOAL)));
- if (!r && !noerror)
+ if (errno)
{
- const char *err = strerror (errno);
- OSS (error, fstart, "%s: %s", name, err);
+ d->error = (unsigned short)errno;
+ d->floc = *fstart;
}
+
+ free_ns (files);
+ files = next;
}
/* Restore conditional state. */
@@ -957,7 +950,7 @@ eval (struct ebuffer *ebuf, int set_default)
{
struct nameseq *next = files->next;
const char *name = files->name;
- struct dep *deps;
+ struct goaldep *deps;
int r;
/* Load the file. 0 means failure. */
@@ -973,7 +966,7 @@ eval (struct ebuffer *ebuf, int set_default)
continue;
/* It succeeded, so add it to the list "to be rebuilt". */
- deps = alloc_dep ();
+ deps = alloc_goaldep ();
deps->next = read_files;
read_files = deps;
deps->file = lookup_file (name);
@@ -1241,8 +1234,7 @@ eval (struct ebuffer *ebuf, int set_default)
The rule is that it's only a target, if there are TWO :'s
OR a space around the :.
*/
- if (p && !(isspace ((unsigned char)p[1]) || !p[1]
- || isspace ((unsigned char)p[-1])))
+ if (p && !(ISSPACE (p[1]) || !p[1] || ISSPACE (p[-1])))
p = 0;
#endif
#ifdef HAVE_DOS_PATHS
@@ -1435,7 +1427,7 @@ do_undefine (char *name, enum variable_origin origin, struct ebuffer *ebuf)
if (*name == '\0')
O (fatal, &ebuf->floc, _("empty variable name"));
p = name + strlen (name) - 1;
- while (p > name && isblank ((unsigned char)*p))
+ while (p > name && ISBLANK (*p))
--p;
p[1] = '\0';
@@ -1452,7 +1444,7 @@ do_define (char *name, enum variable_origin origin, struct ebuffer *ebuf)
{
struct variable *v;
struct variable var;
- gmk_floc defstart;
+ floc defstart;
int nlevels = 1;
unsigned int length = 100;
char *definition = xmalloc (length);
@@ -1480,7 +1472,7 @@ do_define (char *name, enum variable_origin origin, struct ebuffer *ebuf)
if (name[0] == '\0')
O (fatal, &defstart, _("empty variable name"));
p = name + strlen (name) - 1;
- while (p > name && isblank ((unsigned char)*p))
+ while (p > name && ISBLANK (*p))
--p;
p[1] = '\0';
@@ -1508,13 +1500,13 @@ do_define (char *name, enum variable_origin origin, struct ebuffer *ebuf)
len = strlen (p);
/* If this is another 'define', increment the level count. */
- if ((len == 6 || (len > 6 && isblank ((unsigned char)p[6])))
+ if ((len == 6 || (len > 6 && ISBLANK (p[6])))
&& strneq (p, "define", 6))
++nlevels;
/* If this is an 'endef', decrement the count. If it's now 0,
we've found the last one. */
- else if ((len == 5 || (len > 5 && isblank ((unsigned char)p[5])))
+ else if ((len == 5 || (len > 5 && ISBLANK (p[5])))
&& strneq (p, "endef", 5))
{
p += 5;
@@ -1568,7 +1560,7 @@ do_define (char *name, enum variable_origin origin, struct ebuffer *ebuf)
1 if following text should be ignored. */
static int
-conditional_line (char *line, int len, const gmk_floc *flocp)
+conditional_line (char *line, int len, const floc *flocp)
{
const char *cmdname;
enum { c_ifdef, c_ifndef, c_ifeq, c_ifneq, c_else, c_endif } cmdtype;
@@ -1590,7 +1582,8 @@ conditional_line (char *line, int len, const gmk_floc *flocp)
return -2;
/* Found one: skip past it and any whitespace after it. */
- line = next_token (line + len);
+ line += len;
+ NEXT_TOKEN (line);
#define EXTRATEXT() OS (error, flocp, _("extraneous text after '%s' directive"), cmdname)
#define EXTRACMD() OS (fatal, flocp, _("extraneous '%s'"), cmdname)
@@ -1711,7 +1704,7 @@ conditional_line (char *line, int len, const gmk_floc *flocp)
/* Make sure there's only one variable name to test. */
p = end_of_token (var);
i = p - var;
- p = next_token (p);
+ NEXT_TOKEN (p);
if (*p != '\0')
return -1;
@@ -1757,7 +1750,7 @@ conditional_line (char *line, int len, const gmk_floc *flocp)
{
/* Strip blanks after the first string. */
char *p = line++;
- while (isblank ((unsigned char)p[-1]))
+ while (ISBLANK (p[-1]))
--p;
*p = '\0';
}
@@ -1773,7 +1766,7 @@ conditional_line (char *line, int len, const gmk_floc *flocp)
if (termin != ',')
/* Find the start of the second string. */
- line = next_token (line);
+ NEXT_TOKEN (line);
termin = termin == ',' ? ')' : *line;
if (termin != ')' && termin != '"' && termin != '\'')
@@ -1808,8 +1801,8 @@ conditional_line (char *line, int len, const gmk_floc *flocp)
if (*line == '\0')
return -1;
- *line = '\0';
- line = next_token (++line);
+ *(line++) = '\0';
+ NEXT_TOKEN (line);
if (*line != '\0')
EXTRATEXT ();
@@ -1838,7 +1831,7 @@ conditional_line (char *line, int len, const gmk_floc *flocp)
static void
record_target_var (struct nameseq *filenames, char *defn,
enum variable_origin origin, struct vmodifiers *vmod,
- const gmk_floc *flocp)
+ const floc *flocp)
{
struct nameseq *nextf;
struct variable_set_list *global;
@@ -1942,7 +1935,7 @@ record_files (struct nameseq *filenames, const char *pattern,
const char *pattern_percent, char *depstr,
unsigned int cmds_started, char *commands,
unsigned int commands_idx, int two_colon,
- char prefix, const gmk_floc *flocp)
+ char prefix, const floc *flocp)
{
struct commands *cmds;
struct dep *deps;
@@ -1966,6 +1959,7 @@ record_files (struct nameseq *filenames, const char *pattern,
cmds = xmalloc (sizeof (struct commands));
cmds->fileinfo.filenm = flocp->filenm;
cmds->fileinfo.lineno = cmds_started;
+ cmds->fileinfo.offset = 0;
cmds->commands = xstrndup (commands, commands_idx);
cmds->command_lines = 0;
cmds->recipe_prefix = prefix;
@@ -2261,6 +2255,10 @@ find_char_unquote (char *string, int map)
{
char openparen = p[1];
+ /* Check if '$' is the last character in the string. */
+ if (openparen == '\0')
+ break;
+
p += 2;
/* Skip the contents of a non-quoted, multi-char variable ref. */
@@ -2342,6 +2340,10 @@ unescape_char (char *string, int c)
/* It's not; just take it all without unescaping. */
memmove (p, s, l);
p += l;
+
+ // If we hit the end of the string, we're done
+ if (*e == '\0')
+ break;
}
else if (l > 1)
{
@@ -2350,6 +2352,7 @@ unescape_char (char *string, int c)
memmove (p, s, l);
p += l;
}
+
s = e;
}
@@ -2457,7 +2460,7 @@ find_percent_cached (const char **string)
Since we aren't really reading from a file, don't bother with linenumbers.
*/
-static unsigned long
+static long
readstring (struct ebuffer *ebuf)
{
char *eol;
@@ -2631,7 +2634,7 @@ get_next_mword (char *buffer, char *delim, char **startp, unsigned int *length)
char c;
/* Skip any leading whitespace. */
- while (isblank ((unsigned char)*p))
+ while (ISBLANK (*p))
++p;
beg = p;
@@ -2729,6 +2732,8 @@ get_next_mword (char *buffer, char *delim, char **startp, unsigned int *length)
c = *(p++);
if (c == '$')
break;
+ if (c == '\0')
+ goto done_word;
/* This is a variable reference, so note that it's expandable.
Then read it to the matching close paren. */
@@ -2913,7 +2918,6 @@ tilde_expand (const char *name)
#ifndef VMS
if (name[1] == '/' || name[1] == '\0')
{
- extern char *getenv ();
char *home_dir;
int is_variable;
@@ -2936,7 +2940,6 @@ tilde_expand (const char *name)
# 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)
@@ -3005,8 +3008,6 @@ void *
parse_file_seq (char **stringp, unsigned int size, int stopmap,
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;
@@ -3064,7 +3065,7 @@ parse_file_seq (char **stringp, unsigned int size, int stopmap,
int i;
/* Skip whitespace; at the end of the string or STOPCHAR we're done. */
- p = next_token (p);
+ NEXT_TOKEN (p);
if (STOP_SET (*p, stopmap))
break;
@@ -3079,8 +3080,7 @@ parse_file_seq (char **stringp, unsigned int size, int stopmap,
#endif
#ifdef _AMIGA
if (p && STOP_SET (*p, stopmap & MAP_COLON)
- && !(isspace ((unsigned char)p[1]) || !p[1]
- || isspace ((unsigned char)p[-1])))
+ && !(ISSPACE (p[1]) || !p[1] || ISSPACE (p[-1])))
p = find_char_unquote (p+1, stopmap|MAP_VMSCOMMA|MAP_BLANK);
#endif
#ifdef HAVE_DOS_PATHS
@@ -3089,7 +3089,7 @@ parse_file_seq (char **stringp, unsigned int size, int stopmap,
Note that tokens separated by spaces should be treated as separate
tokens since make doesn't allow path names with spaces */
if (stopmap | MAP_COLON)
- while (p != 0 && !isspace ((unsigned char)*p) &&
+ while (p != 0 && !ISSPACE (*p) &&
(p[1] == '\\' || p[1] == '/') && isalpha ((unsigned char)p[-1]))
p = find_char_unquote (p + 1, stopmap|MAP_VMSCOMMA|MAP_BLANK);
#endif
@@ -3099,12 +3099,15 @@ parse_file_seq (char **stringp, unsigned int size, int stopmap,
/* Strip leading "this directory" references. */
if (NONE_SET (flags, PARSEFS_NOSTRIP))
#ifdef VMS
- /* Skip leading '[]'s. */
- while (p - s > 2 && s[0] == '[' && s[1] == ']')
-#else
+ /* Skip leading '[]'s. should only be one set or bug somwhere else */
+ if (p - s > 2 && s[0] == '[' && s[1] == ']')
+ s += 2;
+ /* Skip leading '<>'s. should only be one set or bug somwhere else */
+ if (p - s > 2 && s[0] == '<' && s[1] == '>')
+ s += 2;
+#endif
/* Skip leading './'s. */
while (p - s > 2 && s[0] == '.' && s[1] == '/')
-#endif
{
/* Skip "./" and all following slashes. */
s += 2;
@@ -3118,9 +3121,7 @@ parse_file_seq (char **stringp, unsigned int size, int stopmap,
if (s == p)
{
/* The name was stripped to empty ("./"). */
-#if defined(VMS)
- continue;
-#elif defined(_AMIGA)
+#if defined(_AMIGA)
/* PDS-- This cannot be right!! */
tp[0] = '\0';
nlen = 0;
@@ -3183,7 +3184,7 @@ parse_file_seq (char **stringp, unsigned int size, int stopmap,
do
{
const char *o = e;
- e = next_token (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. */
diff --git a/remake.c b/remake.c
index 299a2aaf..5d5d67a4 100644
--- a/remake.c
+++ b/remake.c
@@ -1,5 +1,5 @@
/* Basic dependency engine for GNU Make.
-Copyright (C) 1988-2014 Free Software Foundation, Inc.
+Copyright (C) 1988-2016 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
@@ -37,8 +37,6 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
#include <io.h>
#endif
-extern int try_implicit_rule (struct file *file, unsigned int depth);
-
/* The test for circular dependencies is based on the 'updating' bit in
'struct file'. However, double colon targets have separate 'struct
@@ -55,8 +53,13 @@ extern int try_implicit_rule (struct file *file, unsigned int depth);
/* Incremented when a command is started (under -n, when one would be). */
unsigned int commands_started = 0;
-/* Current value for pruning the scan of the goal chain (toggle 0/1). */
-static unsigned int considered;
+/* Set to the goal dependency. Mostly needed for remaking makefiles. */
+static struct goaldep *goal_list;
+static struct dep *goal_dep;
+
+/* Current value for pruning the scan of the goal chain.
+ All files start with considered == 0. */
+static unsigned int considered = 0;
static enum update_status update_file (struct file *file, unsigned int depth);
static enum update_status update_file_1 (struct file *file, unsigned int depth);
@@ -77,31 +80,22 @@ static const char *library_search (const char *lib, FILE_TIMESTAMP *mtime_ptr);
one goal whose 'changed' member is nonzero is successfully made. */
enum update_status
-update_goal_chain (struct dep *goals)
+update_goal_chain (struct goaldep *goaldeps)
{
int t = touch_flag, q = question_flag, n = just_print_flag;
enum update_status status = us_none;
-#define MTIME(file) (rebuilding_makefiles ? file_mtime_no_search (file) \
- : file_mtime (file))
-
/* Duplicate the chain so we can remove things from it. */
- goals = copy_dep_chain (goals);
+ struct dep *goals = copy_dep_chain ((struct dep *)goaldeps);
- {
- /* Clear the 'changed' flag of each goal in the chain.
- We will use the flag below to notice when any commands
- have actually been run for a target. When no commands
- have been run, we give an "up to date" diagnostic. */
+ goal_list = rebuilding_makefiles ? goaldeps : NULL;
- struct dep *g;
- for (g = goals; g != 0; g = g->next)
- g->changed = 0;
- }
+#define MTIME(file) (rebuilding_makefiles ? file_mtime_no_search (file) \
+ : file_mtime (file))
- /* All files start with the considered bit 0, so the global value is 1. */
- considered = 1;
+ /* Start a fresh batch of consideration. */
+ ++considered;
/* Update all the goals until they are all finished. */
@@ -125,6 +119,8 @@ update_goal_chain (struct dep *goals)
struct file *file;
int stop = 0, any_not_updated = 0;
+ goal_dep = g;
+
for (file = g->file->double_colon ? g->file->double_colon : g->file;
file != NULL;
file = file->prev)
@@ -132,7 +128,7 @@ update_goal_chain (struct dep *goals)
unsigned int ocommands_started;
enum update_status fail;
- file->dontcare = g->dontcare;
+ file->dontcare = ANY_SET (g->flags, RM_DONTCARE);
check_renamed (file);
if (rebuilding_makefiles)
@@ -252,10 +248,10 @@ update_goal_chain (struct dep *goals)
}
}
- /* If we reached the end of the dependency graph toggle the considered
- flag for the next pass. */
+ /* If we reached the end of the dependency graph update CONSIDERED
+ for the next pass. */
if (g == 0)
- considered = !considered;
+ ++considered;
}
if (rebuilding_makefiles)
@@ -268,6 +264,30 @@ update_goal_chain (struct dep *goals)
return status;
}
+/* If we're rebuilding an included makefile that failed, and we care
+ about errors, show an error message the first time. */
+
+void
+show_goal_error (void)
+{
+ struct goaldep *goal;
+
+ if ((goal_dep->flags & (RM_INCLUDED|RM_DONTCARE)) != RM_INCLUDED)
+ return;
+
+ for (goal = goal_list; goal; goal = goal->next)
+ if (goal_dep->file == goal->file)
+ {
+ if (goal->error)
+ {
+ OSS (error, &goal->floc, "%s: %s",
+ goal->file->name, strerror ((int)goal->error));
+ goal->error = 0;
+ }
+ return;
+ }
+}
+
/* If FILE is not up to date, execute the commands for it.
Return 0 if successful, non-0 if unsuccessful;
but with some flag settings, just call 'exit' if unsuccessful.
@@ -301,7 +321,7 @@ update_file (struct file *file, unsigned int depth)
&& !f->dontcare && f->no_diag))
{
DBF (DB_VERBOSE, _("Pruning file '%s'.\n"));
- return f->command_state == cs_finished ? f->update_status : 0;
+ return f->command_state == cs_finished ? f->update_status : us_success;
}
}
@@ -325,12 +345,9 @@ update_file (struct file *file, unsigned int depth)
if (f->command_state == cs_running
|| f->command_state == cs_deps_running)
- {
- /* Don't run the other :: rules for this
- file until this rule is finished. */
- status = us_success;
- break;
- }
+ /* Don't run other :: rules for this target until
+ this rule is finished. */
+ return us_success;
if (new > status)
status = new;
@@ -349,7 +366,7 @@ update_file (struct file *file, unsigned int depth)
{
enum update_status new = update_file (d->file, depth + 1);
if (new > status)
- new = status;
+ status = new;
}
}
@@ -380,29 +397,28 @@ complain (struct file *file)
if (d == 0)
{
+ show_goal_error ();
+
/* Didn't find any dependencies to complain about. */
if (file->parent)
{
size_t l = strlen (file->name) + strlen (file->parent->name) + 4;
+ const char *m = _("%sNo rule to make target '%s', needed by '%s'%s");
if (!keep_going_flag)
- fatal (NILF, l,
- _("%sNo rule to make target '%s', needed by '%s'%s"),
- "", file->name, file->parent->name, "");
+ fatal (NILF, l, m, "", file->name, file->parent->name, "");
- error (NILF, l, _("%sNo rule to make target '%s', needed by '%s'%s"),
- "*** ", file->name, file->parent->name, ".");
+ error (NILF, l, m, "*** ", file->name, file->parent->name, ".");
}
else
{
size_t l = strlen (file->name) + 4;
+ const char *m = _("%sNo rule to make target '%s'%s");
if (!keep_going_flag)
- fatal (NILF, l,
- _("%sNo rule to make target '%s'%s"), "", file->name, "");
+ fatal (NILF, l, m, "", file->name, "");
- error (NILF, l,
- _("%sNo rule to make target '%s'%s"), "*** ", file->name, ".");
+ error (NILF, l, m, "*** ", file->name, ".");
}
file->no_diag = 0;
@@ -600,8 +616,8 @@ update_file_1 (struct file *file, unsigned int depth)
break;
if (!running)
- /* The prereq is considered changed if the timestamp has changed while
- it was built, OR it doesn't exist. */
+ /* 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));
@@ -635,7 +651,7 @@ update_file_1 (struct file *file, unsigned int depth)
/* We may have already considered this file, when we didn't know
we'd need to update it. Force update_file() to consider it and
not prune it. */
- d->file->considered = !considered;
+ d->file->considered = 0;
new = update_file (d->file, depth);
if (new > dep_status)
@@ -1072,7 +1088,7 @@ check_dep (struct file *file, unsigned int depth,
/* If the target was waiting for a dependency it has to be
reconsidered, as that dependency might have finished. */
if (file->command_state == cs_deps_running)
- file->considered = !considered;
+ file->considered = 0;
set_command_state (file, cs_not_started);
}
@@ -1158,8 +1174,9 @@ touch_file (struct file *file)
else
#endif
{
- int fd = open (file->name, O_RDWR | O_CREAT, 0666);
+ int fd;
+ EINTRLOOP (fd, open (file->name, O_RDWR | O_CREAT, 0666));
if (fd < 0)
TOUCH_ERROR ("touch: open: ");
else
@@ -1172,18 +1189,24 @@ touch_file (struct file *file)
if (e < 0)
TOUCH_ERROR ("touch: fstat: ");
/* Rewrite character 0 same as it already is. */
- if (read (fd, &buf, 1) < 0)
+ EINTRLOOP (e, read (fd, &buf, 1));
+ if (e < 0)
TOUCH_ERROR ("touch: read: ");
- if (lseek (fd, 0L, 0) < 0L)
- TOUCH_ERROR ("touch: lseek: ");
- if (write (fd, &buf, 1) < 0)
+ {
+ off_t o;
+ EINTRLOOP (o, lseek (fd, 0L, 0));
+ if (o < 0L)
+ TOUCH_ERROR ("touch: lseek: ");
+ }
+ EINTRLOOP (e, write (fd, &buf, 1));
+ if (e < 0)
TOUCH_ERROR ("touch: write: ");
- /* If file length was 0, we just
- changed it, so change it back. */
+
+ /* If file length was 0, we just changed it, so change it back. */
if (statbuf.st_size == 0)
{
(void) close (fd);
- fd = open (file->name, O_RDWR | O_TRUNC, 0666);
+ EINTRLOOP (fd, open (file->name, O_RDWR | O_TRUNC, 0666));
if (fd < 0)
TOUCH_ERROR ("touch: open: ");
}
@@ -1249,6 +1272,7 @@ FILE_TIMESTAMP
f_mtime (struct file *file, int search)
{
FILE_TIMESTAMP mtime;
+ int propagate_timestamp;
/* File's mtime is not known; must get it from the system. */
@@ -1325,6 +1349,8 @@ f_mtime (struct file *file, int search)
|| (file->name[0] == '-' && file->name[1] == 'l'
&& (name = library_search (file->name, &mtime)) != 0))
{
+ int name_len;
+
if (mtime != UNKNOWN_MTIME)
/* vpath_search and library_search store UNKNOWN_MTIME
if they didn't need to do a stat call for their work. */
@@ -1333,7 +1359,14 @@ f_mtime (struct file *file, int search)
/* If we found it in VPATH, see if it's in GPATH too; if so,
change the name right now; if not, defer until after the
dependencies are updated. */
- if (gpath_search (name, strlen (name) - strlen (file->name) - 1))
+#ifndef VMS
+ name_len = strlen (name) - strlen (file->name) - 1;
+#else
+ name_len = strlen (name) - strlen (file->name);
+ if (name[name_len - 1] == '/')
+ name_len--;
+#endif
+ if (gpath_search (name, name_len))
{
rename_file (file, name);
check_renamed (file);
@@ -1416,10 +1449,13 @@ f_mtime (struct file *file, int search)
}
}
- /* Store the mtime into all the entries for this file. */
+ /* Store the mtime into all the entries for this file for which it is safe
+ to do so: avoid propagating timestamps to double-colon rules that haven't
+ been examined so they're run or not based on the pre-update timestamp. */
if (file->double_colon)
file = file->double_colon;
+ propagate_timestamp = file->updated;
do
{
/* If this file is not implicit but it is intermediate then it was
@@ -1431,7 +1467,8 @@ f_mtime (struct file *file, int search)
&& !file->tried_implicit && file->intermediate)
file->intermediate = 0;
- file->last_mtime = mtime;
+ if (file->updated == propagate_timestamp)
+ file->last_mtime = mtime;
file = file->prev;
}
while (file != 0);
diff --git a/remote-cstms.c b/remote-cstms.c
index 867ee8da..7c36b9dc 100644
--- a/remote-cstms.c
+++ b/remote-cstms.c
@@ -3,7 +3,7 @@
Please do not send bug reports or questions about it to
the Make maintainers.
-Copyright (C) 1988-2014 Free Software Foundation, Inc.
+Copyright (C) 1988-2016 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
@@ -222,7 +222,7 @@ start_remote_job (char **argv, char **envp, int stdin_fd,
fflush (stderr);
}
- pid = fork ();
+ pid = vfork ();
if (pid < 0)
{
/* The fork failed! */
diff --git a/remote-stub.c b/remote-stub.c
index aeb335c7..8e31a203 100644
--- a/remote-stub.c
+++ b/remote-stub.c
@@ -1,5 +1,5 @@
/* Template for the remote job exportation interface to GNU Make.
-Copyright (C) 1988-2014 Free Software Foundation, Inc.
+Copyright (C) 1988-2016 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
diff --git a/rule.c b/rule.c
index 9abf5b01..de8b3046 100644
--- a/rule.c
+++ b/rule.c
@@ -1,5 +1,5 @@
/* Pattern and suffix rule internals for GNU Make.
-Copyright (C) 1988-2014 Free Software Foundation, Inc.
+Copyright (C) 1988-2016 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
@@ -380,6 +380,7 @@ install_pattern_rule (struct pspec *p, int terminal)
r->cmds = xmalloc (sizeof (struct commands));
r->cmds->fileinfo.filenm = 0;
r->cmds->fileinfo.lineno = 0;
+ r->cmds->fileinfo.offset = 0;
/* These will all be string literals, but we malloc space for them
anyway because somebody might want to free them later. */
r->cmds->commands = xstrdup (p->commands);
diff --git a/rule.h b/rule.h
index df9fba2a..9156b8e6 100644
--- a/rule.h
+++ b/rule.h
@@ -1,5 +1,5 @@
/* Definitions for using pattern rules in GNU Make.
-Copyright (C) 1988-2014 Free Software Foundation, Inc.
+Copyright (C) 1988-2016 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
@@ -55,3 +55,4 @@ void install_pattern_rule (struct pspec *p, int terminal);
void create_pattern_rule (const char **targets, const char **target_percents,
unsigned int num, int terminal, struct dep *deps,
struct commands *commands, int override);
+void print_rule_data_base (void);
diff --git a/signame.c b/signame.c
index 7db24391..55646e96 100644
--- a/signame.c
+++ b/signame.c
@@ -1,5 +1,5 @@
/* Convert between signal names and numbers.
-Copyright (C) 1990-2014 Free Software Foundation, Inc.
+Copyright (C) 1990-2016 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
diff --git a/strcache.c b/strcache.c
index 1ade5e7d..6dcf2bc6 100644
--- a/strcache.c
+++ b/strcache.c
@@ -1,5 +1,5 @@
/* Constant string caching for GNU Make.
-Copyright (C) 2006-2014 Free Software Foundation, Inc.
+Copyright (C) 2006-2016 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
@@ -42,8 +42,8 @@ struct strcache {
#define CACHE_BUFFER_ALLOC(_s) ((_s) - (2 * sizeof (size_t)))
#define CACHE_BUFFER_OFFSET (offsetof (struct strcache, buffer))
#define CACHE_BUFFER_SIZE(_s) (CACHE_BUFFER_ALLOC(_s) - CACHE_BUFFER_OFFSET)
+#define BUFSIZE CACHE_BUFFER_SIZE (CACHE_BUFFER_BASE)
-static sc_buflen_t bufsize = CACHE_BUFFER_SIZE (CACHE_BUFFER_BASE);
static struct strcache *strcache = NULL;
static struct strcache *fullcache = NULL;
@@ -57,65 +57,76 @@ static unsigned long total_size = 0;
that this doesn't seem to be much of an issue in practice.
*/
static struct strcache *
-new_cache ()
+new_cache (struct strcache **head, sc_buflen_t buflen)
{
- struct strcache *new;
- new = xmalloc (bufsize + CACHE_BUFFER_OFFSET);
+ struct strcache *new = xmalloc (buflen + CACHE_BUFFER_OFFSET);
new->end = 0;
new->count = 0;
- new->bytesfree = bufsize;
+ new->bytesfree = buflen;
- new->next = strcache;
- strcache = new;
+ new->next = *head;
+ *head = new;
++total_buffers;
return new;
}
static const char *
+copy_string (struct strcache *sp, const char *str, unsigned int len)
+{
+ /* Add the string to this cache. */
+ char *res = &sp->buffer[sp->end];
+
+ memmove (res, str, len);
+ res[len++] = '\0';
+ sp->end += len;
+ sp->bytesfree -= len;
+ ++sp->count;
+
+ return res;
+}
+
+static const char *
add_string (const char *str, unsigned int len)
{
- char *res;
+ const char *res;
struct strcache *sp;
struct strcache **spp = &strcache;
/* We need space for the nul char. */
unsigned int sz = len + 1;
+ ++total_strings;
+ total_size += sz;
+
/* If the string we want is too large to fit into a single buffer, then
- no existing cache is large enough. Change the maximum size. */
- if (sz > bufsize)
- bufsize = CACHE_BUFFER_SIZE ((((sz + 1) / CACHE_BUFFER_BASE) + 1)
- * CACHE_BUFFER_BASE);
- else
- /* Find the first cache with enough free space. */
- for (; *spp != NULL; spp = &(*spp)->next)
- if ((*spp)->bytesfree > sz)
- break;
-
- /* If nothing is big enough, make a new cache. */
+ no existing cache is large enough. Add it directly to the fullcache. */
+ if (sz > BUFSIZE)
+ {
+ sp = new_cache (&fullcache, sz);
+ return copy_string (sp, str, len);
+ }
+
+ /* Find the first cache with enough free space. */
+ for (; *spp != NULL; spp = &(*spp)->next)
+ if ((*spp)->bytesfree > sz)
+ break;
sp = *spp;
+
+ /* If nothing is big enough, make a new cache at the front. */
if (sp == NULL)
{
- sp = new_cache ();
- spp = &sp;
+ sp = new_cache (&strcache, BUFSIZE);
+ spp = &strcache;
}
/* Add the string to this cache. */
- res = &sp->buffer[sp->end];
- memmove (res, str, len);
- res[len] = '\0';
- sp->end += sz;
- sp->bytesfree -= sz;
- ++sp->count;
+ res = copy_string (sp, str, len);
/* If the amount free in this cache is less than the average string size,
consider it full and move it to the full list. */
- ++total_strings;
- total_size += sz;
-
- if (sp->bytesfree < (total_size / total_strings) + 1)
+ if (total_strings > 20 && sp->bytesfree < (total_size / total_strings) + 1)
{
- *spp = (*spp)->next;
+ *spp = sp->next;
sp->next = fullcache;
fullcache = sp;
}
@@ -123,6 +134,26 @@ add_string (const char *str, unsigned int len)
return res;
}
+/* For strings too large for the strcache, we just save them in a list. */
+struct hugestring {
+ struct hugestring *next; /* The next string. */
+ char buffer[1]; /* The string. */
+};
+
+static struct hugestring *hugestrings = NULL;
+
+static const char *
+add_hugestring (const char *str, unsigned int len)
+{
+ struct hugestring *new = xmalloc (sizeof (struct hugestring) + len);
+ memcpy (new->buffer, str, len);
+ new->buffer[len] = '\0';
+
+ new->next = hugestrings;
+ hugestrings = new;
+
+ return new->buffer;
+}
/* Hash table of strings in the cache. */
@@ -148,11 +179,19 @@ static struct hash_table strings;
static unsigned long total_adds = 0;
static const char *
-add_hash (const char *str, int len)
+add_hash (const char *str, unsigned int len)
{
+ char *const *slot;
+ const char *key;
+
+ /* If it's too large for the string cache, just copy it.
+ We don't bother trying to match these. */
+ if (len > USHRT_MAX - 1)
+ return add_hugestring (str, len);
+
/* Look up the string in the hash. If it's there, return it. */
- char *const *slot = (char *const *) hash_find_slot (&strings, str);
- const char *key = *slot;
+ slot = (char *const *) hash_find_slot (&strings, str);
+ key = *slot;
/* Count the total number of add operations we performed. */
++total_adds;
@@ -179,6 +218,13 @@ strcache_iscached (const char *str)
if (str >= sp->buffer && str < sp->buffer + sp->end)
return 1;
+ {
+ struct hugestring *hp;
+ for (hp = hugestrings; hp != 0; hp = hp->next)
+ if (str == hp->buffer)
+ return 1;
+ }
+
return 0;
}
@@ -207,14 +253,6 @@ strcache_add_len (const char *str, unsigned int len)
return add_hash (str, len);
}
-int
-strcache_setbufsize (unsigned int size)
-{
- if (size > bufsize)
- bufsize = size;
- return bufsize;
-}
-
void
strcache_init (void)
{
@@ -229,7 +267,7 @@ strcache_print_stats (const char *prefix)
{
const struct strcache *sp;
unsigned long numbuffs = 0, fullbuffs = 0;
- unsigned long totfree = 0, maxfree = 0, minfree = bufsize;
+ unsigned long totfree = 0, maxfree = 0, minfree = BUFSIZE;
if (! strcache)
{
@@ -268,12 +306,13 @@ strcache_print_stats (const char *prefix)
(total_size / total_strings));
printf (_("%s current buf: size = %hu B / used = %hu B / count = %hu / avg = %hu B\n"),
- prefix, bufsize, strcache->end, strcache->count,
+ prefix, (sc_buflen_t)BUFSIZE, strcache->end, strcache->count,
(strcache->end / strcache->count));
if (numbuffs)
{
- unsigned long sz = total_size - bufsize;
+ /* Show information about non-current buffers. */
+ unsigned long sz = total_size - strcache->end;
unsigned long cnt = total_strings - strcache->count;
sc_buflen_t avgfree = totfree / numbuffs;
diff --git a/subproc.bat b/subproc.bat
index e3b8d3cf..8deb9465 100644
--- a/subproc.bat
+++ b/subproc.bat
@@ -1,23 +1,24 @@
-@echo off
-rem Copyright (C) 1996-2014 Free Software Foundation, Inc.
-rem This file is part of GNU Make.
-rem
-rem GNU Make is free software; you can redistribute it and/or modify it under
-rem the terms of the GNU General Public License as published by the Free
-rem Software Foundation; either version 3 of the License, or (at your option)
-rem any later version.
-rem
-rem GNU Make is distributed in the hope that it will be useful, but WITHOUT
-rem ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-rem FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for.
-rem more details.
-rem
-rem You should have received a copy of the GNU General Public License along
-rem with this program. If not, see <http://www.gnu.org/licenses/>.
-
-cd w32\subproc
-set MAKE=%2
-set MAKEFILE=%1
-if x%2 == x set MAKE=nmake
-%MAKE% /f %MAKEFILE%
-cd ..\..
+@echo off
+rem Copyright (C) 1996-2016 Free Software Foundation, Inc.
+rem This file is part of GNU Make.
+rem
+rem GNU Make is free software; you can redistribute it and/or modify it under
+rem the terms of the GNU General Public License as published by the Free
+rem Software Foundation; either version 3 of the License, or (at your option)
+rem any later version.
+rem
+rem GNU Make is distributed in the hope that it will be useful, but WITHOUT
+rem ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+rem FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for.
+rem more details.
+rem
+rem You should have received a copy of the GNU General Public License along
+rem with this program. If not, see <http://www.gnu.org/licenses/>.
+
+cd w32\subproc
+set MAKE=%2
+set MAKEFILE=%1
+if x%2 == x set MAKE=nmake
+%MAKE% /f %MAKEFILE%
+if ERRORLEVEL 1 exit /B
+cd ..\..
diff --git a/tests/.gitignore b/tests/.gitignore
new file mode 100644
index 00000000..a30a6895
--- /dev/null
+++ b/tests/.gitignore
@@ -0,0 +1,2 @@
+config-flags.pm
+work
diff --git a/tests/ChangeLog.1 b/tests/ChangeLog.1
index 9abe731c..684af03d 100644
--- a/tests/ChangeLog.1
+++ b/tests/ChangeLog.1
@@ -1413,7 +1413,7 @@
ChangeLog file for the test suite created.
-Copyright (C) 1992-2014 Free Software Foundation, Inc.
+Copyright (C) 1992-2016 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
diff --git a/tests/NEWS b/tests/NEWS
index 584f4a4f..f55e4ba8 100644
--- a/tests/NEWS
+++ b/tests/NEWS
@@ -162,7 +162,7 @@ Changes from 0.1 to 0.2 (5-4-92):
-------------------------------------------------------------------------------
-Copyright (C) 1992-2014 Free Software Foundation, Inc.
+Copyright (C) 1992-2016 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
diff --git a/tests/README b/tests/README
index 3b699eec..0213159f 100644
--- a/tests/README
+++ b/tests/README
@@ -7,7 +7,7 @@ This entire test suite, including all test files, are copyright and
distributed under the following terms:
-----------------------------------------------------------------------------
- Copyright (C) 1992-2014 Free Software Foundation, Inc.
+ Copyright (C) 1992-2016 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
diff --git a/tests/config_flags_pm.com b/tests/config_flags_pm.com
index 3f5adffe..a4271b61 100755
--- a/tests/config_flags_pm.com
+++ b/tests/config_flags_pm.com
@@ -3,7 +3,7 @@ $! config_flags_pm.com - Build config-flags.pm on VMS.
$!
$! Just good enough to run the self tests for now.
$!
-$! Copyright (C) 2014 Free Software Foundation, Inc.
+$! Copyright (C) 2014-2016 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
diff --git a/tests/mkshadow b/tests/mkshadow
index aa9b3bcd..23c7ab0c 100755
--- a/tests/mkshadow
+++ b/tests/mkshadow
@@ -3,7 +3,7 @@
# Simple script to make a "shadow" test directory, using symbolic links.
# Typically you'd put the shadow in /tmp or another local disk
#
-# Copyright (C) 1992-2014 Free Software Foundation, Inc.
+# Copyright (C) 1992-2016 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
diff --git a/tests/run_make_tests.com b/tests/run_make_tests.com
index 2f17f7f5..de79a91c 100755
--- a/tests/run_make_tests.com
+++ b/tests/run_make_tests.com
@@ -4,7 +4,7 @@ $! This is a wrapper for the GNU make perl test programs on VMS.
$!
$! Parameter "-help" for description on how to use described below.
$!
-$! Copyright (C) 2014 Free Software Foundation, Inc.
+$! Copyright (C) 2014-2016 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
@@ -238,18 +238,18 @@ $!
$ if no_gnv .or. no_perl then exit 44
$!
$!
-$ make := $bin:make.exe
$ default = f$environment("DEFAULT")
+$ default_dev = f$element(0, ":", default) + ":"
$ this = f$environment("PROCEDURE")
$ on error then goto all_error
-$ set default 'f$parse(this,,,"DEVICE")''f$parse(this,,,"DIRECTORY")'
+$ set default 'default_dev''f$parse(this,,,"DIRECTORY")'
$!
$! Need to make sure that the config-flags.pm exists.
$ if f$search("config-flags.pm") .eqs. ""
$ then
$ @config_flags_pm.com
$ endif
-$ define/user bin 'default',gnv$gnu:[bin]
+$ define/user bin 'default_dev'[-],gnv$gnu:[bin]
$ define/user decc$filename_unix_noversion enable
$ define/user decc$filename_unix_report enable
$ define/user decc$readdir_dropdotnotype enable
diff --git a/tests/run_make_tests.pl b/tests/run_make_tests.pl
index 9468faba..916f3467 100644
--- a/tests/run_make_tests.pl
+++ b/tests/run_make_tests.pl
@@ -11,7 +11,7 @@
# [-make <make prog>]
# (and others)
-# Copyright (C) 1992-2014 Free Software Foundation, Inc.
+# Copyright (C) 1992-2016 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
@@ -140,6 +140,7 @@ sub subst_make_string
sub run_make_test
{
local ($makestring, $options, $answer, $err_code, $timeout) = @_;
+ my @call = caller;
# If the user specified a makefile string, create a new makefile to contain
# it. If the first value is not defined, use the last one (if there is
@@ -171,7 +172,7 @@ sub run_make_test
}
run_make_with_options($makefile, $options, &get_logfile(0),
- $err_code, $timeout);
+ $err_code, $timeout, @call);
&compare_output($answer, &get_logfile(1));
$old_makefile = $makefile;
@@ -180,7 +181,8 @@ sub run_make_test
# The old-fashioned way...
sub run_make_with_options {
- local ($filename,$options,$logname,$expected_code,$timeout) = @_;
+ my ($filename,$options,$logname,$expected_code,$timeout,@call) = @_;
+ @call = caller unless @call;
local($code);
local($command) = $make_path;
@@ -231,7 +233,11 @@ sub run_make_with_options {
$command .= " $options";
}
- $command_string = "$command\n";
+ $command_string = "";
+ if (@call) {
+ $command_string = "#$call[1]:$call[2]\n";
+ }
+ $command_string .= "$command\n";
if ($valgrind) {
print VALGRIND "\n\nExecuting: $command\n";
@@ -359,6 +365,12 @@ sub set_more_defaults
elsif ($osname =~ m%OS/2%) {
$port_type = 'OS/2';
}
+
+ # VMS has a GNV Unix mode or a DCL mode.
+ # The SHELL environment variable should not be defined in VMS-DCL mode.
+ elsif ($osname eq 'VMS' && !defined $ENV{"SHELL"}) {
+ $port_type = 'VMS-DCL';
+ }
# Everything else, right now, is UNIX. Note that we should integrate
# the VOS support into this as well and get rid of $vos; we'll do
# that next time.
@@ -377,6 +389,7 @@ sub set_more_defaults
# Find the full pathname of Make. For DOS systems this is more
# complicated, so we ask make itself.
if ($osname eq 'VMS') {
+ $port_type = 'VMS-DCL' unless defined $ENV{"SHELL"};
# On VMS pre-setup make to be found with simply 'make'.
$make_path = 'make';
} else {
@@ -458,6 +471,8 @@ sub set_more_defaults
# Set up for valgrind, if requested.
+ $make_command = $make_path;
+
if ($valgrind) {
my $args = $valgrind_args;
open(VALGRIND, "> valgrind.out")
diff --git a/tests/scripts/features/archives b/tests/scripts/features/archives
index b0acfecb..a064dd44 100644
--- a/tests/scripts/features/archives
+++ b/tests/scripts/features/archives
@@ -9,89 +9,205 @@ This only works on systems that support it.";
exists $FEATURES{archives} or return -1;
# Create some .o files to work with
-utouch(-60, qw(a1.o a2.o a3.o));
+if ($osname eq 'VMS') {
+ use Cwd;
+ my $pwd = getcwd;
+ # VMS AR needs real object files at this time.
+ foreach $afile ('a1', 'a2', 'a3') {
+ # Use non-standard extension to prevent implicit rules from recreating
+ # objects when the test tampers with the timestamp.
+ 1 while unlink "$afile.c1";
+ 1 while unlink "$afile.o";
+ open (MYFILE, ">$afile.c1");
+ print MYFILE "int $afile(void) {return 1;}\n";
+ close MYFILE;
+ system("cc $afile.c1 /object=$afile.o");
+ }
+} else {
+ utouch(-60, qw(a1.o a2.o a3.o));
+}
my $ar = $CONFIG_FLAGS{AR};
+# Fallback if configure did not find AR, such as VMS
+# which does not run configure.
+$ar = 'ar' if $ar eq '';
+
+my $redir = '2>&1';
+$redir = '' if $osname eq 'VMS';
+
+my $arflags = 'rv';
+my $arvar = "AR=$ar";
+
+# Newer versions of binutils can be built with --enable-deterministic-archives
+# which forces all timestamps (among other things) to always be 0, defeating
+# GNU make's archive support. See if ar supports the U option to disable it.
+unlink('libxx.a');
+$_ = `$ar U$arflags libxx.a a1.o $redir`;
+if ($? == 0) {
+ $arflags = 'Urv';
+ $arvar = "$arvar ARFLAGS=$arflags";
+}
+
# Some versions of ar print different things on creation. Find out.
-my $created = `$ar rv libxx.a a1.o 2>&1`;
+unlink('libxx.a');
+my $created = `$ar $arflags libxx.a a1.o $redir`;
# Some versions of ar print different things on add. Find out.
-my $add = `$ar rv libxx.a a2.o 2>&1`;
+my $add = `$ar $arflags libxx.a a2.o $redir`;
$add =~ s/a2\.o/#OBJECT#/g;
# Some versions of ar print different things on replacement. Find out.
-my $repl = `$ar rv libxx.a a2.o 2>&1`;
+my $repl = `$ar $arflags libxx.a a2.o $redir`;
$repl =~ s/a2\.o/#OBJECT#/g;
unlink('libxx.a');
# Very simple
-run_make_test('all: libxx.a(a1.o)',
- '', "$ar rv libxx.a a1.o\n$created");
+my $answer = "$ar $arflags libxx.a a1.o\n$created";
+if ($port_type eq 'VMS-DCL') {
+ $answer = 'library /replace libxx.a a1.o';
+}
+run_make_test('all: libxx.a(a1.o)', $arvar, $answer);
# Multiple .o's. Add a new one to the existing library
($_ = $add) =~ s/#OBJECT#/a2.o/g;
-run_make_test('all: libxx.a(a1.o a2.o)',
- '', "$ar rv libxx.a a2.o\n$_");
+
+$answer = "$ar $arflags libxx.a a2.o\n$_";
+if ($port_type eq 'VMS-DCL') {
+ $answer = 'library /replace libxx.a a2.o';
+}
+run_make_test('all: libxx.a(a1.o a2.o)', $arvar, $answer);
# Touch one of the .o's so it's rebuilt
-utouch(-40, 'a1.o');
+if ($port_type eq 'VMS-DCL') {
+ # utouch is not changing what VMS library compare is testing for.
+ # So do a real change by regenerating the file.
+ 1 while unlink('a1.o');
+ # Later time stamp than last insertion.
+ sleep(2);
+ system('cc a1.c1 /object=a1.o');
+ # Next insertion will have a later timestamp.
+ sleep(2);
+} else {
+ utouch(-40, 'a1.o');
+}
+
($_ = $repl) =~ s/#OBJECT#/a1.o/g;
-run_make_test(undef, '', "$ar rv libxx.a a1.o\n$_");
+$answer = "$ar $arflags libxx.a a1.o\n$_";
+if ($port_type eq 'VMS-DCL') {
+ $answer = 'library /replace libxx.a a1.o';
+}
+run_make_test(undef, $arvar, $answer);
# Use wildcards
-run_make_test('all: libxx.a(*.o)',
- '', "#MAKE#: Nothing to be done for 'all'.\n");
+$answer = "#MAKE#: Nothing to be done for 'all'.\n";
+run_make_test('all: libxx.a(*.o)', $arvar, $answer);
# Touch one of the .o's so it's rebuilt
-utouch(-30, 'a1.o');
+if ($port_type eq 'VMS-DCL') {
+ # utouch is not changing what VMS library compare is testing for.
+ # So do a real change by regenerating the file.
+ 1 while unlink('a1.o');
+ # Make timestamp later than last insertion.
+ sleep(2);
+ system('cc a1.c1 /object=a1.o');
+} else {
+ utouch(-30, 'a1.o');
+}
($_ = $repl) =~ s/#OBJECT#/a1.o/g;
-run_make_test(undef, '', "$ar rv libxx.a a1.o\n$_");
+$answer = "$ar $arflags libxx.a a1.o\n$_";
+if ($port_type eq 'VMS-DCL') {
+ $answer = 'library /replace libxx.a a1.o';
+}
+run_make_test(undef, $arvar, $answer);
# Use both wildcards and simple names
-utouch(-50, 'a2.o');
+if ($port_type eq 'VMS-DCL') {
+ # utouch is not changing what VMS library compare is testing for.
+ # So do a real change by regenerating the file.
+ 1 while unlink('a2.o');
+ sleep(2);
+ system('cc a2.c1 /object=a2.o');
+} else {
+ utouch(-50, 'a2.o');
+}
($_ = $add) =~ s/#OBJECT#/a3.o/g;
-$_ .= "$ar rv libxx.a a2.o\n";
+$_ .= "$ar $arflags libxx.a a2.o\n";
($_ .= $repl) =~ s/#OBJECT#/a2.o/g;
-run_make_test('all: libxx.a(a3.o *.o)', '',
- "$ar rv libxx.a a3.o\n$_");
+$answer = "$ar $arflags libxx.a a3.o\n$_";
+if ($port_type eq 'VMS-DCL') {
+ $answer = 'library /replace libxx.a a3.o';
+}
+
+run_make_test('all: libxx.a(a3.o *.o)', $arvar, $answer);
# Check whitespace handling
-utouch(-40, 'a2.o');
+if ($port_type eq 'VMS-DCL') {
+ # utouch is not changing what VMS library compare is testing for.
+ # So do a real change by regenerating the file.
+ 1 while unlink('a2.o');
+ sleep(2);
+ system('cc a2.c1 /object=a2.o');
+} else {
+ utouch(-40, 'a2.o');
+}
($_ = $repl) =~ s/#OBJECT#/a2.o/g;
-run_make_test('all: libxx.a( a3.o *.o )', '',
- "$ar rv libxx.a a2.o\n$_");
+$answer = "$ar $arflags libxx.a a2.o\n$_";
+if ($port_type eq 'VMS-DCL') {
+ $answer = 'library /replace libxx.a a2.o';
+}
+run_make_test('all: libxx.a( a3.o *.o )', $arvar, $answer);
-rmfiles(qw(a1.o a2.o a3.o libxx.a));
+rmfiles(qw(a1.c1 a2.c1 a3.c1 a1.o a2.o a3.o libxx.a));
# Check non-archive targets
# See Savannah bug #37878
-run_make_test(q!
+$mk_string = q!
all: foo(bar).baz
foo(bar).baz: ; @echo '$@'
-!,
- '', "foo(bar).baz\n");
+!;
+
+if ($port_type eq 'VMS-DCL') {
+ $mk_string =~ s/echo/write sys\$\$output/;
+ $mk_string =~ s/\'/\"/g;
+}
+run_make_test($mk_string, $arvar, "foo(bar).baz\n");
# Check renaming of archive targets.
# See Savannah bug #38442
mkdir('artest', 0777);
touch('foo.vhd');
-
-run_make_test(q!
+$mk_string = q!
DIR = artest
vpath % $(DIR)
default: lib(foo)
(%): %.vhd ; @cd $(DIR) && touch $(*F) && $(AR) $(ARFLAGS) $@ $(*F) >/dev/null 2>&1 && rm $(*F)
.PHONY: default
-!,
- '', "");
-
-run_make_test(undef, '', "#MAKE#: Nothing to be done for 'default'.\n");
+!;
+if ($port_type eq 'VMS-DCL') {
+ $mk_string =~ s#= artest#= sys\$\$disk:\[.artest\]#;
+ $mk_string =~ s#lib\(foo\)#lib.tlb\(foo\)#;
+ $mk_string =~ s#; \@cd#; pipe SET DEFAULT#;
+ $mk_string =~
+ s#touch \$\(\*F\)#touch \$\(\*F\) && library/create/text sys\$\$disk:\$\@#;
+ $mk_string =~
+ s#library#if f\$\$search(\"\$\@\") \.eqs\. \"\" then library#;
+ # VMS needs special handling for null extension
+ $mk_string =~ s#\@ \$\(\*F\)#\@ \$\(\*F\)\.#;
+ $mk_string =~ s#>/dev/null 2>&1 ##;
+}
+run_make_test($mk_string, $arvar, "");
+
+run_make_test(undef, $arvar, "#MAKE#: Nothing to be done for 'default'.\n");
unlink('foo.vhd');
-remove_directory_tree('artest');
+if ($osname eq 'VMS') {
+ remove_directory_tree("$pwd/artest");
+} else {
+ remove_directory_tree('artest');
+}
# This tells the test driver that the perl test script executed properly.
1;
diff --git a/tests/scripts/features/conditionals b/tests/scripts/features/conditionals
index 2ece60bb..78344b93 100644
--- a/tests/scripts/features/conditionals
+++ b/tests/scripts/features/conditionals
@@ -141,6 +141,22 @@ all: ; @:',
'',
'success');
+# SV 47960 : ensure variable assignments in non-taken legs don't cause problems
+run_make_test('
+ifneq ($(FOO),yes)
+target:
+else
+BAR = bar
+target:
+endif
+ @echo one
+',
+ '', "one\n");
+
# This tells the test driver that the perl test script executed properly.
1;
+
+### Local Variables:
+### eval: (setq whitespace-action (delq 'auto-cleanup whitespace-action))
+### End:
diff --git a/tests/scripts/features/double_colon b/tests/scripts/features/double_colon
index 1097775b..58f126f6 100644
--- a/tests/scripts/features/double_colon
+++ b/tests/scripts/features/double_colon
@@ -151,8 +151,7 @@ two');
unlink('result','one','two');
-# TEST 10: check for proper backslash handling
-# Savannah bug #33399
+# TEST 10: SV 33399 : check for proper backslash handling
run_make_test('
a\ xb :: ; @echo one
@@ -160,5 +159,62 @@ a\ xb :: ; @echo two
',
'', "one\ntwo\n");
+# Test 11: SV 44742 : All double-colon rules should be run in parallel build.
+
+run_make_test('result :: 01
+ @echo update
+ @touch $@
+result :: 02
+ @echo update
+ @touch $@
+result :: 03
+ @echo update
+ @touch $@
+result :: 04
+ @echo update
+ @touch $@
+result :: 05
+ @echo update
+ @touch $@
+01 02 03 04 05:
+ @touch 01 02 03 04 05
+',
+ '-j10 result', "update\nupdate\nupdate\nupdate\nupdate\n");
+
+unlink('result', '01', '02', '03', '04', '05');
+
+# Test 12: SV 44742 : Double-colon rules with parallelism
+
+run_make_test('
+root: all
+ echo root
+all::
+ echo all_one
+all:: 3
+ echo all_two
+%:
+ sleep $*
+',
+ '-rs -j2 1 2 root', "all_one\nall_two\nroot\n");
+
+# SV 47995 : Parallel double-colon rules with FORCE
+
+run_make_test('
+all:: ; @echo one
+
+all:: joe ; @echo four
+
+joe: FORCE ; touch joe-is-forced
+
+FORCE:
+',
+ '-j5', "one\ntouch joe-is-forced\nfour\n");
+
+unlink('joe-is-forced');
+
# This tells the test driver that the perl test script executed properly.
1;
+
+### Local Variables:
+### eval: (setq whitespace-action (delq 'auto-cleanup whitespace-action))
+### End:
diff --git a/tests/scripts/features/errors b/tests/scripts/features/errors
index c0339cb6..ebd43831 100644
--- a/tests/scripts/features/errors
+++ b/tests/scripts/features/errors
@@ -30,7 +30,7 @@ open(MAKEFILE,"> $makefile");
print MAKEFILE "clean:\n"
."\t-$rm_command cleanit\n"
."\t$rm_command foo\n"
- ."clean2: \n"
+ ."clean2: \n"
."\t$rm_command cleanit\n"
."\t$rm_command foo\n";
@@ -50,8 +50,7 @@ $delete_error_code = $? >> 8;
$answer = "$rm_command cleanit
$cleanit_error
-$makefile:2: recipe for target 'clean' failed
-$make_name: [clean] Error $delete_error_code (ignored)
+$make_name: [$makefile:2: clean] Error $delete_error_code (ignored)
$rm_command foo\n";
&run_make_with_options($makefile,"",&get_logfile);
@@ -78,8 +77,7 @@ if (!$vos)
$answer = "$rm_command cleanit
$cleanit_error
-$makefile:5: recipe for target 'clean2' failed
-$make_name: [clean2] Error $delete_error_code (ignored)
+$make_name: [$makefile:5: clean2] Error $delete_error_code (ignored)
$rm_command foo\n";
&run_make_with_options($makefile,"clean2 -i",&get_logfile);
@@ -92,4 +90,18 @@ if (!$vos) {
&compare_output($answer,&get_logfile(1));
}
+# Test that error line offset works
+
+run_make_test(q!
+all:
+ @echo hi
+ @echo there
+ @exit 1
+!,
+ '', "hi\nthere\n#MAKE#: *** [#MAKEFILE#:5: all] Error 1", 512);
+
1;
+
+### Local Variables:
+### eval: (setq whitespace-action (delq 'auto-cleanup whitespace-action))
+### End:
diff --git a/tests/scripts/features/include b/tests/scripts/features/include
index ee014bd8..f78563f9 100644
--- a/tests/scripts/features/include
+++ b/tests/scripts/features/include
@@ -165,6 +165,70 @@ baz: end
#MAKE#: *** No rule to make target 'end', needed by 'baz'. Stop.\n",
512);
+# Test include of make-able file doesn't show an error (Savannah #102)
+run_make_test(q!
+.PHONY: default
+default:; @echo DONE
+
+inc1:; echo > $@
+include inc1
+include inc2
+inc2:; echo > $@
+!,
+ '', "echo > inc2\necho > inc1\nDONE\n");
+
+rmfiles('inc1', 'inc2');
+
+# Test include of non-make-able file does show an error (Savannah #102)
+run_make_test(q!
+.PHONY: default
+default:; @echo DONE
+
+inc1:; echo > $@
+include inc1
+include inc2
+!,
+ '', "#MAKEFILE#:7: inc2: No such file or directory\n#MAKE#: *** No rule to make target 'inc2'. Stop.\n", 512);
+
+rmfiles('inc1');
+
+# Include same file multiple times
+
+run_make_test(q!
+default:; @echo DEFAULT
+include inc1
+inc1:; echo > $@
+include inc1
+!,
+ '', "echo > inc1\nDEFAULT\n");
+
+rmfiles('inc1');
+
+# Included file has a prerequisite that fails to build
+
+run_make_test(q!
+default:; @echo DEFAULT
+include inc1
+inc1: foo; echo > $@
+foo:; exit 1
+!,
+ '', "exit 1\n#MAKEFILE#:3: inc1: No such file or directory\n#MAKE#: *** [#MAKEFILE#:5: foo] Error 1\n", 512);
+
+rmfiles('inc1');
+
+# Included file has a prerequisite we don't know how to build
+
+run_make_test(q!
+default:; @echo DEFAULT
+include inc1
+inc1: foo; echo > $@
+!,
+ '', "#MAKEFILE#:3: inc1: No such file or directory\n#MAKE#: *** No rule to make target 'foo', needed by 'inc1'. Stop.\n", 512);
+
+rmfiles('inc1');
+
+# include a directory
+
if ($all_tests) {
# Test that include of a rebuild-able file doesn't show a warning
# Savannah bug #102
diff --git a/tests/scripts/features/jobserver b/tests/scripts/features/jobserver
index cedd4b34..7da4a654 100644
--- a/tests/scripts/features/jobserver
+++ b/tests/scripts/features/jobserver
@@ -12,7 +12,49 @@ if (!$parallel_jobs) {
return -1;
}
-# Don't put --jobserver-fds into a re-exec'd MAKEFLAGS.
+# Shorthand
+my $np = '--no-print-directory';
+
+# Simple test of MAKEFLAGS settings
+run_make_test(q!
+SHOW = $(patsubst --jobserver-auth=%,--jobserver-auth=<auth>,$(MAKEFLAGS))
+recurse: ; @echo $@: "/$(SHOW)/"; $(MAKE) -f #MAKEFILE# all
+all:;@echo $@: "/$(SHOW)/"
+!,
+ "-j2 $np", "recurse: /-j2 --jobserver-auth=<auth> $np/\nall: /-j2 --jobserver-auth=<auth> $np/\n");
+
+# Setting parallelism with the environment
+# Command line should take precedence over the environment
+$extraENV{MAKEFLAGS} = "-j2 $np";
+run_make_test(q!
+SHOW = $(patsubst --jobserver-auth=%,--jobserver-auth=<auth>,$(MAKEFLAGS))
+recurse: ; @echo $@: "/$(SHOW)/"; $(MAKE) -f #MAKEFILE# all
+all:;@echo $@: "/$(SHOW)/"
+!,
+ '', "recurse: /-j2 --jobserver-auth=<auth> $np/\nall: /-j2 --jobserver-auth=<auth> $np/\n");
+delete $extraENV{MAKEFLAGS};
+
+# Test override of -jN
+$extraENV{MAKEFLAGS} = "-j9 $np";
+run_make_test(q!
+SHOW = $(patsubst --jobserver-auth=%,--jobserver-auth=<auth>,$(MAKEFLAGS))
+recurse: ; @echo $@: "/$(SHOW)/"; $(MAKE) -j3 -f #MAKEFILE# recurse2
+recurse2: ; @echo $@: "/$(SHOW)/"; $(MAKE) -f #MAKEFILE# all
+all:;@echo $@: "/$(SHOW)/"
+!,
+ "-j2 $np", "recurse: /-j2 --jobserver-auth=<auth> $np/\n#MAKE#[1]: warning: -jN forced in submake: disabling jobserver mode.\nrecurse2: /-j3 --jobserver-auth=<auth> $np/\nall: /-j3 --jobserver-auth=<auth> $np/\n");
+delete $extraENV{MAKEFLAGS};
+
+# Test override of -jN with -j
+run_make_test(q!
+SHOW = $(patsubst --jobserver-auth=%,--jobserver-auth=<auth>,$(MAKEFLAGS))
+recurse: ; @echo $@: "/$(SHOW)/"; $(MAKE) -j -f #MAKEFILE# recurse2
+recurse2: ; @echo $@: "/$(SHOW)/"; $(MAKE) -f #MAKEFILE# all
+all:;@echo $@: "/$(SHOW)/"
+!,
+ "-j2 $np", "recurse: /-j2 --jobserver-auth=<auth> $np/\n#MAKE#[1]: warning: -jN forced in submake: disabling jobserver mode.\nrecurse2: /-j $np/\nall: /-j $np/\n");
+
+# Don't put --jobserver-auth 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
@@ -34,7 +76,7 @@ inc.mk:
# @echo 'MAKEFLAGS = $(MAKEFLAGS)'
@echo 'FOO = bar' > $@
!,
- '--no-print-directory -j2', "#MAKE#[1]: warning: -jN forced in submake: disabling jobserver mode.\nall\n");
+ "$np -j2", "#MAKE#[1]: warning: -jN forced in submake: disabling jobserver mode.\nall\n");
unlink('inc.mk');
@@ -52,10 +94,14 @@ close(MAKEFILE);
run_make_test(q!
default: ; @ #MAKEPATH# -f Makefile2
!,
- '-j2 --no-print-directory',
+ "-j2 $np",
"#MAKE#[1]: warning: jobserver unavailable: using -j1. Add '+' to parent make rule.
#MAKE#[1]: Nothing to be done for 'foo'.");
rmfiles('Makefile2');
1;
+
+### Local Variables:
+### eval: (setq whitespace-action (delq 'auto-cleanup whitespace-action))
+### End:
diff --git a/tests/scripts/features/load b/tests/scripts/features/load
index 1f8cdc22..2e9318d5 100644
--- a/tests/scripts/features/load
+++ b/tests/scripts/features/load
@@ -56,7 +56,7 @@ load testload.so
POST := $(.LOADED)
all: ; @echo pre=$(PRE) post=$(POST) $(TESTLOAD)
!,
- '', "pre= post=testload.so implicit\n");
+ '--warn-undefined-variables', "pre= post=testload.so implicit\n");
# TEST 2
# Load using an explicit function
diff --git a/tests/scripts/features/output-sync b/tests/scripts/features/output-sync
index a7534cb7..7237e65b 100644
--- a/tests/scripts/features/output-sync
+++ b/tests/scripts/features/output-sync
@@ -53,6 +53,8 @@ sub output_sync_set {
@syncfiles = qw(mksync.foo mksync.foo_start mksync.bar mksync.bar_start);
+$tmout = 30;
+
output_sync_clean();
mkdir('foo', 0777);
mkdir('bar', 0777);
@@ -140,7 +142,7 @@ bar: start
bar: end
baz: start
baz: end
-#MAKE#[1]: Leaving directory '#PWD#/bar'\n", 0, 6);
+#MAKE#[1]: Leaving directory '#PWD#/bar'\n", 0, $tmout);
# Test per-target synchronization.
# Note we have to sleep again here after starting the foo makefile before
@@ -171,7 +173,7 @@ foo: end
#MAKE#[1]: Entering directory '#PWD#/bar'
baz: start
baz: end
-#MAKE#[1]: Leaving directory '#PWD#/bar'\n", 0, 6);
+#MAKE#[1]: Leaving directory '#PWD#/bar'\n", 0, $tmout);
# Rerun but this time suppress the directory tracking
unlink(@syncfiles);
@@ -183,7 +185,7 @@ bar: end
foo: start
foo: end
baz: start
-baz: end\n", 0, 6);
+baz: end\n", 0, $tmout);
# Test that messages from make itself are enclosed with
# "Entering/Leaving directory" messages.
@@ -204,11 +206,9 @@ bar: end
#MAKE#[1]: Entering directory '#PWD#/foo'
foo-fail: start
foo-fail: end
-Makefile:20: recipe for target 'foo-fail' failed
-#MAKE#[1]: *** [foo-fail] Error 1
+#MAKE#[1]: *** [Makefile:23: foo-fail] Error 1
#MAKE#[1]: Leaving directory '#PWD#/foo'
-#MAKEFILE#:4: recipe for target 'make-foo-fail' failed
-#MAKE#: *** [make-foo-fail] Error 2\n",
+#MAKE#: *** [#MAKEFILE#:4: make-foo-fail] Error 2\n",
512);
# Test the per-job synchronization.
@@ -238,7 +238,7 @@ bar: end
#MAKE#[1]: Leaving directory '#PWD#/bar'
#MAKE#[1]: Entering directory '#PWD#/foo'
foo: end
-#MAKE#[1]: Leaving directory '#PWD#/foo'\n", 0, 6);
+#MAKE#[1]: Leaving directory '#PWD#/foo'\n", 0, $tmout);
# Remove temporary directories and contents.
@@ -326,7 +326,7 @@ run_make_test(qq!
all: t1
t1: ; -\@\$(MAKE) -f $m1
!,
- "-j -Oline", "#MAKE#[1]: Entering directory '#PWD#'\nd1 stderr\nd1 stdout\n$m1:3: *** d1 failed. Stop.\n#MAKE#[1]: Leaving directory '#PWD#'\n#MAKEFILE#:3: recipe for target 't1' failed\n#MAKE#: [t1] Error 2 (ignored)\n");
+ "-j -Oline", "#MAKE#[1]: Entering directory '#PWD#'\nd1 stderr\nd1 stdout\n$m1:3: *** d1 failed. Stop.\n#MAKE#[1]: Leaving directory '#PWD#'\n#MAKE#: [#MAKEFILE#:3: t1] Error 2 (ignored)\n");
rmfiles($m1);
@@ -337,5 +337,13 @@ foo: $(OBJS) ; echo $(or $(filter %.o,$^),$(error fail))
!,
'-O', "#MAKEFILE#:2: *** fail. Stop.\n", 512);
+# SV 47365: Make sure exec failure error messages are shown
+# Is "127" not always the same everywhere? We may have to detect it?
+
+run_make_test(q!
+all:: ; @./foo bar baz
+!,
+ '-O', "#MAKE#: ./foo: Command not found\n#MAKE#: *** [#MAKEFILE#:2: all] Error 127\n", 512);
+
# This tells the test driver that the perl test script executed properly.
1;
diff --git a/tests/scripts/features/parallelism b/tests/scripts/features/parallelism
index c702c268..fabe5485 100644
--- a/tests/scripts/features/parallelism
+++ b/tests/scripts/features/parallelism
@@ -99,15 +99,12 @@ ok:
\@$sleep_command 4
\@echo Ok done",
'-rR -j5', "Fail
-#MAKEFILE#:6: recipe for target 'fail.1' failed
-#MAKE#: *** [fail.1] Error 1
+#MAKE#: *** [#MAKEFILE#:8: fail.1] Error 1
#MAKE#: *** Waiting for unfinished jobs....
Fail
-#MAKEFILE#:6: recipe for target 'fail.2' failed
-#MAKE#: *** [fail.2] Error 1
+#MAKE#: *** [#MAKEFILE#:8: fail.2] Error 1
Fail
-#MAKEFILE#:6: recipe for target 'fail.3' failed
-#MAKE#: *** [fail.3] Error 1
+#MAKE#: *** [#MAKEFILE#:8: fail.3] Error 1
Ok done",
512);
@@ -214,3 +211,7 @@ rmfiles('file1', 'file2', 'file3', 'file4');
# rmfiles(qw(dependfile output));
1;
+
+### Local Variables:
+### eval: (setq whitespace-action (delq 'auto-cleanup whitespace-action))
+### End:
diff --git a/tests/scripts/features/patternrules b/tests/scripts/features/patternrules
index 0ff49a75..c7ae7cff 100644
--- a/tests/scripts/features/patternrules
+++ b/tests/scripts/features/patternrules
@@ -110,8 +110,7 @@ $(dir)/foo.bar:
',
"dir=$dir",
-"#MAKEFILE#:6: recipe for target '$dir/foo.bar' failed
-#MAKE#: *** [$dir/foo.bar] Error 1",
+"#MAKE#: *** [#MAKEFILE#:6: $dir/foo.bar] Error 1",
512);
unlink("$dir/foo.bar");
@@ -223,3 +222,7 @@ all: foo.x foo-mt.x
# This tells the test driver that the perl test script executed properly.
1;
+
+### Local Variables:
+### eval: (setq whitespace-action (delq 'auto-cleanup whitespace-action))
+### End:
diff --git a/tests/scripts/features/vpath3 b/tests/scripts/features/vpath3
index c6ede282..839fb723 100644
--- a/tests/scripts/features/vpath3
+++ b/tests/scripts/features/vpath3
@@ -17,6 +17,12 @@ my @files_to_touch = ("a1${pathsep}lib1.a",
"b3${pathsep}lib3.so");
&touch(@files_to_touch);
+my $answer = "a1${pathsep}lib1.a a1${pathsep}libc.a " .
+ "a2${pathsep}lib2.a lib3.a\n";
+if ($port_type eq 'VMS-DCL') {
+ $answer =~ s/ /,/g;
+}
+
run_make_test('
vpath %.h b3
vpath %.a a1
@@ -25,7 +31,7 @@ vpath % a2 b2
vpath % b3
all: -l1 -lc -l2 -l3; @echo $^
',
- '', "a1${pathsep}lib1.a a1${pathsep}libc.a a2${pathsep}lib2.a lib3.a\n");
+ '', $answer);
unlink(@files_to_touch);
for my $d (@dirs_to_make) {
diff --git a/tests/scripts/features/vpathplus b/tests/scripts/features/vpathplus
index 361788c7..9ade3f0c 100644
--- a/tests/scripts/features/vpathplus
+++ b/tests/scripts/features/vpathplus
@@ -86,8 +86,7 @@ cat ${VP}foo.c bar.c > foo.b 2>/dev/null || exit 1
$answer = "not creating notarget.c from notarget.d
cat notarget.c > notarget.b 2>/dev/null || exit 1
-$makefile:16: recipe for target 'notarget.b' failed
-$make_name: *** [notarget.b] Error 1
+$make_name: *** [$makefile:16: notarget.b] Error 1
";
&compare_output($answer,&get_logfile(1));
@@ -127,3 +126,7 @@ rm inter.c
unlink @touchedfiles unless $keep;
1;
+
+### Local Variables:
+### eval: (setq whitespace-action (delq 'auto-cleanup whitespace-action))
+### End:
diff --git a/tests/scripts/functions/call b/tests/scripts/functions/call
index 9db9da71..dc1a6233 100644
--- a/tests/scripts/functions/call
+++ b/tests/scripts/functions/call
@@ -4,11 +4,7 @@ $description = "Test the call function.\n";
$details = "Try various uses of call and ensure they all give the correct
results.\n";
-open(MAKEFILE, "> $makefile");
-
-# The Contents of the MAKEFILE ...
-
-print MAKEFILE <<'EOMAKE';
+run_make_test(q!
# Simple, just reverse two things
#
reverse = $2 $1
@@ -48,35 +44,22 @@ all: ; @echo '$(call reverse,bar,foo)'; \
echo '$(call my-foreach,a,,,)'; \
echo '$(call my-if,a,b,c)'; \
echo '$(call two,bar,baz)'; \
- echo '$(call tclose,foo)'
-
-
+ echo '$(call tclose,foo)';
+!,
+ "", "foo bar\ndefault file file\nb d f\n\n\nb\nbar foo baz\nfoo bar baz blarp quux \n");
-EOMAKE
-
-# These won't work until/unless PR/1527 is resolved.
-# echo '$(call my-foreach,a,x y z,$(a)$(a))'; \
-# echo '$(call my-if,,$(warning don't print this),ok)'
+# These won't work because call expands all its arguments first, before
+# passing them on, then marks them as resolved/simple, so they're not
+# expanded again by the function.
#
-# $answer = "xx yy zz\nok\n";
-
-# END of Contents of MAKEFILE
-
-close(MAKEFILE);
-
-&run_make_with_options($makefile, "", &get_logfile);
-$answer = "foo bar\ndefault file file\nb d f\n\n\nb\nbar foo baz\nfoo bar baz blarp quux \n";
-&compare_output($answer, &get_logfile(1));
-
+# echo '$(call my-foreach,a,x y z,$$(a)$$(a))'; \
+# echo '$(call my-if,,$$(info don't print this),$$(info do print this))'
+#
+# $answer = "xx yy zz\ndo print this\n";
# TEST eclipsing of arguments when invoking sub-calls
-$makefile2 = &get_tmpfile;
-
-open(MAKEFILE,"> $makefile2");
-
-print MAKEFILE <<'EOF';
-
+run_make_test(q!
all = $1 $2 $3 $4 $5 $6 $7 $8 $9
level1 = $(call all,$1,$2,$3,$4,$5)
@@ -88,13 +71,8 @@ all:
@echo $(call level1,1,2,3,4,5,6,7,8)
@echo $(call level2,1,2,3,4,5,6,7,8)
@echo $(call level3,1,2,3,4,5,6,7,8)
-EOF
-
-close(MAKEFILE);
-
-&run_make_with_options($makefile2, "", &get_logfile);
-$answer = "1 2 3 4 5 6 7 8 9\n1 2 3 4 5\n1 2 3\n1 2 3\n";
-&compare_output($answer,&get_logfile(1));
+!,
+ "", "1 2 3 4 5 6 7 8 9\n1 2 3 4 5\n1 2 3\n1 2 3\n");
# Ensure that variables are defined in global scope even in a $(call ...)
@@ -108,3 +86,7 @@ all: ; @echo "$${X123-not set}"
'', "\n");
1;
+
+### Local Variables:
+### eval: (setq whitespace-action (delq 'auto-cleanup whitespace-action))
+### End:
diff --git a/tests/scripts/functions/error b/tests/scripts/functions/error
index 0d61177f..998afe48 100644
--- a/tests/scripts/functions/error
+++ b/tests/scripts/functions/error
@@ -54,7 +54,7 @@ $answer = "Some stuff\n$makefile:12: *** error is maybe. Stop.\n";
# Test #4
&run_make_with_options($makefile, "ERROR4=definitely", &get_logfile, 512);
-$answer = "Some stuff\n$makefile:16: *** error is definitely. Stop.\n";
+$answer = "Some stuff\n$makefile:17: *** error is definitely. Stop.\n";
&compare_output($answer,&get_logfile(1));
# Test #5
@@ -66,8 +66,6 @@ $answer = "$makefile:22: *** Error found!. Stop.\n";
# This tells the test driver that the perl test script executed properly.
1;
-
-
-
-
-
+### Local Variables:
+### eval: (setq whitespace-action (delq 'auto-cleanup whitespace-action))
+### End:
diff --git a/tests/scripts/functions/file b/tests/scripts/functions/file
index 55eb58a0..904db790 100644
--- a/tests/scripts/functions/file
+++ b/tests/scripts/functions/file
@@ -115,4 +115,47 @@ x:;@cat file.out
unlink('file.out');
+# Reading files
+run_make_test(q!
+$(file >file.out,A = foo)
+X1 := $(file <file.out)
+$(file >>file.out,B = bar)
+$(eval $(file <file.out))
+
+x:;@echo '$(X1)'; echo '$(A)'; echo '$(B)'
+!,
+ '', "A = foo\nfoo\nbar\n");
+
+unlink('file.out');
+
+# Reading from non-existent file
+run_make_test(q!
+X1 := $(file <file.out)
+x:;@echo '$(X1)';
+!,
+ '', "\n");
+
+# Extra arguments in read mode
+run_make_test(q!
+X1 := $(file <file.out,foo)
+x:;@echo '$(X1)';
+!,
+ '', "#MAKEFILE#:2: *** file: too many arguments. Stop.\n", 512);
+
+
+# Missing filename
+run_make_test('$(file >)', '',
+ "#MAKEFILE#:1: *** file: missing filename. Stop.\n", 512);
+
+run_make_test('$(file >>)', '',
+ "#MAKEFILE#:1: *** file: missing filename. Stop.\n", 512);
+
+run_make_test('$(file <)', '',
+ "#MAKEFILE#:1: *** file: missing filename. Stop.\n", 512);
+
+# Bad call
+
+run_make_test('$(file foo)', '',
+ "#MAKEFILE#:1: *** file: invalid file operation: foo. Stop.\n", 512);
+
1;
diff --git a/tests/scripts/functions/foreach b/tests/scripts/functions/foreach
index 4d1a11d1..451839a2 100644
--- a/tests/scripts/functions/foreach
+++ b/tests/scripts/functions/foreach
@@ -53,8 +53,26 @@ $(foreach x,FOREACH,$(eval $(value mktarget)))',
'',
'FOREACH');
+# Allow variable names with trailing space
+run_make_test(q!
+$(foreach \
+ a \
+, b c d \
+, $(info $a))
+all:;@:
+!,
+ "", "b\nc\nd\n");
+
+# Allow empty variable names. We still expand the body.
-# TEST 2: Check some error conditions.
+run_make_test('
+x = $(foreach ,1 2 3,a)
+y := $x
+
+all: ; @echo $y',
+ '', "a a a\n");
+
+# Check some error conditions.
run_make_test('
x = $(foreach )
@@ -66,12 +84,12 @@ all: ; @echo $y',
512);
run_make_test('
-x = $(foreach )
+x = $(foreach x,y)
y := $x
all: ; @echo $y',
'',
- "#MAKEFILE#:2: *** insufficient number of arguments (1) to function 'foreach'. Stop.",
+ "#MAKEFILE#:2: *** insufficient number of arguments (2) to function 'foreach'. Stop.",
512);
1;
diff --git a/tests/scripts/functions/shell b/tests/scripts/functions/shell
index 723cd0ed..809c77fa 100644
--- a/tests/scripts/functions/shell
+++ b/tests/scripts/functions/shell
@@ -4,11 +4,26 @@ $description = 'Test the $(shell ...) function.';
$details = '';
+# Test standard shell
+run_make_test('.PHONY: all
+OUT := $(shell echo hi)
+all: ; @echo $(OUT)
+ ','','hi');
# Test shells inside rules.
run_make_test('.PHONY: all
all: ; @echo $(shell echo hi)
-','','hi');
+ ','','hi');
+
+# Verify .SHELLSTATUS
+run_make_test('.PHONY: all
+PRE := $(.SHELLSTATUS)
+$(shell exit 0)
+OK := $(.SHELLSTATUS)
+$(shell exit 1)
+BAD := $(.SHELLSTATUS)
+all: ; @echo PRE=$(PRE) OK=$(OK) BAD=$(BAD)
+ ','','PRE= OK=0 BAD=1');
# Test unescaped comment characters in shells. Savannah bug #20513
@@ -27,6 +42,19 @@ run_make_test('
export HI = $(shell echo hi)
.PHONY: all
all: ; @echo $$HI
-','','hi');
+ ','','hi');
+
+# Test shell errors in recipes including offset
+run_make_test('
+all:
+ @echo hi
+ $(shell ./basdfdfsed there)
+ @echo there
+',
+ '', "#MAKE#: ./basdfdfsed: Command not found\nhi\nthere\n");
1;
+
+### Local Variables:
+### eval: (setq whitespace-action (delq 'auto-cleanup whitespace-action))
+### End:
diff --git a/tests/scripts/functions/sort b/tests/scripts/functions/sort
index b5589103..f1791437 100644
--- a/tests/scripts/functions/sort
+++ b/tests/scripts/functions/sort
@@ -12,20 +12,20 @@ remove all duplicates\n";
run_make_test('
foo := moon_light days
foo1:= jazz
-bar := captured
-bar2 = boy end, has rise A midnight
+bar := captured
+bar2 = boy end, has rise A midnight
bar3:= $(foo)
s1 := _by
s2 := _and_a
t1 := $(addsuffix $(s1), $(bar) )
t2 := $(addsuffix $(s2), $(foo1) )
-t3 := $(t2) $(t2) $(t2) $(t2) $(t2) $(t2) $(t2) $(t2) $(t2) $(t2)
-t4 := $(t3) $(t3) $(t3) $(t3) $(t3) $(t3) $(t3) $(t3) $(t3) $(t3)
-t5 := $(t4) $(t4) $(t4) $(t4) $(t4) $(t4) $(t4) $(t4) $(t4) $(t4)
-t6 := $(t5) $(t5) $(t5) $(t5) $(t5) $(t5) $(t5) $(t5) $(t5) $(t5)
-t7 := $(t6) $(t6) $(t6)
+t3 := $(t2) $(t2) $(t2) $(t2) $(t2) $(t2) $(t2) $(t2) $(t2) $(t2)
+t4 := $(t3) $(t3) $(t3) $(t3) $(t3) $(t3) $(t3) $(t3) $(t3) $(t3)
+t5 := $(t4) $(t4) $(t4) $(t4) $(t4) $(t4) $(t4) $(t4) $(t4) $(t4)
+t6 := $(t5) $(t5) $(t5) $(t5) $(t5) $(t5) $(t5) $(t5) $(t5) $(t5)
+t7 := $(t6) $(t6) $(t6)
p1 := $(addprefix $(foo1), $(s2) )
-blank:=
+blank:=
all:
@echo $(sort $(bar2) $(foo) $(addsuffix $(s1), $(bar) ) $(t2) $(bar2) $(bar3))
@echo $(sort $(blank) $(foo) $(bar2) $(t1) $(p1) )
@@ -42,6 +42,10 @@ A boy captured_by days end, has jazz_and_a midnight moon_light rise
run_make_test("FOO = a b\tc\rd\fe \f \f \f \f \ff
all: ; \@echo \$(words \$(sort \$(FOO)))\n",
- '', "5\n");
+ '', "6\n");
1;
+
+### Local Variables:
+### eval: (setq whitespace-action (delq 'auto-cleanup whitespace-action))
+### End:
diff --git a/tests/scripts/functions/warning b/tests/scripts/functions/warning
index cd452d41..16eb83bb 100644
--- a/tests/scripts/functions/warning
+++ b/tests/scripts/functions/warning
@@ -52,14 +52,32 @@ $answer = "Some stuff\n$makefile:10: warning is maybe\nhi\n";
# Test #4
&run_make_with_options($makefile, "WARNING4=definitely", &get_logfile, 0);
-$answer = "Some stuff\n$makefile:14: warning is definitely\nhi\nthere\n";
+$answer = "Some stuff\n$makefile:15: warning is definitely\nhi\nthere\n";
&compare_output($answer,&get_logfile(1));
+# Test linenumber offset
+
+run_make_test(q!
+all: one two
+ $(warning in $@ line 3)
+ @true
+ $(warning in $@ line 5)
+
+one two:
+ $(warning in $@ line 8)
+ @true
+ $(warning in $@ line 10)
+!,
+ '', "#MAKEFILE#:8: in one line 8
+#MAKEFILE#:10: in one line 10
+#MAKEFILE#:8: in two line 8
+#MAKEFILE#:10: in two line 10
+#MAKEFILE#:3: in all line 3
+#MAKEFILE#:5: in all line 5\n");
+
# This tells the test driver that the perl test script executed properly.
1;
-
-
-
-
-
+### Local Variables:
+### eval: (setq whitespace-action (delq 'auto-cleanup whitespace-action))
+### End:
diff --git a/tests/scripts/misc/bs-nl b/tests/scripts/misc/bs-nl
index 4fc3f639..fc323ce9 100644
--- a/tests/scripts/misc/bs-nl
+++ b/tests/scripts/misc/bs-nl
@@ -125,5 +125,103 @@ close(MAKEFILE);
run_make_with_options($m2, '', get_logfile());
compare_output("foo bar\n", get_logfile(1));
+# Test different types of whitespace, and bsnl inside functions
+
+sub xlate
+{
+ $_ = $_[0];
+ s/\\r/\r/g;
+ s/\\t/\t/g;
+ s/\\f/\f/g;
+ s/\\v/\v/g;
+ s/\\n/\n/g;
+ return $_;
+}
+
+run_make_test(xlate(q!
+$(foreach\r a \t , b\t c \r ,$(info $a \r ) )
+all:;@:
+!),
+ '', "b \r \nc \r \n");
+
+run_make_test(xlate(q!
+all:;@:$(foreach\r a \t , b\t c \r ,$(info $a \r ) )
+!),
+ '', "b \r \nc \r \n");
+
+run_make_test(xlate(q!
+$(foreach \
+\r a \t\
+ , b\t \
+ c \r ,$(info \
+ $a \r ) \
+ )
+all:;@:
+!),
+ '', "b \r \nc \r \n");
+
+run_make_test(xlate(q!
+all:;@:$(foreach \
+\r a \t\
+ , b\t \
+ c \r ,$(info \
+ $a \r ) \
+ )
+!),
+ '', "b \r \nc \r \n");
+
+run_make_test(xlate(q!
+define FOO
+$(foreach
+\r a \t
+ , b\t
+ c \r ,$(info
+ $a \r )
+ )
+endef
+$(FOO)
+all:;@:
+!),
+ '', "b \r \nc \r \n");
+
+run_make_test(xlate(q!
+define FOO
+$(foreach
+\r a \t
+ , b\t
+ c \r ,$(info
+ $a \r )
+ )
+endef
+all:;@:$(FOO)
+!),
+ '', "b \r \nc \r \n");
+
+# Test variables in recipes that expand to multiple lines
+
+run_make_test(q!
+define var
+
+echo foo
+
+
+echo bar
+endef
+all:;$(var)
+!,
+ '', "echo foo\nfoo\necho bar\nbar\n");
+
+run_make_test(q!
+define var
+
+echo foo
+
+@
+
+echo bar
+endef
+all:;$(var)
+!,
+ '', "echo foo\nfoo\necho bar\nbar\n");
1;
diff --git a/tests/scripts/misc/fopen-fail b/tests/scripts/misc/fopen-fail
index 6580e519..2ec9810b 100644
--- a/tests/scripts/misc/fopen-fail
+++ b/tests/scripts/misc/fopen-fail
@@ -7,9 +7,12 @@ $description = "Make sure make exits with an error if fopen fails.";
# since it's hard to know what it will be, exactly.
# See Savannah bug #27374.
+# Use a longer-than-normal timeout: some systems have more FDs available?
+# We also set ulimit -n 512 in check-regression in Makefile.am, which see.
+# See Savannah bug #42390.
run_make_test(q!
include $(lastword $(MAKEFILE_LIST))
!,
- '', undef, 512);
+ '', undef, 512, 300);
1;
diff --git a/tests/scripts/misc/general3 b/tests/scripts/misc/general3
index 8ad0f8e2..7bbff1c2 100644
--- a/tests/scripts/misc/general3
+++ b/tests/scripts/misc/general3
@@ -310,4 +310,6 @@ foo bar
hi
foo bar');
+run_make_test('x:;@-exit 1', '', "#MAKE#: [#MAKEFILE#:1: x] Error 1 (ignored)\n");
+
1;
diff --git a/tests/scripts/options/dash-B b/tests/scripts/options/dash-B
index 9c708b77..4c4c4cfb 100644
--- a/tests/scripts/options/dash-B
+++ b/tests/scripts/options/dash-B
@@ -45,7 +45,6 @@ include foo.x
foo.x: ; @touch $@
',
'-B', 'MAKE_RESTARTS=
-#MAKEFILE#:4: foo.x: No such file or directory
MAKE_RESTARTS=1');
rmfiles('foo.x');
@@ -63,7 +62,6 @@ foo.x: ; @touch $@
blah.x: ; @echo $@
',
'-B', 'MAKE_RESTARTS=
-#MAKEFILE#:4: foo.x: No such file or directory
MAKE_RESTARTS=1
blah.x
all');
@@ -83,3 +81,7 @@ x.a: x.b ; @echo $?
unlink(qw(x.a x.b));
1;
+
+### Local Variables:
+### eval: (setq whitespace-action (delq 'auto-cleanup whitespace-action))
+### End:
diff --git a/tests/scripts/options/dash-W b/tests/scripts/options/dash-W
index 20b9f745..857b1cce 100644
--- a/tests/scripts/options/dash-W
+++ b/tests/scripts/options/dash-W
@@ -42,8 +42,7 @@ foo.x: bar.x
bar.x: ; echo >> $@
baz.x: bar.x ; @echo "touch $@"
',
- '', '#MAKEFILE#:3: foo.x: No such file or directory
-echo >> bar.x
+ '', 'echo >> bar.x
touch foo.x
restarts=1
touch baz.x');
@@ -86,3 +85,7 @@ unlink(qw(y x-dir/x));
rmdir('x-dir');
1;
+
+### Local Variables:
+### eval: (setq whitespace-action (delq 'auto-cleanup whitespace-action))
+### End:
diff --git a/tests/scripts/options/dash-k b/tests/scripts/options/dash-k
index e784e0db..85dd0b0a 100644
--- a/tests/scripts/options/dash-k
+++ b/tests/scripts/options/dash-k
@@ -42,7 +42,7 @@ close(MAKEFILE);
"$workdir${pathsep}command.h",
"$workdir${pathsep}commands.c","$workdir${pathsep}display.c",
"$workdir${pathsep}buffer.h",
- "$workdir${pathsep}command.c");
+ "$workdir${pathsep}command.c");
&touch(@files_to_touch);
@@ -92,8 +92,7 @@ close(MAKEFILE);
&run_make_with_options($makefile2, "-k", &get_logfile, $error_code);
$answer = "exit 1
-$makefile2:9: recipe for target 'foo.o' failed
-$make_name: *** [foo.o] Error 1
+$make_name: *** [$makefile2:9: foo.o] Error 1
$make_name: Target 'all' not remade because of errors.\n";
&compare_output($answer, &get_logfile(1));
diff --git a/tests/scripts/options/dash-n b/tests/scripts/options/dash-n
index dfed419d..02ae4a99 100644
--- a/tests/scripts/options/dash-n
+++ b/tests/scripts/options/dash-n
@@ -92,7 +92,7 @@ EOF
close(MAKEFILE);
&run_make_with_options($topmake, '-n --no-print-directory', &get_logfile);
-$answer = "$make_path -f \"$submake\" bar\ntouch inc\necho n --no-print-directory\n";
+$answer = "$make_command -f \"$submake\" bar\ntouch inc\necho n --no-print-directory\n";
&compare_output($answer, &get_logfile(1));
unlink('inc');
diff --git a/tests/scripts/options/dash-q b/tests/scripts/options/dash-q
index 194588d9..e67b55d4 100644
--- a/tests/scripts/options/dash-q
+++ b/tests/scripts/options/dash-q
@@ -74,4 +74,13 @@ build-y: build-x
',
'-q build-y', "#MAKE#: *** No rule to make target 'build-stamp-2', needed by 'build-arch'. Stop.\n", 512);
+# TEST 9 : Savannah bug # 47151
+# Make sure we exit with 1 when invoking a recursive make
+run_make_test('
+foo: bar ; echo foo
+bar: ; @$(MAKE) -f #MAKEFILE# baz
+baz: ; echo baz
+',
+ '-q foo', '', 256);
+
1;
diff --git a/tests/scripts/options/print-directory b/tests/scripts/options/print-directory
index a05bbee7..db762b2c 100644
--- a/tests/scripts/options/print-directory
+++ b/tests/scripts/options/print-directory
@@ -18,7 +18,7 @@ include foo
all: ;@:
foo: ; touch foo
!,
- "", "#MAKEFILE#:2: foo: No such file or directory\ntouch foo\n");
+ "", "touch foo\n");
unlink('foo');
# Test makefile rebuild with -w
@@ -27,7 +27,7 @@ include foo
all: ;@:
foo: ; touch foo
!,
- "-w", "#MAKE#: Entering directory '#PWD#'\n#MAKEFILE#:2: foo: No such file or directory\ntouch foo\n#MAKE#: Leaving directory '#PWD#'\n");
+ "-w", "#MAKE#: Entering directory '#PWD#'\ntouch foo\n#MAKE#: Leaving directory '#PWD#'\n");
unlink('foo');
1;
diff --git a/tests/scripts/targets/DELETE_ON_ERROR b/tests/scripts/targets/DELETE_ON_ERROR
new file mode 100644
index 00000000..f0d9f9b4
--- /dev/null
+++ b/tests/scripts/targets/DELETE_ON_ERROR
@@ -0,0 +1,22 @@
+#! -*-perl-*-
+
+$description = "Test the behaviour of the .DELETE_ON_ERROR target.";
+
+$details = "";
+
+run_make_test('
+.DELETE_ON_ERROR:
+all: ; exit 1 > $@
+',
+ '', "exit 1 > all\n#MAKE#: *** [#MAKEFILE#:3: all] Error 1\n#MAKE#: *** Deleting file 'all'", 512);
+
+run_make_test('
+.DELETE_ON_ERROR:
+all: foo.x ;
+%.x : %.q ; echo > $@
+%.q : ; exit 1 > $@
+',
+ '', "exit 1 > foo.q\n#MAKE#: *** [#MAKEFILE#:5: foo.q] Error 1\n#MAKE#: *** Deleting file 'foo.q'", 512);
+
+# This tells the test driver that the perl test script executed properly.
+1;
diff --git a/tests/scripts/targets/POSIX b/tests/scripts/targets/POSIX
index a24e3bcf..5c3c7f89 100644
--- a/tests/scripts/targets/POSIX
+++ b/tests/scripts/targets/POSIX
@@ -17,8 +17,7 @@ run_make_test(qq!
.POSIX:
all: ; \@$script
!,
- '', "#MAKEFILE#:3: recipe for target 'all' failed
-#MAKE#: *** [all] Error $err\n", 512);
+ '', "#MAKE#: *** [#MAKEFILE#:3: all] Error $err\n", 512);
# User settings must override .POSIX
$flags = '-xc';
diff --git a/tests/scripts/variables/MAKEFLAGS b/tests/scripts/variables/MAKEFLAGS
index 8a5d0f6a..0fac74a3 100644
--- a/tests/scripts/variables/MAKEFLAGS
+++ b/tests/scripts/variables/MAKEFLAGS
@@ -39,3 +39,7 @@ jump Works: MAKEFLAGS=e --no-print-directory
print Works: MAKEFLAGS=e --no-print-directory');
1;
+
+### Local Variables:
+### eval: (setq whitespace-action (delq 'auto-cleanup whitespace-action))
+### End:
diff --git a/tests/scripts/variables/MAKE_RESTARTS b/tests/scripts/variables/MAKE_RESTARTS
index ef8e368f..01bf55ec 100644
--- a/tests/scripts/variables/MAKE_RESTARTS
+++ b/tests/scripts/variables/MAKE_RESTARTS
@@ -11,7 +11,6 @@ include foo.x
foo.x: ; @touch $@
',
'', 'MAKE_RESTARTS=
-#MAKEFILE#:4: foo.x: No such file or directory
MAKE_RESTARTS=1');
rmfiles('foo.x');
@@ -26,9 +25,7 @@ foo.x: ; @echo "include bar.x" > $@
bar.x: ; @touch $@
',
'', 'MAKE_RESTARTS=
-#MAKEFILE#:4: foo.x: No such file or directory
MAKE_RESTARTS=1
-foo.x:1: bar.x: No such file or directory
MAKE_RESTARTS=2');
rmfiles('foo.x', 'bar.x');
@@ -47,9 +44,7 @@ foo.x: ; @echo "include bar.x" > $@
bar.x: ; @touch $@
',
'', "MAKE_RESTARTS=
-#MAKEFILE#:8: foo.x: No such file or directory
MAKE_RESTARTS=1
-foo.x:1: bar.x: No such file or directory
MAKE_RESTARTS=2
recurse MAKE_RESTARTS=
#MAKE#[1]: Entering directory '#PWD#'
@@ -60,3 +55,7 @@ all MAKE_RESTARTS=
rmfiles('foo.x', 'bar.x');
1;
+
+### Local Variables:
+### eval: (setq whitespace-action (delq 'auto-cleanup whitespace-action))
+### End:
diff --git a/tests/scripts/variables/SHELL b/tests/scripts/variables/SHELL
index 1d01ba3f..edba7b67 100644
--- a/tests/scripts/variables/SHELL
+++ b/tests/scripts/variables/SHELL
@@ -97,7 +97,6 @@ run_make_test(qq!
.SHELLFLAGS = $flags
all: ; \@$script
!,
- '', "$out#MAKEFILE#:3: recipe for target 'all' failed
-#MAKE#: *** [all] Error $err\n", 512);
+ '', "$out#MAKE#: *** [#MAKEFILE#:3: all] Error $err\n", 512);
1;
diff --git a/tests/scripts/variables/special b/tests/scripts/variables/special
index a5ab93aa..68f3128c 100644
--- a/tests/scripts/variables/special
+++ b/tests/scripts/variables/special
@@ -14,14 +14,22 @@ X2 := $(sort $(filter FOO BAR,$(.VARIABLES)))
BAR := bar
-all:
- @echo X1 = $(X1)
- @echo X2 = $(X2)
- @echo LAST = $(sort $(filter FOO BAR,$(.VARIABLES)))
+all: ; @echo X1 = $(X1); echo X2 = $(X2); echo LAST = $(sort $(filter FOO BAR,$(.VARIABLES)))
',
'', "X1 =\nX2 = FOO\nLAST = BAR FOO\n");
+# SV 45728: Test that undefining a variable is reflected properly
+&run_make_test('
+FOO := foo
+BAR := bar
+$(info one: $(sort $(filter FOO BAR BAZ,$(.VARIABLES))))
+undefine BAR
+BAZ := baz
+$(info two: $(sort $(filter FOO BAR BAZ,$(.VARIABLES))))
+all:;@:
+',
+ '', "one: BAR FOO\ntwo: BAZ FOO\n");
# $makefile2 = &get_tmpfile;
# open(MAKEFILE, "> $makefile2");
@@ -31,9 +39,9 @@ all:
# X1 := $(sort $(.TARGETS))
# all: foo
-# @echo X1 = $(X1)
-# @echo X2 = $(X2)
-# @echo LAST = $(sort $(.TARGETS))
+# @echo X1 = $(X1)
+# @echo X2 = $(X2)
+# @echo LAST = $(sort $(.TARGETS))
# X2 := $(sort $(.TARGETS))
diff --git a/tests/scripts/vms/library b/tests/scripts/vms/library
new file mode 100644
index 00000000..9a64951e
--- /dev/null
+++ b/tests/scripts/vms/library
@@ -0,0 +1,73 @@
+# -*-mode: perl-*-
+
+$description = "Test GNU make's VMS Library management features.";
+
+$details = "\
+This only works on VMS systems.";
+
+return -1 if $osname ne 'VMS';
+
+# Help library
+$mk_string = "help : help.hlb(file1.hlp)\n\n" .
+"file1.hlp :\n" .
+"\t\@pipe open/write xxx file1.hlp ; write xxx \"1 help\" ; close xxx\n";
+
+my $answer = "library /replace help.hlb file1.hlp";
+
+run_make_test($mk_string,
+ '', $answer);
+
+unlink('help.hlb');
+unlink('file1.hlp');
+
+#Text library
+$mk_string = "text : text.tlb(file1.txt)\n\n" .
+"file1.txt :\n" .
+"\t\@pipe open/write xxx file1.txt ; write xxx \"text file\" ; close xxx\n";
+
+my $answer = "library /replace text.tlb file1.txt";
+
+run_make_test($mk_string,
+ '', $answer);
+
+unlink('text.tlb');
+unlink('file1.txt');
+
+
+#Macro library
+$mk_string = "macro : macro.mlb(file1.mar)\n\n" .
+"file1.mar :\n" .
+"\t\pipe open/write xxx file1.mar ; " .
+"write xxx \".macro a b\" ; write xxx \".endm\" ; close xxx\n";
+
+my $answer = "library /replace macro.mlb file1.mar";
+
+run_make_test($mk_string,
+ '', $answer);
+
+unlink('macro.mlb');
+unlink('file1.mar');
+
+$mk_string =
+"all:imagelib.olb(file2.exe)\n" .
+"file2.exe : file2.obj file2.opt\n" .
+"\t\@link /share=\$\@ \$\*,\$\*/opt\n\n" .
+"file2.opt :\n" .
+"\t\@pipe open/write xxx file2.opt ; " .
+"write xxx \"CASE_SENSITIVE=YES\" ; close xxx\n" .
+"file2.c :\n" .
+"\t\@pipe open/write xxx file2.c ; write xxx \"file2(){}\" ; close xxx\n";
+
+my $answer = "library /replace imagelib.olb file2.exe";
+
+run_make_test($mk_string,
+ '', $answer);
+
+unlink('imagelib.olb');
+unlink('file2.c');
+unlink('file2.obj');
+unlink('file2.exe');
+unlink('file2.opt');
+
+# This tells the test driver that the perl test script executed properly.
+1;
diff --git a/tests/test_driver.pl b/tests/test_driver.pl
index 91141eb4..e6cd9f9e 100644
--- a/tests/test_driver.pl
+++ b/tests/test_driver.pl
@@ -5,7 +5,7 @@
# Written 91-12-02 through 92-01-01 by Stephen McGee.
# Modified 92-02-11 through 92-02-22 by Chris Arthur to further generalize.
#
-# Copyright (C) 1991-2014 Free Software Foundation, Inc.
+# Copyright (C) 1991-2016 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
diff --git a/variable.c b/variable.c
index 01b6d89e..36ab1f45 100644
--- a/variable.c
+++ b/variable.c
@@ -1,5 +1,5 @@
/* Internals of variables for GNU Make.
-Copyright (C) 1988-2014 Free Software Foundation, Inc.
+Copyright (C) 1988-2016 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
@@ -29,6 +29,9 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
#endif
#include "hash.h"
+/* Incremented every time we add or remove a global variable. */
+static unsigned long variable_changenum;
+
/* Chain of all pattern-specific variables. */
static struct pattern_var *pattern_vars;
@@ -193,7 +196,7 @@ struct variable *
define_variable_in_set (const char *name, unsigned int length,
const char *value, enum variable_origin origin,
int recursive, struct variable_set *set,
- const gmk_floc *flocp)
+ const floc *flocp)
{
struct variable *v;
struct variable **var_slot;
@@ -205,11 +208,39 @@ define_variable_in_set (const char *name, unsigned int length,
var_key.name = (char *) name;
var_key.length = length;
var_slot = (struct variable **) hash_find_slot (&set->table, &var_key);
+ v = *var_slot;
+
+#ifdef VMS
+ /* VMS does not populate envp[] with DCL symbols and logical names which
+ historically are mapped to environent variables.
+ If the variable is not yet defined, then we need to check if getenv()
+ can find it. Do not do this for origin == o_env to avoid infinte
+ recursion */
+ if (HASH_VACANT (v) && (origin != o_env))
+ {
+ struct variable * vms_variable;
+ char * vname = alloca (length + 1);
+ char * vvalue;
+
+ strncpy (vname, name, length);
+ vvalue = getenv(vname);
+
+ /* Values starting with '$' are probably foreign commands.
+ We want to treat them as Shell aliases and not look them up here */
+ if ((vvalue != NULL) && (vvalue[0] != '$'))
+ {
+ vms_variable = lookup_variable(name, length);
+ /* Refresh the slot */
+ var_slot = (struct variable **) hash_find_slot (&set->table,
+ &var_key);
+ v = *var_slot;
+ }
+ }
+#endif
if (env_overrides && origin == o_env)
origin = o_env_override;
- v = *var_slot;
if (! HASH_VACANT (v))
{
if (env_overrides && v->origin == o_env)
@@ -240,6 +271,9 @@ define_variable_in_set (const char *name, unsigned int length,
v->name = xstrndup (name, length);
v->length = length;
hash_insert_at (&set->table, v, var_slot);
+ if (set == &global_variable_set)
+ ++variable_changenum;
+
v->value = xstrdup (value);
if (flocp != 0)
v->fileinfo = *flocp;
@@ -322,12 +356,15 @@ undefine_variable_in_set (const char *name, unsigned int length,
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. */
+ /* Undefine only if this undefinition is from an equal or stronger
+ source than the variable definition. */
if ((int) origin >= (int) v->origin)
{
hash_delete_at (&set->table, var_slot);
free_variable_name_and_value (v);
+ free (v);
+ if (set == &global_variable_set)
+ ++variable_changenum;
}
}
}
@@ -345,7 +382,7 @@ undefine_variable_in_set (const char *name, unsigned int length,
static struct variable *
lookup_special_var (struct variable *var)
{
- static unsigned long last_var_count = 0;
+ static unsigned long last_changenum = 0;
/* This one actually turns out to be very hard, due to the way the parser
@@ -373,8 +410,7 @@ lookup_special_var (struct variable *var)
else
*/
- if (streq (var->name, ".VARIABLES")
- && global_variable_set.table.ht_fill != last_var_count)
+ if (variable_changenum != last_changenum && streq (var->name, ".VARIABLES"))
{
unsigned long max = EXPANSION_INCREMENT (strlen (var->value));
unsigned long len;
@@ -410,11 +446,8 @@ lookup_special_var (struct variable *var)
}
*(p-1) = '\0';
- /* Remember how many variables are in our current count. Since we never
- remove variables from the list, this is a reliable way to know whether
- the list is up to date or needs to be recomputed. */
-
- last_var_count = global_variable_set.table.ht_fill;
+ /* Remember the current variable change number. */
+ last_changenum = variable_changenum;
}
return var;
@@ -450,8 +483,8 @@ lookup_variable (const char *name, unsigned int length)
}
#ifdef VMS
- /* since we don't read envp[] on startup, try to get the
- variable via getenv() here. */
+ /* VMS does not populate envp[] with DCL symbols and logical names which
+ historically are mapped to enviroment varables and returned by getenv() */
{
char *vname = alloca (length + 1);
char *value;
@@ -725,6 +758,8 @@ merge_variable_sets (struct variable_set *to_set,
struct variable **from_var_slot = (struct variable **) from_set->table.ht_vec;
struct variable **from_var_end = from_var_slot + from_set->table.ht_size;
+ int inc = to_set == &global_variable_set ? 1 : 0;
+
for ( ; from_var_slot < from_var_end; from_var_slot++)
if (! HASH_VACANT (*from_var_slot))
{
@@ -732,7 +767,10 @@ merge_variable_sets (struct variable_set *to_set,
struct variable **to_var_slot
= (struct variable **) hash_find_slot (&to_set->table, *from_var_slot);
if (HASH_VACANT (*to_var_slot))
- hash_insert_at (&to_set->table, from_var, to_var_slot);
+ {
+ hash_insert_at (&to_set->table, from_var, to_var_slot);
+ variable_changenum += inc;
+ }
else
{
/* GKM FIXME: delete in from_set->table */
@@ -784,7 +822,6 @@ merge_variable_set_lists (struct variable_set_list **setlist0,
void
define_automatic_variables (void)
{
- extern const char* default_shell;
struct variable *v;
char buf[200];
@@ -900,15 +937,7 @@ define_automatic_variables (void)
/* Define the magic D and F variables in terms of
the automatic variables they are variations of. */
-#ifdef VMS
- 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);
-#elif defined(__MSDOS__) || defined(WINDOWS32)
+#if defined(__MSDOS__) || defined(WINDOWS32)
/* For consistency, remove the trailing backslash as well as slash. */
define_variable_cname ("@D", "$(patsubst %/,%,$(patsubst %\\,%,$(dir $@)))",
o_automatic, 1);
@@ -1019,7 +1048,6 @@ target_environment (struct file *file)
/* If this is the SHELL variable and it's not exported,
then add the value from our original environment, if
the original environment defined a value for SHELL. */
- extern struct variable shell_var;
if (streq (v->name, "SHELL") && shell_var.value)
{
v = &shell_var;
@@ -1040,7 +1068,7 @@ target_environment (struct file *file)
}
}
- makelevel_key.name = xstrdup (MAKELEVEL_NAME);
+ makelevel_key.name = (char *)MAKELEVEL_NAME;
makelevel_key.length = MAKELEVEL_LENGTH;
hash_delete (&table, &makelevel_key);
@@ -1106,7 +1134,7 @@ set_special_var (struct variable *var)
* result. This removes only ONE newline (if any) at the end, for maximum
* compatibility with the *BSD makes. If it fails, returns NULL. */
-char *
+static char *
shell_result (const char *p)
{
char *buf;
@@ -1129,7 +1157,7 @@ shell_result (const char *p)
See the try_variable_definition() function for details on the parameters. */
struct variable *
-do_variable_definition (const gmk_floc *flocp, const char *varname,
+do_variable_definition (const floc *flocp, const char *varname,
const char *value, enum variable_origin origin,
enum variable_flavor flavor, int target_var)
{
@@ -1402,7 +1430,7 @@ parse_variable_definition (const char *p, struct variable *var)
int wspace = 0;
const char *e = NULL;
- p = next_token (p);
+ NEXT_TOKEN (p);
var->name = (char *)p;
var->length = 0;
@@ -1419,38 +1447,40 @@ parse_variable_definition (const char *p, struct variable *var)
/* This begins a variable expansion reference. Make sure we don't
treat chars inside the reference as assignment tokens. */
char closeparen;
- int count;
+ unsigned int count;
+
c = *p++;
if (c == '(')
closeparen = ')';
else if (c == '{')
closeparen = '}';
+ else if (c == '\0')
+ return NULL;
else
/* '$$' or '$X'. Either way, nothing special to do here. */
continue;
/* P now points past the opening paren or brace.
Count parens or braces until it is matched. */
- count = 0;
- for (; *p != '\0'; ++p)
+ for (count = 1; *p != '\0'; ++p)
{
- if (*p == c)
- ++count;
- else if (*p == closeparen && --count < 0)
+ if (*p == closeparen && --count == 0)
{
++p;
break;
}
+ if (*p == c)
+ ++count;
}
continue;
}
/* If we find whitespace skip it, and remember we found it. */
- if (isblank ((unsigned char)c))
+ if (ISBLANK (c))
{
wspace = 1;
e = p - 1;
- p = next_token (p);
+ NEXT_TOKEN (p);
c = *p;
if (c == '\0')
return NULL;
@@ -1562,7 +1592,7 @@ assign_variable_definition (struct variable *v, const char *line)
returned. */
struct variable *
-try_variable_definition (const gmk_floc *flocp, const char *line,
+try_variable_definition (const floc *flocp, const char *line,
enum variable_origin origin, int target_var)
{
struct variable v;
@@ -1626,7 +1656,7 @@ print_variable (const void *item, void *arg)
fputs (" private", stdout);
if (v->fileinfo.filenm)
printf (_(" (from '%s', line %lu)"),
- v->fileinfo.filenm, v->fileinfo.lineno);
+ v->fileinfo.filenm, v->fileinfo.lineno + v->fileinfo.offset);
putchar ('\n');
fputs (prefix, stdout);
@@ -1707,7 +1737,7 @@ print_variable_data_base (void)
{
struct pattern_var *p;
- int rules = 0;
+ unsigned int rules = 0;
for (p = pattern_vars; p != 0; p = p->next)
{
diff --git a/variable.h b/variable.h
index fa2dbbd1..fe1d609d 100644
--- a/variable.h
+++ b/variable.h
@@ -1,5 +1,5 @@
/* Definitions for using variables in GNU Make.
-Copyright (C) 1988-2014 Free Software Foundation, Inc.
+Copyright (C) 1988-2016 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
@@ -51,7 +51,7 @@ struct variable
{
char *name; /* Variable name. */
char *value; /* Variable value. */
- gmk_floc fileinfo; /* Where the variable was defined. */
+ floc fileinfo; /* Where the variable was defined. */
int length; /* strlen (name) */
unsigned int recursive:1; /* Gets recursively re-evaluated. */
unsigned int append:1; /* Nonzero if an appending target-specific
@@ -110,6 +110,7 @@ struct pattern_var
extern char *variable_buffer;
extern struct variable_set_list *current_variable_set_list;
extern struct variable *default_goal_var;
+extern struct variable shell_var;
/* expand.c */
char *variable_buffer_output (char *ptr, const char *string, unsigned int length);
@@ -134,7 +135,7 @@ char *patsubst_expand_pat (char *o, const char *text, const char *pattern,
const char *replace_percent);
char *patsubst_expand (char *o, const char *text, char *pattern, char *replace);
char *func_shell_base (char *o, char **argv, int trim_newlines);
-
+void shell_completed (int exit_code, int exit_sig);
/* expand.c */
char *recursively_expand_for_file (struct variable *v, struct file *file);
@@ -148,11 +149,10 @@ void pop_variable_scope (void);
void define_automatic_variables (void);
void initialize_file_variables (struct file *file, int reading);
void print_file_variables (const struct file *file);
-void print_file_variables (const struct file *file);
void print_target_variables (const struct file *file);
void merge_variable_set_lists (struct variable_set_list **to_list,
struct variable_set_list *from_list);
-struct variable *do_variable_definition (const gmk_floc *flocp,
+struct variable *do_variable_definition (const floc *flocp,
const char *name, const char *value,
enum variable_origin origin,
enum variable_flavor flavor,
@@ -160,12 +160,12 @@ struct variable *do_variable_definition (const gmk_floc *flocp,
char *parse_variable_definition (const char *line,
struct variable *v);
struct variable *assign_variable_definition (struct variable *v, const char *line);
-struct variable *try_variable_definition (const gmk_floc *flocp, const char *line,
+struct variable *try_variable_definition (const floc *flocp, const char *line,
enum variable_origin origin,
int target_var);
void init_hash_global_variable_set (void);
void hash_init_function_table (void);
-void define_new_function(const gmk_floc *flocp, const char *name,
+void define_new_function(const floc *flocp, const char *name,
unsigned int min, unsigned int max, unsigned int flags,
gmk_func_ptr func);
struct variable *lookup_variable (const char *name, unsigned int length);
@@ -177,7 +177,7 @@ struct variable *define_variable_in_set (const char *name, unsigned int length,
enum variable_origin origin,
int recursive,
struct variable_set *set,
- const gmk_floc *flocp);
+ const floc *flocp);
/* Define a variable in the current variable set. */
diff --git a/version.c b/version.c
index d94ecec3..e6d822d0 100644
--- a/version.c
+++ b/version.c
@@ -1,5 +1,5 @@
/* Record version and build host architecture for GNU make.
-Copyright (C) 1988-2014 Free Software Foundation, Inc.
+Copyright (C) 1988-2016 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
diff --git a/vms_exit.c b/vms_exit.c
new file mode 100644
index 00000000..b08d84d9
--- /dev/null
+++ b/vms_exit.c
@@ -0,0 +1,95 @@
+/* vms_exit.c
+ *
+ * Wrapper for the VMS exit() command to tranlate UNIX codes to be
+ * encoded for POSIX, but also have VMS severity levels.
+ * The posix_exit() variant only sets a severity level for status code 1.
+ *
+ * Author: John E. Malmberg
+ */
+
+/* Copyright (C) 2014-2016 Free Software Foundation, Inc.
+
+GNU Make is free software; you can redistribute it and/or modify it under the
+terms of the GNU General Public License as published by the Free Software
+Foundation; either version 3 of the License, or (at your option) any later
+version.
+
+GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License along with
+this program. If not, see <http://www.gnu.org/licenses/>. */
+
+
+/* Per copyright assignment agreement with the Free Software Foundation
+ this software may be available under under other license agreements
+ and copyrights. */
+
+#include <makeint.h>
+
+#include <stsdef.h>
+void
+decc$exit (int status);
+#ifndef C_FACILITY_NO
+# define C_FACILITY_NO 0x350000
+#endif
+
+/* Lowest legal non-success VMS exit code is 8 */
+/* GNU make only defines codes 0, 1, 2 */
+/* So assume any exit code > 8 is a VMS exit code */
+
+#ifndef MAX_EXPECTED_EXIT_CODE
+# define MAX_EXPECTED_EXIT_CODE 7
+#endif
+
+/* Build a Posix Exit with VMS severity */
+void
+vms_exit (int status)
+{
+ int vms_status;
+ /* Fake the __posix_exit with severity added */
+ /* Undocumented correct way to do this. */
+ vms_status = 0;
+
+ /* The default DECC definition is not compatible with doing a POSIX_EXIT */
+ /* So fix it. */
+ if (status == EXIT_FAILURE)
+ status = MAKE_FAILURE;
+
+ /* Trivial case exit success */
+ if (status == 0)
+ decc$exit (STS$K_SUCCESS);
+
+ /* Is this a VMS status then just take it */
+ if (status > MAX_EXPECTED_EXIT_CODE)
+ {
+ /* Make sure that the message inhibit is set since message has */
+ /* already been displayed. */
+ vms_status = status | STS$M_INHIB_MSG;
+ decc$exit (vms_status);
+ }
+
+ /* Unix status codes are limited to 1 byte, so anything larger */
+ /* is a probably a VMS exit code and needs to be passed through */
+ /* A lower value can be set for a macro. */
+ /* Status 0 is always passed through as it is converted to SS$_NORMAL */
+ /* Always set the message inhibit bit */
+ vms_status = C_FACILITY_NO | 0xA000 | STS$M_INHIB_MSG;
+ vms_status |= (status << 3);
+
+ /* STS$K_ERROR is for status that stops makefile that a simple */
+ /* Rerun of the makefile will not fix. */
+
+ if (status == MAKE_FAILURE)
+ vms_status |= STS$K_ERROR;
+ else if (status == MAKE_TROUBLE)
+ {
+ /* Make trouble is for when make was told to do nothing and */
+ /* found that a target was not up to date. Since a second */
+ /* of make will produce the same condition, this is of */
+ /* Error severity */
+ vms_status |= STS$K_ERROR;
+ }
+ decc$exit (vms_status);
+}
diff --git a/vms_export_symbol.c b/vms_export_symbol.c
new file mode 100644
index 00000000..954f3f4b
--- /dev/null
+++ b/vms_export_symbol.c
@@ -0,0 +1,527 @@
+/* File: vms_export_symbol.c
+ *
+ * Some programs need special environment variables deported as DCL
+ * DCL symbols.
+ */
+
+/* Copyright (C) 2014-2016 Free Software Foundation, Inc.
+
+GNU Make is free software; you can redistribute it and/or modify it under the
+terms of the GNU General Public License as published by the Free Software
+Foundation; either version 3 of the License, or (at your option) any later
+version.
+
+GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License along with
+this program. If not, see <http://www.gnu.org/licenses/>. */
+
+
+/* Per copyright assignment agreement with the Free Software Foundation
+ this software may be available under under other license agreements
+ and copyrights. */
+
+
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <errno.h>
+
+#include <descrip.h>
+#include <stsdef.h>
+#include <ssdef.h>
+#include <unixlib.h>
+#include <libclidef.h>
+
+#pragma member_alignment save
+#pragma nomember_alignment longword
+struct item_list_3
+{
+ unsigned short len;
+ unsigned short code;
+ void * bufadr;
+ unsigned short * retlen;
+};
+
+
+#pragma member_alignment
+
+int
+LIB$GET_SYMBOL (const struct dsc$descriptor_s * symbol,
+ struct dsc$descriptor_s * value,
+ unsigned short * value_len,
+ const unsigned long * table);
+
+int
+LIB$SET_SYMBOL (const struct dsc$descriptor_s * symbol,
+ const struct dsc$descriptor_s * value,
+ const unsigned long * table);
+
+int
+LIB$DELETE_SYMBOL (const struct dsc$descriptor_s * symbol,
+ const unsigned long * table);
+
+#define MAX_DCL_SYMBOL_LEN (255)
+#if __CRTL_VER >= 70302000 && !defined(__VAX)
+# define MAX_DCL_SYMBOL_VALUE (8192)
+#else
+# define MAX_DCL_SYMBOL_VALUE (1024)
+#endif
+
+struct dcl_symbol
+{
+ struct dcl_symbol * link;
+ struct dsc$descriptor_s name_desc;
+ struct dsc$descriptor_s value_desc;
+ char name[MAX_DCL_SYMBOL_LEN + 1]; /* + 1 byte for null terminator */
+ char value[MAX_DCL_SYMBOL_VALUE +1]; /* + 1 byte for null terminator */
+ char pad[3]; /* Pad structure to longword allignment */
+};
+
+static struct dcl_symbol * vms_dcl_symbol_head = NULL;
+
+/* Restore symbol state to original condition. */
+static unsigned long
+clear_dcl_symbol (struct dcl_symbol * symbol)
+{
+
+ const unsigned long symtbl = LIB$K_CLI_LOCAL_SYM;
+ int status;
+
+ if (symbol->value_desc.dsc$w_length == (unsigned short)-1)
+ status = LIB$DELETE_SYMBOL (&symbol->name_desc, &symtbl);
+ else
+ status = LIB$SET_SYMBOL (&symbol->name_desc,
+ &symbol->value_desc, &symtbl);
+ return status;
+}
+
+
+/* Restore all exported symbols to their original conditions */
+static void
+clear_exported_symbols (void)
+{
+
+ struct dcl_symbol * symbol;
+
+ symbol = vms_dcl_symbol_head;
+
+ /* Walk the list of symbols. This is done durring exit,
+ * so no need to free memory.
+ */
+ while (symbol != NULL)
+ {
+ clear_dcl_symbol (symbol);
+ symbol = symbol->link;
+ }
+
+}
+
+
+/* Restore the symbol back to the original value
+ * symbol name is either a plain name or of the form "symbol=name" where
+ * the name portion is ignored.
+ */
+void
+vms_restore_symbol (const char * string)
+{
+
+ struct dcl_symbol * symbol;
+ char name[MAX_DCL_SYMBOL_LEN + 1];
+ int status;
+ char * value;
+ int name_len;
+
+ symbol = vms_dcl_symbol_head;
+
+ /* Isolate the name from the value */
+ value = strchr (string, '=');
+ if (value != NULL)
+ {
+ /* Copy the name from the string */
+ name_len = (value - string);
+ }
+ else
+ name_len = strlen (string);
+
+ if (name_len > MAX_DCL_SYMBOL_LEN)
+ name_len = MAX_DCL_SYMBOL_LEN;
+
+ strncpy (name, string, name_len);
+ name[name_len] = 0;
+
+ /* Walk the list of symbols. The saved symbol is not freed
+ * symbols are likely to be overwritten multiple times, so this
+ * saves time in saving them each time.
+ */
+ while (symbol != NULL)
+ {
+ int result;
+ result = strcmp (symbol->name, name);
+ if (result == 0)
+ {
+ clear_dcl_symbol (symbol);
+ break;
+ }
+ symbol = symbol->link;
+ }
+}
+
+int
+vms_export_dcl_symbol (const char * name, const char * value)
+{
+
+ struct dcl_symbol * symbol;
+ struct dcl_symbol * next;
+ struct dcl_symbol * link;
+ int found;
+ const unsigned long symtbl = LIB$K_CLI_LOCAL_SYM;
+ struct dsc$descriptor_s value_desc;
+ int string_len;
+ int status;
+ char new_value[MAX_DCL_SYMBOL_VALUE + 1];
+ char * dollarp;
+
+ next = vms_dcl_symbol_head;
+ link = vms_dcl_symbol_head;
+
+ /* Is symbol already exported? */
+ found = 0;
+ while ((found == 0) && (link != NULL))
+ {
+ int x;
+ found = !strncasecmp (link->name, name, MAX_DCL_SYMBOL_LEN);
+ if (found)
+ symbol = link;
+ next = link;
+ link = link->link;
+ }
+
+ /* New symbol, set it up */
+ if (found == 0)
+ {
+ symbol = malloc (sizeof (struct dcl_symbol));
+ if (symbol == NULL)
+ return SS$_INSFMEM;
+
+ /* Construct the symbol descriptor, used for both saving
+ * the old symbol and creating the new symbol.
+ */
+ symbol->name_desc.dsc$w_length = strlen (name);
+ if (symbol->name_desc.dsc$w_length > MAX_DCL_SYMBOL_LEN)
+ symbol->name_desc.dsc$w_length = MAX_DCL_SYMBOL_LEN;
+
+ strncpy (symbol->name, name, symbol->name_desc.dsc$w_length);
+ symbol->name[symbol->name_desc.dsc$w_length] = 0;
+ symbol->name_desc.dsc$a_pointer = symbol->name;
+ symbol->name_desc.dsc$b_dtype = DSC$K_DTYPE_T;
+ symbol->name_desc.dsc$b_class = DSC$K_CLASS_S;
+
+ /* construct the value descriptor, used only for saving
+ * the old symbol.
+ */
+ symbol->value_desc.dsc$a_pointer = symbol->value;
+ symbol->value_desc.dsc$w_length = MAX_DCL_SYMBOL_VALUE;
+ symbol->value_desc.dsc$b_dtype = DSC$K_DTYPE_T;
+ symbol->value_desc.dsc$b_class = DSC$K_CLASS_S;
+ }
+
+ if (found == 0)
+ {
+ unsigned long old_symtbl;
+ unsigned short value_len;
+
+ /* Look up the symbol */
+ status = LIB$GET_SYMBOL (&symbol->name_desc, &symbol->value_desc,
+ &value_len, &old_symtbl);
+ if (!$VMS_STATUS_SUCCESS (status))
+ value_len = (unsigned short)-1;
+ else if (old_symtbl != symtbl)
+ value_len = (unsigned short)-1;
+
+ symbol->value_desc.dsc$w_length = value_len;
+
+ /* Store it away */
+ if (value_len != (unsigned short) -1)
+ symbol->value[value_len] = 0;
+
+ /* Make sure atexit scheduled */
+ if (vms_dcl_symbol_head == NULL)
+ {
+ vms_dcl_symbol_head = symbol;
+ atexit (clear_exported_symbols);
+ }
+ else
+ {
+ /* Extend the chain */
+ next->link = symbol;
+ }
+ }
+
+ /* Create or replace a symbol */
+ value_desc.dsc$a_pointer = new_value;
+ string_len = strlen (value);
+ if (string_len > MAX_DCL_SYMBOL_VALUE)
+ string_len = MAX_DCL_SYMBOL_VALUE;
+
+ strncpy (new_value, value, string_len);
+ new_value[string_len] = 0;
+
+ /* Special handling for GNU Make. GNU Make doubles the dollar signs
+ * in environment variables read in from getenv(). Make exports symbols
+ * with the dollar signs already doubled. So all $$ must be converted
+ * back to $.
+ * If the first $ is not doubled, then do not convert at all.
+ */
+ dollarp = strchr (new_value, '$');
+ while (dollarp && dollarp[1] == '$')
+ {
+ int left;
+ dollarp++;
+ left = string_len - (dollarp - new_value - 1);
+ string_len--;
+ if (left > 0)
+ {
+ memmove (dollarp, &dollarp[1], left);
+ dollarp = strchr (&dollarp[1], '$');
+ }
+ else
+ {
+ /* Ended with $$, simple case */
+ dollarp[1] = 0;
+ break;
+ }
+ }
+ value_desc.dsc$w_length = string_len;
+ value_desc.dsc$b_dtype = DSC$K_DTYPE_T;
+ value_desc.dsc$b_class = DSC$K_CLASS_S;
+ status = LIB$SET_SYMBOL (&symbol->name_desc, &value_desc, &symtbl);
+ return status;
+}
+
+/* export a DCL symbol using a string in the same syntax as putenv */
+int
+vms_putenv_symbol (const char * string)
+{
+
+ char name[MAX_DCL_SYMBOL_LEN + 1];
+ int status;
+ char * value;
+ int name_len;
+
+ /* Isolate the name from the value */
+ value = strchr (string, '=');
+ if (value == NULL)
+ {
+ errno = EINVAL;
+ return -1;
+ }
+
+ /* Copy the name from the string */
+ name_len = (value - string);
+ if (name_len > MAX_DCL_SYMBOL_LEN)
+ name_len = MAX_DCL_SYMBOL_LEN;
+
+ strncpy (name, string, name_len);
+ name[name_len] = 0;
+
+ /* Skip past the "=" */
+ value++;
+
+ /* Export the symbol */
+ status = vms_export_dcl_symbol (name, value);
+
+ /* Convert the error to Unix format */
+ if (!$VMS_STATUS_SUCCESS (status))
+ {
+ errno = EVMSERR;
+ vaxc$errno = status;
+ return -1;
+ }
+ return 0;
+}
+
+#if __CRTL_VER >= 70301000
+# define transpath_parm transpath
+#else
+static char transpath[MAX_DCL_SYMBOL_VALUE];
+#endif
+
+/* Helper callback routine for converting Unix paths to VMS */
+static int
+to_vms_action (char * vms_spec, int flag, char * transpath_parm)
+{
+ strncpy (transpath, vms_spec, MAX_DCL_SYMBOL_VALUE - 1);
+ transpath[MAX_DCL_SYMBOL_VALUE - 1] = 0;
+ return 0;
+}
+
+#ifdef __DECC
+# pragma message save
+ /* Undocumented extra parameter use triggers a ptrmismatch warning */
+# pragma message disable ptrmismatch
+#endif
+
+/* Create a foreign command only visible to children */
+int
+create_foreign_command (const char * command, const char * image)
+{
+ char vms_command[MAX_DCL_SYMBOL_VALUE + 1];
+ int status;
+
+ vms_command[0] = '$';
+ vms_command[1] = 0;
+ if (image[0] == '/')
+ {
+#if __CRTL_VER >= 70301000
+ /* Current decc$to_vms is reentrant */
+ decc$to_vms (image, to_vms_action, 0, 1, &vms_command[1]);
+#else
+ /* Older decc$to_vms is not reentrant */
+ decc$to_vms (image, to_vms_action, 0, 1);
+ strncpy (&vms_command[1], transpath, MAX_DCL_SYMBOL_VALUE - 1);
+ vms_command[MAX_DCL_SYMBOL_VALUE] = 0;
+#endif
+ }
+ else
+ {
+ strncpy (&vms_command[1], image, MAX_DCL_SYMBOL_VALUE - 1);
+ vms_command[MAX_DCL_SYMBOL_VALUE] = 0;
+ }
+ status = vms_export_dcl_symbol (command, vms_command);
+
+ return status;
+}
+#ifdef __DECC
+# pragma message restore
+#endif
+
+
+#ifdef DEBUG
+
+int
+main(int argc, char ** argv, char **env)
+{
+
+ char value[MAX_DCL_SYMBOL_VALUE +1];
+ int status = 0;
+ int putenv_status;
+ int vms_status;
+ struct dsc$descriptor_s name_desc;
+ struct dsc$descriptor_s value_desc;
+ const unsigned long symtbl = LIB$K_CLI_LOCAL_SYM;
+ unsigned short value_len;
+ unsigned long old_symtbl;
+ int result;
+ const char * vms_command = "vms_export_symbol";
+ const char * vms_image = "test_image.exe";
+ const char * vms_symbol1 = "test_symbol1";
+ const char * value1 = "test_value1";
+ const char * vms_symbol2 = "test_symbol2";
+ const char * putenv_string = "test_symbol2=value2";
+ const char * value2 = "value2";
+
+ /* Test creating a foreign command */
+ vms_status = create_foreign_command (vms_command, vms_image);
+ if (!$VMS_STATUS_SUCCESS (vms_status))
+ {
+ printf("Create foreign command failed: %d\n", vms_status);
+ status = 1;
+ }
+
+ name_desc.dsc$a_pointer = (char *)vms_command;
+ name_desc.dsc$w_length = strlen (vms_command);
+ name_desc.dsc$b_dtype = DSC$K_DTYPE_T;
+ name_desc.dsc$b_class = DSC$K_CLASS_S;
+
+ value_desc.dsc$a_pointer = value;
+ value_desc.dsc$w_length = MAX_DCL_SYMBOL_VALUE;
+ value_desc.dsc$b_dtype = DSC$K_DTYPE_T;
+ value_desc.dsc$b_class = DSC$K_CLASS_S;
+
+ vms_status = LIB$GET_SYMBOL (&name_desc, &value_desc,
+ &value_len, &old_symtbl);
+ if (!$VMS_STATUS_SUCCESS (vms_status))
+ {
+ printf ("lib$get_symbol for command failed: %d\n", vms_status);
+ status = 1;
+ }
+
+ value[value_len] = 0;
+ result = strncasecmp (&value[1], vms_image, value_len - 1);
+ if (result != 0)
+ {
+ printf ("create_foreign_command failed! expected '%s', got '%s'\n",
+ vms_image, &value[1]);
+ status = 1;
+ }
+
+ /* Test exporting a symbol */
+ vms_status = vms_export_dcl_symbol (vms_symbol1, value1);
+ if (!$VMS_STATUS_SUCCESS (vms_status))
+ {
+ printf ("vms_export_dcl_symbol for command failed: %d\n", vms_status);
+ status = 1;
+ }
+
+ name_desc.dsc$a_pointer = (char *)vms_symbol1;
+ name_desc.dsc$w_length = strlen (vms_symbol1);
+ vms_status = LIB$GET_SYMBOL(&name_desc, &value_desc,
+ &value_len, &old_symtbl);
+ if (!$VMS_STATUS_SUCCESS(vms_status))
+ {
+ printf ("lib$get_symbol for command failed: %d\n", vms_status);
+ status = 1;
+ }
+
+ value[value_len] = 0;
+ result = strncmp (value, value1, value_len);
+ if (result != 0)
+ {
+ printf ("vms_export_dcl_symbol failed! expected '%s', got '%s'\n",
+ value1, value);
+ status = 1;
+ }
+
+ /* Test putenv for DCL symbols */
+ putenv_status = vms_putenv_symbol (putenv_string);
+ if (putenv_status != 0)
+ {
+ perror ("vms_putenv_symbol");
+ status = 1;
+ }
+
+ name_desc.dsc$a_pointer = (char *)vms_symbol2;
+ name_desc.dsc$w_length = strlen(vms_symbol2);
+ vms_status = LIB$GET_SYMBOL (&name_desc, &value_desc,
+ &value_len, &old_symtbl);
+ if (!$VMS_STATUS_SUCCESS (vms_status))
+ {
+ printf ("lib$get_symbol for command failed: %d\n", vms_status);
+ status = 1;
+ }
+
+ value[value_len] = 0;
+ result = strncmp (value, value2, value_len);
+ if (result != 0)
+ {
+ printf ("vms_putenv_symbol failed! expected '%s', got '%s'\n",
+ value2, value);
+ status = 1;
+ }
+
+ vms_restore_symbol (putenv_string);
+ vms_status = LIB$GET_SYMBOL (&name_desc, &value_desc,
+ &value_len, &old_symtbl);
+ if ($VMS_STATUS_SUCCESS (vms_status))
+ {
+ printf ("lib$get_symbol for command succeeded, should have failed\n");
+ status = 1;
+ }
+
+ exit (status);
+}
+
+#endif
diff --git a/vms_export_symbol_test.com b/vms_export_symbol_test.com
new file mode 100644
index 00000000..4345f44a
--- /dev/null
+++ b/vms_export_symbol_test.com
@@ -0,0 +1,37 @@
+$! VMS_EXPORT_SYMBOL_TEST.COM
+$!
+$! Verify the VMS_EXPORT_SYMBOL.C module
+$!
+$! 22-May-2014 J. Malmberg
+$!
+$!=========================================================================
+$!
+$ cc/names=(as_is)/define=(DEBUG=1,_POSIX_EXIT=1) vms_export_symbol.c
+$!
+$ link vms_export_symbol
+$!
+$ delete vms_export_symbol.obj;*
+$!
+$! Need a foreign command to test.
+$ vms_export_symbol := $sys$disk:[]vms_export_symbol.exe
+$ save_export_symbol = vms_export_symbol
+$!
+$ vms_export_symbol
+$ if $severity .ne. 1
+$ then
+$ write sys$output "Test program failed!";
+$ endif
+$!
+$ if vms_export_symbol .nes. save_export_symbol
+$ then
+$ write sys$output "Test failed to restore foreign command!"
+$ endif
+$ if f$type(test_export_symbol) .nes. ""
+$ then
+$ write sys$output "Test failed to clear exported symbol!"
+$ endif
+$ if f$type(test_putenv_symbol) .nes. ""
+$ then
+$ write sys$output "Test failed to clear putenv exported symbol!"
+$ endif
+$!
diff --git a/vms_progname.c b/vms_progname.c
new file mode 100644
index 00000000..0665a540
--- /dev/null
+++ b/vms_progname.c
@@ -0,0 +1,463 @@
+/* File: vms_progname.c
+ *
+ * This module provides a fixup of the program name.
+ *
+ * This module is designed to be a plug in replacement for the
+ * progname module used by many GNU utilities with a few enhancements
+ * needed for GNU Make.
+ *
+ * It does not support the HAVE_DECL_PROGRAM_INVOCATION_* macros at this
+ * time.
+ *
+ * Make sure that the program_name string is set as close as possible to
+ * what the original command was given.
+ *
+ * When run from DCL, The argv[0] element is initialized with an absolute
+ * path name. The decc$ feature logical names can control the format
+ * of this pathname. In some cases it causes the UNIX format name to be
+ * formatted incorrectly.
+ *
+ * This DCL provided name is usually incompatible with what is expected to
+ * be provided by Unix programs and needs to be replaced.
+ *
+ * When run from an exec() call, the argv[0] element is initialized by the
+ * program. This name is compatible with what is expected to be provided
+ * by Unix programs and should be passed through unchanged.
+ *
+ * The DCL provided name can be detected because it always contains the
+ * device name.
+ *
+ * DCL examples:
+ * devname:[dir]program.exe;1 Normal VMS - remove path and .EXE;n
+ * devname:[dir]facility$program.exe;1 Facility also needs removal.
+ * /devname/dir/program.exe
+ * /DISK$VOLUME/dir/program.exe.1 Bug version should not be there.
+ * /DISK$VOLUME/dir/program. Bug Period should not be there.
+ *
+ */
+
+/* Copyright (C) 2014-2016 Free Software Foundation, Inc.
+
+GNU Make is free software; you can redistribute it and/or modify it under the
+terms of the GNU General Public License as published by the Free Software
+Foundation; either version 3 of the License, or (at your option) any later
+version.
+
+GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License along with
+this program. If not, see <http://www.gnu.org/licenses/>. */
+
+
+/* Per copyright assignment agreement with the Free Software Foundation
+ this software may be available under under other license agreements
+ and copyrights. */
+
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include <stdio.h>
+#include <string.h>
+#include <ctype.h>
+#include <stdlib.h>
+
+#include <descrip.h>
+#include <dvidef.h>
+#include <efndef.h>
+#include <fscndef.h>
+#include <stsdef.h>
+
+#ifdef USE_PROGNAME_H
+# include "progname.h"
+#endif
+
+#pragma member_alignment save
+#pragma nomember_alignment longword
+struct item_list_3
+{
+ unsigned short len;
+ unsigned short code;
+ void * bufadr;
+ unsigned short * retlen;
+};
+
+struct filescan_itmlst_2
+{
+ unsigned short length;
+ unsigned short itmcode;
+ char * component;
+};
+
+#pragma member_alignment
+
+int
+SYS$GETDVIW (unsigned long efn,
+ unsigned short chan,
+ const struct dsc$descriptor_s * devnam,
+ const struct item_list_3 * itmlst,
+ void * iosb,
+ void (* astadr)(unsigned long),
+ unsigned long astprm,
+ void * nullarg);
+
+int
+SYS$FILESCAN (const struct dsc$descriptor_s * srcstr,
+ struct filescan_itmlst_2 * valuelist,
+ unsigned long * fldflags,
+ struct dsc$descriptor_s *auxout,
+ unsigned short * retlen);
+
+/* String containing name the program is called with.
+ To be initialized by main(). */
+
+const char *program_name = NULL;
+
+static int internal_need_vms_symbol = 0;
+
+static char vms_new_nam[256];
+
+int
+need_vms_symbol (void)
+{
+ return internal_need_vms_symbol;
+}
+
+
+void
+set_program_name (const char *argv0)
+{
+ int status;
+ int result;
+
+#ifdef DEBUG
+ printf ("original argv0 = %s\n", argv0);
+#endif
+
+ /* Posix requires non-NULL argv[0] */
+ if (argv0 == NULL)
+ {
+ fputs ("A NULL argv[0] was passed through an exec system call.\n",
+ stderr);
+ abort ();
+ }
+
+ program_name = argv0;
+ result = 0;
+ internal_need_vms_symbol = 0;
+
+ /* If the path name starts with a /, then it is an absolute path */
+ /* that may have been generated by the CRTL instead of the command name */
+ /* If it is the device name between the slashes, then this was likely */
+ /* from the run command and needs to be fixed up. */
+ /* If the DECC$POSIX_COMPLIANT_PATHNAMES is set to 2, then it is the */
+ /* DISK$VOLUME that will be present, and it will still need to be fixed. */
+ if (argv0[0] == '/')
+ {
+ char * nextslash;
+ int length;
+ struct item_list_3 itemlist[3];
+ unsigned short dvi_iosb[4];
+ char alldevnam[64];
+ unsigned short alldevnam_len;
+ struct dsc$descriptor_s devname_dsc;
+ char diskvolnam[256];
+ unsigned short diskvolnam_len;
+
+ internal_need_vms_symbol = 1;
+
+ /* Get some information about the disk */
+ /*--------------------------------------*/
+ itemlist[0].len = (sizeof alldevnam) - 1;
+ itemlist[0].code = DVI$_ALLDEVNAM;
+ itemlist[0].bufadr = alldevnam;
+ itemlist[0].retlen = &alldevnam_len;
+ itemlist[1].len = (sizeof diskvolnam) - 1 - 5;
+ itemlist[1].code = DVI$_VOLNAM;
+ itemlist[1].bufadr = &diskvolnam[5];
+ itemlist[1].retlen = &diskvolnam_len;
+ itemlist[2].len = 0;
+ itemlist[2].code = 0;
+
+ /* Add the prefix for the volume name. */
+ /* SYS$GETDVI will append the volume name to this */
+ strcpy (diskvolnam, "DISK$");
+
+ nextslash = strchr (&argv0[1], '/');
+ if (nextslash != NULL)
+ {
+ length = nextslash - argv0 - 1;
+
+ /* Cast needed for HP C compiler diagnostic */
+ devname_dsc.dsc$a_pointer = (char *)&argv0[1];
+ devname_dsc.dsc$w_length = length;
+ devname_dsc.dsc$b_dtype = DSC$K_DTYPE_T;
+ devname_dsc.dsc$b_class = DSC$K_CLASS_S;
+
+ status = SYS$GETDVIW (EFN$C_ENF, 0, &devname_dsc, itemlist,
+ dvi_iosb, NULL, 0, 0);
+ if (!$VMS_STATUS_SUCCESS (status))
+ {
+ /* If the sys$getdviw fails, then this path was passed by */
+ /* An exec() program and not from DCL, so do nothing */
+ /* An example is "/tmp/program" where tmp: does not exist */
+#ifdef DEBUG
+ printf ("sys$getdviw failed with status %d\n", status);
+#endif
+ result = 0;
+ }
+ else if (!$VMS_STATUS_SUCCESS (dvi_iosb[0]))
+ {
+#ifdef DEBUG
+ printf ("sys$getdviw failed with iosb %d\n", dvi_iosb[0]);
+#endif
+ result = 0;
+ }
+ else
+ {
+ char * devnam;
+ int devnam_len;
+ char argv_dev[64];
+
+ /* Null terminate the returned alldevnam */
+ alldevnam[alldevnam_len] = 0;
+ devnam = alldevnam;
+ devnam_len = alldevnam_len;
+
+ /* Need to skip past any leading underscore */
+ if (devnam[0] == '_')
+ {
+ devnam++;
+ devnam_len--;
+ }
+
+ /* And remove the trailing colon */
+ if (devnam[devnam_len - 1] == ':')
+ {
+ devnam_len--;
+ devnam[devnam_len] = 0;
+ }
+
+ /* Null terminate the returned volnam */
+ diskvolnam_len += 5;
+ diskvolnam[diskvolnam_len] = 0;
+
+ /* Check first for normal CRTL behavior */
+ if (devnam_len == length)
+ {
+ strncpy (vms_new_nam, &argv0[1], length);
+ vms_new_nam[length] = 0;
+ result = (strcasecmp (devnam, vms_new_nam) == 0);
+ }
+
+ /* If we have not got a match, check for POSIX Compliant */
+ /* behavior. To be more accurate, we could also check */
+ /* to see if that feature is active. */
+ if ((result == 0) && (diskvolnam_len == length))
+ {
+ strncpy (vms_new_nam, &argv0[1], length);
+ vms_new_nam[length] = 0;
+ result = (strcasecmp (diskvolnam, vms_new_nam) == 0);
+ }
+ }
+ }
+ }
+ else
+ {
+ /* The path did not start with a slash, so it could be VMS format */
+ /* If it is vms format, it has a volume/device in it as it must */
+ /* be an absolute path */
+ struct dsc$descriptor_s path_desc;
+ int status;
+ unsigned long field_flags;
+ struct filescan_itmlst_2 item_list[5];
+ char * volume;
+ char * name;
+ int name_len;
+ char * ext;
+
+ path_desc.dsc$a_pointer = (char *)argv0; /* cast ok */
+ path_desc.dsc$w_length = strlen (argv0);
+ path_desc.dsc$b_dtype = DSC$K_DTYPE_T;
+ path_desc.dsc$b_class = DSC$K_CLASS_S;
+
+ /* Don't actually need to initialize anything buf itmcode */
+ /* I just do not like uninitialized input values */
+
+ /* Sanity check, this must be the same length as input */
+ item_list[0].itmcode = FSCN$_FILESPEC;
+ item_list[0].length = 0;
+ item_list[0].component = NULL;
+
+ /* If the device is present, then it if a VMS spec */
+ item_list[1].itmcode = FSCN$_DEVICE;
+ item_list[1].length = 0;
+ item_list[1].component = NULL;
+
+ /* we need the program name and type */
+ item_list[2].itmcode = FSCN$_NAME;
+ item_list[2].length = 0;
+ item_list[2].component = NULL;
+
+ item_list[3].itmcode = FSCN$_TYPE;
+ item_list[3].length = 0;
+ item_list[3].component = NULL;
+
+ /* End the list */
+ item_list[4].itmcode = 0;
+ item_list[4].length = 0;
+ item_list[4].component = NULL;
+
+ status = SYS$FILESCAN ((const struct dsc$descriptor_s *)&path_desc,
+ item_list, &field_flags, NULL, NULL);
+
+
+ if ($VMS_STATUS_SUCCESS (status) &&
+ (item_list[0].length == path_desc.dsc$w_length) &&
+ (item_list[1].length != 0))
+ {
+
+ char * dollar;
+ int keep_ext;
+ int i;
+
+ /* We need the filescan to be successful, */
+ /* same length as input, and a volume to be present */
+ internal_need_vms_symbol = 1;
+
+ /* We will assume that we only get to this path on a version */
+ /* of VMS that does not support the EFS character set */
+
+ /* There may be a xxx$ prefix on the image name. Linux */
+ /* programs do not handle that well, so strip the prefix */
+ name = item_list[2].component;
+ name_len = item_list[2].length;
+ dollar = strrchr (name, '$');
+ if (dollar != NULL)
+ {
+ dollar++;
+ name_len = name_len - (dollar - name);
+ name = dollar;
+ }
+
+ strncpy (vms_new_nam, name, name_len);
+ vms_new_nam[name_len] = 0;
+
+ /* Commit to using the new name */
+ program_name = vms_new_nam;
+
+ /* We only keep the extension if it is not ".exe" */
+ keep_ext = 0;
+ ext = item_list[3].component;
+
+ if (item_list[3].length != 1)
+ {
+ keep_ext = 1;
+ if (item_list[3].length == 4)
+ {
+ if ((ext[1] == 'e' || ext[1] == 'E') &&
+ (ext[2] == 'x' || ext[2] == 'X') &&
+ (ext[3] == 'e' || ext[3] == 'E'))
+ keep_ext = 0;
+ }
+ }
+
+ if (keep_ext == 1)
+ strncpy (&vms_new_nam[name_len], ext, item_list[3].length);
+ }
+ }
+
+ if (result)
+ {
+ char * lastslash;
+ char * dollar;
+ char * dotexe;
+ char * lastdot;
+ char * extension;
+
+ /* This means it is probably the name from a DCL command */
+ /* Find the last slash which separates the file from the */
+ /* path. */
+ lastslash = strrchr (argv0, '/');
+
+ if (lastslash != NULL) {
+ int i;
+
+ lastslash++;
+
+ /* There may be a xxx$ prefix on the image name. Linux */
+ /* programs do not handle that well, so strip the prefix */
+ dollar = strrchr (lastslash, '$');
+
+ if (dollar != NULL) {
+ dollar++;
+ lastslash = dollar;
+ }
+
+ strcpy (vms_new_nam, lastslash);
+
+ /* In UNIX mode + EFS character set, there should not be a */
+ /* version present, as it is not possible when parsing to */
+ /* tell if it is a version or part of the UNIX filename as */
+ /* UNIX programs use numeric extensions for many reasons. */
+
+ lastdot = strrchr (vms_new_nam, '.');
+ if (lastdot != NULL) {
+ int i;
+
+ i = 1;
+ while (isdigit (lastdot[i])) {
+ i++;
+ }
+ if (lastdot[i] == 0) {
+ *lastdot = 0;
+ }
+ }
+
+ /* Find the .exe on the name (case insenstive) and toss it */
+ dotexe = strrchr (vms_new_nam, '.');
+ if (dotexe != NULL) {
+ if ((dotexe[1] == 'e' || dotexe[1] == 'E') &&
+ (dotexe[2] == 'x' || dotexe[2] == 'X') &&
+ (dotexe[3] == 'e' || dotexe[3] == 'E') &&
+ (dotexe[4] == 0)) {
+
+ *dotexe = 0;
+ } else {
+ /* Also need to handle a null extension because of a */
+ /* CRTL bug. */
+ if (dotexe[1] == 0) {
+ *dotexe = 0;
+ }
+ }
+ }
+
+ /* Commit to new name */
+ program_name = vms_new_nam;
+
+ } else {
+ /* There is no way that the code should ever get here */
+ /* As we already verified that the '/' was present */
+ fprintf (stderr, "Sanity failure somewhere we lost a '/'\n");
+ }
+ }
+}
+
+#ifdef DEBUG
+
+int
+main (int argc, char ** argv, char **env)
+{
+
+ char command[1024];
+
+ set_program_name (argv[0]);
+
+ printf ("modified argv[0] = %s\n", program_name);
+
+ return 0;
+}
+#endif
diff --git a/vmsdir.h b/vmsdir.h
index 3be3f0c0..814b89da 100644
--- a/vmsdir.h
+++ b/vmsdir.h
@@ -1,5 +1,5 @@
/* dirent.h for vms
-Copyright (C) 1996-2014 Free Software Foundation, Inc.
+Copyright (C) 1996-2016 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
diff --git a/vmsfunctions.c b/vmsfunctions.c
index 6ed136ce..e422d488 100644
--- a/vmsfunctions.c
+++ b/vmsfunctions.c
@@ -1,5 +1,5 @@
/* VMS functions
-Copyright (C) 1996-2014 Free Software Foundation, Inc.
+Copyright (C) 1996-2016 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
@@ -118,7 +118,7 @@ closedir (DIR *dir)
struct FAB *dfab = &dir->fab;
struct NAM *dnam = (struct NAM *)(dfab->fab$l_nam);
if (dnam != NULL)
- free (dnam->nam$l_esa);
+ free (dnam->nam$l_esa);
free (dnam);
free (dir);
}
diff --git a/vmsify.c b/vmsify.c
index 02bdbf59..e504a099 100644
--- a/vmsify.c
+++ b/vmsify.c
@@ -1,5 +1,5 @@
/* vmsify.c -- Module for vms <-> unix file name conversion
-Copyright (C) 1996-2014 Free Software Foundation, Inc.
+Copyright (C) 1996-2016 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
diff --git a/vmsjobs.c b/vmsjobs.c
index b11bca13..f45c8a80 100644
--- a/vmsjobs.c
+++ b/vmsjobs.c
@@ -1,7 +1,7 @@
/* --------------- Moved here from job.c ---------------
This file must be #included in job.c, as it accesses static functions.
-Copyright (C) 1996-2014 Free Software Foundation, Inc.
+Copyright (C) 1996-2016 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
@@ -20,13 +20,69 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
#include <descrip.h>
#include <clidef.h>
+/* TODO - VMS specific header file conditionally included in makeint.h */
+
+#include <stsdef.h>
+#include <ssdef.h>
+void
+decc$exit (int status);
+
+/* Lowest legal non-success VMS exit code is 8 */
+/* GNU make only defines codes 0, 1, 2 */
+/* So assume any exit code > 8 is a VMS exit code */
+
+#ifndef MAX_EXPECTED_EXIT_CODE
+# define MAX_EXPECTED_EXIT_CODE 7
+#endif
+
+
+#if __CRTL_VER >= 70302000 && !defined(__VAX)
+# define MAX_DCL_LINE_LENGTH 4095
+# define MAX_DCL_CMD_LINE_LENGTH 8192
+#else
+# define MAX_DCL_LINE_LENGTH 255
+# define MAX_DCL_CMD_LINE_LENGTH 1024
+#endif
+#define MAX_DCL_TOKEN_LENGTH 255
+#define MAX_DCL_TOKENS 127
+
+enum auto_pipe { nopipe, add_pipe, dcl_pipe };
+
char *vmsify (char *name, int type);
static int vms_jobsefnmask = 0;
+/* returns whether path is assumed to be a unix like shell. */
+int
+_is_unixy_shell (const char *path)
+{
+ return vms_gnv_shell;
+}
+
+#define VMS_GETMSG_MAX 256
+static char vms_strsignal_text[VMS_GETMSG_MAX + 2];
+
+char *
+vms_strsignal (int status)
+{
+ if (status <= MAX_EXPECTED_EXIT_CODE)
+ sprintf (vms_strsignal_text, "lib$spawn returned %x", status);
+ else
+ {
+ int vms_status;
+ unsigned short * msg_len;
+ unsigned char out[4];
+ vms_status = SYS$GETMSG (status, &msg_len,
+ vms_strsignal_text, 7, *out);
+ }
+
+ return vms_strsignal_text;
+}
+
+
/* Wait for nchildren children to terminate */
static void
-vmsWaitForChildren(int *status)
+vmsWaitForChildren (int *status)
{
while (1)
{
@@ -41,72 +97,6 @@ vmsWaitForChildren(int *status)
return;
}
-/* Set up IO redirection. */
-
-static char *
-vms_redirect (struct dsc$descriptor_s *desc, char *fname, char *ibuf)
-{
- char *fptr;
- char saved;
-
- ibuf++;
- while (isspace ((unsigned char)*ibuf))
- ibuf++;
- fptr = ibuf;
- while (*ibuf && !isspace ((unsigned char)*ibuf))
- ibuf++;
- saved = *ibuf;
- *ibuf = 0;
- if (strcmp (fptr, "/dev/null") != 0)
- {
- strcpy (fname, vmsify (fptr, 0));
- if (strchr (fname, '.') == 0)
- strcat (fname, ".");
- }
- desc->dsc$w_length = strlen (fname);
- desc->dsc$a_pointer = fname;
- desc->dsc$b_dtype = DSC$K_DTYPE_T;
- desc->dsc$b_class = DSC$K_CLASS_S;
-
- if (*fname == 0)
- printf (_("Warning: Empty redirection\n"));
- if (saved=='\0')
- return ibuf;
- *ibuf = saved;
- return --ibuf;
-}
-
-
-/* found apostrophe at (p-1)
- inc p until after closing apostrophe.
-*/
-
-static char *
-vms_handle_apos (char *p)
-{
- int alast;
- alast = 0;
-
- while (*p != 0)
- if (*p == '"')
- if (alast)
- {
- alast = 0;
- p++;
- }
- else
- {
- p++;
- if (*p!='"')
- break;
- alast = 1;
- }
- else
- p++;
-
- return p;
-}
-
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
@@ -114,15 +104,21 @@ static int ctrlYPressed= 0;
inner mode level AST.
*/
static int
-vmsHandleChildTerm(struct child *child)
+vmsHandleChildTerm (struct child *child)
{
int exit_code;
register struct child *lastc, *c;
int child_failed;
- vms_jobsefnmask &= ~(1 << (child->efn - 32));
+ /* The child efn is 0 when a built-in or null command is executed
+ successfully with out actually creating a child.
+ */
+ if (child->efn > 0)
+ {
+ vms_jobsefnmask &= ~(1 << (child->efn - 32));
- lib$free_ef (&child->efn);
+ lib$free_ef (&child->efn);
+ }
if (child->comname)
{
if (!ISDB (DB_JOBS) && !ctrlYPressed)
@@ -132,82 +128,40 @@ vmsHandleChildTerm(struct child *child)
(void) sigblock (fatal_signal_mask);
- child_failed = !(child->cstatus & 1);
- if (child_failed)
- exit_code = child->cstatus;
+ /* First check to see if this is a POSIX exit status and handle */
+ if ((child->cstatus & VMS_POSIX_EXIT_MASK) == VMS_POSIX_EXIT_MASK)
+ {
+ exit_code = (child->cstatus >> 3) & 255;
+ if (exit_code != MAKE_SUCCESS)
+ child_failed = 1;
+ }
+ else
+ {
+ child_failed = !$VMS_STATUS_SUCCESS (child->cstatus);
+ if (child_failed)
+ exit_code = child->cstatus;
+ }
/* Search for a child matching the deceased one. */
lastc = 0;
-#if defined(RECURSIVEJOBS) /* I've had problems with recursive stuff and process handling */
+#if defined(RECURSIVEJOBS)
+ /* I've had problems with recursive stuff and process handling */
for (c = children; c != 0 && c != child; lastc = c, c = c->next)
;
#else
c = child;
#endif
- if (child_failed && !c->noerror && !ignore_errors_flag)
- {
- /* The commands failed. Write an error message,
- delete non-precious targets, and abort. */
- child_error (c, c->cstatus, 0, 0, 0);
- c->file->update_status = us_failed;
- delete_child_targets (c);
- }
- else
+ if ($VMS_STATUS_SUCCESS (child->vms_launch_status))
{
- if (child_failed)
- {
- /* The commands failed, but we don't care. */
- child_error (c, c->cstatus, 0, 0, 1);
- child_failed = 0;
- }
-
-#if defined(RECURSIVEJOBS) /* I've had problems with recursive stuff and process handling */
- /* If there are more commands to run, try to start them. */
- start_job (c);
-
- switch (c->file->command_state)
- {
- case cs_running:
- /* Successfully started. */
- break;
-
- case cs_finished:
- if (c->file->update_status != us_success)
- /* We failed to start the commands. */
- delete_child_targets (c);
- break;
-
- default:
- OS (error, NILF,
- _("internal error: '%s' command_state"), c->file->name);
- abort ();
- break;
- }
-#endif /* RECURSIVEJOBS */
+ /* Convert VMS success status to 0 for UNIX code to be happy */
+ child->vms_launch_status = 0;
}
/* Set the state flag to say the commands have finished. */
c->file->command_state = cs_finished;
notice_finished_file (c->file);
-#if defined(RECURSIVEJOBS) /* I've had problems with recursive stuff and process handling */
- /* Remove the child from the chain and free it. */
- if (lastc == 0)
- children = c->next;
- else
- lastc->next = c->next;
- free_child (c);
-#endif /* RECURSIVEJOBS */
-
- /* There is now another slot open. */
- if (job_slots_used > 0)
- --job_slots_used;
-
- /* If the job failed, and the -k flag was not given, die. */
- if (child_failed && !keep_going_flag)
- die (exit_code);
-
(void) sigsetmask (sigblock (0) & ~(fatal_signal_mask));
return 1;
@@ -216,8 +170,6 @@ vmsHandleChildTerm(struct child *child)
/* VMS:
Spawn a process executing the command in ARGV and return its pid. */
-#define MAXCMDLEN 200
-
/* local helpers to make ctrl+c and ctrl+y working, see below */
#include <iodef.h>
#include <libclidef.h>
@@ -298,47 +250,584 @@ tryToSetupYAst(void)
chan = loc_chan;
}
-static int
-nextnl(char *cmd, int l)
+/* Check if a token is too long */
+#define INC_TOKEN_LEN_OR_RETURN(x) {token->length++; \
+ if (token->length >= MAX_DCL_TOKEN_LENGTH) \
+ { token->cmd_errno = ERANGE; return x; }}
+
+#define INC_TOKEN_LEN_OR_BREAK {token->length++; \
+ if (token->length >= MAX_DCL_TOKEN_LENGTH) \
+ { token->cmd_errno = ERANGE; break; }}
+
+#define ADD_TOKEN_LEN_OR_RETURN(add_len, x) {token->length += add_len; \
+ if (token->length >= MAX_DCL_TOKEN_LENGTH) \
+ { token->cmd_errno = ERANGE; return x; }}
+
+/* Check if we are out of space for more tokens */
+#define V_NEXT_TOKEN { if (cmd_tkn_index < MAX_DCL_TOKENS) \
+ cmd_tokens[++cmd_tkn_index] = NULL; \
+ else { token.cmd_errno = E2BIG; break; } \
+ token.length = 0;}
+
+
+#define UPDATE_TOKEN {cmd_tokens[cmd_tkn_index] = strdup(token.text); \
+ V_NEXT_TOKEN;}
+
+#define EOS_ERROR(x) { if (*x == 0) { token->cmd_errno = ERANGE; break; }}
+
+struct token_info
+ {
+ char *text; /* Parsed text */
+ int length; /* Length of parsed text */
+ char *src; /* Pointer to source text */
+ int cmd_errno; /* Error status of parse */
+ int use_cmd_file; /* Force use of a command file */
+ };
+
+
+/* Extract a Posix single quoted string from input line */
+static char *
+posix_parse_sq (struct token_info *token)
{
- int instring;
- instring = 0;
- while (cmd[l])
+ /* A Posix quoted string with no expansion unless in a string
+ Unix simulation means no lexical functions present.
+ */
+ char * q;
+ char * p;
+ q = token->text;
+ p = token->src;
+
+ *q++ = '"';
+ p++;
+ INC_TOKEN_LEN_OR_RETURN (p);
+
+ while (*p != '\'' && (token->length < MAX_DCL_TOKEN_LENGTH))
{
- if (cmd[l]=='"')
- instring = !instring;
- else if (cmd[l]=='\n' && !instring)
- return ++l;
- ++l;
+ EOS_ERROR (p);
+ if (*p == '"')
+ {
+ /* Embedded double quotes need to be doubled */
+ *q++ = '"';
+ INC_TOKEN_LEN_OR_BREAK;
+ *q = '"';
+ }
+ else
+ *q = *p;
+
+ q++;
+ p++;
+ INC_TOKEN_LEN_OR_BREAK;
+ }
+ *q++ = '"';
+ p++;
+ INC_TOKEN_LEN_OR_RETURN (p);
+ *q = 0;
+ return p;
+}
+
+/* Extract a Posix double quoted string from input line */
+static char *
+posix_parse_dq (struct token_info *token)
+{
+ /* Unix mode: Any imbedded \" becomes doubled.
+ \t is tab, \\, \$ leading character stripped.
+ $ character replaced with \' unless escaped.
+ */
+ char * q;
+ char * p;
+ q = token->text;
+ p = token->src;
+ *q++ = *p++;
+ INC_TOKEN_LEN_OR_RETURN (p);
+ while (*p != 0)
+ {
+ if (*p == '\\')
+ {
+ switch(p[1])
+ {
+ case 't': /* Convert tabs */
+ *q = '\t';
+ p++;
+ break;
+ case '\\': /* Just remove leading backslash */
+ case '$':
+ p++;
+ *q = *p;
+ break;
+ case '"':
+ p++;
+ *q = *p;
+ *q++ = '"';
+ INC_TOKEN_LEN_OR_BREAK;
+ default: /* Pass through unchanged */
+ *q++ = *p++;
+ INC_TOKEN_LEN_OR_BREAK;
+ }
+ INC_TOKEN_LEN_OR_BREAK;
+ }
+ else if (*p == '$' && isalpha (p[1]))
+ {
+ /* A symbol we should be able to substitute */
+ *q++ = '\'';
+ INC_TOKEN_LEN_OR_BREAK;
+ *q = '\'';
+ INC_TOKEN_LEN_OR_BREAK;
+ token->use_cmd_file = 1;
+ }
+ else
+ {
+ *q = *p;
+ INC_TOKEN_LEN_OR_BREAK;
+ if (*p == '"')
+ {
+ p++;
+ q++;
+ break;
+ }
+ }
+ p++;
+ q++;
+ }
+ *q = 0;
+ return p;
+}
+
+/* Extract a VMS quoted string or substitution string from input line */
+static char *
+vms_parse_quotes (struct token_info *token)
+{
+ /* VMS mode, the \' means that a symbol substitution is starting
+ so while you might think you can just copy until the next
+ \'. Unfortunately the substitution can be a lexical function
+ which can contain embedded strings and lexical functions.
+ Messy, so both types need to be handled together.
+ */
+ char * q;
+ char * p;
+ q = token->text;
+ p = token->src;
+ int parse_level[MAX_DCL_TOKENS + 1];
+ int nest = 0;
+
+ parse_level[0] = *p;
+ if (parse_level[0] == '\'')
+ token->use_cmd_file = 1;
+
+ *q++ = *p++;
+ INC_TOKEN_LEN_OR_RETURN (p);
+
+
+ /* Copy everything until after the next single quote at nest == 0 */
+ while (token->length < MAX_DCL_TOKEN_LENGTH)
+ {
+ EOS_ERROR (p);
+ *q = *p;
+ INC_TOKEN_LEN_OR_BREAK;
+ if ((*p == parse_level[nest]) && (p[1] != '"'))
+ {
+ if (nest == 0)
+ {
+ *q++ = *p++;
+ break;
+ }
+ nest--;
+ }
+ else
+ {
+ switch(*p)
+ {
+ case '\\':
+ /* Handle continuation on to next line */
+ if (p[1] != '\n')
+ break;
+ p++;
+ p++;
+ *q = *p;
+ break;
+ case '(':
+ /* Parenthesis only in single quote level */
+ if (parse_level[nest] == '\'')
+ {
+ nest++;
+ parse_level[nest] == ')';
+ }
+ break;
+ case '"':
+ /* Double quotes only in parenthesis */
+ if (parse_level[nest] == ')')
+ {
+ nest++;
+ parse_level[nest] == '"';
+ }
+ break;
+ case '\'':
+ /* Symbol substitution ony in double quotes */
+ if ((p[1] == '\'') && (parse_level[nest] == '"'))
+ {
+ nest++;
+ parse_level[nest] == '\'';
+ *p++ = *q++;
+ token->use_cmd_file = 1;
+ INC_TOKEN_LEN_OR_BREAK;
+ break;
+ }
+ *q = *p;
+ }
+ }
+ p++;
+ q++;
+ /* Pass through doubled double quotes */
+ if ((*p == '"') && (p[1] == '"') && (parse_level[nest] == '"'))
+ {
+ *p++ = *q++;
+ INC_TOKEN_LEN_OR_BREAK;
+ *p++ = *q++;
+ INC_TOKEN_LEN_OR_BREAK;
+ }
+ }
+ *q = 0;
+ return p;
+}
+
+/* Extract a $ string from the input line */
+static char *
+posix_parse_dollar (struct token_info *token)
+{
+ /* $foo becomes 'foo' */
+ char * q;
+ char * p;
+ q = token->text;
+ p = token->src;
+ token->use_cmd_file = 1;
+
+ p++;
+ *q++ = '\'';
+ INC_TOKEN_LEN_OR_RETURN (p);
+
+ while ((isalnum (*p)) || (*p == '_'))
+ {
+ *q++ = *p++;
+ INC_TOKEN_LEN_OR_BREAK;
+ }
+ *q++ = '\'';
+ while (1)
+ {
+ INC_TOKEN_LEN_OR_BREAK;
+ break;
+ }
+ *q = 0;
+ return p;
+}
+
+const char *vms_filechars = "0123456789abcdefghijklmnopqrstuvwxyz" \
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZ[]<>:/_-.$";
+
+/* Simple text copy */
+static char *
+parse_text (struct token_info *token, int assignment_hack)
+{
+ char * q;
+ char * p;
+ int str_len;
+ q = token->text;
+ p = token->src;
+
+ /* If assignment hack, then this text needs to be double quoted. */
+ if (vms_unix_simulation && (assignment_hack == 2))
+ {
+ *q++ = '"';
+ INC_TOKEN_LEN_OR_RETURN (p);
+ }
+
+ *q++ = *p++;
+ INC_TOKEN_LEN_OR_RETURN (p);
+
+ while (*p != 0)
+ {
+ str_len = strspn (p, vms_filechars);
+ if (str_len == 0)
+ {
+ /* Pass through backslash escapes in Unix simulation
+ probably will not work anyway.
+ All any character after a ^ otherwise to support EFS.
+ */
+ if (vms_unix_simulation && (p[0] == '\\') && (p[1] != 0))
+ str_len = 2;
+ else if ((p[0] == '^') && (p[1] != 0))
+ str_len = 2;
+ else if (!vms_unix_simulation && (p[0] == ';'))
+ str_len = 1;
+
+ if (str_len == 0)
+ {
+ /* If assignment hack, then this needs to be double quoted. */
+ if (vms_unix_simulation && (assignment_hack == 2))
+ {
+ *q++ = '"';
+ INC_TOKEN_LEN_OR_RETURN (p);
+ }
+ *q = 0;
+ return p;
+ }
+ }
+ if (str_len > 0)
+ {
+ ADD_TOKEN_LEN_OR_RETURN (str_len, p);
+ strncpy (q, p, str_len);
+ p += str_len;
+ q += str_len;
+ *q = 0;
+ }
+ }
+ /* If assignment hack, then this text needs to be double quoted. */
+ if (vms_unix_simulation && (assignment_hack == 2))
+ {
+ *q++ = '"';
+ INC_TOKEN_LEN_OR_RETURN (p);
+ }
+ return p;
+}
+
+/* single character copy */
+static char *
+parse_char (struct token_info *token, int count)
+{
+ char * q;
+ char * p;
+ q = token->text;
+ p = token->src;
+
+ while (count > 0)
+ {
+ *q++ = *p++;
+ INC_TOKEN_LEN_OR_RETURN (p);
+ count--;
+ }
+ *q = 0;
+ return p;
+}
+
+/* Build a command string from the collected tokens
+ and process built-ins now
+*/
+static struct dsc$descriptor_s *
+build_vms_cmd (char **cmd_tokens,
+ enum auto_pipe use_pipe_cmd,
+ int append_token)
+{
+ struct dsc$descriptor_s *cmd_dsc;
+ int cmd_tkn_index;
+ char * cmd;
+ int cmd_len;
+ int semicolon_seen;
+
+ cmd_tkn_index = 0;
+ cmd_dsc = xmalloc (sizeof (struct dsc$descriptor_s));
+
+ /* Empty command? */
+ if (cmd_tokens[0] == NULL)
+ {
+ cmd_dsc->dsc$a_pointer = NULL;
+ cmd_dsc->dsc$w_length = 0;
+ return cmd_dsc;
+ }
+
+ /* Max DCL command + 1 extra token and trailing space */
+ cmd = xmalloc (MAX_DCL_CMD_LINE_LENGTH + 256);
+
+ cmd[0] = '$';
+ cmd[1] = 0;
+ cmd_len = 1;
+
+ /* Handle real or auto-pipe */
+ if (use_pipe_cmd == add_pipe)
+ {
+ /* We need to auto convert to a pipe command */
+ strcat (cmd, "pipe ");
+ cmd_len += 5;
+ }
+
+ semicolon_seen = 0;
+ while (cmd_tokens[cmd_tkn_index] != NULL)
+ {
+
+ /* Check for buffer overflow */
+ if (cmd_len > MAX_DCL_CMD_LINE_LENGTH)
+ {
+ errno = E2BIG;
+ break;
+ }
+
+ /* Eliminate double ';' */
+ if (semicolon_seen && (cmd_tokens[cmd_tkn_index][0] == ';'))
+ {
+ semicolon_seen = 0;
+ free (cmd_tokens[cmd_tkn_index++]);
+ if (cmd_tokens[cmd_tkn_index] == NULL)
+ break;
+ }
+
+ /* Special handling for CD built-in */
+ if (strncmp (cmd_tokens[cmd_tkn_index], "builtin_cd", 11) == 0)
+ {
+ int result;
+ semicolon_seen = 0;
+ free (cmd_tokens[cmd_tkn_index]);
+ cmd_tkn_index++;
+ if (cmd_tokens[cmd_tkn_index] == NULL)
+ break;
+ DB(DB_JOBS, (_("BUILTIN CD %s\n"), cmd_tokens[cmd_tkn_index]));
+
+ /* TODO: chdir fails with some valid syntaxes */
+ result = chdir (cmd_tokens[cmd_tkn_index]);
+ if (result != 0)
+ {
+ /* TODO: Handle failure better */
+ free (cmd);
+ while (cmd_tokens[cmd_tkn_index] == NULL)
+ free (cmd_tokens[cmd_tkn_index++]);
+ cmd_dsc->dsc$w_length = -1;
+ cmd_dsc->dsc$a_pointer = NULL;
+ return cmd_dsc;
+ }
+ }
+ else if (strncmp (cmd_tokens[cmd_tkn_index], "exit", 5) == 0)
+ {
+ /* Copy the exit command */
+ semicolon_seen = 0;
+ strcpy (&cmd[cmd_len], cmd_tokens[cmd_tkn_index]);
+ cmd_len += strlen (cmd_tokens[cmd_tkn_index]);
+ free (cmd_tokens[cmd_tkn_index++]);
+ if (cmd_len > MAX_DCL_CMD_LINE_LENGTH)
+ {
+ errno = E2BIG;
+ break;
+ }
+
+ /* Optional whitespace */
+ if (isspace (cmd_tokens[cmd_tkn_index][0]))
+ {
+ strcpy (&cmd[cmd_len], cmd_tokens[cmd_tkn_index]);
+ cmd_len += strlen (cmd_tokens[cmd_tkn_index]);
+ free (cmd_tokens[cmd_tkn_index++]);
+ if (cmd_len > MAX_DCL_CMD_LINE_LENGTH)
+ {
+ errno = E2BIG;
+ break;
+ }
+ }
+
+ /* There should be a status, but it is optional */
+ if (cmd_tokens[cmd_tkn_index][0] == ';')
+ continue;
+
+ /* If Unix simulation, add '((' */
+ if (vms_unix_simulation)
+ {
+ strcpy (&cmd[cmd_len], "((");
+ cmd_len += 2;
+ if (cmd_len > MAX_DCL_CMD_LINE_LENGTH)
+ {
+ errno = E2BIG;
+ break;
+ }
+ }
+
+ /* Add the parameter */
+ strcpy (&cmd[cmd_len], cmd_tokens[cmd_tkn_index]);
+ cmd_len += strlen (cmd_tokens[cmd_tkn_index]);
+ free (cmd_tokens[cmd_tkn_index++]);
+ if (cmd_len > MAX_DCL_CMD_LINE_LENGTH)
+ {
+ errno = E2BIG;
+ break;
+ }
+
+ /* Add " * 8) .and. %x7f8) .or. %x1035a002" */
+ if (vms_unix_simulation)
+ {
+ const char *end_str = " * 8) .and. %x7f8) .or. %x1035a002";
+ strcpy (&cmd[cmd_len], end_str);
+ cmd_len += strlen (end_str);
+ if (cmd_len > MAX_DCL_CMD_LINE_LENGTH)
+ {
+ errno = E2BIG;
+ break;
+ }
+ }
+ continue;
+ }
+
+ /* auto pipe needs spaces before semicolon */
+ if (use_pipe_cmd == add_pipe)
+ if (cmd_tokens[cmd_tkn_index][0] == ';')
+ {
+ cmd[cmd_len++] = ' ';
+ semicolon_seen = 1;
+ if (cmd_len > MAX_DCL_CMD_LINE_LENGTH)
+ {
+ errno = E2BIG;
+ break;
+ }
+ }
+ else
+ {
+ char ch;
+ ch = cmd_tokens[cmd_tkn_index][0];
+ if (!(ch == ' ' || ch == '\t'))
+ semicolon_seen = 0;
+ }
+
+ strcpy (&cmd[cmd_len], cmd_tokens[cmd_tkn_index]);
+ cmd_len += strlen (cmd_tokens[cmd_tkn_index]);
+
+ free (cmd_tokens[cmd_tkn_index++]);
+
+ /* Skip the append tokens if they exist */
+ if (cmd_tkn_index == append_token)
+ {
+ free (cmd_tokens[cmd_tkn_index++]);
+ if (isspace (cmd_tokens[cmd_tkn_index][0]))
+ free (cmd_tokens[cmd_tkn_index++]);
+ free (cmd_tokens[cmd_tkn_index++]);
+ }
}
- return l;
+
+ cmd[cmd_len] = 0;
+ cmd_dsc->dsc$w_length = cmd_len;
+ cmd_dsc->dsc$a_pointer = cmd;
+ cmd_dsc->dsc$b_dtype = DSC$K_DTYPE_T;
+ cmd_dsc->dsc$b_class = DSC$K_CLASS_S;
+
+ return cmd_dsc;
}
+
int
-child_execute_job (char *argv, struct child *child)
+child_execute_job (struct child *child, char *argv)
{
int i;
- static struct dsc$descriptor_s cmddsc;
- static struct dsc$descriptor_s pnamedsc;
- static struct dsc$descriptor_s ifiledsc;
- static struct dsc$descriptor_s ofiledsc;
- static struct dsc$descriptor_s efiledsc;
- int have_redirection = 0;
- int have_append = 0;
- int have_newline = 0;
+ static struct dsc$descriptor_s *cmd_dsc;
+ static struct dsc$descriptor_s pnamedsc;
int spflags = CLI$M_NOWAIT;
int status;
- char *cmd = alloca (strlen (argv) + 512), *p, *q;
- char ifile[256], ofile[256], efile[256];
int comnamelen;
char procname[100];
- int in_string;
+
+ char *p;
+ char *cmd_tokens[(MAX_DCL_TOKENS * 2) + 1]; /* whitespace does not count */
+ char token_str[MAX_DCL_TOKEN_LENGTH + 1];
+ struct token_info token;
+ int cmd_tkn_index;
+ int paren_level = 0;
+ enum auto_pipe use_pipe_cmd = nopipe;
+ int append_token = -1;
+ char *append_file = NULL;
+ int unix_echo_cmd = 0; /* Special handle Unix echo command */
+ int assignment_hack = 0; /* Handle x=y command as piped command */
/* Parse IO redirection. */
- ifile[0] = 0;
- ofile[0] = 0;
- efile[0] = 0;
child->comname = NULL;
DB (DB_JOBS, ("child_execute_job (%s)\n", argv));
@@ -347,313 +836,422 @@ child_execute_job (char *argv, struct child *child)
argv++;
if (*argv == 0)
- return 0;
+ {
+ /* Only a built-in or a null command - Still need to run term AST */
+ child->cstatus = VMS_POSIX_EXIT_MASK;
+ child->vms_launch_status = SS$_NORMAL;
+ /* TODO what is this "magic number" */
+ child->pid = 270163; /* Special built-in */
+ child->efn = 0;
+ vmsHandleChildTerm (child);
+ return 1;
+ }
sprintf (procname, "GMAKE_%05x", getpid () & 0xfffff);
- pnamedsc.dsc$w_length = strlen(procname);
+ pnamedsc.dsc$w_length = strlen (procname);
pnamedsc.dsc$a_pointer = procname;
pnamedsc.dsc$b_dtype = DSC$K_DTYPE_T;
pnamedsc.dsc$b_class = DSC$K_CLASS_S;
- in_string = 0;
+ /* Old */
/* Handle comments and redirection.
For ONESHELL, the redirection must be on the first line. Any other
redirection token is handled by DCL, that is, the pipe command with
redirection can be used, but it should not be used on the first line
for ONESHELL. */
- for (p = argv, q = cmd; *p; p++, q++)
+
+ /* VMS parser notes:
+ 1. A token is any of DCL verbs, qualifiers, parameters, or punctuation.
+ 2. Only MAX_DCL_TOKENS per line in both one line or command file mode.
+ 3. Each token limited to MAC_DCL_TOKEN_LENGTH
+ 4. If the line to DCL is greater than MAX_DCL_LINE_LENGTH then a
+ command file must be used.
+ 5. Currently a command file must be used symbol substitution is to
+ be performed.
+ 6. Currently limiting command files to 2 * MAX_DCL_TOKENS.
+
+ Build both a command file token list and command line token list
+ until it is determined that the command line limits are exceeded.
+ */
+
+ cmd_tkn_index = 0;
+ cmd_tokens[cmd_tkn_index] = NULL;
+ p = argv;
+
+ token.text = token_str;
+ token.length = 0;
+ token.cmd_errno = 0;
+ token.use_cmd_file = 0;
+
+ while (*p != 0)
{
- if (*p == '"')
- in_string = !in_string;
- if (in_string)
- {
- *q = *p;
- continue;
- }
+ /* We can not build this command so give up */
+ if (token.cmd_errno != 0)
+ break;
+
+ token.src = p;
+
switch (*p)
{
- case '#':
- *p-- = 0;
- *q-- = 0;
+ case '\'':
+ if (vms_unix_simulation || unix_echo_cmd)
+ {
+ p = posix_parse_sq (&token);
+ UPDATE_TOKEN;
+ break;
+ }
+
+ /* VMS mode, the \' means that a symbol substitution is starting
+ so while you might think you can just copy until the next
+ \'. Unfortunately the substitution can be a lexical function
+ which can contain embedded strings and lexical functions.
+ Messy.
+ */
+ p = vms_parse_quotes (&token);
+ UPDATE_TOKEN;
+ break;
+ case '"':
+ if (vms_unix_simulation)
+ {
+ p = posix_parse_dq (&token);
+ UPDATE_TOKEN;
+ break;
+ }
+
+ /* VMS quoted string, can contain lexical functions with
+ quoted strings and nested lexical functions.
+ */
+ p = vms_parse_quotes (&token);
+ UPDATE_TOKEN;
+ break;
+
+ case '$':
+ if (vms_unix_simulation)
+ {
+ p = posix_parse_dollar (&token);
+ UPDATE_TOKEN;
+ break;
+ }
+
+ /* Otherwise nothing special */
+ p = parse_text (&token, 0);
+ UPDATE_TOKEN;
break;
case '\\':
- p++;
- if (*p == '\n')
+ if (p[1] == '\n')
+ {
+ /* Line continuation, remove it */
+ p += 2;
+ break;
+ }
+
+ /* Ordinary character otherwise */
+ if (assignment_hack != 0)
+ assignment_hack++;
+ if (assignment_hack > 2)
+ {
+ assignment_hack = 0; /* Reset */
+ if (use_pipe_cmd == nopipe) /* force pipe use */
+ use_pipe_cmd = add_pipe;
+ token_str[0] = ';'; /* add ; token */
+ token_str[1] = 0;
+ UPDATE_TOKEN;
+ }
+ p = parse_text (&token, assignment_hack);
+ UPDATE_TOKEN;
+ break;
+ case '!':
+ case '#':
+ /* Unix '#' is VMS '!' which comments out the rest of the line.
+ Historically the rest of the line has been skipped.
+ Not quite the right thing to do, as the f$verify lexical
+ function works in comments. But this helps keep the line
+ lengths short.
+ */
+ unix_echo_cmd = 0;
+ while (*p != '\n' && *p != 0)
p++;
- if (isspace ((unsigned char)*p))
+ break;
+ case '(':
+ /* Subshell, equation, or lexical function argument start */
+ p = parse_char (&token, 1);
+ UPDATE_TOKEN;
+ paren_level++;
+ break;
+ case ')':
+ /* Close out a paren level */
+ p = parse_char (&token, 1);
+ UPDATE_TOKEN;
+ paren_level--;
+ /* TODO: Should we diagnose if paren_level goes negative? */
+ break;
+ case '&':
+ if (isalpha (p[1]) && !vms_unix_simulation)
{
- do { p++; } while (isspace ((unsigned char)*p));
- p--;
+ /* VMS symbol substitution */
+ p = parse_text (&token, 0);
+ token.use_cmd_file = 1;
+ UPDATE_TOKEN;
+ break;
}
- *q = *p;
+ if (use_pipe_cmd == nopipe)
+ use_pipe_cmd = add_pipe;
+ if (p[1] != '&')
+ p = parse_char (&token, 1);
+ else
+ p = parse_char (&token, 2);
+ UPDATE_TOKEN;
+ break;
+ case '|':
+ if (use_pipe_cmd == nopipe)
+ use_pipe_cmd = add_pipe;
+ if (p[1] != '|')
+ p = parse_char (&token, 1);
+ else
+ p = parse_char (&token, 2);
+ UPDATE_TOKEN;
break;
+ case ';':
+ /* Separator - convert to a pipe command. */
+ unix_echo_cmd = 0;
case '<':
- if (have_newline==0)
+ if (use_pipe_cmd == nopipe)
+ use_pipe_cmd = add_pipe;
+ p = parse_char (&token, 1);
+ UPDATE_TOKEN;
+ break;
+ case '>':
+ if (use_pipe_cmd == nopipe)
+ use_pipe_cmd = add_pipe;
+ if (p[1] == '>')
{
- p = vms_redirect (&ifiledsc, ifile, p);
- *q = ' ';
- have_redirection = 1;
+ /* Parsing would have been simple until support for the >>
+ append redirect was added.
+ Implementation needs:
+ * if not exist output file create empty
+ * open/append gnv$make_temp??? output_file
+ * define/user sys$output gnv$make_temp???
+ ** And all this done before the command previously tokenized.
+ * command previously tokenized
+ * close gnv$make_temp???
+ */
+ p = parse_char (&token, 2);
+ append_token = cmd_tkn_index;
+ token.use_cmd_file = 1;
}
else
- *q = *p;
+ p = parse_char (&token, 1);
+ UPDATE_TOKEN;
break;
- case '>':
- if (have_newline==0)
+ case '/':
+ /* Unix path or VMS option start, read until non-path symbol */
+ if (assignment_hack != 0)
+ assignment_hack++;
+ if (assignment_hack > 2)
{
- have_redirection = 1;
- if (*(p-1) == '2')
- {
- q--;
- if (strncmp (p, ">&1", 3) == 0)
- {
- p += 2;
- strcpy (efile, "sys$output");
- efiledsc.dsc$w_length = strlen(efile);
- efiledsc.dsc$a_pointer = efile;
- efiledsc.dsc$b_dtype = DSC$K_DTYPE_T;
- efiledsc.dsc$b_class = DSC$K_CLASS_S;
- }
- else
- p = vms_redirect (&efiledsc, efile, p);
- }
- else
+ assignment_hack = 0; /* Reset */
+ if (use_pipe_cmd == nopipe) /* force pipe use */
+ use_pipe_cmd = add_pipe;
+ token_str[0] = ';'; /* add ; token */
+ token_str[1] = 0;
+ UPDATE_TOKEN;
+ }
+ p = parse_text (&token, assignment_hack);
+ UPDATE_TOKEN;
+ break;
+ case ':':
+ if ((p[1] == 0) || isspace (p[1]))
+ {
+ /* Unix Null command - treat as comment until next command */
+ unix_echo_cmd = 0;
+ p++;
+ while (*p != 0)
{
- if (*(p+1) == '>')
+ if (*p == ';')
{
- have_append = 1;
- p += 1;
+ /* Remove Null command from pipeline */
+ p++;
+ break;
}
- p = vms_redirect (&ofiledsc, ofile, p);
+ p++;
}
- *q = ' ';
+ break;
}
+
+ /* String assignment */
+ /* := :== or : */
+ if (p[1] != '=')
+ p = parse_char (&token, 1);
+ else if (p[2] != '=')
+ p = parse_char (&token, 2);
else
- *q = *p;
+ p = parse_char (&token, 3);
+ UPDATE_TOKEN;
break;
- case '\n':
- have_newline++;
- default:
- *q = *p;
+ case '=':
+ /* = or == */
+ /* If this is not an echo statement, this could be a shell
+ assignment. VMS requires the target to be quoted if it
+ is not a macro substitution */
+ if (!unix_echo_cmd && vms_unix_simulation && (assignment_hack == 0))
+ assignment_hack = 1;
+ if (p[1] != '=')
+ p = parse_char (&token, 1);
+ else
+ p = parse_char (&token, 2);
+ UPDATE_TOKEN;
break;
- }
- }
- *q = *p;
- while (isspace ((unsigned char)*--q))
- *q = '\0';
-
-
-#define VMS_EMPTY_ECHO "write sys$output \"\""
- if (have_newline == 0)
- {
- /* multiple shells */
- if (strncmp(cmd, "builtin_", 8) == 0)
- {
- child->pid = 270163;
- child->efn = 0;
- child->cstatus = 1;
-
- DB(DB_JOBS, (_("BUILTIN [%s][%s]\n"), cmd, cmd + 8));
+ case '+':
+ case '-':
+ case '*':
+ p = parse_char (&token, 1);
+ UPDATE_TOKEN;
+ break;
+ case '.':
+ /* .xxx. operation, VMS does not require the trailing . */
+ p = parse_text (&token, 0);
+ UPDATE_TOKEN;
+ break;
+ default:
+ /* Skip repetitive whitespace */
+ if (isspace (*p))
+ {
+ p = parse_char (&token, 1);
- p = cmd + 8;
+ /* Force to a space or a tab */
+ if ((token_str[0] != ' ') ||
+ (token_str[0] != '\t'))
+ token_str[0] = ' ';
+ UPDATE_TOKEN;
- if ((*(p) == 'c') && (*(p + 1) == 'd')
- && ((*(p + 2) == ' ') || (*(p + 2) == '\t')))
- {
- p += 3;
- while ((*p == ' ') || (*p == '\t'))
+ while (isspace (*p))
p++;
- DB(DB_JOBS, (_("BUILTIN CD %s\n"), p));
- if (chdir(p))
- return 0;
- else
- return 1;
- }
- else if ((*(p) == 'e')
- && (*(p+1) == 'c')
- && (*(p+2) == 'h')
- && (*(p+3) == 'o')
- && ((*(p+4) == ' ') || (*(p+4) == '\t') || (*(p+4) == '\0')))
- {
- /* This is not a real builtin, it is a built in pre-processing
- for the VMS/DCL echo (write sys$output) to ensure the to be echoed
- string is correctly quoted (with the DCL quote character '"'). */
- char *vms_echo;
- p += 4;
- if (*p == '\0')
- cmd = VMS_EMPTY_ECHO;
- else
- {
- p++;
- while ((*p == ' ') || (*p == '\t'))
- p++;
- if (*p == '\0')
- cmd = VMS_EMPTY_ECHO;
- else
- {
- vms_echo = alloca(strlen(p) + sizeof VMS_EMPTY_ECHO);
- strcpy(vms_echo, VMS_EMPTY_ECHO);
- vms_echo[sizeof VMS_EMPTY_ECHO - 2] = '\0';
- strcat(vms_echo, p);
- strcat(vms_echo, "\"");
- cmd = vms_echo;
- }
- }
- DB (DB_JOBS, (_("BUILTIN ECHO %s->%s\n"), p, cmd));
+ if (assignment_hack != 0)
+ assignment_hack++;
+ break;
}
- else
+
+ if (assignment_hack != 0)
+ assignment_hack++;
+ if (assignment_hack > 2)
{
- printf(_("Unknown builtin command '%s'\n"), cmd);
- fflush(stdout);
- return 0;
+ assignment_hack = 0; /* Reset */
+ if (use_pipe_cmd == nopipe) /* force pipe use */
+ use_pipe_cmd = add_pipe;
+ token_str[0] = ';'; /* add ; token */
+ token_str[1] = 0;
+ UPDATE_TOKEN;
}
- }
- /* expand ':' aka 'do nothing' builtin for bash and friends */
- else if (cmd[0]==':' && cmd[1]=='\0')
- {
- cmd = "continue";
+ p = parse_text (&token, assignment_hack);
+ if (strncasecmp (token.text, "echo", 4) == 0)
+ unix_echo_cmd = 1;
+ else if (strncasecmp (token.text, "pipe", 4) == 0)
+ use_pipe_cmd = dcl_pipe;
+ UPDATE_TOKEN;
+ break;
}
}
- else
+
+ /* End up here with a list of tokens to build a command line.
+ Deal with errors detected during parsing.
+ */
+ if (token.cmd_errno != 0)
{
- /* todo: expand ':' aka 'do nothing' builtin for bash and friends */
- /* For 'one shell' expand all the
- builtin_echo
- to
- write sys$output ""
- where one is ......7 bytes longer.
- At the same time ensure that the echo string is properly terminated.
- For that, allocate a command buffer big enough for all possible expansions
- (have_newline is the count), then expand, copy and terminate. */
- char *tmp_cmd;
- int nloff = 0;
- int vlen = 0;
- int clen = 0;
- int inecho;
-
- tmp_cmd = alloca(strlen(cmd) + (have_newline + 1) * 7 + 1);
- tmp_cmd[0] = '\0';
- inecho = 0;
- while (cmd[nloff])
+ while (cmd_tokens[cmd_tkn_index] == NULL)
+ free (cmd_tokens[cmd_tkn_index++]);
+ child->cstatus = VMS_POSIX_EXIT_MASK | (MAKE_TROUBLE << 3);
+ child->vms_launch_status = SS$_ABORT;
+ /* TODO what is this "magic number" */
+ child->pid = 270163; /* Special built-in */
+ child->efn = 0;
+ errno = token.cmd_errno;
+ return 0;
+ }
+
+ /* Save any redirection to append file */
+ if (append_token != -1)
+ {
+ int file_token;
+ char * lastdot;
+ char * lastdir;
+ char * raw_append_file;
+ file_token = append_token;
+ file_token++;
+ if (isspace (cmd_tokens[file_token][0]))
+ file_token++;
+ raw_append_file = vmsify (cmd_tokens[file_token], 0);
+ /* VMS DCL needs a trailing dot if null file extension */
+ lastdot = strrchr(raw_append_file, '.');
+ lastdir = strrchr(raw_append_file, ']');
+ if (lastdir == NULL)
+ lastdir = strrchr(raw_append_file, '>');
+ if (lastdir == NULL)
+ lastdir = strrchr(raw_append_file, ':');
+ if ((lastdot == NULL) || (lastdot > lastdir))
{
- if (inecho)
- {
- if (clen < nloff - 1)
- {
- memcpy(&tmp_cmd[vlen], &cmd[clen], nloff - clen - 1);
- vlen += nloff - clen - 1;
- clen = nloff;
- }
- inecho = 0;
- tmp_cmd[vlen] = '"';
- vlen++;
- tmp_cmd[vlen] = '\n';
- vlen++;
- }
- if (strncmp(&cmd[nloff], "builtin_", 8) == 0)
- {
- /* ??? */
- child->pid = 270163;
- child->efn = 0;
- child->cstatus = 1;
-
- DB (DB_JOBS, (_("BUILTIN [%s][%s]\n"), &cmd[nloff], &cmd[nloff+8]));
- p = &cmd[nloff + 8];
- if ((*(p) == 'e')
- && (*(p + 1) == 'c')
- && (*(p + 2) == 'h')
- && (*(p + 3) == 'o')
- && ((*(p + 4) == ' ') || (*(p + 4) == '\t') || (*(p + 4) == '\0')))
- {
- if (clen < nloff - 1)
- {
- memcpy(&tmp_cmd[vlen], &cmd[clen], nloff - clen - 1);
- vlen += nloff - clen - 1;
- clen = nloff;
- if (inecho)
- {
- inecho = 0;
- tmp_cmd[vlen] = '"';
- vlen++;
- }
- tmp_cmd[vlen] = '\n';
- vlen++;
- }
- inecho = 1;
- p += 4;
- while ((*p == ' ') || (*p == '\t'))
- p++;
- clen = p - cmd;
- memcpy(&tmp_cmd[vlen], VMS_EMPTY_ECHO,
- sizeof VMS_EMPTY_ECHO - 2);
- vlen += sizeof VMS_EMPTY_ECHO - 2;
- }
- else
- {
- printf (_("Builtin command is unknown or unsupported in .ONESHELL: '%s'\n"), &cmd[nloff]);
- fflush(stdout);
- return 0;
- }
- }
- nloff = nextnl(cmd, nloff + 1);
+ append_file = xmalloc (strlen (raw_append_file) + 1);
+ strcpy (append_file, raw_append_file);
+ strcat (append_file, ".");
}
- if (clen < nloff)
+ else
+ append_file = strdup(raw_append_file);
+ }
+
+ cmd_dsc = build_vms_cmd (cmd_tokens, use_pipe_cmd, append_token);
+ if (cmd_dsc->dsc$a_pointer == NULL)
+ {
+ if (cmd_dsc->dsc$w_length < 0)
{
- memcpy(&tmp_cmd[vlen], &cmd[clen], nloff - clen);
- vlen += nloff - clen;
- clen = nloff;
- if (inecho)
- {
- inecho = 0;
- tmp_cmd[vlen] = '"';
- vlen++;
- }
+ free (cmd_dsc);
+ child->cstatus = VMS_POSIX_EXIT_MASK | (MAKE_TROUBLE << 3);
+ child->vms_launch_status = SS$_ABORT;
+ /* TODO what is this "magic number" */
+ child->pid = 270163; /* Special built-in */
+ child->efn = 0;
+ return 0;
}
- tmp_cmd[vlen] = '\0';
-
- cmd = tmp_cmd;
+ /* Only a built-in or a null command - Still need to run term AST */
+ free (cmd_dsc);
+ child->cstatus = VMS_POSIX_EXIT_MASK;
+ child->vms_launch_status = SS$_NORMAL;
+ /* TODO what is this "magic number" */
+ child->pid = 270163; /* Special built-in */
+ child->efn = 0;
+ vmsHandleChildTerm (child);
+ return 1;
}
-#ifdef USE_DCL_COM_FILE
- /* Enforce the creation of a command file.
- Then all the make environment variables are written as DCL symbol
- assignments into the command file as well, so that they are visible
- in the sub-process but do not affect the current process.
+ if (cmd_dsc->dsc$w_length > MAX_DCL_LINE_LENGTH)
+ token.use_cmd_file = 1;
+
+ DB(DB_JOBS, (_("DCL: %s\n"), cmd_dsc->dsc$a_pointer));
+
+ /* Enforce the creation of a command file if "vms_always_use_cmd_file" is
+ non-zero.
Further, this way DCL reads the input stream and therefore does
'forced' symbol substitution, which it doesn't do for one-liners when
- they are 'lib$spawn'ed. */
-#else
- /* Create a *.com file if either the command is too long for
- lib$spawn, or the command contains a newline, or if redirection
- is desired. Forcing commands with newlines into DCLs allows to
- store search lists on user mode logicals. */
- if (strlen (cmd) > MAXCMDLEN
- || (have_redirection != 0)
- || (have_newline != 0))
-#endif
+ they are 'lib$spawn'ed.
+
+ Otherwise the behavior is:
+
+ Create a *.com file if either the command is too long for
+ lib$spawn, or if a redirect appending to a file is desired, or
+ symbol substitition.
+ */
+
+ if (vms_always_use_cmd_file || token.use_cmd_file)
{
FILE *outfile;
- char c;
- char *sep;
- int alevel = 0; /* apostrophe level */
- int tmpstrlen;
- char *tmpstr;
- if (strlen (cmd) == 0)
- {
- printf (_("Error, empty command\n"));
- fflush (stdout);
- return 0;
- }
+ int cmd_len;
- outfile = output_tmpfile (&child->comname, "sys$scratch:CMDXXXXXX.COM");
+ outfile = output_tmpfile (&child->comname,
+ "sys$scratch:gnv$make_cmdXXXXXX.com");
/* 012345678901234567890 */
-#define TMP_OFFSET 12
-#define TMP_LEN 9
if (outfile == 0)
pfatal_with_name (_("fopen (temporary file)"));
comnamelen = strlen (child->comname);
- tmpstr = &child->comname[TMP_OFFSET];
- tmpstrlen = TMP_LEN;
+
/* The whole DCL "script" is executed as one action, and it behaves as
any DCL "script", that is errors stop it but warnings do not. Usually
the command on the last line, defines the exit code. However, with
@@ -667,158 +1265,72 @@ child_execute_job (char *argv, struct child *child)
verify". However, the prolog and epilog commands are not shown. Also,
if output redirection is used, the verification output is redirected
into that file as well. */
- fprintf (outfile, "$ %.*s_1 = \"''f$verify(0)'\"\n", tmpstrlen, tmpstr);
- if (ifile[0])
- {
- fprintf (outfile, "$ assign/user %s sys$input\n", ifile);
- DB (DB_JOBS, (_("Redirected input from %s\n"), ifile));
- ifiledsc.dsc$w_length = 0;
- }
+ fprintf (outfile, "$ gnv$$make_verify = \"''f$verify(0)'\"\n");
+ fprintf (outfile, "$ gnv$$make_pid = f$getjpi(\"\",\"pid\")\n");
+ fprintf (outfile, "$ on error then $ goto gnv$$make_error\n");
- if (efile[0])
+ /* Handle append redirection */
+ if (append_file != NULL)
{
- fprintf (outfile, "$ define sys$error %s\n", efile);
- DB (DB_JOBS, (_("Redirected error to %s\n"), efile));
- efiledsc.dsc$w_length = 0;
+ /* If file does not exist, create it */
+ fprintf (outfile,
+ "$ gnv$$make_al = \"gnv$$make_append''gnv$$make_pid'\"\n");
+ fprintf (outfile,
+ "$ if f$search(\"%s\") .eqs. \"\" then create %s\n",
+ append_file, append_file);
+
+ fprintf (outfile,
+ "$ open/append 'gnv$$make_al' %s\n", append_file);
+
+ /* define sys$output to that file */
+ fprintf (outfile,
+ "$ define/user sys$output 'gnv$$make_al'\n");
+ DB (DB_JOBS, (_("Append output to %s\n"), append_file));
+ free(append_file);
}
- if (ofile[0])
- if (have_append)
- {
- fprintf (outfile, "$ define sys$output %.*s\n", comnamelen-3, child->comname);
- fprintf (outfile, "$ on error then $ goto %.*s\n", tmpstrlen, tmpstr);
- 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;
- }
-#ifdef USE_DCL_COM_FILE
- /* Export the child environment into DCL symbols */
- if (child->environment != 0)
- {
- char **ep = child->environment;
- char *valstr;
- while (*ep != 0)
- {
- valstr = strchr(*ep, '=');
- if (valstr == NULL)
- continue;
- fprintf(outfile, "$ %.*s=\"%s\"\n", valstr - *ep, *ep,
- valstr + 1);
- ep++;
- }
- }
-#endif
- fprintf (outfile, "$ %.*s_ = f$verify(%.*s_1)\n", tmpstrlen, tmpstr, tmpstrlen, tmpstr);
-
- /* TODO: give 78 a name! Whether 78 is a good number is another question.
- Trim, split and write the command lines.
- Splitting of a command is done after 78 output characters at an
- appropriate place (after strings, after comma or space and
- before slash): appending a hyphen indicates that the DCL command
- is being continued.
- Trimming is to skip any whitespace around - including - a
- leading $ from the command to ensure writing exactly one "$ "
- at the beginning of the line of the output file. Trimming is
- done when a new command is seen, indicated by a '\n' (outside
- of a string).
- The buffer so far is written and reset, when a new command is
- seen, when a split was done and at the end of the command.
+ fprintf (outfile, "$ gnv$$make_verify = f$verify(gnv$$make_verify)\n");
+
+ /* TODO:
Only for ONESHELL there will be several commands separated by
- '\n'. But there can always be multiple continuation lines. */
- p = sep = q = cmd;
- for (c = '\n'; c; c = *q++)
- {
- switch (c)
- {
- case '\n':
- if (q > p)
- {
- fwrite(p, 1, q - p, outfile);
- p = q;
- }
- fputc('$', outfile);
- fputc(' ', outfile);
- while (isspace((unsigned char) *p))
- p++;
- if (*p == '$')
- p++;
- while (isspace((unsigned char) *p))
- p++;
- q = sep = p;
- break;
- case '"':
- q = vms_handle_apos(q);
- sep = q;
- break;
- case ',':
- case ' ':
- sep = q;
- break;
- case '/':
- case '\0':
- sep = q - 1;
- break;
- default:
- break;
- }
- if (sep - p > 78)
- {
- /* Enough stuff for a line. */
- fwrite(p, 1, sep - p, outfile);
- p = sep;
- if (*sep)
- {
- /* The command continues. */
- fputc('-', outfile);
- }
- fputc('\n', outfile);
- }
- }
+ '\n'. But there can always be multiple continuation lines.
+ */
- if (*p)
- {
- fwrite(p, 1, --q - p, outfile);
- fputc('\n', outfile);
- }
+ fprintf (outfile, "%s\n", cmd_dsc->dsc$a_pointer);
+ fprintf (outfile, "$ gnv$$make_status_2 = $status\n");
+ fprintf (outfile, "$ goto gnv$$make_exit\n");
- if (have_append)
+ /* Exit and clean up */
+ fprintf (outfile, "$ gnv$$make_error: ! 'f$verify(0)\n");
+ fprintf (outfile, "$ gnv$$make_status_2 = $status\n");
+
+ if (append_token != -1)
{
- fprintf (outfile, "$ %.*s: ! 'f$verify(0)\n", tmpstrlen, tmpstr);
- fprintf (outfile, "$ %.*s_2 = $status\n", tmpstrlen, tmpstr);
- fprintf (outfile, "$ on error then $ exit\n");
fprintf (outfile, "$ deassign sys$output\n");
- if (efile[0])
- fprintf (outfile, "$ deassign sys$error\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);
- fprintf (outfile, "$ exit '%.*s_2 + (0*f$verify(%.*s_1))\n", tmpstrlen, tmpstr, tmpstrlen, tmpstr);
- DB (DB_JOBS, (_("Append %.*s and cleanup\n"), comnamelen-3, child->comname));
+ fprintf (outfile, "$ close 'gnv$$make_al'\n");
+
+ DB (DB_JOBS,
+ (_("Append %.*s and cleanup\n"), comnamelen-3, child->comname));
}
+ fprintf (outfile, "$ gnv$$make_exit: ! 'f$verify(0)\n");
+ fprintf (outfile,
+ "$ exit 'gnv$$make_status_2' + (0*f$verify(gnv$$make_verify))\n");
fclose (outfile);
- sprintf (cmd, "$ @%s", child->comname);
+ free (cmd_dsc->dsc$a_pointer);
+ cmd_dsc->dsc$a_pointer = xmalloc (256 + 4);
+ sprintf (cmd_dsc->dsc$a_pointer, "$ @%s", child->comname);
+ cmd_dsc->dsc$w_length = strlen (cmd_dsc->dsc$a_pointer);
- DB (DB_JOBS, (_("Executing %s instead\n"), cmd));
+ DB (DB_JOBS, (_("Executing %s instead\n"), child->comname));
}
- cmddsc.dsc$w_length = strlen(cmd);
- cmddsc.dsc$a_pointer = cmd;
- cmddsc.dsc$b_dtype = DSC$K_DTYPE_T;
- cmddsc.dsc$b_class = DSC$K_CLASS_S;
-
child->efn = 0;
while (child->efn < 32 || child->efn > 63)
{
- status = lib$get_ef ((unsigned long *)&child->efn);
- if (!(status & 1))
+ status = LIB$GET_EF ((unsigned long *)&child->efn);
+ if (!$VMS_STATUS_SUCCESS (status))
{
if (child->comname)
{
@@ -830,10 +1342,21 @@ child_execute_job (char *argv, struct child *child)
}
}
- sys$clref (child->efn);
+ SYS$CLREF (child->efn);
vms_jobsefnmask |= (1 << (child->efn - 32));
+ /* Export the child environment into DCL symbols */
+ if (child->environment != 0)
+ {
+ char **ep = child->environment;
+ while (*ep != 0)
+ {
+ vms_putenv_symbol (*ep);
+ *ep++;
+ }
+ }
+
/*
LIB$SPAWN [command-string]
[,input-file]
@@ -886,37 +1409,43 @@ child_execute_job (char *argv, struct child *child)
if (!setupYAstTried)
tryToSetupYAst();
- status = lib$spawn (&cmddsc, /* cmd-string */
- (ifiledsc.dsc$w_length == 0)?0:&ifiledsc, /* input-file */
- (ofiledsc.dsc$w_length == 0)?0:&ofiledsc, /* output-file */
- &spflags, /* flags */
- &pnamedsc, /* proc name */
- &child->pid, &child->cstatus, &child->efn,
- 0, 0,
- 0, 0, 0);
- if (status & 1)
+ child->vms_launch_status = lib$spawn (cmd_dsc, /* cmd-string */
+ NULL, /* input-file */
+ NULL, /* output-file */
+ &spflags, /* flags */
+ &pnamedsc, /* proc name */
+ &child->pid, &child->cstatus, &child->efn,
+ 0, 0,
+ 0, 0, 0);
+
+ status = child->vms_launch_status;
+ if ($VMS_STATUS_SUCCESS (status))
{
- status= sys$waitfr (child->efn);
- vmsHandleChildTerm(child);
+ status = sys$waitfr (child->efn);
+ vmsHandleChildTerm (child);
}
#else
- status = lib$spawn (&cmddsc,
- (ifiledsc.dsc$w_length == 0)?0:&ifiledsc,
- (ofiledsc.dsc$w_length == 0)?0:&ofiledsc,
+ child->vms_launch_status = lib$spawn (cmd_dsc,
+ NULL,
+ NULL,
&spflags,
&pnamedsc,
&child->pid, &child->cstatus, &child->efn,
vmsHandleChildTerm, child,
0, 0, 0);
+ status = child->vms_launch_status;
#endif
- if (!(status & 1))
+ /* Free the pointer if not a command file */
+ if (!vms_always_use_cmd_file && !token.use_cmd_file)
+ free (cmd_dsc->dsc$a_pointer);
+ free (cmd_dsc);
+
+ if (!$VMS_STATUS_SUCCESS (status))
{
- printf (_("Error spawning, %d\n") ,status);
- fflush (stdout);
switch (status)
{
- case 0x1c:
+ case SS$_EXQUOTA:
errno = EPROCLIM;
break;
default:
@@ -924,5 +1453,16 @@ child_execute_job (char *argv, struct child *child)
}
}
+ /* Restore the VMS symbols that were changed */
+ if (child->environment != 0)
+ {
+ char **ep = child->environment;
+ while (*ep != 0)
+ {
+ vms_restore_symbol (*ep);
+ *ep++;
+ }
+ }
+
return (status & 1);
}
diff --git a/vpath.c b/vpath.c
index 1bcba042..0c7dce35 100644
--- a/vpath.c
+++ b/vpath.c
@@ -1,5 +1,5 @@
/* Implementation of pattern-matching file search paths for GNU Make.
-Copyright (C) 1988-2014 Free Software Foundation, Inc.
+Copyright (C) 1988-2016 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
@@ -52,7 +52,7 @@ static struct vpath *gpaths;
variable. */
void
-build_vpath_lists ()
+build_vpath_lists (void)
{
register struct vpath *new = 0;
register struct vpath *old, *nexto;
@@ -208,7 +208,7 @@ construct_vpath_list (char *pattern, char *dirpath)
#endif
/* Skip over any initial separators and blanks. */
- while (*dirpath == PATH_SEPARATOR_CHAR || isblank ((unsigned char)*dirpath))
+ while (STOP_SET (*dirpath, MAP_BLANK|MAP_PATHSEP))
++dirpath;
/* Figure out the maximum number of VPATH entries and put it in
@@ -218,7 +218,7 @@ construct_vpath_list (char *pattern, char *dirpath)
maxelem = 2;
p = dirpath;
while (*p != '\0')
- if (*p++ == PATH_SEPARATOR_CHAR || isblank ((unsigned char)*p))
+ if (STOP_SET (*p++, MAP_BLANK|MAP_PATHSEP))
++maxelem;
vpath = xmalloc (maxelem * sizeof (const char *));
@@ -244,7 +244,7 @@ construct_vpath_list (char *pattern, char *dirpath)
#else
&& *p != PATH_SEPARATOR_CHAR
#endif
- && !isblank ((unsigned char)*p))
+ && !ISBLANK (*p))
++p;
len = p - v;
@@ -266,7 +266,7 @@ construct_vpath_list (char *pattern, char *dirpath)
}
/* Skip over separators and blanks between entries. */
- while (*p == PATH_SEPARATOR_CHAR || isblank ((unsigned char)*p))
+ while (STOP_SET (*p, MAP_BLANK|MAP_PATHSEP))
++p;
}
@@ -387,6 +387,10 @@ selective_vpath_search (struct vpath *path, const char *file,
{
#ifndef VMS
*p++ = '/';
+#else
+ /* VMS: if this is not in VMS format, treat as Unix format */
+ if ((*p != ':') && (*p != ']') && (*p != '>'))
+ *p++ = '/';
#endif
memcpy (p, file, name_dplen);
p += name_dplen;
@@ -405,6 +409,15 @@ selective_vpath_search (struct vpath *path, const char *file,
memcpy (p + 1, filename, flen + 1);
}
else
+#else
+ /* VMS use a slash if no directory terminator present */
+ if (p != name && p[-1] != '/' && p[-1] != ':' &&
+ p[-1] != '>' && p[-1] != ']')
+ {
+ *p = '/';
+ memcpy (p + 1, filename, flen + 1);
+ }
+ else
#endif
memcpy (p, filename, flen + 1);
@@ -449,17 +462,20 @@ selective_vpath_search (struct vpath *path, const char *file,
See if it actually exists. */
#ifdef VMS
- exists_in_cache = exists = dir_file_exists_p (vpath[i], filename);
-#else
- /* Clobber a null into the name at the last slash.
- Now NAME is the name of the directory to look in. */
- *p = '\0';
-
- /* We know the directory is in the hash table now because either
- construct_vpath_list or the code just above put it there.
- Does the file we seek exist in it? */
- exists_in_cache = exists = dir_file_exists_p (name, filename);
+ /* For VMS syntax just use the original vpath */
+ if (*p != '/')
+ exists_in_cache = exists = dir_file_exists_p (vpath[i], filename);
+ else
#endif
+ {
+ /* Clobber a null into the name at the last slash.
+ Now NAME is the name of the directory to look in. */
+ *p = '\0';
+ /* We know the directory is in the hash table now because either
+ construct_vpath_list or the code just above put it there.
+ Does the file we seek exist in it? */
+ exists_in_cache = exists = dir_file_exists_p (name, filename);
+ }
}
if (exists)
@@ -475,6 +491,10 @@ selective_vpath_search (struct vpath *path, const char *file,
#ifndef VMS
/* Put the slash back in NAME. */
*p = '/';
+#else
+ /* If the slash was removed, put it back */
+ if (*p == 0)
+ *p = '/';
#endif
if (exists_in_cache) /* Makefile-mentioned file need not exist. */
diff --git a/w32/Makefile.am b/w32/Makefile.am
index a2c40632..5527f778 100644
--- a/w32/Makefile.am
+++ b/w32/Makefile.am
@@ -1,5 +1,5 @@
# Makefile.am to create libw32.a for mingw32 host.
-# Copyright (C) 1997-2014 Free Software Foundation, Inc.
+# Copyright (C) 1997-2016 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
@@ -20,6 +20,7 @@ AUTOMAKE_OPTIONS = subdir-objects
noinst_LIBRARIES = libw32.a
libw32_a_SOURCES = subproc/misc.c subproc/sub_proc.c subproc/w32err.c \
- compat/posixfcn.c pathstuff.c
+ compat/posixfcn.c pathstuff.c w32os.c
-libw32_a_CPPFLAGS = -I$(srcdir)/include -I$(srcdir)/subproc -I$(top_srcdir)
+libw32_a_CPPFLAGS = -I$(srcdir)/include -I$(srcdir)/subproc -I$(top_srcdir) \
+ -I$(top_srcdir)/glob
diff --git a/w32/compat/dirent.c b/w32/compat/dirent.c
index 56407dd5..17f7d5fd 100644
--- a/w32/compat/dirent.c
+++ b/w32/compat/dirent.c
@@ -1,5 +1,5 @@
/* Directory entry code for Window platforms.
-Copyright (C) 1996-2014 Free Software Foundation, Inc.
+Copyright (C) 1996-2016 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
diff --git a/w32/compat/posixfcn.c b/w32/compat/posixfcn.c
index b3663997..c760cc84 100644
--- a/w32/compat/posixfcn.c
+++ b/w32/compat/posixfcn.c
@@ -1,6 +1,6 @@
/* Replacements for Posix functions and Posix functionality for MS-Windows.
-Copyright (C) 2013-2014 Free Software Foundation, Inc.
+Copyright (C) 2013-2016 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
diff --git a/w32/include/dirent.h b/w32/include/dirent.h
index 13308de9..bae8449e 100644
--- a/w32/include/dirent.h
+++ b/w32/include/dirent.h
@@ -1,5 +1,5 @@
/* Windows version of dirent.h
-Copyright (C) 1996-2014 Free Software Foundation, Inc.
+Copyright (C) 1996-2016 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
diff --git a/w32/include/dlfcn.h b/w32/include/dlfcn.h
index c64ac7b6..5a2ae286 100644
--- a/w32/include/dlfcn.h
+++ b/w32/include/dlfcn.h
@@ -1,5 +1,5 @@
/* dlfcn.h replacement for MS-Windows build.
-Copyright (C) 2013-2014 Free Software Foundation, Inc.
+Copyright (C) 2013-2016 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
diff --git a/w32/include/pathstuff.h b/w32/include/pathstuff.h
index fb03f122..923dc005 100644
--- a/w32/include/pathstuff.h
+++ b/w32/include/pathstuff.h
@@ -1,5 +1,5 @@
/* Definitions for Windows path manipulation.
-Copyright (C) 1996-2014 Free Software Foundation, Inc.
+Copyright (C) 1996-2016 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
diff --git a/w32/include/sub_proc.h b/w32/include/sub_proc.h
index 1e1b2139..4afa4b47 100644
--- a/w32/include/sub_proc.h
+++ b/w32/include/sub_proc.h
@@ -1,5 +1,5 @@
/* Definitions for Windows process invocation.
-Copyright (C) 1996-2014 Free Software Foundation, Inc.
+Copyright (C) 1996-2016 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
@@ -32,11 +32,11 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
EXTERN_DECL(HANDLE process_init, (VOID_DECL));
EXTERN_DECL(HANDLE process_init_fd, (HANDLE stdinh, HANDLE stdouth,
- HANDLE stderrh));
+ HANDLE stderrh));
EXTERN_DECL(long process_begin, (HANDLE proc, char **argv, char **envp,
- char *exec_path, char *as_user));
+ char *exec_path, char *as_user));
EXTERN_DECL(long process_pipe_io, (HANDLE proc, char *stdin_data,
- int stdin_data_len));
+ int stdin_data_len));
EXTERN_DECL(long process_file_io, (HANDLE proc));
EXTERN_DECL(void process_cleanup, (HANDLE proc));
EXTERN_DECL(HANDLE process_wait_for_any, (int block, DWORD* pdwWaitStatus));
@@ -45,6 +45,7 @@ EXTERN_DECL(HANDLE process_easy, (char** argv, char** env,
int outfd, int errfd));
EXTERN_DECL(BOOL process_kill, (HANDLE proc, int signal));
EXTERN_DECL(int process_used_slots, (VOID_DECL));
+EXTERN_DECL(DWORD process_set_handles, (HANDLE *handles));
/* support routines */
EXTERN_DECL(long process_errno, (HANDLE proc));
@@ -58,14 +59,4 @@ EXTERN_DECL(int process_errcnt, (HANDLE proc));
EXTERN_DECL(void process_pipes, (HANDLE proc, int pipes[3]));
EXTERN_DECL(void process_noinherit, (int fildes));
-/* jobserver routines */
-EXTERN_DECL(int open_jobserver_semaphore, (const char* name));
-EXTERN_DECL(int create_jobserver_semaphore, (int tokens));
-EXTERN_DECL(void free_jobserver_semaphore, (VOID_DECL));
-EXTERN_DECL(int acquire_jobserver_semaphore, (VOID_DECL));
-EXTERN_DECL(int release_jobserver_semaphore, (VOID_DECL));
-EXTERN_DECL(int has_jobserver_semaphore, (VOID_DECL));
-EXTERN_DECL(char* get_jobserver_semaphore_name, (VOID_DECL));
-EXTERN_DECL(int wait_for_semaphore_or_child_process, (VOID_DECL));
-
#endif
diff --git a/w32/include/w32err.h b/w32/include/w32err.h
index 7d722265..b4292f28 100644
--- a/w32/include/w32err.h
+++ b/w32/include/w32err.h
@@ -1,5 +1,5 @@
/* Definitions for Windows error handling.
-Copyright (C) 1996-2014 Free Software Foundation, Inc.
+Copyright (C) 1996-2016 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
diff --git a/w32/pathstuff.c b/w32/pathstuff.c
index 55332aba..9bd55e63 100644
--- a/w32/pathstuff.c
+++ b/w32/pathstuff.c
@@ -1,5 +1,5 @@
/* Path conversion for Windows pathnames.
-Copyright (C) 1996-2014 Free Software Foundation, Inc.
+Copyright (C) 1996-2016 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
@@ -32,7 +32,7 @@ convert_vpath_to_windows32(char *Path, char to_delim)
* contain blanks get trounced here. Use 8.3 format as a workaround.
*/
for (etok = Path; etok && *etok; etok++)
- if (isblank ((unsigned char) *etok))
+ if (ISBLANK ((unsigned char) *etok))
*etok = to_delim;
return (convert_Path_to_windows32(Path, to_delim));
diff --git a/w32/subproc/NMakefile b/w32/subproc/NMakefile
index ebf516d5..325e55c6 100644
--- a/w32/subproc/NMakefile
+++ b/w32/subproc/NMakefile
@@ -1,7 +1,7 @@
# NOTE: If you have no 'make' program at all to process this makefile, run
# 'build.bat' instead.
#
-# Copyright (C) 1996-2014 Free Software Foundation, Inc.
+# Copyright (C) 1996-2016 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
diff --git a/w32/subproc/misc.c b/w32/subproc/misc.c
index 3f3bdf83..8b174137 100644
--- a/w32/subproc/misc.c
+++ b/w32/subproc/misc.c
@@ -1,5 +1,5 @@
/* Process handling for Windows
-Copyright (C) 1996-2014 Free Software Foundation, Inc.
+Copyright (C) 1996-2016 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
diff --git a/w32/subproc/proc.h b/w32/subproc/proc.h
index 1e4054c6..7ccb5ea7 100644
--- a/w32/subproc/proc.h
+++ b/w32/subproc/proc.h
@@ -1,5 +1,5 @@
/* Definitions for Windows
-Copyright (C) 1996-2014 Free Software Foundation, Inc.
+Copyright (C) 1996-2016 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
diff --git a/w32/subproc/sub_proc.c b/w32/subproc/sub_proc.c
index 5496c7eb..d34e8408 100644
--- a/w32/subproc/sub_proc.c
+++ b/w32/subproc/sub_proc.c
@@ -1,5 +1,5 @@
/* Process handling for Windows.
-Copyright (C) 1996-2014 Free Software Foundation, Inc.
+Copyright (C) 1996-2016 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
@@ -61,124 +61,26 @@ static sub_process *proc_array[MAXIMUM_WAIT_OBJECTS];
static int proc_index = 0;
static int fake_exits_pending = 0;
-/* Windows jobserver implementation variables */
-static char jobserver_semaphore_name[MAX_PATH + 1];
-static HANDLE jobserver_semaphore = NULL;
-/* Open existing jobserver semaphore */
-int open_jobserver_semaphore(const char* name)
-{
- jobserver_semaphore = OpenSemaphore(
- SEMAPHORE_ALL_ACCESS, // Semaphore access setting
- FALSE, // Child processes DON'T inherit
- name); // Semaphore name
-
- if (jobserver_semaphore == NULL)
- return 0;
-
- return 1;
-}
-
-/* Create new jobserver semaphore */
-int create_jobserver_semaphore(int tokens)
-{
- sprintf(jobserver_semaphore_name, "gmake_semaphore_%d", _getpid());
-
- jobserver_semaphore = CreateSemaphore(
- NULL, // Use default security descriptor
- tokens, // Initial count
- tokens, // Maximum count
- jobserver_semaphore_name); // Semaphore name
-
- if (jobserver_semaphore == NULL)
- return 0;
-
- return 1;
-}
-
-/* Close jobserver semaphore */
-void free_jobserver_semaphore()
-{
- if (jobserver_semaphore != NULL)
- {
- CloseHandle(jobserver_semaphore);
- jobserver_semaphore = NULL;
- }
-}
-
-/* Decrement semaphore count */
-int acquire_jobserver_semaphore()
-{
- DWORD dwEvent = WaitForSingleObject(
- jobserver_semaphore, // Handle to semaphore
- 0); // DON'T wait on semaphore
-
- return (dwEvent == WAIT_OBJECT_0);
-}
-
-/* Increment semaphore count */
-int release_jobserver_semaphore()
-{
- BOOL bResult = ReleaseSemaphore(
- jobserver_semaphore, // handle to semaphore
- 1, // increase count by one
- NULL); // not interested in previous count
-
- return (bResult);
-}
-
-int has_jobserver_semaphore()
-{
- return (jobserver_semaphore != NULL);
-}
-
-char* get_jobserver_semaphore_name()
-{
- return (jobserver_semaphore_name);
-}
-
-/* Wait for either the jobserver semaphore to become signalled or one of our
- * child processes to terminate.
+/*
+ * Fill a HANDLE list with handles to wait for.
*/
-int wait_for_semaphore_or_child_process()
+DWORD
+process_set_handles(HANDLE *handles)
{
- HANDLE handles[MAXIMUM_WAIT_OBJECTS];
- DWORD dwHandleCount = 1;
- DWORD dwEvent;
+ DWORD count = 0;
int i;
- /* Add jobserver semaphore to first slot. */
- handles[0] = jobserver_semaphore;
-
/* Build array of handles to wait for */
- for (i = 0; i < proc_index; i++)
- {
+ for (i = 0; i < proc_index; i++) {
/* Don't wait on child processes that have already finished */
if (fake_exits_pending && proc_array[i]->exit_code)
continue;
- handles[dwHandleCount++] = (HANDLE) proc_array[i]->pid;
+ handles[count++] = (HANDLE) proc_array[i]->pid;
}
- dwEvent = WaitForMultipleObjects(
- dwHandleCount, // number of objects in array
- handles, // array of objects
- FALSE, // wait for any object
- INFINITE); // wait until object is signalled
-
- switch(dwEvent)
- {
- case WAIT_FAILED:
- return -1;
-
- case WAIT_OBJECT_0:
- /* Indicate that the semaphore was signalled */
- return 1;
-
- default:
- /* Assume that one or more of the child processes terminated. */
- return 0;
- }
+ return count;
}
/*
@@ -721,9 +623,26 @@ process_begin(
if (!shell_name
&& batch_file_with_spaces(exec_fname)
&& _stricmp(exec_path, argv[0]) == 0) {
+ char *new_argv, *p;
+ char **argvi;
+ int arglen, i;
pass_null_exec_path = 1;
+ /* Rewrite argv[] replacing argv[0] with exec_fname. */
+ for (argvi = argv + 1, arglen = strlen(exec_fname) + 1;
+ *argvi;
+ argvi++) {
+ arglen += strlen(*argvi) + 1;
+ }
+ new_argv = xmalloc(arglen);
+ p = strcpy(new_argv, exec_fname) + strlen(exec_fname) + 1;
+ for (argvi = argv + 1, i = 1; *argvi; argvi++, i++) {
+ strcpy(p, *argvi);
+ argv[i] = p;
+ p += strlen(*argvi) + 1;
+ }
+ argv[i] = NULL;
free (argv[0]);
- argv[0] = xstrdup(exec_fname);
+ argv[0] = new_argv;
}
command_line = make_command_line( shell_name, exec_fname, argv);
}
@@ -736,14 +655,15 @@ process_begin(
if (envp) {
if (arr2envblk(envp, &envblk, &envsize_needed) == FALSE) {
- pproc->last_err = 0;
pproc->lerrno = E_NO_MEM;
free( command_line );
- if (pproc->last_err == ERROR_INVALID_PARAMETER
+ if ((pproc->last_err == ERROR_INVALID_PARAMETER
+ || pproc->last_err == ERROR_MORE_DATA)
&& envsize_needed > 32*1024) {
fprintf (stderr, "CreateProcess failed, probably because environment is too large (%d bytes).\n",
envsize_needed);
}
+ pproc->last_err = 0;
return(-1);
}
}
@@ -757,6 +677,7 @@ process_begin(
/*
* Set up inherited stdin, stdout, stderr for child
*/
+ memset(&startInfo, '\0', sizeof(startInfo));
GetStartupInfo(&startInfo);
startInfo.dwFlags = STARTF_USESTDHANDLES;
startInfo.lpReserved = 0;
diff --git a/w32/subproc/w32err.c b/w32/subproc/w32err.c
index 9ff4f4c9..14eebed5 100644
--- a/w32/subproc/w32err.c
+++ b/w32/subproc/w32err.c
@@ -1,5 +1,5 @@
/* Error handling for Windows
-Copyright (C) 1996-2014 Free Software Foundation, Inc.
+Copyright (C) 1996-2016 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
diff --git a/w32/w32os.c b/w32/w32os.c
new file mode 100644
index 00000000..533b9100
--- /dev/null
+++ b/w32/w32os.c
@@ -0,0 +1,198 @@
+/* Windows32-based operating system interface for GNU Make.
+Copyright (C) 2016 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
+terms of the GNU General Public License as published by the Free Software
+Foundation; either version 3 of the License, or (at your option) any later
+version.
+
+GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License along with
+this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#include "makeint.h"
+
+#include <stdio.h>
+#include <string.h>
+
+#include <windows.h>
+#include <process.h>
+#include <io.h>
+#include "pathstuff.h"
+#include "sub_proc.h"
+#include "w32err.h"
+#include "os.h"
+#include "debug.h"
+
+/* This section provides OS-specific functions to support the jobserver. */
+
+static char jobserver_semaphore_name[MAX_PATH + 1];
+static HANDLE jobserver_semaphore = NULL;
+
+unsigned int
+jobserver_setup (int slots)
+{
+ /* sub_proc.c cannot wait for more than MAXIMUM_WAIT_OBJECTS objects
+ * and one of them is the job-server semaphore object. Limit the
+ * number of available job slots to (MAXIMUM_WAIT_OBJECTS - 1). */
+
+ if (slots >= MAXIMUM_WAIT_OBJECTS)
+ {
+ slots = MAXIMUM_WAIT_OBJECTS - 1;
+ DB (DB_JOBS, (_("Jobserver slots limited to %d\n"), slots));
+ }
+
+ sprintf (jobserver_semaphore_name, "gmake_semaphore_%d", _getpid ());
+
+ jobserver_semaphore = CreateSemaphore (
+ NULL, /* Use default security descriptor */
+ slots, /* Initial count */
+ slots, /* Maximum count */
+ jobserver_semaphore_name); /* Semaphore name */
+
+ if (jobserver_semaphore == NULL)
+ {
+ DWORD err = GetLastError ();
+ const char *estr = map_windows32_error_to_string (err);
+ ONS (fatal, NILF,
+ _("creating jobserver semaphore: (Error %ld: %s)"), err, estr);
+ }
+
+ return 1;
+}
+
+unsigned int
+jobserver_parse_auth (const char *auth)
+{
+ jobserver_semaphore = OpenSemaphore (
+ SEMAPHORE_ALL_ACCESS, /* Semaphore access setting */
+ FALSE, /* Child processes DON'T inherit */
+ auth); /* Semaphore name */
+
+ if (jobserver_semaphore == NULL)
+ {
+ DWORD err = GetLastError ();
+ const char *estr = map_windows32_error_to_string (err);
+ fatal (NILF, strlen (auth) + INTSTR_LENGTH + strlen (estr),
+ _("internal error: unable to open jobserver semaphore '%s': (Error %ld: %s)"),
+ auth, err, estr);
+ }
+ DB (DB_JOBS, (_("Jobserver client (semaphore %s)\n"), auth));
+
+ return 1;
+}
+
+char *
+jobserver_get_auth ()
+{
+ return xstrdup (jobserver_semaphore_name);
+}
+
+unsigned int
+jobserver_enabled ()
+{
+ return jobserver_semaphore != NULL;
+}
+
+/* Close jobserver semaphore */
+void
+jobserver_clear ()
+{
+ if (jobserver_semaphore != NULL)
+ {
+ CloseHandle (jobserver_semaphore);
+ jobserver_semaphore = NULL;
+ }
+}
+
+void
+jobserver_release (int is_fatal)
+{
+ if (! ReleaseSemaphore (
+ jobserver_semaphore, /* handle to semaphore */
+ 1, /* increase count by one */
+ NULL)) /* not interested in previous count */
+ {
+ if (is_fatal)
+ {
+ DWORD err = GetLastError ();
+ const char *estr = map_windows32_error_to_string (err);
+ ONS (fatal, NILF,
+ _("release jobserver semaphore: (Error %ld: %s)"), err, estr);
+ }
+ perror_with_name ("release_jobserver_semaphore", "");
+ }
+}
+
+unsigned int
+jobserver_acquire_all ()
+{
+ unsigned int tokens = 0;
+ while (1)
+ {
+ DWORD dwEvent = WaitForSingleObject (
+ jobserver_semaphore, /* Handle to semaphore */
+ 0); /* DON'T wait on semaphore */
+
+ if (dwEvent != WAIT_OBJECT_0)
+ return tokens;
+
+ ++tokens;
+ }
+}
+
+void
+jobserver_signal ()
+{
+}
+
+void jobserver_pre_child (int recursive)
+{
+}
+
+void jobserver_post_child (int recursive)
+{
+}
+
+void
+jobserver_pre_acquire ()
+{
+}
+
+/* Returns 1 if we got a token, or 0 if a child has completed.
+ The Windows implementation doesn't support load detection. */
+unsigned int
+jobserver_acquire (int timeout)
+{
+ HANDLE handles[MAXIMUM_WAIT_OBJECTS];
+ DWORD dwHandleCount;
+ DWORD dwEvent;
+
+ /* Add jobserver semaphore to first slot. */
+ handles[0] = jobserver_semaphore;
+
+ /* Build array of handles to wait for. */
+ dwHandleCount = 1 + process_set_handles (&handles[1]);
+
+ dwEvent = WaitForMultipleObjects (
+ dwHandleCount, /* number of objects in array */
+ handles, /* array of objects */
+ FALSE, /* wait for any object */
+ INFINITE); /* wait until object is signalled */
+
+ if (dwEvent == WAIT_FAILED)
+ {
+ DWORD err = GetLastError ();
+ const char *estr = map_windows32_error_to_string (err);
+ ONS (fatal, NILF,
+ _("semaphore or child process wait: (Error %ld: %s)"),
+ err, estr);
+ }
+
+ /* WAIT_OBJECT_0 indicates that the semaphore was signalled. */
+ return dwEvent == WAIT_OBJECT_0;
+}