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