help-make
[Top][All Lists]
Advanced

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

Re: reuse recipe


From: Paul Smith
Subject: Re: reuse recipe
Date: Fri, 28 Jan 2011 07:30:02 -0500

On Fri, 2011-01-28 at 12:01 +0100, Klaus Rudolph wrote:
> %.x: %.yy
>     <do something>
> 
> %.x: %.abc
>     <do something>
> 
> I want to use <do something> for both rules without rewriting it.

Use a variable:

        SOMETHING = <do something>
        
        %.x : %.yy
                $(SOMETHING)
        %.x : %.abc
                $(SOMETHING)

-- 
-------------------------------------------------------------------------------
 Paul D. Smith <address@hidden>          Find some GNU make tips at:
 http://www.gnu.org                      http://make.mad-scientist.net
 "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]