]> git.donarmstrong.com Git - lilypond.git/blob - GNUmakefile.in
Merge branch 'master' of git+ssh://jneem@git.sv.gnu.org/srv/git/lilypond
[lilypond.git] / GNUmakefile.in
1 # -*-Makefile-*-
2
3 depth = .
4
5 SUBDIRS = buildscripts 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 
20 README_FILES = COPYING DEDICATION ROADMAP THANKS HACKING
21 TOPDOC_FILES = AUTHORS README INSTALL 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 .cvsignore .gitignore SConstruct \
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 include $(depth)/make/stepmake.make
34
35 #
36 # suggested settings
37 #
38 # LILYPOND_JOBS= -djob-count=X   ## for SMP/Multicore machine
39
40 include local.make
41
42 local-dist: dist-toplevel-txt-files dist-changelog
43
44 dist-changelog:
45         if  test -d $(top-src-dir)/.git ; then \
46                 cd $(top-src-dir) && git-whatchanged gub-2.9.29-2.. > $(distdir)/ChangeLog ; \
47         else \
48                 cp $(top-src-dir)/ChangeLog $(distdir) ; \
49         fi
50
51 all: $(outdir)/VERSION
52
53 $(outdir)/VERSION: $(config_make) VERSION
54         -mkdir -p $(outdir)
55         echo $(TOPLEVEL_VERSION) > $@
56
57 dist-toplevel-txt-files:
58         -mkdir -p $(distdir)
59         ln $(TOPDOC_TXT_FILES) $(distdir)/
60         ln $(top-src-dir)/stepmake/aclocal.m4 $(distdir)/
61
62 doc: 
63         $(MAKE) -C Documentation
64
65 install-WWW:
66         -$(INSTALL) -m 755 -d $(DESTDIR)$(webdir)
67         rsync -rl $(outdir)/offline-root/ $(DESTDIR)$(webdir)
68         $(MAKE) -C Documentation/user local-install-WWW
69         $(MAKE) -C Documentation/user install-info
70
71 install-help2man:
72         $(MAKE) -C scripts man install-help2man
73         $(MAKE) -C lily man install-help2man
74
75 web-install:
76         $(MAKE) out=www install-WWW
77
78 uninstall-WWW:
79         echo TODO
80
81 web-uninstall:
82         $(MAKE) out=www uninstall-WWW
83
84 local-install:
85         $(INSTALL) -d $(DESTDIR)$(local_lilypond_datadir)
86
87 final-install:
88         @true
89
90
91 # For online docs with content negotiation, issue `make web WEB_TARGETS=online'
92 # For both online and offline docs, issue `make web WEB_TARGETS="offline online"'
93 WEB_TARGETS = offline
94
95 local-WWW-post:
96 # need UTF8 setting in case this is hosted on a website. 
97         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
98         $(PYTHON) $(buildscript-dir)/mutopia-index.py -o $(outdir)/examples.html input/
99         rm -rf $(outdir)/online-root
100         rm -rf $(outdir)/offline-root
101         $(PYTHON) $(buildscript-dir)/www_post.py $(PACKAGE_NAME) $(TOPLEVEL_VERSION) $(buildscript-dir) $(outdir) "$(WEB_TARGETS)"
102
103
104 tree-prefix = $(outdir)
105 tree-bin = $(tree-prefix)/bin
106 tree-lib = $(tree-prefix)/lib
107 tree-share = $(tree-prefix)/share
108
109 # Don't put version numbers here. During development
110 # they make no sense, and cause EPS files to become invalid.
111
112 tree-share-prefix = $(tree-share)/lilypond/current
113 tree-lib-prefix = $(tree-lib)/lilypond/current
114
115 C_DIRS = flower lily
116 c-clean:
117         $(foreach i, $(C_DIRS), $(MAKE) -C $(i) clean &&) true
118
119 src-ext = c cc yy ll hh icc py scm tex ps texi itexi tely itely sh
120
121 web-clean:
122         $(MAKE) out=www clean
123         $(MAKE) $(tree-share-prefix)/lilypond-force
124
125 default: $(config_h) build-dir-setup 
126
127 build-dir-setup: $(tree-share-prefix)/lilypond-force
128
129 PO_FILES = $(call src-wildcard,$(src-depth)/po/*.po)
130 HELP_CATALOGS = $(PO_FILES:po/%.po=%)
131 CATALOGS = $(HELP_CATALOGS:lilypond=) 
132
133 $(tree-share-prefix)/lilypond-force link-tree: GNUmakefile $(outdir)/VERSION 
134 # Preparing LilyPond tree for build-dir exec
135         cd $(top-build-dir)/$(outbase) && rm -rf bin lib share
136         mkdir -p $(tree-bin)
137         mkdir -p $(tree-share-prefix)
138         mkdir -p $(tree-lib-prefix)
139         mkdir -p $(tree-share-prefix)/elisp
140         mkdir -p $(tree-share-prefix)/fonts
141         mkdir -p $(tree-share-prefix)/fonts/otf
142         mkdir -p $(tree-share-prefix)/fonts/tfm
143         mkdir -p $(tree-share-prefix)/fonts/type1
144         mkdir -p $(tree-share-prefix)/fonts/svg
145         mkdir -p $(tree-share-prefix)/fonts/map
146         mkdir -p $(tree-share-prefix)/fonts/enc
147         mkdir -p $(tree-share-prefix)/tex
148         cd $(tree-bin) && \
149                 ln -sf ../../lily/$(outconfbase)/lilypond . && \
150                 for i in abc2ly convert-ly etf2ly lilypond-book lilypond-invoke-editor midi2ly musicxml2ly; \
151                         do ln -sf ../../scripts/$(outconfbase)/$$i . ; done
152         cd $(tree-lib-prefix) && \
153                 ln -s ../../../../python/$(outconfbase) python
154         cd $(tree-share-prefix) && \
155                 ln -s $(top-src-dir)/ly ly && \
156                 ln -s ../../../../mf mf && \
157                 ln -s $(top-src-dir)/ps && \
158                 ln -s ../../../../python/$(outconfbase) python && \
159                 ln -s $(top-src-dir)/scm && \
160                 ln -s $(top-src-dir)/scripts scripts
161         cd $(tree-share-prefix)/tex && \
162                 ln -s $(top-src-dir)/tex source && \
163                 ln -s ../../../../../tex/$(outconfbase) tex-out && \
164                 ln -s ../../../../../mf/$(outconfbase) mf-out
165
166         cd $(tree-share-prefix)/fonts && \
167                 ln -s $(top-src-dir)/mf source && \
168                 true
169         -cd $(tree-share-prefix)/elisp && \
170                 ln -sf ../../../../../../elisp/$(outconfbase)/lilypond-words.el . && \
171                 ln -s $(top-src-dir)/elisp/*.el .
172         $(foreach i,$(CATALOGS), \
173                 (mkdir -p $(tree-share)/locale/$i/LC_MESSAGES && \
174                 cd $(tree-share)/locale/$i/LC_MESSAGES && \
175                 ln -sf ../../../../../po/$(outconfbase)/$i.mo lilypond.mo) &&) true
176         touch $(tree-share-prefix)/lilypond-force
177
178 $(tree-share-prefix)/mf-link-tree link-mf-tree: $(tree-share-prefix)/lilypond-force
179         -rm -f $(tree-share-prefix)/fonts/otf/* &&  \
180         rm -f $(tree-share-prefix)/fonts/svg/* &&  \
181         rm -f $(tree-share-prefix)/fonts/tfm/* &&  \
182         rm -f $(tree-share-prefix)/fonts/type1/* &&  \
183                 cd $(tree-share-prefix)/fonts/otf && \
184                 ln -s ../../../../../../mf/$(outconfbase)/*.otf .
185         -cd $(tree-share-prefix)/fonts/svg && \
186                 ln -s ../../../../../../mf/$(outconfbase)/*.svg .
187         -cd $(tree-share-prefix)/fonts/tfm && \
188                 ln -s ../../../../../../mf/$(outconfbase)/*.tfm .
189         -cd $(tree-share-prefix)/fonts/type1 && \
190                 ln -s ../../../../../../mf/$(outconfbase)/*.pfa .
191
192 TAGS.make: dummy
193         etags -o $@ $(find $(top-src-dir) -name 'GNUmakefile*' -o -name '*.make')
194
195 $(config_h): config.hh.in
196 #
197 # this is to prevent people from getting
198 # undefined symbols  when we add them to config.h.in,
199 # and they blindly run "cvs update; make".
200 #
201         @echo
202         @echo ' *** $(config_h) is out of date'
203         @echo ' *** Remove it and rerun autogen:'
204         @echo '         rm $(config_h); ./autogen.sh'
205         @echo
206         @false
207
208
209 ################################################################
210 # testing
211
212 RESULT_DIR=$(top-build-dir)/out/test-results
213 OUT_TEST=test
214
215
216 test:
217         rm -f input/regression/out-$(OUT_TEST)/collated-files.html
218         @echo -en 'For tracking crashes: use\n\n\t'
219         @echo 'grep sourcefilename `grep -L systems.texi input/regression/out-test/*log|sed s/log/ly/g`'
220         @echo
221         if test -d .git  ; then \
222                 echo -e 'HEAD is:\n\n\t' ; \
223                 git log --max-count=1 --pretty=oneline ;\
224                 echo -e '\n\n\n' ; \
225                 git diff ; \
226         fi > input/regression/out-test/tree.gittxt
227         $(MAKE) -C input/regression/ out=$(OUT_TEST) LILYPOND_BOOK_LILYPOND_FLAGS="--backend=eps --formats=ps $(LILYPOND_JOBS) -dseparate-log-files -dinclude-eps-fonts -dgs-load-fonts --header=texidoc -I $(top-src-dir)/input/manual -ddump-profile -dcheck-internal-types -ddump-signatures -danti-alias-factor=1" LILYPOND_BOOK_VERBOSE= out-$(OUT_TEST)/collated-files.html
228         @find input ly -name '*.ly' -print |grep -v 'out.*/' | xargs grep '\\version' -L | grep -v "standard input" |sed 's/^/**** Missing version: /g' 
229
230
231 test-baseline: test
232         rm -rf input/regression/out-test-baseline
233         mv input/regression/out-test input/regression/out-test-baseline
234
235 local-check: test
236         rm -rf $(RESULT_DIR)
237         mkdir -p $(RESULT_DIR)
238         $(PYTHON) $(buildscript-dir)/output-distance.py --create-images --output-dir $(RESULT_DIR) input/regression/out-test-baseline input/regression/out-test/
239
240
241 test-redo:
242         for a in `cat $(RESULT_DIR)/changed.txt` ; do \
243                 echo removing $$a* ; \
244                 rm -f $$a* ;\
245         done
246         $(MAKE) check
247
248 test-clean:
249         $(MAKE) -C input/regression/ out=$(OUT_TEST) clean