5 SUBDIRS = python scripts \
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 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 INSTALLATION_DIR=$(local_lilypond_datadir)
30 INSTALLATION_FILES=$(config_make) VERSION
31 GENERATED_BUILD_FILES=configure aclocal.m4 autogen.sh
34 STEPMAKE_TEMPLATES=toplevel po install
35 LOCALSTEPMAKE_TEMPLATES=lilypond
37 include $(depth)/make/stepmake.make
39 .PHONY: test info website
41 dist: local-dist $(GENERATED_BUILD_FILES) top-doc refresh-release-files .gitfilelist
42 @cd $(top-src-dir) && \
43 if test -n "`find . -name .git`" -a '(' -n "`git diff HEAD | head -1`" \
44 -o -n "`git status | grep -i untracked`" ')'; \
45 then echo "*** dist must been rolled on a clean git tree;"; \
46 echo "uncommitted changes or untracked files detected, aborting."; \
49 $(MAKE) local-dist $(distdir)
50 chmod -R a+r $(distdir)
51 chmod a+x `find $(distdir) -type d -print`
52 $(LN) $(TOPDOC_TXT_FILES) $(distdir)
53 $(LN) $(GENERATED_BUILD_FILES:%=$(src-dir)/%) .gitfilelist $(distdir)
54 cd $(top-src-dir) && xargs $(buildscript-dir)/mass-link hard . $(distdir) <$(top-build-dir)/.gitfilelist
55 if test -n "`find $(top-src-dir) -name .git`"; then \
56 COMMIT_DATE=`git --git-dir=$(top-src-dir)/.git log -1 --format=%cD`; \
57 find $(distdir) | xargs touch -d "$$COMMIT_DATE"; fi
58 (cd ./$(depth)/$(outdir); $(TAR) -cf - --owner=0 --group=0 $(DIST_NAME) | gzip -9 > $(DIST_NAME).tar.gz)
61 ifneq ($(shell find $(top-src-dir) -name .git),)
62 .gitfilelist: $(top-src-dir)/.git/index
63 cd $(top-src-dir) && git ls-files >$(top-build-dir)/$@
67 .gitfilelist: $(src-dir)/.gitfilelist
72 all: $(outdir)/VERSION
74 $(outdir)/VERSION: $(config_make) VERSION
76 echo $(TOPLEVEL_VERSION) > $@
78 $(outdir)/ChangeLog: $(outdir)/VERSION
79 @echo 'See http://git.savannah.gnu.org/gitweb/?p=lilypond.git;a=log;h=refs/tags/release/$(TOPLEVEL_VERSION)-1' > $@
81 $(outdir)/RELEASE-COMMIT: # FIXME: any file in $(top-src-dir)/.git/ we can depend on and be sure RELEASE-COMMIT is up to date?
82 git --git-dir=$(top-src-dir)/.git show HEAD | head -100 > $@
84 # junk me as soon as RELEASE-COMMIT FIXME: has been addressed
85 refresh-release-files:
86 test -d $(top-src-dir)/.git && rm -f $(RELEASE_OUT_FILES)
87 $(MAKE) $(RELEASE_OUT_FILES)
90 $(MAKE) -C scripts/build
93 top-doc: python-modules
95 local-clean: local-clean-ChangeLog local-clean-filelist
97 local-clean-ChangeLog:
101 $(foreach d, $(INFO_DIRECTORIES),$(MAKE) -C $(d) out=www info && ) true
104 $(MAKE) out=www COPY_INFO_IMAGES=1 install-info-WWW
107 $(MAKE) -C scripts man install-help2man
108 $(MAKE) -C lily man install-help2man
111 $(MAKE) out=www install-WWW
112 $(MAKE) out=www install-info-WWW
115 $(MAKE) out=www uninstall-WWW
118 $(INSTALL) -d $(DESTDIR)$(local_lilypond_datadir)
124 # All web targets, except info image symlinks and info docs are
125 # installed in non-recursing target from TOP-SRC-DIR
127 -$(INSTALL) -m 755 -d $(DESTDIR)$(webdir)
128 rsync -rl --exclude='*.signature' $(outdir)/offline-root/ $(DESTDIR)$(webdir)
129 $(MAKE) -C Documentation omf-local-install
132 $(foreach d, $(INFO_DIRECTORIES),$(MAKE) -C $(d) install-info && ) true
135 rm -rf $(DESTDIR)$(webdir)
136 -rmdir $(package_docdir)
137 $(MAKE) -C Documentation uninstall
140 # For online docs with content negotiation, issue `make doc WEB_TARGETS=online'
141 # For both online and offline docs, issue `make doc WEB_TARGETS="offline online"'
142 WEB_TARGETS = offline
144 WEB_ROOT_FILES = $(WEB_TARGETS:%=$(outdir)/%-root/index.html)
146 WEB_TRACKED_FILES = $(filter-out $(outdir)/index.html, \
147 $(shell bash -O nullglob -c "echo $(outdir)/*.{midi,html,pdf,png,jpg,jpeg,txt,ly,ily,signature,css,zip,js,idx,php}")) \
148 $(shell bash -O nullglob -c "echo input/$(outdir)/*.{midi,html,pdf,png,jpg,jpeg,txt,ly,ily,signature,css,zip,js,idx,php}") \
149 $(shell bash -O nullglob -c "echo input/*/$(outdir)/*.{midi,html,pdf,png,jpg,jpeg,txt,ly,ily,signature,css,zip,js,idx,php}") \
150 $(shell bash -O nullglob -c "echo input/*/*/$(outdir)/*.{midi,html,pdf,png,jpg,jpeg,txt,ly,ily,signature,css,zip,js,idx,php}") \
151 $(shell bash -O nullglob -c "echo input/regression/lilypond-book/$(outdir)/*.{info,tex}") \
152 $(shell bash -O nullglob -c "echo Documentation/$(outdir)/*.{midi,html,pdf,png,jpg,jpeg,txt,ly,ily,signature,css,zip,js,idx,php}") \
153 $(shell bash -O nullglob -c "echo Documentation/$(outdir)/*/*.{midi,html,pdf,png,jpg,jpeg,txt,ly,ily,signature,css,zip,js,idx,php}")
155 WWW-post: $(top-build-dir)/.htaccess $(WEB_ROOT_FILES)
157 # need UTF8 setting in case this is hosted on a website.
158 $(top-build-dir)/.htaccess:
159 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
161 $(outdir)/offline-root/index.html: $(WEB_TRACKED_FILES)
162 $(buildscript-dir)/www_post $(PACKAGE_NAME) $(TOPLEVEL_VERSION) $(outdir) offline
163 find $(outdir)/offline-root -type l | xargs rm -f
165 $(outdir)/online-root/index.html: $(WEB_TRACKED_FILES)
166 $(buildscript-dir)/www_post $(PACKAGE_NAME) $(TOPLEVEL_VERSION) $(outdir) online
167 endif # ifeq ($(out),www)
169 # For those who cannot for the life in them remember to type
170 # WEB_TARGETS=..., just bloody make all doc stuff, already.
172 $(MAKE) WEB_TARGETS='online offline' doc
174 tree-prefix = $(outdir)
175 tree-bin = $(tree-prefix)/bin
176 tree-lib = $(tree-prefix)/lib
177 tree-share = $(tree-prefix)/share
179 # Don't put version numbers here. During development
180 # they make no sense, and cause EPS files to become invalid.
182 tree-share-prefix = $(tree-share)/lilypond/current
183 tree-lib-prefix = $(tree-lib)/lilypond/current
187 $(foreach i, $(C_DIRS), $(MAKE) -C $(i) clean &&) true
189 src-ext = c cc yy ll hh icc py scm tex ps texi itexi tely itely sh
191 doc-clean: snippets-clean $(tree-share-prefix)/lilypond-force
193 default: $(config_h) build-dir-setup build-scripts
195 build-dir-setup: $(tree-share-prefix)/lilypond-force
198 $(MAKE) -C scripts/build
200 PO_FILES = $(call src-wildcard,$(src-depth)/po/*.po)
201 HELP_CATALOGS = $(PO_FILES:po/%.po=%)
202 CATALOGS = $(HELP_CATALOGS:lilypond=)
204 # Preparing LilyPond tree for build-dir exec
205 link-tree: $(tree-share-prefix)/lilypond-force
207 $(tree-share-prefix)/lilypond-force: GNUmakefile $(outdir)/VERSION
208 cd $(top-build-dir)/$(outbase) && rm -rf bin lib share
210 mkdir -p $(tree-share-prefix)
211 mkdir -p $(tree-lib-prefix)
212 mkdir -p $(tree-share-prefix)/elisp
213 mkdir -p $(tree-share-prefix)/fonts
214 mkdir -p $(tree-share-prefix)/fonts/otf
215 mkdir -p $(tree-share-prefix)/fonts/tfm
216 mkdir -p $(tree-share-prefix)/fonts/type1
217 mkdir -p $(tree-share-prefix)/fonts/svg
218 mkdir -p $(tree-share-prefix)/fonts/map
219 mkdir -p $(tree-share-prefix)/fonts/enc
220 mkdir -p $(tree-share-prefix)/tex
222 ln -sf ../../lily/$(outconfbase)/lilypond . && \
223 for i in abc2ly convert-ly etf2ly lilymidi lilypond-book lilypond-invoke-editor midi2ly musicxml2ly; \
224 do ln -sf ../../scripts/$(outconfbase)/$$i . ; done
225 cd $(tree-lib-prefix) && \
226 ln -s ../../../../python/$(outconfbase) python
227 cd $(tree-share-prefix) && \
228 ln -s $(top-src-dir)/ly ly && \
229 ln -s ../../../../mf mf && \
230 ln -s $(top-src-dir)/ps && \
231 ln -s ../../../../python/$(outconfbase) python && \
232 ln -s $(top-src-dir)/scm && \
233 ln -s $(top-src-dir)/scripts scripts
234 cd $(tree-share-prefix)/tex && \
235 ln -s $(top-src-dir)/tex source && \
236 ln -s ../../../../../tex/$(outconfbase) tex-out && \
238 cd $(tree-share-prefix)/fonts && \
239 ln -s $(top-src-dir)/mf source && \
241 -cd $(tree-share-prefix)/elisp && \
242 ln -sf ../../../../../elisp/$(outconfbase)/lilypond-words.el . && \
243 ln -s $(top-src-dir)/elisp/*.el .
244 $(foreach i,$(CATALOGS), \
245 (mkdir -p $(tree-share)/locale/$i/LC_MESSAGES && \
246 cd $(tree-share)/locale/$i/LC_MESSAGES && \
247 ln -sf ../../../../../po/$(outconfbase)/$i.mo lilypond.mo) &&) true
248 touch $(tree-share-prefix)/lilypond-force
250 link-mf-tree: $(tree-share-prefix)/mf-link-tree
252 $(tree-share-prefix)/mf-link-tree: $(tree-share-prefix)/lilypond-force
253 -rm -f $(tree-share-prefix)/fonts/otf/* && \
254 rm -f $(tree-share-prefix)/fonts/svg/* && \
255 rm -f $(tree-share-prefix)/fonts/fonts.conf && \
256 rm -f $(tree-share-prefix)/fonts/00-lilypond-fonts.conf && \
257 rm -f $(tree-share-prefix)/fonts/99-lilypond-fonts.conf && \
258 rm -f $(tree-share-prefix)/fonts/tfm/* && \
259 rm -f $(tree-share-prefix)/fonts/type1/* && \
260 cd $(tree-share-prefix)/fonts/otf && \
261 ln -s ../../../../../../mf/$(outconfbase)/*.otf . && \
262 $(foreach i,$(addprefix $(TEXGYRE_DIR)/,$(TEXGYRE_FILES)), \
263 ln -s $i . && ) true && \
264 $(foreach i,$(addprefix $(URWOTF_DIR)/,$(URWOTF_FILES)), \
266 -cd $(tree-share-prefix)/fonts && \
267 ln -s ../../../../../mf/$(outconfbase)/fonts.conf . && \
268 ln -s ../../../../../mf/$(outconfbase)/00-lilypond-fonts.conf . && \
269 ln -s ../../../../../mf/$(outconfbase)/99-lilypond-fonts.conf .
270 -cd $(tree-share-prefix)/fonts/svg && \
271 ln -s ../../../../../../mf/$(outconfbase)/*.svg .
272 -cd $(tree-share-prefix)/fonts/svg && \
273 ln -s ../../../../../../mf/$(outconfbase)/*.woff .
274 -cd $(tree-share-prefix)/fonts/tfm && \
275 ln -s ../../../../../../mf/$(outconfbase)/*.tfm .
276 -cd $(tree-share-prefix)/fonts/type1 && \
277 ln -s ../../../../../../mf/$(outconfbase)/*.pf? .
278 touch $(tree-share-prefix)/mf-link-tree
281 etags -o $@ $(find $(top-src-dir) -name 'GNUmakefile*' -o -name '*.make')
283 $(config_h): config.hh.in
285 # this is to prevent people from getting
286 # undefined symbols when we add them to config.h.in,
287 # and they blindly run "cvs update; make".
290 @echo ' *** $(config_h) is out of date'
291 @echo ' *** Remove it and rerun autogen:'
292 @echo ' rm $(config_h); ./autogen.sh'
297 $(MAKE) -C scripts/build
298 PATH=$(buildscript-dir):$(PATH) $(buildscript-dir)/grand-replace
301 ################################################################
304 RESULT_DIR=$(top-build-dir)/out/test-results
308 @echo 'For tracking crashes: use'
310 @echo ' grep sourcefilename `grep -L systems.texi out/lybook-testdb/*/*log|sed s/log/ly/g`'
312 $(MAKE) -C input/regression out=test local-test
313 $(MAKE) -C input/regression/midi out=test local-test
314 $(MAKE) -C input/regression/musicxml out=test local-test
315 $(MAKE) -C input/regression/abc2ly out=test local-test
316 $(MAKE) -C input/regression/lilypond-book out=test local-test
319 @if test -d .git ; then \
320 $(if $(shell git diff), echo "commit before base lining" && false,true) ; \
324 $(MAKE) out=test -C input/regression local-test-baseline
325 $(MAKE) out=test -C input/regression/midi local-test-baseline
326 $(MAKE) out=test -C input/regression/musicxml local-test-baseline
327 $(MAKE) out=test -C input/regression/abc2ly local-test-baseline
328 $(MAKE) out=test -C input/regression/lilypond-book local-test-baseline
329 $(MAKE) test-snippets-clean
334 mkdir -p $(RESULT_DIR)
335 $(buildscript-dir)/output-distance --local-datadir --create-images --output-dir $(RESULT_DIR) \
336 input/regression/out-test-baseline input/regression/out-test \
337 input/regression/midi/out-test-baseline input/regression/midi/out-test
338 @find input ly -name '*.ly' -print |grep -v 'out.*/' | xargs grep '\\version' -L | grep -v "standard input" |sed 's/^/**** Missing version: /g'
342 for a in `cat $(RESULT_DIR)/changed.txt` ; do \
343 echo removing $$a* ; \
348 test-clean: test-snippets-clean
349 $(MAKE) -C input/regression out=test clean
355 rm -rf out/lybook-testdb
357 # we want this separate for security; see CG 4.2. -gp
359 $(MAKE) config_make=$(config_make) \
360 top-src-dir=$(top-src-dir) \
361 -f $(top-src-dir)/make/website.make \