5 SUBDIRS = buildscripts python scripts \
12 cygwin stepmake $(documentation-dir)
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)
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
32 STEPMAKE_TEMPLATES=toplevel po install
33 include $(depth)/make/stepmake.make
36 $(MAKE) -C Documentation
39 -$(INSTALL) -m 755 -d $(DESTDIR)$(webdir)
40 cp -a $(outdir)/web-root/ $(DESTDIR)$(webdir)/
42 $(MAKE) -C Documentation/user local-install-WWW
43 $(MAKE) -C Documentation/user install-info
46 $(MAKE) out=www install-WWW
52 $(MAKE) out=www uninstall-WWW=
55 $(INSTALL) -d $(DESTDIR)$(local_lilypond_datadir)
60 web-ext = html midi pdf png txt ly
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'
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
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 \
79 cd $(top-build-dir) && find Documentation input \
80 -path '*/out-www/*.signature' \
82 ls $(outdir)/*.html >> $(outdir)/weblist
84 ## rewrite file names so we lose out-www
85 rm -rf $(outdir)/web-root/
86 mkdir $(outdir)/web-root/ $(outdir)/web-signature-root/
87 cat $(outdir)/weblist | (cd $(top-build-dir); tar -cf- -T- ) | \
88 tar -C $(outdir)/web-root/ -xf -
89 cat $(outdir)/siglist | (cd $(top-build-dir); tar -cf- -T- ) | \
90 tar -C $(outdir)/web-signature-root/ -xf -
91 for dir in $(outdir)/web-root/ $(outdir)/web-signature-root/ ; do \
93 for a in `find . -name out-www`; do \
94 rsync -a --link-dest $$a/ $$a/ $$a/.. ; \
98 echo $(TOPLEVEL_VERSION) > $(outdir)/web-root/VERSION
99 echo $(TOPLEVEL_VERSION) > $(outdir)/web-signature-root/VERSION
101 tree-prefix = $(outdir)
102 tree-bin = $(tree-prefix)/bin
103 tree-lib = $(tree-prefix)/lib
104 tree-share = $(tree-prefix)/share
105 tree-share-prefix = $(tree-share)/lilypond/current
106 tree-lib-prefix = $(tree-lib)/lilypond/current
110 $(foreach i, $(C_DIRS), $(MAKE) -C $(i) clean &&) true
112 src-ext = c cc yy ll hh icc py scm tex ps texi itexi tely itely sh
115 $(MAKE) out=www clean
116 $(MAKE) $(tree-share-prefix)/lilypond-force
118 default: $(config_h) build-dir-setup
120 build-dir-setup: $(tree-share-prefix)/lilypond-force
122 PO_FILES = $(call src-wildcard,$(src-depth)/po/*.po)
123 HELP_CATALOGS = $(PO_FILES:$(src-depth)/po/%.po=%)
124 CATALOGS = $(HELP_CATALOGS:lilypond=)
126 $(tree-share-prefix)/lilypond-force link-tree: GNUmakefile
127 # Preparing LilyPond tree for build-dir exec
128 cd $(top-build-dir)/$(outbase) && rm -rf bin lib share
130 mkdir -p $(tree-share-prefix)
131 mkdir -p $(tree-lib-prefix)
132 mkdir -p $(tree-share-prefix)/dvips
133 mkdir -p $(tree-share-prefix)/elisp
134 mkdir -p $(tree-share-prefix)/fonts
135 mkdir -p $(tree-share-prefix)/fonts/otf
136 mkdir -p $(tree-share-prefix)/fonts/tfm
137 mkdir -p $(tree-share-prefix)/fonts/type1
138 mkdir -p $(tree-share-prefix)/fonts/svg
139 mkdir -p $(tree-share-prefix)/fonts/map
140 mkdir -p $(tree-share-prefix)/fonts/enc
141 mkdir -p $(tree-share-prefix)/tex
143 ln -sf ../../lily/$(outconfbase)/lilypond . && \
144 for i in abc2ly convert-ly etf2ly lilypond-book lilypond-invoke-editor midi2ly musicxml2ly; \
145 do ln -sf ../../scripts/$(outconfbase)/$$i . ; done
146 cd $(tree-lib-prefix) && \
147 ln -s ../../../../python/$(outconfbase) python
148 cd $(tree-share-prefix) && \
149 ln -s $(top-src-dir)/ly ly && \
150 ln -s ../../../../mf mf && \
151 ln -s $(top-src-dir)/ps && \
152 ln -s ../../../../python/$(outconfbase) python && \
153 ln -s $(top-src-dir)/scm && \
154 ln -s $(top-src-dir)/scripts scripts
155 cd $(tree-share-prefix)/dvips && \
156 ln -s ./../../../mf/$(outconfbase) mf-out && \
157 ln -s $(top-src-dir)/ps
158 cd $(tree-share-prefix)/tex && \
159 ln -s $(top-src-dir)/tex source && \
160 ln -s ../../../../../tex/$(outconfbase) tex-out && \
161 ln -s ../../../../../mf/$(outconfbase) mf-out
163 cd $(tree-share-prefix)/fonts && \
164 ln -s $(top-src-dir)/mf source && \
166 -cd $(tree-share-prefix)/elisp && \
167 ln -sf ../../../../../../elisp/$(outconfbase)/lilypond-words.el . && \
168 ln -s $(top-src-dir)/elisp/*.el .
169 $(foreach i,$(CATALOGS), \
170 (mkdir -p $(tree-share)/locale/$i/LC_MESSAGES && \
171 cd $(tree-share)/locale/$i/LC_MESSAGES && \
172 ln -sf ../../../../../po/$(outconfbase)/$i.mo lilypond.mo) &&) true
173 touch $(tree-share-prefix)/lilypond-force
175 $(tree-share-prefix)/mf-link-tree link-mf-tree: $(tree-share-prefix)/lilypond-force
176 -rm -f $(tree-share-prefix)/fonts/{otf,svg,tfm,type1}/* && \
177 cd $(tree-share-prefix)/fonts/otf && \
178 ln -s ../../../../../../mf/$(outconfbase)/*.otf .
179 -cd $(tree-share-prefix)/fonts/svg && \
180 ln -s ../../../../../../mf/$(outconfbase)/*.svg .
181 -cd $(tree-share-prefix)/fonts/tfm && \
182 ln -s ../../../../../../mf/$(outconfbase)/*.tfm .
183 -cd $(tree-share-prefix)/fonts/type1 && \
184 ln -s ../../../../../../mf/$(outconfbase)/*.pfa .
188 etags -o $@ $(find $(srcdir) -name 'GNUmakefile*' -o -name '*.make')
190 local-clean: build-dir-setup-clean
191 build-dir-setup-clean:
192 cd $(top-build-dir) && rm -rf share
194 $(config_h): config.hh.in
196 # this is to prevent people from getting
197 # undefined symbols when we add them to config.h.in,
198 # and they blindly run "cvs update; make".
201 @echo ' *** $(config_h) is out of date'
202 @echo ' *** Remove it and rerun autogen:'
203 @echo ' rm $(config_h); ./autogen.sh'