Subject: bug#27781: LIBOBJS should depend on LIBOBJDIR

From: Mathieu Lirzin <[email-masked]>
Date: Thu, 24 Aug 2017 11:35:04 +0200

Nick Bowler <[email-masked]> writes:

> On 8/23/17, Mathieu Lirzin <[email-masked]> wrote:
>> Michael Haubenwallner <[email-masked]> writes:
>>> Another thought about the final "$(LIBOBJS): .../.dirstamp" Makefile
>>> line: If I remember correctly, there have been (non-GNU) make
>>> implementations thatchoke on this rule when LIBOBJS is an empty
>>> variable: Am I wrong here, or is GNU make required anyway these days?
>>
>> GNU make is not required for current Automake version.  I didn't find
>> any reference of this issue with empty variable target in Autoconf
>> "Portable Make programming" section [1] but if it is actually the case
>> then it would be nice to find a solution for that.
>
> POSIX requires that target rules specify at least one target.  At least
> dmake will fail to parse the makefile if it contains an target rule with
> no targets:
>
>   % cat >Makefile <<'EOF'
> FOO =
> dummy: ;
> $(FOO): ;
> EOF
>   % dmake
>   dmake:  Makefile:  line 3:  Error: -- Missing targets or attributes in rule
>
> If the target list is a macro which can reasonably be empty then one
> solution is to add a bogus target name that won't be used anywhere
> else, along the lines of:
>
>   gobbledegook $(FOO): ;

Instead of this dummy target, I would rather prefer adding the dirstamp
dependency for each explicit object file separately.  this should be computed
from the '%libsources' variable.  However after a quick look in the code, it
seems that this variable is not properly populated by the
'scan_autoconf_traces' subroutine.  It only contains the files that are
explicitely defined by scanning the AC_LIBSOURCE macro and not by AC_LIBOBJ or
AC_LIBSOURCES in 'configure.ac'.

Michael: Are you interested in looking into this?

Thanks for your input.

-- 
Mathieu Lirzin
GPG: F2A3 8D7E EB2B 6640 5761  070D 0ADE E100 9460 4D37