bug-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug #63840] make allows match-anything rules to match files with the de


From: Dmitry Goncharov
Subject: [bug #63840] make allows match-anything rules to match files with the default suffixes
Date: Sun, 26 Feb 2023 15:05:16 -0500 (EST)

Follow-up Comment #1, bug #63840 (project make):

When the built-in rules are disabled, make allows match-anything rules to
match files with the default suffixes.

Example 1 demonstrates how a match-anything pattern rule incorrectly matches a
file with the default suffix when the built-in rules are disabled.

++++
$ ls
hello.c.o  makefile
$ cat makefile 
hello.c:
%: %.o; $(info $@ from $<)
$ make-4.4
make-4.4: Nothing to be done for 'hello.c'.
$ make-4.4 -r
hello.c from hello.c.o
make-4.4: 'hello.c' is up to date.
----


Example 2 demonstrates how a match-anything pattern rule incorrectly matches a
file with a user defined suffix when the built-in rules are disabled.

++++
$ ls
hello.c.x  makefile
$ cat makefile 
hello.c:
%: %.x; $(info $@ from $<)
$ make-4.4
make-4.4: Nothing to be done for 'hello.c'.
$ make-4.4 -r
hello.c from hello.c.x
make-4.4: 'hello.c' is up to date.
----


Example 3 demonstrates how a single suffix rule incorrectly matches a file
with the default suffix when the built-in rules are disabled.

++++
$ ls
hello.c.o  makefile
$ cat makefile
.SUFFIXES:
.SUFFIXES: .o
hello.c:
.o:; $(info $@ from $<)
$ make-4.4
make-4.4: Nothing to be done for 'hello.c'.
$ make-4.4 -r
hello.c from hello.c.o
make-4.4: 'hello.c' is up to date.
----

Example 4 demonstrates how a single suffix rule incorrectly matches a file
with a user defined suffix when the built-in rules are disabled.

++++
$ ls
hello.c.x  makefile
$ cat makefile 
.SUFFIXES:
.SUFFIXES: .x
hello.c:
.x:; $(info $@ from $<)
$ make-4.4
make-4.4: Nothing to be done for 'hello.c'.
$ make-4.4 -r
hello.c from hello.c.x
make-4.4: 'hello.c' is up to date.
----


When built-in rules are enabled, the default suffixes are entered as files on
startup and then converted to dummy pattern rules. These dummy pattern rules
prevent match-anything rules from matching files with the default suffixes.
When built-in rules are disabled, the default suffixes are not entered as
files and not converted to dummy pattern rules. Because the dummy rules are
missing make fails to recognize files with the default suffixes.

This patch enters the default suffixes as files whether built-in rules are
enabled or not.





    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?63840>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]