Compare commits

...

42 Commits

Author SHA1 Message Date
Paul Smith
fdfe0446b6 Release GNU make 4.2.93
* NEWS: Update the release and date
* configure.ac: Update the release number
2020-01-03 02:08:59 -05:00
Paul Smith
12b14f0484 Update copyright statements for 2020 2020-01-03 02:08:59 -05:00
Paul Smith
4e12a5fa45 Support the .EXTRA_PREREQS special variable
Initial implementation by Christof Warlich <cwarlich@gmx.de>

* NEWS: Announce the new feature.
* doc/make.texi (Other Special Variables): Document .EXTRA_PREREQS.
* src/dep.h (struct dep): New flag to note extra prereq deps.
* src/filedef.h (expand_extra_prereqs): Declare a function to expand
the value of .EXTRA_PREREQS.
* src/file.c (expand_extra_prereqs): Given a struct variable lookup
of .EXTRA_PREREQS, convert it into a list of deps and for each one
make sure it has a struct file and has the new flag set.
(snap_file): A new function invoked by hash_map that will perform
per-file operations: set up second expansion, intermediate, and also
.EXTRA_PREREQS.  Manage circular dependencies by ignoring them.
(snap_deps): Defer per-file operations until the end.  Look up the
global .EXTRA_PREREQS and pass it along to snap_file for each file.
* src/implicit.c (struct patdeps): Remember the extra prereqs flag.
(pattern_search): Transfer extra prereqs flag settings into the
matched pattern rule.
* src/rule.h (snap_implicit_rules): Rename count_implicit_rules to
snap_implicit_rules since we now do more than count.
* src/rule.c (snap_implicit_rules): As we walk through all the pattern
rules, add in any global .EXTRA_PREREQS to the dep list.  Ensure we
take them into account for the max number of prereqs and name length.
* src/main.c (main): Add extra-prereqs to .FEATURES.
Call the renamed snap_implicit_rules.
* tests/scripts/variables/EXTRA_PREREQS: Add tests.
2020-01-03 02:08:59 -05:00
Paul Smith
e56243fe57 * tests/scripts/features/patternrules: Use Windows-compatible quoting 2020-01-03 02:08:59 -05:00
Paul Smith
7449abfe1b * tests/test_driver.pl: Compute full path to Perl interpreter 2020-01-03 02:08:59 -05:00
Paul Smith
53b9770b40 * tests/scripts/features/exec: Don't use $ENV in the description 2020-01-03 02:08:59 -05:00
Paul Smith
766baeef0a * src/makeint.h: Add a declaration for memrchr() 2020-01-03 02:08:59 -05:00
Paul Smith
ee204c78f2 * NEWS: Remove info about disabled /proc/loadavg usage. 2019-12-27 01:42:25 -05:00
Paul Smith
e64674b718 [SV 57022] Avoid posix_spawn which fails asynchronously
Avoid using posix_spawn implementations that fail asynchronously when
the spawned program can't be invoked: this means instead of getting
an error such as "No such file or directory" we get just "Exit 127".

Original implementation of the configure.ac macro provided by
Martin Dorey <martin.dorey@hds.com>

Original implementation of the regression tests provided by
Dmitry Goncharov <dgoncharov@users.sf.net>

* configure.ac: Test whether posix_spawn fails asynchronously.  In a
cross-compilation environment, assume that it does not.  If we detect
that it does, fall back to fork/exec.
* tests/scripts/features/exec: Add regression tests for different
shebang invocation methods.
2019-12-27 01:37:17 -05:00
Paul Smith
564fb212a7 [SV 56655] Allow pattern expansion to contain spaces
* src/dep.h: Add a new flag PARSEFS_ONEWORD
* src/read.c (parse_file_seq): If PARSEFS_ONEWORD is given, treat the
entire incoming string as a single pattern.
* src/implicit.c (pattern_search): Pass PARSEFS_ONEWORD when parsing
patterns for wildcards.
* tests/scripts/features/patternrules: Add a new test.
2019-12-26 18:39:56 -05:00
Ben Wijen
30cc10093b * src/misc.c (spin): On WINDOWS32 use Sleep() instead of sleep() 2019-12-18 09:05:40 -05:00
Ben Wijen
69c5a2128b * bootstrap.bat: Fix typo in batch file name 2019-12-18 09:05:40 -05:00
Paul Smith
577dd1ff6d * src/config.h.W32.template: [SV 57152] MinGW32 doesn't support d_type 2019-12-18 09:05:40 -05:00
Jouke Witteveen
86f2f8bcb5 [SV 54161] Fix second expansion of $* for paths
If the stem matches a path containing a directory not just a
filename, make sure the second expansion of $* in the
prerequisites matches $* in the recipe.  This requires using
$(*F) when replacing % in the first expansion to preserve the
simple filename.

* src/implicit.c (pattern_search): If lastslash is set prepend
the directory onto the stem.  Then use $(*F) when expanding %.
* tests/scripts/features/se_implicit: Add a test case
2019-12-18 09:05:17 -05:00
Jouke Witteveen
c72205b28b * src/implicit.c (pattern_search): Set lastslash correctly
If filename contained multiple slashes lastslash is wrongly set to 0.
* configure.ac: Check for the GNU memrchr() extension function.
* src/misc.c (memrchr): Supply memrchr() if not available.
2019-12-17 15:06:28 -05:00
Jouke Witteveen
057e33d6b5 * src/implicit.c (pattern-search): Remove unneeded 'dir' variable 2019-12-17 15:06:28 -05:00
Paul Smith
e4499a1fb5 * Makefile.am: Build lzip package instead of bzip2
* README.git: Mention changed requirements.
2019-12-17 15:06:28 -05:00
Paul Smith
57b043c7fb * src/job.c (load_too_high): Disable Linux /proc/loadavg for now
This new feature has a problem: if you provide a load which is
larger than the number of cores then it will always run every job.
Before we can enable it we need to at the least learn how to clamp
this value to the number of cores.  To experiment with it, set
PROC_FD_INIT to -2 in job.c to re-enable the feature.
2019-12-17 15:06:28 -05:00
Paul Smith
f389aabde6 * tests/run_make_tests.pl (set_more_defaults): Fix typo 2019-12-17 15:06:28 -05:00
Paul Smith
acbef3f612 * tests/run_make_tests.pl (subst_make_string): Force use of /
On Windows the path to the helper tool will contain '\': this will
fail if recipes are run with a POSIX shell.  Convert '\' to '/'
on Windows.  While here, escape any spaces in the path as well.
2019-12-16 16:18:58 -05:00
Paul Smith
3822f77c1d Rename jhelp.pl to thelp.pl and make it a generic test helper.
* tests/thelp.pl: Rename from tests/jhelp.pl.
(op): Use names instead of options for the operations.
(op): Add new operations for sleep, mkdir, and rm.
(op): Enhance wait to time out
* tests/run_make_tests.pl: Add a new #HELPER# replacement
(subst_make_string): Use fully-qualified path to thelp.pl
* tests/scripts/features/parallelism: Update to use thelp.pl
and the new named operations.  Use thelp.pl sleep instead of
system-specific sleep commands.
* tests/scripts/features/output-sync: Update to use thelp.pl
instead of complex shell scripts.
* Makefile.am: Distribute tests/thelp.pl instead of tests/jhelp.pl
2019-12-16 09:31:31 -05:00
Paul Eggert
1cf3932a39 Port functions/shell test to Solaris 10
* tests/scripts/functions/shell: Port exit-status calculation
to Solaris 10 with Perl 5.8.4.
2019-10-10 18:31:50 -04:00
Paul Smith
33bda40086 Release GNU make 4.2.92
* NEWS: Update the release and date
* configure.ac: Update the release number
2019-10-08 08:35:39 -04:00
Paul Smith
e666a6a021 * doc/make.text (Reading Makefiles): Rewrite to be more clear. 2019-10-06 15:48:53 -04:00
Paul Smith
5920d6d2b3 * Makefile.am (check-regression): Use PERLFLAGS when running Perl
* maintMakefile: Set PERLFLAGS to enable warnings.
* tests/run_make_tests.pl: Clean up issues pointed out by perl -w.
2019-10-05 17:48:19 -04:00
Paul Smith
2e6468c811 * tests/scripts/functions/wildcard: Skip slash tests for local glob. 2019-10-05 17:48:19 -04:00
Paul Smith
393d2a2d4a tests: Convert %CONFIG_FLAGS to get_config()
* tests/config-flags.pm.W32: Create a predefined Windows file.
* Makefile.am (test_FILES): Add it to the distribution.
* build_w32.bat: Install tests/config-flags.pm if not existing.
* tests/run_make_tests.pl (get_config): Create new function.
* tests/scripts/features/archives: Call get_config() rather than
using %CONFIG_FLAGS directly.
* tests/scripts/features/load: Ditto.
* tests/scripts/features/loadapi: Ditto.
* tests/scripts/functions/wildcard: Ditto.
2019-10-05 17:47:52 -04:00
Paul Smith
bd7d03f8cd * src/hash.c (jhash_string): Don't read past end of string.
Original patch from Dmitry Goncharov <dgoncharov@users.sf.net>.
2019-10-05 11:23:31 -04:00
Paul Smith
a4a173928f * tests/run_make_tests.pl (valid_option): Add missing File::Spec 2019-10-05 07:43:52 -04:00
Paul Smith
0e113897f7 * src/function.c (func_realpath) [AIX]: Remove trailing slashes. 2019-09-23 00:34:12 -04:00
Paul Smith
b0eab8ecb9 * tests/scripts/features/vpathplus: Fix output for big-endian systems.
Our hashing algorithm gives different ordering on LE vs BE systems.
Patch from Dmitry Goncharov <dgoncharov@users.sf.net>.
2019-09-22 17:35:51 -04:00
Florian Weimer
f84821b249 * configure.ac (HAVE_GETTIMEOFDAY): Avoid undeclared exit function.
Copyright-paperwork-exempt: yes
2019-09-22 17:32:29 -04:00
Paul Smith
99d1423059 * test/test_driver.el (_run_with_timeout): Show error message. 2019-09-22 17:03:05 -04:00
Paul Smith
7fbd58cd6b * job.c (child_error): Modify error message string.
This reverts commit 6264deece3.
Further investigation discovers that the real issue is that
GNU Emacs compile mode doesn't have a matching regex for GNU
make error messages generated when targets fail.  I submitted
a patch to GNU Emacs adding a matcher for compile mode.
2019-09-22 17:02:57 -04:00
Paul Smith
3ede0b96ac * tests: Convert from File::Spec::Functions to File::Spec.
Users report the Functions version doesn't work correctly for some
older versions of Perl.
2019-09-21 16:37:56 -04:00
Paul Smith
1d289b424a * tests/scripts/function/guile: Valgrind doesn't work with Guile. 2019-09-21 15:38:52 -04:00
Paul Smith
96285f875b * src/job.c (child_execute_job): Allocate space for argv NULL. 2019-09-21 15:38:52 -04:00
Paul Smith
bd4ce86785 [SV 56918] Compute job slots properly on failing command
Ensure we properly reduce job_slots_used if a command fails because
it doesn't exist/can't be started.

* src/job.h (struct child): Add a field jobslot to be set when using
a job slot.
* src/job.c (start_waiting_job): Remember if we are using a job slot.
(reap_children): Reduce number of job slots used by jobslot.
2019-09-21 15:38:48 -04:00
Paul Smith
e1c072aa7e * src/arscan.c (ar_scan): Restrict length for sscanf of ar_mode. 2019-09-21 15:13:32 -04:00
Paul Smith
af0074547d * tests/scripts/functions/shell: Detect correct SHELLSTATUS code. 2019-09-21 15:13:32 -04:00
Paul Smith
4a7a8278e8 * tests/run_make_test.pl: Fix support for valgrind.
Change the variable holding the make command to be a list that can
hold extra commands and options, not just a string.
2019-09-21 15:13:24 -04:00
Paul Smith
00fa3ca3a5 * tests/run_make_tests.pl (find_prog): Fix syntax error. 2019-09-21 12:39:07 -04:00
138 changed files with 1190 additions and 573 deletions

View File

@@ -68,12 +68,13 @@ Other contributors:
David Boyce <dsb@boyski.com>
Frank Heckenbach <f.heckenbach@fh-soft.de>
Kaz Kylheku <kaz@kylheku.com>
Christof Warlich <cwarlich@gmx.de>
With suggestions/comments/bug reports from a cast of ... well ...
hundreds, anyway :)
-------------------------------------------------------------------------------
Copyright (C) 1997-2019 Free Software Foundation, Inc.
Copyright (C) 1997-2020 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

View File

@@ -10,7 +10,7 @@
#
# make.exe -f Basic.mk
#
# Copyright (C) 2017-2019 Free Software Foundation, Inc.
# Copyright (C) 2017-2020 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

View File

@@ -1,6 +1,6 @@
# This is a -*-Makefile-*-, or close enough
#
# Copyright (C) 1997-2019 Free Software Foundation, Inc.
# Copyright (C) 1997-2020 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,7 +16,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/>.
AUTOMAKE_OPTIONS = dist-bzip2 silent-rules std-options subdir-objects nostdinc
AUTOMAKE_OPTIONS = dist-lzip silent-rules std-options subdir-objects nostdinc
ACLOCAL_AMFLAGS = -I m4
MAKE_HOST = @MAKE_HOST@
@@ -94,7 +94,8 @@ m4_FILES = m4/gnulib-cache.m4
test_FILES = tests/run_make_tests tests/run_make_tests.bat \
tests/run_make_tests.pl tests/test_driver.pl \
tests/config-flags.pm.in tests/config_flags_pm.com \
tests/mkshadow tests/jhelp.pl tests/guile.supp tests/README
tests/config-flags.pm.W32 \
tests/mkshadow tests/thelp.pl tests/guile.supp tests/README
# test/scripts are added via dist-hook below.
EXTRA_DIST = ChangeLog README build.sh build.cfg.in $(man_MANS) \
@@ -160,8 +161,8 @@ check-regression: tests/config-flags.pm
rm -f tests/$$f; ln -s ../srctests/$$f tests; \
done; fi ;; \
esac; \
echo "cd tests && $(PERL) ./run_make_tests.pl -srcdir $(abs_top_srcdir) -make ../make$(EXEEXT) $(MAKETESTFLAGS)"; \
cd tests && $(PERL) ./run_make_tests.pl -srcdir '$(abs_top_srcdir)' -make '../make$(EXEEXT)' $(MAKETESTFLAGS); \
echo "cd tests && $(PERL) $(PERLFLAGS) ./run_make_tests.pl -srcdir $(abs_top_srcdir) -make ../make$(EXEEXT) $(MAKETESTFLAGS)"; \
cd tests && $(PERL) $(PERLFLAGS) ./run_make_tests.pl -srcdir '$(abs_top_srcdir)' -make '../make$(EXEEXT)' $(MAKETESTFLAGS); \
else \
echo "Can't find a working Perl ($(PERL)); the test suite requires Perl."; \
fi; \

21
NEWS
View File

@@ -1,6 +1,6 @@
GNU make NEWS -*-indented-text-*-
History of user-visible changes.
16 September 2019
3 January 2020
See the end of this file for copyrights and conditions.
@@ -9,7 +9,7 @@ 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.91 (16 Sep 2019)
Version 4.2.93 (03 Jan 2020)
A complete list of bugs fixed in this version is available here:
@@ -35,14 +35,6 @@ http://sv.gnu.org/bugs/index.php?group=make&report_id=111&fix_release_id=108&set
already contains some value. Similarly, appending an empty string does not
add a trailing space.
* WARNING: Backward-incompatibility!
On Linux, and any other systems that provide a /proc/loadavg with similar
syntax, the -l/--load-average option will consult that file to determine how
many CPUs are busy at that moment and compare that value to the load value
requested. This allows usage such as "-j -lN" for N-processor systems
without fear of overload during initial startup.
Patch provided by Sven C. Dack <sven.c.dack@sky.com>
* WARNING: Backward-incompatibility!
Contrary to the documentation, suffix rules with prerequisites were being
treated BOTH as simple targets AND as pattern rules. Behavior now matches
@@ -56,6 +48,13 @@ http://sv.gnu.org/bugs/index.php?group=make&report_id=111&fix_release_id=108&set
search for 'grouped-target' in the .FEATURES special variable.
Implementation contributed by Kaz Kylheku <kaz@kylheku.com>
* New feature: .EXTRA_PREREQS variable
Words in this variable are considered prerequisites of targets but they are
not added to any of the automatic variable values when expanding the
recipe. This variable can either be global (applies to all targets) or
a target-specific variable. To detect this feature search for 'extra-prereqs'
in the .FEATURES special variable.
* Makefiles can now specify the '-j' option in their MAKEFLAGS variable and
this will cause make to enable that parallelism mode.
@@ -1611,7 +1610,7 @@ Version 3.05
(Changes from versions 1 through 3.05 were never recorded. Sorry.)
-------------------------------------------------------------------------------
Copyright (C) 1988-2019 Free Software Foundation, Inc.
Copyright (C) 1988-2020 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

View File

@@ -64,7 +64,7 @@ If you plan to use recursive makes, install make resident:
-------------------------------------------------------------------------------
Copyright (C) 1995-2019 Free Software Foundation, Inc.
Copyright (C) 1995-2020 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

View File

@@ -280,7 +280,7 @@ Bug reports:
-------------------------------------------------------------------------------
Copyright (C) 1996-2019 Free Software Foundation, Inc.
Copyright (C) 1996-2020 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

View File

@@ -160,7 +160,7 @@ from the make source tree.
-------------------------------------------------------------------------------
Copyright (C) 2003-2019 Free Software Foundation, Inc.
Copyright (C) 2003-2020 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

View File

@@ -345,7 +345,7 @@ Bug reports:
is described in the GNU make manual and the base README.
-------------------------------------------------------------------------------
Copyright (C) 1996-2019 Free Software Foundation, Inc.
Copyright (C) 1996-2020 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

View File

@@ -96,7 +96,7 @@ SunOS 4.1.x:
-------------------------------------------------------------------------------
Copyright (C) 1998-2019 Free Software Foundation, Inc.
Copyright (C) 1998-2020 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

View File

@@ -1,7 +1,7 @@
-*-text-*-
-------------------------------------------------------------------------------
Copyright (C) 2002-2019 Free Software Foundation, Inc.
Copyright (C) 2002-2020 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
@@ -88,7 +88,11 @@ need to install the following extra software:
* GCC (Clang's GCC emulation is not sufficient)
* GNU make (POSIX make is not sufficient)
And any tools that those utilities require (GNU m4, Perl, etc.)
And any tools that those utilities require (GNU m4, etc.)
To run the tests you must install Perl.
To build a release you'll need to install lzip.
GNU make requires gnulib to provide some facilities. If you want to maintain
a local installation of gnulib you can set GNULIB_SRCDIR to point to it.
@@ -166,16 +170,16 @@ run:
and, if you like:
$ make dist-bzip2
$ make dist-lzip
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.
Which will build both .gz and .lz package files, then unpack one into a
temporary location, try to build it and repack it, then verifying that
everything works, you get the same results, _and_ no extraneous files are
left over after the "distclean" rule.
This package can be unpacked and built to give a "normal" (non-maintainer
mode) result.

View File

@@ -172,7 +172,7 @@ at the right README!
-------------------------------------------------------------------------------
Copyright (C) 1988-2019 Free Software Foundation, Inc.
Copyright (C) 1988-2020 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

View File

@@ -101,7 +101,7 @@ The Rest of the List
-------------------------------------------------------------------------------
Copyright (C) 1997-2019 Free Software Foundation, Inc.
Copyright (C) 1997-2020 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

View File

@@ -1,5 +1,5 @@
@echo off
:: Copyright (C) 2018-2019 Free Software Foundation, Inc.
:: Copyright (C) 2018-2020 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
@@ -30,5 +30,5 @@ if ERRORLEVEL 1 exit /b 1
goto :EOF
:Done
echo Done. Run buld_w32.bat to build GNU make.
echo Done. Run build_w32.bat to build GNU make.
goto :EOF

View File

@@ -1,6 +1,6 @@
# Bootstrap configuration. -*-shell-script-*-
# Copyright (C) 2018-2019 Free Software Foundation, Inc.
# Copyright (C) 2018-2020 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

View File

@@ -1,7 +1,7 @@
# Configuration for building GNU Make in the absence of any 'make' program.
# @configure_input@
# Copyright (C) 1993-2019 Free Software Foundation, Inc.
# Copyright (C) 1993-2020 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

View File

@@ -1,7 +1,7 @@
#!/bin/sh
# Shell script to build GNU Make in the absence of any 'make' program.
# Copyright (C) 1993-2019 Free Software Foundation, Inc.
# Copyright (C) 1993-2020 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

View File

@@ -1,5 +1,5 @@
@echo off
:: Copyright (C) 1996-2019 Free Software Foundation, Inc.
:: Copyright (C) 1996-2020 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
@@ -258,6 +258,7 @@ exit 1
:Success
echo %OUTDIR% build succeeded.
if exist Basic.mk copy /Y Basic.mk Makefile
if not exist tests\config-flags.pm copy /Y tests\config-flags.pm.W32 tests\config-flags.pm
call :Reset
goto :EOF

View File

@@ -1,5 +1,5 @@
@echo off
rem Copyright (C) 1998-2019 Free Software Foundation, Inc.
rem Copyright (C) 1998-2020 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

View File

@@ -1,6 +1,6 @@
# Process this file with autoconf to produce a configure script.
#
# Copyright (C) 1993-2019 Free Software Foundation, Inc.
# Copyright (C) 1993-2020 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,7 +16,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/>.
AC_INIT([GNU make],[4.2.91],[bug-make@gnu.org])
AC_INIT([GNU make],[4.2.93],[bug-make@gnu.org])
AC_PREREQ([2.69])
@@ -127,8 +127,8 @@ AC_CACHE_CHECK([for standard gettimeofday], [ac_cv_func_gettimeofday],
int main ()
{
struct timeval t; t.tv_sec = -1; t.tv_usec = -1;
exit (gettimeofday (&t, 0) != 0
|| t.tv_sec < 0 || t.tv_usec < 0);
return gettimeofday (&t, 0) != 0
|| t.tv_sec < 0 || t.tv_usec < 0;
}]])],
[ac_cv_func_gettimeofday=yes],
[ac_cv_func_gettimeofday=no],
@@ -138,7 +138,7 @@ AS_IF([test "$ac_cv_func_gettimeofday" = yes],
[Define to 1 if you have a standard gettimeofday function])
])
AC_CHECK_FUNCS([strdup strndup umask mkstemp mktemp fdopen \
AC_CHECK_FUNCS([strdup strndup memrchr umask mkstemp mktemp fdopen \
dup dup2 getcwd realpath sigsetmask sigaction \
getgroups seteuid setegid setlinebuf setreuid setregid \
getrlimit setrlimit setvbuf pipe strsignal \
@@ -371,7 +371,28 @@ AC_ARG_ENABLE([posix-spawn],
AS_CASE([/$ac_cv_header_spawn/$ac_cv_func_posix_spawn/],
[*/no/*], [make_cv_posix_spawn=no])
AS_CASE([/$make_cv_posix_spawn/$user_posix_spawn/],
AS_IF([test "$make_cv_posix_spawn" = yes],
AC_CACHE_CHECK([for posix_spawn that fails synchronously],
[make_cv_synchronous_posix_spawn],
[make_cv_synchronous_posix_spawn=no
AC_RUN_IFELSE([AC_LANG_SOURCE([[
#include <spawn.h>
#include <string.h>
extern char **environ;
int main() {
char* path = strdup("./non-existent");
char *argv[[2]];
argv[[0]] = path;
argv[[1]] = 0;
return posix_spawn(0, path, 0, 0, argv, environ);
}]])],
[make_cv_synchronous_posix_spawn=no],
[make_cv_synchronous_posix_spawn=yes],
[make_cv_synchronous_posix_spawn="no (cross-compiling)"])]))
AS_CASE([/$user_posix_spawn/$make_cv_posix_spawn/$make_cv_synchronous_posix_spawn/],
[*/no/*], [make_cv_posix_spawn=no],
[AC_DEFINE(USE_POSIX_SPAWN, 1, [Define to 1 to use posix_spawn().])
])

View File

@@ -1,5 +1,5 @@
# -*-Makefile-*-, or close enough
# Copyright (C) 2000-2019 Free Software Foundation, Inc.
# Copyright (C) 2000-2020 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

View File

@@ -361,7 +361,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-2019 Free Software Foundation, Inc.
Copyright \(co 1992-1993, 1996-2020 Free Software Foundation, Inc.
This file is part of
.IR "GNU make" .
.LP

View File

@@ -26,8 +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, 2015, 2016, 2017, 2018, 2019
Free Software Foundation, Inc.
2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019,
2020 Free Software Foundation, Inc.
@quotation
Permission is granted to copy, distribute and/or modify this document
@@ -1469,25 +1469,27 @@ build it---otherwise it would apply the same match-anything rule to
@cindex reading makefiles
@cindex makefile, reading
GNU @code{make} does its work in two distinct phases. During the first
phase it reads all the makefiles, included makefiles, etc. and
internalizes all the variables and their values, implicit and explicit
rules, and constructs a dependency graph of all the targets and their
prerequisites. During the second phase, @code{make} uses these internal
structures to determine what targets will need to be rebuilt and to
invoke the rules necessary to do so.
GNU @code{make} does its work in two distinct phases. During the
first phase it reads all the makefiles, included makefiles, etc. and
internalizes all the variables and their values and implicit and
explicit rules, and builds a dependency graph of all the targets and
their prerequisites. During the second phase, @code{make} uses this
internalized data to determine which targets need to be updated and
run the recipes necessary to update them.
It's important to understand this two-phase approach because it has a
direct impact on how variable and function expansion happens; this is
often a source of some confusion when writing makefiles. Here we will
present a summary of the phases in which expansion happens for different
constructs within the makefile. We say that expansion is
@dfn{immediate} if it happens during the first phase: in this case
@code{make} will expand any variables or functions in that section of a
construct as the makefile is parsed. We say that expansion is
@dfn{deferred} if expansion is not performed immediately. Expansion of
a deferred construct is not performed until either the construct appears
later in an immediate context, or until the second phase.
often a source of some confusion when writing makefiles. Below is a
summary of the different constructs that can be found in a makefile,
and the phase in which expansion happens for each part of the
construct.
We say that expansion is @dfn{immediate} if it happens during the
first phase: @code{make} will expand that part of the construct as the
makefile is parsed. We say that expansion is @dfn{deferred} if it is
not immediate. Expansion of a deferred construct part is delayed
until the expansion is used: either when it is referenced in an
immediate context, or when it is needed during the second phase.
You may not be familiar with some of these constructs yet. You can
reference this section as you become familiar with them, in later
@@ -1540,14 +1542,14 @@ define @var{immediate} !=
endef
@end example
For the append operator, @samp{+=}, the right-hand side is considered
For the append operator @samp{+=}, the right-hand side is considered
immediate if the variable was previously set as a simple variable
(@samp{:=} or @samp{::=}), and deferred otherwise.
For the shell assignment operator, @samp{!=}, the right-hand side is
evaluated immediately and handed to the shell. The result is stored in the
variable named on the left, and that variable becomes a simple variable
(and will thus be re-evaluated on each reference).
For the shell assignment operator @samp{!=}, the right-hand side is
evaluated immediately and handed to the shell. The result is stored
in the variable named on the left, and that variable becomes a simple
variable (and will thus be re-evaluated on each reference).
@subheading Conditional Directives
@cindex ifdef, expansion
@@ -1576,10 +1578,10 @@ A rule is always expanded the same way, regardless of the form:
@var{deferred}
@end example
That is, the target and prerequisite sections are expanded immediately,
and the recipe used to construct the target is always deferred. This
general rule is true for explicit rules, pattern rules, suffix rules,
static pattern rules, and simple prerequisite definitions.
That is, the target and prerequisite sections are expanded
immediately, and the recipe used to build the target is always
deferred. This is true for explicit rules, pattern rules, suffix
rules, static pattern rules, and simple prerequisite definitions.
@node Parsing Makefiles, Secondary Expansion, Reading Makefiles, Makefiles
@section How Makefiles Are Parsed
@@ -6629,6 +6631,57 @@ Supports dynamically loadable objects for creating custom extensions.
Expands to a list of directories that @code{make} searches for
included makefiles (@pxref{Include, , Including Other Makefiles}).
@vindex .EXTRA_PREREQS @r{(prerequisites not added to automatic variables)}
@item .EXTRA_PREREQS
Each word in this variable is a new prerequisite which is added to
targets for which it is set. These prerequisites differ from normal
prerequisites in that they do not appear in any of the automatic
variables (@pxref{Automatic Variables}). This allows prerequisites to
be defined which do not impact the recipe.
Consider a rule to link a program:
@example
myprog: myprog.o file1.o file2.o
$(CC) $(CFLAGS) $(LDFLAGS) -o $@@ $^ $(LDLIBS)
@end example
Now suppose you want to enhance this makefile to ensure that updates
to the compiler cause the program to be re-linked. You can add the
compiler as a prerequisite, but you must ensure that it's not passed
as an argument to link command. You'll need something like this:
@example
myprog: myprog.o file1.o file2.o $(CC)
$(CC) $(CFLAGS) $(LDFLAGS) -o $@@ $(filter-out $(CC),$^) $(LDLIBS)
@end example
Then consider having multiple extra prerequisites: they would all have
to be filtered out. Using @code{.EXTRA_PREREQS} and target-specific
variables provides a simpler solution:
@example
myprog: myprog.o file1.o file2.o
$(CC) $(CFLAGS) $(LDFLAGS) -o $@@ $^ $(LDLIBS)
myprog: .EXTRA_PREREQS = $(CC)
@end example
This feature can also be useful if you want to add prerequisites to a
makefile you cannot easily modify: you can create a new file such as
@file{extra.mk}:
@example
myprog: .EXTRA_PREREQS = $(CC)
@end example
then invoke @code{make -f extra.mk -f Makefile}.
Setting @code{.EXTRA_PREREQS} globally will cause those prerequisites
to be added to all targets (which did not themselves override it with
a target-specific value). Note @code{make} is smart enough not to add
a prerequisite listed in @code{.EXTRA_PREREQS} as a prerequisite to
itself.
@end table
@node Conditionals, Functions, Using Variables, Top

View File

@@ -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-2019 Free Software Foundation, Inc.
dnl Copyright (C) 1998-2020 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

View File

@@ -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-2019 Free Software Foundation, Inc.
# Copyright (C) 1993-2020 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

View File

@@ -26,6 +26,9 @@ GNUWEBDIR ?= $(SRCROOTDIR)/gnu-www
# Where to put the CVS checkout of the GNU make web repository
MAKEWEBDIR ?= $(SRCROOTDIR)/make/make-web
# Enable Perl warnings for the test suite
PERLFLAGS := -w
# We like mondo-warnings!
# Also force comments to be preserved. This helps when using ccache, in
# combination with GCC 7's implicit-fallthrough warning.
@@ -480,7 +483,7 @@ $(UPLOADS): $(DIST_ARCHIVES) $(DIST_ARCHIVES_SIG) $(DIST_ARCHIVES_DIRECTIVE)
# Rebuild Makefile.in if this file is modifed.
Makefile.in: maintMakefile
# Copyright (C) 1997-2019 Free Software Foundation, Inc.
# Copyright (C) 1997-2020 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

View File

@@ -154,7 +154,7 @@ $ exit
$ endsubroutine : compileit
$!
$!-----------------------------------------------------------------------------
$!Copyright (C) 1996-2019 Free Software Foundation, Inc.
$!Copyright (C) 1996-2020 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

View File

@@ -2,7 +2,7 @@
#
# Amiga overrides for use with Basic.mk.
#
# Copyright (C) 2017-2019 Free Software Foundation, Inc.
# Copyright (C) 2017-2020 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

View File

@@ -2,7 +2,7 @@
#
# POSIX overrides for use with Basic.mk.
#
# Copyright (C) 2017-2019 Free Software Foundation, Inc.
# Copyright (C) 2017-2020 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

View File

@@ -2,7 +2,7 @@
#
# VMS overrides for use with Basic.mk.
#
# Copyright (C) 2017-2019 Free Software Foundation, Inc.
# Copyright (C) 2017-2020 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

View File

@@ -2,7 +2,7 @@
#
# Windows overrides for use with Basic.mk.
#
# Copyright (C) 2017-2019 Free Software Foundation, Inc.
# Copyright (C) 2017-2020 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

View File

@@ -2,7 +2,7 @@
#
# MS-DOS overrides for use with Basic.mk.
#
# Copyright (C) 2017-2019 Free Software Foundation, Inc.
# Copyright (C) 2017-2020 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

View File

@@ -1,5 +1,5 @@
# List of source files containing translatable strings.
# Copyright (C) 2000-2019 Free Software Foundation, Inc.
# Copyright (C) 2000-2020 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

View File

@@ -1,6 +1,6 @@
#!/bin/sh
#
# Copyright (C) 2014-2019 Free Software Foundation, Inc.
# Copyright (C) 2014-2020 Free Software Foundation, Inc.
# This file is part of GNU Make.
#
# Update GNU make copyrights using gnulib update-copyright

View File

@@ -1,5 +1,5 @@
/* Running commands on Amiga
Copyright (C) 1995-2019 Free Software Foundation, Inc.
Copyright (C) 1995-2020 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

View File

@@ -1,5 +1,5 @@
/* Definitions for amiga specific things
Copyright (C) 1995-2019 Free Software Foundation, Inc.
Copyright (C) 1995-2020 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

View File

@@ -1,5 +1,5 @@
/* Interface to 'ar' archives for GNU Make.
Copyright (C) 1988-2019 Free Software Foundation, Inc.
Copyright (C) 1988-2020 Free Software Foundation, Inc.
This file is part of GNU Make.

View File

@@ -1,5 +1,5 @@
/* Library function for scanning an archive file.
Copyright (C) 1987-2019 Free Software Foundation, Inc.
Copyright (C) 1987-2020 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
@@ -703,7 +703,7 @@ ar_scan (const char *archive, ar_member_func_t function, const void *arg)
}
#ifndef M_XENIX
sscanf (TOCHAR (member_header.ar_mode), "%o", &eltmode);
sscanf (TOCHAR (member_header.ar_mode), "%8o", &eltmode);
eltsize = atol (TOCHAR (member_header.ar_size));
#else /* Xenix. */
eltmode = (unsigned short int) member_header.ar_mode;

View File

@@ -1,5 +1,5 @@
/* Command processing for GNU Make.
Copyright (C) 1988-2019 Free Software Foundation, Inc.
Copyright (C) 1988-2020 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
@@ -133,7 +133,7 @@ set_file_variables (struct file *file)
/* $< is the first not order-only dependency. */
less = "";
for (d = file->deps; d != 0; d = d->next)
if (!d->ignore_mtime)
if (!d->ignore_mtime && !d->ignore_automatic_vars)
{
if (!d->need_2nd_expansion)
less = dep_name (d);
@@ -178,7 +178,7 @@ set_file_variables (struct file *file)
bar_len = 0;
for (d = file->deps; d != 0; d = d->next)
{
if (!d->need_2nd_expansion)
if (!d->need_2nd_expansion && !d->ignore_automatic_vars)
{
if (d->ignore_mtime)
bar_len += strlen (dep_name (d)) + 1;
@@ -200,7 +200,7 @@ set_file_variables (struct file *file)
qmark_len = plus_len + 1; /* Will be this or less. */
for (d = file->deps; d != 0; d = d->next)
if (! d->ignore_mtime && ! d->need_2nd_expansion)
if (! d->ignore_mtime && ! d->need_2nd_expansion && ! d->ignore_automatic_vars)
{
const char *c = dep_name (d);
@@ -247,7 +247,7 @@ set_file_variables (struct file *file)
for (d = file->deps; d != 0; d = d->next)
{
if (d->need_2nd_expansion)
if (d->need_2nd_expansion || d->ignore_automatic_vars)
continue;
slot = hash_find_slot (&dep_hash, d);
@@ -269,7 +269,7 @@ set_file_variables (struct file *file)
{
const char *c;
if (d->need_2nd_expansion || hash_find_item (&dep_hash, d) != d)
if (d->need_2nd_expansion || d->ignore_automatic_vars || hash_find_item (&dep_hash, d) != d)
continue;
c = dep_name (d);

View File

@@ -1,5 +1,5 @@
/* Definition of data structures describing shell commands for GNU Make.
Copyright (C) 1988-2019 Free Software Foundation, Inc.
Copyright (C) 1988-2020 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

View File

@@ -1,5 +1,5 @@
/* config.h -- hand-massaged for Amiga -*-C-*-
Copyright (C) 1995-2019 Free Software Foundation, Inc.
Copyright (C) 1995-2020 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

View File

@@ -1,6 +1,6 @@
/* config.h-vms. Generated by hand by Klaus Kämpf <kkaempf@rmi.de> -*-C-*-
Copyright (C) 1996-2019 Free Software Foundation, Inc.
Copyright (C) 1996-2020 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

View File

@@ -1,6 +1,6 @@
/* config.h.W32 -- hand-massaged config.h file for Windows builds -*-C-*-
Copyright (C) 1996-2019 Free Software Foundation, Inc.
Copyright (C) 1996-2020 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
@@ -292,7 +292,10 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
/* #undef HAVE_STRSIGNAL */
/* Define to 1 if `d_type' is a member of `struct dirent'. */
#define HAVE_STRUCT_DIRENT_D_TYPE 1
/* SV 57152: MinGW64 version of dirent doesn't support d_type. */
#ifndef __MINGW64__
# define HAVE_STRUCT_DIRENT_D_TYPE 1
#endif
/* Define to 1 if you have the `isatty' function. */
#define HAVE_ISATTY 1

View File

@@ -1,6 +1,6 @@
/* configh.dos -- hand-massaged config.h file for MS-DOS builds -*-C-*-
Copyright (C) 1994-2019 Free Software Foundation, Inc.
Copyright (C) 1994-2020 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

View File

@@ -1,5 +1,5 @@
/* Debugging macros and interface.
Copyright (C) 1999-2019 Free Software Foundation, Inc.
Copyright (C) 1999-2020 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

View File

@@ -1,5 +1,5 @@
/* Data base of default implicit rules for GNU Make.
Copyright (C) 1988-2019 Free Software Foundation, Inc.
Copyright (C) 1988-2020 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

View File

@@ -1,5 +1,5 @@
/* Definitions of dependency data structures for GNU Make.
Copyright (C) 1988-2019 Free Software Foundation, Inc.
Copyright (C) 1988-2020 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
@@ -48,7 +48,8 @@ struct nameseq
unsigned int changed : 1; \
unsigned int ignore_mtime : 1; \
unsigned int staticpattern : 1; \
unsigned int need_2nd_expansion : 1
unsigned int need_2nd_expansion : 1; \
unsigned int ignore_automatic_vars : 1
struct dep
{
@@ -74,6 +75,7 @@ struct goaldep
#define PARSEFS_NOGLOB 0x0004
#define PARSEFS_EXISTS 0x0008
#define PARSEFS_NOCACHE 0x0010
#define PARSEFS_ONEWORD 0x0020
#define PARSE_FILE_SEQ(_s,_t,_c,_p,_f) \
(_t *)parse_file_seq ((_s),sizeof (_t),(_c),(_p),(_f))

View File

@@ -1,5 +1,5 @@
/* Directory hashing for GNU Make.
Copyright (C) 1988-2019 Free Software Foundation, Inc.
Copyright (C) 1988-2020 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

View File

@@ -1,5 +1,5 @@
/* Variable expansion functions for GNU Make.
Copyright (C) 1988-2019 Free Software Foundation, Inc.
Copyright (C) 1988-2020 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

View File

@@ -1,5 +1,5 @@
/* Target file management for GNU Make.
Copyright (C) 1988-2019 Free Software Foundation, Inc.
Copyright (C) 1988-2020 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
@@ -550,15 +550,6 @@ enter_prereqs (struct dep *deps, const char *stem)
return deps;
}
/* Set the intermediate flag. */
static void
set_intermediate (const void *item)
{
struct file *f = (struct file *) item;
f->intermediate = 1;
}
/* Expand and parse each dependency line. */
static void
expand_deps (struct file *f)
@@ -644,13 +635,69 @@ expand_deps (struct file *f)
}
}
/* Reset the updating flag. */
/* Add extra prereqs to the file in question. */
struct dep *
expand_extra_prereqs (const struct variable *extra)
{
struct dep *prereqs = extra ? split_prereqs (variable_expand (extra->value)) : NULL;
for (struct dep *d = prereqs; d; d = d->next)
{
d->file = lookup_file (d->name);
if (!d->file)
d->file = enter_file (d->name);
d->name = NULL;
d->ignore_automatic_vars = 1;
}
return prereqs;
}
/* Perform per-file snap operations. */
static void
reset_updating (const void *item)
snap_file (const void *item, void *arg)
{
struct file *f = (struct file *) item;
f->updating = 0;
struct file *f = (struct file*)item;
struct dep *prereqs = NULL;
/* If we're not doing second expansion then reset updating. */
if (!second_expansion)
f->updating = 0;
/* If .SECONDARY is set with no deps, mark all targets as intermediate. */
if (all_secondary)
f->intermediate = 1;
/* If .EXTRA_PREREQS is set, add them as ignored by automatic variables. */
if (f->variables)
prereqs = expand_extra_prereqs (lookup_variable_in_set (STRING_SIZE_TUPLE(".EXTRA_PREREQS"), f->variables->set));
else if (f->is_target)
prereqs = copy_dep_chain (arg);
if (prereqs)
{
struct dep *d;
for (d = prereqs; d; d = d->next)
if (streq (f->name, dep_name (d)))
/* Skip circular dependencies. */
break;
if (d)
/* We broke early: must have found a circular dependency. */
free_dep_chain (prereqs);
else if (!f->deps)
f->deps = prereqs;
else
{
d = f->deps;
while (d->next)
d = d->next;
d->next = prereqs;
}
}
}
/* For each dependency of each file, make the 'struct dep' point
@@ -700,9 +747,6 @@ snap_deps (void)
expand_deps (f);
free (file_slot_0);
}
else
/* We're not doing second expansion, so reset updating. */
hash_map (&files, reset_updating);
/* Now manage all the special targets. */
@@ -744,10 +788,7 @@ snap_deps (void)
f2->intermediate = f2->secondary = 1;
/* .SECONDARY with no deps listed marks *all* files that way. */
else
{
all_secondary = 1;
hash_map (&files, set_intermediate);
}
all_secondary = 1;
f = lookup_file (".EXPORT_ALL_VARIABLES");
if (f != 0 && f->is_target)
@@ -779,6 +820,15 @@ snap_deps (void)
if (f != 0 && f->is_target)
not_parallel = 1;
{
struct dep *prereqs = expand_extra_prereqs (lookup_variable (STRING_SIZE_TUPLE(".EXTRA_PREREQS")));
/* Perform per-file snap operations. */
hash_map_arg(&files, snap_file, prereqs);
free_dep_chain (prereqs);
}
#ifndef NO_MINUS_C_MINUS_O
/* If .POSIX was defined, remove OUTPUT_OPTION to comply. */
/* This needs more work: what if the user sets this in the makefile?

View File

@@ -1,5 +1,5 @@
/* Definition of target file data structures for GNU Make.
Copyright (C) 1988-2019 Free Software Foundation, Inc.
Copyright (C) 1988-2020 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
@@ -21,6 +21,11 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
#include "hash.h"
struct commands;
struct dep;
struct variable;
struct variable_set_list;
struct file
{
const char *name;
@@ -110,6 +115,7 @@ struct file *lookup_file (const char *name);
struct file *enter_file (const char *name);
struct dep *split_prereqs (char *prereqstr);
struct dep *enter_prereqs (struct dep *prereqs, const char *stem);
struct dep *expand_extra_prereqs (const struct variable *extra);
void remove_intermediates (int sig);
void snap_deps (void);
void rename_file (struct file *file, const char *name);

View File

@@ -1,5 +1,5 @@
/* Builtin function expansion for GNU Make.
Copyright (C) 1988-2019 Free Software Foundation, Inc.
Copyright (C) 1988-2020 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
@@ -2173,6 +2173,15 @@ func_realpath (char *o, char **argv, const char *funcname UNUSED)
#ifdef HAVE_REALPATH
ENULLLOOP (rp, realpath (in, out));
# if defined _AIX
/* AIX realpath() doesn't remove trailing slashes correctly. */
if (rp)
{
char *ep = rp + strlen (rp) - 1;
while (ep > rp && ep[0] == '/')
*(ep--) = '\0';
}
# endif
#else
rp = abspath (in, out);
#endif

View File

@@ -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-2019 Free Software Foundation, Inc.
Copyright (C) 1987-2020 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.

View File

@@ -1,5 +1,5 @@
/* Declarations for getopt.
Copyright (C) 1989-2019 Free Software Foundation, Inc.
Copyright (C) 1989-2020 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.

View File

@@ -1,5 +1,5 @@
/* getopt_long and getopt_long_only entry points for GNU getopt.
Copyright (C) 1987-1994, 1996-2019 Free Software Foundation, Inc.
Copyright (C) 1987-1994, 1996-2020 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.

View File

@@ -1,5 +1,5 @@
/* Convenience header for conditional use of GNU <libintl.h>.
Copyright (C) 1995-2019 Free Software Foundation, Inc.
Copyright (C) 1995-2020 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

View File

@@ -1,5 +1,5 @@
;; Contents of the (gnu make) Guile module
;; Copyright (C) 2011-2019 Free Software Foundation, Inc.
;; Copyright (C) 2011-2020 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

View File

@@ -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-2019 Free Software Foundation, Inc.
Copyright (C) 2013-2020 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

View File

@@ -1,5 +1,5 @@
/* GNU Guile interface for GNU Make.
Copyright (C) 2011-2019 Free Software Foundation, Inc.
Copyright (C) 2011-2020 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

View File

@@ -16,6 +16,7 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
#include "makeint.h"
#include "hash.h"
#include <assert.h>
#define CALLOC(t, n) ((t *) xcalloc (sizeof (t) * (n)))
#define MALLOC(t, n) ((t *) xmalloc (sizeof (t) * (n)))
@@ -364,7 +365,8 @@ round_up_2 (unsigned long n)
r += val; \
} while(0);
unsigned jhash(unsigned const char *k, int length)
unsigned int
jhash(unsigned const char *k, int length)
{
unsigned int a, b, c;
@@ -408,12 +410,16 @@ unsigned jhash(unsigned const char *k, int length)
return c;
}
#define UINTSZ sizeof (unsigned int)
#ifdef WORDS_BIGENDIAN
/* The ifs are ordered from the first byte in memory to the last. */
#define sum_up_to_nul(r, p, flag) \
#define sum_up_to_nul(r, p, plen, flag) \
do { \
unsigned int val; \
memcpy(&val, (p), 4); \
unsigned int val = 0; \
size_t pn = (plen); \
size_t n = pn < UINTSZ ? pn : UINTSZ; \
memcpy (&val, (p), n); \
if ((val & 0xFF000000) == 0) \
flag = 1; \
else if ((val & 0xFF0000) == 0) \
@@ -427,51 +433,60 @@ unsigned jhash(unsigned const char *k, int length)
/* First detect the presence of zeroes. If there is none, we can
sum the 4 bytes directly. Otherwise, the ifs are ordered as in the
big endian case, from the first byte in memory to the last. */
#define sum_up_to_nul(r, p, flag) \
do { \
unsigned int val; \
unsigned int zeroes; \
memcpy(&val, (p), 4); \
zeroes = ((val - 0x01010101) & ~val); \
if (!(zeroes & 0x80808080)) \
r += val; \
else if ((val & 0xFF) == 0) \
flag = 1; \
else if ((val & 0xFF00) == 0) \
r += val & 0xFF, flag = 1; \
else if ((val & 0xFF0000) == 0) \
r += val & 0xFFFF, flag = 1; \
else \
r += val, flag = 1; \
#define sum_up_to_nul(r, p, plen, flag) \
do { \
unsigned int val = 0; \
size_t pn = (plen); \
size_t n = pn < UINTSZ ? pn : UINTSZ; \
memcpy (&val, (p), n); \
flag = ((val - 0x01010101) & ~val) & 0x80808080; \
if (!flag) \
r += val; \
else if (val & 0xFF) \
{ \
if ((val & 0xFF00) == 0) \
r += val & 0xFF; \
else if ((val & 0xFF0000) == 0) \
r += val & 0xFFFF; \
else \
r += val; \
} \
} while (0)
#endif
/* This function performs magic which is correct but causes ASAN heartburn
when we pass in a global constant string (at least). */
__attribute__((no_sanitize_address))
unsigned jhash_string(unsigned const char *k)
unsigned int
jhash_string(unsigned const char *k)
{
unsigned int a, b, c;
unsigned int have_nul = 0;
unsigned const char *start = k;
size_t klen = strlen ((const char*)k);
/* Set up the internal state */
a = b = c = JHASH_INITVAL;
/* All but the last block: affect some 32 bits of (a,b,c) */
for (;;) {
sum_up_to_nul(a, k, have_nul);
sum_up_to_nul(a, k, klen, have_nul);
if (have_nul)
break;
k += 4;
sum_up_to_nul(b, k, have_nul);
k += UINTSZ;
assert (klen >= UINTSZ);
klen -= UINTSZ;
sum_up_to_nul(b, k, klen, have_nul);
if (have_nul)
break;
k += 4;
sum_up_to_nul(c, k, have_nul);
k += UINTSZ;
assert (klen >= UINTSZ);
klen -= UINTSZ;
sum_up_to_nul(c, k, klen, have_nul);
if (have_nul)
break;
k += 4;
k += UINTSZ;
assert (klen >= UINTSZ);
klen -= UINTSZ;
jhash_mix(a, b, c);
}

View File

@@ -1,5 +1,5 @@
/* Implicit rule searching for GNU Make.
Copyright (C) 1988-2019 Free Software Foundation, Inc.
Copyright (C) 1988-2020 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
@@ -152,6 +152,7 @@ struct patdeps
const char *pattern;
struct file *file;
unsigned int ignore_mtime : 1;
unsigned int ignore_automatic_vars : 1;
};
/* This structure stores information about pattern rules that we need
@@ -220,8 +221,9 @@ pattern_search (struct file *file, int archive,
struct patdeps *deplist = xmalloc (max_deps * sizeof (struct patdeps));
struct patdeps *pat = deplist;
/* Names of possible dependencies are constructed in this buffer. */
char *depname = alloca (namelen + max_pattern_dep_length);
/* Names of possible dependencies are constructed in this buffer.
We may replace % by $(*F) for second expansion, increasing the length. */
char *depname = alloca (namelen + max_pattern_dep_length + 4);
/* The start and length of the stem of FILENAME for the current rule. */
const char *stem = 0;
@@ -265,7 +267,7 @@ 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, '/');
lastslash = memrchr (filename, '/', namelen - 1);
#ifdef VMS
if (lastslash == NULL)
lastslash = strrchr (filename, ']');
@@ -278,18 +280,16 @@ pattern_search (struct file *file, int archive,
/* Handle backslashes (possibly mixed with forward slashes)
and the case of "d:file". */
{
char *bslash = strrchr (filename, '\\');
char *bslash = memrchr (filename, '\\', namelen - 1);
if (lastslash == 0 || bslash > lastslash)
lastslash = bslash;
if (lastslash == 0 && filename[0] && filename[1] == ':')
lastslash = filename + 1;
}
#endif
if (lastslash != 0 && lastslash[1] == '\0')
lastslash = 0;
}
pathlen = lastslash - filename + 1;
pathlen = lastslash ? lastslash - filename + 1 : 0;
/* First see which pattern rules match this target and may be considered.
Put them in TRYRULES. */
@@ -443,7 +443,6 @@ pattern_search (struct file *file, int archive,
unsigned int deps_found = 0;
/* NPTR points to the part of the prereq we haven't processed. */
const char *nptr = 0;
const char *dir = NULL;
int order_only = 0;
unsigned int matches;
@@ -478,12 +477,12 @@ pattern_search (struct file *file, int archive,
memcpy (pathdir, filename, pathlen);
pathdir[pathlen] = '\0';
}
dir = pathdir;
}
if (stemlen > GET_PATH_MAX)
if (stemlen + (check_lastslash ? pathlen : 0) > GET_PATH_MAX)
{
DBS (DB_IMPLICIT, (_("Stem too long: '%.*s'.\n"),
DBS (DB_IMPLICIT, (_("Stem too long: '%s%.*s'.\n"),
check_lastslash ? pathdir : "",
(int) stemlen, stem));
continue;
}
@@ -491,8 +490,19 @@ pattern_search (struct file *file, int archive,
DBS (DB_IMPLICIT, (_("Trying pattern rule with stem '%.*s'.\n"),
(int) stemlen, stem));
strncpy (stem_str, stem, stemlen);
stem_str[stemlen] = '\0';
if (!check_lastslash)
{
memcpy (stem_str, stem, stemlen);
stem_str[stemlen] = '\0';
}
else
{
/* We want to prepend the directory from
the original FILENAME onto the stem. */
memcpy (stem_str, filename, pathlen);
memcpy (stem_str + pathlen, stem, stemlen);
stem_str[pathlen + stemlen] = '\0';
}
/* If there are no prerequisites, then this rule matches. */
if (rule->deps == 0)
@@ -543,18 +553,19 @@ pattern_search (struct file *file, int archive,
}
memcpy (o, nptr, p - nptr);
o += p - nptr;
memcpy (o, stem_str, stemlen);
memcpy (o, stem, stemlen);
o += stemlen;
strcpy (o, p + 1);
}
/* Parse the expanded string. It might have wildcards. */
p = depname;
dl = PARSE_SIMPLE_SEQ (&p, struct dep);
dl = PARSE_FILE_SEQ (&p, struct dep, MAP_NUL, NULL, PARSEFS_ONEWORD);
for (d = dl; d != NULL; d = d->next)
{
++deps_found;
d->ignore_mtime = dep->ignore_mtime;
d->ignore_automatic_vars = dep->ignore_automatic_vars;
}
/* We've used up this dep, so next time get a new one. */
@@ -594,10 +605,10 @@ pattern_search (struct file *file, int archive,
again. This is not good if you have certain characters
in your stem (like $).
Instead, we will replace % with $* and allow the second
expansion to take care of it for us. This way (since $*
is a simple variable) there won't be additional
re-expansion of the stem. */
Instead, we will replace % with $* or $(*F) and allow the
second expansion to take care of it for us. This way
(since $* and $(*F) are simple variables) there won't be
additional re-expansion of the stem. */
p = lindex (nptr, nptr + len, '%');
if (p == 0)
@@ -608,13 +619,22 @@ pattern_search (struct file *file, int archive,
else
{
size_t i = p - nptr;
memcpy (depname, nptr, i);
memcpy (depname + i, "$*", 2);
memcpy (depname + i + 2, p + 1, len - i - 1);
depname[len + 2 - 1] = '\0';
char *o = depname;
memcpy (o, nptr, i);
o += i;
if (check_lastslash)
add_dir = 1;
{
add_dir = 1;
memcpy (o, "$(*F)", 5);
o += 5;
}
else
{
memcpy (o, "$*", 2);
o += 2;
}
memcpy (o, p + 1, len - i - 1);
o[len - i - 1] = '\0';
}
/* Set up for the next word. */
@@ -646,7 +666,7 @@ pattern_search (struct file *file, int archive,
/* Parse the expanded string. */
struct dep *dp = PARSE_FILE_SEQ (&p, struct dep,
order_only ? MAP_NUL : MAP_PIPE,
add_dir ? dir : NULL, PARSEFS_NONE);
add_dir ? pathdir : NULL, PARSEFS_NONE);
*dptr = dp;
for (d = dp; d != NULL; d = d->next)
@@ -705,6 +725,7 @@ pattern_search (struct file *file, int archive,
memset (pat, '\0', sizeof (struct patdeps));
pat->ignore_mtime = d->ignore_mtime;
pat->ignore_automatic_vars = d->ignore_automatic_vars;
DBS (DB_IMPLICIT,
(is_rule
@@ -895,6 +916,7 @@ pattern_search (struct file *file, int archive,
dep = alloc_dep ();
dep->ignore_mtime = pat->ignore_mtime;
dep->ignore_automatic_vars = pat->ignore_automatic_vars;
s = strcache_add (pat->name);
if (recursions)
dep->name = s;
@@ -931,17 +953,13 @@ pattern_search (struct file *file, int archive,
}
else
{
size_t dirlen = (lastslash + 1) - filename;
char *sp;
/* We want to prepend the directory from
the original FILENAME onto the stem. */
fullstemlen = dirlen + stemlen;
sp = alloca (fullstemlen + 1);
memcpy (sp, filename, dirlen);
memcpy (sp + dirlen, stem, stemlen);
sp[fullstemlen] = '\0';
file->stem = strcache_add (sp);
fullstemlen = pathlen + stemlen;
memcpy (stem_str, filename, pathlen);
memcpy (stem_str + pathlen, stem, stemlen);
stem_str[fullstemlen] = '\0';
file->stem = strcache_add (stem_str);
}
file->cmds = rule->cmds;

View File

@@ -1,5 +1,5 @@
/* Job execution and handling for GNU Make.
Copyright (C) 1988-2019 Free Software Foundation, Inc.
Copyright (C) 1988-2020 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
@@ -557,11 +557,8 @@ child_error (struct child *child,
nm = _("<builtin>");
else
{
/* We can't use the standard <FILE>:<LINENO> syntax here because
Emacs misinterprets it and matches a bogus filename in the compile
buffer. */
char *a = alloca (strlen (flocp->filenm) + 6 + INTSTR_LENGTH + 1);
sprintf (a, "%s;%lu", flocp->filenm, flocp->lineno + flocp->offset);
sprintf (a, "%s:%lu", flocp->filenm, flocp->lineno + flocp->offset);
nm = a;
}
@@ -1073,12 +1070,12 @@ reap_children (int block, int err)
{
DB (DB_JOBS, (_("Removing child %p PID %s%s from chain.\n"),
c, pid2str (c->pid), c->remote ? _(" (remote)") : ""));
/* There is now another slot open. */
if (job_slots_used > 0)
--job_slots_used;
}
/* There is now another slot open. */
if (job_slots_used > 0)
job_slots_used -= c->jobslot;
/* Remove the child from the chain and free it. */
if (lastc == 0)
children = c->next;
@@ -1647,6 +1644,8 @@ start_waiting_job (struct child *c)
c->remote ? _(" (remote)") : ""));
/* One more job slot is in use. */
++job_slots_used;
assert (c->jobslot == 0);
c->jobslot = 1;
}
children = c;
unblock_sigs ();
@@ -2009,7 +2008,18 @@ load_too_high (void)
#else
static double last_sec;
static time_t last_now;
static int proc_fd = -2;
/* This is disabled by default for now, because it will behave badly if the
user gives a value > the number of cores; in that situation the load will
never be exceeded, this function always returns false, and we'll start
all the jobs. Also, it's not quite right to limit jobs to the number of
cores not busy since a job takes some time to start etc. Maybe that's
OK, I'm not sure exactly how to handle that, but for sure we need to
clamp this value at the number of cores before this can be enabled.
*/
#define PROC_FD_INIT -1
static int proc_fd = PROC_FD_INIT;
double load, guess;
time_t now;
@@ -2397,7 +2407,7 @@ child_execute_job (struct childbase *child, int good_stdin, char **argv)
for (pp = argv; *pp != NULL; ++pp)
++l;
nargv = xmalloc (sizeof (char *) * (l + 2));
nargv = xmalloc (sizeof (char *) * (l + 3));
nargv[0] = (char *)default_shell;
nargv[1] = cmd;
memcpy (&nargv[2], &argv[1], sizeof (char *) * l);

View File

@@ -1,5 +1,5 @@
/* Definitions for managing subprocesses in GNU Make.
Copyright (C) 1992-2019 Free Software Foundation, Inc.
Copyright (C) 1992-2020 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,6 +61,7 @@ struct child
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 jobslot:1; /* Nonzero if it's reserved a job slot. */
unsigned int dontcare:1; /* Saved dontcare flag. */
};

View File

@@ -1,5 +1,5 @@
/* Loading dynamic objects for GNU Make.
Copyright (C) 2012-2019 Free Software Foundation, Inc.
Copyright (C) 2012-2020 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

View File

@@ -1,5 +1,5 @@
/* API for GNU Make dynamic objects.
Copyright (C) 2013-2019 Free Software Foundation, Inc.
Copyright (C) 2013-2020 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

View File

@@ -1,5 +1,5 @@
/* Argument parsing and main program of GNU Make.
Copyright (C) 1988-2019 Free Software Foundation, Inc.
Copyright (C) 1988-2020 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
@@ -1313,7 +1313,7 @@ main (int argc, char **argv, char **envp)
{
const char *features = "target-specific order-only second-expansion"
" else-if shortest-stem undefine oneshell nocomment"
" grouped-target"
" grouped-target extra-prereqs"
#ifndef NO_ARCHIVES
" archives"
#endif
@@ -2134,9 +2134,9 @@ main (int argc, char **argv, char **envp)
install_default_implicit_rules ();
/* Compute implicit rule limits. */
/* Compute implicit rule limits and do magic for pattern rules. */
count_implicit_rule_limits ();
snap_implicit_rules ();
/* Construct the listings of directories in VPATH lists. */
@@ -3370,7 +3370,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-2019 Free Software Foundation, Inc.\n",
printf ("%sCopyright (C) 1988-2020 Free Software Foundation, Inc.\n",
precede);
printf (_("%sLicense GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>\n\

View File

@@ -1,5 +1,5 @@
/* Miscellaneous global declarations and portability cruft for GNU Make.
Copyright (C) 1988-2019 Free Software Foundation, Inc.
Copyright (C) 1988-2020 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
@@ -528,8 +528,12 @@ void print_spaces (unsigned int);
char *find_percent (char *);
const char *find_percent_cached (const char **);
FILE *get_tmpfile (char **, const char *);
ssize_t writebuf (int, const void*, size_t);
ssize_t readbuf (int, void*, size_t);
ssize_t writebuf (int, const void *, size_t);
ssize_t readbuf (int, void *, size_t);
#ifndef HAVE_MEMRCHR
void *memrchr(const void *, int, size_t);
#endif
#ifndef NO_ARCHIVES
int ar_name (const char *);

View File

@@ -1,5 +1,5 @@
/* Miscellaneous generic support functions for GNU Make.
Copyright (C) 1988-2019 Free Software Foundation, Inc.
Copyright (C) 1988-2020 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,6 +24,7 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
#include <stdarg.h>
#ifdef WINDOWS32
# include <windows.h>
# include <io.h>
#endif
@@ -260,6 +261,30 @@ xstrndup (const char *str, size_t length)
return result;
}
#ifndef HAVE_MEMRCHR
void *
memrchr(const void* str, int ch, size_t len)
{
const char* sp = str;
const char* cp = sp;
if (len == 0)
return NULL;
cp += len - 1;
while (cp[0] != ch)
{
if (cp == sp)
return NULL;
--cp;
}
return (void*)cp;
}
#endif
/* Limited INDEX:
@@ -407,7 +432,8 @@ free_ns_chain (struct nameseq *ns)
#ifdef MAKE_MAINTAINER_MODE
void spin(const char* type)
void
spin (const char* type)
{
char filenm[256];
struct stat dummy;
@@ -418,7 +444,11 @@ void spin(const char* type)
{
fprintf (stderr, "SPIN on %s\n", filenm);
do
#ifdef WINDOWS32
Sleep (1000);
#else
sleep (1);
#endif
while (stat (filenm, &dummy) == 0);
}
}

View File

@@ -1,5 +1,5 @@
/* Declarations for operating system interfaces for GNU Make.
Copyright (C) 2016-2019 Free Software Foundation, Inc.
Copyright (C) 2016-2020 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

View File

@@ -1,5 +1,5 @@
/* Output to stdout / stderr for GNU make
Copyright (C) 2013-2019 Free Software Foundation, Inc.
Copyright (C) 2013-2020 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

View File

@@ -1,5 +1,5 @@
/* Output to stdout / stderr for GNU make
Copyright (C) 2013-2019 Free Software Foundation, Inc.
Copyright (C) 2013-2020 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

View File

@@ -1,5 +1,5 @@
/* POSIX-based operating system interface for GNU Make.
Copyright (C) 2016-2019 Free Software Foundation, Inc.
Copyright (C) 2016-2020 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

View File

@@ -1,5 +1,5 @@
/* Reading and parsing of makefiles for GNU Make.
Copyright (C) 1988-2019 Free Software Foundation, Inc.
Copyright (C) 1988-2020 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
@@ -3138,7 +3138,10 @@ parse_file_seq (char **stringp, size_t size, int stopmap,
char *p;
glob_t gl;
char *tp;
int findmap = stopmap|MAP_VMSCOMMA|MAP_BLANK|MAP_NUL;
int findmap = stopmap|MAP_VMSCOMMA|MAP_NUL;
if (NONE_SET (flags, PARSEFS_ONEWORD))
findmap |= MAP_BLANK;
/* Always stop on NUL. */
stopmap |= MAP_NUL;

View File

@@ -1,5 +1,5 @@
/* Basic dependency engine for GNU Make.
Copyright (C) 1988-2019 Free Software Foundation, Inc.
Copyright (C) 1988-2020 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

View File

@@ -3,7 +3,7 @@
Please do not send bug reports or questions about it to
the Make maintainers.
Copyright (C) 1988-2019 Free Software Foundation, Inc.
Copyright (C) 1988-2020 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

View File

@@ -1,5 +1,5 @@
/* Template for the remote job exportation interface to GNU Make.
Copyright (C) 1988-2019 Free Software Foundation, Inc.
Copyright (C) 1988-2020 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

View File

@@ -1,5 +1,5 @@
/* Pattern and suffix rule internals for GNU Make.
Copyright (C) 1988-2019 Free Software Foundation, Inc.
Copyright (C) 1988-2020 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
@@ -60,36 +60,43 @@ struct file *suffix_file;
static size_t maxsuffix;
/* Compute the maximum dependency length and maximum number of
dependencies of all implicit rules. Also sets the subdir
flag for a rule when appropriate, possibly removing the rule
completely when appropriate. */
/* Compute the maximum dependency length and maximum number of dependencies of
all implicit rules. Also sets the subdir flag for a rule when appropriate,
possibly removing the rule completely when appropriate.
Add any global EXTRA_PREREQS here as well. */
void
count_implicit_rule_limits (void)
snap_implicit_rules (void)
{
char *name;
size_t namelen;
struct rule *rule;
char *name = NULL;
size_t namelen = 0;
struct dep *prereqs = expand_extra_prereqs (lookup_variable (STRING_SIZE_TUPLE(".EXTRA_PREREQS")));
unsigned int pre_deps = 0;
num_pattern_rules = max_pattern_targets = max_pattern_deps = 0;
max_pattern_dep_length = 0;
name = 0;
namelen = 0;
rule = pattern_rules;
while (rule != 0)
for (struct dep *d = prereqs; d; d = d->next)
{
unsigned int ndeps = 0;
struct dep *dep;
struct rule *next = rule->next;
size_t l = strlen (dep_name (d));
if (l > max_pattern_dep_length)
max_pattern_dep_length = l;
++pre_deps;
}
num_pattern_rules = max_pattern_targets = max_pattern_deps = 0;
for (struct rule *rule = pattern_rules; rule; rule = rule->next)
{
unsigned int ndeps = pre_deps;
struct dep *lastdep = NULL;
++num_pattern_rules;
if (rule->num > max_pattern_targets)
max_pattern_targets = rule->num;
for (dep = rule->deps; dep != 0; dep = dep->next)
for (struct dep *dep = rule->deps; dep != 0; dep = dep->next)
{
const char *dname = dep_name (dep);
size_t len = strlen (dname);
@@ -99,17 +106,20 @@ count_implicit_rule_limits (void)
const char *p2;
if (p == 0)
p = strrchr (dname, ':');
p2 = p != 0 ? strchr (dname, '%') : 0;
p2 = p ? strchr (p, '%') : 0;
#else
const char *p = strrchr (dname, '/');
const char *p2 = p != 0 ? strchr (dname, '%') : 0;
const char *p2 = p ? strchr (p, '%') : 0;
#endif
ndeps++;
if (len > max_pattern_dep_length)
max_pattern_dep_length = len;
if (p != 0 && p2 > p)
if (!dep->next)
lastdep = dep;
if (p2)
{
/* There is a slash before the % in the dep name.
Extract the directory name. */
@@ -134,13 +144,20 @@ count_implicit_rule_limits (void)
dep->changed = 0;
}
if (prereqs)
{
if (lastdep)
lastdep->next = copy_dep_chain (prereqs);
else
rule->deps = copy_dep_chain (prereqs);
}
if (ndeps > max_pattern_deps)
max_pattern_deps = ndeps;
rule = next;
}
free (name);
free_dep_chain (prereqs);
}
/* Create a pattern rule from a suffix rule.

View File

@@ -1,5 +1,5 @@
/* Definitions for using pattern rules in GNU Make.
Copyright (C) 1988-2019 Free Software Foundation, Inc.
Copyright (C) 1988-2020 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
@@ -48,7 +48,7 @@ extern size_t max_pattern_dep_length;
extern struct file *suffix_file;
void count_implicit_rule_limits (void);
void snap_implicit_rules (void);
void convert_to_pattern (void);
void install_pattern_rule (struct pspec *p, int terminal);
void create_pattern_rule (const char **targets, const char **target_percents,

View File

@@ -1,5 +1,5 @@
/* Convert between signal names and numbers.
Copyright (C) 1990-2019 Free Software Foundation, Inc.
Copyright (C) 1990-2020 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

View File

@@ -1,5 +1,5 @@
/* Constant string caching for GNU Make.
Copyright (C) 2006-2019 Free Software Foundation, Inc.
Copyright (C) 2006-2020 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

View File

@@ -1,5 +1,5 @@
/* Internals of variables for GNU Make.
Copyright (C) 1988-2019 Free Software Foundation, Inc.
Copyright (C) 1988-2020 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

View File

@@ -1,5 +1,5 @@
/* Definitions for using variables in GNU Make.
Copyright (C) 1988-2019 Free Software Foundation, Inc.
Copyright (C) 1988-2020 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

View File

@@ -1,5 +1,5 @@
/* Record version and build host architecture for GNU make.
Copyright (C) 1988-2019 Free Software Foundation, Inc.
Copyright (C) 1988-2020 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

View File

@@ -7,7 +7,7 @@
* Author: John E. Malmberg
*/
/* Copyright (C) 2014-2019 Free Software Foundation, Inc.
/* Copyright (C) 2014-2020 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

View File

@@ -4,7 +4,7 @@
* DCL symbols.
*/
/* Copyright (C) 2014-2019 Free Software Foundation, Inc.
/* Copyright (C) 2014-2020 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

View File

@@ -36,7 +36,7 @@
*
*/
/* Copyright (C) 2014-2019 Free Software Foundation, Inc.
/* Copyright (C) 2014-2020 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

View File

@@ -1,5 +1,5 @@
/* dirent.h for vms
Copyright (C) 1996-2019 Free Software Foundation, Inc.
Copyright (C) 1996-2020 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

View File

@@ -1,5 +1,5 @@
/* VMS functions
Copyright (C) 1996-2019 Free Software Foundation, Inc.
Copyright (C) 1996-2020 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

View File

@@ -1,5 +1,5 @@
/* vmsify.c -- Module for vms <-> unix file name conversion
Copyright (C) 1996-2019 Free Software Foundation, Inc.
Copyright (C) 1996-2020 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

View File

@@ -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-2019 Free Software Foundation, Inc.
Copyright (C) 1996-2020 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

View File

@@ -1,5 +1,5 @@
/* Implementation of pattern-matching file search paths for GNU Make.
Copyright (C) 1988-2019 Free Software Foundation, Inc.
Copyright (C) 1988-2020 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

View File

@@ -1,5 +1,5 @@
/* Directory entry code for Window platforms.
Copyright (C) 1996-2019 Free Software Foundation, Inc.
Copyright (C) 1996-2020 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

View File

@@ -1,6 +1,6 @@
/* Replacements for Posix functions and Posix functionality for MS-Windows.
Copyright (C) 2013-2019 Free Software Foundation, Inc.
Copyright (C) 2013-2020 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

View File

@@ -1,5 +1,5 @@
/* Windows version of dirent.h
Copyright (C) 1996-2019 Free Software Foundation, Inc.
Copyright (C) 1996-2020 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

View File

@@ -1,5 +1,5 @@
/* dlfcn.h replacement for MS-Windows build.
Copyright (C) 2013-2019 Free Software Foundation, Inc.
Copyright (C) 2013-2020 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

View File

@@ -1,5 +1,5 @@
/* Definitions for Windows path manipulation.
Copyright (C) 1996-2019 Free Software Foundation, Inc.
Copyright (C) 1996-2020 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

View File

@@ -1,5 +1,5 @@
/* Definitions for Windows process invocation.
Copyright (C) 1996-2019 Free Software Foundation, Inc.
Copyright (C) 1996-2020 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

View File

@@ -1,5 +1,5 @@
/* Definitions for Windows error handling.
Copyright (C) 1996-2019 Free Software Foundation, Inc.
Copyright (C) 1996-2020 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

View File

@@ -1,5 +1,5 @@
/* Path conversion for Windows pathnames.
Copyright (C) 1996-2019 Free Software Foundation, Inc.
Copyright (C) 1996-2020 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

View File

@@ -1,5 +1,5 @@
/* Process handling for Windows
Copyright (C) 1996-2019 Free Software Foundation, Inc.
Copyright (C) 1996-2020 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

View File

@@ -1,5 +1,5 @@
/* Definitions for Windows
Copyright (C) 1996-2019 Free Software Foundation, Inc.
Copyright (C) 1996-2020 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

Some files were not shown because too many files have changed in this diff Show More