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