2 # title specific top level makefile for LilyPond
9 # descent order into subdirectories
11 SUBDIRS = buildscripts python scripts \
13 flower kpath-guile lily \
22 #package=`echo $PACKAGE_NAME | tr '[A-Z]' '[a-z]'`
24 SCRIPTS = configure aclocal.m4 autogen.sh lexer-gcc-3.1.sh Doxyfile
25 README_FILES = ChangeLog COPYING DEDICATION ROADMAP THANKS HACKING
26 README_TXT_FILES = AUTHORS.txt README.txt INSTALL.txt NEWS.txt
27 IN_FILES := $(call src-wildcard,*.in)
28 PATCH_FILES = emacsclient.patch server.el.patch darwin.patch
29 EXTRA_DIST_FILES = VERSION .cvsignore SConstruct \
30 $(README_FILES) $(SCRIPTS) $(IN_FILES) $(PATCH_FILES)
31 NON_ESSENTIAL_DIST_FILES = $(README_TXT_FILES)
32 INSTALLATION_DIR=$(local_lilypond_datadir)
33 INSTALLATION_FILES=$(config_make) VERSION
37 STEPMAKE_TEMPLATES=toplevel po install
38 include $(depth)/make/stepmake.make
41 $(MAKE) -C Documentation
44 -$(INSTALL) -m 755 -d $(DESTDIR)$(webdir)
45 tar -C $(webdir)/ -xzf $(outdir)/web.tar.gz
46 # install-WWW does not recurse; fake it visiting Documentation/user manually
47 $(MAKE) -C Documentation/user local-install-WWW
48 $(MAKE) -C Documentation/user install-info
51 $(MAKE) out=www install-WWW
57 $(MAKE) out=www uninstall-WWW=
60 $(INSTALL) -d $(DESTDIR)$(local_lilypond_datadir)
65 web-ext = html midi pdf png txt ly
67 footify = $(PYTHON) $(step-bindir)/add-html-footer.py --name $(PACKAGE_NAME) --version $(TOPLEVEL_VERSION)
68 footifymail = MAILADDRESS=bug-lilypond@gnu.org
71 # need UTF8 setting in case this is hosted on a website.
72 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
73 $(PYTHON) $(buildscript-dir)/mutopia-index.py -o $(outdir)/examples.html ./
74 echo '<META HTTP-EQUIV="refresh" content="0;URL=Documentation/index.html">' > $(outdir)/index.html
75 echo '<html><body>Redirecting to the documentation index...</body></html>' >> $(outdir)/index.html
77 cd $(top-build-dir) && $(FIND) . -name '*.html' -print | $(footifymail) xargs $(footify)
78 cd $(top-build-dir) && find . -name \*.html~ -print | xargs rm -f
79 cd $(top-build-dir) && find Documentation input \
80 $(web-ext:%=-path '*/out-www/*.%' -or) -type l \
82 ls $(outdir)/*.html >> $(outdir)/weblist
84 ## rewrite paths so we lose out-www
85 rm -rf $(outdir)/web-root/
86 mkdir $(outdir)/web-root/
87 cat $(outdir)/weblist | (cd $(top-build-dir); tar -cf- -T- ) | \
88 tar -C $(outdir)/web-root/ -xf -
89 cd $(outdir)/web-root/ && \
90 for a in `find -name out-www`; do \
95 tree-prefix = $(outdir)
96 tree-bin = $(tree-prefix)/bin
97 tree-lib = $(tree-prefix)/lib
98 tree-share = $(tree-prefix)/share
99 tree-share-prefix = $(tree-share)/lilypond/$(TOPLEVEL_VERSION)
100 tree-lib-prefix = $(tree-lib)/lilypond/$(TOPLEVEL_VERSION)
102 src-ext = c cc yy ll hh icc py scm tex ps texi itexi tely itely sh
105 $(MAKE) out=www clean
106 $(MAKE) $(tree-share-prefix)/lilypond-force
108 default: $(config_h) build-dir-setup
110 build-dir-setup: $(tree-share-prefix)/lilypond-force
112 PO_FILES = $(call src-wildcard,$(src-depth)/po/*.po)
113 HELP_CATALOGS = $(PO_FILES:$(src-depth)/po/%.po=%)
114 CATALOGS = $(HELP_CATALOGS:lilypond=)
116 $(tree-share-prefix)/lilypond-force link-tree: GNUmakefile
117 # Preparing LilyPond tree for build-dir exec
118 cd $(top-build-dir)/$(outbase) && rm -rf bin lib share
120 mkdir -p $(tree-share-prefix)
121 mkdir -p $(tree-lib-prefix)
122 (cd $(tree-lib)/lilypond/ && ln -sf $(TOPLEVEL_VERSION) current)
123 (cd $(tree-share)/lilypond/ && ln -sf $(TOPLEVEL_VERSION) current)
124 mkdir -p $(tree-share-prefix)/dvips
125 mkdir -p $(tree-share-prefix)/elisp
126 mkdir -p $(tree-share-prefix)/fonts
127 mkdir -p $(tree-share-prefix)/fonts/otf
128 mkdir -p $(tree-share-prefix)/fonts/tfm
129 mkdir -p $(tree-share-prefix)/fonts/type1
130 mkdir -p $(tree-share-prefix)/fonts/svg
131 mkdir -p $(tree-share-prefix)/fonts/map
132 mkdir -p $(tree-share-prefix)/fonts/enc
133 mkdir -p $(tree-share-prefix)/tex
135 ln -sf ../../lily/$(outconfbase)/lilypond . && \
136 ln -sf ../../scripts/$(outconfbase)/convert-ly . && \
137 ln -sf ../../scripts/$(outconfbase)/lilypond-book . && \
138 ln -sf ../../scripts/$(outconfbase)/*.ly .
139 cd $(tree-lib-prefix) && \
140 ln -s ../../../../python/$(outconfbase) python
141 cd $(tree-share-prefix) && \
142 ln -s $(top-src-dir)/ly ly && \
143 ln -s ../../../../mf mf && \
144 ln -s $(top-src-dir)/ps && \
145 ln -s ../../../../python/$(outconfbase) python && \
146 ln -s $(top-src-dir)/scm && \
147 ln -s $(top-src-dir)/scripts scripts
148 cd $(tree-share-prefix)/dvips && \
149 ln -s ./../../../mf/$(outconfbase) mf-out && \
150 ln -s $(top-src-dir)/ps
151 cd $(tree-share-prefix)/tex && \
152 ln -s $(top-src-dir)/tex source && \
153 ln -s ../../../../../tex/$(outconfbase) tex-out && \
154 ln -s ../../../../../mf/$(outconfbase) mf-out
155 -cd $(tree-share-prefix)/fonts/otf && \
156 ln -s ../../../../../../mf/$(outconfbase)/*.otf .
157 -cd $(tree-share-prefix)/fonts/svg && \
158 ln -s ../../../../../../mf/$(outconfbase)/*.svg .
159 -cd $(tree-share-prefix)/fonts/tfm && \
160 ln -s ../../../../../../mf/$(outconfbase)/*.tfm .
161 -cd $(tree-share-prefix)/fonts/type1 && \
162 ln -s ../../../../../../mf/$(outconfbase)/*.pfa .
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
174 touch $(tree-share-prefix)/lilypond-force
176 local-clean: build-dir-setup-clean
177 build-dir-setup-clean:
178 cd $(top-build-dir) && rm -rf share
180 $(config_h): config.hh.in
182 # this is to prevent people from getting
183 # undefined symbols when we add them to config.h.in,
184 # and they blindly run "cvs update; make".
187 @echo ' *** $(config_h) is out of date'
188 @echo ' *** Remove it and rerun autogen:'
189 @echo ' rm $(config_h); ./autogen.sh'