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