Hello everybody,

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/$@

dir:
   mkdir -p $@

VPATH=dir

clean::
   $(RM) -r dir

If I run make for the first time:
mkdir -p dir
touch dir/first
ls first
ls: cannot access first: No such file or directory

.. and second time:
ls dir/first
dir/first
.. voila!


1) Why does the make need two steps?
2) If it is a normal behavior, why did the make let the upmost rule run in
the first run even the prerequisite 'first' didn't exist? (ls first)

Kind Regards,
Gökçe
_______________________________________________
Help-make mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/help-make

Reply via email to