In message <4a0d9dd6.4070...@gmail.com>, Jonathan Kulp
<jonlancek...@gmail.com> writes
Anthony W. Youngman wrote:
parts:
for LILYFILE in Parts/*.ly ; do $(LILY_CMD) "$$LILYFILE" ; done
mv *.pdf $(OUTDIR)/
It works exactly as it did with the GNU wildcard, except that multiple files
can't be compiled at once with separate processors. I'll probably stick
with the GNU wildcard approach in my personal makefiles, or else have
both lines in there with one commented out.
My bash-fu is minimal to non-existent, but couldn't you do something
like
for LILYFILE in Parts/*.ly ; do $(LILY_CMD) "$$LILYFILE" & ;
done
wait
mv *.pdf $(OUTDIR)/
?
I'm sure there's a command, and I think it is "wait", that says to
wait
and collect status from all the jobs you've just spawned, so the mv
wouldn't run until all the LILY_CMD commands had completed.
Cheers,
Wol
It already waits until all of the files have been run before moving
them. It just loops until it has done all of the files, then proceeds
to the next line and does the "mv" command.
I think you missed the "&" in my code :-)
If the "wait" isn't there, the mv will fail because there won't be any
*.pdf files for it to move. Werner's point about multiple invocations of
lilypond is very valid, but on a multi-processor machine my technique
will use all processors. It'll probably be a bit slower on a
uni-processor, though.
To explain ... let's say there are 10 lily files to process, each of
which takes maybe 30 secs? My bash-fu thinks this technique will run
lily 10 times, once for each file. WITHOUT the ampersand, the 10
instances run in sequence, taking 5 minutes, and then the code moves on
to the mv. WITH the ampersand, all ten instances are fired off at once,
taking maybe 15 seconds, and then the code moves on to the next line. If
that's the 'mv', then it won't find any pdfs! That's the point of the
"wait" - to say "wait until all the lilys have finished before carrying
on".
Cheers,
Wol
--
Anthony W. Youngman - anth...@thewolery.demon.co.uk
_______________________________________________
lilypond-devel mailing list
lilypond-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-devel