[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Pulling parts from a filename.
From: |
Mike Shal |
Subject: |
Re: Pulling parts from a filename. |
Date: |
Wed, 9 Jun 2010 11:19:12 -0400 |
On 6/9/10, Todd Showalter <address@hidden> wrote:
> On Wed, Jun 9, 2010 at 4:46 AM, Oleksandr Gavenko <address@hidden> wrote:
>
> > FOO_FNT = foo_14.fnt foo_13.fnt foo_10.fnt
> > BAR_FNT = bar_12.fnt bar_9.fnt
> >
> > FNT = $(FOO_FNT) $(BAR_FNT)
> >
> > all: $(FNT)
> >
> > $(FOO_FNT): foo_%.fnt: foo.otf
> > fontgen -f $* $< $@
> >
> > $(BAR_FNT): bar_%.fnt: bar.otf
> > fontgen -f $* $< $@
>
>
> Thanks, but this doesn't quite solve the problem; I've already
> got something akin to that in my current makefile. What I'm trying to
> determine is if there's a way I can (sanely) unify the $(FOO_FNT) and
> $(BAR_FNT) rules, so I don't have to add another one for $(BAZ_FNT)
> and $(QUUX_FNT) and so on somewhere down the road. What I want is a
> rule for which the target is $(FNT).
I don't know if this helps or not, but you can separate the command
from the dependency listing:
FOO_FNT = foo.14.fnt foo.13.fnt foo.10.fnt
BAR_FNT = bar.12.fnt bar.9.fnt
FNT = $(FOO_FNT) $(BAR_FNT)
all: $(FNT)
$(FNT):
@echo fontgen -p $(subst .,,$(suffix $(basename $@))) $< $@
# generate and include these?
$(FOO_FNT): foo.otf
$(BAR_FNT): bar.otf
You might then be able to generate the foo.14.fnt: foo.otf relation
and include it as a separate makefile (like how you would generate and
include a .d file for C programs).
-Mike