]> git.donarmstrong.com Git - lilypond.git/blob - GNUmakefile.in
8cb53003b675e3c811327977e9d9a4e291baee0c
[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                 | grep -v 'lily-[0-9].*.pdf' \
87                 > $(outdir)/weblist
88         ls $(outdir)/*.html >> $(outdir)/weblist
89
90 ## urg: this is too hairy, should write a python script to do this.
91
92 ## rewrite file names so we lose out-www
93         rm -rf $(outdir)/web-root/ 
94         mkdir $(outdir)/web-root/
95 ## urg slow.
96         cat $(outdir)/weblist | (cd $(top-build-dir); tar -cf-  -T- ) | \
97                 tar -C $(outdir)/web-root/ -xf -  
98         for dir in $(outdir)/web-root/ ; do  \
99                 cd $$dir && \
100                 for a in `find . -name out-www`; do \
101                         rsync -a  --link-dest $$a/ $$a/ $$a/.. ; \
102                         rm -rf $$a ; \
103                 done \
104         done
105         echo $(TOPLEVEL_VERSION) > $(outdir)/web-root/VERSION
106
107 tree-prefix = $(outdir)
108 tree-bin = $(tree-prefix)/bin
109 tree-lib = $(tree-prefix)/lib
110 tree-share = $(tree-prefix)/share
111 tree-share-prefix = $(tree-share)/lilypond/$(TOPLEVEL_VERSION)
112 tree-share-prefix-current = $(tree-share)/lilypond/current
113 tree-lib-prefix = $(tree-lib)/lilypond/$(TOPLEVEL_VERSION)
114 tree-lib-prefix-current = $(tree-lib)/lilypond/current
115
116 C_DIRS = flower lily
117 c-clean:
118         $(foreach i, $(C_DIRS), $(MAKE) -C $(i) clean &&) true
119
120 src-ext = c cc yy ll hh icc py scm tex ps texi itexi tely itely sh
121
122 web-clean:
123         $(MAKE) out=www clean
124         $(MAKE) $(tree-share-prefix)/lilypond-force
125
126 default: $(config_h) build-dir-setup 
127
128 build-dir-setup: $(tree-share-prefix)/lilypond-force
129
130 PO_FILES = $(call src-wildcard,$(src-depth)/po/*.po)
131 HELP_CATALOGS = $(PO_FILES:$(src-depth)/po/%.po=%)
132 CATALOGS = $(HELP_CATALOGS:lilypond=) 
133
134 $(tree-share-prefix)/lilypond-force link-tree: GNUmakefile
135 # Preparing LilyPond tree for build-dir exec
136         cd $(top-build-dir)/$(outbase) && rm -rf bin lib share
137         mkdir -p $(tree-bin)
138         mkdir -p $(tree-share-prefix)
139         ln -s $(TOPLEVEL_VERSION) $(tree-share-prefix-current)
140         mkdir -p $(tree-lib-prefix)
141         ln -s $(TOPLEVEL_VERSION) $(tree-lib-prefix-current)
142         mkdir -p $(tree-share-prefix)/dvips
143         mkdir -p $(tree-share-prefix)/elisp
144         mkdir -p $(tree-share-prefix)/fonts
145         mkdir -p $(tree-share-prefix)/fonts/otf
146         mkdir -p $(tree-share-prefix)/fonts/tfm
147         mkdir -p $(tree-share-prefix)/fonts/type1
148         mkdir -p $(tree-share-prefix)/fonts/svg
149         mkdir -p $(tree-share-prefix)/fonts/map
150         mkdir -p $(tree-share-prefix)/fonts/enc
151         mkdir -p $(tree-share-prefix)/tex
152         cd $(tree-bin) && \
153                 ln -sf ../../lily/$(outconfbase)/lilypond . && \
154                 for i in abc2ly convert-ly etf2ly lilypond-book lilypond-invoke-editor midi2ly musicxml2ly; \
155                         do ln -sf ../../scripts/$(outconfbase)/$$i . ; done
156         cd $(tree-lib-prefix) && \
157                 ln -s ../../../../python/$(outconfbase) python
158         cd $(tree-share-prefix) && \
159                 ln -s $(top-src-dir)/ly ly && \
160                 ln -s ../../../../mf mf && \
161                 ln -s $(top-src-dir)/ps && \
162                 ln -s ../../../../python/$(outconfbase) python && \
163                 ln -s $(top-src-dir)/scm && \
164                 ln -s $(top-src-dir)/scripts scripts
165         cd $(tree-share-prefix)/dvips && \
166                 ln -s ./../../../mf/$(outconfbase) mf-out && \
167                 ln -s $(top-src-dir)/ps
168         cd $(tree-share-prefix)/tex && \
169                 ln -s $(top-src-dir)/tex source && \
170                 ln -s ../../../../../tex/$(outconfbase) tex-out && \
171                 ln -s ../../../../../mf/$(outconfbase) mf-out
172
173         cd $(tree-share-prefix)/fonts && \
174                 ln -s $(top-src-dir)/mf source && \
175                 true
176         -cd $(tree-share-prefix)/elisp && \
177                 ln -sf ../../../../../../elisp/$(outconfbase)/lilypond-words.el . && \
178                 ln -s $(top-src-dir)/elisp/*.el .
179         $(foreach i,$(CATALOGS), \
180                 (mkdir -p $(tree-share)/locale/$i/LC_MESSAGES && \
181                 cd $(tree-share)/locale/$i/LC_MESSAGES && \
182                 ln -sf ../../../../../po/$(outconfbase)/$i.mo lilypond.mo) &&) true
183         touch $(tree-share-prefix)/lilypond-force
184
185 $(tree-share-prefix)/mf-link-tree link-mf-tree: $(tree-share-prefix)/lilypond-force
186         -rm -f $(tree-share-prefix)/fonts/{otf,svg,tfm,type1}/* &&  \
187                 cd $(tree-share-prefix)/fonts/otf && \
188                 ln -s ../../../../../../mf/$(outconfbase)/*.otf .
189         -cd $(tree-share-prefix)/fonts/svg && \
190                 ln -s ../../../../../../mf/$(outconfbase)/*.svg .
191         -cd $(tree-share-prefix)/fonts/tfm && \
192                 ln -s ../../../../../../mf/$(outconfbase)/*.tfm .
193         -cd $(tree-share-prefix)/fonts/type1 && \
194                 ln -s ../../../../../../mf/$(outconfbase)/*.pfa .
195
196 TAGS.make: dummy
197         etags -o $@ $(find $(srcdir) -name 'GNUmakefile*' -o -name '*.make')
198
199 local-clean: build-dir-setup-clean local-web-clean
200
201 local-web-clean:
202         rm -rf $(outdir)/web-root/
203
204
205
206 build-dir-setup-clean:
207         cd $(top-build-dir) && rm -rf share
208
209 $(config_h): config.hh.in
210 #
211 # this is to prevent people from getting
212 # undefined symbols  when we add them to config.h.in,
213 # and they blindly run "cvs update; make".
214 #
215         @echo
216         @echo ' *** $(config_h) is out of date'
217         @echo ' *** Remove it and rerun autogen:'
218         @echo '         rm $(config_h); ./autogen.sh'
219         @echo
220         @false