Am 26.05.2009, 04:13 Uhr, schrieb Jonathan Kulp <jonlancek...@gmail.com>:
I had to comment out one more thing before it would run properly, though--the "-djob-count" option, something we put in on the Linux version to take advantage of dual processors. It choked on that saying "unbound variable 'primitive-fork'". This could be because I'm running on a virtual machine, though. Did it work properly for you with the multiple jobs option?
Hi Jon, it worked properly for me. Maybe you got the long line cut like I saw it on the gmane web interface. Below I put a version with three lines for the lilypond command (as attachement also). BTW: I got no difference with the "-djob-count" or without it. With the option: 2:45.218 without : 2:45.000(!) (On a 2.2GHz Athlon 64 X2 Dual Core Processor--is that a normal time?) Seems as if the option should be omitted on Windows for simplicity. I also got a way to work around the path-with-blank(s) problem. Instead of CURDIR I fill and use a variable "workdir" in VPATH. (Change the name if you like, I'm not a native speaker.) The used technique for getting the 8.3 version of CURDIR is explained near the end of the help for the command for ("for /h" on the Windows commandline). Instead of %%b %%a could be used, but as a German I don't like sa... I am looking for a way to distinguish from within the makefile if make is running on Linux or Windows. Perhaps we could use the environment variable "OS" which is OS=Windows_NT on my computer. make has "ifdef variable-name" and "ifeq (arg1, arg2)", so there should be a chance. Then perhaps it could be possible to have the same makefile for Linux (and OSX?) and Windows. Does Linux have a varialble OS? If not, we can check for existence, if yes we check the value. Regarding the mid/midi thing: We could use -dmidi-extension to set the default file extension for MIDI output file to midi, but that touches the question of the proper extension for midi. (http://news.gmane.org/find-root.php?message_id=%3c20090408193658.GA2963%40zonnet.nl%3e) Could we let lilypond give us the answer itself? On Windows: MidiExtWithQuotes = $(shell for /f "delims=() tokens=2" %%a in \ ('lilypond -dhelp 2^>nul^|find "midi-extension"') \ do echo %%a) How can this be achived on Linux? You would have to build a command that gives midi and nothing else. Henning ######## # the name stem of the output files piece = stamitz # The command to run lilypond LILY_CMD = lilypond -ddelete-intermediate-files \ -dno-point-and-click \ -djob-count=$(NUMBER_OF_PROCESSORS) #get the 8.3 name of CURDIR workdir = $(shell for /f "tokens=*" %%b in ("$(CURDIR)") \ do @echo %%~sb) # let lilypond tell us the default midi extension MidiExtWithQuotes = $(shell for /f "delims=() tokens=2" %%a in \ ('lilypond -dhelp 2^>nul^|find "midi-extension"') \ do echo %%a) #remove all doublequotes MidiExt = $(subst ",,$(MidiExtWithQuotes)) # The suffixes used in this Makefile. .SUFFIXES: .ly .ily .pdf .$(MidiExt) # Input and output files are searched in the directories listed in # the VPATH variable. All of them are subdirectories of the current # directory (given by the workdir variable which is the 8.3 version # of the GNU make variable `CURDIR'). VPATH = \ $(workdir)/Scores \ $(workdir)/PDF \ $(workdir)/Parts \ $(workdir)/Notes # The pattern rule to create PDF and MIDI files from a LY input file. # The .pdf output files are created in the `PDF' subdirectory, and the # .midi files are put into the `MIDI' subdirectory. %.pdf %.$(MidiExt): %.ly $(LILY_CMD) $< if exist "$*.pdf" move /Y "$*.pdf" PDF/ if exist "$*.$(MidiExt)" move /Y "$*.$(MidiExt)" MIDI/ notes = \ cello.ily \ figures.ily \ horn.ily \ oboe.ily \ trioString.ily \ viola.ily \ violinOne.ily \ violinTwo.ily # The dependencies of the movements. $(piece)I.pdf: $(piece)I.ly $(notes) $(piece)II.pdf: $(piece)II.ly $(notes) $(piece)III.pdf: $(piece)III.ly $(notes) $(piece)IV.pdf: $(piece)IV.ly $(notes) # The dependencies of the full score. $(piece).pdf: $(piece).ly $(notes) # The dependencies of the parts. $(piece)-cello.pdf: $(piece)-cello.ly cello.ily \ figures.ily \ trioString.ily $(piece)-horn.pdf: $(piece)-horn.ly horn.ily $(piece)-oboes.pdf: $(piece)-oboes.ly oboe.ily $(piece)-viola.pdf: $(piece)-viola.ly viola.ily $(piece)-violinOne.pdf: $(piece)-violinOne.ly violinOne.ily $(piece)-violinTwo.pdf: $(piece)-violinTwo.ly violinTwo.ily # Say `make score' to generate the full score of all four # movements as one file. .PHONY: score score: $(piece).pdf # Say `make parts' to generate all parts. # Say `make foo.pdf' to generate the part for instrument `foo'. # Example: `make cello.pdf'. .PHONY: parts parts: $(piece)-cello.pdf \ $(piece)-violinOne.pdf \ $(piece)-violinTwo.pdf \ $(piece)-viola.pdf \ $(piece)-oboes.pdf \ $(piece)-horn.pdf # Say `make movements' to generate files for the # four movements separately. .PHONY: movements movements: $(piece)I.pdf \ $(piece)II.pdf \ $(piece)III.pdf \ $(piece)IV.pdf all: score parts movements #archive: # tar -cvvf stamitz.tar \ # --exclude=*pdf --exclude=*~ \ # --exclude=*$(MidiExt) --exclude=*.tar \ # ../Stamitz/*
Makefile
Description: Binary data
_______________________________________________ lilypond-devel mailing list lilypond-devel@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-devel