%% Jonathan Baccash <[EMAIL PROTECTED]> writes:

  jb> With GNU make 3.81-beta3, I try this makefile:
  jb> define myvar
  jb> # $(error blah)
  jb> endef
  jb> $(eval $(myvar))


  jb> And I get:
  jb> Makefile:4: *** blah.  Stop.

  jb> Shouldn't the commented error call be ignored?

No, because the variable myvar is expanded FIRST, then the results
are evaluated.  When myvar is being expanded it's just the same as if it
were being used in a command script or similar: comment characters have
no impact.

To behave like you expect you need to escape the error function so that
it's not expanded until it's inside the eval:

  define myvar
  # $$(error blah)
  endef
  $(eval $(myvar))

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


_______________________________________________
Bug-make mailing list
Bug-make@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-make

Reply via email to