when creating a Makefile, im trying to figure out how(if) i can change a variable based on the target.
So something likes this:
VER = $(if target=release then 1.0.0 elseif target=nightly then 20110411)
nightly:
@@echo ${VER} >> version.txt
release:
@@echo ${VER} >> version.txt
If your
makeis GNU make,Target-Specific Variable
is allowed.
For example, in your question’s case, the following definitions will meet the
purpose:
Hope this helps