List Info

Thread: setting variables within ifeq section doesn't work?




setting variables within ifeq section doesn't work?
user name
2006-05-03 16:40:26
%% Jason Lunz <lunzfalooley.org> writes:

  jl> Is this expected behavior?

  jl> 	$ cat Makefile 
  jl> 	ifeq ($(A),x)
  jl> 	A:=y
  jl> 	$(info A set to $(A))
  jl> 	endif
  jl> 	.PHONY: default
  jl> 	default:
  jl> 		echo A is $(A)
  jl> 	$ make 
  jl> 	A is
  jl> 	$ make A=a
  jl> 	A is a
  jl> 	$ make A=x
  jl> 	A set to x
  jl> 	A is x

Yes.

  jl> I would expect A to be set to "y"
whenever its previous value is "x",
  jl> but that doesn't happen.

Variable settings on the command line override any value set
"normally"
in the makefile.

See the GNU make manual, section "Overriding
Variables".

-- 
------------------------------------------------------------
-------------------
 Paul D. Smith <psmithgnu.org>          Find
some GNU make tips at:
 http://www.gnu.org        
             http://make.paulandlesl
ey.org
 "Please remain calm...I may be mad, but I am a
professional." --Mad Scientist


_______________________________________________
Help-make mailing list
Help-makegnu.org
http:
//lists.gnu.org/mailman/listinfo/help-make
[1]

about | contact  Other archives ( Real Estate discussion Medical topics )