[Top][All Lists]

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

Re: Compacting link-rules

From: Paul Smith
Subject: Re: Compacting link-rules
Date: Thu, 18 Oct 2018 13:16:30 -0400

On Thu, 2018-10-18 at 18:32 +0200, Gisle Vanem wrote:
>     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)
>     link -nologo -debug -incremental:no -map -subsystem:windows
>       -out:bin/controls.exe lib/Qwt.lib ...
> 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.

reply via email to

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