[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Compacting link-rules
From: |
Edward Welbourne |
Subject: |
Re: Compacting link-rules |
Date: |
Fri, 19 Oct 2018 09:39:05 +0000 |
Paul Smith wrote:
>>> All the .obj files are missing!?
>>
>> Oh. $@ is "bin/animation.exe" so $(@F) is "animation.exe" and
>> $($(@F)_OBJ) would be "animation.exe_OBJ" but that's not the name of
>> your variable, so it expands to the empty string.
>>
>> Sorry I didn't catch this problem in your original suggestion.
>>
>> You want:
>>
>> bin/%.exe: $$($$*_OBJ) $(LIBS)
>> ...
>>
>> because $* matches the pattern stem, which is "animation" in this case.
Gisle Vanem (18 October 2018 19:40) replied:
> That seems to work fine. Thanks a lot!
Good to hear. For completeness's sake,
note another approach that might work:
TARGETS = bin/animation.exe bin/barchart.exe ...
$(TARGETS): bin/%.exe: $(%_OBJ) $(LIBS)
$(call link_EXE, $@, $^)
using the other kind of pattern rule,
Eddy.
Re: Compacting link-rules, Eddy Petrișor, 2018/10/19