]> git.donarmstrong.com Git - lilypond.git/blob - GNUmakefile.in
set LILYPOND_BOOK_LILYPOND_FLAGS explicitly for test. Removes PDF for tests.
[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 = ChangeLog 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 # Set
37 # CHECK_SOURCE=
38 -include local.make
39
40 local-dist: dist-toplevel-txt-files 
41
42 default: $(outdir)/VERSION
43
44 $(outdir)/VERSION: $(config_make) VERSION
45         echo $(TOPLEVEL_VERSION) > $@
46
47 dist-toplevel-txt-files:
48         -mkdir -p $(distdir)
49         ln $(TOPDOC_TXT_FILES) $(distdir)/
50         ln $(top-src-dir)/stepmake/aclocal.m4 $(distdir)/
51
52 doc: 
53         $(MAKE) -C Documentation
54
55 install-WWW:
56         -$(INSTALL) -m 755 -d $(DESTDIR)$(webdir)
57         rsync -rl $(outdir)/offline-root/ $(DESTDIR)$(webdir)
58         $(MAKE) -C Documentation/user local-install-WWW
59         $(MAKE) -C Documentation/user install-info
60
61 install-help2man:
62         $(MAKE) -C scripts man install-help2man
63         $(MAKE) -C lily man install-help2man
64
65 web-install:
66         $(MAKE) out=www install-WWW
67
68 uninstall-WWW:
69         echo TODO
70
71 web-uninstall:
72         $(MAKE) out=www uninstall-WWW
73
74 local-install:
75         $(INSTALL) -d $(DESTDIR)$(local_lilypond_datadir)
76
77 final-install:
78         @true
79
80
81 # For online docs with content negotiation, issue `make web WEB_TARGETS=online'
82 # For both online and offline docs, issue `make web WEB_TARGETS="offline online"'
83 WEB_TARGETS = offline
84
85 local-WWW-post:
86 # need UTF8 setting in case this is hosted on a website. 
87         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
88         $(PYTHON) $(buildscript-dir)/mutopia-index.py -o $(outdir)/examples.html input/
89         rm -rf $(outdir)/online-root
90         rm -rf $(outdir)/offline-root
91         $(PYTHON) $(buildscript-dir)/www_post.py $(PACKAGE_NAME) $(TOPLEVEL_VERSION) $(buildscript-dir) $(outdir) "$(WEB_TARGETS)"
92
93 tree-prefix = $(outdir)
94 tree-bin = $(tree-prefix)/bin
95 tree-lib = $(tree-prefix)/lib
96 tree-share = $(tree-prefix)/share
97 tree-share-prefix = $(tree-share)/lilypond/$(TOPLEVEL_VERSION)
98 tree-share-prefix-current = $(tree-share)/lilypond/current
99 tree-lib-prefix = $(tree-lib)/lilypond/$(TOPLEVEL_VERSION)
100 tree-lib-prefix-current = $(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         ln -s $(TOPLEVEL_VERSION) $(tree-share-prefix-current)
126         mkdir -p $(tree-lib-prefix)
127         ln -s $(TOPLEVEL_VERSION) $(tree-lib-prefix-current)
128         mkdir -p $(tree-share-prefix)/dvips
129         mkdir -p $(tree-share-prefix)/elisp
130         mkdir -p $(tree-share-prefix)/fonts
131         mkdir -p $(tree-share-prefix)/fonts/otf
132         mkdir -p $(tree-share-prefix)/fonts/tfm
133         mkdir -p $(tree-share-prefix)/fonts/type1
134         mkdir -p $(tree-share-prefix)/fonts/svg
135         mkdir -p $(tree-share-prefix)/fonts/map
136         mkdir -p $(tree-share-prefix)/fonts/enc
137         mkdir -p $(tree-share-prefix)/tex
138         cd $(tree-bin) && \
139                 ln -sf ../../lily/$(outconfbase)/lilypond . && \
140                 for i in abc2ly convert-ly etf2ly lilypond-book lilypond-invoke-editor midi2ly musicxml2ly; \
141                         do ln -sf ../../scripts/$(outconfbase)/$$i . ; done
142         cd $(tree-lib-prefix) && \
143                 ln -s ../../../../python/$(outconfbase) python
144         cd $(tree-share-prefix) && \
145                 ln -s $(top-src-dir)/ly ly && \
146                 ln -s ../../../../mf mf && \
147                 ln -s $(top-src-dir)/ps && \
148                 ln -s ../../../../python/$(outconfbase) python && \
149                 ln -s $(top-src-dir)/scm && \
150                 ln -s $(top-src-dir)/scripts scripts
151         cd $(tree-share-prefix)/dvips && \
152                 ln -s ./../../../mf/$(outconfbase) mf-out && \
153                 ln -s $(top-src-dir)/ps
154         cd $(tree-share-prefix)/tex && \
155                 ln -s $(top-src-dir)/tex source && \
156                 ln -s ../../../../../tex/$(outconfbase) tex-out && \
157                 ln -s ../../../../../mf/$(outconfbase) mf-out
158
159         cd $(tree-share-prefix)/fonts && \
160                 ln -s $(top-src-dir)/mf source && \
161                 true
162         -cd $(tree-share-prefix)/elisp && \
163                 ln -sf ../../../../../../elisp/$(outconfbase)/lilypond-words.el . && \
164                 ln -s $(top-src-dir)/elisp/*.el .
165         $(foreach i,$(CATALOGS), \
166                 (mkdir -p $(tree-share)/locale/$i/LC_MESSAGES && \
167                 cd $(tree-share)/locale/$i/LC_MESSAGES && \
168                 ln -sf ../../../../../po/$(outconfbase)/$i.mo lilypond.mo) &&) true
169         touch $(tree-share-prefix)/lilypond-force
170
171 $(tree-share-prefix)/mf-link-tree link-mf-tree: $(tree-share-prefix)/lilypond-force
172         -rm -f $(tree-share-prefix)/fonts/otf/* &&  \
173         rm -f $(tree-share-prefix)/fonts/svg/* &&  \
174         rm -f $(tree-share-prefix)/fonts/tfm/* &&  \
175         rm -f $(tree-share-prefix)/fonts/type1/* &&  \
176                 cd $(tree-share-prefix)/fonts/otf && \
177                 ln -s ../../../../../../mf/$(outconfbase)/*.otf .
178         -cd $(tree-share-prefix)/fonts/svg && \
179                 ln -s ../../../../../../mf/$(outconfbase)/*.svg .
180         -cd $(tree-share-prefix)/fonts/tfm && \
181                 ln -s ../../../../../../mf/$(outconfbase)/*.tfm .
182         -cd $(tree-share-prefix)/fonts/type1 && \
183                 ln -s ../../../../../../mf/$(outconfbase)/*.pfa .
184
185 TAGS.make: dummy
186         etags -o $@ $(find $(top-src-dir) -name 'GNUmakefile*' -o -name '*.make')
187
188 $(config_h): config.hh.in
189 #
190 # this is to prevent people from getting
191 # undefined symbols  when we add them to config.h.in,
192 # and they blindly run "cvs update; make".
193 #
194         @echo
195         @echo ' *** $(config_h) is out of date'
196         @echo ' *** Remove it and rerun autogen:'
197         @echo '         rm $(config_h); ./autogen.sh'
198         @echo
199         @false
200
201
202 test:
203         $(MAKE) -C input/regression/ out=test clean
204
205 ## no aa-scaling, no PDF
206         $(MAKE) -C input/regression/ out=test WWW LILYPOND_BOOK_LILYPOND_FLAGS="--backend=eps --formats=ps,png $(LILYPOND_JOBS) -dinclude-eps-fonts -dgs-load-fonts --header=texidoc -I $(top-src-dir)/input/manual -dcheck-internal-types -ddump-signatures -danti-alias-factor=1"
207
208 RESULT_DIR=$(top-build-dir)/out/test-results/
209 check: test
210         rm -rf $(RESULT_DIR)
211         mkdir -p $(RESULT_DIR)
212         $(PYTHON) $(buildscript-dir)/output-distance.py --output-dir $(RESULT_DIR) $(CHECK_SOURCE) input/regression/out-test/