]> git.donarmstrong.com Git - lilypond.git/blob - GNUmakefile.in
48dd4f1e3d5e7dc17f3f1572d06fc5ac9836e7fa
[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 ttftool 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 := $(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 web-ext = html midi pdf png txt ly
63
64 footify = $(PYTHON) $(step-bindir)/add-html-footer.py  --name $(PACKAGE_NAME) --version $(TOPLEVEL_VERSION)
65 footifymail = MAILADDRESS=bug-lilypond@gnu.org
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' > $(builddir)/.htaccess
70         $(PYTHON) $(buildscript-dir)/mutopia-index.py -o $(builddir)/examples.html ./
71         cd $(builddir) && $(FIND) . -name '*.html' -print | $(footifymail) xargs $(footify)
72         cd $(builddir) && find . -name \*.html~ -print | xargs rm -f
73         cd $(builddir) && find Documentation input \
74                 $(web-ext:%=-path '*/out-www/*.%' -or) -type l \
75                 > $(outdir)/weblist
76         echo '<META HTTP-EQUIV="refresh" content="0;URL=Documentation/out-www/index.html">' > $(builddir)/index.html
77         echo '<html><body>Redirecting to the documentation index...</body></html>' >> $(builddir)/index.html
78         cd $(builddir) && ls *.html >> $(outdir)/weblist
79         cat $(outdir)/weblist | (cd $(builddir); GZIP=-9v tar -czf $(outdir)/web.tar.gz  -T -)
80
81 share-prefix = $(builddir)/share
82 tree-prefix = $(builddir)/share/lilypond/$(TOPLEVEL_VERSION)
83
84 src-ext = c cc yy ll hh icc py scm tex ps texi itexi tely itely sh
85
86 web-clean:
87         $(MAKE) out=www clean
88         $(MAKE) $(tree-prefix)/lilypond-force
89
90 default: $(config_h) builddir-setup 
91
92 builddir-setup: $(tree-prefix)/lilypond-force
93
94 PO_FILES = $(wildcard $(srcdir)/po/*.po)
95 HELP_CATALOGS = $(PO_FILES:$(srcdir)/po/%.po=%)
96 CATALOGS = $(HELP_CATALOGS:lilypond=) 
97
98 $(tree-prefix)/lilypond-force link-tree: GNUmakefile
99 # Preparing LilyPond tree for builddir exec
100         cd $(builddir) && rm -rf lib share
101         mkdir -p $(builddir)/lib/$(package)
102         mkdir -p $(tree-prefix)
103         mkdir -p $(tree-prefix)/dvips
104         mkdir -p $(tree-prefix)/elisp
105         mkdir -p $(tree-prefix)/fonts
106         mkdir -p $(tree-prefix)/fonts/otf
107         mkdir -p $(tree-prefix)/fonts/tfm
108         mkdir -p $(tree-prefix)/fonts/type1
109         mkdir -p $(tree-prefix)/fonts/svg
110         mkdir -p $(tree-prefix)/fonts/map
111         mkdir -p $(tree-prefix)/fonts/enc
112         mkdir -p $(tree-prefix)/tex
113         cd $(builddir)/lib && \
114                 ln -s  ../../../python/$(outconfbase) python
115         cd $(tree-prefix) && \
116                 ln -s $(abs-srcdir)/ly ly && \
117                 ln -s $(abs-srcdir)/ps && \
118                 ln -s ../../../python/$(outconfbase) python && \
119                 ln -s $(abs-srcdir)/scm && \
120                 ln -s $(abs-srcdir)/scripts scripts
121         cd $(tree-prefix)/dvips && \
122                 ln -s ./../../mf/$(outconfbase) mf-out && \
123                 ln -s $(abs-srcdir)/ps
124         cd $(tree-prefix)/tex && \
125                 ln -s $(abs-srcdir)/tex source && \
126                 ln -s ../../../../tex/$(outconfbase) tex-out && \
127                 ln -s ../../../../mf/$(outconfbase) mf-out
128         cd $(tree-prefix)/fonts/enc && \
129                 ln -s ../../../../../mf/$(outconfbase)/*.enc .
130         cd $(tree-prefix)/fonts/map && \
131                 ln -s ../../../../../mf/$(outconfbase)/*.map .
132         cd $(tree-prefix)/fonts/otf && \
133                 ln -s ../../../../../mf/$(outconfbase)/*.otf .
134         cd $(tree-prefix)/fonts/svg && \
135                 ln -s ../../../../../mf/$(outconfbase)/*.svg .
136         cd $(tree-prefix)/fonts/tfm && \
137                 ln -s ../../../../../mf/$(outconfbase)/*.tfm .
138         cd $(tree-prefix)/fonts/type1 && \
139                 ln -s ../../../../../mf/$(outconfbase)/*.pfa .
140         cd $(tree-prefix)/fonts && \
141                 ln -s $(abs-srcdir)/mf source && \
142                 true
143         cd $(tree-prefix)/elisp && \
144                 ln -sf ../../../../../elisp/$(outconfbase)/lilypond-words.el . && \
145                 ln -s $(abs-srcdir)/elisp/*.el .
146         $(foreach i,$(CATALOGS), \
147                 mkdir -p $(share-prefix)/locale/$i/LC_MESSAGES && \
148                 cd $(share-prefix)/locale/$i/LC_MESSAGES && \
149                 ln -sf ../../../../po/$(outconfbase)/$i.mo lilypond.mo &&) true
150 #       touch $@
151         touch $(tree-prefix)/lilypond-force
152
153 local-clean: builddir-setup-clean
154 builddir-setup-clean:
155         cd $(builddir) && rm -rf share
156
157 $(config_h): config.hh.in 
158 #
159 # this is to prevent people from getting
160 # undefined symbols  when we add them to config.h.in,
161 # and they blindly run "cvs update; make".
162 #
163         @echo
164         @echo ' *** $(config_h) is out of date'
165         @echo ' *** Remove it and rerun autogen:'
166         @echo '         rm $(config_h); ./autogen.sh'
167         @echo
168         @false
169
170