[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: |
Sat, 14 Jan 2012 09:34:39 -0500 |
On Sat, 2012-01-14 at 00:19 +0100, Maurice van der Pot wrote:
> > Or, and I don't know if this works, what about:
> >
> > ./.%XB.h: ./%XB.h
>
> That does not seem to match a target of .ABC/ABCXB.h
Yes, I was afraid of this. Make has some special handling for "./" to
treat it as a no-op so that rules that include it match properly with
rules that don't (e.g., "foo.c" and "./foo.c" are treated as the same
file).
I tried an experiment and this will work (if it helps):
$(CURDIR)/.%XB.h: %XB.itm
However, it also means you have to add $(CURDIR)/ to all your targets;
e.g.:
all: $(CURDIR)/.ABC/ABCXB.h
You can get away with a relative path but it must be more complex than
"./"; for example:
TARGETDIR = ../$(notdir $(CURDIR))
all: $(TARGETDIR)/.ABC/ABCXB.h
$(TARGETDIR)/.%XB.h : %XB.itm
You can, of course, use make functions like $(addprefix ...) to
construct these names.
Or, you can use what you have already :-)
--
-------------------------------------------------------------------------------
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