LSR: Update.
[lilypond.git] / GNUmakefile.in
blob426ae7f60c196643eebfeb28f796398e68df3bc0
1 # -*-Makefile-*-
3 depth = .
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)
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
30 # bootstrap stepmake:
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
43 -mkdir -p $(outdir)
44 echo $(TOPLEVEL_VERSION) > $@
46 ChangeLog: $(outdir)/VERSION
47 @echo 'See http://git.savannah.gnu.org/gitweb/?p=lilypond.git;a=log;h=refs/tags/release/$(TOPLEVEL_VERSION)-1' > ChangeLog
49 python-modules:
50 $(MAKE) -C python
52 do-top-doc: python-modules
54 local-clean: local-clean-ChangeLog
56 local-clean-ChangeLog:
57 rm -f ChangeLog
59 dist-toplevel-txt-files: do-top-doc
60 -mkdir -p $(distdir)
61 ln $(TOPDOC_TXT_FILES) $(distdir)/
62 ln $(top-src-dir)/stepmake/aclocal.m4 $(distdir)/
64 doc:
65 $(MAKE) -C Documentation
67 info:
68 $(foreach d, $(INFO_DIRECTORIES),$(MAKE) -C $(d) out=www info && ) true
70 info-install: info
71 $(MAKE) out=www COPY_INFO_IMAGES=1 install-info-WWW
73 install-help2man:
74 $(MAKE) -C scripts man install-help2man
75 $(MAKE) -C lily man install-help2man
77 # All web targets, except info image symlinks and info docs are
78 # installed in non-recursing target from TOP-SRC-DIR
79 install-WWW:
80 -$(INSTALL) -m 755 -d $(DESTDIR)$(webdir)
81 rsync -rl --exclude='*.signature' $(outdir)/offline-root/ $(DESTDIR)$(webdir)
83 install-info-WWW:
84 $(foreach d, $(INFO_DIRECTORIES),$(MAKE) -C $(d) install-info && ) true
86 web-install:
87 $(MAKE) out=www install-WWW
88 $(MAKE) out=www install-info-WWW
90 uninstall-WWW:
91 rm -rf $(DESTDIR)$(webdir)
92 -rmdir $(package_docdir)
93 $(MAKE) -C Documentation/user uninstall
94 $(MAKE) -C input/lsr uninstall
96 web-uninstall:
97 $(MAKE) out=www uninstall-WWW
99 local-install:
100 $(INSTALL) -d $(DESTDIR)$(local_lilypond_datadir)
102 final-install:
103 @true
106 # For online docs with content negotiation, issue `make web WEB_TARGETS=online'
107 # For both online and offline docs, issue `make web WEB_TARGETS="offline online"'
108 WEB_TARGETS = offline
110 WWW-post:
111 # need UTF8 setting in case this is hosted on a website.
112 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
113 $(buildscript-dir)/mutopia-index -o $(outdir)/examples.html input/
114 find $(outdir) -name '*-root' | xargs rm -rf
115 $(buildscript-dir)/www_post $(PACKAGE_NAME) $(TOPLEVEL_VERSION) $(outdir) "$(WEB_TARGETS)"
116 find $(outdir)/offline-root -type l -delete
119 tree-prefix = $(outdir)
120 tree-bin = $(tree-prefix)/bin
121 tree-lib = $(tree-prefix)/lib
122 tree-share = $(tree-prefix)/share
124 # Don't put version numbers here. During development
125 # they make no sense, and cause EPS files to become invalid.
127 tree-share-prefix = $(tree-share)/lilypond/current
128 tree-lib-prefix = $(tree-lib)/lilypond/current
130 C_DIRS = flower lily
131 c-clean:
132 $(foreach i, $(C_DIRS), $(MAKE) -C $(i) clean &&) true
134 src-ext = c cc yy ll hh icc py scm tex ps texi itexi tely itely sh
136 web-clean: snippets-clean $(tree-share-prefix)/lilypond-force
138 default: $(config_h) build-dir-setup
140 build-dir-setup: $(tree-share-prefix)/lilypond-force
142 PO_FILES = $(call src-wildcard,$(src-depth)/po/*.po)
143 HELP_CATALOGS = $(PO_FILES:po/%.po=%)
144 CATALOGS = $(HELP_CATALOGS:lilypond=)
146 $(tree-share-prefix)/lilypond-force link-tree: GNUmakefile $(outdir)/VERSION
147 # Preparing LilyPond tree for build-dir exec
148 cd $(top-build-dir)/$(outbase) && rm -rf bin lib share
149 mkdir -p $(tree-bin)
150 mkdir -p $(tree-share-prefix)
151 mkdir -p $(tree-lib-prefix)
152 mkdir -p $(tree-share-prefix)/elisp
153 mkdir -p $(tree-share-prefix)/fonts
154 mkdir -p $(tree-share-prefix)/fonts/otf
155 mkdir -p $(tree-share-prefix)/fonts/tfm
156 mkdir -p $(tree-share-prefix)/fonts/type1
157 mkdir -p $(tree-share-prefix)/fonts/svg
158 mkdir -p $(tree-share-prefix)/fonts/map
159 mkdir -p $(tree-share-prefix)/fonts/enc
160 mkdir -p $(tree-share-prefix)/tex
161 cd $(tree-bin) && \
162 ln -sf ../../lily/$(outconfbase)/lilypond . && \
163 for i in abc2ly convert-ly etf2ly lilymidi lilypond-book lilypond-invoke-editor midi2ly musicxml2ly; \
164 do ln -sf ../../scripts/$(outconfbase)/$$i . ; done
165 cd $(tree-lib-prefix) && \
166 ln -s ../../../../python/$(outconfbase) python
167 cd $(tree-share-prefix) && \
168 ln -s $(top-src-dir)/ly ly && \
169 ln -s ../../../../mf mf && \
170 ln -s $(top-src-dir)/ps && \
171 ln -s ../../../../python/$(outconfbase) python && \
172 ln -s $(top-src-dir)/scm && \
173 ln -s $(top-src-dir)/scripts scripts
174 cd $(tree-share-prefix)/tex && \
175 ln -s $(top-src-dir)/tex source && \
176 ln -s ../../../../../tex/$(outconfbase) tex-out && \
177 true
178 cd $(tree-share-prefix)/fonts && \
179 ln -s $(top-src-dir)/mf source && \
180 true
181 -cd $(tree-share-prefix)/elisp && \
182 ln -sf ../../../../../elisp/$(outconfbase)/lilypond-words.el . && \
183 ln -s $(top-src-dir)/elisp/*.el .
184 $(foreach i,$(CATALOGS), \
185 (mkdir -p $(tree-share)/locale/$i/LC_MESSAGES && \
186 cd $(tree-share)/locale/$i/LC_MESSAGES && \
187 ln -sf ../../../../../po/$(outconfbase)/$i.mo lilypond.mo) &&) true
188 touch $(tree-share-prefix)/lilypond-force
190 $(tree-share-prefix)/mf-link-tree link-mf-tree: $(tree-share-prefix)/lilypond-force
191 -rm -f $(tree-share-prefix)/fonts/otf/* && \
192 rm -f $(tree-share-prefix)/fonts/svg/* && \
193 rm -f $(tree-share-prefix)/fonts/fonts.conf && \
194 rm -f $(tree-share-prefix)/fonts/tfm/* && \
195 rm -f $(tree-share-prefix)/fonts/type1/* && \
196 cd $(tree-share-prefix)/fonts/otf && \
197 ln -s ../../../../../../mf/$(outconfbase)/*.otf .
198 -cd $(tree-share-prefix)/fonts/ && \
199 ln -s ../../../../../mf/$(outconfbase)/fonts.conf .
200 -cd $(tree-share-prefix)/fonts/svg && \
201 ln -s ../../../../../../mf/$(outconfbase)/*.svg .
202 -cd $(tree-share-prefix)/fonts/tfm && \
203 ln -s ../../../../../../mf/$(outconfbase)/*.tfm .
204 -cd $(tree-share-prefix)/fonts/type1 && \
205 ln -s ../../../../../../mf/$(outconfbase)/*.pf? .
207 TAGS.make: dummy
208 etags -o $@ $(find $(top-src-dir) -name 'GNUmakefile*' -o -name '*.make')
210 $(config_h): config.hh.in
212 # this is to prevent people from getting
213 # undefined symbols when we add them to config.h.in,
214 # and they blindly run "cvs update; make".
216 @echo
217 @echo ' *** $(config_h) is out of date'
218 @echo ' *** Remove it and rerun autogen:'
219 @echo ' rm $(config_h); ./autogen.sh'
220 @echo
221 @false
223 grand-replace:
224 $(MAKE) -C scripts/build
225 PATH=$(buildscript-dir):$(PATH) $(buildscript-dir)/grand-replace
227 ################################################################
228 # testing
230 RESULT_DIR=$(top-build-dir)/out/test-results
233 test:
234 @echo -en 'For tracking crashes: use\n\n\t'
235 @echo 'grep sourcefilename `grep -L systems.texi out/lybook-db/*/*log|sed s/log/ly/g`'
236 @echo
237 $(MAKE) -C input/regression/ out=test local-test
238 $(MAKE) -C input/regression/musicxml out=test local-test
240 test-baseline:
241 @if test -d .git ; then \
242 $(if $(shell git diff), echo "commit before base lining" && false,true) ; \
244 $(MAKE)
245 $(MAKE) test
246 $(MAKE) out=test -C input/regression/ local-test-baseline
247 $(MAKE) out=test -C input/regression/musicxml local-test-baseline
248 $(MAKE) test-snippets-clean
251 local-check: test
252 rm -rf $(RESULT_DIR)
253 mkdir -p $(RESULT_DIR)
254 $(buildscript-dir)/output-distance --create-images --output-dir $(RESULT_DIR) input/regression/out-test-baseline input/regression/out-test/
255 @find input ly -name '*.ly' -print |grep -v 'out.*/' | xargs grep '\\version' -L | grep -v "standard input" |sed 's/^/**** Missing version: /g'
258 test-redo:
259 for a in `cat $(RESULT_DIR)/changed.txt` ; do \
260 echo removing $$a* ; \
261 rm -f $$a* ;\
262 done
263 $(MAKE) check
265 test-clean: test-snippets-clean
266 $(MAKE) -C input/regression/ out=test clean
268 snippets-clean:
269 rm -rf out/lybook-db
271 test-snippets-clean:
272 rm -rf out/lybook-testdb