Hi,
I looking to optimize an existing Makefile. It's used to create multiple plots (using Octave) for every logfile in a given directory using an scriptfile for every plot which takes a logfilename as an argument. In the Moment, I use one single rule for every kind of plot available, with a handwritten call to Octave, giving the specific scriptfile/logfile as an argument.
It would be nice, if every plot has "his" octave-script as a dependency (plus the logfile, of course), so only one plot is regenerated if his script is changed.
Since I don't want to type that much, I wonder how I can simplifiy this by using only one general rule to build "a" plot?
To make it clearer:
Logfile: "$(LOGNAME).log"
Scriptfile: "plot$(PLOTNAME).m" creates "$(LOGNAME)_$(PLOTNAME).png"
The first thing I had in mind:
%1_%2.png: %1.log
$(OCTAVE) --eval "plot$<2('$<1')"
But this seems not to be allowed. Could someone give me a hint?