]> git.donarmstrong.com Git - lilypond.git/blob - GNUmakefile.in
f6389fbe3f7a0b4aae02d30ec1b7afc911c6e41a
[lilypond.git] / GNUmakefile.in
1 # -*-Makefile-*-
2
3 depth = .
4
5 SUBDIRS = python scripts \
6         flower lily \
7         mf ly \
8         tex ps scm \
9         po make \
10         elisp vim \
11         input \
12         stepmake $(documentation-dir)
13
14
15 ## this convoluted construction is necessary, since we don't know the
16 ## value of DOCUMENTATION here.
17 documentation-dir=$(if $(findstring no,$(DOCUMENTATION)),,Documentation)
18
19 SCRIPTS = configure autogen.sh smart-autogen.sh smart-configure.sh
20 README_FILES = COPYING DEDICATION ROADMAP THANKS HACKING
21 TOPDOC_FILES = AUTHORS INSTALL README NEWS
22 TOPDOC_TXT_FILES = $(addprefix $(top-build-dir)/Documentation/topdocs/$(outdir)/,$(addsuffix .txt,$(TOPDOC_FILES)))
23 IN_FILES := $(call src-wildcard,*.in)
24
25 EXTRA_DIST_FILES = VERSION .gitignore SConstruct lilypond-texi2html.init \
26   $(README_FILES) $(SCRIPTS) $(IN_FILES) 
27 INSTALLATION_DIR=$(local_lilypond_datadir)
28 INSTALLATION_FILES=$(config_make) VERSION
29
30 # bootstrap stepmake:
31 #
32 STEPMAKE_TEMPLATES=toplevel po install
33 LOCALSTEPMAKE_TEMPLATES=lilypond
34
35 include $(depth)/make/stepmake.make
36
37
38 local-dist: dist-toplevel-txt-files 
39
40 all: $(outdir)/VERSION
41
42 $(outdir)/VERSION: $(config_make) VERSION
43         -mkdir -p $(outdir)
44         echo $(TOPLEVEL_VERSION) > $@
45
46 dist-toplevel-txt-files:
47         -mkdir -p $(distdir)
48         ln $(TOPDOC_TXT_FILES) $(distdir)/
49         ln $(top-src-dir)/stepmake/aclocal.m4 $(distdir)/
50
51 doc: 
52         $(MAKE) -C Documentation
53
54 install-help2man:
55         $(MAKE) -C scripts man install-help2man
56         $(MAKE) -C lily man install-help2man
57
58 # All web targets, except info image symlinks and info docs are
59 # installed in non-recursing target from TOP-SRC-DIR
60 install-WWW:
61         -$(INSTALL) -m 755 -d $(DESTDIR)$(webdir)
62         rsync -rl $(outdir)/offline-root/ $(DESTDIR)$(webdir)
63         $(MAKE) -C Documentation/user install-info
64         $(MAKE) -C input/lsr install-info
65
66 web-install:
67         $(MAKE) out=www install-WWW
68
69 uninstall-WWW:
70         rm -rf $(DESTDIR)$(webdir)
71         -rmdir $(package_docdir)
72         $(MAKE) -C Documentation/user uninstall
73         $(MAKE) -C input/lsr uninstall
74
75 web-uninstall:
76         $(MAKE) out=www uninstall-WWW
77
78 local-install:
79         $(INSTALL) -d $(DESTDIR)$(local_lilypond_datadir)
80
81 final-install:
82         @true
83
84
85 # For online docs with content negotiation, issue `make web WEB_TARGETS=online'
86 # For both online and offline docs, issue `make web WEB_TARGETS="offline online"'
87 WEB_TARGETS = offline
88
89 WWW-post:
90 # need UTF8 setting in case this is hosted on a website.
91         echo -e 'AddDefaultCharset utf-8\nAddCharset utf-8 .html\nAddCharset utf-8 .en\nAddCharset utf-8 .nl\nAddCharset utf-8 .txt\n' > $(top-build-dir)/.htaccess
92         $(buildscript-dir)/mutopia-index -o $(outdir)/examples.html input/
93         find $(outdir) -name '*-root' | xargs rm -rf
94         $(buildscript-dir)/www_post $(PACKAGE_NAME) $(TOPLEVEL_VERSION) $(outdir) "$(WEB_TARGETS)"
95         find $(outdir)/offline-root -type l -delete
96
97
98 tree-prefix = $(outdir)
99 tree-bin = $(tree-prefix)/bin
100 tree-lib = $(tree-prefix)/lib
101 tree-share = $(tree-prefix)/share
102
103 # Don't put version numbers here. During development
104 # they make no sense, and cause EPS files to become invalid.
105
106 tree-share-prefix = $(tree-share)/lilypond/current
107 tree-lib-prefix = $(tree-lib)/lilypond/current
108
109 C_DIRS = flower lily
110 c-clean:
111         $(foreach i, $(C_DIRS), $(MAKE) -C $(i) clean &&) true
112
113 src-ext = c cc yy ll hh icc py scm tex ps texi itexi tely itely sh
114
115 web-clean: snippets-clean $(tree-share-prefix)/lilypond-force
116
117 default: $(config_h) build-dir-setup
118
119 build-dir-setup: $(tree-share-prefix)/lilypond-force
120
121 PO_FILES = $(call src-wildcard,$(src-depth)/po/*.po)
122 HELP_CATALOGS = $(PO_FILES:po/%.po=%)
123 CATALOGS = $(HELP_CATALOGS:lilypond=) 
124
125 $(tree-share-prefix)/lilypond-force link-tree: GNUmakefile $(outdir)/VERSION 
126 # Preparing LilyPond tree for build-dir exec
127         cd $(top-build-dir)/$(outbase) && rm -rf bin lib share
128         mkdir -p $(tree-bin)
129         mkdir -p $(tree-share-prefix)
130         mkdir -p $(tree-lib-prefix)
131         mkdir -p $(tree-share-prefix)/elisp
132         mkdir -p $(tree-share-prefix)/fonts
133         mkdir -p $(tree-share-prefix)/fonts/otf
134         mkdir -p $(tree-share-prefix)/fonts/tfm
135         mkdir -p $(tree-share-prefix)/fonts/type1
136         mkdir -p $(tree-share-prefix)/fonts/svg
137         mkdir -p $(tree-share-prefix)/fonts/map
138         mkdir -p $(tree-share-prefix)/fonts/enc
139         mkdir -p $(tree-share-prefix)/tex
140         cd $(tree-bin) && \
141                 ln -sf ../../lily/$(outconfbase)/lilypond . && \
142                 for i in abc2ly convert-ly etf2ly lilymidi lilypond-book lilypond-invoke-editor midi2ly musicxml2ly; \
143                         do ln -sf ../../scripts/$(outconfbase)/$$i . ; done
144         cd $(tree-lib-prefix) && \
145                 ln -s ../../../../python/$(outconfbase) python
146         cd $(tree-share-prefix) && \
147                 ln -s $(top-src-dir)/ly ly && \
148                 ln -s ../../../../mf mf && \
149                 ln -s $(top-src-dir)/ps && \
150                 ln -s ../../../../python/$(outconfbase) python && \
151                 ln -s $(top-src-dir)/scm && \
152                 ln -s $(top-src-dir)/scripts scripts
153         cd $(tree-share-prefix)/tex && \
154                 ln -s $(top-src-dir)/tex source && \
155                 ln -s ../../../../../tex/$(outconfbase) tex-out && \
156                 true
157         cd $(tree-share-prefix)/fonts && \
158                 ln -s $(top-src-dir)/mf source && \
159                 true
160         -cd $(tree-share-prefix)/elisp && \
161                 ln -sf ../../../../../elisp/$(outconfbase)/lilypond-words.el . && \
162                 ln -s $(top-src-dir)/elisp/*.el .
163         $(foreach i,$(CATALOGS), \
164                 (mkdir -p $(tree-share)/locale/$i/LC_MESSAGES && \
165                 cd $(tree-share)/locale/$i/LC_MESSAGES && \
166                 ln -sf ../../../../../po/$(outconfbase)/$i.mo lilypond.mo) &&) true
167         touch $(tree-share-prefix)/lilypond-force
168
169 $(tree-share-prefix)/mf-link-tree link-mf-tree: $(tree-share-prefix)/lilypond-force
170         -rm -f $(tree-share-prefix)/fonts/otf/* &&  \
171         rm -f $(tree-share-prefix)/fonts/svg/* &&  \
172         rm -f $(tree-share-prefix)/fonts/fonts.conf &&  \
173         rm -f $(tree-share-prefix)/fonts/tfm/* &&  \
174         rm -f $(tree-share-prefix)/fonts/type1/* &&  \
175                 cd $(tree-share-prefix)/fonts/otf && \
176                 ln -s ../../../../../../mf/$(outconfbase)/*.otf .
177         -cd $(tree-share-prefix)/fonts/ && \
178                 ln -s ../../../../../mf/$(outconfbase)/fonts.conf .
179         -cd $(tree-share-prefix)/fonts/svg && \
180                 ln -s ../../../../../../mf/$(outconfbase)/*.svg .
181         -cd $(tree-share-prefix)/fonts/tfm && \
182                 ln -s ../../../../../../mf/$(outconfbase)/*.tfm .
183         -cd $(tree-share-prefix)/fonts/type1 && \
184                 ln -s ../../../../../../mf/$(outconfbase)/*.pf? .
185
186 TAGS.make: dummy
187         etags -o $@ $(find $(top-src-dir) -name 'GNUmakefile*' -o -name '*.make')
188
189 $(config_h): config.hh.in
190 #
191 # this is to prevent people from getting
192 # undefined symbols  when we add them to config.h.in,
193 # and they blindly run "cvs update; make".
194 #
195         @echo
196         @echo ' *** $(config_h) is out of date'
197         @echo ' *** Remove it and rerun autogen:'
198         @echo '         rm $(config_h); ./autogen.sh'
199         @echo
200         @false
201
202 grand-replace:
203         $(MAKE) -C scripts/build
204         PATH=$(buildscript-dir):$(PATH) $(buildscript-dir)/grand-replace
205
206 ################################################################
207 # testing
208
209 RESULT_DIR=$(top-build-dir)/out/test-results
210
211
212 test:
213         @echo -en 'For tracking crashes: use\n\n\t'
214         @echo 'grep sourcefilename `grep -L systems.texi out/lybook-db/*/*log|sed s/log/ly/g`'
215         @echo
216         $(MAKE) -C input/regression/ out=test local-test
217         $(MAKE) -C input/regression/musicxml out=test local-test
218
219 test-baseline: 
220         @if test -d .git ; then \
221                 $(if $(shell git diff), echo "commit before base lining" && false,true) ; \
222         fi
223         $(MAKE) 
224         $(MAKE) test
225         $(MAKE) out=test -C input/regression/ local-test-baseline
226         $(MAKE) out=test -C input/regression/musicxml local-test-baseline
227         $(MAKE) test-snippets-clean
228
229
230 local-check: test
231         rm -rf $(RESULT_DIR)
232         mkdir -p $(RESULT_DIR)
233         $(buildscript-dir)/output-distance --create-images --output-dir $(RESULT_DIR) input/regression/out-test-baseline input/regression/out-test/
234         @find input ly -name '*.ly' -print |grep -v 'out.*/' | xargs grep '\\version' -L | grep -v "standard input" |sed 's/^/**** Missing version: /g' 
235
236
237 test-redo:
238         for a in `cat $(RESULT_DIR)/changed.txt` ; do \
239                 echo removing $$a* ; \
240                 rm -f $$a* ;\
241         done
242         $(MAKE) check
243
244 test-clean: test-snippets-clean
245         $(MAKE) -C input/regression/ out=test clean
246
247 snippets-clean:
248         rm -rf out/lybook-db
249
250 test-snippets-clean:
251         rm -rf out/lybook-testdb