Will do.
Eddy
vin., 19 oct. 2018, 16:52 Paul Smith a scris:
> On Fri, 2018-10-19 at 09:26 +0300, Eddy Petrișor wrote:
> > I have a similar issue, but in my case I used explicit pattern rules,
> > vpath and added compiler generated .d files to make sure the object
> > files are regenerated on .h
On Fri, 2018-10-19 at 09:26 +0300, Eddy Petrișor wrote:
> I have a similar issue, but in my case I used explicit pattern rules,
> vpath and added compiler generated .d files to make sure the object
> files are regenerated on .h modification, but the end result was that
> the pattern rules were no l
On Fri, 2018-10-19 at 09:39 +, Edward Welbourne wrote:
> TARGETS = bin/animation.exe bin/barchart.exe ...
>
> $(TARGETS): bin/%.exe: $(%_OBJ) $(LIBS)
> $(call link_EXE, $@, $^)
If you try this, you'll see it doesn't work.
Variables are expanded before the pattern is substituted, so $(%
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 o
joi, 18 oct. 2018, 18:56 Paul Smith a scris:
> On Thu, 2018-10-18 at 17:40 +0200, Gisle Vanem wrote:
> >bin/%.exe: $($(@F)_OBJ) $(LIBS)
> >$(call link_EXE, $@, $^)
>
> This cannot work because automatic variables like $@, etc. are only
> valid _inside a recipe_. They are not set
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 suggestio
On Thu, 2018-10-18 at 18:32 +0200, Gisle Vanem wrote:
>
> .SECONDEXPANSION:
>
> bin/%.exe: $$($$(@F)_OBJ) $(LIBS)
> $(call link_EXE, $@, $^)
>
> Very compact and nice. But trying it, it wont work.
> For 'bin/animation.exe', it expands to:
> bin/animation.exe: $(LIBS)
>
Paul Smith wrote:
Or, you can enable secondary expansion which will allow you to write:
.SECONDEXPANSION:
bin/%.exe: $$($$(@F)_OBJ) $(LIBS)
$(call link_EXE, $@, $^)
Very compact and nice. But trying it, it wont work.
For 'bin/animation.exe', it expands to:
bin/animation.e
On Thu, 2018-10-18 at 17:40 +0200, Gisle Vanem wrote:
>bin/%.exe: $($(@F)_OBJ) $(LIBS)
>$(call link_EXE, $@, $^)
This cannot work because automatic variables like $@, etc. are only
valid _inside a recipe_. They are not set and cannot be used in target
or prerequisite lists: they e
Hello list.
I need help with compacting a series of rules like (from a
Qwt makefile):
animation_OBJ = examples/animation/main.obj \
examples/animation/plot.obj
barchart_OBJ = examples/barchart/barchart.obj \
examples/barchart/main.obj \
10 matches
Mail list logo