help-make
[Top][All Lists]
Advanced

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

Re: accessing command-script text


From: Paul D. Smith
Subject: Re: accessing command-script text
Date: Thu, 5 Jun 2003 07:55:29 -0400

%% "leon j. breedt" <address@hidden> writes:

  ljb> in the kernel, they have something like:

  ljb> quiet=quiet_
  ljb> quiet_cmd_cc=  CC    $<
  ljb> cmd_cc=        $(CC) $(CFLAGS) ...

  ljb> and then an echo of $($(quiet)cmd_cc). but how can i access the contents
  ljb> of the command script?

  ljb> an example command script:

  ljb>     $(WGET) http://someurl/somefile || exit 1

  ljb> i want to echo  "WGET   url" in this case, but that's
  ljb> nigh on impossible,

Correct.  There's no way to access the command script as a variable.

You could do this:

  PRINT_WGET = @echo WGET $1; $(WGET) $1

then in the command script:

    doit:
        $(call PRINT_WGET, http://someurl/somefile) || exit 1

but that's your only option.

-- 
-------------------------------------------------------------------------------
 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]