5 SUBDIRS = python scripts \
12 stepmake $(documentation-dir)
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)
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)
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
33 STEPMAKE_TEMPLATES=toplevel po install
34 LOCALSTEPMAKE_TEMPLATES=lilypond
36 include $(depth)/make/stepmake.make
39 local-dist: refresh-release-files dist-toplevel-txt-files
41 all: $(outdir)/VERSION
43 $(outdir)/VERSION: $(config_make) VERSION
45 echo $(TOPLEVEL_VERSION) > $@
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' > $@
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 > $@
53 # junk me as soon as RELEASE-COMMIT FIXME: has been addressed
54 refresh-release-files:
56 test -d $(top-src-dir)/.git && rm -f RELEASE-COMMIT
57 $(MAKE) $(RELEASE_FILES)
62 do-top-doc: python-modules
64 local-clean: local-clean-ChangeLog
66 local-clean-ChangeLog:
69 dist-toplevel-txt-files: do-top-doc
71 ln $(TOPDOC_TXT_FILES) $(distdir)/
72 ln $(top-src-dir)/stepmake/aclocal.m4 $(distdir)/
75 $(MAKE) -C Documentation
78 $(MAKE) -C scripts man install-help2man
79 $(MAKE) -C lily man install-help2man
81 # All web targets, except info image symlinks and info docs are
82 # installed in non-recursing target from TOP-SRC-DIR
84 -$(INSTALL) -m 755 -d $(DESTDIR)$(webdir)
85 rsync -rl --exclude='*.signature' $(outdir)/offline-root/ $(DESTDIR)$(webdir)
88 $(MAKE) -C Documentation/user install-info
89 $(MAKE) -C input/lsr install-info
90 (cd $(DESTDIR)$(infodir) && rm -f lilypond && ln -sf $$($(PYTHON) $(buildscript-dir)/relative $(DESTDIR)$(webdir)/Documentation/user) lilypond)
91 (cd $(DESTDIR)$(infodir) && rm -f lilypond-snippets && ln -sf $$($(PYTHON) $(buildscript-dir)/relative $(DESTDIR)$(webdir)/input/lsr) lilypond-snippets)
94 $(MAKE) out=www install-WWW
95 $(MAKE) out=www install-info-WWW
98 rm -rf $(DESTDIR)$(webdir)
99 -rmdir $(package_docdir)
100 $(MAKE) -C Documentation/user uninstall
101 $(MAKE) -C input/lsr uninstall
104 $(MAKE) out=www uninstall-WWW
107 $(INSTALL) -d $(DESTDIR)$(local_lilypond_datadir)
113 # For online docs with content negotiation, issue `make web WEB_TARGETS=online'
114 # For both online and offline docs, issue `make web WEB_TARGETS="offline online"'
115 WEB_TARGETS = offline
118 # need UTF8 setting in case this is hosted on a website.
119 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
120 $(buildscript-dir)/mutopia-index -o $(outdir)/examples.html input/
121 find $(outdir) -name '*-root' | xargs rm -rf
122 $(buildscript-dir)/www_post $(PACKAGE_NAME) $(TOPLEVEL_VERSION) $(outdir) "$(WEB_TARGETS)"
123 find $(outdir)/offline-root -type l -delete
126 tree-prefix = $(outdir)
127 tree-bin = $(tree-prefix)/bin
128 tree-lib = $(tree-prefix)/lib
129 tree-share = $(tree-prefix)/share
131 # Don't put version numbers here. During development
132 # they make no sense, and cause EPS files to become invalid.
134 tree-share-prefix = $(tree-share)/lilypond/current
135 tree-lib-prefix = $(tree-lib)/lilypond/current
139 $(foreach i, $(C_DIRS), $(MAKE) -C $(i) clean &&) true
141 src-ext = c cc yy ll hh icc py scm tex ps texi itexi tely itely sh
143 web-clean: snippets-clean $(tree-share-prefix)/lilypond-force
145 default: $(config_h) build-dir-setup
147 build-dir-setup: $(tree-share-prefix)/lilypond-force
149 PO_FILES = $(call src-wildcard,$(src-depth)/po/*.po)
150 HELP_CATALOGS = $(PO_FILES:po/%.po=%)
151 CATALOGS = $(HELP_CATALOGS:lilypond=)
153 $(tree-share-prefix)/lilypond-force link-tree: GNUmakefile $(outdir)/VERSION
154 # Preparing LilyPond tree for build-dir exec
155 cd $(top-build-dir)/$(outbase) && rm -rf bin lib share
157 mkdir -p $(tree-share-prefix)
158 mkdir -p $(tree-lib-prefix)
159 mkdir -p $(tree-share-prefix)/elisp
160 mkdir -p $(tree-share-prefix)/fonts
161 mkdir -p $(tree-share-prefix)/fonts/otf
162 mkdir -p $(tree-share-prefix)/fonts/tfm
163 mkdir -p $(tree-share-prefix)/fonts/type1
164 mkdir -p $(tree-share-prefix)/fonts/svg
165 mkdir -p $(tree-share-prefix)/fonts/map
166 mkdir -p $(tree-share-prefix)/fonts/enc
167 mkdir -p $(tree-share-prefix)/tex
169 ln -sf ../../lily/$(outconfbase)/lilypond . && \
170 for i in abc2ly convert-ly etf2ly lilymidi lilypond-book lilypond-invoke-editor midi2ly musicxml2ly; \
171 do ln -sf ../../scripts/$(outconfbase)/$$i . ; done
172 cd $(tree-lib-prefix) && \
173 ln -s ../../../../python/$(outconfbase) python
174 cd $(tree-share-prefix) && \
175 ln -s $(top-src-dir)/ly ly && \
176 ln -s ../../../../mf mf && \
177 ln -s $(top-src-dir)/ps && \
178 ln -s ../../../../python/$(outconfbase) python && \
179 ln -s $(top-src-dir)/scm && \
180 ln -s $(top-src-dir)/scripts scripts
181 cd $(tree-share-prefix)/tex && \
182 ln -s $(top-src-dir)/tex source && \
183 ln -s ../../../../../tex/$(outconfbase) tex-out && \
185 cd $(tree-share-prefix)/fonts && \
186 ln -s $(top-src-dir)/mf source && \
188 -cd $(tree-share-prefix)/elisp && \
189 ln -sf ../../../../../elisp/$(outconfbase)/lilypond-words.el . && \
190 ln -s $(top-src-dir)/elisp/*.el .
191 $(foreach i,$(CATALOGS), \
192 (mkdir -p $(tree-share)/locale/$i/LC_MESSAGES && \
193 cd $(tree-share)/locale/$i/LC_MESSAGES && \
194 ln -sf ../../../../../po/$(outconfbase)/$i.mo lilypond.mo) &&) true
195 touch $(tree-share-prefix)/lilypond-force
197 $(tree-share-prefix)/mf-link-tree link-mf-tree: $(tree-share-prefix)/lilypond-force
198 -rm -f $(tree-share-prefix)/fonts/otf/* && \
199 rm -f $(tree-share-prefix)/fonts/svg/* && \
200 rm -f $(tree-share-prefix)/fonts/fonts.conf && \
201 rm -f $(tree-share-prefix)/fonts/tfm/* && \
202 rm -f $(tree-share-prefix)/fonts/type1/* && \
203 cd $(tree-share-prefix)/fonts/otf && \
204 ln -s ../../../../../../mf/$(outconfbase)/*.otf .
205 -cd $(tree-share-prefix)/fonts/ && \
206 ln -s ../../../../../mf/$(outconfbase)/fonts.conf .
207 -cd $(tree-share-prefix)/fonts/svg && \
208 ln -s ../../../../../../mf/$(outconfbase)/*.svg .
209 -cd $(tree-share-prefix)/fonts/tfm && \
210 ln -s ../../../../../../mf/$(outconfbase)/*.tfm .
211 -cd $(tree-share-prefix)/fonts/type1 && \
212 ln -s ../../../../../../mf/$(outconfbase)/*.pf? .
215 etags -o $@ $(find $(top-src-dir) -name 'GNUmakefile*' -o -name '*.make')
217 $(config_h): config.hh.in
219 # this is to prevent people from getting
220 # undefined symbols when we add them to config.h.in,
221 # and they blindly run "cvs update; make".
224 @echo ' *** $(config_h) is out of date'
225 @echo ' *** Remove it and rerun autogen:'
226 @echo ' rm $(config_h); ./autogen.sh'
231 $(MAKE) -C scripts/build
232 PATH=$(buildscript-dir):$(PATH) $(buildscript-dir)/grand-replace
234 ################################################################
237 RESULT_DIR=$(top-build-dir)/out/test-results
241 @echo -en 'For tracking crashes: use\n\n\t'
242 @echo 'grep sourcefilename `grep -L systems.texi out/lybook-db/*/*log|sed s/log/ly/g`'
244 $(MAKE) -C input/regression/ out=test local-test
245 $(MAKE) -C input/regression/musicxml out=test local-test
248 @if test -d .git ; then \
249 $(if $(shell git diff), echo "commit before base lining" && false,true) ; \
253 $(MAKE) out=test -C input/regression/ local-test-baseline
254 $(MAKE) out=test -C input/regression/musicxml local-test-baseline
255 $(MAKE) test-snippets-clean
260 mkdir -p $(RESULT_DIR)
261 $(buildscript-dir)/output-distance --create-images --output-dir $(RESULT_DIR) input/regression/out-test-baseline input/regression/out-test/
262 @find input ly -name '*.ly' -print |grep -v 'out.*/' | xargs grep '\\version' -L | grep -v "standard input" |sed 's/^/**** Missing version: /g'
266 for a in `cat $(RESULT_DIR)/changed.txt` ; do \
267 echo removing $$a* ; \
272 test-clean: test-snippets-clean
273 $(MAKE) -C input/regression/ out=test clean
279 rm -rf out/lybook-testdb