[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: is this a feature or a bug?
From: |
Sam Ravnborg |
Subject: |
Re: is this a feature or a bug? |
Date: |
Tue, 23 Nov 2010 21:34:49 +0100 |
User-agent: |
Mutt/1.5.18 (2008-05-17) |
On Tue, Nov 23, 2010 at 11:40:14AM -0800, James Sarrett wrote:
> Hi all,
>
> I was trying to write a very simple Makefile this morning, and was
> stymied! What I thought I meant was this:
>
> xrcs := *.xrc
> py_xrcs := $(xrcs:.xrc=_xrc.py)
>
> %_xrc.py: %.xrc
> pywxrc -pv $<
>
> all: $(py_xrcs)
>
> I have 2 .xrc files which need to be turned into _xrc.py files via
> pywxrc. I'm using GNU make 3.81 on Ubuntu 10.10 (maverick meerkat).
> What appears to actually happen is that the variable py_xrcs ends up
> with only the first filename returned by *.xrc translated to
> file1_xrc.py. I have found the workaround to be defining xrcs like this:
>
> xrcs := $(wildcard *.xrc)
>
> This seems like it should not be required. Is this a bug in patsubst?
>From the manual:
Wildcard expansion is performed by `make' automatically in targets
and in prerequisites. In commands the shell is responsible for
wildcard expansion. In other contexts, wildcard expansion happens only
if you request it explicitly with the `wildcard' function.
So the wildcard is needed because you want the expansion to happen
outside the prerequisites/targets.
Sam