linux - Variables based on targets in Makefile -


when creating makefile, im trying figure out how(if) can change variable based on target.

so likes this:

ver = $(if target=release 1.0.0 elseif target=nightly 20110411)  nightly:     @@echo ${ver} >> version.txt  release:     @@echo ${ver} >> version.txt 

if make gnu make, target-specific variable allowed.
example, in question's case, following definitions meet purpose:

nightly: ver = 20110411 release: ver = 1.0.0  nightly:     @echo ${ver}  release:     @echo ${ver} 

hope helps


Comments

Popular posts from this blog

php - What is the difference between $_SERVER['PATH_INFO'] and $_SERVER['ORIG_PATH_INFO']? -

fortran - Function return type mismatch -

queue - mq_receive: message too long -