]> git.donarmstrong.com Git - lilypond.git/blob - GNUmakefile.in
Removes mutopia-index.py processing
[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 COPYING.FDL DEDICATION ROADMAP THANKS HACKING \
21   LICENSE LICENSE.DOCUMENTATION
22 TOPDOC_FILES = AUTHORS INSTALL README NEWS
23 TOPDOC_TXT_FILES = $(addprefix $(top-build-dir)/Documentation/topdocs/$(outdir)/,$(addsuffix .txt,$(TOPDOC_FILES)))
24 IN_FILES := $(call src-wildcard,*.in)
25
26 RELEASE_FILES = ChangeLog RELEASE-COMMIT
27 RELEASE_OUT_FILES = $(RELEASE_FILES:%=$(outdir)/%)
28 OUT_DIST_FILES += $(RELEASE_OUT_FILES)
29 EXTRA_DIST_FILES = VERSION .gitignore .mailmap \
30   $(README_FILES) $(SCRIPTS) $(IN_FILES)
31 INSTALLATION_DIR=$(local_lilypond_datadir)
32 INSTALLATION_FILES=$(config_make) VERSION
33
34 # bootstrap stepmake:
35 #
36 STEPMAKE_TEMPLATES=toplevel po install
37 LOCALSTEPMAKE_TEMPLATES=lilypond
38
39 include $(depth)/make/stepmake.make
40
41 .PHONY: test info website
42
43 local-dist: refresh-release-files dist-toplevel-txt-files
44
45 all: $(outdir)/VERSION
46
47 $(outdir)/VERSION: $(config_make) VERSION
48         -mkdir -p $(outdir)
49         echo $(TOPLEVEL_VERSION) > $@
50
51 $(outdir)/ChangeLog: $(outdir)/VERSION
52         @echo 'See http://git.savannah.gnu.org/gitweb/?p=lilypond.git;a=log;h=refs/tags/release/$(TOPLEVEL_VERSION)-1' > $@
53
54 $(outdir)/RELEASE-COMMIT: # FIXME: any file in $(top-src-dir)/.git/ we can depend on and be sure RELEASE-COMMIT is up to date?
55         git --git-dir=$(top-src-dir)/.git show HEAD | head -100 > $@
56
57 # junk me as soon as RELEASE-COMMIT FIXME: has been addressed
58 refresh-release-files:
59         test -d $(top-src-dir)/.git && rm -f $(RELEASE_OUT_FILES)
60         $(MAKE) $(RELEASE_OUT_FILES)
61
62 python-modules:
63         $(MAKE) -C python
64
65 top-doc: python-modules
66
67 local-clean: local-clean-ChangeLog
68
69 local-clean-ChangeLog:
70         rm -f ChangeLog
71
72 dist-toplevel-txt-files: top-doc
73         -mkdir -p $(distdir)
74         ln $(TOPDOC_TXT_FILES) $(distdir)
75         ln $(top-src-dir)/stepmake/aclocal.m4 $(distdir)
76
77 info:
78         $(foreach d, $(INFO_DIRECTORIES),$(MAKE) -C $(d) out=www info && ) true
79
80 install-info: info
81         $(MAKE) out=www COPY_INFO_IMAGES=1 install-info-WWW
82
83 install-help2man:
84         $(MAKE) -C scripts man install-help2man
85         $(MAKE) -C lily man install-help2man
86
87 install-doc:
88         $(MAKE) out=www install-WWW
89         $(MAKE) out=www install-info-WWW
90
91 uninstall-doc:
92         $(MAKE) out=www uninstall-WWW
93
94 local-install:
95         $(INSTALL) -d $(DESTDIR)$(local_lilypond_datadir)
96
97 final-install:
98         @true
99
100 ifeq ($(out),www)
101 # All web targets, except info image symlinks and info docs are
102 # installed in non-recursing target from TOP-SRC-DIR
103 install-WWW:
104         -$(INSTALL) -m 755 -d $(DESTDIR)$(webdir)
105         rsync -rl --exclude='*.signature' $(outdir)/offline-root $(DESTDIR)$(webdir)
106         $(MAKE) -C Documentation omf-local-install
107
108 install-info-WWW:
109         $(foreach d, $(INFO_DIRECTORIES),$(MAKE) -C $(d) install-info && ) true
110
111 uninstall-WWW:
112         rm -rf $(DESTDIR)$(webdir)
113         -rmdir $(package_docdir)
114         $(MAKE) -C Documentation uninstall
115
116
117 # For online docs with content negotiation, issue `make doc WEB_TARGETS=online'
118 # For both online and offline docs, issue `make doc WEB_TARGETS="offline online"'
119 WEB_TARGETS = offline
120
121 WEB_ROOT_FILES = $(WEB_TARGETS:%=$(outdir)/%-root/index.html)
122
123 WEB_EXAMPLE_FILES = $(wildcard input/$(outdir)/*.ly) \
124                     $(wildcard input/*/$(outdir)/*.ly) \
125                     $(wildcard input/*/*/$(outdir)/*.ly)
126
127 WEB_TRACKED_FILES = $(filter-out $(outdir)/index.html, \
128                     $(shell bash -O nullglob -c "echo $(outdir)/*.{midi,html,pdf,png,jpg,jpeg,txt,ly,ily,signature,css,zip,js,idx,php}")) \
129                     $(shell bash -O nullglob -c "echo input/$(outdir)/*.{midi,html,pdf,png,jpg,jpeg,txt,ly,ily,signature,css,zip,js,idx,php}") \
130                     $(shell bash -O nullglob -c "echo input/*/$(outdir)/*.{midi,html,pdf,png,jpg,jpeg,txt,ly,ily,signature,css,zip,js,idx,php}") \
131                     $(shell bash -O nullglob -c "echo input/*/*/$(outdir)/*.{midi,html,pdf,png,jpg,jpeg,txt,ly,ily,signature,css,zip,js,idx,php}") \
132                     $(shell bash -O nullglob -c "echo input/regression/lilypond-book/$(outdir)/*.{info,tex}") \
133                     $(shell bash -O nullglob -c "echo Documentation/$(outdir)/*.{midi,html,pdf,png,jpg,jpeg,txt,ly,ily,signature,css,zip,js,idx,php}") \
134                     $(shell bash -O nullglob -c "echo Documentation/$(outdir)/*/*.{midi,html,pdf,png,jpg,jpeg,txt,ly,ily,signature,css,zip,js,idx,php}")
135
136 WWW-post: $(top-build-dir)/.htaccess $(WEB_ROOT_FILES)
137
138 # need UTF8 setting in case this is hosted on a website.
139 $(top-build-dir)/.htaccess:
140         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
141
142 $(outdir)/offline-root/index.html: $(WEB_TRACKED_FILES)
143         $(buildscript-dir)/www_post $(PACKAGE_NAME) $(TOPLEVEL_VERSION) $(outdir) offline
144         find $(outdir)/offline-root -type l | xargs rm -f
145
146 $(outdir)/online-root/index.html: $(WEB_TRACKED_FILES)
147         $(buildscript-dir)/www_post $(PACKAGE_NAME) $(TOPLEVEL_VERSION) $(outdir) online
148 endif # ifeq ($(out),www)
149
150 # For those who cannot for the life in them remember to type
151 # WEB_TARGETS=..., just bloody make all doc stuff, already.
152 all-doc:
153         $(MAKE) WEB_TARGETS='online offline' doc
154
155 tree-prefix = $(outdir)
156 tree-bin = $(tree-prefix)/bin
157 tree-lib = $(tree-prefix)/lib
158 tree-share = $(tree-prefix)/share
159
160 # Don't put version numbers here. During development
161 # they make no sense, and cause EPS files to become invalid.
162
163 tree-share-prefix = $(tree-share)/lilypond/current
164 tree-lib-prefix = $(tree-lib)/lilypond/current
165
166 C_DIRS = flower lily
167 c-clean:
168         $(foreach i, $(C_DIRS), $(MAKE) -C $(i) clean &&) true
169
170 src-ext = c cc yy ll hh icc py scm tex ps texi itexi tely itely sh
171
172 doc-clean: snippets-clean $(tree-share-prefix)/lilypond-force
173
174 default: $(config_h) build-dir-setup build-scripts
175
176 build-dir-setup: $(tree-share-prefix)/lilypond-force
177
178 build-scripts:
179         $(MAKE) -C scripts/build
180
181 PO_FILES = $(call src-wildcard,$(src-depth)/po/*.po)
182 HELP_CATALOGS = $(PO_FILES:po/%.po=%)
183 CATALOGS = $(HELP_CATALOGS:lilypond=)
184
185 # Preparing LilyPond tree for build-dir exec
186 link-tree: $(tree-share-prefix)/lilypond-force
187
188 $(tree-share-prefix)/lilypond-force: GNUmakefile $(outdir)/VERSION
189         cd $(top-build-dir)/$(outbase) && rm -rf bin lib share
190         mkdir -p $(tree-bin)
191         mkdir -p $(tree-share-prefix)
192         mkdir -p $(tree-lib-prefix)
193         mkdir -p $(tree-share-prefix)/elisp
194         mkdir -p $(tree-share-prefix)/fonts
195         mkdir -p $(tree-share-prefix)/fonts/otf
196         mkdir -p $(tree-share-prefix)/fonts/tfm
197         mkdir -p $(tree-share-prefix)/fonts/type1
198         mkdir -p $(tree-share-prefix)/fonts/svg
199         mkdir -p $(tree-share-prefix)/fonts/map
200         mkdir -p $(tree-share-prefix)/fonts/enc
201         mkdir -p $(tree-share-prefix)/tex
202         cd $(tree-bin) && \
203                 ln -sf ../../lily/$(outconfbase)/lilypond . && \
204                 for i in abc2ly convert-ly etf2ly lilymidi lilypond-book lilypond-invoke-editor midi2ly musicxml2ly; \
205                         do ln -sf ../../scripts/$(outconfbase)/$$i . ; done
206         cd $(tree-lib-prefix) && \
207                 ln -s ../../../../python/$(outconfbase) python
208         cd $(tree-share-prefix) && \
209                 ln -s $(top-src-dir)/ly ly && \
210                 ln -s ../../../../mf mf && \
211                 ln -s $(top-src-dir)/ps && \
212                 ln -s ../../../../python/$(outconfbase) python && \
213                 ln -s $(top-src-dir)/scm && \
214                 ln -s $(top-src-dir)/scripts scripts
215         cd $(tree-share-prefix)/tex && \
216                 ln -s $(top-src-dir)/tex source && \
217                 ln -s ../../../../../tex/$(outconfbase) tex-out && \
218                 true
219         cd $(tree-share-prefix)/fonts && \
220                 ln -s $(top-src-dir)/mf source && \
221                 true
222         -cd $(tree-share-prefix)/elisp && \
223                 ln -sf ../../../../../elisp/$(outconfbase)/lilypond-words.el . && \
224                 ln -s $(top-src-dir)/elisp/*.el .
225         $(foreach i,$(CATALOGS), \
226                 (mkdir -p $(tree-share)/locale/$i/LC_MESSAGES && \
227                 cd $(tree-share)/locale/$i/LC_MESSAGES && \
228                 ln -sf ../../../../../po/$(outconfbase)/$i.mo lilypond.mo) &&) true
229         touch $(tree-share-prefix)/lilypond-force
230
231 link-mf-tree: $(tree-share-prefix)/mf-link-tree
232
233 $(tree-share-prefix)/mf-link-tree: $(tree-share-prefix)/lilypond-force
234         -rm -f $(tree-share-prefix)/fonts/otf/* &&  \
235         rm -f $(tree-share-prefix)/fonts/svg/* &&  \
236         rm -f $(tree-share-prefix)/fonts/fonts.conf &&  \
237         rm -f $(tree-share-prefix)/fonts/tfm/* &&  \
238         rm -f $(tree-share-prefix)/fonts/type1/* &&  \
239                 cd $(tree-share-prefix)/fonts/otf && \
240                 ln -s ../../../../../../mf/$(outconfbase)/*.otf .
241         -cd $(tree-share-prefix)/fonts && \
242                 ln -s ../../../../../mf/$(outconfbase)/fonts.conf .
243         -cd $(tree-share-prefix)/fonts/svg && \
244                 ln -s ../../../../../../mf/$(outconfbase)/*.svg .
245         -cd $(tree-share-prefix)/fonts/svg && \
246                 ln -s ../../../../../../mf/$(outconfbase)/*.woff .
247         -cd $(tree-share-prefix)/fonts/tfm && \
248                 ln -s ../../../../../../mf/$(outconfbase)/*.tfm .
249         -cd $(tree-share-prefix)/fonts/type1 && \
250                 ln -s ../../../../../../mf/$(outconfbase)/*.pf? .
251         touch $(tree-share-prefix)/mf-link-tree
252
253 TAGS.make: dummy
254         etags -o $@ $(find $(top-src-dir) -name 'GNUmakefile*' -o -name '*.make')
255
256 $(config_h): config.hh.in
257 #
258 # this is to prevent people from getting
259 # undefined symbols  when we add them to config.h.in,
260 # and they blindly run "cvs update; make".
261 #
262         @echo
263         @echo ' *** $(config_h) is out of date'
264         @echo ' *** Remove it and rerun autogen:'
265         @echo '         rm $(config_h); ./autogen.sh'
266         @echo
267         @false
268
269 grand-replace:
270         $(MAKE) -C scripts/build
271         PATH=$(buildscript-dir):$(PATH) $(buildscript-dir)/grand-replace
272
273
274 ################################################################
275 # testing
276
277 RESULT_DIR=$(top-build-dir)/out/test-results
278
279
280 test:
281         @echo 'For tracking crashes: use'
282         @echo
283         @echo '        grep sourcefilename `grep -L systems.texi out/lybook-testdb/*/*log|sed s/log/ly/g`'
284         @echo
285         $(MAKE) -C input/regression out=test local-test
286         $(MAKE) -C input/regression/midi out=test local-test
287         $(MAKE) -C input/regression/musicxml out=test local-test
288         $(MAKE) -C input/regression/abc2ly out=test local-test
289         $(MAKE) -C input/regression/lilypond-book out=test local-test
290
291 test-baseline:
292         @if test -d .git ; then \
293                 $(if $(shell git diff), echo "commit before base lining" && false,true) ; \
294         fi
295         $(MAKE)
296         $(MAKE) test
297         $(MAKE) out=test -C input/regression local-test-baseline
298         $(MAKE) out=test -C input/regression/midi local-test-baseline
299         $(MAKE) out=test -C input/regression/musicxml local-test-baseline
300         $(MAKE) out=test -C input/regression/abc2ly local-test-baseline
301         $(MAKE) out=test -C input/regression/lilypond-book local-test-baseline
302         $(MAKE) test-snippets-clean
303
304
305 local-check: test
306         rm -rf $(RESULT_DIR)
307         mkdir -p $(RESULT_DIR)
308         $(buildscript-dir)/output-distance --create-images --output-dir $(RESULT_DIR) \
309                 input/regression/out-test-baseline input/regression/out-test \
310                 input/regression/midi/out-test-baseline input/regression/midi/out-test 
311         @find input ly -name '*.ly' -print |grep -v 'out.*/' | xargs grep '\\version' -L | grep -v "standard input" |sed 's/^/**** Missing version: /g'
312
313
314 test-redo:
315         for a in `cat $(RESULT_DIR)/changed.txt` ; do \
316                 echo removing $$a* ; \
317                 rm -f $$a* ;\
318         done
319         $(MAKE) check
320
321 test-clean: test-snippets-clean
322         $(MAKE) -C input/regression out=test clean
323
324 snippets-clean:
325         rm -rf out/lybook-db
326
327 test-snippets-clean:
328         rm -rf out/lybook-testdb
329
330 # we want this separate for security; see CG 4.2.  -gp
331 website:
332         $(MAKE) config_make=$(config_make) \
333                 top-src-dir=$(top-src-dir) \
334                 -f $(top-src-dir)/make/website.make \
335                 website
336