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 autogen.sh lexer-gcc-3.1.sh Doxyfile
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 PATCH_FILES = emacsclient.patch server.el.patch darwin.patch
26 EXTRA_DIST_FILES = VERSION .cvsignore SConstruct \
27 $(README_FILES) $(SCRIPTS) $(IN_FILES) $(PATCH_FILES)
28 INSTALLATION_DIR=$(local_lilypond_datadir)
29 INSTALLATION_FILES=$(config_make) VERSION
33 STEPMAKE_TEMPLATES=toplevel po install
34 include $(depth)/make/stepmake.make
36 local-dist: dist-toplevel-txt-files
38 dist-toplevel-txt-files:
40 ln $(TOPDOC_TXT_FILES) $(distdir)/
41 ln $(top-src-dir)/stepmake/aclocal.m4 $(distdir)/
44 $(MAKE) -C Documentation
47 -$(INSTALL) -m 755 -d $(DESTDIR)$(webdir)
48 cp -a $(outdir)/web-root/ $(DESTDIR)$(webdir)/
50 $(MAKE) -C Documentation/user local-install-WWW
51 $(MAKE) -C Documentation/user install-info
54 $(MAKE) out=www install-WWW
60 $(MAKE) out=www uninstall-WWW=
63 $(INSTALL) -d $(DESTDIR)$(local_lilypond_datadir)
68 web-ext = html midi pdf png txt ly signature
70 footify = $(PYTHON) $(step-bindir)/add-html-footer.py --name $(PACKAGE_NAME) --version $(TOPLEVEL_VERSION)
71 footifymail = MAILADDRESS='http://post.gmane.org/post.php?group=gmane.comp.gnu.lilypond.bugs'
76 # need UTF8 setting in case this is hosted on a website.
77 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
78 $(PYTHON) $(buildscript-dir)/mutopia-index.py -o $(outdir)/examples.html input/
79 echo '<META HTTP-EQUIV="refresh" content="0;URL=Documentation/index.html">' > $(outdir)/index.html
80 echo '<html><body>Redirecting to the documentation index...</body></html>' >> $(outdir)/index.html
82 cd $(top-build-dir) && $(FIND) . -name '*.html' -print | $(footifymail) xargs $(footify)
84 cd $(top-build-dir) && find Documentation input \
85 $(web-ext:%=-path '*/out-www/*.%' -or) -type l \
86 | grep -v 'lily-[0-9].*.pdf' \
88 ls $(outdir)/*.html >> $(outdir)/weblist
90 ## urg: this is too hairy, should write a python script to do this.
92 ## rewrite file names so we lose out-www
93 rm -rf $(outdir)/web-root/
94 mkdir $(outdir)/web-root/
96 cat $(outdir)/weblist | (cd $(top-build-dir); tar -cf- -T- ) | \
97 tar -C $(outdir)/web-root/ -xf -
98 for dir in $(outdir)/web-root/ ; do \
100 for a in `find . -name out-www`; do \
101 rsync -a --link-dest $$a/ $$a/ $$a/.. ; \
105 echo $(TOPLEVEL_VERSION) > $(outdir)/web-root/VERSION
107 tree-prefix = $(outdir)
108 tree-bin = $(tree-prefix)/bin
109 tree-lib = $(tree-prefix)/lib
110 tree-share = $(tree-prefix)/share
111 tree-share-prefix = $(tree-share)/lilypond/$(TOPLEVEL_VERSION)
112 tree-share-prefix-current = $(tree-share)/lilypond/current
113 tree-lib-prefix = $(tree-lib)/lilypond/$(TOPLEVEL_VERSION)
114 tree-lib-prefix-current = $(tree-lib)/lilypond/current
118 $(foreach i, $(C_DIRS), $(MAKE) -C $(i) clean &&) true
120 src-ext = c cc yy ll hh icc py scm tex ps texi itexi tely itely sh
123 $(MAKE) out=www clean
124 $(MAKE) $(tree-share-prefix)/lilypond-force
126 default: $(config_h) build-dir-setup
128 build-dir-setup: $(tree-share-prefix)/lilypond-force
130 PO_FILES = $(call src-wildcard,$(src-depth)/po/*.po)
131 HELP_CATALOGS = $(PO_FILES:$(src-depth)/po/%.po=%)
132 CATALOGS = $(HELP_CATALOGS:lilypond=)
134 $(tree-share-prefix)/lilypond-force link-tree: GNUmakefile
135 # Preparing LilyPond tree for build-dir exec
136 cd $(top-build-dir)/$(outbase) && rm -rf bin lib share
138 mkdir -p $(tree-share-prefix)
139 ln -s $(TOPLEVEL_VERSION) $(tree-share-prefix-current)
140 mkdir -p $(tree-lib-prefix)
141 ln -s $(TOPLEVEL_VERSION) $(tree-lib-prefix-current)
142 mkdir -p $(tree-share-prefix)/dvips
143 mkdir -p $(tree-share-prefix)/elisp
144 mkdir -p $(tree-share-prefix)/fonts
145 mkdir -p $(tree-share-prefix)/fonts/otf
146 mkdir -p $(tree-share-prefix)/fonts/tfm
147 mkdir -p $(tree-share-prefix)/fonts/type1
148 mkdir -p $(tree-share-prefix)/fonts/svg
149 mkdir -p $(tree-share-prefix)/fonts/map
150 mkdir -p $(tree-share-prefix)/fonts/enc
151 mkdir -p $(tree-share-prefix)/tex
153 ln -sf ../../lily/$(outconfbase)/lilypond . && \
154 for i in abc2ly convert-ly etf2ly lilypond-book lilypond-invoke-editor midi2ly musicxml2ly; \
155 do ln -sf ../../scripts/$(outconfbase)/$$i . ; done
156 cd $(tree-lib-prefix) && \
157 ln -s ../../../../python/$(outconfbase) python
158 cd $(tree-share-prefix) && \
159 ln -s $(top-src-dir)/ly ly && \
160 ln -s ../../../../mf mf && \
161 ln -s $(top-src-dir)/ps && \
162 ln -s ../../../../python/$(outconfbase) python && \
163 ln -s $(top-src-dir)/scm && \
164 ln -s $(top-src-dir)/scripts scripts
165 cd $(tree-share-prefix)/dvips && \
166 ln -s ./../../../mf/$(outconfbase) mf-out && \
167 ln -s $(top-src-dir)/ps
168 cd $(tree-share-prefix)/tex && \
169 ln -s $(top-src-dir)/tex source && \
170 ln -s ../../../../../tex/$(outconfbase) tex-out && \
171 ln -s ../../../../../mf/$(outconfbase) mf-out
173 cd $(tree-share-prefix)/fonts && \
174 ln -s $(top-src-dir)/mf source && \
176 -cd $(tree-share-prefix)/elisp && \
177 ln -sf ../../../../../../elisp/$(outconfbase)/lilypond-words.el . && \
178 ln -s $(top-src-dir)/elisp/*.el .
179 $(foreach i,$(CATALOGS), \
180 (mkdir -p $(tree-share)/locale/$i/LC_MESSAGES && \
181 cd $(tree-share)/locale/$i/LC_MESSAGES && \
182 ln -sf ../../../../../po/$(outconfbase)/$i.mo lilypond.mo) &&) true
183 touch $(tree-share-prefix)/lilypond-force
185 $(tree-share-prefix)/mf-link-tree link-mf-tree: $(tree-share-prefix)/lilypond-force
186 -rm -f $(tree-share-prefix)/fonts/{otf,svg,tfm,type1}/* && \
187 cd $(tree-share-prefix)/fonts/otf && \
188 ln -s ../../../../../../mf/$(outconfbase)/*.otf .
189 -cd $(tree-share-prefix)/fonts/svg && \
190 ln -s ../../../../../../mf/$(outconfbase)/*.svg .
191 -cd $(tree-share-prefix)/fonts/tfm && \
192 ln -s ../../../../../../mf/$(outconfbase)/*.tfm .
193 -cd $(tree-share-prefix)/fonts/type1 && \
194 ln -s ../../../../../../mf/$(outconfbase)/*.pfa .
197 etags -o $@ $(find $(srcdir) -name 'GNUmakefile*' -o -name '*.make')
199 local-clean: build-dir-setup-clean local-web-clean
202 rm -rf $(outdir)/web-root/
206 build-dir-setup-clean:
207 cd $(top-build-dir) && rm -rf share
209 $(config_h): config.hh.in
211 # this is to prevent people from getting
212 # undefined symbols when we add them to config.h.in,
213 # and they blindly run "cvs update; make".
216 @echo ' *** $(config_h) is out of date'
217 @echo ' *** Remove it and rerun autogen:'
218 @echo ' rm $(config_h); ./autogen.sh'