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