I seem to be using % wrongly in Makefiles. This simple makefile shows the problem
Makefile:
mylib: mylib-%.dll
mylib-%.dll:
touch mylib-13.dll
myotherlib: myotherlib-13.dll
myotherlib-13.dll:
touch myotherlib-13.dll
Output:
> make mylib
touch mylib-13.dll
> make mylib
touch mylib-13.dll
> make myotherlib
touch myotherlib-13.dll
> make myotherlib
make: Nothing to be done for `myotherlib'.
mylib is always rebuilt (the second make mylib call is again executing the touch command), while myotherlib is only built once.
Why is this and what do I need to change so that mylib is not always rebuilt, i.e. the second call to make mylib also returns make: Nothing to be done for 'mylib'.?