开发者

Using a pattern match in a makefile rule

I have a makefile with rules that look like this:

data/foo-trunk.xml:
    svn log -v --xml http://www.example.com/svn/foo/trunk > $@

data/bar-trunk.xml:
    svn log -v --xml http://www.example.com/svn/bar/trunk > $@

data/baz-trunk.xml:
    svn log -v --xml http://www.example.com/svn/baz/trunk > $@

How could I abstract this into a rule? For example, is there a way to do something like this (i.开发者_开发问答e., what would replace the ???)

data/%-trunk.xml:
    svn log -v --xml http://www.example.com/svn/???/trunk > $@


Assuming GNU Make, ??? should be $*.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜