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