forked from lilypond/lilypond
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGNUmakefile.in
423 lines (352 loc) · 14.3 KB
/
GNUmakefile.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
# -*-Makefile-*-
depth = .
SUBDIRS = python scripts \
flower lily \
mf ly \
tex ps scm \
po \
elisp vim \
input \
$(documentation-dir)
## this convoluted construction is necessary, since we don't know the
## value of DOCUMENTATION here.
documentation-dir=$(if $(findstring no,$(DOCUMENTATION)),,Documentation)
README_FILES = README.md COPYING COPYING.FDL DEDICATION ROADMAP HACKING \
LICENSE LICENSE.DOCUMENTATION LICENSE.OFL
TOPDOC_FILES = AUTHORS INSTALL NEWS
TOPDOC_TXT_FILES = $(foreach T,$(TOPDOC_FILES),Documentation/$(outdir)/topdocs/$(T).txt)
RELEASE_FILES = RELEASE-COMMIT
RELEASE_OUT_FILES = $(RELEASE_FILES:%=$(outdir)/%)
INSTALLATION_DIR=$(local_lilypond_datadir)
INSTALLATION_FILES=$(config_make) VERSION
GENERATED_BUILD_FILES=configure aclocal.m4 autogen.sh
# bootstrap stepmake:
#
STEPMAKE_TEMPLATES=install
LOCALSTEPMAKE_TEMPLATES=lilypond
include $(depth)/make/stepmake.make
.PHONY: test info website
dist: $(GENERATED_BUILD_FILES) top-doc refresh-release-files .gitfilelist
@if ! test -d $(top-src-dir)/.git ; \
then echo "*** dist needs a git repository" \
exit 1 ; \
fi
@cd $(top-src-dir) && if ! git diff --quiet HEAD ; \
then echo "*** dist must been rolled on a clean git tree;"; \
echo "uncommitted changes detected, aborting."; \
exit 1 ; \
fi
rm -rf $(distdir)
mkdir -p $(distdir)
$(LN) $(RELEASE_OUT_FILES) $(TOPDOC_TXT_FILES) $(distdir)
$(LN) $(GENERATED_BUILD_FILES:%=$(src-dir)/%) .gitfilelist $(distdir)
cd $(top-src-dir) && xargs $(PYTHON) $(buildscript-dir)/mass-link.py hard . $(distdir) <$(top-build-dir)/.gitfilelist
chmod -R a+r $(distdir)
chmod a+x `find $(distdir) -type d -print`
(cd $(outdir); \
$(TAR) --sort=name --mtime="$$(git --git-dir=$(top-src-dir)/.git log -1 --format=%cD)" \
-cf - --owner=0 --group=0 $(DIST_NAME) | gzip -9 > $(DIST_NAME).tar.gz)
rm -rf $(distdir)
top-doc:
$(MAKE) -C Documentation $(foreach T,$(TOPDOC_FILES),$(outdir)/topdocs/$(T).txt)
ifneq ($(shell find $(top-src-dir) -name .git),)
.gitfilelist: $(top-src-dir)/.git/index
$(call ly_progress,Making,$@,)
cd $(top-src-dir) && git ls-files >$(top-build-dir)/$@
local-clean-filelist:
rm -f .gitfilelist
else
.gitfilelist: $(src-dir)/.gitfilelist
$(call ly_progress,Making,$@,(copy))
cp $< $@
local-clean-filelist:
endif
all: $(outdir)/VERSION
$(outdir)/VERSION: $(config_make) VERSION
$(call ly_progress,Making,$@,)
-mkdir -p $(outdir)
echo $(TOPLEVEL_VERSION) > $@
$(outdir)/RELEASE-COMMIT:
$(call ly_progress,Making,$@,)
git --git-dir=$(top-src-dir)/.git show --no-patch HEAD > $@
refresh-release-files:
@if ! test -d $(top-src-dir)/.git ; \
then echo "*** dist needs a git repository" \
exit 1 ; \
fi
rm -f $(RELEASE_OUT_FILES)
$(MAKE) $(RELEASE_OUT_FILES)
local-clean: local-clean-filelist
# PO files
po:
if test -r $(po-srcdir); then \
rm -f $(po-outdir)/$(package).po; \
mkdir -p $(po-outdir); \
touch $(po-outdir)/$(package).po; \
fi
$(LOOP)
po-update: po
$(MAKE) -C $(po-outdir)/.. po-update
po-replace: po
$(MAKE) -C $(po-outdir)/.. po-replace
info:
$(MAKE) out=www -C Documentation info
install-info:
$(MAKE) COPY_INFO_IMAGES=yes out=www -C Documentation install-info
install-info-noimages:
$(MAKE) COPY_INFO_IMAGES=no out=www -C Documentation install-info
uninstall-info:
$(MAKE) out=www -C Documentation uninstall-info
install-help2man:
$(MAKE) -C scripts man install-help2man
$(MAKE) -C lily man install-help2man
install-doc: install-info-noimages install-WWW
uninstall-doc: uninstall-info uninstall-WWW
local-install:
$(INSTALLPY) -d $(DESTDIR)$(local_lilypond_datadir)
final-install:
@true
# All web targets, except info image symlinks and info docs are
# installed in non-recursing target from TOP-SRC-DIR
install-WWW: $(outdir)/offline-root/index.html
$(INSTALLPY) -m 755 -d $(DESTDIR)$(webdir)
rsync -rl --exclude='*.signature' $(dir $<) $(DESTDIR)$(webdir)
uninstall-WWW:
rm -rf $(DESTDIR)$(package_docdir)
$(MAKE) out=www -C Documentation uninstall
# For online docs with content negotiation, issue `make doc WEB_TARGETS=online'
# For both online and offline docs, issue `make doc WEB_TARGETS="offline online"'
WEB_TARGETS = offline
WEB_ROOT_FILES = $(WEB_TARGETS:%=$(outdir)/%-root/index.html)
WWW-post: $(WEB_ROOT_FILES)
$(outdir)/%-root/index.html: doc-build
$(call ly_progress,Making,$@,)
rm -rf $(dir $@)/
mkdir -p $(dir $@)/Documentation/
for d in . musicxml abc2ly lilypond-book ; do \
mkdir -p $(dir $@)/input/regression/$${d}; \
cp --link -a input/regression/$${d}/out-www/* $(dir $@)/input/regression/$${d}/ ; \
done
find $(dir $@)/input/regression/ -type f -not -name '*.png' \
-not -name '*.ly' -not -name '*.html' -not -name 'collated-files.pdf' \
-delete
cp --link -a Documentation/out-www/webdoc/* $(dir $@)/Documentation/
cp --link $(TOPDOC_TXT_FILES) $(dir $@)
# No link because the files come from the source directory.
cp $(addprefix $(src-dir)/,$(README_FILES)) $(dir $@)
$(PYTHON) $(buildscript-dir)/www_post.py $(PACKAGE_NAME) $(TOPLEVEL_VERSION) $(dir $@) "$*"
find $(outdir)/$*-root -type l | xargs rm -f
cd $(outdir)/$*-root && find -name \*.html -execdir $(buildscript-dir)/fix-docsize.sh {} +
$(PERL) -i -pe 's#(href)="\.\./Documentation/#\1="#g' $(dir $@)/Documentation/*html
$(PERL) -i -pe 's#(href)="\.\./\.\./Documentation/#\1="../#g' $(dir $@)/Documentation/*/*html
# Fixup links to CSS files.
$(PERL) -i -pe 's#(href)="css/#\1="../../Documentation/css/#g' $(dir $@)/input/regression/*html
$(PERL) -i -pe 's#(href)="css/#\1="../../../Documentation/css/#g' $(dir $@)/input/regression/*/*html
doc-build: top-doc
$(MAKE) out=www -C Documentation/ doc
$(MAKE) out=www -C input/regression/ doc
website: $(outdir)/website-root/index.html
$(outdir)/website-root/index.html: website-build
$(call ly_progress,Making,$@,)
rm -rf $(dir $@)/
mkdir -p $(dir $@)/
cp -a Documentation/out-web/website/web/* $(dir $@)/
$(foreach d,css misc pictures ly-examples,\
cp -a Documentation/out-web/website/$(d) $(dir $@)/ &&) true
$(PYTHON) $(buildscript-dir)/www_post.py $(PACKAGE_NAME) $(TOPLEVEL_VERSION) $(dir $@) "offline"
# fixup links to subdirectories.
$(PERL) -i -pe 's#(href|src)="\.\./(misc|pictures|ly-examples|css)#\1="\2#g' $(dir $@)/*html
# simplify links to self.
$(PERL) -i -pe 's#(href)="\.\./web/#\1="#g' $(dir $@)/*html
website-build:
$(MAKE) out=web WEB_VERSION=yes -C Documentation/ website
# For those who cannot for the life in them remember to type
# WEB_TARGETS=..., just bloody make all doc stuff, already.
all-doc:
$(MAKE) WEB_TARGETS='online offline' doc
tree-prefix = $(outdir)
tree-bin = $(tree-prefix)/bin
tree-share = $(tree-prefix)/share
# Don't put version numbers here. During development
# they make no sense, and cause EPS files to become invalid.
tree-share-prefix = $(tree-share)/lilypond/current
src-ext = c cc yy ll hh icc py scm tex ps texi itexi tely itely sh
doc-clean: snippets-clean $(tree-share-prefix)/lilypond-force
default: $(config_h) build-dir-setup doc-messages
build-dir-setup: $(tree-share-prefix)/lilypond-force
# Preparing LilyPond tree for build-dir exec
link-tree: $(tree-share-prefix)/lilypond-force
$(tree-share-prefix)/lilypond-force: GNUmakefile GNUmakefile.in $(outdir)/VERSION
$(call ly_progress,Making,$@,)
rm -rf $(tree-bin) $(tree-share)
mkdir -p $(tree-bin)
mkdir -p $(tree-share-prefix)
mkdir -p $(tree-share-prefix)/fonts
mkdir -p $(tree-share-prefix)/fonts/otf
mkdir -p $(tree-share-prefix)/fonts/svg
cd $(tree-bin) && \
ln -sf ../../lily/$(outconfbase)/lilypond . && \
for i in abc2ly convert-ly etf2ly lilymidi lilypond-book lilypond-invoke-editor midi2ly musicxml2ly; \
do ln -sf ../../scripts/$(outconfbase)/$$i . ; done
cd $(tree-share-prefix) && for i in ly ps python; do \
ln -s $(top-src-dir)/$$i; done
mkdir -p $(tree-share-prefix)/scm && ln -s $(top-src-dir)/scm $(tree-share-prefix)/scm/lily
touch $(tree-share-prefix)/lilypond-force
link-mf-tree: $(tree-share-prefix)/mf-link-tree
$(tree-share-prefix)/mf-link-tree: $(tree-share-prefix)/lilypond-force
$(call ly_progress,Making,$@,)
-rm -f $(tree-share-prefix)/fonts/otf/* && \
rm -f $(tree-share-prefix)/fonts/svg/* && \
rm -f $(tree-share-prefix)/fonts/00-lilypond-fonts.conf && \
rm -f $(tree-share-prefix)/fonts/99-lilypond-fonts.conf && \
cd $(tree-share-prefix)/fonts/otf && \
ln -s ../../../../../../mf/$(outconfbase)/*.otf . && \
$(foreach i,$(addprefix $(TEXGYRE_DIR)/,$(TEXGYRE_FILES)), \
ln -s $i . && ) true && \
$(foreach i,$(addprefix $(URWOTF_DIR)/,$(URWOTF_FILES)), \
ln -s $i . && ) true
-cd $(tree-share-prefix)/fonts && \
ln -s ../../../../../mf/$(outconfbase)/00-lilypond-fonts.conf . && \
ln -s ../../../../../mf/$(outconfbase)/99-lilypond-fonts.conf .
-cd $(tree-share-prefix)/fonts/svg && \
ln -s ../../../../../../mf/$(outconfbase)/*.svg .
-cd $(tree-share-prefix)/fonts/svg && \
ln -s ../../../../../../mf/$(outconfbase)/*.woff .
touch $(tree-share-prefix)/mf-link-tree
TAGS.make: dummy
$(call ly_progress,Making,$@,)
etags -o $@ $(find $(top-src-dir) -name 'GNUmakefile*' -o -name '*.make')
$(config_h): config.hh.in
#
# this is to prevent people from getting
# undefined symbols when we add them to config.h.in,
# and they blindly run "cvs update; make".
#
@echo
@echo ' *** $(config_h) is out of date'
@echo ' *** Remove it and rerun autogen:'
@echo ' rm $(config_h); ./autogen.sh'
@echo
@false
grand-replace:
cd $(top-src-dir) && $(PYTHON) $(buildscript-dir)/grand-replace.py
################################################################
# testing
BASELINE_STAMP:=$(top-build-dir)/out-baseline/.test-baseline-done
RESULT_DIR=$(top-build-dir)/out/test-results
test-pre: $(tree-share-prefix)/lilypond-force
$(call make_subdirs,python scripts flower lily mf,all)
test: test-pre
$(MAKE) -C python local-test
$(MAKE) -C scripts/build local-test
$(MAKE) -C ly local-test
@echo 'To begin investigating regression-test crashes, try this:'
@echo
@echo ' grep -L systems.texi out/lybook-testdb/*/*log | sed s/log/ly/g | xargs grep -H sourcefilename'
@echo
@echo 'Matching lines may provide original test source file names.'
@echo 'The .ly files in which they appear are preprocessed test input.'
@echo 'The corresponding .log files may have errors or warnings.'
@echo
@echo 'If the above is not helpful, try sifting through this:'
@echo
@echo ' find out/lybook-testdb -name "*.log" | xargs grep -H "\(error\|warning\)"'
@echo
$(MAKE) -C input/regression out=test lysdoc-test
$(buildscript-dir)/print-gittxt.sh $(top-src-dir) > input/regression/out-test/tree.gittxt
$(MAKE) -C input/regression/abc2ly out=test lysdoc-test
$(MAKE) -C input/regression/lilypond-book out=test local-test
$(MAKE) -C input/regression/midi out=test lysdoc-test
$(MAKE) -C input/regression/musicxml out=test lysdoc-test
$(MAKE) -C input/regression/other out=test lysdoc-test
test-baseline-pre:
cd $(top-src-dir) && \
if test -d .git ; then \
if ! git diff --exit-code > /dev/null ; then \
echo "*** commit before base lining" 1>&2; \
exit 1; \
fi \
fi
$(MAKE) test-clean
$(MAKE) test
test-baseline: test-baseline-pre
rm -f $(BASELINE_STAMP)
# Make a copy of the fonts that all subdir baselines can share.
$(call ly_progress,Synching,out-baseline/share/lilypond/current/fonts,from out)
mkdir -p $(top-build-dir)/out-baseline/share/lilypond/current
rsync -L -a -q --delete --exclude source \
$(top-build-dir)/out/share/lilypond/current/fonts \
$(top-build-dir)/out-baseline/share/lilypond/current
$(MAKE) out=test -C input/regression local-test-baseline
$(MAKE) out=test -C input/regression/abc2ly local-test-baseline
$(MAKE) out=test -C input/regression/midi local-test-baseline
$(MAKE) out=test -C input/regression/musicxml local-test-baseline
$(MAKE) out=test -C input/regression/other local-test-baseline
$(MAKE) test-snippets-clean
touch $(BASELINE_STAMP)
local-check-pre:
[ -f $(BASELINE_STAMP) ] || \
( echo "*** no baseline for comparison" 1>&2 && false )
$(MAKE) test
local-check: local-check-pre
rm -rf $(RESULT_DIR)
mkdir -p $(RESULT_DIR)
$(PYTHON) $(buildscript-dir)/output-distance.py $(if $(VERBOSE),-v) \
--local-datadir --output-dir $(RESULT_DIR) \
input/regression/out-test-baseline input/regression/out-test \
input/regression/abc2ly/out-test-baseline input/regression/abc2ly/out-test \
input/regression/midi/out-test-baseline input/regression/midi/out-test \
input/regression/musicxml/out-test-baseline input/regression/musicxml/out-test \
input/regression/other/out-test-baseline input/regression/other/out-test
ifneq ($(TIDY),false)
find $(RESULT_DIR) -name '*.html' | while read f ; do \
echo "Validating $$f" ; \
$(TIDY) -q -o /dev/null "$$f" || exit 1 ; \
done
endif
@find input ly -name '*.ly' -print |grep -v 'out.*/' | xargs grep '\\version' -L | grep -v "standard input" |sed 's/^/**** Missing version: /g'
test-clean: test-snippets-clean
rm -rf $(RESULT_DIR)
$(MAKE) -C input/regression out=test clean
snippets-clean:
rm -rf out/lybook-db
test-snippets-clean:
rm -rf out/lybook-testdb
distclean: clean doc-clean test-clean
$(MAKE) local-distclean
local-distclean:
rm -f config.hh config.make GNUmakefile \
config.cache config.status config.log
rm -rf autom4te.cache
rm -rf $(outdir)
$(package-icon):
$(MAKE) -C Documentation/logo icon
install:
$(LOOP)
ifeq ($(strip $(SRCMAKE)),)
$(MAKE) final-install
endif
local-help:
@echo " config rerun configure"
@echo " dist roll tarball: $(depth)/$(outdir)/$(distname).tar.gz"
@echo " distclean make clean, doc-clean, test-clean and"
@echo " also remove configure output"
@echo " po make new translation Portable Object database"
@echo " po-replace do po-update and replace catalogs with msgmerged versions"
@echo " po-update update translation Portable Object database"
@echo
@echo " install-doc install website documentation in"
@echo " (webdir=$(webdir))"
@echo " and Info documentation with images"
@echo " uninstall-doc remove installed documentation with images"
@echo " info build Info documentation with images"
@echo " install-info install Info documentation with images"
@echo
@echo "Some more targets are available for testing changes:"
@echo " test-baseline"
@echo " check"
@echo " test-clean"
@echo
@echo " For more information on these targets, see"
@echo " \`Verify regression tests' in the Contributor's Guide."
@echo