lilypond-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: DOCS: include a sample "Makefile"?


From: Jonathan Kulp
Subject: Re: DOCS: include a sample "Makefile"?
Date: Sun, 17 May 2009 09:29:56 -0500
User-agent: Thunderbird 2.0.0.21 (X11/20090409)

Peter Chubb wrote:

There are alternatives.  The main objection I have to the form of
makefile you propose is that dependencies are not tracked, so editing
one file will either not rebuild anything, or will rebuild everything
(depending on the rules).

In general, it's best to name all the inputs directly.
--

An excellent objection.  I've tried this makefile you posted:

.SUFFIXES: .pdf .ps .ly .midi
%.pdf %.midi: %.ly
        lilypond $<

INPUTS= $(wildcard *.ly)


all: Pieces.pdf

Pieces.pdf Pieces.midi : $(INPUTS)

clean:
        rm -f *.pdf *.midi *.ps *~


And I like how it tracks whether the pdf is up-to-date. I'm trying now to adapt it to the stamitz symphony, and I've gotten it to compile the score, but if I run "make score" again (while there's a current pdf output of the file in the PDF dir), instead of saying it's up-to-date, it compiles the file again. Can you tell me which part of the makefile keeps track of the pdf output? Here's what I'm using:

piece= stamitz
LILY_CMD=lilypond -ddelete-intermediate-files -dno-point-and-click
SUFFIXES: .ly .pdf .view
LILY_PARTS: `ls Parts/*.ly`
.ly.pdf:
        ${LILY_CMD} $<

%.pdf %.midi: %.ly


PDF/${piece}.pdf: Scores/${piece}.ly

score: PDF/${piece}.pdf
        $(LILY_CMD) Scores/${piece}.ly
        mv ${piece}.pdf PDF/


###

The score source files are all in the Scores/ dir, the .pdf output gets moved to the PDF/ dir. I need to make it keep an eye on the PDF/ dir but I don't understand which part of the Makefile does this.

I don't understand exactly what these lines do, either:

.ly.pdf:
        ${LILY_CMD} $<

%.pdf %.midi: %.ly


Also, what is the significance of the curly braces instead of parentheses in ${piece}?

I have to attend the university graduation ceremonies today--an excellent opportunity to study some of the makefiles you guys have posted. I can print them out and slip them inside my graduation program... ;)

Jon
--
Jonathan Kulp
http://www.jonathankulp.com




reply via email to

[Prev in Thread] Current Thread [Next in Thread]