2 # title specific top level makefile for LilyPond
9 # descent order into subdirectories
11 SUBDIRS = buildscripts python scripts \
13 flower kpath-guile ttftool lily \
16 cygwin debian stepmake \
22 package=`echo $PACKAGE_NAME | tr '[A-Z]' '[a-z]'`
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
37 STEPMAKE_TEMPLATES=toplevel po install
38 include $(depth)/make/stepmake.make
41 $(MAKE) -C Documentation
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
51 $(MAKE) out=www install-WWW
57 $(MAKE) out=www uninstall-WWW=
60 $(INSTALL) -d $(DESTDIR)$(local_lilypond_datadir)
63 @echo '*** Before using LilyPond, the contents of one of the login scripts'
64 @echo '*** buildscripts/out/lilypond-{profile,login} should be sourced.'
65 @echo '*** LilyPond should have been installed to do that automatically'
66 @echo '*** when you log in. So, please log out now and log in again.'
67 @echo '*** For more information see Invoking LilyPond in the manual.'
69 web-ext = html midi pdf png txt ly
71 footify = $(PYTHON) $(step-bindir)/add-html-footer.py --name $(PACKAGE_NAME) --version $(TOPLEVEL_VERSION)
72 footifymail = MAILADDRESS=bug-lilypond@gnu.org
75 # need UTF8 setting in case this is hosted on a website.
76 echo -e 'AddDefaultCharset utf-8\nAddCharset utf-8 .html\nAddCharset utf-8 .en\nAddCharset utf-8 .nl\nAddCharset utf-8 .txt\n' > $(builddir)/.htaccess
77 $(PYTHON) $(buildscript-dir)/mutopia-index.py -o $(builddir)/examples.html ./
78 cd $(builddir) && $(FIND) . -name '*.html' -print | $(footifymail) xargs $(footify)
79 cd $(builddir) && find . -name \*.html~ -print | xargs rm -f
80 cd $(builddir) && find Documentation input \
81 $(web-ext:%=-path '*/out-www/*.%' -or) -type l \
83 echo '<META HTTP-EQUIV="refresh" content="0;URL=Documentation/out-www/index.html">' > $(builddir)/index.html
84 echo '<html><body>Redirecting to the documentation index...</body></html>' >> $(builddir)/index.html
85 cd $(builddir) && ls *.html >> $(outdir)/weblist
86 cat $(outdir)/weblist | (cd $(builddir); GZIP=-9v tar -czf $(outdir)/web.tar.gz -T -)
88 share-prefix = $(builddir)/share
89 tree-prefix = $(builddir)/share/lilypond/$(TOPLEVEL_VERSION)
91 src-ext = c cc yy ll hh icc py scm tex ps texi itexi tely itely sh
95 $(MAKE) $(tree-prefix)/lilypond-force
97 default: $(config_h) builddir-setup
99 builddir-setup: $(tree-prefix)/lilypond-force
101 PO_FILES = $(wildcard $(srcdir)/po/*.po)
102 HELP_CATALOGS = $(PO_FILES:$(srcdir)/po/%.po=%)
103 CATALOGS = $(HELP_CATALOGS:lilypond=)
105 $(tree-prefix)/lilypond-force: GNUmakefile
106 # Preparing LilyPond tree for builddir exec
107 cd $(builddir) && rm -rf lib share
108 mkdir -p $(builddir)/lib/$(package)
109 mkdir -p $(tree-prefix)
110 mkdir -p $(tree-prefix)/dvips
111 mkdir -p $(tree-prefix)/elisp
112 mkdir -p $(tree-prefix)/fonts
113 mkdir -p $(tree-prefix)/tex
114 cd $(builddir)/lib && \
115 ln -s ../../../python/$(outconfbase) python
116 cd $(tree-prefix) && \
117 ln -s $(abs-srcdir)/ly ly && \
118 ln -s ../../../mf/$(outconfbase) otf && \
119 ln -s ../../../mf/$(outconfbase) svg && \
120 ln -s ../../../mf/$(outconfbase) tfm && \
121 ln -s $(abs-srcdir)/mf && \
122 ln -s $(abs-srcdir)/ps && \
123 ln -s ../../../python/$(outconfbase) python && \
124 ln -s $(abs-srcdir)/scm && \
125 ln -s $(abs-srcdir)/scripts scripts
126 cd $(tree-prefix)/dvips && \
127 ln -s ./../../mf/$(outconfbase) mf-out && \
128 ln -s $(abs-srcdir)/ps
129 cd $(tree-prefix)/tex && \
130 ln -s $(abs-srcdir)/tex source && \
131 ln -s ../../../../tex/$(outconfbase) tex-out && \
132 ln -s ../../../../mf/$(outconfbase) mf-out
133 cd $(tree-prefix)/fonts && \
134 ln -s $(abs-srcdir)/mf source && \
135 ln -s ../../../../tex/$(outconfbase) enc && \
136 ln -s ../../../../mf/$(outconfbase) map && \
137 ln -s ../../../../mf/$(outconfbase) otf && \
138 ln -s ../../../../mf/$(outconfbase) tfm && \
139 ln -s ../../../../mf/$(outconfbase) svg && \
140 ln -s ../../../../mf/$(outconfbase) type1
141 cd $(tree-prefix)/elisp && \
142 ln -sf ../../../../../elisp/$(outconfbase)/lilypond-words.el . && \
143 ln -s $(abs-srcdir)/elisp/*.el .
144 $(foreach i,$(CATALOGS), \
145 mkdir -p $(share-prefix)/locale/$i/LC_MESSAGES && \
146 cd $(share-prefix)/locale/$i/LC_MESSAGES && \
147 ln -sf ../../../../po/$(outconfbase)/$i.mo lilypond.mo &&) true
150 local-clean: builddir-setup-clean
151 builddir-setup-clean:
152 cd $(builddir) && rm -rf share
154 $(config_h): config.hh.in
156 # this is to prevent people from getting
157 # undefined symbols when we add them to config.h.in,
158 # and they blindly run "cvs update; make".
161 @echo ' *** $(config_h) is out of date'
162 @echo ' *** Remove it and rerun autogen:'
163 @echo ' rm $(config_h); ./autogen.sh'