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 $*
.
精彩评论