Makefile generic pattern rule -- xyzzy-en_US.ext2 from xyzzy.ext0

Posted by Janne Savukoski on Stack Overflow See other posts from Stack Overflow or by Janne Savukoski
Published on 2010-06-17T18:19:07Z Indexed on 2010/06/17 18:23 UTC
Read the original article Hit count: 290

Filed under:
|
|

I can't figure out a way to define a generic pattern rule for the following kind of production with make:

require xyzzy-en_US.ext2 from xyzzy.ext0 via xyzzy.ext1.

This works:

all: xyzzy-en_US.ext2
# to be compiled from xyzzy.ext0

%.ext1 : %.ext0
  # produce xyzzy.ext1

%-en_US.ext2 : %.ext1
  # produce xyzzy-en_US.ext2

But how to generalize the locale part of the second rule? Or do I need to generate rules for all different locales?

Neither of these work:

%-??_??.ext2 : %.ext1
  # ...

%.ext2 : $(@,%-??_??.ext2,%.ext1)
  # ...

© Stack Overflow or respective owner

Related posts about makefile

Related posts about make