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