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 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)
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
36 STEPMAKE_TEMPLATES=toplevel po install
37 LOCALSTEPMAKE_TEMPLATES=lilypond
39 include $(depth)/make/stepmake.make
41 .PHONY: test info website
43 local-dist: refresh-release-files dist-toplevel-txt-files
45 all: $(outdir)/VERSION
47 $(outdir)/VERSION: $(config_make) VERSION
49 echo $(TOPLEVEL_VERSION) > $@
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' > $@
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 > $@
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)
65 top-doc: python-modules
67 local-clean: local-clean-ChangeLog
69 local-clean-ChangeLog:
72 dist-toplevel-txt-files: top-doc
74 ln $(TOPDOC_TXT_FILES) $(distdir)
75 ln $(top-src-dir)/stepmake/aclocal.m4 $(distdir)
78 $(foreach d, $(INFO_DIRECTORIES),$(MAKE) -C $(d) out=www info && ) true
81 $(MAKE) out=www COPY_INFO_IMAGES=1 install-info-WWW
84 $(MAKE) -C scripts man install-help2man
85 $(MAKE) -C lily man install-help2man
88 $(MAKE) out=www install-WWW
89 $(MAKE) out=www install-info-WWW
92 $(MAKE) out=www uninstall-WWW
95 $(INSTALL) -d $(DESTDIR)$(local_lilypond_datadir)
101 # All web targets, except info image symlinks and info docs are
102 # installed in non-recursing target from TOP-SRC-DIR
104 -$(INSTALL) -m 755 -d $(DESTDIR)$(webdir)
105 rsync -rl --exclude='*.signature' $(outdir)/offline-root $(DESTDIR)$(webdir)
106 $(MAKE) -C Documentation omf-local-install
109 $(foreach d, $(INFO_DIRECTORIES),$(MAKE) -C $(d) install-info && ) true
112 rm -rf $(DESTDIR)$(webdir)
113 -rmdir $(package_docdir)
114 $(MAKE) -C Documentation uninstall
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
121 WEB_EXAMPLE_FILES = $(wildcard input/$(outdir)/*.ly) \
122 $(wildcard input/*/$(outdir)/*.ly) \
123 $(wildcard input/*/*/$(outdir)/*.ly)
125 WEB_TRACKED_FILES = $(wildcard $(outdir)/*.{midi,html,pdf,png,jpg,jpeg,txt,ly,ily,signature,css,zip,js,idx,php}) \
126 $(wildcard input/$(outdir)/*.{midi,html,pdf,png,jpg,jpeg,txt,ly,ily,signature,css,zip,js,idx,php}) \
127 $(wildcard input/*/$(outdir)/*.{midi,html,pdf,png,jpg,jpeg,txt,ly,ily,signature,css,zip,js,idx,php}) \
128 $(wildcard Documentation/$(outdir)/*.{midi,html,pdf,png,jpg,jpeg,txt,ly,ily,signature,css,zip,js,idx,php}) \
129 $(wildcard Documentation/$(outdir)/*/*.{midi,html,pdf,png,jpg,jpeg,txt,ly,ily,signature,css,zip,js,idx,php})
131 WWW-post: $(top-build-dir)/.htaccess $(outdir)/examples.html $(outdir)/offline-root/index.html
133 # need UTF8 setting in case this is hosted on a website.
134 $(top-build-dir)/.htaccess:
135 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
137 $(outdir)/examples.html: $(WEB_EXAMPLE_FILES)
138 $(buildscript-dir)/mutopia-index -o $(outdir)/examples.html input/
140 $(outdir)/offline-root/index.html: $(WEB_TRACKED_FILES)
141 $(buildscript-dir)/www_post $(PACKAGE_NAME) $(TOPLEVEL_VERSION) $(outdir) "$(WEB_TARGETS)"
142 find $(outdir)/offline-root -type l | xargs rm -f
143 endif # ifeq ($(out),www)
145 # For those who cannot for the life in them remember to type
146 # WEB_TARGETS=..., just bloody make all doc stuff, already.
148 $(MAKE) WEB_TARGETS='online offline' doc
150 tree-prefix = $(outdir)
151 tree-bin = $(tree-prefix)/bin
152 tree-lib = $(tree-prefix)/lib
153 tree-share = $(tree-prefix)/share
155 # Don't put version numbers here. During development
156 # they make no sense, and cause EPS files to become invalid.
158 tree-share-prefix = $(tree-share)/lilypond/current
159 tree-lib-prefix = $(tree-lib)/lilypond/current
163 $(foreach i, $(C_DIRS), $(MAKE) -C $(i) clean &&) true
165 src-ext = c cc yy ll hh icc py scm tex ps texi itexi tely itely sh
167 doc-clean: snippets-clean $(tree-share-prefix)/lilypond-force
169 default: $(config_h) build-dir-setup build-scripts
171 build-dir-setup: $(tree-share-prefix)/lilypond-force
174 $(MAKE) -C scripts/build
176 PO_FILES = $(call src-wildcard,$(src-depth)/po/*.po)
177 HELP_CATALOGS = $(PO_FILES:po/%.po=%)
178 CATALOGS = $(HELP_CATALOGS:lilypond=)
180 # Preparing LilyPond tree for build-dir exec
181 link-tree: $(tree-share-prefix)/lilypond-force
183 $(tree-share-prefix)/lilypond-force: GNUmakefile $(outdir)/VERSION
184 cd $(top-build-dir)/$(outbase) && rm -rf bin lib share
186 mkdir -p $(tree-share-prefix)
187 mkdir -p $(tree-lib-prefix)
188 mkdir -p $(tree-share-prefix)/elisp
189 mkdir -p $(tree-share-prefix)/fonts
190 mkdir -p $(tree-share-prefix)/fonts/otf
191 mkdir -p $(tree-share-prefix)/fonts/tfm
192 mkdir -p $(tree-share-prefix)/fonts/type1
193 mkdir -p $(tree-share-prefix)/fonts/svg
194 mkdir -p $(tree-share-prefix)/fonts/map
195 mkdir -p $(tree-share-prefix)/fonts/enc
196 mkdir -p $(tree-share-prefix)/tex
198 ln -sf ../../lily/$(outconfbase)/lilypond . && \
199 for i in abc2ly convert-ly etf2ly lilymidi lilypond-book lilypond-invoke-editor midi2ly musicxml2ly; \
200 do ln -sf ../../scripts/$(outconfbase)/$$i . ; done
201 cd $(tree-lib-prefix) && \
202 ln -s ../../../../python/$(outconfbase) python
203 cd $(tree-share-prefix) && \
204 ln -s $(top-src-dir)/ly ly && \
205 ln -s ../../../../mf mf && \
206 ln -s $(top-src-dir)/ps && \
207 ln -s ../../../../python/$(outconfbase) python && \
208 ln -s $(top-src-dir)/scm && \
209 ln -s $(top-src-dir)/scripts scripts
210 cd $(tree-share-prefix)/tex && \
211 ln -s $(top-src-dir)/tex source && \
212 ln -s ../../../../../tex/$(outconfbase) tex-out && \
214 cd $(tree-share-prefix)/fonts && \
215 ln -s $(top-src-dir)/mf source && \
217 -cd $(tree-share-prefix)/elisp && \
218 ln -sf ../../../../../elisp/$(outconfbase)/lilypond-words.el . && \
219 ln -s $(top-src-dir)/elisp/*.el .
220 $(foreach i,$(CATALOGS), \
221 (mkdir -p $(tree-share)/locale/$i/LC_MESSAGES && \
222 cd $(tree-share)/locale/$i/LC_MESSAGES && \
223 ln -sf ../../../../../po/$(outconfbase)/$i.mo lilypond.mo) &&) true
224 touch $(tree-share-prefix)/lilypond-force
226 link-mf-tree: $(tree-share-prefix)/mf-link-tree
228 $(tree-share-prefix)/mf-link-tree: $(tree-share-prefix)/lilypond-force
229 -rm -f $(tree-share-prefix)/fonts/otf/* && \
230 rm -f $(tree-share-prefix)/fonts/svg/* && \
231 rm -f $(tree-share-prefix)/fonts/fonts.conf && \
232 rm -f $(tree-share-prefix)/fonts/tfm/* && \
233 rm -f $(tree-share-prefix)/fonts/type1/* && \
234 cd $(tree-share-prefix)/fonts/otf && \
235 ln -s ../../../../../../mf/$(outconfbase)/*.otf .
236 -cd $(tree-share-prefix)/fonts && \
237 ln -s ../../../../../mf/$(outconfbase)/fonts.conf .
238 -cd $(tree-share-prefix)/fonts/svg && \
239 ln -s ../../../../../../mf/$(outconfbase)/*.svg .
240 -cd $(tree-share-prefix)/fonts/svg && \
241 ln -s ../../../../../../mf/$(outconfbase)/*.woff .
242 -cd $(tree-share-prefix)/fonts/tfm && \
243 ln -s ../../../../../../mf/$(outconfbase)/*.tfm .
244 -cd $(tree-share-prefix)/fonts/type1 && \
245 ln -s ../../../../../../mf/$(outconfbase)/*.pf? .
246 touch $(tree-share-prefix)/mf-link-tree
249 etags -o $@ $(find $(top-src-dir) -name 'GNUmakefile*' -o -name '*.make')
251 $(config_h): config.hh.in
253 # this is to prevent people from getting
254 # undefined symbols when we add them to config.h.in,
255 # and they blindly run "cvs update; make".
258 @echo ' *** $(config_h) is out of date'
259 @echo ' *** Remove it and rerun autogen:'
260 @echo ' rm $(config_h); ./autogen.sh'
265 $(MAKE) -C scripts/build
266 PATH=$(buildscript-dir):$(PATH) $(buildscript-dir)/grand-replace
269 ################################################################
272 RESULT_DIR=$(top-build-dir)/out/test-results
276 @echo 'For tracking crashes: use'
278 @echo ' grep sourcefilename `grep -L systems.texi out/lybook-testdb/*/*log|sed s/log/ly/g`'
280 $(MAKE) -C input/regression out=test local-test
281 $(MAKE) -C input/regression/midi out=test local-test
282 $(MAKE) -C input/regression/musicxml out=test local-test
283 $(MAKE) -C input/regression/abc2ly out=test local-test
284 $(MAKE) -C input/regression/lilypond-book out=test local-test
287 @if test -d .git ; then \
288 $(if $(shell git diff), echo "commit before base lining" && false,true) ; \
292 $(MAKE) out=test -C input/regression local-test-baseline
293 $(MAKE) out=test -C input/regression/midi local-test-baseline
294 $(MAKE) out=test -C input/regression/musicxml local-test-baseline
295 $(MAKE) out=test -C input/regression/abc2ly local-test-baseline
296 $(MAKE) out=test -C input/regression/lilypond-book local-test-baseline
297 $(MAKE) test-snippets-clean
302 mkdir -p $(RESULT_DIR)
303 $(buildscript-dir)/output-distance --create-images --output-dir $(RESULT_DIR) \
304 input/regression/out-test-baseline input/regression/out-test \
305 input/regression/midi/out-test-baseline input/regression/midi/out-test
306 @find input ly -name '*.ly' -print |grep -v 'out.*/' | xargs grep '\\version' -L | grep -v "standard input" |sed 's/^/**** Missing version: /g'
310 for a in `cat $(RESULT_DIR)/changed.txt` ; do \
311 echo removing $$a* ; \
316 test-clean: test-snippets-clean
317 $(MAKE) -C input/regression out=test clean
323 rm -rf out/lybook-testdb
325 # we want this separate for security; see CG 4.2. -gp
327 $(MAKE) config_make=$(config_make) \
328 top-src-dir=$(top-src-dir) \
329 -f $(top-src-dir)/make/website.make \