[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Wildcard limited to partial match in a single path component?
From: |
Paul Smith |
Subject: |
Re: Wildcard limited to partial match in a single path component? |
Date: |
Fri, 13 Jan 2012 17:06:23 -0500 |
On Fri, 2012-01-13 at 23:02 +0100, Maurice van der Pot wrote:
> I am trying to port a set of clearmake/SUN make makefiles for use with
> GNU make. In these makefiles I have rules like this:
>
> .%XB.h : %XB.itm
>
> For some reason it does not match a path/file like this:
>
> .dir/fileXB.h
See the GNU make manual section "How Patterns Match":
When the target pattern does not contain a slash (and it usually does
not), directory names in the file names are removed from the file name
before it is compared with the target prefix and suffix. After the
comparison of the file name to the target pattern, the directory names,
along with the slash that ends them, are added on to the prerequisite
file names generated from the pattern rule's prerequisite patterns and
the file name. The directories are ignored only for the purpose of
finding an implicit rule to use, not in the application of that rule.
Thus, `e%t' matches the file name `src/eat', with `src/a' as the stem.
When prerequisites are turned into file names, the directories from the
stem are added at the front, while the rest of the stem is substituted
for the `%'. The stem `src/a' with a prerequisite pattern `c%r' gives
the file name `src/car'.
If I'm understanding your description this explains the situation you
have.
--
-------------------------------------------------------------------------------
Paul D. Smith <address@hidden> Find some GNU make tips at:
http://www.gnu.org http://make.mad-scientist.net
"Please remain calm...I may be mad, but I am a professional." --Mad Scientist