I'm trying to create a makefile with wildcard targets but the wildcards should match on variables.
So I have a makefile like this:
A_OUT := bin/a
B_OUT := bin/b
# This does not work
$(%_OUT):
@echo $@
Output:
$ make bin/a
make: *** No rule to make target 'bin/a'. Stop.
I can not use bin/%: because the variables may point to another directory.
Is there any way to do this in GNU make?
bin/%? What does the target being a directory change about this? What do you plan on doing in the target that your proposed snippet would do that usingbin/%doesn't? - Etan Reisnermake A_OUT=anotherdir/a anotherdir/a- das_j