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