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.
* 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.
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.
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.
* 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.
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
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.
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.
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.
* 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
* 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.
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.