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
37 default: $(outdir)/VERSION
39 $(outdir)/VERSION: $(config_make) VERSION
40 echo $(TOPLEVEL_VERSION) > $@
42 dist-toplevel-txt-files:
44 ln $(TOPDOC_TXT_FILES) $(distdir)/
45 ln $(top-src-dir)/stepmake/aclocal.m4 $(distdir)/
48 $(MAKE) -C Documentation
51 -$(INSTALL) -m 755 -d $(DESTDIR)$(webdir)
52 cp -a $(outdir)/web-root/ $(DESTDIR)$(webdir)/
54 $(MAKE) -C Documentation/user local-install-WWW
55 $(MAKE) -C Documentation/user install-info
58 $(MAKE) -C scripts man install-help2man
59 $(MAKE) -C lily man install-help2man
62 $(MAKE) out=www install-WWW
68 $(MAKE) out=www uninstall-WWW
71 $(INSTALL) -d $(DESTDIR)$(local_lilypond_datadir)
76 web-ext = html midi pdf png txt ly signature
78 # For docball, issue `make web CONTENT_NEGOTIATION='
79 CONTENT_NEGOTIATION = --content-negotiation
80 footify = $(PYTHON) $(step-bindir)/add-html-footer.py --name $(PACKAGE_NAME) --version $(TOPLEVEL_VERSION) $(CONTENT_NEGOTIATION)
81 footifymail = MAILADDRESS='http://post.gmane.org/post.php?group=gmane.comp.gnu.lilypond.bugs'
86 # need UTF8 setting in case this is hosted on a website.
87 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
88 $(PYTHON) $(buildscript-dir)/mutopia-index.py -o $(outdir)/examples.html input/
89 echo '<META HTTP-EQUIV="refresh" content="0;URL=Documentation/index.html">' > $(outdir)/index.html
90 echo '<html><body>Redirecting to the documentation index...</body></html>' >> $(outdir)/index.html
92 cd $(top-build-dir) && $(FIND) . -name '*.html' -print | $(footifymail) xargs $(footify)
94 cd $(top-build-dir) && find Documentation input \
95 $(web-ext:%=-path '*/out-www/*.%' -or) -type l \
96 | grep -v 'lily-[0-9a-f]*.*pdf' \
99 ls $(outdir)/*.html >> $(outdir)/weblist
101 ## urg: this is too hairy, should write a python script to do this.
103 ## rewrite file names so we lose out-www
104 rm -rf $(outdir)/web-root/
105 mkdir $(outdir)/web-root/
107 cat $(outdir)/weblist | (cd $(top-build-dir); tar -cf- -T- ) | \
108 tar -C $(outdir)/web-root/ -xf -
109 for dir in $(outdir)/web-root/ ; do \
111 for a in `find . -name out-www`; do \
112 rsync -a --link-dest $$a/ $$a/ $$a/.. ; \
117 tree-prefix = $(outdir)
118 tree-bin = $(tree-prefix)/bin
119 tree-lib = $(tree-prefix)/lib
120 tree-share = $(tree-prefix)/share
121 tree-share-prefix = $(tree-share)/lilypond/$(TOPLEVEL_VERSION)
122 tree-share-prefix-current = $(tree-share)/lilypond/current
123 tree-lib-prefix = $(tree-lib)/lilypond/$(TOPLEVEL_VERSION)
124 tree-lib-prefix-current = $(tree-lib)/lilypond/current
128 $(foreach i, $(C_DIRS), $(MAKE) -C $(i) clean &&) true
130 src-ext = c cc yy ll hh icc py scm tex ps texi itexi tely itely sh
133 $(MAKE) out=www clean
134 $(MAKE) $(tree-share-prefix)/lilypond-force
136 default: $(config_h) build-dir-setup
138 build-dir-setup: $(tree-share-prefix)/lilypond-force
140 PO_FILES = $(call src-wildcard,$(src-depth)/po/*.po)
141 HELP_CATALOGS = $(PO_FILES:po/%.po=%)
142 CATALOGS = $(HELP_CATALOGS:lilypond=)
144 $(tree-share-prefix)/lilypond-force link-tree: GNUmakefile $(outdir)/VERSION
145 # Preparing LilyPond tree for build-dir exec
146 cd $(top-build-dir)/$(outbase) && rm -rf bin lib share
148 mkdir -p $(tree-share-prefix)
149 ln -s $(TOPLEVEL_VERSION) $(tree-share-prefix-current)
150 mkdir -p $(tree-lib-prefix)
151 ln -s $(TOPLEVEL_VERSION) $(tree-lib-prefix-current)
152 mkdir -p $(tree-share-prefix)/dvips
153 mkdir -p $(tree-share-prefix)/elisp
154 mkdir -p $(tree-share-prefix)/fonts
155 mkdir -p $(tree-share-prefix)/fonts/otf
156 mkdir -p $(tree-share-prefix)/fonts/tfm
157 mkdir -p $(tree-share-prefix)/fonts/type1
158 mkdir -p $(tree-share-prefix)/fonts/svg
159 mkdir -p $(tree-share-prefix)/fonts/map
160 mkdir -p $(tree-share-prefix)/fonts/enc
161 mkdir -p $(tree-share-prefix)/tex
163 ln -sf ../../lily/$(outconfbase)/lilypond . && \
164 for i in abc2ly convert-ly etf2ly lilypond-book lilypond-invoke-editor midi2ly musicxml2ly; \
165 do ln -sf ../../scripts/$(outconfbase)/$$i . ; done
166 cd $(tree-lib-prefix) && \
167 ln -s ../../../../python/$(outconfbase) python
168 cd $(tree-share-prefix) && \
169 ln -s $(top-src-dir)/ly ly && \
170 ln -s ../../../../mf mf && \
171 ln -s $(top-src-dir)/ps && \
172 ln -s ../../../../python/$(outconfbase) python && \
173 ln -s $(top-src-dir)/scm && \
174 ln -s $(top-src-dir)/scripts scripts
175 cd $(tree-share-prefix)/dvips && \
176 ln -s ./../../../mf/$(outconfbase) mf-out && \
177 ln -s $(top-src-dir)/ps
178 cd $(tree-share-prefix)/tex && \
179 ln -s $(top-src-dir)/tex source && \
180 ln -s ../../../../../tex/$(outconfbase) tex-out && \
181 ln -s ../../../../../mf/$(outconfbase) mf-out
183 cd $(tree-share-prefix)/fonts && \
184 ln -s $(top-src-dir)/mf source && \
186 -cd $(tree-share-prefix)/elisp && \
187 ln -sf ../../../../../../elisp/$(outconfbase)/lilypond-words.el . && \
188 ln -s $(top-src-dir)/elisp/*.el .
189 $(foreach i,$(CATALOGS), \
190 (mkdir -p $(tree-share)/locale/$i/LC_MESSAGES && \
191 cd $(tree-share)/locale/$i/LC_MESSAGES && \
192 ln -sf ../../../../../po/$(outconfbase)/$i.mo lilypond.mo) &&) true
193 touch $(tree-share-prefix)/lilypond-force
195 $(tree-share-prefix)/mf-link-tree link-mf-tree: $(tree-share-prefix)/lilypond-force
196 -rm -f $(tree-share-prefix)/fonts/otf/* && \
197 rm -f $(tree-share-prefix)/fonts/svg/* && \
198 rm -f $(tree-share-prefix)/fonts/tfm/* && \
199 rm -f $(tree-share-prefix)/fonts/type1/* && \
200 cd $(tree-share-prefix)/fonts/otf && \
201 ln -s ../../../../../../mf/$(outconfbase)/*.otf .
202 -cd $(tree-share-prefix)/fonts/svg && \
203 ln -s ../../../../../../mf/$(outconfbase)/*.svg .
204 -cd $(tree-share-prefix)/fonts/tfm && \
205 ln -s ../../../../../../mf/$(outconfbase)/*.tfm .
206 -cd $(tree-share-prefix)/fonts/type1 && \
207 ln -s ../../../../../../mf/$(outconfbase)/*.pfa .
210 etags -o $@ $(find $(top-src-dir) -name 'GNUmakefile*' -o -name '*.make')
212 $(config_h): config.hh.in
214 # this is to prevent people from getting
215 # undefined symbols when we add them to config.h.in,
216 # and they blindly run "cvs update; make".
219 @echo ' *** $(config_h) is out of date'
220 @echo ' *** Remove it and rerun autogen:'
221 @echo ' rm $(config_h); ./autogen.sh'