help-make
[Top][All Lists]
Advanced

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

Re: Variables within Pattern Rules


From: Paul D. Smith
Subject: Re: Variables within Pattern Rules
Date: Wed, 5 Jan 2005 15:22:48 -0500

%% Barry Clarkson <address@hidden> writes:

  bc> How do you create a variable on the fly within a
  bc> pattern rule?

  bc> DEF=`echo $(basename $<) | tr '[a-z]' '[A-Z]'`_DEFS

  bc> ...so that I can perform...

  bc> gcc -DMYFILE_DEFS myfile.c ...
  bc> gcc -DANOTHERFILE_DEFS anotherfile.c ...

  bc> ...for each prerequisite.

  bc> Thanks in advance,

What you have here seems to me like it will work, assuming you finish it
(pass -D$(DEF) to the compiler line).

What's the problem?

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