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 = ChangeLog 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 make-dist-version
38 echo $(TOPLEVEL_VERSION) > $(outdir)/VERSION
40 dist-toplevel-txt-files:
42 ln $(TOPDOC_TXT_FILES) $(distdir)/
43 ln $(top-src-dir)/stepmake/aclocal.m4 $(distdir)/
46 $(MAKE) -C Documentation
49 -$(INSTALL) -m 755 -d $(DESTDIR)$(webdir)
50 cp -a $(outdir)/web-root/ $(DESTDIR)$(webdir)/
52 $(MAKE) -C Documentation/user local-install-WWW
53 $(MAKE) -C Documentation/user install-info
56 $(MAKE) -C scripts man install-help2man
57 $(MAKE) -C lily man install-help2man
60 $(MAKE) out=www install-WWW
66 $(MAKE) out=www uninstall-WWW
69 $(INSTALL) -d $(DESTDIR)$(local_lilypond_datadir)
74 web-ext = html midi pdf png txt ly signature
76 footify = $(PYTHON) $(step-bindir)/add-html-footer.py --name $(PACKAGE_NAME) --version $(TOPLEVEL_VERSION)
77 footifymail = MAILADDRESS='http://post.gmane.org/post.php?group=gmane.comp.gnu.lilypond.bugs'
82 # need UTF8 setting in case this is hosted on a website.
83 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
84 $(PYTHON) $(buildscript-dir)/mutopia-index.py -o $(outdir)/examples.html input/
85 echo '<META HTTP-EQUIV="refresh" content="0;URL=Documentation/index.html">' > $(outdir)/index.html
86 echo '<html><body>Redirecting to the documentation index...</body></html>' >> $(outdir)/index.html
88 cd $(top-build-dir) && $(FIND) . -name '*.html' -print | $(footifymail) xargs $(footify)
90 cd $(top-build-dir) && find Documentation input \
91 $(web-ext:%=-path '*/out-www/*.%' -or) -type l \
92 | grep -v 'lily-[0-9].*.pdf' \
94 ls $(outdir)/*.html >> $(outdir)/weblist
96 ## urg: this is too hairy, should write a python script to do this.
98 ## rewrite file names so we lose out-www
99 rm -rf $(outdir)/web-root/
100 mkdir $(outdir)/web-root/
102 cat $(outdir)/weblist | (cd $(top-build-dir); tar -cf- -T- ) | \
103 tar -C $(outdir)/web-root/ -xf -
104 for dir in $(outdir)/web-root/ ; do \
106 for a in `find . -name out-www`; do \
107 rsync -a --link-dest $$a/ $$a/ $$a/.. ; \
111 echo $(TOPLEVEL_VERSION) > $(outdir)/web-root/VERSION
113 tree-prefix = $(outdir)
114 tree-bin = $(tree-prefix)/bin
115 tree-lib = $(tree-prefix)/lib
116 tree-share = $(tree-prefix)/share
117 tree-share-prefix = $(tree-share)/lilypond/$(TOPLEVEL_VERSION)
118 tree-share-prefix-current = $(tree-share)/lilypond/current
119 tree-lib-prefix = $(tree-lib)/lilypond/$(TOPLEVEL_VERSION)
120 tree-lib-prefix-current = $(tree-lib)/lilypond/current
124 $(foreach i, $(C_DIRS), $(MAKE) -C $(i) clean &&) true
126 src-ext = c cc yy ll hh icc py scm tex ps texi itexi tely itely sh
129 $(MAKE) out=www clean
130 $(MAKE) $(tree-share-prefix)/lilypond-force
132 default: $(config_h) build-dir-setup
134 build-dir-setup: $(tree-share-prefix)/lilypond-force
136 PO_FILES = $(call src-wildcard,$(src-depth)/po/*.po)
137 HELP_CATALOGS = $(PO_FILES:po/%.po=%)
138 CATALOGS = $(HELP_CATALOGS:lilypond=)
140 $(tree-share-prefix)/lilypond-force link-tree: GNUmakefile
141 # Preparing LilyPond tree for build-dir exec
142 cd $(top-build-dir)/$(outbase) && rm -rf bin lib share
144 mkdir -p $(tree-share-prefix)
145 ln -s $(TOPLEVEL_VERSION) $(tree-share-prefix-current)
146 mkdir -p $(tree-lib-prefix)
147 ln -s $(TOPLEVEL_VERSION) $(tree-lib-prefix-current)
148 mkdir -p $(tree-share-prefix)/dvips
149 mkdir -p $(tree-share-prefix)/elisp
150 mkdir -p $(tree-share-prefix)/fonts
151 mkdir -p $(tree-share-prefix)/fonts/otf
152 mkdir -p $(tree-share-prefix)/fonts/tfm
153 mkdir -p $(tree-share-prefix)/fonts/type1
154 mkdir -p $(tree-share-prefix)/fonts/svg
155 mkdir -p $(tree-share-prefix)/fonts/map
156 mkdir -p $(tree-share-prefix)/fonts/enc
157 mkdir -p $(tree-share-prefix)/tex
159 ln -sf ../../lily/$(outconfbase)/lilypond . && \
160 for i in abc2ly convert-ly etf2ly lilypond-book lilypond-invoke-editor midi2ly musicxml2ly; \
161 do ln -sf ../../scripts/$(outconfbase)/$$i . ; done
162 cd $(tree-lib-prefix) && \
163 ln -s ../../../../python/$(outconfbase) python
164 cd $(tree-share-prefix) && \
165 ln -s $(top-src-dir)/ly ly && \
166 ln -s ../../../../mf mf && \
167 ln -s $(top-src-dir)/ps && \
168 ln -s ../../../../python/$(outconfbase) python && \
169 ln -s $(top-src-dir)/scm && \
170 ln -s $(top-src-dir)/scripts scripts
171 cd $(tree-share-prefix)/dvips && \
172 ln -s ./../../../mf/$(outconfbase) mf-out && \
173 ln -s $(top-src-dir)/ps
174 cd $(tree-share-prefix)/tex && \
175 ln -s $(top-src-dir)/tex source && \
176 ln -s ../../../../../tex/$(outconfbase) tex-out && \
177 ln -s ../../../../../mf/$(outconfbase) mf-out
179 cd $(tree-share-prefix)/fonts && \
180 ln -s $(top-src-dir)/mf source && \
182 -cd $(tree-share-prefix)/elisp && \
183 ln -sf ../../../../../../elisp/$(outconfbase)/lilypond-words.el . && \
184 ln -s $(top-src-dir)/elisp/*.el .
185 $(foreach i,$(CATALOGS), \
186 (mkdir -p $(tree-share)/locale/$i/LC_MESSAGES && \
187 cd $(tree-share)/locale/$i/LC_MESSAGES && \
188 ln -sf ../../../../../po/$(outconfbase)/$i.mo lilypond.mo) &&) true
189 touch $(tree-share-prefix)/lilypond-force
191 $(tree-share-prefix)/mf-link-tree link-mf-tree: $(tree-share-prefix)/lilypond-force
192 -rm -f $(tree-share-prefix)/fonts/otf/* && \
193 rm -f $(tree-share-prefix)/fonts/svg/* && \
194 rm -f $(tree-share-prefix)/fonts/tfm/* && \
195 rm -f $(tree-share-prefix)/fonts/type1/* && \
196 cd $(tree-share-prefix)/fonts/otf && \
197 ln -s ../../../../../../mf/$(outconfbase)/*.otf .
198 -cd $(tree-share-prefix)/fonts/svg && \
199 ln -s ../../../../../../mf/$(outconfbase)/*.svg .
200 -cd $(tree-share-prefix)/fonts/tfm && \
201 ln -s ../../../../../../mf/$(outconfbase)/*.tfm .
202 -cd $(tree-share-prefix)/fonts/type1 && \
203 ln -s ../../../../../../mf/$(outconfbase)/*.pfa .
206 etags -o $@ $(find $(srcdir) -name 'GNUmakefile*' -o -name '*.make')
208 local-clean: build-dir-setup-clean local-web-clean
211 rm -rf $(outdir)/web-root/
215 build-dir-setup-clean:
216 cd $(top-build-dir) && rm -rf share
218 $(config_h): config.hh.in
220 # this is to prevent people from getting
221 # undefined symbols when we add them to config.h.in,
222 # and they blindly run "cvs update; make".
225 @echo ' *** $(config_h) is out of date'
226 @echo ' *** Remove it and rerun autogen:'
227 @echo ' rm $(config_h); ./autogen.sh'