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