bug-make
[Top][All Lists]
Advanced

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

Re: Explicit, implicit rule chain doesn't work in created dirs


From: barkalow
Subject: Re: Explicit, implicit rule chain doesn't work in created dirs
Date: Wed, 28 Aug 2002 11:49:16 -0400 (EDT)

On Wed, 28 Aug 2002, Paul D. Smith wrote:

> %% <address@hidden> writes:
>
>   n>   if (lookup_file (p) != 0 ||
>   n>       ((!dep->changed || check_lastslash) && file_exists_p (p)))
>
> I'll look at this more closely.

Thanks. Another thing I forgot: if you ask make to make that target
directly, it will do so, which makes the problem much more confusing.

>   n> Ideally it would be possible to tell make that the date on some
>   n> targets is never important, rather than using the --old-file=
>   n> parameter anytime it changes.
>
> You can do this in the next version of GNU make.  There is a feature
> which allows you to declare a dependency for ordering purposes only, but
> which doesn't impact the rebuild/don't rebuild decision (the update time
> is ignored).

Cool. :) Does it build the target if it doesn't exist at all? (--old-file=
doesn't in 3.78, which I find odd: is assumes the file exists as well as
being really old)

Will you also be able get to the -r effect from inside the Makefile?

> Nevertheless, I think this is not an elegant way of handling this
> problem.  I still feel it's too much work (and looks messy as well) to
> declare the directory as a prerequisite to every single target.

I agree if it's for every single target, but I like it when it's only for
a small set of the targets, like:

dist:
        mkdir -p dist

dist/%: % dist
        cp $< $@

dist.tar: dist/foo dist/bar
        tar -cf $@ dist

That way you only get the directory when you're actually going to need it.

>   >> _foo := $(shell [ -d dir/subdir ] || mkdir -p dir/subdir)
>
>   n> It would be nice if the documentation suggested that...
>
> I thought I had added this to the docs, actually, but I don't see it
> now.  Either I dreamed it or I added it somewhere else.

Glad to know, at least, that I wasn't just failing to read it. :)

        -Daniel
*This .sig left intentionally blank*





reply via email to

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