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

c# - How to set Z index when using WPF DrawingContext? -

razor - Is this a bug in WebMatrix PageData? -

android - layout with fragment and framelayout replaced by another fragment and framelayout -