bug-ddrescue
[Top][All Lists]
Advanced

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

Re: New Makefile rule in 1.28 breaks detection of invalid make targets


From: Antonio Diaz Diaz
Subject: Re: New Makefile rule in 1.28 breaks detection of invalid make targets
Date: Fri, 26 Jan 2024 19:58:09 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i586; en-US; rv:1.9.1.19) Gecko/20110420 SeaMonkey/2.0.14

Hi Christian,

Thank you very much for reporting this.

Christian Franke wrote:
The root of the problem is this new rule in Makefile.in:

# prevent 'make' from trying to remake source files
...
%.h %.cc : ;

It looks like an interference between the above empty rule and the default rules of GNU make. Invoking make with option '-r' is not enough to fix the problem. I have managed to "fix" it by adding an empty .SUFFIXES to the Makefile and replacing the pattern rule '%.o : %.cc' with a suffix rule '.cc.o'.

All I wanted was to prevent make from trying lots of expensive ways to remake source files that do not need to be remade in the first place[1]. It seems that I have managed to open a can of worms instead.

[1] http://www.gnu.org/software/make/manual/html_node/Empty-Recipes.html
"You may be wondering why you would want to define a recipe that does nothing. One reason this is useful is to prevent a target from getting implicit recipes (from implicit rules or the .DEFAULT special target;"

I don't know why the above happens if this rule is present. Bug in GNU
make itself?

Maybe. IMHO, make should not try to build arbitrary targets, and should not add suffixes to target names to make them match some default rule. It is confusing.

Best regards,
Antonio.



reply via email to

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