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