[GNU Make] Generic phony rules
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Unix and Linux reviews > Free Unix support > Unix Programming > [GNU Make] Generic phony rules




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    [GNU Make] Generic phony rules  
* Tong *


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
03-22-07 06:27 PM

My OP:

I have the following make file:

-------------------------------------------
all: something else

.PHONY: MakeAppleJuice MakeOrangeJuice MakeTomatoJuice

MakeAppleJuice:
make_juice Apple.in.source  Apple.in.condition

MakeOrangeJuice:
make_juice Orange.in.source Orange.in.condition

MakeTomatoJuice:
make_juice Tomato.in.source Tomato.in.condition
-------------------------------------------

Is there anyway to combine the 3 rules into one? I hope there is, because
the 3 rules only different in what files they use and what juices then make
(but I still need the 3 phony targets).

On Thu, 22 Mar 2007 12:47:15 +0000, * Tong * wrote:

> On Wed, 21 Mar 2007 23:33:30 -0500, Jean-Rene David wrote:
> 
>
> Thanks for the reply. I still can't get it working:
>
> $ cat Makefile
> make_juice := echo
>
> all: something else
>
> .PHONY: MakeAppleJuice MakeOrangeJuice MakeTomatoJuice
>
> FORCE:
> Make%Juice: %.in.source FORCE
>         make_juice $*.in.source $*.in.condition
>
> #MakeAppleJuice:
>
> $ make MakeAppleJuice
> make: Nothing to be done for `MakeAppleJuice'.
>
> If the last "MakeAppleJuice:" is uncommented, It still won't work. My make
> is:
>
> $ make --version
> GNU Make 3.81
> 
>
> I don't quite understand this. You mean do a 'rm <target>' as the make rul
e?
>
> This is what I tried also:
>
> $ rm -v Apple.in.*
> removed `Apple.in.condition'
> removed `Apple.in.source'
>
> $ make MakeAppleJuice
> make: Nothing to be done for `MakeAppleJuice'.
>
> I read quite a lot, but just can't apprehend enough to make it works.

I just tried "Empty Target Files" trick,
http://www.gnu.org/software/autocon...f.net/techdocs/
http://xpt.sf.net/tools/

--
Posted via a free Usenet account from http://www.teranews.com






[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 10:06 AM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register