Reputation: 7326
I want to include a rule in my makefile for converting my lazy c++ .lzz
files into their respective .h
and .cpp
files.
It seems to me to be a slightly unusual case where two files depend on one, and I'm not confident that I'll be able to get the dependencies set up correctly.
# something like...
%.cpp %.h : %.lzz
lzz $<
Anyone have a rule that works well?
Upvotes: 1
Views: 321
Reputation: 730
That looks right to me.
From the make info pages:
A rule with multiple targets is equivalent to writing many rules, each with one target, and all identical aside from that. The same commands apply to all the targets, but their effects may vary because you can substitute the actual target name into the command using `$@'. The rule contributes the same prerequisites to all the targets also.
Upvotes: 2