5 SUBDIRS = buildscripts python scripts \
12 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 autogen.sh
20 README_FILES = COPYING DEDICATION ROADMAP THANKS HACKING
21 TOPDOC_FILES = AUTHORS README INSTALL NEWS
22 TOPDOC_TXT_FILES = $(addprefix $(top-build-dir)/Documentation/topdocs/$(outdir)/,$(addsuffix .txt,$(TOPDOC_FILES)))
23 IN_FILES := $(call src-wildcard,*.in)
25 EXTRA_DIST_FILES = VERSION .cvsignore .gitignore SConstruct \
26 $(README_FILES) $(SCRIPTS) $(IN_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
35 local-dist: dist-toplevel-txt-files dist-changelog
38 if test -d $(top-src-dir)/.git ; then \
39 cd $(top-src-dir) && git-whatchanged gub-2.9.29-2.. > $(distdir)/ChangeLog ; \
41 cp $(top-src-dir)/ChangeLog $(distdir) ; \
44 default: $(outdir)/VERSION
46 $(outdir)/VERSION: $(config_make)
47 echo $(TOPLEVEL_VERSION) > $@
49 dist-toplevel-txt-files:
51 ln $(TOPDOC_TXT_FILES) $(distdir)/
52 ln $(top-src-dir)/stepmake/aclocal.m4 $(distdir)/
55 $(MAKE) -C Documentation
58 -$(INSTALL) -m 755 -d $(DESTDIR)$(webdir)
59 cp -a $(outdir)/web-root/ $(DESTDIR)$(webdir)/
61 $(MAKE) -C Documentation/user local-install-WWW
62 $(MAKE) -C Documentation/user install-info
65 $(MAKE) -C scripts man install-help2man
66 $(MAKE) -C lily man install-help2man
69 $(MAKE) out=www install-WWW
75 $(MAKE) out=www uninstall-WWW
78 $(INSTALL) -d $(DESTDIR)$(local_lilypond_datadir)
83 web-ext = html midi pdf png txt ly signature
85 footify = $(PYTHON) $(step-bindir)/add-html-footer.py --name $(PACKAGE_NAME) --version $(TOPLEVEL_VERSION)
86 footifymail = MAILADDRESS='http://post.gmane.org/post.php?group=gmane.comp.gnu.lilypond.bugs'
91 # need UTF8 setting in case this is hosted on a website.
92 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
93 $(PYTHON) $(buildscript-dir)/mutopia-index.py -o $(outdir)/examples.html input/
94 echo '<META HTTP-EQUIV="refresh" content="0;URL=Documentation/index.html">' > $(outdir)/index.html
95 echo '<html><body>Redirecting to the documentation index...</body></html>' >> $(outdir)/index.html
97 cd $(top-build-dir) && $(FIND) . -name '*.html' -print | $(footifymail) xargs $(footify)
99 cd $(top-build-dir) && find Documentation input \
100 $(web-ext:%=-path '*/out-www/*.%' -or) -type l \
101 | grep -v 'lily-[0-9].*.pdf' \
103 ls $(outdir)/*.html >> $(outdir)/weblist
105 ## urg: this is too hairy, should write a python script to do this.
107 ## rewrite file names so we lose out-www
108 rm -rf $(outdir)/web-root/
109 mkdir $(outdir)/web-root/
111 cat $(outdir)/weblist | (cd $(top-build-dir); tar -cf- -T- ) | \
112 tar -C $(outdir)/web-root/ -xf -
113 for dir in $(outdir)/web-root/ ; do \
115 for a in `find . -name out-www`; do \
116 rsync -a --link-dest $$a/ $$a/ $$a/.. ; \
120 echo $(TOPLEVEL_VERSION) > $(outdir)/web-root/VERSION
122 tree-prefix = $(outdir)
123 tree-bin = $(tree-prefix)/bin
124 tree-lib = $(tree-prefix)/lib
125 tree-share = $(tree-prefix)/share
126 tree-share-prefix = $(tree-share)/lilypond/$(TOPLEVEL_VERSION)
127 tree-share-prefix-current = $(tree-share)/lilypond/current
128 tree-lib-prefix = $(tree-lib)/lilypond/$(TOPLEVEL_VERSION)
129 tree-lib-prefix-current = $(tree-lib)/lilypond/current
133 $(foreach i, $(C_DIRS), $(MAKE) -C $(i) clean &&) true
135 src-ext = c cc yy ll hh icc py scm tex ps texi itexi tely itely sh
138 $(MAKE) out=www clean
139 $(MAKE) $(tree-share-prefix)/lilypond-force
141 default: $(config_h) build-dir-setup
143 build-dir-setup: $(tree-share-prefix)/lilypond-force
145 PO_FILES = $(call src-wildcard,$(src-depth)/po/*.po)
146 HELP_CATALOGS = $(PO_FILES:po/%.po=%)
147 CATALOGS = $(HELP_CATALOGS:lilypond=)
149 $(tree-share-prefix)/lilypond-force link-tree: GNUmakefile
150 # Preparing LilyPond tree for build-dir exec
151 cd $(top-build-dir)/$(outbase) && rm -rf bin lib share
153 mkdir -p $(tree-share-prefix)
154 ln -s $(TOPLEVEL_VERSION) $(tree-share-prefix-current)
155 mkdir -p $(tree-lib-prefix)
156 ln -s $(TOPLEVEL_VERSION) $(tree-lib-prefix-current)
157 mkdir -p $(tree-share-prefix)/elisp
158 mkdir -p $(tree-share-prefix)/fonts
159 mkdir -p $(tree-share-prefix)/fonts/otf
160 mkdir -p $(tree-share-prefix)/fonts/tfm
161 mkdir -p $(tree-share-prefix)/fonts/type1
162 mkdir -p $(tree-share-prefix)/fonts/svg
163 mkdir -p $(tree-share-prefix)/fonts/map
164 mkdir -p $(tree-share-prefix)/fonts/enc
165 mkdir -p $(tree-share-prefix)/tex
167 ln -sf ../../lily/$(outconfbase)/lilypond . && \
168 for i in abc2ly convert-ly etf2ly lilypond-book lilypond-invoke-editor midi2ly musicxml2ly; \
169 do ln -sf ../../scripts/$(outconfbase)/$$i . ; done
170 cd $(tree-lib-prefix) && \
171 ln -s ../../../../python/$(outconfbase) python
172 cd $(tree-share-prefix) && \
173 ln -s $(top-src-dir)/ly ly && \
174 ln -s ../../../../mf mf && \
175 ln -s $(top-src-dir)/ps && \
176 ln -s ../../../../python/$(outconfbase) python && \
177 ln -s $(top-src-dir)/scm && \
178 ln -s $(top-src-dir)/scripts scripts
179 cd $(tree-share-prefix)/tex && \
180 ln -s $(top-src-dir)/tex source && \
181 ln -s ../../../../../tex/$(outconfbase) tex-out && \
182 ln -s ../../../../../mf/$(outconfbase) mf-out
184 cd $(tree-share-prefix)/fonts && \
185 ln -s $(top-src-dir)/mf source && \
187 -cd $(tree-share-prefix)/elisp && \
188 ln -sf ../../../../../../elisp/$(outconfbase)/lilypond-words.el . && \
189 ln -s $(top-src-dir)/elisp/*.el .
190 $(foreach i,$(CATALOGS), \
191 (mkdir -p $(tree-share)/locale/$i/LC_MESSAGES && \
192 cd $(tree-share)/locale/$i/LC_MESSAGES && \
193 ln -sf ../../../../../po/$(outconfbase)/$i.mo lilypond.mo) &&) true
194 touch $(tree-share-prefix)/lilypond-force
196 $(tree-share-prefix)/mf-link-tree link-mf-tree: $(tree-share-prefix)/lilypond-force
197 -rm -f $(tree-share-prefix)/fonts/otf/* && \
198 rm -f $(tree-share-prefix)/fonts/svg/* && \
199 rm -f $(tree-share-prefix)/fonts/tfm/* && \
200 rm -f $(tree-share-prefix)/fonts/type1/* && \
201 cd $(tree-share-prefix)/fonts/otf && \
202 ln -s ../../../../../../mf/$(outconfbase)/*.otf .
203 -cd $(tree-share-prefix)/fonts/svg && \
204 ln -s ../../../../../../mf/$(outconfbase)/*.svg .
205 -cd $(tree-share-prefix)/fonts/tfm && \
206 ln -s ../../../../../../mf/$(outconfbase)/*.tfm .
207 -cd $(tree-share-prefix)/fonts/type1 && \
208 ln -s ../../../../../../mf/$(outconfbase)/*.pfa .
211 etags -o $@ $(find $(top-src-dir) -name 'GNUmakefile*' -o -name '*.make')
213 local-clean: build-dir-setup-clean local-web-clean
216 rm -rf $(outdir)/web-root/
220 build-dir-setup-clean:
221 cd $(top-build-dir) && rm -rf share
223 $(config_h): config.hh.in
225 # this is to prevent people from getting
226 # undefined symbols when we add them to config.h.in,
227 # and they blindly run "cvs update; make".
230 @echo ' *** $(config_h) is out of date'
231 @echo ' *** Remove it and rerun autogen:'
232 @echo ' rm $(config_h); ./autogen.sh'