[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: why does make strip / at the end of a directory prerequisite??
From: |
Mark Galeck (CW) |
Subject: |
RE: why does make strip / at the end of a directory prerequisite?? |
Date: |
Thu, 8 Sep 2011 07:01:47 -0700 |
Thank you Lane for a very thorough explanation.
I am still however not 100% convinced that make strips away "/" and treats "%/"
as %, and this pattern would match everything:
%/:
touch $@
address@hidden: make foobar
make: *** No rule to make target `foobar'. Stop.
address@hidden: make foobar/
touch foobar/
touch: setting times of `foobar/': No such file or directory
make: *** [foobar/] Error 1
Definitely only the second one matched.
>I assume that your overall goal is to have a single rule that can be
used to create directories, but won't fire for non-directory files. If
so, then you should be able to accomplish that goal by using your fix,
then specifying "x/." as the prerequisite in each rule that needs a
directory "x" to exist:
%/.:
mkdir -p $@
dir/foobar: dir/.
touch $@
Yes I found that too, but, for some other reasons which I don't want to go into
right now, adding /. is too much. Being able to add only / would be perfect.
Mark