]> git.donarmstrong.com Git - lilypond.git/blob - GNUmakefile.in
0da6f9ad5e27f17694c876ebc0019649ce68422e
[lilypond.git] / GNUmakefile.in
1 # -*-Makefile-*-
2 # title    specific top level makefile for LilyPond  
3
4 # subdir level:
5 #
6 depth = .
7 #
8
9 # descent order into subdirectories
10
11 SUBDIRS = buildscripts scripts flower lily \
12         mf ly tex ps scm \
13         python po make intl \
14         debian $(builddir)/stepmake \
15         Documentation input
16 #
17
18 SCRIPTS = configure aclocal.m4 autogen.sh
19 README_FILES =  ChangeLog CHANGES COPYING DEDICATION NEWS README.mandrake ROADMAP
20 README_TXT_FILES = AUTHORS.txt README.txt INSTALL.txt FAQ.txt
21 IN_FILES := $(wildcard *.in)
22 EXTRA_DIST_FILES = $(wildcard *.el) vimrc VERSION $(README_FILES)  $(SCRIPTS) $(IN_FILES)  emacsclient.patch lexer-gcc-3.0.patch darwin.patch .cvsignore
23 NON_ESSENTIAL_DIST_FILES = $(README_TXT_FILES)
24 INSTALLATION_DIR=$(datadir)
25 INSTALLATION_FILES=$(configuration) VERSION
26
27 # bootstrap stepmake:
28 #
29 STEPMAKE_TEMPLATES=toplevel po install
30 include $(depth)/make/stepmake.make 
31 #
32
33 footify:
34         $(footify) --index=./ `$(FIND) . -maxdepth 1 -name '*.html' -print`
35         $(footify-all-command)
36
37 fonts:
38         $(MAKE) -C $(depth)/mf
39
40 run-reqs: builddir-setup fonts lily
41 web-reqs: run-reqs pfa-fonts
42
43 doc: run-reqs
44         $(MAKE) -C Documentation
45
46 web-doc: web-reqs
47         $(MAKE) out=www -C Documentation WWW
48         $(MAKE) footify
49
50 pfa-fonts:
51         $(MAKE) MAKE_PFA_FILES=1 -C mf
52
53 docdir = $(prefix)/share/doc/lilypond-$(TOPLEVEL_VERSION)
54 install-html-doc: html-doc
55         $(INSTALL) -d $(docdir)/html 
56         tar -C $(docdir)/html -zxf $(outdir)/web.tar.gz
57
58 # KPATHSEA=0: Hack for compiling without kpathsea -- not recommended
59 my_tfm_path = $(TFM_PATH) /tmp /tmp /tmp /tmp /tmp /tmp 
60
61
62 local-install:
63         $(INSTALL) -d $(datadir)
64 ifeq ($(KPATHSEA),0)
65         $(foreach i, 1 2 3 4 5, rm -f $(datadir)/tfm.$(i); $(LN_S) $(word $(i), $(my_tfm_path)) $(datadir)/tfm.$(i) ; )
66 endif
67
68
69 TOP_HTMLS = index.html short-examples.html long-examples.html
70
71 short-examples: web-reqs
72         $(MAKE) out=www -C input WWW
73         $(PYTHON) $(buildscript-dir)/mutopia-index.py -o $(builddir)/$@.html input/
74
75 long-examples: web-reqs
76         $(MAKE) out=www -C mutopia WWW
77         $(PYTHON) $(buildscript-dir)/mutopia-index.py -o $(builddir)/$@.html mutopia/
78
79 lily: lily/$(outdir)/lilypond
80
81 lily/$(outdir)/lilypond:
82         $(MAKE) -C lily
83
84 local-web: web-doc $(TOP_HTMLS:%.html=%) footify do-top-doc top-web
85
86 web-ext = gz html midi pdf png txt
87 top-web:
88         cd $(builddir) && rm -f `find . -name \*.html~ -print`
89         cd $(builddir) && find Documentation input mutopia \
90                 $(web-ext:%=-path '*/out-www/*.%' -or) -false \
91                 > $(outdir)/weblist
92         cd $(builddir) && ls *.png *.html >> $(outdir)/weblist
93         cat $(outdir)/weblist | (cd $(builddir); GZIP=-9v tar -czf $(outdir)/web.tar.gz  -T -)
94
95 src-ext = c cc yy ll hh icc py scm tex ps texi itexi tely itely sh
96 ALL-TAGS:
97         etags $(shell find . $(src-ext:%=-name '*.%' -or) -false | grep -v '/out')
98
99 local-WWW:
100
101 web: local-web
102 html-doc: web
103 index: web
104
105 local-WWW-clean: top-WWW-clean
106
107 WWW-clean:
108         $(MAKE) -C Documentation WWW-clean
109         $(MAKE) -C input WWW-clean
110         $(MAKE) -C mutopia WWW-clean
111
112 top-WWW-clean:
113         cd $(depth)/$(builddir) && rm -f $(TOP_HTMLS) lily-[0-9]*.png
114         $(SHELL) $(buildscript-dir)/clean-fonts.sh
115
116 WWW:
117
118 default: builddir-setup
119
120 builddir-setup: $(depth)/$(builddir)/share/lilypond/$(TOPLEVEL_VERSION)-force
121
122 $(depth)/$(builddir)/share/lilypond/$(TOPLEVEL_VERSION)-force:
123         # Preparing LilyPond tree for builddir exec
124         @echo Making $(depth)/$(builddir)/share 
125         @cd $(depth)/$(builddir) && rm -rf share
126         @cd $(depth)/$(builddir) && mkdir -p share/lilypond
127         @cd $(depth)/$(builddir)/share/lilypond && mkdir -p $(TOPLEVEL_VERSION)
128         @cd $(depth)/$(builddir)/share/lilypond/$(TOPLEVEL_VERSION) && \
129                 ln -s ../../../$(srcdir)/ly ly && \
130                 ln -s ../../../mf/$(outconfbase) dvips && \
131                 ln -s ../../../mf/$(outconfbase) afm && \
132                 ln -s ../../../mf/$(outconfbase) tfm && \
133                 ln -s ../../../$(srcdir)/mf && \
134                 ln -s ../../../$(srcdir)/ps && \
135                 ln -s ../../../$(srcdir)/scm
136         @cd $(depth)/$(builddir)/share/lilypond/$(TOPLEVEL_VERSION) && \
137                 mkdir tex
138         @cd $(depth)/$(builddir)/share/lilypond/$(TOPLEVEL_VERSION)/tex && \
139                 ln -s ../../../../$(srcdir)/tex source && \
140                 ln -s ../../../../mf/$(outconfbase) generate
141         @cd $(depth)/$(builddir)/share/lilypond/$(TOPLEVEL_VERSION) && \
142                 mkdir fonts
143         @cd $(depth)/$(builddir)/share/lilypond/$(TOPLEVEL_VERSION)/fonts && \
144                 ln -s ../../../../$(srcdir)/mf source && \
145                 ln -s ../../../../mf/$(outconfbase) afm && \
146                 ln -s ../../../../mf/$(outconfbase) tfm && \
147                 ln -s ../../../../mf/$(outconfbase) type1
148
149 local-clean: builddir-setup-clean
150 builddir-setup-clean:
151         @cd $(depth)/$(builddir) && rm -rf share