bug-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: target-specific 'define'd variables (3.80)?


From: Paul D. Smith
Subject: Re: target-specific 'define'd variables (3.80)?
Date: Mon, 5 Jul 2004 12:55:31 -0400

%% Will Partain <address@hidden> writes:

  wp> Hi; I don't know if the little Makefile below *ought* to
  wp> work or not; it seems it should.

No.  define/endef is not supported directly in kernel-specific
variables.  The entire definition must fit onto one logical line.

You can always do this:

  define _foo
  @echo This is a multi-line definition
  @echo of myvar with foo in it.
  endef

  define _bar
  @echo This is a multi-line definition
  @echo of myvar with bar in it.
  endef


  foo : myvar = $(_foo)

  bar : myvar = $(_bar)

  foo :
          $(myvar)

  bar :
          $(myvar)


Of course in this simple example there are much less complex ways to
manage this; just using $@ would be enough:

  define myvar
  @echo This is a multi-line definition
  @echo of myvar with $@ in it.
  endef

  foo :
          $(myvar)

  bar :
          $(myvar)


-- 
-------------------------------------------------------------------------------
 Paul D. Smith <address@hidden>          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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]