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