]> git.donarmstrong.com Git - lilypond.git/blob - make/ly.make
patch::: 1.3.144.jcn6
[lilypond.git] / make / ly.make
1 #!/usr/bin/make
2 #
3 # Mutopia Makefile Project
4 #
5 # Rename this file to GNUmakefile, and issue `make help'
6 #
7
8
9 #
10 # Magic: find and include LilyPond's StepMake rules
11 #
12 # 0: try local tree
13 # 1: follow LILYPONDPREFIX
14 # 2: try source tree in home
15 # 3: try installed tree in $HOME
16 # 4: try system installed tree
17 # 5: try system installed tree
18 #
19 make-root=$(wildcard $(depth)/make)
20 make-root?=$(wildcard $(LILYPONDPREFIX)/make)
21 make-root?=$(wildcard $(HOME)/usr/src/lilypond/make)
22 make-root?=$(wildcard $(HOME)/usr/share/lilypond/make)
23 make-root?=$(wildcard /usr/share/lilypond/make)
24 make-root?=$(wildcard /usr/local/share/lilypond/make)
25 #make-root=<LilyPond's datadir>/make
26 ifneq ($(make-root),)
27 ### some versions apparently choke on $(message)
28 ### $(message running from $(make-root))
29 depth:=$(make-root)/..
30 LOCALSTEPMAKE_TEMPLATES=ly mutopia
31 include $(make-root)/stepmake.make
32 else
33 $(error can't find LilyPond's stepmake installation)
34 endif
35 #
36
37
38 #
39 # Mutopia/user targets.
40 # This needs some work.
41 #
42
43 #
44 # Name of mutopia project
45 #
46 name=book
47 tarball=$(name)
48 parts=$(patsubst %.ly,%,$(wildcard *-part.ly))
49
50 #
51 # scores for target local-WWW (duh)
52 #
53 examples=
54
55 #
56 # scores for target mutopia
57 #
58 mutopia-examples=$(name) $(parts)
59
60 #
61 # Timothy's booklet
62 #
63 $(outdir)/%-book.ps: $(outdir)/%.ps
64         psbook $< $<.tmp
65 #       pstops '2:0L(11.45in,0.25in)+1L(11.45in,5.6in)' $<.tmp $@
66         pstops  '2:0L@.7(21cm,0)+1L@.7(21cm,14.85cm)' $<.tmp $@
67
68 #
69 # Catch-all target: type `make foo' to make out/foo.ps,
70 # or make `foo-book' to make out/foo-book.ps
71 #
72 %: $(outdir)/%.ps
73         @echo Generated $< for target $@.
74
75 #
76 # Also clean hand-compiled stuff in cwd
77 #
78 local-clean: local-auto-gen-clean
79
80 # Compose string from two parts: must not remove myself.
81 auto-gen-tag=Generated
82 auto-gen-tag+= automatically by
83
84 local-auto-gen-clean:
85         rm -f `grep -l '$(auto-gen-tag)' *`
86         rm -f *.dvi *.png
87