help-make
[Top][All Lists]
Advanced

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

Re: Why does make behave like this?


From: Dave Hylands
Subject: Re: Why does make behave like this?
Date: Mon, 27 Mar 2006 13:25:23 -0800

I sent this to Rodrigo and forgot to do a Reply-All, so I'm sending it
to the list now.

Hi Rodrigo,

> This is a make file I wrote, and what happens when I use it:
>
> all: temp/t1 temp/t2
>
> temp/t%: t%
>
> t1:
>
> When I run 'make', I get the output:
>
> ls > t1
> ls > t2
> mkdir -p temp
> ls > temp/t1
> make: *** No rule to make target `temp/t2', needed by `all'.  Stop.

Make has two distinct passes. In the first pass, make just considers
the targets and dependencies. In the second pass, make executes rules
to build stuff that's out of date.

After running the first pass, temp/t2 doesn't exist, and t2 doesn't
exist, and no rules exist to create t2, so make doesn't know how to
build temp/t2.

Make has no way of divining that building t1 will somehow cause t2 to
be created.

--
Dave Hylands
Vancouver, BC, Canada
http://www.DaveHylands.com/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]