bug-ddrescue
[Top][All Lists]
Advanced

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

New Makefile rule in 1.28 breaks detection of invalid make targets


From: Christian Franke
Subject: New Makefile rule in 1.28 breaks detection of invalid make targets
Date: Fri, 26 Jan 2024 10:38:58 +0100
User-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 SeaMonkey/2.53.16

Important: This does not break builds of ddrescue.

But it is at least an interesting observation:

$ ../src/ddrescue-1.28/configure ...OPTIONS...
...

$ make --version
GNU Make 4.4.1
Built for x86_64-pc-cygwin

$ make -n foobar
g++  ...OPTIONS... -c -o foobar.o foobar.cc
cc   foobar.o   -o foobar
rm foobar.o foobar.cc


With Makefile.in from 1.27 the result is as expected:

$ make -n foobar
make: *** No rule to make target 'foobar'.  Stop.


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

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


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

I found this during test packaging for Cygwin using its packaging support tool cygport and the existing ddrescue.cygport script. The script uses the default 'src_install' recipe of cygport which does the following:

        #  Runs 'make install' (or 'make install/fast' in CMake packages) ...
        if $(make -n -s install/fast &> /dev/null)
        then
                inst_target="install/fast"
        else
                inst_target="install"
        fi
        make ... ${inst_target} DESTDIR=...

This fails with new Makefile.in. No problem in this case, as I could add a custom recipe simply running "make install DESTDIR=...".

--
Regards,
Christian




reply via email to

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