]> git.ipfire.org Git - thirdparty/make.git/log
thirdparty/make.git
7 years ago* maintMakefile: Preserve comments during compilation
Paul Smith [Sun, 1 Jul 2018 19:45:46 +0000 (15:45 -0400)] 
* maintMakefile: Preserve comments during compilation

7 years ago* function.c(abspath): Use memcpy() to avoid GCC 8.1 warnings
Paul Smith [Sun, 1 Jul 2018 19:32:49 +0000 (15:32 -0400)] 
* function.c(abspath): Use memcpy() to avoid GCC 8.1 warnings

7 years agoConvert GNU make to use the gnulib portability library
Paul Smith [Sun, 1 Jul 2018 16:28:25 +0000 (12:28 -0400)] 
Convert GNU make to use the gnulib portability library

Move content from glob/* and config/* into standard GNU directory
locations lib/* and m4/*.

Install the gnulib bootstrap script and its configuration file, and
create a bootstrap.bat file for Windows.  Update the README.git file
with new requirements and instructions for building from Git.

At this point we only install the alloca, getloadavg, and FDL modules
from gnulib.  We keep our old glob/fnmatch implementation since the
gnulib versions require significant amounts of infrastructure which
doesn't exist on Windows yet.  Further work is required here.

Due to a problem with gnulib's version of getloadavg, we need to bump
the minimum required version of automake to 1.16.1 unfortunately.

* README.git: Update instructions
* NEWS: Move developer news to a separate section
* configure.ac: Update for use with gnulib modules

* bootstrap: Bootstrap from Git workspace (import from gnulib)
* bootstrap.conf: Bootstrap configuration for GNU make
* bootstrap.bat: Bootstrap from Git workspace for Windows
* gl/modules/make-glob: Support our local fnmatch/glob implementation

* config/acinclude.m4: Move to m4/
* config/dospaths.m4: Move to m4/
* glob/fnmatch.c: Move to lib/
* glob/fnmatch.h.in: Move to lib/
* glob/glob.c: Move to lib/
* glob/glob.h.in: Move to lib/

* Makefile.am: Update for new directories
* build.template: Update for new directories
* build_w32.bat: Update for new directories
* builddos.bat: Update for new directories
* maintMakefile: Update for new directories
* makefile.com: Update for new directories
* mk/Amiga.mk: Update for new directories
* mk/Posix.mk.in: Update for new directories
* mk/VMS.mk: Update for new directories
* mk/Windows32.mk: Update for new directories
* mk/msdosdjgpp.mk: Update for new directories

* po/LINGUAS: One language per line (needed by gnulib)

* INSTALL: Remove (obtained from gnulib)
* src/alloca.c: Remove (obtained from gnulib)
* src/getloadavg.c: Remove (obtained from gnulib)
* po/Makevars: Remove (created by bootstrap)
* config/*: Remove leftover files
* glob/*: Remove leftover files

7 years ago* Makefile.ami, glob/Makefile.ami: Remove obsolete files
Paul Smith [Sun, 1 Jul 2018 16:27:53 +0000 (12:27 -0400)] 
* Makefile.ami, glob/Makefile.ami: Remove obsolete files

7 years ago* doc/make.texi: Updated language
Ola Olsson [Tue, 19 Dec 2017 19:24:55 +0000 (20:24 +0100)] 
* doc/make.texi: Updated language

7 years ago* all: Update Copyright statements for 2018
Paul Smith [Sun, 8 Apr 2018 12:40:39 +0000 (08:40 -0400)] 
* all: Update Copyright statements for 2018

7 years ago* scripts/copyright-update: Maintainer's script for copyright mgmt
Paul Smith [Sun, 8 Apr 2018 12:32:29 +0000 (08:32 -0400)] 
* scripts/copyright-update: Maintainer's script for copyright mgmt

7 years ago* build_w32.bat: Support Visual Studio 17.
Paul Smith [Sat, 10 Feb 2018 20:34:53 +0000 (15:34 -0500)] 
* build_w32.bat: Support Visual Studio 17.

7 years ago* configure.ac: Support GLIBC glob interface version 2
Paul Smith [Sun, 19 Nov 2017 20:09:16 +0000 (15:09 -0500)] 
* configure.ac: Support GLIBC glob interface version 2

7 years agoRework directory structure to use GNU-recommended "src" directory.
Paul Smith [Sun, 19 Nov 2017 18:49:26 +0000 (13:49 -0500)] 
Rework directory structure to use GNU-recommended "src" directory.

Move the source code (other than glob) into the "src" subdirectory.
Update all scripting and recommendations to support this change.

* *.c, *.h, w32/*: Move to src/
* configure.ac, Makefile.am, maintMakefile: Locate new source files.
* Basic.mk.template, mk/*: Update for new source file locations.
* NEWS, README.DOS.template: Update for new locations.
* build.template, build_w32.bat, builddos.bat: Ditto.
* po/POTFILES.in: Ditto
* tests/run_make_tests.pl, tests/scripts/features/load*: Ditto.
* make.1: Move to doc.
* mk/VMS.mk: Add support for building on VMS (hopefully).
* makefile.vms, prepare_w32.bat: Remove.
* SCOPTIONS: Update to define HAVE_CONFIG_H

7 years ago* job.c: Add "command" as a known shell built-in.
Paul Smith [Sun, 12 Nov 2017 23:10:28 +0000 (18:10 -0500)] 
* job.c: Add "command" as a known shell built-in.

This is not a POSIX shell built-in but it's common in UNIX shells.
Reported by Nick Bowler <nbowler@draconx.ca>.

7 years ago* tests/scripts/features/output-sync: Revert bad change in 0c5a9f9b92a
Paul Smith [Sun, 12 Nov 2017 23:03:22 +0000 (18:03 -0500)] 
* tests/scripts/features/output-sync: Revert bad change in 0c5a9f9b92a

7 years agoRemove unsupported build facilities.
Paul Smith [Sun, 12 Nov 2017 22:44:38 +0000 (17:44 -0500)] 
Remove unsupported build facilities.

Over time the non-standard build and install systems (nmake files,
smake files, Visual Studio project files, etc.) have atrophied and
maintaining them is not worth the effort, for such a simple utility
as make.  Remove all the non-standard build tool support and unify
OS-specific build rules under a basic set of (GNU make) makefiles.

Preserve the existing bootstrapping scripts (for POSIX, Windows,
and MS-DOS).  Also the existing VMS build scripts are left unchanged:
I don't have enough experience with VMS to venture into this area.
Perhaps one of the VMS maintainers might like to determine whether
conversion would be appropriate.

Rather than create libraries for w32 and glob (non-POSIX), simply
link the object files directly to remove the complexity.

* NEWS: Update with user-facing notes.
* Makefile.am: Clean up to use the latest automake best practices.
Build Windows code directly from the root makefile to avoid recursion.
* README.Amiga, README.DOS.template, README.W32.template: Updated.
* INSTALL: Point readers at the README.git file.
* maintMakefile: Remove obsolete files.  Create Basic.mk file.
* Basic.mk.template, mk/*.mk: Create basic GNU make-based makefiles.
* build_w32.bat: Copy Basic.mk to Makefile
* configure.ac: We no longer need AM_PROG_AR.
* dosbuild.bat: Rename to builddos.bat.  Incorporate configure.bat.
* Makefile.DOS.template: Remove.
* NMakefile.template, w32/subproc/NMakefile: Remove.
* SMakefile.template, glob/SMakefile, glob/SCOPTIONS, make.lnk: Remove.
* configure.bat, glob/configure.bat: Remove.
* w32/Makefile.am: Remove.
* make_msvc_net2003.sln, make_msvc_net2003.vcproj: Remove.

7 years ago* Makefile.am: Add jhelp.pl to remote test setup.
Paul Smith [Sat, 11 Nov 2017 18:12:28 +0000 (13:12 -0500)] 
* Makefile.am: Add jhelp.pl to remote test setup.

7 years agoDo not use STOP_SET for singleton compares.
Paolo Bonzini [Fri, 11 Aug 2017 11:44:33 +0000 (13:44 +0200)] 
Do not use STOP_SET for singleton compares.

Compare against '$' directly rather than using MAP_VARIABLE.
This saves ~10% for find_map_function, which is the top hotspot in
QEMU's no-op build.  The build is sped up overall by about 1.5%
more (from 11.1s to 10.95s).

* read.c (find_map_function): Do not compare against singleton sets.

7 years agoSpeedup parsing of functions.
Paolo Bonzini [Fri, 11 Aug 2017 11:44:32 +0000 (13:44 +0200)] 
Speedup parsing of functions.

Use the stopchar map to quickly jump over everything that is
not an open/close brace, an open/close parenthesis or a comma.

This saves 1% on QEMU's noop build (from 11.23s to 11.1s).

* function.c (find_next_argument, handle_function): Check
with STOP_SET before comparing against individual characters.
* main.c (initialize_stopchar_map): Initialize MAP_VARSEP
mappings in stopchar_map.
* makeint.h (MAP_VARSEP): New.

7 years agoRemove MAP_PERCENT as strchr is faster.
Paolo Bonzini [Fri, 11 Aug 2017 11:44:31 +0000 (13:44 +0200)] 
Remove MAP_PERCENT as strchr is faster.

* read.c (find_percent_cached): Use strchr instead of STOP_SET
to find % or nul.
* makeint.h (MAP_PERCENT): Remove.
* main.c (initialize_stopchar_map): Remove.

7 years agoUse Jenkins hash.
Paolo Bonzini [Fri, 11 Aug 2017 11:44:28 +0000 (13:44 +0200)] 
Use Jenkins hash.

This is about twice as fast as the current hash, and removes the
need for double hashing (improving locality of reference).  The
hash function is based on Bob Jenkins' design, slightly adapted
wherever Make needs to hash NUL-terminated strings.  The old hash
function is kept for case-insensitive hashing.

This saves 8.5% on QEMU's no-op build (from 12.87s to 11.78s).

* configure.ac: Check endianness.
* hash.c (rol32, jhash_mix, jhash_final, JHASH_INITVAL,
sum_get_unaligned_32, jhash): New.
* hash.h (STRING_HASH_1, STRING_N_HASH_1): Use jhash.
(STRING_HASH_2, STRING_N_HASH_2): Return a dummy value.
(STRING_N_COMPARE, return_STRING_N_COMPARE): Prefer memcmp to strncmp.

7 years agoUse strchr for simple case of find_char_unquote.
Paolo Bonzini [Fri, 11 Aug 2017 11:44:29 +0000 (13:44 +0200)] 
Use strchr for simple case of find_char_unquote.

In most cases, find_char_unquote has a single stopchar.  In that
case we can look for it using strchr's optimized implementation.

This saves 3.5% on QEMU's noop build (from 11.78s to 11.37s).

* read.c (find_char_unquote): Rename to find_map_unquote.  Replace
with an implementation optimized for the case where the stopchar
is a singleton.  Adjust all callers.

7 years agoUse strchr/memmove in collapse_continuations.
Paolo Bonzini [Fri, 11 Aug 2017 11:44:30 +0000 (13:44 +0200)] 
Use strchr/memmove in collapse_continuations.

collapse_continuations is already using strchr to speed up the
common case of no backslash-newline sequence, but on modern
processors it is faster to scan the string twice with
strchr+memmove (or strlen+memmove) than to move bytes manually.

Saves about 1.5% on QEMU's no-op build (from 11.37s to 11.23s).

* misc.c (collapse_continuations): Rewrite the scanning of LINE.

7 years ago* main.c (main): [SV 48274] Allow -j in makefile MAKEFLAGS variable.
Paul Smith [Mon, 30 Oct 2017 16:53:49 +0000 (12:53 -0400)] 
* main.c (main): [SV 48274] Allow -j in makefile MAKEFLAGS variable.

* tests/jhelp.pl: New file to allow testing parallelism without sleep.
* tests/scripts/features/parallelism: Test this.
* tests/scripts/features/jobserver: Update tests.
* tests/scripts/features/output-sync: Remove useless rm command.

7 years ago* job.c (child_error): Modify error message string.
Paul Smith [Sat, 28 Oct 2017 22:45:30 +0000 (18:45 -0400)] 
* job.c (child_error): Modify error message string.

Ensure Emacs compile-mode's next-error doesn't match target failure
messages.  Syntax errors in makefiles are still matched.

7 years ago* function.c (func_if): Check the first character of condition.
Paul Smith [Sat, 28 Oct 2017 19:28:32 +0000 (15:28 -0400)] 
* function.c (func_if): Check the first character of condition.

Reported by Rob W <robw9739@gmail.com>

7 years agoglob: Do not assume glibc glob internals.
Paul Eggert [Sun, 24 Sep 2017 13:12:58 +0000 (09:12 -0400)] 
glob: Do not assume glibc glob internals.

It has been proposed that glibc glob start using gl_lstat,
which the API allows it to do.  GNU 'make' should not get in
the way of this.  See:
https://sourceware.org/ml/libc-alpha/2017-09/msg00409.html

* dir.c (local_lstat): New function, like local_stat.
(dir_setup_glob): Use it to initialize gl_lstat too, as the API
requires.

7 years agoCompute load from number of running processes.
Paul Smith [Sat, 23 Sep 2017 19:55:37 +0000 (15:55 -0400)] 
Compute load from number of running processes.

* job.c (load_too_high): If /proc/loadavg is available, compare the
maximum load against the number of processes currently running.  If
we can't parse /proc/loadavg, use the previous algorithm.

Concept and initial patch from Sven C. Dack <sven.c.dack@sky.com>

8 years agoFix checking existence of directories on MS-Windows
Eli Zaretskii [Sat, 30 Sep 2017 07:56:39 +0000 (10:56 +0300)] 
Fix checking existence of directories on MS-Windows

* remake.c (name_mtime) [WINDOWS32]: Emulate Posix behavior of
'stat' with the likes of "foo/" and "foo/.".

8 years agoUpdate copyright statements for 2017.
Paul Smith [Mon, 10 Jul 2017 01:52:28 +0000 (21:52 -0400)] 
Update copyright statements for 2017.

8 years agoRemove uses of unnecessary "register" keyword.
Paul Smith [Mon, 10 Jul 2017 01:24:41 +0000 (21:24 -0400)] 
Remove uses of unnecessary "register" keyword.

8 years ago* variable.c (create_pattern_var): [SV 51266] Create with xcalloc().
Paul Smith [Sun, 9 Jul 2017 22:56:36 +0000 (18:56 -0400)] 
* variable.c (create_pattern_var): [SV 51266] Create with xcalloc().

Reported by Chris Metcalf <cmetcalf@mellanox.com>

8 years ago[SV 51400] Only unblock fatal signals after child invocation
Paul Smith [Sun, 9 Jul 2017 22:44:17 +0000 (18:44 -0400)] 
[SV 51400] Only unblock fatal signals after child invocation

* job.c (unblock_sigs): Only unblock fatal signals not all signals.
(unblock_all_sigs): Unblock all signals not just fatal signals.
(child_execute_job): Call unblock_all_sigs() in child process.
* job.h: Remove unused function definitions.
* remote-cstms.c (start_remote_job): Call unblock_all_sigs() in
child process.
Reported by Koen Van Hoof <koen.van_hoof@nokia.com>

8 years ago* function.c (shell_completed): [SV 51014] Add signal to .SHELLSTATUS
Paul Smith [Mon, 5 Jun 2017 00:06:48 +0000 (20:06 -0400)] 
* function.c (shell_completed): [SV 51014] Add signal to .SHELLSTATUS

* tests/scripts/functions/shell: Verify that .SHELLSTATUS contains
a non-0 value when the shell exits due to a signal.

8 years agoAvoid crashes when SHELL=abcde is specified on the command line
Eli Zaretskii [Wed, 7 Jun 2017 05:32:35 +0000 (08:32 +0300)] 
Avoid crashes when SHELL=abcde is specified on the command line

* variable.c (do_variable_definition): If $SHELL was not found,
process "SHELL=foo" as any other variable definition.  This avoids
segfaults when SHELL=foo is specified on the Make command line.
Reported by Orgad Shaneh <orgads@gmail.com>.

8 years ago[SV 51159] Use a non-blocking read with pselect to avoid hangs.
Paul Smith [Sat, 3 Jun 2017 20:20:51 +0000 (16:20 -0400)] 
[SV 51159] Use a non-blocking read with pselect to avoid hangs.

* posixos.c (set_blocking): Set blocking on a file descriptor.
(jobserver_setup): Set non-blocking on the jobserver read side.
(jobserver_parse_auth): Ditto.
(jobserver_acquire_all): Set blocking to avoid a busy-wait loop.
(jobserver_acquire): If the non-blocking read() returns without
taking a token then try again.

8 years ago[SV 50823] Support filenames containing '$' in MAKEFILE_LIST
Paul Smith [Sun, 28 May 2017 04:33:29 +0000 (00:33 -0400)] 
[SV 50823] Support filenames containing '$' in MAKEFILE_LIST

* variable.h (enum variable_flavor: Add a new flavor for appended
values that shouldn't be expanded.
* variable.c (do_variable_definition): If given this new flavor,
do not expand the value before appending it.
* read.c (eval_makefile): Use this new flavor for MAKEFILE_LIST
* tests/scripts/variables/MFILE_LIST: Test filenames containing '$'.

8 years ago* tests/test_driver.pl: Useful error if given an invalid test name.
Paul Smith [Sun, 28 May 2017 04:32:26 +0000 (00:32 -0400)] 
* tests/test_driver.pl: Useful error if given an invalid test name.

8 years ago* NEWS: Do not insert a space during '+=' if the value is empty.
Paul Smith [Sun, 28 May 2017 00:07:30 +0000 (20:07 -0400)] 
* NEWS: Do not insert a space during '+=' if the value is empty.

* doc/make.texi (Appending): Document this behavior.
* variable.c (do_variable_definition): Only add a space if the variable
value is not empty.
* tests/scripts/variables/flavors: Test this behavior.

8 years ago* read.c (read_all_makefiles): [SV 50909] Add MAKEFILES to strcache
Enrique Olaizola [Sat, 27 May 2017 18:56:57 +0000 (14:56 -0400)] 
* read.c (read_all_makefiles): [SV 50909] Add MAKEFILES to strcache

Copyright-paperwork-exempt: yes

8 years ago* po/LINGUAS: Add support for traditional Chinese (zh_TW)
Paul Smith [Sat, 20 May 2017 14:35:51 +0000 (10:35 -0400)] 
* po/LINGUAS: Add support for traditional Chinese (zh_TW)

8 years agoRename output_tmpfile() to a misc function get_tmpfile()
Paul Smith [Sat, 11 Feb 2017 18:42:37 +0000 (13:42 -0500)] 
Rename output_tmpfile() to a misc function get_tmpfile()

* output.c: Remove output_tmpfile() and umask handling.
* output.h: Ditto.
* misc.c: Add get_tmpfile() and umask handling.
* makeint.h: Ditto.
* function.c: Rename output_tmpfile() to get_tmpfile().
* main.c: Ditto.
* vmsjobs.c: Ditto.

8 years ago[SV 13651] Handle out-of-memory conditions slightly more gracefully.
Paul Smith [Mon, 2 Jan 2017 20:46:30 +0000 (15:46 -0500)] 
[SV 13651] Handle out-of-memory conditions slightly more gracefully.

* makeint.h: Change OUT_OF_MEM() macro to out_of_memory() function.
* output.h, job.h: Move FD_* macros from job.h to output.h.
* output.c (output_write): Write a buffer to an FD directly.
(out_of_memory): Use output_write() to avoid allocating more
memory while writing the error, and call exit() instead of die().
This does mean we can't translate the error string, though.
* misc.c (xmalloc, xcalloc, xrealloc, xstrdup, xstrndup): Call new
out_of_memory() rather than OUT_OF_MEM().
* read.c (parse_file_seq): Ditto.

8 years agoClean up close-on-exec, particularly with jobserver pipes.
Paul Smith [Mon, 2 Jan 2017 19:08:54 +0000 (14:08 -0500)] 
Clean up close-on-exec, particularly with jobserver pipes.

* configure.ac: Check sys/file.h and assume fileno() always exists.
* output.h: Move output-specific content from job.h to output.h.
* os.h (fd_inherit, fd_noinherit): New functions manage FD inheritance.
* posixos.c (fd_inherit, fd_noinherit): Implement for POSIX systems.
(jobserver_setup): Force jobserver FDs to not be inherited by default.
(jobserver_pre_child): Enable inheritance in recursive invocations.
(jobserver_post_child): Disable inheritance after recursive invocations.
* w32/w32os.c (fd_inherit, fd_noinherit): Implement for W32 systems.
* job.h (CLOSE_ON_EXEC): Remove macro in deference to new fd_noinherit.
* function.c (func_shell_base): Convert CLOSE_ON_EXEC to fd_noinherit.
* job.c (child_execute_job): Ditto.
* output.c (setup_tmpfile): Ditto.
* read.c (eval_makefile): Ditto, plus remove HAVE_FILENO check.
* w32/include/sub_proc.h: Remove process_noinherit for fd_noinherit.
* w32/subproc/sub_proc.c: Ditto.

8 years ago[SV 50300] Use CFLAGS value of "-O1" in POSIX mode.
Paul Smith [Sun, 16 Apr 2017 19:40:57 +0000 (15:40 -0400)] 
[SV 50300] Use CFLAGS value of "-O1" in POSIX mode.

* read.c (record_files): Use "-O1" not "-O" for CFLAGS and FFLAGS.
* tests/scripts/targets/POSIX: Test for the new value.

8 years ago* configure.ac: [SV 50648] Detect Guile 2.2 packages.
Paul Smith [Sun, 16 Apr 2017 19:03:48 +0000 (15:03 -0400)] 
* configure.ac: [SV 50648] Detect Guile 2.2 packages.

8 years ago* doc/make.texi: [SV 50304] Add missing close parenthesis.
Paul Smith [Sun, 16 Apr 2017 18:22:44 +0000 (14:22 -0400)] 
* doc/make.texi: [SV 50304] Add missing close parenthesis.

8 years agoAdd test suite support to Windows
Paul Smith [Mon, 17 Apr 2017 19:37:57 +0000 (15:37 -0400)] 
Add test suite support to Windows

* main.c (main): Sanitize program name detection on Windows.
* makeint.h: 'program' is a const string on all platforms now.
* tests/run_make_tests.bat: Windows bat file to invoke tests
* tests/test_driver.pl: Obtain system-specific error messages.
(get_osname): Compute the $port_type here.  Add more $osname checks
for different Windows Perl ports.
(_run_command): Rewrite the timeout capability to work properly
with Windows.  Don't use Perl fork/exec; instead use system(1,...)
which allows a more reliable/proper kill operation.
Also, allow options to be given as a list instead of a string, to
allow more complex quoting of command-line arguments.
* tests/run_make_tests.pl (run_make_with_options): Allow options
to be provided as a list in addition to a simple string.
(set_more_defaults): Write sample makefiles and run make on them
instead of trying to run echo and invoking make with -f-, to avoid
relying on shell and echo to get basic configuration values.  Also
create a $sh_name variable instead of hard-coding /bin/sh.
* tests/scripts/features/archives: Skip on Windows.
* tests/scripts/features/escape: Use list method for passing options.
* tests/scripts/features/include: Use system-specific error messages.
* tests/scripts/features/output-sync: "Command not found" errors
generate very different / odd output on Windows.  This needs to be
addressed but for now disable these tests on Windows.
* tests/scripts/functions/abspath: Disable on Windows.
* tests/scripts/functions/file: Use system-specific error messages.
* tests/scripts/functions/shell: "Command not found" errors generate
very different / odd output on Windows.  This needs to be addressed
but for now disable these tests on Windows.
* tests/scripts/misc/close_stdout: Disable on Windows.
* tests/scripts/options/dash-k: Use system-specific error messages.
* tests/scripts/options/dash-l: Disable on Windows.
* tests/scripts/options/eval: Use list method for passing options.
* tests/scripts/options/general: Skip some non-portable tests.
* tests/scripts/targets/ONESHELL: Skip some non-portable tests.
* tests/scripts/targets/POSIX: Skip some non-portable tests.
* tests/scripts/variables/MAKEFILES: Skip some non-portable tests.
* tests/scripts/variables/SHELL: Use a makefile not -f- for testing.

8 years ago* tests/run_make_tests.pl: [SV 50902] Find Perl modules
Enrique Olaizola [Sat, 27 May 2017 18:24:33 +0000 (14:24 -0400)] 
* tests/run_make_tests.pl: [SV 50902] Find Perl modules

8 years ago[SV 50021] Avoid infloop on MS-Windows with short scripts
Eli Zaretskii [Wed, 11 Jan 2017 18:43:41 +0000 (20:43 +0200)] 
[SV 50021] Avoid infloop on MS-Windows with short scripts

* job.c (reap_children) [WINDOWS32]: Avoid recursive call to
reap_children when the argument passed to
map_windows32_error_to_string is negative or too large.

8 years ago* main.c (switches): Add -E as an alias for --eval.
Paul Smith [Wed, 28 Dec 2016 05:41:38 +0000 (00:41 -0500)] 
* main.c (switches): Add -E as an alias for --eval.

* make.1: Document the -E and --eval options.
* doc/make.texi: Document the -E option.
* tests/scripts/options/eval: Test the -E option and MAKEFILES.
* NEWS: Add information about the new option.

8 years ago* main.c (switches): Add --no-silent to undo -s options.
Paul Smith [Wed, 28 Dec 2016 05:23:55 +0000 (00:23 -0500)] 
* main.c (switches): Add --no-silent to undo -s options.

* make.1: Document the new flag.
* doc/make.texi: Document the new flag.  Remove suggestions that the
.SILENT special target is deprecated or should not be used.
* tests/scripts/options/dash-s: Test the -s and --no-silent options.
* NEWS: Add information about the new option.

8 years ago* job.c (child_execute_job): [SV 49938] Avoid spurious GCC warning.
Martin Dorey [Mon, 26 Dec 2016 19:09:38 +0000 (14:09 -0500)] 
* job.c (child_execute_job): [SV 49938] Avoid spurious GCC warning.

8 years ago* main.c (main): [SV 49935] Fix uninitialized variable.
Martin Dorey [Mon, 26 Dec 2016 18:26:44 +0000 (13:26 -0500)] 
* main.c (main): [SV 49935] Fix uninitialized variable.

8 years ago[SV 40236] Handle included file open failures properly.
Paul Smith [Sun, 25 Dec 2016 22:41:50 +0000 (17:41 -0500)] 
[SV 40236] Handle included file open failures properly.

* read.c (eval_makefile): Set deps->error if we discovered any
error reading makefiles, and set NONEXISTENT_MTIME so we know
it needs to be rebuilt.
* main.c (main): Clean up management of makefile_mtimes.
* tests/scripts/features/include: Add open failure testcases.

8 years agoPortability changes for the test suite.
Paul Smith [Fri, 23 Dec 2016 18:33:58 +0000 (13:33 -0500)] 
Portability changes for the test suite.

* tests/test_driver.pl: Save error strings for later comparison.
* tests/run_make_tests.pl: Create portable commands for later use.
* tests/*: Use these new variables.

8 years ago[SV 20513] Un-escaped # are not comments in function invocations
Paul Smith [Thu, 22 Dec 2016 23:47:26 +0000 (18:47 -0500)] 
[SV 20513] Un-escaped # are not comments in function invocations

* NEWS: Document the change, as a backward-incompatible change.
* main.c (main): Add 'nocomment' to the .FEATURES variable.
* read.c (remove_comments): Skip variable references during remove.
(find_char_unquote): Fix comments for new STOPMAP support.
* tests/scripts/features/escape: Test new escape syntax.
* tests/scripts/functions/guile: Ditto.
* tests/scripts/functions/shell: Ditto.

8 years ago* main.c (main): [SV 40234] Show correct error message.
Paul Smith [Thu, 22 Dec 2016 21:35:47 +0000 (16:35 -0500)] 
* main.c (main): [SV 40234] Show correct error message.

8 years ago* main.c (switches): [SV 48809] Accept obsolete jobserver flag.
Christoph Schulz [Sun, 18 Dec 2016 18:54:35 +0000 (13:54 -0500)] 
* main.c (switches): [SV 48809] Accept obsolete jobserver flag.

8 years ago* read.c (get_next_mword): [SV 49865] Make fallthrough explicit.
Paul Smith [Sun, 18 Dec 2016 18:49:14 +0000 (13:49 -0500)] 
* read.c (get_next_mword): [SV 49865] Make fallthrough explicit.

8 years ago[SV 49114] Remove support for the NO_FLOAT compile flag.
Paul Smith [Sun, 18 Dec 2016 17:43:18 +0000 (12:43 -0500)] 
[SV 49114] Remove support for the NO_FLOAT compile flag.

* makeint.h (max_load_average): Always a double.
* main.c (max_load_average, default_load_average): Always doubles.
(switches): -l option is a "floating" format.
(decode_switches, define_makeflags): Support "floating" format.
* remake.c (f_mtime): Show time skew as double.
* rule.c (print_rule_data_base): Show percentages as double.
* Makefile.ami, README.DOS.template, SMakefile.template: Remove
references to NO_FLOAT.
* SCOPTIONS, glob/SCOPTIONS: Remove NO_FLOAT settings.

8 years ago[SV 45477] [SV 49115] Parse DOS/Windows drivespecs correctly.
Paul Smith [Sun, 18 Dec 2016 17:25:24 +0000 (12:25 -0500)] 
[SV 45477] [SV 49115] Parse DOS/Windows drivespecs correctly.

* read.c (parse_file_seq) [WINDOWS32]: Only consider a colon part of
a path if it's in a valid Windows drivespec.

8 years ago[SV 49116] Check potential null pointer dereference.
Paul Smith [Sun, 18 Dec 2016 15:22:43 +0000 (10:22 -0500)] 
[SV 49116] Check potential null pointer dereference.

* w32/subproc/sub_proc.c (make_command_line): Simplify cygwin shell
check for correctness.

8 years ago* expand.c (variable_append): [SV 49113] Possible null ptr deref
Jaak Ristioja [Sun, 18 Dec 2016 14:48:46 +0000 (09:48 -0500)] 
* expand.c (variable_append): [SV 49113] Possible null ptr deref

8 years ago* w32/*/dirent.*: [SV 49111] Remove unused telldir()
Jaak Ristioja [Sun, 18 Dec 2016 14:45:47 +0000 (09:45 -0500)] 
* w32/*/dirent.*: [SV 49111] Remove unused telldir()

8 years agoAdd more GCC warnings to the maintainer build.
Paul Smith [Sun, 18 Dec 2016 02:50:50 +0000 (21:50 -0500)] 
Add more GCC warnings to the maintainer build.

* arscan.c: [SV 49112] Correct TEST printf() formatting.
Recommended by Jaak Ristioja <jaak@ristioja.ee>
* hash.c: Correct fprintf() formatting.
* maintMakefile: Add extra GCC warning flags.

8 years ago* po/Makevars, makeint.h, debug.h: Add xgettext C format flags.
Paul Smith [Sat, 17 Dec 2016 18:16:22 +0000 (13:16 -0500)] 
* po/Makevars, makeint.h, debug.h: Add xgettext C format flags.

8 years ago* po/LINGUAS: Added Serbian translation.
Paul Smith [Sat, 17 Dec 2016 14:12:00 +0000 (09:12 -0500)] 
* po/LINGUAS: Added Serbian translation.

8 years ago* README.template: Clarify some items in the README
Paul Smith [Wed, 14 Dec 2016 22:24:43 +0000 (17:24 -0500)] 
* README.template: Clarify some items in the README

8 years ago* doc/make.texi: [SV 48951] Fix documentation typo.
Paul Smith [Wed, 14 Dec 2016 22:23:09 +0000 (17:23 -0500)] 
* doc/make.texi: [SV 48951] Fix documentation typo.

8 years ago* maintMakefile: Update default GPG ID for new key.
Paul Smith [Sun, 23 Oct 2016 20:34:55 +0000 (16:34 -0400)] 
* maintMakefile: Update default GPG ID for new key.

8 years agoResolve issues discovered by static code analysis.
Paul Smith [Sun, 25 Sep 2016 23:06:56 +0000 (19:06 -0400)] 
Resolve issues discovered by static code analysis.

* maintMakefile: Add a rule to submit code for analysis.
* configure.ac: Check for availability of the umask() function.
* output.c (output_tmpfd, output_tmpfile): Use umask on temp files.
* makeint.h (PATH_VAR): Reserve an extra character for nul bytes.
* function.c (func_error): Initialize buffer to empty string.
* job.c (child_execute_job): Verify validity of fdin.
* main.c (main): Simplify code for makefile updating algorithm.
* arscan.c (ar_scan): Verify member name length before reading.
* read.c (readline): Cast pointer arithmetic to avoid warnings.
* remake.c (update_file): Remove unreachable code.
(name_mtime): Verify symlink name length.

8 years ago* NEWS: Mention the extended support for -jN on MS-Windows.
Eli Zaretskii [Sat, 12 Nov 2016 09:03:14 +0000 (11:03 +0200)] 
* NEWS: Mention the extended support for -jN on MS-Windows.

8 years agoSupport more than 63 jobs on MS-Windows
Marc Ullman [Sat, 12 Nov 2016 08:53:28 +0000 (10:53 +0200)] 
Support more than 63 jobs on MS-Windows

* job.c (start_waiting_job, load_too_high):
* w32/w32os.c (jobserver_setup, jobserver_acquire): Abstracted out
MAXIMUM_WAIT_OBJECTS.  Call process_table_full instead.
* w32/include/sub_proc.h: Update and add prototypes.
* w32/subproc/sub_proc.c (GMAKE_MAXIMUM_WAIT_OBJECTS): New macro.
(process_wait_for_multiple_objects): Drop-in replacement for Windows
API WaitForMultipleOjects.
(process_wait_for_any_private): Replaced MAXIMUM_WAIT_OBJECTS with
GMAKE_MAXIMUM_WAIT_OBJECTS.
(process_table_full): Replacement for process_used_slots.
(process_used_slots): Removed, as no longer needed.
(process_table_usable_size): Returns maximum usable size of process
table.
(process_table_actual_size): Returns actual size of process table.
(process_register): Added assertion.
(process_easy): Abstracted out MAXIMUM_WAIT_OBJECTS.

9 years agoOnly include strings.h in MinGW builds
Eli Zaretskii [Sun, 9 Oct 2016 13:09:52 +0000 (16:09 +0300)] 
Only include strings.h in MinGW builds

* main.c:
* job.c: Include strings.h only if HAVE_STRINGS_H is defined.

* config.h.W32.template (HAVE_STRINGS_H): Define only for MinGW,
as MSVC doesn't have this header.

9 years agoUpdate the Guile version tested with the MS-Windows build.
Eli Zaretskii [Thu, 6 Oct 2016 19:41:47 +0000 (22:41 +0300)] 
Update the Guile version tested with the MS-Windows build.

9 years agoAvoid compiler warnings with MinGW runtime 3.22.2
Eli Zaretskii [Thu, 6 Oct 2016 19:39:14 +0000 (22:39 +0300)] 
Avoid compiler warnings with MinGW runtime 3.22.2

* main.c:
* job.c: Include strings.h, to get the prototypes of strcasecmp
and strncasecmp with latest MinGW runtime versions.
* config.h.W32.template (HAVE_STRINGS_H): Define.

9 years ago* README.W32.template: Update the build documentation.
Paul Smith [Sun, 19 Jun 2016 14:52:17 +0000 (10:52 -0400)] 
* README.W32.template: Update the build documentation.

* build_w32.bat: Fix issues with Visual Studio builds.  Fix an error
that always created Debug builds.  Support 32bit and 64bit builds.

9 years ago* Update to pre-release version 4.2.90.
Paul Smith [Sat, 25 Jun 2016 00:49:32 +0000 (20:49 -0400)] 
* Update to pre-release version 4.2.90.

9 years agoGNU Make release 4.2.1. 4.2.1
Paul Smith [Mon, 6 Jun 2016 12:32:45 +0000 (08:32 -0400)] 
GNU Make release 4.2.1.

9 years ago* maintMakefile: TP recommends rsync for retrieving PO files.
Paul Smith [Mon, 6 Jun 2016 12:32:00 +0000 (08:32 -0400)] 
* maintMakefile: TP recommends rsync for retrieving PO files.

9 years ago* main.c (main): [SV 48009] Reset stack limit for make re-exec.
Jeremy Devenport [Tue, 31 May 2016 07:09:24 +0000 (03:09 -0400)] 
* main.c (main): [SV 48009] Reset stack limit for make re-exec.

Copyright-paperwork-exempt: yes

9 years ago[SV 47995] Ensure forced double-colon rules work with -j.
Paul Smith [Tue, 31 May 2016 06:56:51 +0000 (02:56 -0400)] 
[SV 47995] Ensure forced double-colon rules work with -j.

The fix for SV 44742 had a side-effect that some double-colon targets
were skipped.  This happens because the "considered" facility assumed
that all targets would be visited on each walk through the dependency
graph: we used a bit for considered and toggled it on each pass; if
we didn't walk the entire graph on every pass the bit would get out
of sync.  The new behavior after SV 44742 might return early without
walking the entire graph.  To fix this I changed the considered value
to an integer which is monotonically increasing: it is then never
possible to incorrectly determine that a previous pass through the
graph already considered the current target.

* filedef.h (struct file): make CONSIDERED an unsigned int.
* main.c (main): No longer need to reset CONSIDERED.
* remake.c (update_goal_chain): increment CONSIDERED rather than
inverting it between 0<->1.
(update_file_1): Reset CONSIDERED to 0 so it's re-considered.
(check_dep): Ditto.
* tests/scripts/features/double_colon: Add a regression test.

9 years ago* DELETE_ON_ERROR: [SV 48061] Use "exit 1" for portability.
Paul Smith [Tue, 31 May 2016 06:26:26 +0000 (02:26 -0400)] 
* DELETE_ON_ERROR: [SV 48061] Use "exit 1" for portability.

Reported by Joel Fredrikson <Joel.Fredrikson@it.uu.se>

9 years ago* w32/pathstuff.c: [SV 47996] Use ISBLANK() not isblank().
Paul Smith [Wed, 25 May 2016 21:25:25 +0000 (17:25 -0400)] 
* w32/pathstuff.c: [SV 47996] Use ISBLANK() not isblank().

9 years agoFix printing time stamps on MS-Windows
Eli Zaretskii [Sat, 28 May 2016 09:53:02 +0000 (12:53 +0300)] 
Fix printing time stamps on MS-Windows

* dir.c (print_dir_data_base) [WINDOWS32]: Use %I64u format for
printing unsigned 64-bit data types, as %ull is not universally
supported.

9 years ago[SV 48037] Fix MinGW build with Posix configury tools
Luke Allardyce [Fri, 27 May 2016 19:39:55 +0000 (22:39 +0300)] 
[SV 48037] Fix MinGW build with Posix configury tools

* w32/Makefile.am (libw32_a_CPPFLAGS): Add -I$(srcdir)/glob.

Copyright-paperwork-exempt: yes

9 years agoGNU Make release 4.2. 4.2
Paul Smith [Sat, 21 May 2016 19:23:54 +0000 (15:23 -0400)] 
GNU Make release 4.2.

9 years ago[SV 44742] Fix double-colon rules plus parallel builds.
Joe Crayne [Sat, 21 May 2016 21:26:00 +0000 (17:26 -0400)] 
[SV 44742] Fix double-colon rules plus parallel builds.

* remake.c (update_file): Don't update double-colon target status
if we're still building targets.
(ftime_t): Don't propagate timestamps for double-colon targets that
we've not examined yet.
* tests/scripts/features/double_colon: Add parallel build tests.

Copyright-paperwork-exempt: yes

9 years ago* read.c (eval): [SV 47960] Skip record waiting files when ignoring.
Paul Smith [Sat, 21 May 2016 17:08:34 +0000 (13:08 -0400)] 
* read.c (eval): [SV 47960] Skip record waiting files when ignoring.

* tests/scripts/features/conditionals: Test this scenario.

9 years agoSeparate the GNU make load ABI from internal types.
Paul Smith [Sun, 1 May 2016 23:24:20 +0000 (19:24 -0400)] 
Separate the GNU make load ABI from internal types.

Create an internal type "floc" and convert all users to that type.
* gnumake.h (gmk_floc): Remove the offset field from this type.
* loadapi.c (gmk_eval): Convert gmk_floc to internal floc.

9 years agoFixes for enhanced GCC warnings.
Paul Eggert [Sun, 1 May 2016 19:52:58 +0000 (15:52 -0400)] 
Fixes for enhanced GCC warnings.

Move function prototypes into header files and out of .c files.
Use void argument lists for functions that accept no args.
Remove unused macros.  Make private functions static.  Align
types with printf format characters.

9 years agoFix compile issues with Windows and VMS.
Paul Smith [Sun, 1 May 2016 19:34:42 +0000 (15:34 -0400)] 
Fix compile issues with Windows and VMS.

* main.c (initialize_stopchar_map): isblank() is not part of C89.
Install bits for space and tab directly.
* makeint.h: Don't define vfork; autoconf handles this for us.
* vmsjobs.c: Rename NEXT_TOKEN to V_NEXT_TOKEN to avoid conflicts.
* dir.c (print_dir_data_base): Visual Studio C doesn't have int64_t.
* w32/subproc/sub_proc.c (process_begin): Missing arg to memset().
* build_w32.bat: Don't use obsolete Visual Studio flags.

9 years agoAllow compiling with an ISO C 1989/1990 compiler.
Paul Smith [Sun, 24 Apr 2016 15:27:57 +0000 (11:27 -0400)] 
Allow compiling with an ISO C 1989/1990 compiler.

* posixos.c (jobserver_post_child): Use C89 for loop syntax.
* remake.c (update_goal_chain): Ditto.
* variable.c (parse_variable_definition): Ditto.

9 years ago[SV 47942] Avoid random crashes in subordinate programs on MS-Windows
Eli Zaretskii [Tue, 17 May 2016 15:15:26 +0000 (18:15 +0300)] 
[SV 47942] Avoid random crashes in subordinate programs on MS-Windows

* w32/subproc/sub_proc.c (process_begin): Zero out startInfo
before using it.  Fixes crashes in Intel Fortran compiler invoked
by Make.

9 years agoFix the MS-Windows MinGW build
Eli Zaretskii [Sun, 24 Apr 2016 06:53:38 +0000 (09:53 +0300)] 
Fix the MS-Windows MinGW build

* build_w32.bat (GccCompile): Use -std=gnu99, as some code uses
C99 features ('for' loop initial declarations).

* dir.c (print_dir_data_base) [WINDOWS32]: Cast 'mtime' to
'int64_t', and use %I64d to print it, to avoid compile-time
warning about printing a 'time_t' value, which could be either
a 32-bit or a 64 bit integral type.

9 years ago* tests/scripts/features/output-sync: increase test timeout. 4.1.90
Paul Smith [Sat, 23 Apr 2016 15:21:36 +0000 (11:21 -0400)] 
* tests/scripts/features/output-sync: increase test timeout.

I'm getting random failures with a timeout of 10s; increase to 30s.

9 years ago* NEWS: Update for pre-release
Paul Smith [Mon, 11 Apr 2016 11:50:11 +0000 (07:50 -0400)] 
* NEWS: Update for pre-release

9 years ago* dep.h, makeint.h (show_goal_error): Move to makeint.h.
Paul Smith [Sun, 10 Apr 2016 21:22:57 +0000 (17:22 -0400)] 
* dep.h, makeint.h (show_goal_error): Move to makeint.h.

9 years ago[SV 46433] Show recipe line offsets in line number messages.
Paul Smith [Sun, 10 Apr 2016 21:12:48 +0000 (17:12 -0400)] 
[SV 46433] Show recipe line offsets in line number messages.

While displaying line numbers, show the relevant line number inside
the recipe not just the first line of the entire recipe.
Sample changes suggested by Brian Vandenberg <phantall@gmail.com>

* gnumake.h (gmk_floc): Add an 'offset' to track the recipe offset.
* read.c (eval, eval_makefile, eval_buffer): Initialize 'offset'.
(record_files, install_pattern_rule): Ditto.
* job.c (new_job, job_next_command): Update 'offset' based on the
line of the recipe we're expanding or invoking.
(child_error): Add 'offset' when showing the line number.
* function.c (func_shell_base): Ditto.
* output.c (error, fatal): Ditto.
* NEWS: Mention the new ability.
* tests/scripts/features/errors: Check the line number on errors.
* tests/scripts/functions/warning: Check the line number on warnings.
* tests/scripts/features/output-sync,
tests/scripts/features/parallelism, tests/scripts/functions/shell,
tests/scripts/functions/error: Update line numbers.

9 years ago* maintMakefile: Add a rule for storing preprocessor output.
Paul Smith [Sun, 10 Apr 2016 00:06:06 +0000 (20:06 -0400)] 
* maintMakefile: Add a rule for storing preprocessor output.

9 years ago[SV 102] Don't show unnecessary include file errors.
Paul Smith [Sat, 9 Apr 2016 23:49:27 +0000 (19:49 -0400)] 
[SV 102] Don't show unnecessary include file errors.

Delay the generation of error messages for included files until we
are sure that we can't rebuild that included file.
* dep.h (struct dep): Don't reuse "changed"; make a separate field
to keep "flags".  Get rid of dontcare and use the flag.
(struct goaldep): Create a new structure for goal prereqs
that tracks an errno value and the floc where the include happened.
Rework the structures to ensure they are supersets as expected.
In maintainer mode with GCC, use inline to get type checking.
* read.c (eval_makefile): Return a struct goaldep for the new
makefile.  Ensure errno is set properly to denote a failure.
(read_all_makefiles): Switch to goaldep and check errno.
(eval): Don't show included file errors; instead remember them.
* remake.c (update_goal_chain): Set global variables to the current
goaldep we're building, and the entire chain.
(show_goal_error): Check if the current failure is a consequence
of building an included makefile and if so print an error.
(complain): Call show_goal_error() on rule failure.
* job.c (child_error): Call show_goal_error() on child error.
* main.c (main): Switch from struct dep to goaldep.
* misc.c (free_dep_chain): Not used; make into a macro.
* tests/scripts/features/include: Update and include new tests.
* tests/scripts/options/dash-B, tests/scripts/options/dash-W,
tests/scripts/options/print-directory,
tests/scripts/variables/MAKE_RESTARTS: Update known-good-output.

9 years ago* job.c (child_error): Add filename length to output length.
Paul Smith [Sat, 9 Apr 2016 13:25:50 +0000 (09:25 -0400)] 
* job.c (child_error): Add filename length to output length.

Reported by Dale Stimson <dale@riyescott.com>