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