[Top][All Lists]

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

Re: DOCS: include a sample "Makefile"?

From: Werner LEMBERG
Subject: Re: DOCS: include a sample "Makefile"?
Date: Mon, 18 May 2009 07:38:49 +0200 (CEST)

> PS: There might be typos in my modifications, so please test them.

Uff, indeed there are typos.  Attached an improved version.



# This is a Makefile for `GNU make'!
# It uses extensions not available in most other `make' programs.

# The name stem of the output files.
piece = stamitz

# The command to run lilypond.
LILY_CMD = lilypond -ddelete-intermediate-files \

# The used suffixes in this Makefile.
.SUFFIXES: .ly .ily .pdf .midi

# Input and output files are searched in the directories listened in
# the VPATH variable.  All of them are subdirectories of the current
# directory (given by the GNU make variable `CURDIR').
  $(CURDIR)/Scores \
  $(CURDIR)/Parts \

# The pattern rule to create PDF and MIDI files from a LY input file.
# Output files are created in the `PDF' subdirectory.
%.pdf %.midi:
        cd PDF; $(LILY_CMD) $<

# A shorthand.
notes = \
  cello.ily \
  figures.ily \
  horn.ily \
  oboe.ily \
  trioString.ily \
  viola.ily \
  violinOne.ily \

# The dependencies of the full score.
$(piece).pdf: $(piece).ly $(notes)

# The dependencies of the movements.
$(piece)I.pdf: $(piece)I.pdf $(notes)
$(piece)II.pdf: $(piece)II.pdf $(notes)
$(piece)III.pdf: $(piece)III.pdf $(notes)
$(piece)IV.pdf: $(piece)IV.pdf $(notes)

# The dependencies of the parts.
cello.pdf: cello.ily \
                    figures.ily \
horn.pdf: horn.ily
oboes.pdf: oboe.ily
viola.pdf: viola.ily
violinOne.pdf: violinOne.ily
violinTwo.pdf: violinTwo.ily

# Say `make score' to generate the full score.
.PHONY: score
score: $(piece).pdf

# Say `make movements' to generate files for the
# four movements separately.
.PHONY: movements
movements: $(piece)I.pdf \
           $(piece)II.pdf \
           $(piece)III.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: cello.pdf \
       violinOne.pdf \
       violinTwo.pdf \
       viola.pdf \

# end of Makefile

reply via email to

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