lmi
[Top][All Lists]
Advanced

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

Re: [lmi] Best way to integrate PCRE


From: Greg Chicares
Subject: Re: [lmi] Best way to integrate PCRE
Date: Thu, 30 Sep 2021 11:45:23 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0

On 9/30/21 1:38 AM, Greg Chicares wrote:
> On 9/28/21 8:09 PM, Greg Chicares wrote:
> [...]
>> The root cause seems to be here, in 'workhorse.make':
>> 
>>   # The link command promiscuously mentions libxml2 for all targets.
[...]
> In 'workhorse.make', the changes are mostly like this:
>   +liblmi.a liblmi$(SHREXT): REQUIRED_LIBS := $(xml_libraries)
>    liblmi.a liblmi$(SHREXT): EXTRA_LDFLAGS :=
> where ":=" seems appropriate. In included file 'objects.make',
> ":=" won't do, and "+=" is needed, though I don't know why; maybe
> tomorrow I'll try plain "=" in both files and see if that works.

Plain "=" does indeed work, and now I can explain why, with
this simplified example:

'objects.make':
  # $(xml_libraries) is not yet defined here.
  foo.$(EXEEXT): extra_flags := $(xml_libraries)

'workhorse.make':
  # $(xml_libraries) is not yet defined here.
  include 'objects.make'
  xml_libraries := whatever
  # Now $(xml_libraries) is defined, but that doesn't
  # affect foo's target-specific $(extra_flags) because
  # it was a simply-expanded variable.
  #
  # A simply-expanded target-specific variable works
  # for bar, because here $(xml_libraries) is defined.
  bar.$(EXEEXT): extra_flags := $(xml_libraries)
  %.$(EXEEXT): $(LD) -o $@ $^ $(extra_flags) $(LDFLAGS)

So it *is* obvious.


reply via email to

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