makefile - Define compilation variables based on target for -


my c++ source file specific variable passed makefile. when making different target, variable definition different.

how can define variable in makefile based on target.

thanks

you can use target-specific variable values, propagate target's prerequisites:

all : foo bar foo : cxxflags += -dfoo bar : cxxflags += -dbar  foo bar :     @echo target=$@ cxxflags=${cxxflags}  .phony : 

Comments

Popular posts from this blog

python - Why doesn't list have safe "get" method like dictionary? -

razor - Is this a bug in WebMatrix PageData? -

sql server - Stored procedure -