Compare commits

..

52 Commits
4.2.91 ... 4.3

Author SHA1 Message Date
Paul Smith
f430a65ccb GNU Make release 4.3
* NEWS: Update for the release
* configure.ac: New release number
* doc/make.texi: New edition number
2020-01-19 17:04:52 -05:00
Paul Smith
c30da63fd2 * configure.ac (guile): Check for Guile 3.0 installations 2020-01-19 17:04:52 -05:00
Paul Smith
3fb7312e9f * src/job.c (sh_cmds): [SV 57625] Update builtin shell command list 2020-01-19 17:04:52 -05:00
Paul Smith
dd6adfa454 Resolve some documentation issues
* doc/make.texi (Interrupts): [SV 46193] Recommend defensive recipes
* doc/make.texi: [SV 49262] Clarify interaction of prerequisites and
non-terminal match-anything rules.
2020-01-19 17:04:52 -05:00
Paul Smith
3b5e47b2e2 [SV 40657] Reinstate old behavior for suffix rules with prereqs
POSIX says that suffix rules cannot have prerequisites, but after
making this change we observed a number of makefiles "in the wild"
that were relying on this behavior and failed.

For .POSIX: makefiles, obey POSIX.  Otherwise preserve the old
behavior.  However, generate a warning so users know this is a
problem.  In a future version we will change all behavior to be
POSIX-conforming.

* NEWS: describe the change
* src/rule.c (convert_to_pattern): If posix_pedantic don't make a
pattern rule if prereqs exist.  Otherwise show a warning.
* tests/scripts/features/suffixrules: Add tests for the new behavior
including .POSIX vs. non-.POSIX.
2020-01-19 17:04:52 -05:00
Dmitry Goncharov
4e277f6fbd * tests/test_driver.pl: Enhance error messages 2020-01-05 10:46:58 -05:00
Paul Smith
ec946d7e21 * doc/make.texi: Change the GFDL to an Appendix 2020-01-04 13:24:39 -05:00
Paul Smith
16d06006a4 * NEWS: Clarify authorship of new features. 2020-01-04 13:24:39 -05:00
Paul Smith
b774aebffa Enable compilation with C90 compilers
* configure.ac: Try compiling Guile headers: they don't work with C90.
* maintMakefile: Simplify config checks via target-specific variables.
* src/makeint.h: Use ATTRIBUTE rather than defining __attribute__,
as that causes compile issues with system headers.
(ENUM_BITFIELD): Don't use enum bitfields in ANSI mode.
* src/main.c: Use ATTRIBUTE instead of __attribute__.
* src/job.h: Ditto.
* src/file.c: Don't define variables inside for loops.
* src/rule.c: Ditto.
* src/dep.h (SI): Only use static inline in non-ANSI mode.
2020-01-04 13:23:23 -05:00
Paul Smith
06de697268 * bootstrap: Update to the latest gnulib version 2020-01-03 15:44:13 -05:00
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
141 changed files with 1393 additions and 669 deletions

1
.gitignore vendored
View File

@@ -30,6 +30,7 @@ configure
/mk/Posix.mk /mk/Posix.mk
stamp-h1 stamp-h1
.dirstamp .dirstamp
gnulib
# Build artifacts # Build artifacts
.deps/ .deps/

View File

@@ -68,12 +68,13 @@ Other contributors:
David Boyce <dsb@boyski.com> David Boyce <dsb@boyski.com>
Frank Heckenbach <f.heckenbach@fh-soft.de> Frank Heckenbach <f.heckenbach@fh-soft.de>
Kaz Kylheku <kaz@kylheku.com> Kaz Kylheku <kaz@kylheku.com>
Christof Warlich <cwarlich@gmx.de>
With suggestions/comments/bug reports from a cast of ... well ... With suggestions/comments/bug reports from a cast of ... well ...
hundreds, anyway :) 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. This file is part of GNU Make.
GNU Make is free software; you can redistribute it and/or modify it under the 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 # 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. # This file is part of GNU Make.
# #
# GNU Make is free software; you can redistribute it and/or modify it under # 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 # 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. # This file is part of GNU Make.
# #
# GNU Make is free software; you can redistribute it and/or modify it under # 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 # You should have received a copy of the GNU General Public License along with
# this program. If not, see <http://www.gnu.org/licenses/>. # this 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 ACLOCAL_AMFLAGS = -I m4
MAKE_HOST = @MAKE_HOST@ 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 \ test_FILES = tests/run_make_tests tests/run_make_tests.bat \
tests/run_make_tests.pl tests/test_driver.pl \ tests/run_make_tests.pl tests/test_driver.pl \
tests/config-flags.pm.in tests/config_flags_pm.com \ 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. # test/scripts are added via dist-hook below.
EXTRA_DIST = ChangeLog README build.sh build.cfg.in $(man_MANS) \ 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; \ rm -f tests/$$f; ln -s ../srctests/$$f tests; \
done; fi ;; \ done; fi ;; \
esac; \ esac; \
echo "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) ./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 \ else \
echo "Can't find a working Perl ($(PERL)); the test suite requires Perl."; \ echo "Can't find a working Perl ($(PERL)); the test suite requires Perl."; \
fi; \ fi; \

60
NEWS
View File

@@ -1,6 +1,6 @@
GNU make NEWS -*-indented-text-*- GNU make NEWS -*-indented-text-*-
History of user-visible changes. History of user-visible changes.
16 September 2019 19 January 2020
See the end of this file for copyrights and conditions. See the end of this file for copyrights and conditions.
@@ -9,11 +9,11 @@ which is contained in this distribution as the file doc/make.texi.
See the README file and the GNU make manual for instructions for See the README file and the GNU make manual for instructions for
reporting bugs. reporting bugs.
Version 4.2.91 (16 Sep 2019) Version 4.3 (19 Jan 2020)
A complete list of bugs fixed in this version is available here: A complete list of bugs fixed in this version is available here:
http://sv.gnu.org/bugs/index.php?group=make&report_id=111&fix_release_id=108&set=custom https://sv.gnu.org/bugs/index.php?group=make&report_id=111&fix_release_id=108&set=custom
* WARNING: Backward-incompatibility! * WARNING: Backward-incompatibility!
Number signs (#) appearing inside a macro reference or function invocation Number signs (#) appearing inside a macro reference or function invocation
@@ -35,18 +35,18 @@ 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 already contains some value. Similarly, appending an empty string does not
add a trailing space. add a trailing space.
* WARNING: Backward-incompatibility! * NOTE: Deprecated behavior.
On Linux, and any other systems that provide a /proc/loadavg with similar Contrary to the documentation, suffix rules with prerequisites are being
syntax, the -l/--load-average option will consult that file to determine how treated BOTH as simple targets AND as pattern rules. Further, the
many CPUs are busy at that moment and compare that value to the load value prerequisites are ignored by the pattern rules. POSIX specifies that in
requested. This allows usage such as "-j -lN" for N-processor systems order to be a suffix rule there can be no prerequisites defined. In this
without fear of overload during initial startup. release if POSIX mode is enabled then rules with prerequisites cannot be
Patch provided by Sven C. Dack <sven.c.dack@sky.com> suffix rules. If POSIX mode is not enabled then the previous behavior is
preserved (a pattern rule with no extra prerequisites is created) AND a
* WARNING: Backward-incompatibility! warning about this behavior is generated:
Contrary to the documentation, suffix rules with prerequisites were being warning: ignoring prerequisites on suffix rule definition
treated BOTH as simple targets AND as pattern rules. Behavior now matches The POSIX behavior will be adopted as the only behavior in a future release
the documentation, and pattern rules are no longer created in this case. of GNU make so please resolve any warnings.
* New feature: Grouped explicit targets * New feature: Grouped explicit targets
Pattern rules have always had the ability to generate multiple targets with Pattern rules have always had the ability to generate multiple targets with
@@ -56,13 +56,21 @@ 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. search for 'grouped-target' in the .FEATURES special variable.
Implementation contributed by Kaz Kylheku <kaz@kylheku.com> 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.
Implementation contributed by Christof Warlich <cwarlich@gmx.de>
* Makefiles can now specify the '-j' option in their MAKEFLAGS variable and * Makefiles can now specify the '-j' option in their MAKEFLAGS variable and
this will cause make to enable that parallelism mode. this will cause make to enable that parallelism mode.
* GNU make will now use posix_spawn() on systems where it is available. * GNU make will now use posix_spawn() on systems where it is available.
If you prefer to use fork/exec even on systems where posix_spawn() is If you prefer to use fork/exec even on systems where posix_spawn() is
present, you can use the --disable-posix-spawn option to configure. Aron present, you can use the --disable-posix-spawn option to configure.
Barath <baratharon@caesar.elte.hu> provided the basic implementation. Implementation contributed by Aron Barath <baratharon@caesar.elte.hu>
* Error messages printed when invoking non-existent commands have been cleaned * Error messages printed when invoking non-existent commands have been cleaned
up and made consistent. up and made consistent.
@@ -100,7 +108,7 @@ Version 4.2.1 (10 Jun 2016)
A complete list of bugs fixed in this version is available here: A complete list of bugs fixed in this version is available here:
http://sv.gnu.org/bugs/index.php?group=make&report_id=111&fix_release_id=107&set=custom https://sv.gnu.org/bugs/index.php?group=make&report_id=111&fix_release_id=107&set=custom
This release is a bug-fix release. This release is a bug-fix release.
@@ -109,7 +117,7 @@ Version 4.2 (22 May 2016)
A complete list of bugs fixed in this version is available here: A complete list of bugs fixed in this version is available here:
http://sv.gnu.org/bugs/index.php?group=make&report_id=111&fix_release_id=106&set=custom https://sv.gnu.org/bugs/index.php?group=make&report_id=111&fix_release_id=106&set=custom
* New variable: $(.SHELLSTATUS) is set to the exit status of the last != or * New variable: $(.SHELLSTATUS) is set to the exit status of the last != or
$(shell ...) function invoked in this instance of make. This will be "0" if $(shell ...) function invoked in this instance of make. This will be "0" if
@@ -148,7 +156,7 @@ Version 4.1 (05 Oct 2014)
A complete list of bugs fixed in this version is available here: A complete list of bugs fixed in this version is available here:
http://sv.gnu.org/bugs/index.php?group=make&report_id=111&fix_release_id=105&set=custom https://sv.gnu.org/bugs/index.php?group=make&report_id=111&fix_release_id=105&set=custom
* New variables: $(MAKE_TERMOUT) and $(MAKE_TERMERR) are set to non-empty * New variables: $(MAKE_TERMOUT) and $(MAKE_TERMERR) are set to non-empty
values if stdout or stderr, respectively, are believed to be writing to a values if stdout or stderr, respectively, are believed to be writing to a
@@ -196,7 +204,7 @@ Version 4.0 (09 Oct 2013)
A complete list of bugs fixed in this version is available here: A complete list of bugs fixed in this version is available here:
http://sv.gnu.org/bugs/index.php?group=make&report_id=111&fix_release_id=101&set=custom https://sv.gnu.org/bugs/index.php?group=make&report_id=111&fix_release_id=101&set=custom
* WARNING: Backward-incompatibility! * WARNING: Backward-incompatibility!
If .POSIX is specified, then make adheres to the POSIX backslash/newline If .POSIX is specified, then make adheres to the POSIX backslash/newline
@@ -300,7 +308,7 @@ Version 3.82 (28 Jul 2010)
A complete list of bugs fixed in this version is available here: A complete list of bugs fixed in this version is available here:
http://sv.gnu.org/bugs/index.php?group=make&report_id=111&fix_release_id=104&set=custom https://sv.gnu.org/bugs/index.php?group=make&report_id=111&fix_release_id=104&set=custom
* Compiling GNU make now requires a conforming ISO C 1989 compiler and * Compiling GNU make now requires a conforming ISO C 1989 compiler and
standard runtime library. standard runtime library.
@@ -465,7 +473,7 @@ Version 3.81 (01 Apr 2006)
might have caused the target to rebuild. Starting with the _next_ might have caused the target to rebuild. Starting with the _next_
release of GNU make, '$?' will contain all prerequisites that caused release of GNU make, '$?' will contain all prerequisites that caused
the target to be considered out of date. the target to be considered out of date.
See http://savannah.gnu.org/bugs/?16051 See https://savannah.gnu.org/bugs/?16051
* WARNING: Backward-incompatibility! * WARNING: Backward-incompatibility!
GNU make now implements a generic "second expansion" feature on the GNU make now implements a generic "second expansion" feature on the
@@ -589,7 +597,7 @@ Version 3.81 (01 Apr 2006)
A complete list of bugs fixed in this version is available here: A complete list of bugs fixed in this version is available here:
http://savannah.gnu.org/bugs/index.php?group=make&report_id=111&fix_release_id=103 https://savannah.gnu.org/bugs/index.php?group=make&report_id=111&fix_release_id=103
Version 3.80 (03 Oct 2002) Version 3.80 (03 Oct 2002)
@@ -707,7 +715,7 @@ Version 3.80 (03 Oct 2002)
A complete list of bugs fixed in this version is available here: A complete list of bugs fixed in this version is available here:
http://savannah.gnu.org/bugs/index.php?group=make&report_id=111&fix_release_id=102 https://savannah.gnu.org/bugs/index.php?group=make&report_id=111&fix_release_id=102
Version 3.79.1 (23 Jun 2000) Version 3.79.1 (23 Jun 2000)
@@ -1611,7 +1619,7 @@ Version 3.05
(Changes from versions 1 through 3.05 were never recorded. Sorry.) (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. This file is part of GNU Make.
GNU Make is free software; you can redistribute it and/or modify it under the 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. This file is part of GNU Make.
GNU Make is free software; you can redistribute it and/or modify it under the 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. This file is part of GNU Make.
GNU Make is free software; you can redistribute it and/or modify it under the 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. This file is part of GNU Make.
GNU Make is free software; you can redistribute it and/or modify it under the 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. 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. This file is part of GNU Make.
GNU Make is free software; you can redistribute it and/or modify it under the 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. This file is part of GNU Make.
GNU Make is free software; you can redistribute it and/or modify it under the GNU Make is free software; you can redistribute it and/or modify it under the

View File

@@ -1,7 +1,7 @@
-*-text-*- -*-text-*-
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2002-2019 Free Software Foundation, Inc. Copyright (C) 2002-2020 Free Software Foundation, Inc.
This file is part of GNU Make. This file is part of GNU Make.
GNU Make is free software; you can redistribute it and/or modify it under the 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) * GCC (Clang's GCC emulation is not sufficient)
* GNU make (POSIX make 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 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. a local installation of gnulib you can set GNULIB_SRCDIR to point to it.
@@ -166,16 +170,16 @@ run:
and, if you like: and, if you like:
$ make dist-bzip2 $ make dist-lzip
Even better, you should run this: Even better, you should run this:
$ make distcheck $ make distcheck
Which will build both .gz and .bz2 package files, then unpack them into Which will build both .gz and .lz package files, then unpack one into a
a temporary location, try to build them, and repack them, verifying that temporary location, try to build it and repack it, then verifying that
everything works, you get the same results, _and_ no extraneous files everything works, you get the same results, _and_ no extraneous files are
are left over after the "distclean" rule. left over after the "distclean" rule.
This package can be unpacked and built to give a "normal" (non-maintainer This package can be unpacked and built to give a "normal" (non-maintainer
mode) result. 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. This file is part of GNU Make.
GNU Make is free software; you can redistribute it and/or modify it under the 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. This file is part of GNU Make.
GNU Make is free software; you can redistribute it and/or modify it under the GNU Make is free software; you can redistribute it and/or modify it under the

View File

@@ -4,7 +4,7 @@ scriptversion=2019-01-04.17; # UTC
# Bootstrap this package from checked-out sources. # Bootstrap this package from checked-out sources.
# Copyright (C) 2003-2019 Free Software Foundation, Inc. # Copyright (C) 2003-2020 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by
@@ -162,18 +162,11 @@ bootstrap_post_import_hook() { :; }
# Override it via your own definition in bootstrap.conf. # Override it via your own definition in bootstrap.conf.
bootstrap_epilogue() { :; } bootstrap_epilogue() { :; }
# The command to download all .po files for a specified domain into # The command to download all .po files for a specified domain into a
# a specified directory. Fill in the first %s is the domain name, and # specified directory. Fill in the first %s with the destination
# the second with the destination directory. Use rsync's -L and -r # directory and the second with the domain name.
# options because the latest/%s directory and the .po files within are
# all symlinks.
po_download_command_format=\ po_download_command_format=\
"rsync --delete --exclude '*.s1' -Lrtvz \ "wget --mirror --level=1 -nd -nv -A.po -P '%s' \
'translationproject.org::tp/latest/%s/' '%s'"
# Fallback for downloading .po files (if rsync fails).
po_download_command_format2=\
"wget --mirror -nd -q -np -A.po -P '%s' \
https://translationproject.org/latest/%s/" https://translationproject.org/latest/%s/"
# Prefer a non-empty tarname (4th argument of AC_INIT if given), else # Prefer a non-empty tarname (4th argument of AC_INIT if given), else
@@ -741,10 +734,7 @@ download_po_files() {
subdir=$1 subdir=$1
domain=$2 domain=$2
echo "$me: getting translations into $subdir for $domain..." echo "$me: getting translations into $subdir for $domain..."
cmd=$(printf "$po_download_command_format" "$domain" "$subdir") cmd=$(printf "$po_download_command_format" "$subdir" "$domain")
eval "$cmd" && return
# Fallback to HTTPS.
cmd=$(printf "$po_download_command_format2" "$subdir" "$domain")
eval "$cmd" eval "$cmd"
} }

View File

@@ -1,5 +1,5 @@
@echo off @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. :: This file is part of GNU Make.
:: ::
:: GNU Make is free software; you can redistribute it and/or modify it under :: 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 goto :EOF
:Done :Done
echo Done. Run buld_w32.bat to build GNU make. echo Done. Run build_w32.bat to build GNU make.
goto :EOF goto :EOF

View File

@@ -1,6 +1,6 @@
# Bootstrap configuration. -*-shell-script-*- # 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 # 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 # 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. # Configuration for building GNU Make in the absence of any 'make' program.
# @configure_input@ # @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. # This file is part of GNU Make.
# #
# GNU Make is free software; you can redistribute it and/or modify it under # GNU Make is free software; you can redistribute it and/or modify it under

View File

@@ -1,7 +1,7 @@
#!/bin/sh #!/bin/sh
# Shell script to build GNU Make in the absence of any 'make' program. # 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. # This file is part of GNU Make.
# #
# GNU Make is free software; you can redistribute it and/or modify it under # GNU Make is free software; you can redistribute it and/or modify it under

View File

@@ -1,5 +1,5 @@
@echo off @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. :: This file is part of GNU Make.
:: ::
:: GNU Make is free software; you can redistribute it and/or modify it under :: GNU Make is free software; you can redistribute it and/or modify it under
@@ -258,6 +258,7 @@ exit 1
:Success :Success
echo %OUTDIR% build succeeded. echo %OUTDIR% build succeeded.
if exist Basic.mk copy /Y Basic.mk Makefile 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 call :Reset
goto :EOF goto :EOF

View File

@@ -1,5 +1,5 @@
@echo off @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 This file is part of GNU Make.
rem rem
rem GNU Make is free software; you can redistribute it and/or modify it under 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. # 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. # This file is part of GNU Make.
# #
# GNU Make is free software; you can redistribute it and/or modify it under # 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 # You should have received a copy of the GNU General Public License along with
# this program. If not, see <http://www.gnu.org/licenses/>. # this 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.3],[bug-make@gnu.org])
AC_PREREQ([2.69]) AC_PREREQ([2.69])
@@ -127,8 +127,8 @@ AC_CACHE_CHECK([for standard gettimeofday], [ac_cv_func_gettimeofday],
int main () int main ()
{ {
struct timeval t; t.tv_sec = -1; t.tv_usec = -1; struct timeval t; t.tv_sec = -1; t.tv_usec = -1;
exit (gettimeofday (&t, 0) != 0 return gettimeofday (&t, 0) != 0
|| t.tv_sec < 0 || t.tv_usec < 0); || t.tv_sec < 0 || t.tv_usec < 0;
}]])], }]])],
[ac_cv_func_gettimeofday=yes], [ac_cv_func_gettimeofday=yes],
[ac_cv_func_gettimeofday=no], [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]) [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 \ dup dup2 getcwd realpath sigsetmask sigaction \
getgroups seteuid setegid setlinebuf setreuid setregid \ getgroups seteuid setegid setlinebuf setreuid setregid \
getrlimit setrlimit setvbuf pipe strsignal \ getrlimit setrlimit setvbuf pipe strsignal \
@@ -176,7 +176,7 @@ AC_ARG_WITH([guile], [AS_HELP_STRING([--with-guile],
PKG_PROG_PKG_CONFIG PKG_PROG_PKG_CONFIG
AS_IF([test "x$with_guile" != xno], AS_IF([test "x$with_guile" != xno],
[ guile_versions="2.2 2.0 1.8" [ guile_versions="3.0 2.2 2.0 1.8"
guile_version=no guile_version=no
have_guile=no have_guile=no
AC_MSG_CHECKING([for GNU Guile]) AC_MSG_CHECKING([for GNU Guile])
@@ -184,13 +184,21 @@ AS_IF([test "x$with_guile" != xno],
PKG_CHECK_EXISTS([guile-$v], [guile_version=$v; have_guile=yes; break], []) PKG_CHECK_EXISTS([guile-$v], [guile_version=$v; have_guile=yes; break], [])
done done
AC_MSG_RESULT([$guile_version]) AC_MSG_RESULT([$guile_version])
if test "$have_guile" = yes; then AS_IF([test "$have_guile" = yes],
PKG_CHECK_MODULES(GUILE, [guile-$guile_version]) [ PKG_CHECK_MODULES(GUILE, [guile-$guile_version])
AC_DEFINE([HAVE_GUILE], [1], [Embed GNU Guile support]) # Unfortunately Guile requires a C99 compiler but GNU make doesn't, so
fi # verify we can actually compile the header.
keep_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS $pkg_cv_GUILE_CFLAGS"
AC_CHECK_HEADER([libguile.h],
[AC_DEFINE([HAVE_GUILE], [1], [Embed GNU Guile support])],
[have_guile=no],
[/* Avoid configuration error warnings. */])
CPPFLAGS="$keep_CPPFLAGS"
])
]) ])
AM_CONDITIONAL([HAVE_GUILE], [test "$have_guile" = yes]) AM_CONDITIONAL([HAVE_GUILE], [test "$have_guile" = "yes"])
AC_CHECK_DECLS([sys_siglist, _sys_siglist, __sys_siglist], , , AC_CHECK_DECLS([sys_siglist, _sys_siglist, __sys_siglist], , ,
[AC_INCLUDES_DEFAULT [AC_INCLUDES_DEFAULT
@@ -371,7 +379,28 @@ AC_ARG_ENABLE([posix-spawn],
AS_CASE([/$ac_cv_header_spawn/$ac_cv_func_posix_spawn/], AS_CASE([/$ac_cv_header_spawn/$ac_cv_func_posix_spawn/],
[*/no/*], [make_cv_posix_spawn=no]) [*/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], [*/no/*], [make_cv_posix_spawn=no],
[AC_DEFINE(USE_POSIX_SPAWN, 1, [Define to 1 to use posix_spawn().]) [AC_DEFINE(USE_POSIX_SPAWN, 1, [Define to 1 to use posix_spawn().])
]) ])

View File

@@ -1,5 +1,5 @@
# -*-Makefile-*-, or close enough # -*-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. # This file is part of GNU Make.
# #
# GNU Make is free software; you can redistribute it and/or modify it under # 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 Further updates contributed by Mike Frysinger. It has been reworked by Roland
McGrath. Maintained by Paul Smith. McGrath. Maintained by Paul Smith.
.SH "COPYRIGHT" .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 This file is part of
.IR "GNU make" . .IR "GNU make" .
.LP .LP

View File

@@ -3,7 +3,7 @@
@setfilename make.info @setfilename make.info
@include version.texi @include version.texi
@set EDITION 0.74 @set EDITION 0.75
@settitle GNU @code{make} @settitle GNU @code{make}
@setchapternewpage odd @setchapternewpage odd
@@ -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, Copyright @copyright{} 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995,
1996, 1997, 1998, 1999, 2000, 2002, 2003, 2004, 2005, 2006, 2007, 1996, 1997, 1998, 1999, 2000, 2002, 2003, 2004, 2005, 2006, 2007,
2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019,
Free Software Foundation, Inc. 2020 Free Software Foundation, Inc.
@quotation @quotation
Permission is granted to copy, distribute and/or modify this document 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 reading makefiles
@cindex makefile, reading @cindex makefile, reading
GNU @code{make} does its work in two distinct phases. During the first GNU @code{make} does its work in two distinct phases. During the
phase it reads all the makefiles, included makefiles, etc. and first phase it reads all the makefiles, included makefiles, etc. and
internalizes all the variables and their values, implicit and explicit internalizes all the variables and their values and implicit and
rules, and constructs a dependency graph of all the targets and their explicit rules, and builds a dependency graph of all the targets and
prerequisites. During the second phase, @code{make} uses these internal their prerequisites. During the second phase, @code{make} uses this
structures to determine what targets will need to be rebuilt and to internalized data to determine which targets need to be updated and
invoke the rules necessary to do so. run the recipes necessary to update them.
It's important to understand this two-phase approach because it has a It's important to understand this two-phase approach because it has a
direct impact on how variable and function expansion happens; this is direct impact on how variable and function expansion happens; this is
often a source of some confusion when writing makefiles. Here we will often a source of some confusion when writing makefiles. Below is a
present a summary of the phases in which expansion happens for different summary of the different constructs that can be found in a makefile,
constructs within the makefile. We say that expansion is and the phase in which expansion happens for each part of the
@dfn{immediate} if it happens during the first phase: in this case construct.
@code{make} will expand any variables or functions in that section of a
construct as the makefile is parsed. We say that expansion is We say that expansion is @dfn{immediate} if it happens during the
@dfn{deferred} if expansion is not performed immediately. Expansion of first phase: @code{make} will expand that part of the construct as the
a deferred construct is not performed until either the construct appears makefile is parsed. We say that expansion is @dfn{deferred} if it is
later in an immediate context, or until the second phase. 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 You may not be familiar with some of these constructs yet. You can
reference this section as you become familiar with them, in later reference this section as you become familiar with them, in later
@@ -1540,14 +1542,14 @@ define @var{immediate} !=
endef endef
@end example @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 immediate if the variable was previously set as a simple variable
(@samp{:=} or @samp{::=}), and deferred otherwise. (@samp{:=} or @samp{::=}), and deferred otherwise.
For the shell assignment operator, @samp{!=}, the right-hand side is For the shell assignment operator @samp{!=}, the right-hand side is
evaluated immediately and handed to the shell. The result is stored in the evaluated immediately and handed to the shell. The result is stored
variable named on the left, and that variable becomes a simple variable in the variable named on the left, and that variable becomes a simple
(and will thus be re-evaluated on each reference). variable (and will thus be re-evaluated on each reference).
@subheading Conditional Directives @subheading Conditional Directives
@cindex ifdef, expansion @cindex ifdef, expansion
@@ -1576,10 +1578,10 @@ A rule is always expanded the same way, regardless of the form:
@var{deferred} @var{deferred}
@end example @end example
That is, the target and prerequisite sections are expanded immediately, That is, the target and prerequisite sections are expanded
and the recipe used to construct the target is always deferred. This immediately, and the recipe used to build the target is always
general rule is true for explicit rules, pattern rules, suffix rules, deferred. This is true for explicit rules, pattern rules, suffix
static pattern rules, and simple prerequisite definitions. rules, static pattern rules, and simple prerequisite definitions.
@node Parsing Makefiles, Secondary Expansion, Reading Makefiles, Makefiles @node Parsing Makefiles, Secondary Expansion, Reading Makefiles, Makefiles
@section How Makefiles Are Parsed @section How Makefiles Are Parsed
@@ -1930,8 +1932,8 @@ more recent than it.
@item @item
How to update the file @file{foo.o}: by running @code{cc} as stated. How to update the file @file{foo.o}: by running @code{cc} as stated.
The recipe does not explicitly mention @file{defs.h}, but we presume The recipe does not explicitly mention @file{defs.h}, but we presume
that @file{foo.c} includes it, and that that is why @file{defs.h} was that @file{foo.c} includes it, and that is why @file{defs.h} was added
added to the prerequisites. to the prerequisites.
@end itemize @end itemize
@end ifnottex @end ifnottex
@@ -4531,6 +4533,19 @@ target is updated in some atomic fashion, or exists only to record a
modification-time (its contents do not matter), or must exist at all modification-time (its contents do not matter), or must exist at all
times to prevent other sorts of trouble. times to prevent other sorts of trouble.
Although @code{make} does its best to clean up there are certain situations
in which cleanup is impossible. For example, @code{make} may be killed by
an uncatchable signal. Or, one of the programs make invokes may be killed
or crash, leaving behind an up-to-date but corrupt target file: @code{make}
will not realize that this failure requires the target to be cleaned. Or
@code{make} itself may encounter a bug and crash.
For these reasons it's best to write @emph{defensive recipes}, which won't
leave behind corrupted targets even if they fail. Most commonly these
recipes create temporary files rather than updating the target directly,
then rename the temporary file to the final target name. Some compilers
already behave this way, so that you don't need to write a defensive recipe.
@node Recursion, Canned Recipes, Interrupts, Recipes @node Recursion, Canned Recipes, Interrupts, Recipes
@section Recursive Use of @code{make} @section Recursive Use of @code{make}
@cindex recursion @cindex recursion
@@ -6629,6 +6644,57 @@ Supports dynamically loadable objects for creating custom extensions.
Expands to a list of directories that @code{make} searches for Expands to a list of directories that @code{make} searches for
included makefiles (@pxref{Include, , Including Other Makefiles}). 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 @end table
@node Conditionals, Functions, Using Variables, Top @node Conditionals, Functions, Using Variables, Top
@@ -9865,6 +9931,10 @@ and linking with a single @code{cc} command. The optimized rule is used in
preference to the step-by-step chain because it comes earlier in the preference to the step-by-step chain because it comes earlier in the
ordering of rules. ordering of rules.
Finally, for performance reasons @code{make} will not consider non-terminal
match-anything rules (i.e., @samp{%:}) when searching for a rule to
build a prerequisite of an implicit rule (@pxref{Match-Anything Rules}).
@node Pattern Rules, Last Resort, Chained Rules, Implicit Rules @node Pattern Rules, Last Resort, Chained Rules, Implicit Rules
@section Defining and Redefining Pattern Rules @section Defining and Redefining Pattern Rules
@@ -10354,9 +10424,10 @@ remade from any other files; therefore, @code{make} can save time by not
looking for ways to remake them.@refill looking for ways to remake them.@refill
If you do not mark the match-anything rule as terminal, then it is If you do not mark the match-anything rule as terminal, then it is
non-terminal. A non-terminal match-anything rule cannot apply to a file name non-terminal. A non-terminal match-anything rule cannot apply to a
that indicates a specific type of data. A file name indicates a specific prerequisite of an implicit rule, or to a file name that indicates a
type of data if some non-match-anything implicit rule target matches it. specific type of data. A file name indicates a specific type of data
if some non-match-anything implicit rule target matches it.
For example, the file name @file{foo.c} matches the target for the pattern For example, the file name @file{foo.c} matches the target for the pattern
rule @samp{%.c : %.y} (the rule to run Yacc). Regardless of whether this rule @samp{%.c : %.y} (the rule to run Yacc). Regardless of whether this
@@ -10593,8 +10664,9 @@ Make a list of all the pattern rules one of whose targets matches
matched against @var{t}; otherwise, against @var{n}. matched against @var{t}; otherwise, against @var{n}.
@item @item
If any rule in that list is @emph{not} a match-anything rule, then If any rule in that list is @emph{not} a match-anything rule, or if
remove all non-terminal match-anything rules from the list. @var{t} is a prerequisite of an implicit rule, then remove all
non-terminal match-anything rules from the list.
@item @item
Remove from the list all rules with no recipe. Remove from the list all rules with no recipe.
@@ -12678,6 +12750,18 @@ receive only part of the information necessary. In this case, the child
will generate this warning message and proceed with its build in a will generate this warning message and proceed with its build in a
sequential manner. sequential manner.
@item warning: ignoring prerequisites on suffix rule definition
According to POSIX, a suffix rule cannot contain prerequisites. If a rule
that could be a suffix rule has prerequisites it is interpreted as a simple
explicit rule, with an odd target name. This requirement is obeyed when
POSIX-conforming mode is enabled (the @code{.POSIX} target is defined). In
versions of GNU @code{make} prior to 4.3, no warning was emitted and a
suffix rule was created, however all prerequisites were ignored and were not
part of the suffix rule. Starting with GNU @code{make} 4.3 the behavior is
the same, and in addition this warning is generated. In a future version
the POSIX-conforming behavior will be the only behavior: no rule with a
prerequisite can be suffix rule and this warning will be removed.
@end table @end table
@node Complex Makefile, GNU Free Documentation License, Error Messages, Top @node Complex Makefile, GNU Free Documentation License, Error Messages, Top
@@ -12960,7 +13044,7 @@ tar.zoo: $(SRCS) $(AUX)
@end example @end example
@node GNU Free Documentation License, Concept Index, Complex Makefile, Top @node GNU Free Documentation License, Concept Index, Complex Makefile, Top
@appendixsec GNU Free Documentation License @appendix GNU Free Documentation License
@cindex FDL, GNU Free Documentation License @cindex FDL, GNU Free Documentation License
@include fdl.texi @include fdl.texi

View File

@@ -1,7 +1,7 @@
dnl acinclude.m4 -- Extra macros needed for GNU make. dnl acinclude.m4 -- Extra macros needed for GNU make.
dnl dnl
dnl Automake will incorporate this into its generated aclocal.m4. 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 This file is part of GNU Make.
dnl dnl
dnl GNU Make is free software; you can redistribute it and/or modify it under 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) # 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. # 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. # This file is part of GNU Make.
# #
# GNU Make is free software; you can redistribute it and/or modify it under # 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 # Where to put the CVS checkout of the GNU make web repository
MAKEWEBDIR ?= $(SRCROOTDIR)/make/make-web MAKEWEBDIR ?= $(SRCROOTDIR)/make/make-web
# Enable Perl warnings for the test suite
PERLFLAGS := -w
# We like mondo-warnings! # We like mondo-warnings!
# Also force comments to be preserved. This helps when using ccache, in # Also force comments to be preserved. This helps when using ccache, in
# combination with GCC 7's implicit-fallthrough warning. # combination with GCC 7's implicit-fallthrough warning.
@@ -228,15 +231,36 @@ get-doc/make-stds.texi get-doc/fdl.texi:
# Alternative configuration checks. # # Alternative configuration checks. #
# ---------------------------------- # # ---------------------------------- #
CFGCHECK_CONFIGFLAGS =
CFGCHECK_BUILDFLAGS =
CFGCHECK_MAKEFLAGS = CFLAGS='$(AM_CFLAGS)'
checkcfg.strict-c90: CFGCHECK_CONFIGFLAGS = CFLAGS='-std=c90 -pedantic'
checkcfg.strict-c90: CFGCHECK_MAKEFLAGS =
checkcfg.no-jobserver:CFGCHECK_CONFIGFLAGS = --disable-job-server
checkcfg.no-load: CFGCHECK_CONFIGFLAGS = --disable-load
checkcfg.no-guile: CFGCHECK_CONFIGFLAGS = --without-guile
checkcfg.no-spawn: CFGCHECK_CONFIGFLAGS = --disable-posix-spawn
checkcfg.no-sysglob: CFGCHECK_CONFIGFLAGS = make_cv_sys_gnu_glob=no
checkcfg.no-loadavg: CFGCHECK_CONFIGFLAGS = ac_cv_func_getloadavg=no \
ac_cv_have_decl_getloadavg=no \
gl_cv_have_raw_decl_getloadavg=no \
ac_cv_lib_util_getloadavg=no \
ac_cv_lib_getloadavg_getloadavg=no
checkcfg.no-sync: CFGCHECK_CONFIGFLAGS = CPPFLAGS=-DNO_OUTPUT_SYNC
checkcfg.no-archives: CFGCHECK_CONFIGFLAGS = CPPFLAGS=-DNO_ARCHIVES
CONFIG_CHECKS := \ CONFIG_CHECKS := \
checkcfg.--disable-job-server \ checkcfg.strict-c90 \
checkcfg.--disable-load \ checkcfg.no-jobserver \
checkcfg.--without-guile \ checkcfg.no-load \
checkcfg.--disable-posix-spawn \ checkcfg.no-guile \
checkcfg.make_cv_sys_gnu_glob^no \ checkcfg.no-spawn \
checkcfg.ac_cv_func_getloadavg^no+ac_cv_have_decl_getloadavg^no+gl_cv_have_raw_decl_getloadavg^no+ac_cv_lib_util_getloadavg^no+ac_cv_lib_getloadavg_getloadavg^no \ checkcfg.no-sysglob \
checkcfg.CPPFLAGS^-DNO_OUTPUT_SYNC \ checkcfg.no-loadavg \
checkcfg.CPPFLAGS^-DNO_ARCHIVES checkcfg.no-sync \
checkcfg.no-archives
.PHONY: check-alt-config .PHONY: check-alt-config
check-alt-config: $(CONFIG_CHECKS) check-alt-config: $(CONFIG_CHECKS)
@@ -248,20 +272,20 @@ NR_MAKE = $(MAKE)
$(CONFIG_CHECKS): checkcfg.%: distdir $(CONFIG_CHECKS): checkcfg.%: distdir
@echo "Building $@ (output in checkcfg.$*.log)" @echo "Building $@ (output in checkcfg.$*.log)"
exec >'checkcfg.$*.log' 2>&1; \ exec >'checkcfg.$*.log' 2>&1; \
echo "Testing configure with $(subst ^,=,$(subst +, ,$*))"; set -x; \ echo "Testing configure with $(CFGCHECK_CONFIGFLAGS)"; set -x; \
rm -rf $(distdir)/_build \ rm -rf $(distdir)/_build \
&& mkdir $(distdir)/_build \ && mkdir $(distdir)/_build \
&& cd $(distdir)/_build \ && cd $(distdir)/_build \
&& ../configure --srcdir=.. $(subst ^,=,$(subst +, ,$*)) \ && ../configure --srcdir=.. $(CFGCHECK_CONFIGFLAGS) \
$(AM_DISTCHECK_CONFIGURE_FLAGS) $(DISTCHECK_CONFIGURE_FLAGS) $(AM_DISTCHECK_CONFIGURE_FLAGS) $(DISTCHECK_CONFIGURE_FLAGS)
exec >>'checkcfg.$*.log' 2>&1; set -x; \ exec >>'checkcfg.$*.log' 2>&1; set -x; \
cd $(distdir)/_build \ cd $(distdir)/_build \
&& OUTDIR=_bld ../build.sh \ && OUTDIR=_bld ../build.sh $(CFGCHECK_BUILD_FLAGS) \
&& _bld/make $(AM_MAKEFLAGS) check-local \ && _bld/make $(AM_MAKEFLAGS) check-local \
&& _bld/make $(AM_MAKEFLAGS) clean && _bld/make $(AM_MAKEFLAGS) clean
exec >>'checkcfg.$*.log' 2>&1; set -x; \ exec >>'checkcfg.$*.log' 2>&1; set -x; \
cd $(distdir)/_build \ cd $(distdir)/_build \
&& $(NR_MAKE) $(AM_MAKEFLAGS) CFLAGS='$(AM_CFLAGS)' \ && $(NR_MAKE) $(AM_MAKEFLAGS) $(CFGCHECK_MAKEFLAGS) \
&& ./make $(AM_MAKEFLAGS) check \ && ./make $(AM_MAKEFLAGS) check \
&& ./make $(AM_MAKEFLAGS) clean && ./make $(AM_MAKEFLAGS) clean
@@ -480,7 +504,7 @@ $(UPLOADS): $(DIST_ARCHIVES) $(DIST_ARCHIVES_SIG) $(DIST_ARCHIVES_DIRECTIVE)
# Rebuild Makefile.in if this file is modifed. # Rebuild Makefile.in if this file is modifed.
Makefile.in: maintMakefile 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. # This file is part of GNU Make.
# #
# GNU Make is free software; you can redistribute it and/or modify it under # GNU Make is free software; you can redistribute it and/or modify it under

View File

@@ -154,7 +154,7 @@ $ exit
$ endsubroutine : compileit $ 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. $!This file is part of GNU Make.
$! $!
$!GNU Make is free software; you can redistribute it and/or modify it under $!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. # 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. # This file is part of GNU Make.
# #
# GNU Make is free software; you can redistribute it and/or modify it under # 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. # 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. # This file is part of GNU Make.
# #
# GNU Make is free software; you can redistribute it and/or modify it under # 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. # 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. # This file is part of GNU Make.
# #
# GNU Make is free software; you can redistribute it and/or modify it under # 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. # 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. # This file is part of GNU Make.
# #
# GNU Make is free software; you can redistribute it and/or modify it under # 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. # 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. # This file is part of GNU Make.
# #
# GNU Make is free software; you can redistribute it and/or modify it under # 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. # 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. # This file is part of GNU Make.
# #
# GNU Make is free software; you can redistribute it and/or modify it under # GNU Make is free software; you can redistribute it and/or modify it under

View File

@@ -1,6 +1,6 @@
#!/bin/sh #!/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. # This file is part of GNU Make.
# #
# Update GNU make copyrights using gnulib update-copyright # Update GNU make copyrights using gnulib update-copyright

View File

@@ -1,5 +1,5 @@
/* Running commands on Amiga /* 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. This file is part of GNU Make.
GNU Make is free software; you can redistribute it and/or modify it under the 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 /* 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. This file is part of GNU Make.
GNU Make is free software; you can redistribute it and/or modify it under the 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. /* 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. This file is part of GNU Make.

View File

@@ -1,5 +1,5 @@
/* Library function for scanning an archive file. /* 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. This file is part of GNU Make.
GNU Make is free software; you can redistribute it and/or modify it under the 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 #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)); eltsize = atol (TOCHAR (member_header.ar_size));
#else /* Xenix. */ #else /* Xenix. */
eltmode = (unsigned short int) member_header.ar_mode; eltmode = (unsigned short int) member_header.ar_mode;

View File

@@ -1,5 +1,5 @@
/* Command processing for GNU Make. /* 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. This file is part of GNU Make.
GNU Make is free software; you can redistribute it and/or modify it under the 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. */ /* $< is the first not order-only dependency. */
less = ""; less = "";
for (d = file->deps; d != 0; d = d->next) 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) if (!d->need_2nd_expansion)
less = dep_name (d); less = dep_name (d);
@@ -178,7 +178,7 @@ set_file_variables (struct file *file)
bar_len = 0; bar_len = 0;
for (d = file->deps; d != 0; d = d->next) 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) if (d->ignore_mtime)
bar_len += strlen (dep_name (d)) + 1; 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. */ qmark_len = plus_len + 1; /* Will be this or less. */
for (d = file->deps; d != 0; d = d->next) 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); 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) for (d = file->deps; d != 0; d = d->next)
{ {
if (d->need_2nd_expansion) if (d->need_2nd_expansion || d->ignore_automatic_vars)
continue; continue;
slot = hash_find_slot (&dep_hash, d); slot = hash_find_slot (&dep_hash, d);
@@ -269,7 +269,7 @@ set_file_variables (struct file *file)
{ {
const char *c; 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; continue;
c = dep_name (d); c = dep_name (d);

View File

@@ -1,5 +1,5 @@
/* Definition of data structures describing shell commands for GNU Make. /* 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. This file is part of GNU Make.
GNU Make is free software; you can redistribute it and/or modify it under the 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-*- /* 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. This file is part of GNU Make.
GNU Make is free software; you can redistribute it and/or modify it under the 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-*- /* 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. This file is part of GNU Make.
GNU Make is free software; you can redistribute it and/or modify it under the 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-*- /* 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. This file is part of GNU Make.
GNU Make is free software; you can redistribute it and/or modify it under the 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 */ /* #undef HAVE_STRSIGNAL */
/* Define to 1 if `d_type' is a member of `struct dirent'. */ /* Define to 1 if `d_type' is a member of `struct dirent'. */
/* SV 57152: MinGW64 version of dirent doesn't support d_type. */
#ifndef __MINGW64__
# define HAVE_STRUCT_DIRENT_D_TYPE 1 # define HAVE_STRUCT_DIRENT_D_TYPE 1
#endif
/* Define to 1 if you have the `isatty' function. */ /* Define to 1 if you have the `isatty' function. */
#define HAVE_ISATTY 1 #define HAVE_ISATTY 1

View File

@@ -1,6 +1,6 @@
/* configh.dos -- hand-massaged config.h file for MS-DOS builds -*-C-*- /* 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. This file is part of GNU Make.
GNU Make is free software; you can redistribute it and/or modify it under the 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. /* 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. This file is part of GNU Make.
GNU Make is free software; you can redistribute it and/or modify it under the 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. /* 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. This file is part of GNU Make.
GNU Make is free software; you can redistribute it and/or modify it under the 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. /* 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. This file is part of GNU Make.
GNU Make is free software; you can redistribute it and/or modify it under the 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 changed : 1; \
unsigned int ignore_mtime : 1; \ unsigned int ignore_mtime : 1; \
unsigned int staticpattern : 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 struct dep
{ {
@@ -74,6 +75,7 @@ struct goaldep
#define PARSEFS_NOGLOB 0x0004 #define PARSEFS_NOGLOB 0x0004
#define PARSEFS_EXISTS 0x0008 #define PARSEFS_EXISTS 0x0008
#define PARSEFS_NOCACHE 0x0010 #define PARSEFS_NOCACHE 0x0010
#define PARSEFS_ONEWORD 0x0020
#define PARSE_FILE_SEQ(_s,_t,_c,_p,_f) \ #define PARSE_FILE_SEQ(_s,_t,_c,_p,_f) \
(_t *)parse_file_seq ((_s),sizeof (_t),(_c),(_p),(_f)) (_t *)parse_file_seq ((_s),sizeof (_t),(_c),(_p),(_f))
@@ -98,7 +100,7 @@ struct nameseq *ar_glob (const char *arname, const char *member_pattern, size_t
#define alloc_seq_elt(_t) xcalloc (sizeof (_t)) #define alloc_seq_elt(_t) xcalloc (sizeof (_t))
void free_ns_chain (struct nameseq *n); void free_ns_chain (struct nameseq *n);
#if defined(MAKE_MAINTAINER_MODE) && defined(__GNUC__) #if defined(MAKE_MAINTAINER_MODE) && defined(__GNUC__) && !defined(__STRICT_ANSI__)
/* Use inline to get real type-checking. */ /* Use inline to get real type-checking. */
#define SI static inline #define SI static inline
SI struct nameseq *alloc_ns() { return alloc_seq_elt (struct nameseq); } SI struct nameseq *alloc_ns() { return alloc_seq_elt (struct nameseq); }

View File

@@ -1,5 +1,5 @@
/* Directory hashing for GNU Make. /* 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. This file is part of GNU Make.
GNU Make is free software; you can redistribute it and/or modify it under the 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. /* 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. This file is part of GNU Make.
GNU Make is free software; you can redistribute it and/or modify it under the 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. /* 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. This file is part of GNU Make.
GNU Make is free software; you can redistribute it and/or modify it under the 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; 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. */ /* Expand and parse each dependency line. */
static void static void
expand_deps (struct file *f) expand_deps (struct file *f)
@@ -644,13 +635,70 @@ 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 *d;
struct dep *prereqs = extra ? split_prereqs (variable_expand (extra->value)) : NULL;
for (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 static void
reset_updating (const void *item) snap_file (const void *item, void *arg)
{ {
struct file *f = (struct file*)item; 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; 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 /* For each dependency of each file, make the 'struct dep' point
@@ -700,9 +748,6 @@ snap_deps (void)
expand_deps (f); expand_deps (f);
free (file_slot_0); 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. */ /* Now manage all the special targets. */
@@ -744,10 +789,7 @@ snap_deps (void)
f2->intermediate = f2->secondary = 1; f2->intermediate = f2->secondary = 1;
/* .SECONDARY with no deps listed marks *all* files that way. */ /* .SECONDARY with no deps listed marks *all* files that way. */
else else
{
all_secondary = 1; all_secondary = 1;
hash_map (&files, set_intermediate);
}
f = lookup_file (".EXPORT_ALL_VARIABLES"); f = lookup_file (".EXPORT_ALL_VARIABLES");
if (f != 0 && f->is_target) if (f != 0 && f->is_target)
@@ -779,6 +821,15 @@ snap_deps (void)
if (f != 0 && f->is_target) if (f != 0 && f->is_target)
not_parallel = 1; 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 #ifndef NO_MINUS_C_MINUS_O
/* If .POSIX was defined, remove OUTPUT_OPTION to comply. */ /* If .POSIX was defined, remove OUTPUT_OPTION to comply. */
/* This needs more work: what if the user sets this in the makefile? /* 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. /* 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. This file is part of GNU Make.
GNU Make is free software; you can redistribute it and/or modify it under the 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" #include "hash.h"
struct commands;
struct dep;
struct variable;
struct variable_set_list;
struct file struct file
{ {
const char *name; const char *name;
@@ -110,6 +115,7 @@ struct file *lookup_file (const char *name);
struct file *enter_file (const char *name); struct file *enter_file (const char *name);
struct dep *split_prereqs (char *prereqstr); struct dep *split_prereqs (char *prereqstr);
struct dep *enter_prereqs (struct dep *prereqs, const char *stem); 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 remove_intermediates (int sig);
void snap_deps (void); void snap_deps (void);
void rename_file (struct file *file, const char *name); void rename_file (struct file *file, const char *name);

View File

@@ -1,5 +1,5 @@
/* Builtin function expansion for GNU Make. /* 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. This file is part of GNU Make.
GNU Make is free software; you can redistribute it and/or modify it under the 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 #ifdef HAVE_REALPATH
ENULLLOOP (rp, realpath (in, out)); 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 #else
rp = abspath (in, out); rp = abspath (in, out);
#endif #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 "Keep this file name-space clean" means, talk to drepper@gnu.org
before changing it! 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. NOTE: The canonical source of this file is maintained with the GNU C Library.
Bugs can be reported to bug-glibc@gnu.org. Bugs can be reported to bug-glibc@gnu.org.

View File

@@ -1,5 +1,5 @@
/* Declarations for getopt. /* 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. NOTE: The canonical source of this file is maintained with the GNU C Library.
Bugs can be reported to bug-glibc@gnu.org. 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. /* 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. NOTE: The canonical source of this file is maintained with the GNU C Library.
Bugs can be reported to bug-glibc@gnu.org. Bugs can be reported to bug-glibc@gnu.org.

View File

@@ -1,5 +1,5 @@
/* Convenience header for conditional use of GNU <libintl.h>. /* 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. This file is part of GNU Make.
GNU Make is free software; you can redistribute it and/or modify it under the 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 ;; 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. ;; This file is part of GNU Make.
;; ;;
;; GNU Make is free software; you can redistribute it and/or modify it under ;; 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. /* External interfaces usable by dynamic objects loaded into GNU Make.
--THIS API IS A "TECHNOLOGY PREVIEW" ONLY. IT IS NOT A STABLE INTERFACE-- --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. This file is part of GNU Make.
GNU Make is free software; you can redistribute it and/or modify it under the 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. /* 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. This file is part of GNU Make.
GNU Make is free software; you can redistribute it and/or modify it under the 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 "makeint.h"
#include "hash.h" #include "hash.h"
#include <assert.h>
#define CALLOC(t, n) ((t *) xcalloc (sizeof (t) * (n))) #define CALLOC(t, n) ((t *) xcalloc (sizeof (t) * (n)))
#define MALLOC(t, n) ((t *) xmalloc (sizeof (t) * (n))) #define MALLOC(t, n) ((t *) xmalloc (sizeof (t) * (n)))
@@ -364,7 +365,8 @@ round_up_2 (unsigned long n)
r += val; \ r += val; \
} while(0); } while(0);
unsigned jhash(unsigned const char *k, int length) unsigned int
jhash(unsigned const char *k, int length)
{ {
unsigned int a, b, c; unsigned int a, b, c;
@@ -408,12 +410,16 @@ unsigned jhash(unsigned const char *k, int length)
return c; return c;
} }
#define UINTSZ sizeof (unsigned int)
#ifdef WORDS_BIGENDIAN #ifdef WORDS_BIGENDIAN
/* The ifs are ordered from the first byte in memory to the last. */ /* 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 { \ do { \
unsigned int val; \ unsigned int val = 0; \
memcpy(&val, (p), 4); \ size_t pn = (plen); \
size_t n = pn < UINTSZ ? pn : UINTSZ; \
memcpy (&val, (p), n); \
if ((val & 0xFF000000) == 0) \ if ((val & 0xFF000000) == 0) \
flag = 1; \ flag = 1; \
else if ((val & 0xFF0000) == 0) \ 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 /* 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 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. */ big endian case, 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 { \ do { \
unsigned int val; \ unsigned int val = 0; \
unsigned int zeroes; \ size_t pn = (plen); \
memcpy(&val, (p), 4); \ size_t n = pn < UINTSZ ? pn : UINTSZ; \
zeroes = ((val - 0x01010101) & ~val); \ memcpy (&val, (p), n); \
if (!(zeroes & 0x80808080)) \ flag = ((val - 0x01010101) & ~val) & 0x80808080; \
if (!flag) \
r += val; \ r += val; \
else if ((val & 0xFF) == 0) \ else if (val & 0xFF) \
flag = 1; \ { \
else if ((val & 0xFF00) == 0) \ if ((val & 0xFF00) == 0) \
r += val & 0xFF, flag = 1; \ r += val & 0xFF; \
else if ((val & 0xFF0000) == 0) \ else if ((val & 0xFF0000) == 0) \
r += val & 0xFFFF, flag = 1; \ r += val & 0xFFFF; \
else \ else \
r += val, flag = 1; \ r += val; \
} \
} while (0) } while (0)
#endif #endif
/* This function performs magic which is correct but causes ASAN heartburn unsigned int
when we pass in a global constant string (at least). */ jhash_string(unsigned const char *k)
__attribute__((no_sanitize_address))
unsigned jhash_string(unsigned const char *k)
{ {
unsigned int a, b, c; unsigned int a, b, c;
unsigned int have_nul = 0; unsigned int have_nul = 0;
unsigned const char *start = k; unsigned const char *start = k;
size_t klen = strlen ((const char*)k);
/* Set up the internal state */ /* Set up the internal state */
a = b = c = JHASH_INITVAL; a = b = c = JHASH_INITVAL;
/* All but the last block: affect some 32 bits of (a,b,c) */ /* All but the last block: affect some 32 bits of (a,b,c) */
for (;;) { for (;;) {
sum_up_to_nul(a, k, have_nul); sum_up_to_nul(a, k, klen, have_nul);
if (have_nul) if (have_nul)
break; break;
k += 4; k += UINTSZ;
sum_up_to_nul(b, k, have_nul); assert (klen >= UINTSZ);
klen -= UINTSZ;
sum_up_to_nul(b, k, klen, have_nul);
if (have_nul) if (have_nul)
break; break;
k += 4; k += UINTSZ;
sum_up_to_nul(c, k, have_nul); assert (klen >= UINTSZ);
klen -= UINTSZ;
sum_up_to_nul(c, k, klen, have_nul);
if (have_nul) if (have_nul)
break; break;
k += 4; k += UINTSZ;
assert (klen >= UINTSZ);
klen -= UINTSZ;
jhash_mix(a, b, c); jhash_mix(a, b, c);
} }

View File

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

View File

@@ -1,5 +1,5 @@
/* Job execution and handling for GNU Make. /* 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. This file is part of GNU Make.
GNU Make is free software; you can redistribute it and/or modify it under the 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>"); nm = _("<builtin>");
else 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); 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; nm = a;
} }
@@ -1073,11 +1070,11 @@ reap_children (int block, int err)
{ {
DB (DB_JOBS, (_("Removing child %p PID %s%s from chain.\n"), DB (DB_JOBS, (_("Removing child %p PID %s%s from chain.\n"),
c, pid2str (c->pid), c->remote ? _(" (remote)") : "")); c, pid2str (c->pid), c->remote ? _(" (remote)") : ""));
}
/* There is now another slot open. */ /* There is now another slot open. */
if (job_slots_used > 0) if (job_slots_used > 0)
--job_slots_used; job_slots_used -= c->jobslot;
}
/* Remove the child from the chain and free it. */ /* Remove the child from the chain and free it. */
if (lastc == 0) if (lastc == 0)
@@ -1647,6 +1644,8 @@ start_waiting_job (struct child *c)
c->remote ? _(" (remote)") : "")); c->remote ? _(" (remote)") : ""));
/* One more job slot is in use. */ /* One more job slot is in use. */
++job_slots_used; ++job_slots_used;
assert (c->jobslot == 0);
c->jobslot = 1;
} }
children = c; children = c;
unblock_sigs (); unblock_sigs ();
@@ -2009,7 +2008,18 @@ load_too_high (void)
#else #else
static double last_sec; static double last_sec;
static time_t last_now; 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; double load, guess;
time_t now; time_t now;
@@ -2397,7 +2407,7 @@ child_execute_job (struct childbase *child, int good_stdin, char **argv)
for (pp = argv; *pp != NULL; ++pp) for (pp = argv; *pp != NULL; ++pp)
++l; ++l;
nargv = xmalloc (sizeof (char *) * (l + 2)); nargv = xmalloc (sizeof (char *) * (l + 3));
nargv[0] = (char *)default_shell; nargv[0] = (char *)default_shell;
nargv[1] = cmd; nargv[1] = cmd;
memcpy (&nargv[2], &argv[1], sizeof (char *) * l); memcpy (&nargv[2], &argv[1], sizeof (char *) * l);
@@ -2775,9 +2785,10 @@ construct_command_argv_internal (char *line, char **restp, const char *shell,
#else /* must be UNIX-ish */ #else /* must be UNIX-ish */
static const char *sh_chars = "#;\"*?[]&|<>(){}$`^~!"; static const char *sh_chars = "#;\"*?[]&|<>(){}$`^~!";
static const char *sh_cmds[] = static const char *sh_cmds[] =
{ ".", ":", "break", "case", "cd", "command", "continue", "eval", "exec", { ".", ":", "alias", "bg", "break", "case", "cd", "command", "continue",
"exit", "export", "for", "if", "login", "logout", "read", "readonly", "eval", "exec", "exit", "export", "fc", "fg", "for", "getopts", "hash",
"set", "shift", "switch", "test", "times", "trap", "ulimit", "umask", "if", "jobs", "login", "logout", "read", "readonly", "return", "set",
"shift", "test", "times", "trap", "type", "ulimit", "umask", "unalias",
"unset", "wait", "while", 0 }; "unset", "wait", "while", 0 };
# ifdef HAVE_DOS_PATHS # ifdef HAVE_DOS_PATHS

View File

@@ -1,5 +1,5 @@
/* Definitions for managing subprocesses in GNU Make. /* 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. This file is part of GNU Make.
GNU Make is free software; you can redistribute it and/or modify it under the 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 good_stdin:1; /* Nonzero if this child has a good stdin. */
unsigned int deleted:1; /* Nonzero if targets have been deleted. */ unsigned int deleted:1; /* Nonzero if targets have been deleted. */
unsigned int recursive:1; /* Nonzero for recursive command ('+' etc.) */ 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. */ unsigned int dontcare:1; /* Saved dontcare flag. */
}; };
@@ -79,11 +80,11 @@ char **construct_command_argv (char *line, char **restp, struct file *file,
pid_t child_execute_job (struct childbase *child, int good_stdin, char **argv); pid_t child_execute_job (struct childbase *child, int good_stdin, char **argv);
#ifdef _AMIGA #ifdef _AMIGA
void exec_command (char **argv) __attribute__ ((noreturn)); void exec_command (char **argv) NORETURN;
#elif defined(__EMX__) #elif defined(__EMX__)
int exec_command (char **argv, char **envp); int exec_command (char **argv, char **envp);
#else #else
void exec_command (char **argv, char **envp) __attribute__ ((noreturn)); void exec_command (char **argv, char **envp) NORETURN;
#endif #endif
void unblock_all_sigs (void); void unblock_all_sigs (void);

View File

@@ -1,5 +1,5 @@
/* Loading dynamic objects for GNU Make. /* 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. This file is part of GNU Make.
GNU Make is free software; you can redistribute it and/or modify it under the 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. /* 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. This file is part of GNU Make.
GNU Make is free software; you can redistribute it and/or modify it under the 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. /* 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. This file is part of GNU Make.
GNU Make is free software; you can redistribute it and/or modify it under the GNU Make is free software; you can redistribute it and/or modify it under the
@@ -96,7 +96,7 @@ int chdir ();
#endif #endif
#ifndef STDC_HEADERS #ifndef STDC_HEADERS
# ifndef sun /* Sun has an incorrect decl in a header. */ # ifndef sun /* Sun has an incorrect decl in a header. */
void exit (int) __attribute__ ((noreturn)); void exit (int) NORETURN;
# endif # endif
double atof (); double atof ();
#endif #endif
@@ -1313,7 +1313,7 @@ main (int argc, char **argv, char **envp)
{ {
const char *features = "target-specific order-only second-expansion" const char *features = "target-specific order-only second-expansion"
" else-if shortest-stem undefine oneshell nocomment" " else-if shortest-stem undefine oneshell nocomment"
" grouped-target" " grouped-target extra-prereqs"
#ifndef NO_ARCHIVES #ifndef NO_ARCHIVES
" archives" " archives"
#endif #endif
@@ -2134,9 +2134,9 @@ main (int argc, char **argv, char **envp)
install_default_implicit_rules (); 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. */ /* 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 year, and none of the rest of it should be translated (including the
word "Copyright"), so it hardly seems worth it. */ 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); precede);
printf (_("%sLicense GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>\n\ 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. /* 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. This file is part of GNU Make.
GNU Make is free software; you can redistribute it and/or modify it under the GNU Make is free software; you can redistribute it and/or modify it under the
@@ -220,19 +220,22 @@ extern int vms_legacy_behavior;
extern int vms_unix_simulation; extern int vms_unix_simulation;
#endif #endif
#ifndef __attribute__ #if !defined(__attribute__) && (__GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) || __STRICT_ANSI__)
/* This feature is available in gcc versions 2.5 and later. */ /* Don't use __attribute__ if it's not supported. */
# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) || __STRICT_ANSI__ # define ATTRIBUTE(x)
# define __attribute__(x) #else
# define ATTRIBUTE(x) __attribute__ (x)
#endif #endif
/* The __-protected variants of 'format' and 'printf' attributes /* The __-protected variants of 'format' and 'printf' attributes
are accepted by gcc versions 2.6.4 (effectively 2.7) and later. */ are accepted by gcc versions 2.6.4 (effectively 2.7) and later. */
#if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7) #if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7)
# define __format__ format # define __format__ format
# define __printf__ printf # define __printf__ printf
#endif #endif
#endif
#define UNUSED __attribute__ ((unused)) #define UNUSED ATTRIBUTE ((unused))
#define NORETURN ATTRIBUTE ((noreturn))
#if defined (STDC_HEADERS) || defined (__GNU_LIBRARY__) #if defined (STDC_HEADERS) || defined (__GNU_LIBRARY__)
# include <stdlib.h> # include <stdlib.h>
@@ -255,8 +258,8 @@ void *malloc (int);
void *realloc (void *, int); void *realloc (void *, int);
void free (void *); void free (void *);
void abort (void) __attribute__ ((noreturn)); void abort (void) NORETURN;
void exit (int) __attribute__ ((noreturn)); void exit (int) NORETURN;
# endif /* HAVE_STDLIB_H. */ # endif /* HAVE_STDLIB_H. */
#endif /* Standard headers. */ #endif /* Standard headers. */
@@ -327,7 +330,7 @@ extern mode_t umask (mode_t);
#define strneq(a, b, l) (strncmp ((a), (b), (l)) == 0) #define strneq(a, b, l) (strncmp ((a), (b), (l)) == 0)
#if defined(__GNUC__) || defined(ENUM_BITFIELDS) #if defined(ENUM_BITFIELDS) || (defined(__GNUC__) && !defined(__STRICT_ANSI__))
# define ENUM_BITFIELD(bits) :bits # define ENUM_BITFIELD(bits) :bits
#else #else
# define ENUM_BITFIELD(bits) # define ENUM_BITFIELD(bits)
@@ -486,12 +489,12 @@ typedef struct
const char *concat (unsigned int, ...); const char *concat (unsigned int, ...);
void message (int prefix, size_t length, const char *fmt, ...) void message (int prefix, size_t length, const char *fmt, ...)
__attribute__ ((__format__ (__printf__, 3, 4))); ATTRIBUTE ((__format__ (__printf__, 3, 4)));
void error (const floc *flocp, size_t length, const char *fmt, ...) void error (const floc *flocp, size_t length, const char *fmt, ...)
__attribute__ ((__format__ (__printf__, 3, 4))); ATTRIBUTE ((__format__ (__printf__, 3, 4)));
void fatal (const floc *flocp, size_t length, const char *fmt, ...) void fatal (const floc *flocp, size_t length, const char *fmt, ...)
__attribute__ ((noreturn, __format__ (__printf__, 3, 4))); ATTRIBUTE ((noreturn, __format__ (__printf__, 3, 4)));
void out_of_memory () __attribute__((noreturn)); void out_of_memory () NORETURN;
/* When adding macros to this list be sure to update the value of /* When adding macros to this list be sure to update the value of
XGETTEXT_OPTIONS in the po/Makevars file. */ XGETTEXT_OPTIONS in the po/Makevars file. */
@@ -509,8 +512,8 @@ void out_of_memory () __attribute__((noreturn));
#define ONS(_t,_a,_f,_n,_s) _t((_a), INTSTR_LENGTH + strlen (_s), \ #define ONS(_t,_a,_f,_n,_s) _t((_a), INTSTR_LENGTH + strlen (_s), \
(_f), (_n), (_s)) (_f), (_n), (_s))
void die (int) __attribute__ ((noreturn)); void die (int) NORETURN;
void pfatal_with_name (const char *) __attribute__ ((noreturn)); void pfatal_with_name (const char *) NORETURN;
void perror_with_name (const char *, const char *); void perror_with_name (const char *, const char *);
#define xstrlen(_s) ((_s)==NULL ? 0 : strlen (_s)) #define xstrlen(_s) ((_s)==NULL ? 0 : strlen (_s))
void *xmalloc (size_t); void *xmalloc (size_t);
@@ -531,6 +534,10 @@ FILE *get_tmpfile (char **, const char *);
ssize_t writebuf (int, const void *, size_t); ssize_t writebuf (int, const void *, size_t);
ssize_t readbuf (int, void *, size_t); ssize_t readbuf (int, void *, size_t);
#ifndef HAVE_MEMRCHR
void *memrchr(const void *, int, size_t);
#endif
#ifndef NO_ARCHIVES #ifndef NO_ARCHIVES
int ar_name (const char *); int ar_name (const char *);
void ar_parse_name (const char *, char **, char **); void ar_parse_name (const char *, char **, char **);

View File

@@ -1,5 +1,5 @@
/* Miscellaneous generic support functions for GNU Make. /* 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. This file is part of GNU Make.
GNU Make is free software; you can redistribute it and/or modify it under the 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> #include <stdarg.h>
#ifdef WINDOWS32 #ifdef WINDOWS32
# include <windows.h>
# include <io.h> # include <io.h>
#endif #endif
@@ -260,6 +261,30 @@ xstrndup (const char *str, size_t length)
return result; 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: /* Limited INDEX:
@@ -407,7 +432,8 @@ free_ns_chain (struct nameseq *ns)
#ifdef MAKE_MAINTAINER_MODE #ifdef MAKE_MAINTAINER_MODE
void spin(const char* type) void
spin (const char* type)
{ {
char filenm[256]; char filenm[256];
struct stat dummy; struct stat dummy;
@@ -418,7 +444,11 @@ void spin(const char* type)
{ {
fprintf (stderr, "SPIN on %s\n", filenm); fprintf (stderr, "SPIN on %s\n", filenm);
do do
#ifdef WINDOWS32
Sleep (1000);
#else
sleep (1); sleep (1);
#endif
while (stat (filenm, &dummy) == 0); while (stat (filenm, &dummy) == 0);
} }
} }

View File

@@ -1,5 +1,5 @@
/* Declarations for operating system interfaces for GNU Make. /* 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. This file is part of GNU Make.
GNU Make is free software; you can redistribute it and/or modify it under the 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 /* 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. This file is part of GNU Make.
GNU Make is free software; you can redistribute it and/or modify it under the 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 /* 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. This file is part of GNU Make.
GNU Make is free software; you can redistribute it and/or modify it under the 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. /* 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. This file is part of GNU Make.
GNU Make is free software; you can redistribute it and/or modify it under the 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. /* 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. This file is part of GNU Make.
GNU Make is free software; you can redistribute it and/or modify it under the 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; char *p;
glob_t gl; glob_t gl;
char *tp; 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. */ /* Always stop on NUL. */
stopmap |= MAP_NUL; stopmap |= MAP_NUL;

View File

@@ -1,5 +1,5 @@
/* Basic dependency engine for GNU Make. /* 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. This file is part of GNU Make.
GNU Make is free software; you can redistribute it and/or modify it under the 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 Please do not send bug reports or questions about it to
the Make maintainers. 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. This file is part of GNU Make.
GNU Make is free software; you can redistribute it and/or modify it under the 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. /* 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. This file is part of GNU Make.
GNU Make is free software; you can redistribute it and/or modify it under the 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. /* 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. This file is part of GNU Make.
GNU Make is free software; you can redistribute it and/or modify it under the GNU Make is free software; you can redistribute it and/or modify it under the
@@ -60,29 +60,38 @@ struct file *suffix_file;
static size_t maxsuffix; static size_t maxsuffix;
/* Compute the maximum dependency length and maximum number of /* Compute the maximum dependency length and maximum number of dependencies of
dependencies of all implicit rules. Also sets the subdir all implicit rules. Also sets the subdir flag for a rule when appropriate,
flag for a rule when appropriate, possibly removing the rule possibly removing the rule completely when appropriate.
completely when appropriate. */
Add any global EXTRA_PREREQS here as well. */
void void
count_implicit_rule_limits (void) snap_implicit_rules (void)
{ {
char *name; char *name = NULL;
size_t namelen; size_t namelen = 0;
struct rule *rule; struct rule *rule;
struct dep *dep;
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; max_pattern_dep_length = 0;
name = 0; for (dep = prereqs; dep; dep = dep->next)
namelen = 0;
rule = pattern_rules;
while (rule != 0)
{ {
unsigned int ndeps = 0; size_t l = strlen (dep_name (dep));
struct dep *dep; if (l > max_pattern_dep_length)
struct rule *next = rule->next; max_pattern_dep_length = l;
++pre_deps;
}
num_pattern_rules = max_pattern_targets = max_pattern_deps = 0;
for (rule = pattern_rules; rule; rule = rule->next)
{
unsigned int ndeps = pre_deps;
struct dep *lastdep = NULL;
++num_pattern_rules; ++num_pattern_rules;
@@ -99,17 +108,20 @@ count_implicit_rule_limits (void)
const char *p2; const char *p2;
if (p == 0) if (p == 0)
p = strrchr (dname, ':'); p = strrchr (dname, ':');
p2 = p != 0 ? strchr (dname, '%') : 0; p2 = p ? strchr (p, '%') : 0;
#else #else
const char *p = strrchr (dname, '/'); const char *p = strrchr (dname, '/');
const char *p2 = p != 0 ? strchr (dname, '%') : 0; const char *p2 = p ? strchr (p, '%') : 0;
#endif #endif
ndeps++; ndeps++;
if (len > max_pattern_dep_length) if (len > max_pattern_dep_length)
max_pattern_dep_length = len; 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. /* There is a slash before the % in the dep name.
Extract the directory name. */ Extract the directory name. */
@@ -134,13 +146,20 @@ count_implicit_rule_limits (void)
dep->changed = 0; 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) if (ndeps > max_pattern_deps)
max_pattern_deps = ndeps; max_pattern_deps = ndeps;
rule = next;
} }
free (name); free (name);
free_dep_chain (prereqs);
} }
/* Create a pattern rule from a suffix rule. /* Create a pattern rule from a suffix rule.
@@ -253,11 +272,23 @@ convert_to_pattern (void)
memcpy (rulename + slen, dep_name (d2), s2len + 1); memcpy (rulename + slen, dep_name (d2), s2len + 1);
f = lookup_file (rulename); f = lookup_file (rulename);
/* No target, or no commands, or it has deps: it can't be a /* No target, or no commands: it can't be a suffix rule. */
suffix rule. */ if (f == 0 || f->cmds == 0)
if (f == 0 || f->cmds == 0 || f->deps != 0)
continue; continue;
/* POSIX says that suffix rules can't have prerequisites.
In POSIX mode, don't make this a suffix rule. Previous versions
of GNU make did treat this as a suffix rule and ignored the
prerequisites, which is bad. In the future we'll do the same as
POSIX, but for now preserve the old behavior and warn about it. */
if (f->deps != 0)
{
if (posix_pedantic)
continue;
error (&f->cmds->fileinfo, 0,
_("warning: ignoring prerequisites on suffix rule definition"));
}
if (s2len == 2 && rulename[slen] == '.' && rulename[slen + 1] == 'a') if (s2len == 2 && rulename[slen] == '.' && rulename[slen + 1] == 'a')
/* A suffix rule '.X.a:' generates the pattern rule '(%.o): %.X'. /* A suffix rule '.X.a:' generates the pattern rule '(%.o): %.X'.
It also generates a normal '%.a: %.X' rule below. */ It also generates a normal '%.a: %.X' rule below. */

View File

@@ -1,5 +1,5 @@
/* Definitions for using pattern rules in GNU Make. /* 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. This file is part of GNU Make.
GNU Make is free software; you can redistribute it and/or modify it under the 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; extern struct file *suffix_file;
void count_implicit_rule_limits (void); void snap_implicit_rules (void);
void convert_to_pattern (void); void convert_to_pattern (void);
void install_pattern_rule (struct pspec *p, int terminal); void install_pattern_rule (struct pspec *p, int terminal);
void create_pattern_rule (const char **targets, const char **target_percents, void create_pattern_rule (const char **targets, const char **target_percents,

View File

@@ -1,5 +1,5 @@
/* Convert between signal names and numbers. /* 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. This file is part of GNU Make.
GNU Make is free software; you can redistribute it and/or modify it under the 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. /* 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. This file is part of GNU Make.
GNU Make is free software; you can redistribute it and/or modify it under the 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. /* 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. This file is part of GNU Make.
GNU Make is free software; you can redistribute it and/or modify it under the 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. /* 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. This file is part of GNU Make.
GNU Make is free software; you can redistribute it and/or modify it under the 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. /* 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. This file is part of GNU Make.
GNU Make is free software; you can redistribute it and/or modify it under the 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 * 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 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 terms of the GNU General Public License as published by the Free Software

View File

@@ -4,7 +4,7 @@
* DCL symbols. * 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 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 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 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 terms of the GNU General Public License as published by the Free Software

View File

@@ -1,5 +1,5 @@
/* dirent.h for vms /* 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. This file is part of GNU Make.
GNU Make is free software; you can redistribute it and/or modify it under the GNU Make is free software; you can redistribute it and/or modify it under the

View File

@@ -1,5 +1,5 @@
/* VMS functions /* 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. This file is part of GNU Make.
GNU Make is free software; you can redistribute it and/or modify it under the 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 /* 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. This file is part of GNU Make.
GNU Make is free software; you can redistribute it and/or modify it under the 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 --------------- /* --------------- Moved here from job.c ---------------
This file must be #included in job.c, as it accesses static functions. 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. This file is part of GNU Make.
GNU Make is free software; you can redistribute it and/or modify it under the 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. /* 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. This file is part of GNU Make.
GNU Make is free software; you can redistribute it and/or modify it under the 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. /* 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. This file is part of GNU Make.
GNU Make is free software; you can redistribute it and/or modify it under the 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. /* 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. This file is part of GNU Make.
GNU Make is free software; you can redistribute it and/or modify it under the 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 /* 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. This file is part of GNU Make.
GNU Make is free software; you can redistribute it and/or modify it under the 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. /* 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. This file is part of GNU Make.
GNU Make is free software; you can redistribute it and/or modify it under the 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. /* 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. This file is part of GNU Make.
GNU Make is free software; you can redistribute it and/or modify it under the 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. /* 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. This file is part of GNU Make.
GNU Make is free software; you can redistribute it and/or modify it under the 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. /* 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. This file is part of GNU Make.
GNU Make is free software; you can redistribute it and/or modify it under the 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. /* 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. This file is part of GNU Make.
GNU Make is free software; you can redistribute it and/or modify it under the 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