Warning sent by make in test/

152 views
Skip to first unread message

Manolo

unread,
Dec 2, 2020, 9:50:07 AM12/2/20
to fltk.coredev

When building the test part of FLTK with configure+make this warning now appears :
Makefile:318: warning: ignoring prerequisites on suffix rule definition
It's caused by line #317 of test/Makefile
.fl.cxx .fl.h:    ../fluid/fluid$(EXEEXT)
which is a suffix rule containing a prerequisite. That seems to not make sense
for make, as explained in
"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 .POSIX target is defined). In versions of GNU 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 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."

My suggestion to remove this warning is that the prerequisite must just be removed,
to obtain
.fl.cxx .fl.h: 

At any rate, the prerequisite is not operational, because the make command
fails if fluid is not present in ../fluid/. So, we loose nothing by removing it.

Am I overlooking something?

Albrecht Schlosser

unread,
Dec 2, 2020, 1:31:43 PM12/2/20
to fltkc...@googlegroups.com
On 12/2/20 3:50 PM Manolo wrote:
>
> When building the test part of FLTK with configure+make this warning now
> appears :

Side note: in this context "now" obviously means "since make version
4.3". I don't see this warning, my make version is 4.2.1

> Makefile:318: warning: ignoring prerequisites on suffix rule definition
> It's caused by line #317 of test/Makefile
> .fl.cxx .fl.h:    ../fluid/fluid$(EXEEXT)
> which is a suffix rule containing a prerequisite. That seems to not make
> sense for make, as explained in
> [...]
> My suggestion to remove this warning is that the prerequisite must just
> be removed, to obtain
> .fl.cxx .fl.h:

+1

> At any rate, the prerequisite is not operational, because the make command
> fails if fluid is not present in ../fluid/. So, we loose nothing by
> removing it.
>
> Am I overlooking something?

As it stands (and AFAICT) this is correct. At least since "some version"
(which I don't know) of make, perhaps this has been changed.

This code exists since Apr 29, 2002 (commit 782b3d639a) where Mike wrote
in the commit log:

Update test program dependencies on fluid - need to make the .fl
rules dependent on fluid, and the .cxx files dependent on the .fl
files.

So the intention was obviously to be able to build fluid as a
prerequisite if it didn't exist.

Maybe it worked in 2002 but I doubt it because today(!) there is no rule
in test/Makefile that would build '../fluid/fluid$(EXEEXT)' [1]. I don't
think that we can (or should) introduce a rule to build fluid in
test/Makefile (how? I wouldn't know).

So yes, I agree that this rule should be modified as suggested.

-----
[1] an implicit rule exists but it fails if you execute `make` in the
test folder if fluid doesn't exist (on my Linux system). I believe that
CMake + make would be much smarter than our old Makefile's.

Manolo

unread,
Dec 2, 2020, 3:14:58 PM12/2/20
to fltk.coredev
Very well. I've committed the fix to the git repo (f787a1b).
Reply all
Reply to author
Forward
0 new messages