[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: warning: TEST_LDFLAGS' is defined but no program or library has 'TES
From: |
Nick Bowler |
Subject: |
Re: warning: TEST_LDFLAGS' is defined but no program or library has 'TEST' as canonical name |
Date: |
Mon, 20 Nov 2017 13:01:38 -0500 |
Hi,
On 2017-11-20, Thomas Martitz <address@hidden> wrote:
> here's some quite annoying warning. I'm trying to define a variable
> TEST_LDFLAGS that multiple programs use. There is no program named TEST.
> The same works fine with TEST_CFLAGS (i.e. no warning is displayed).
>
> Here's the warning:
>
> Makefile.am:4: warning: variable 'TEST_LDFLAGS' is defined but no program
> or
> Makefile.am:4: library has 'TEST' as canonical name (possible typo)
I'm surprised there is no warning with CFLAGS; it appears this warning
is issued for mumble_SOURCES, LIBADD, LDADD, LDFLAGS and DEPENDENCIES
only.
> Here's the Makefile.am
>
> TEST_CFLAGS = -g
> TEST_LDFLAGS = -Wl,-z,defs
>
> bin_PROGRAMS = test
>
> test_CFLAGS = $(TEST_CFLAGS)
> test_LDFLAGS = $(TEST_LDFLAGS)
>
> Is this known? Is there a workaround? Can I ignore the warning?
If you were to later add a program called TEST, then the results could
be surprising. But you can certainly ignore the warning if you'd like.
Alternately you can perhaps use a different name that does not conflict
with the Automake naming structure. Perhaps LDFLAGS_FOR_TEST?
You can disable the warning outright with -Wno-syntax (but this might
disable more than you'd like).
Finally, this warning is not issued for variables substituted by configure.
Cheers,
Nick