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) > 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. _______________________________________________ Bug-make mailing list Bug-make@gnu.org https://lists.gnu.org/mailman/listinfo/bug-make