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