|
Home > Archive > Unix Programming > May 2005 > makefile dependancies
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
makefile dependancies
|
|
| Billy Patton 2005-05-19, 5:52 pm |
| assume i have file A
I need to run a program against the data in file A
As a result of this program it creates file b,c and d
So my target will need to be b,c and d
It needs to depend on file A.
If the shoe was on the other foot
it would be
A : b c d
But I need
b c d : a
If I had
b : a
<tab>program
c : a
<tab>progrma
d : a
<tab>program
The above 3 : definitions should work, but wouldn't it make the program run 3
times.
If make evaluates after each completion of a colon definition the the program
should only run once. If it evalues at compilation time then it will run 3
times.
I guess this should be easy enough to test. Guess Iv'e wasted band width and
time. Helps to write it out 
Three is just an example. some time there are 5 and others there is only 1.
I've read the Makefile manual and reread many parts. I'm getting much better
with the define and the $(shell ...) and the ifeq and all the other things gnu
make has to offer but that darn dependancies light bulb just hasn't fliked on
yet. It's still a cloud 
___ _ ____ ___ __ __
/ _ )(_) / /_ __ / _ \___ _/ /_/ /____ ___
/ _ / / / / // / / ___/ _ `/ __/ __/ _ \/ _ \
/____/_/_/_/\_, / /_/ \_,_/\__/\__/\___/_//_/
/___/
Texas Instruments ASIC Circuit Design Methodology Group
Dallas, Texas, 214-480-4455, b-patton@ti.com
| |
| Pascal Bourguignon 2005-05-19, 5:52 pm |
| Billy Patton <bpatton@ti.com> writes:
> assume i have file A
> I need to run a program against the data in file A
> As a result of this program it creates file b,c and d
>
> So my target will need to be b,c and d
> It needs to depend on file A.
>
> If the shoe was on the other foot
> it would be
>
> A : b c d
>
> But I need
> b c d : a
>
> If I had
> b : a
> <tab>program
>
> c : a
> <tab>progrma
>
> d : a
> <tab>program
>
> The above 3 : definitions should work, but wouldn't it make the
> program run 3 times.
> If make evaluates after each completion of a colon definition the the
> program should only run once. If it evalues at compilation time then
> it will run 3 times.
>
> I guess this should be easy enough to test. Guess Iv'e wasted band
> width and time. Helps to write it out 
Yes, just write what you need:
b c d : a
<tab>program
--
__Pascal Bourguignon__ http://www.informatimago.com/
Our enemies are innovative and resourceful, and so are we. They never
stop thinking about new ways to harm our country and our people, and
neither do we. -- Georges W. Bush
|
|
|
|
|