Reputation: 27858
Is it possible to have wildcard targets for non-filenames, like:
build-%: pull-% build-%.stamp
pull-%:
cd $* ; git log HEAD..origin/master | grep -q . && ( git pull ; $(RM) ../build-$*.stamp ) || true
build-%.stamp:
cd $* ; ant
touch $@
The idea is to call make build-foo
, which will only call the build when there are new upstream changes (which get pulled).
However, the %
-pattern matching appears to apply to filenames only, even when defining the expanded form ("build-foo") in .PHONY.
Do I have to use templates, as used in Makefile generic pattern rule -- xyzzy-en_US.ext2 from xyzzy.ext0 ?
Upvotes: 1
Views: 494
Reputation: 99124
Ah! Put a semicolon after the build-%
rule.
(I didn't notice this problem because I put a command in the rule: @echo $@
.)
Upvotes: 2