automake-ng
[Top][All Lists]
Advanced

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

Re: [Automake-NG] [PATCH] [ng] dirstamp: remove, use inlined parent dire


From: Stefano Lattarini
Subject: Re: [Automake-NG] [PATCH] [ng] dirstamp: remove, use inlined parent directory creation instead
Date: Fri, 25 May 2012 10:14:10 +0200

On 05/25/2012 09:58 AM, Akim Demaille wrote:
> 
> Le 21 mai 2012 à 16:19, Stefano Lattarini a écrit :
> 
>> As a first step, instead of emitting rules like:
>>
>>    sub/foo.o: sub/foo.c sub/.dirstamp
>>        $(CC) $(CFLAGS) sub/foo.c
>>    sub/.dirstamp:
>>        mkdir sub && touch sub/.dirstamp
>>
>> we might simply emit rules like:
>>
>>    sub/foo.o: sub/foo.c
>>        $(MKDIR_P) $(@D)
>>        $(CC) $(CFLAGS) sub/foo.c
>>
>> But the above would be quite wasteful if we really called $(MKDIR_P) for
>> every created object file, since the directory $(@D) will likely already
>> exist (in an in-tree build, it will exist unconditionally and beforehand,
>> and in a VPATH build will exists after the first object file in it has
>> been created).
> 
> Maybe order-only prerequisites can help here?
>
Nope, I had tried to use them in my first shot at this patch, and they
don't work in a VPATH build:

    $ mkdir src build src/sub
    $ cat > build/Makefile << 'END'
    VPATH = ../src
    sub/out: | ./sub
            : > $@
    END
    $ make
    : > sub/out
    /bin/sh: sub/out: No such file or directory
    make: *** [sub/out] Error 1

Really sad :-(

Regards,
  Stefano



reply via email to

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