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