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 expand to the empty string. You have two choices. You can either separate the prerequisites from the recipe, like this: bin/%.exe: $(call link_EXE,$@,$^) bin/animation.exe: $(animation_OBJ) $(LIBS) bin/barchart.exe: $(barchart_OBJ) $(LIBS) Or, you can enable secondary expansion which will allow you to write: .SECONDEXPANSION: bin/%.exe: $$($$(@F)_OBJ) $(LIBS) $(call link_EXE, $@, $^) (note the extra "$" in the variable references. See: https://www.gnu.org/software/make/manual/make.html#Secondary-Expansion _______________________________________________ Bug-make mailing list Bug-make@gnu.org https://lists.gnu.org/mailman/listinfo/bug-make