]> git.donarmstrong.com Git - lilypond.git/blob - GNUmakefile.in
Fix make clean all: have version depend on all iso default,
[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 local-dist: dist-toplevel-txt-files dist-changelog
36
37 dist-changelog:
38         if  test -d $(top-src-dir)/.git ; then \
39                 cd $(top-src-dir) && git-whatchanged gub-2.9.29-2.. > $(distdir)/ChangeLog ; \
40         else \
41                 cp $(top-src-dir)/ChangeLog $(distdir) ; \
42         fi
43
44 all: $(outdir)/VERSION
45
46 $(outdir)/VERSION: $(config_make) VERSION
47         -mkdir -p $(outdir)
48         echo $(TOPLEVEL_VERSION) > $@
49
50 dist-toplevel-txt-files:
51         -mkdir -p $(distdir)
52         ln $(TOPDOC_TXT_FILES) $(distdir)/
53         ln $(top-src-dir)/stepmake/aclocal.m4 $(distdir)/
54
55 doc: 
56         $(MAKE) -C Documentation
57
58 install-WWW:
59         -$(INSTALL) -m 755 -d $(DESTDIR)$(webdir)
60         cp -a $(outdir)/web-root/ $(DESTDIR)$(webdir)/
61
62         $(MAKE) -C Documentation/user local-install-WWW
63         $(MAKE) -C Documentation/user install-info
64
65 install-help2man:
66         $(MAKE) -C scripts man install-help2man
67         $(MAKE) -C lily man install-help2man
68
69 web-install:
70         $(MAKE) out=www install-WWW
71
72 uninstall-WWW:
73         echo TODO
74
75 web-uninstall:
76         $(MAKE) out=www uninstall-WWW
77
78 local-install:
79         $(INSTALL) -d $(DESTDIR)$(local_lilypond_datadir)
80
81 final-install:
82         @true
83
84 web-ext = html midi pdf png txt ly signature
85
86 # For docball, issue `make web CONTENT_NEGOTIATION='
87 CONTENT_NEGOTIATION = --content-negotiation
88 footify = $(PYTHON) $(step-bindir)/add-html-footer.py --name $(PACKAGE_NAME) --version $(TOPLEVEL_VERSION) $(CONTENT_NEGOTIATION)
89 footifymail = MAILADDRESS='http://post.gmane.org/post.php?group=gmane.comp.gnu.lilypond.bugs'
90
91
92
93 local-WWW-post:
94 # need UTF8 setting in case this is hosted on a website. 
95         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
96         $(PYTHON) $(buildscript-dir)/mutopia-index.py -o $(outdir)/examples.html input/
97         echo '<META HTTP-EQUIV="refresh" content="0;URL=Documentation/index.html">' > $(outdir)/index.html
98         echo '<html><body>Redirecting to the documentation index...</body></html>' >> $(outdir)/index.html
99
100         cd $(top-build-dir) && $(FIND) . -name '*.html' -print | $(footifymail) xargs $(footify)
101
102         cd $(top-build-dir) && find Documentation input \
103                 $(web-ext:%=-path '*/out-www/*.%' -or) -type l \
104                 | grep -v 'lily-[0-9a-f]*.*pdf' \
105                 | grep -v '/fr/' \
106                 > $(outdir)/weblist
107         ls $(outdir)/*.html >> $(outdir)/weblist
108
109 ## urg: this is too hairy, should write a python script to do this.
110
111 ## rewrite file names so we lose out-www
112         rm -rf $(outdir)/web-root/ 
113         mkdir $(outdir)/web-root/
114 ## urg slow.
115         cat $(outdir)/weblist | (cd $(top-build-dir); tar -cf-  -T- ) | \
116                 tar -C $(outdir)/web-root/ -xf -  
117         for dir in $(outdir)/web-root/ ; do  \
118                 cd $$dir && \
119                 for a in `find . -name out-www`; do \
120                         rsync -a  --link-dest $$a/ $$a/ $$a/.. ; \
121                         rm -rf $$a ; \
122                 done \
123         done
124
125 tree-prefix = $(outdir)
126 tree-bin = $(tree-prefix)/bin
127 tree-lib = $(tree-prefix)/lib
128 tree-share = $(tree-prefix)/share
129 tree-share-prefix = $(tree-share)/lilypond/$(TOPLEVEL_VERSION)
130 tree-share-prefix-current = $(tree-share)/lilypond/current
131 tree-lib-prefix = $(tree-lib)/lilypond/$(TOPLEVEL_VERSION)
132 tree-lib-prefix-current = $(tree-lib)/lilypond/current
133
134 C_DIRS = flower lily
135 c-clean:
136         $(foreach i, $(C_DIRS), $(MAKE) -C $(i) clean &&) true
137
138 src-ext = c cc yy ll hh icc py scm tex ps texi itexi tely itely sh
139
140 web-clean:
141         $(MAKE) out=www clean
142         $(MAKE) $(tree-share-prefix)/lilypond-force
143
144 default: $(config_h) build-dir-setup 
145
146 build-dir-setup: $(tree-share-prefix)/lilypond-force
147
148 PO_FILES = $(call src-wildcard,$(src-depth)/po/*.po)
149 HELP_CATALOGS = $(PO_FILES:po/%.po=%)
150 CATALOGS = $(HELP_CATALOGS:lilypond=) 
151
152 $(tree-share-prefix)/lilypond-force link-tree: GNUmakefile $(outdir)/VERSION 
153 # Preparing LilyPond tree for build-dir exec
154         cd $(top-build-dir)/$(outbase) && rm -rf bin lib share
155         mkdir -p $(tree-bin)
156         mkdir -p $(tree-share-prefix)
157         ln -s $(TOPLEVEL_VERSION) $(tree-share-prefix-current)
158         mkdir -p $(tree-lib-prefix)
159         ln -s $(TOPLEVEL_VERSION) $(tree-lib-prefix-current)
160         mkdir -p $(tree-share-prefix)/elisp
161         mkdir -p $(tree-share-prefix)/fonts
162         mkdir -p $(tree-share-prefix)/fonts/otf
163         mkdir -p $(tree-share-prefix)/fonts/tfm
164         mkdir -p $(tree-share-prefix)/fonts/type1
165         mkdir -p $(tree-share-prefix)/fonts/svg
166         mkdir -p $(tree-share-prefix)/fonts/map
167         mkdir -p $(tree-share-prefix)/fonts/enc
168         mkdir -p $(tree-share-prefix)/tex
169         cd $(tree-bin) && \
170                 ln -sf ../../lily/$(outconfbase)/lilypond . && \
171                 for i in abc2ly convert-ly etf2ly lilypond-book lilypond-invoke-editor midi2ly musicxml2ly; \
172                         do ln -sf ../../scripts/$(outconfbase)/$$i . ; done
173         cd $(tree-lib-prefix) && \
174                 ln -s ../../../../python/$(outconfbase) python
175         cd $(tree-share-prefix) && \
176                 ln -s $(top-src-dir)/ly ly && \
177                 ln -s ../../../../mf mf && \
178                 ln -s $(top-src-dir)/ps && \
179                 ln -s ../../../../python/$(outconfbase) python && \
180                 ln -s $(top-src-dir)/scm && \
181                 ln -s $(top-src-dir)/scripts scripts
182         cd $(tree-share-prefix)/tex && \
183                 ln -s $(top-src-dir)/tex source && \
184                 ln -s ../../../../../tex/$(outconfbase) tex-out && \
185                 ln -s ../../../../../mf/$(outconfbase) mf-out
186
187         cd $(tree-share-prefix)/fonts && \
188                 ln -s $(top-src-dir)/mf source && \
189                 true
190         -cd $(tree-share-prefix)/elisp && \
191                 ln -sf ../../../../../../elisp/$(outconfbase)/lilypond-words.el . && \
192                 ln -s $(top-src-dir)/elisp/*.el .
193         $(foreach i,$(CATALOGS), \
194                 (mkdir -p $(tree-share)/locale/$i/LC_MESSAGES && \
195                 cd $(tree-share)/locale/$i/LC_MESSAGES && \
196                 ln -sf ../../../../../po/$(outconfbase)/$i.mo lilypond.mo) &&) true
197         touch $(tree-share-prefix)/lilypond-force
198
199 $(tree-share-prefix)/mf-link-tree link-mf-tree: $(tree-share-prefix)/lilypond-force
200         -rm -f $(tree-share-prefix)/fonts/otf/* &&  \
201         rm -f $(tree-share-prefix)/fonts/svg/* &&  \
202         rm -f $(tree-share-prefix)/fonts/tfm/* &&  \
203         rm -f $(tree-share-prefix)/fonts/type1/* &&  \
204                 cd $(tree-share-prefix)/fonts/otf && \
205                 ln -s ../../../../../../mf/$(outconfbase)/*.otf .
206         -cd $(tree-share-prefix)/fonts/svg && \
207                 ln -s ../../../../../../mf/$(outconfbase)/*.svg .
208         -cd $(tree-share-prefix)/fonts/tfm && \
209                 ln -s ../../../../../../mf/$(outconfbase)/*.tfm .
210         -cd $(tree-share-prefix)/fonts/type1 && \
211                 ln -s ../../../../../../mf/$(outconfbase)/*.pfa .
212
213 TAGS.make: dummy
214         etags -o $@ $(find $(top-src-dir) -name 'GNUmakefile*' -o -name '*.make')
215
216 $(config_h): config.hh.in
217 #
218 # this is to prevent people from getting
219 # undefined symbols  when we add them to config.h.in,
220 # and they blindly run "cvs update; make".
221 #
222         @echo
223         @echo ' *** $(config_h) is out of date'
224         @echo ' *** Remove it and rerun autogen:'
225         @echo '         rm $(config_h); ./autogen.sh'
226         @echo
227         @false
228
229
230 test:
231         $(MAKE) -C input/regression/ out=test clean
232         $(MAKE) -C input/regression/ out=test WWW ANTI_ALIAS_FACTOR=1
233
234
235 CHECK_SOURCE=$(HOME)/vc/gub/target/linux-x86/build/lilypond-master-git.sv.gnu.org-lilypond.git/input/regression/out-test/
236 RESULT_DIR=$(top-build-dir)/out/test-results/
237 check: test
238         rm -rf $(RESULT_DIR)
239         mkdir -p $(RESULT_DIR)
240         $(PYTHON) $(buildscript-dir)/output-distance.py --output-dir $(RESULT_DIR) $(CHECK_SOURCE) input/regression/out-test/