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 EXTRA_DIST_FILES = VERSION .gitignore lilypond-texi2html.init \
26 $(README_FILES) $(SCRIPTS) $(IN_FILES)
27 INSTALLATION_DIR=$(local_lilypond_datadir)
28 INSTALLATION_FILES=$(config_make) VERSION
32 STEPMAKE_TEMPLATES=toplevel po install
33 LOCALSTEPMAKE_TEMPLATES=lilypond
35 include $(depth)/make/stepmake.make
38 local-dist: dist-toplevel-txt-files
40 all: $(outdir)/VERSION
42 $(outdir)/VERSION: $(config_make) VERSION
44 echo $(TOPLEVEL_VERSION) > $@
46 dist-toplevel-txt-files:
48 ln $(TOPDOC_TXT_FILES) $(distdir)/
49 ln $(top-src-dir)/stepmake/aclocal.m4 $(distdir)/
52 $(MAKE) -C Documentation
55 $(MAKE) -C scripts man install-help2man
56 $(MAKE) -C lily man install-help2man
58 # All web targets, except info image symlinks and info docs are
59 # installed in non-recursing target from TOP-SRC-DIR
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
67 $(MAKE) out=www install-WWW
70 rm -rf $(DESTDIR)$(webdir)
71 -rmdir $(package_docdir)
72 $(MAKE) -C Documentation/user uninstall
73 $(MAKE) -C input/lsr uninstall
76 $(MAKE) out=www uninstall-WWW
79 $(INSTALL) -d $(DESTDIR)$(local_lilypond_datadir)
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"'
90 # need UTF8 setting in case this is hosted on a website.
91 $(MAKE) -C scripts/build out=
92 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
93 $(buildscript-dir)/mutopia-index -o $(outdir)/examples.html input/
94 find $(outdir) -name '*-root' | xargs rm -rf
95 $(buildscript-dir)/www_post $(PACKAGE_NAME) $(TOPLEVEL_VERSION) $(outdir) "$(WEB_TARGETS)"
96 find $(outdir)/offline-root -type l -delete
99 tree-prefix = $(outdir)
100 tree-bin = $(tree-prefix)/bin
101 tree-lib = $(tree-prefix)/lib
102 tree-share = $(tree-prefix)/share
104 # Don't put version numbers here. During development
105 # they make no sense, and cause EPS files to become invalid.
107 tree-share-prefix = $(tree-share)/lilypond/current
108 tree-lib-prefix = $(tree-lib)/lilypond/current
112 $(foreach i, $(C_DIRS), $(MAKE) -C $(i) clean &&) true
114 src-ext = c cc yy ll hh icc py scm tex ps texi itexi tely itely sh
116 web-clean: snippets-clean $(tree-share-prefix)/lilypond-force
118 default: $(config_h) build-dir-setup
120 build-dir-setup: $(tree-share-prefix)/lilypond-force
122 PO_FILES = $(call src-wildcard,$(src-depth)/po/*.po)
123 HELP_CATALOGS = $(PO_FILES:po/%.po=%)
124 CATALOGS = $(HELP_CATALOGS:lilypond=)
126 $(tree-share-prefix)/lilypond-force link-tree: GNUmakefile $(outdir)/VERSION
127 # Preparing LilyPond tree for build-dir exec
128 cd $(top-build-dir)/$(outbase) && rm -rf bin lib share
130 mkdir -p $(tree-share-prefix)
131 mkdir -p $(tree-lib-prefix)
132 mkdir -p $(tree-share-prefix)/elisp
133 mkdir -p $(tree-share-prefix)/fonts
134 mkdir -p $(tree-share-prefix)/fonts/otf
135 mkdir -p $(tree-share-prefix)/fonts/tfm
136 mkdir -p $(tree-share-prefix)/fonts/type1
137 mkdir -p $(tree-share-prefix)/fonts/svg
138 mkdir -p $(tree-share-prefix)/fonts/map
139 mkdir -p $(tree-share-prefix)/fonts/enc
140 mkdir -p $(tree-share-prefix)/tex
142 ln -sf ../../lily/$(outconfbase)/lilypond . && \
143 for i in abc2ly convert-ly etf2ly lilymidi lilypond-book lilypond-invoke-editor midi2ly musicxml2ly; \
144 do ln -sf ../../scripts/$(outconfbase)/$$i . ; done
145 cd $(tree-lib-prefix) && \
146 ln -s ../../../../python/$(outconfbase) python
147 cd $(tree-share-prefix) && \
148 ln -s $(top-src-dir)/ly ly && \
149 ln -s ../../../../mf mf && \
150 ln -s $(top-src-dir)/ps && \
151 ln -s ../../../../python/$(outconfbase) python && \
152 ln -s $(top-src-dir)/scm && \
153 ln -s $(top-src-dir)/scripts scripts
154 cd $(tree-share-prefix)/tex && \
155 ln -s $(top-src-dir)/tex source && \
156 ln -s ../../../../../tex/$(outconfbase) tex-out && \
158 cd $(tree-share-prefix)/fonts && \
159 ln -s $(top-src-dir)/mf source && \
161 -cd $(tree-share-prefix)/elisp && \
162 ln -sf ../../../../../elisp/$(outconfbase)/lilypond-words.el . && \
163 ln -s $(top-src-dir)/elisp/*.el .
164 $(foreach i,$(CATALOGS), \
165 (mkdir -p $(tree-share)/locale/$i/LC_MESSAGES && \
166 cd $(tree-share)/locale/$i/LC_MESSAGES && \
167 ln -sf ../../../../../po/$(outconfbase)/$i.mo lilypond.mo) &&) true
168 touch $(tree-share-prefix)/lilypond-force
170 $(tree-share-prefix)/mf-link-tree link-mf-tree: $(tree-share-prefix)/lilypond-force
171 -rm -f $(tree-share-prefix)/fonts/otf/* && \
172 rm -f $(tree-share-prefix)/fonts/svg/* && \
173 rm -f $(tree-share-prefix)/fonts/fonts.conf && \
174 rm -f $(tree-share-prefix)/fonts/tfm/* && \
175 rm -f $(tree-share-prefix)/fonts/type1/* && \
176 cd $(tree-share-prefix)/fonts/otf && \
177 ln -s ../../../../../../mf/$(outconfbase)/*.otf .
178 -cd $(tree-share-prefix)/fonts/ && \
179 ln -s ../../../../../mf/$(outconfbase)/fonts.conf .
180 -cd $(tree-share-prefix)/fonts/svg && \
181 ln -s ../../../../../../mf/$(outconfbase)/*.svg .
182 -cd $(tree-share-prefix)/fonts/tfm && \
183 ln -s ../../../../../../mf/$(outconfbase)/*.tfm .
184 -cd $(tree-share-prefix)/fonts/type1 && \
185 ln -s ../../../../../../mf/$(outconfbase)/*.pf? .
188 etags -o $@ $(find $(top-src-dir) -name 'GNUmakefile*' -o -name '*.make')
190 $(config_h): config.hh.in
192 # this is to prevent people from getting
193 # undefined symbols when we add them to config.h.in,
194 # and they blindly run "cvs update; make".
197 @echo ' *** $(config_h) is out of date'
198 @echo ' *** Remove it and rerun autogen:'
199 @echo ' rm $(config_h); ./autogen.sh'
204 $(MAKE) -C scripts/build
205 PATH=$(buildscript-dir):$(PATH) $(buildscript-dir)/grand-replace
207 ################################################################
210 RESULT_DIR=$(top-build-dir)/out/test-results
214 @echo -en 'For tracking crashes: use\n\n\t'
215 @echo 'grep sourcefilename `grep -L systems.texi out/lybook-db/*/*log|sed s/log/ly/g`'
217 $(MAKE) -C input/regression/ out=test local-test
218 $(MAKE) -C input/regression/musicxml out=test local-test
221 @if test -d .git ; then \
222 $(if $(shell git diff), echo "commit before base lining" && false,true) ; \
226 $(MAKE) out=test -C input/regression/ local-test-baseline
227 $(MAKE) out=test -C input/regression/musicxml local-test-baseline
228 $(MAKE) test-snippets-clean
233 mkdir -p $(RESULT_DIR)
234 $(buildscript-dir)/output-distance --create-images --output-dir $(RESULT_DIR) input/regression/out-test-baseline input/regression/out-test/
235 @find input ly -name '*.ly' -print |grep -v 'out.*/' | xargs grep '\\version' -L | grep -v "standard input" |sed 's/^/**** Missing version: /g'
239 for a in `cat $(RESULT_DIR)/changed.txt` ; do \
240 echo removing $$a* ; \
245 test-clean: test-snippets-clean
246 $(MAKE) -C input/regression/ out=test clean
252 rm -rf out/lybook-testdb