On Tue, Aug 20, 2013 at 6:05 PM, Ahmet Gökçe <[email protected]> wrote:

> I use some tools which create outputs on subdirectories. If I want to use
> the created files in subsequent rules, I must run make for the second time
> that these prerequisites can be found.
>
> Example:
> second: first
>    @ls $<
>
> first: | dir
>    @touch dir/$@
>

To quote http://make.paulandlesley.org/rules.html

    Every non-.PHONY rule must update a file with the exact name of its
target.
    Make sure every command script touches the file "$@"-- not "../$@", or
"$(notdir $@)", but
    exactly $@. That way you and GNU make always agree.

That rule in your makefile violates the above guidance and the odd results
you're experiencing are *exactly* caused by it.  Go read that page, as well
as http://make.paulandlesley.org/vpath.html for thoughts on how to solve
your overall problem.


Philip Guenther
_______________________________________________
Help-make mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/help-make

Reply via email to