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: 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.


   Werner


======================================================================


#
# 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 \
                    -dno-point-and-click

# 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').
VPATH = \
  $(CURDIR)/Scores \
  $(CURDIR)/PDF \
  $(CURDIR)/Parts \
  $(CURDIR)/Notes

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

# A shorthand.
notes = \
  cello.ily \
  figures.ily \
  horn.ily \
  oboe.ily \
  trioString.ily \
  viola.ily \
  violinOne.ily \
  violinTwo.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.ly cello.ily \
                    figures.ily \
                    trioString.ily
horn.pdf: horn.ly horn.ily
oboes.pdf: oboes.ly oboe.ily
viola.pdf: viola.ly viola.ily
violinOne.pdf: violinOne.ly violinOne.ily
violinTwo.pdf: violinTwo.ly 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 \
           $(piece)IV.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 \
       oboes.pdf
       horn.pdf

# end of Makefile




reply via email to

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