-
Notifications
You must be signed in to change notification settings - Fork 24
/
GNUmakefile
81 lines (64 loc) · 2.68 KB
/
GNUmakefile
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
.PHONY: lilypond mingit phone web
.PHONY: default compilers TAGS help
sources = GNUmakefile $(filter-out %~, $(wildcard *.make bin/* gub/*.py gub/*/*.py gub/*/*/*.py gub/*/*/*/*.py test-lily/*.py))
ifeq ($(PLATFORMS),)
PLATFORMS=linux-x86 darwin-ppc darwin-x86 mingw linux-64 linux-ppc freebsd-x86 freebsd-64 # linux-mipsel
endif
default: compilers
include gub.make
include compilers.make
TAGS: $(sources)
etags $^
MAKE_FILES = $(filter-out compilers.make gub.make local.make,$(wildcard *.make))
MAKE_BASES = $(MAKE_FILES:%.make=%)
help:
@echo Usage: make [TAGS $(foreach a,$(MAKE_BASES),"| $(strip $(a))")]
@echo
@echo For more elaborate use, see README and bin/gub --help
$(MAKE_BASES):
$(MAKE) -f [email protected]
lily% cygwin%:
$(MAKE) -f lilypond.make $@
denemo-%:
$(MAKE) -f inkscape.make $@
inkscape-%:
$(MAKE) -f inkscape.make $@
openoffice-%:
$(MAKE) -f openoffice.make $@
test:
rm -rf target
make -f lilypond.make tools LOCAL_GUB_OPTIONS=-vvv
bin/gub -p $(BUILD_PLATFORM) --branch=lilypond=master:master lilypond -vvv
README: web/index.html web/basics.html web/lilypond.html web/denemo.html web/inkscape.html web/oo.o.html web/history.html web/links.html
w3m -dump $^ > $@
web: README
scp -p web/*.html web/*.css lilypond.org:/var/www/lilypond/gub
PYTHON_SOURCES = $$(git ls-files | grep -E '(^bin/|*.py$$)' | grep -Ev 'gub/(2|3)/')
python3:
ifeq (0,0) # a 2to3 crash fails to convert the remaining files
2to3-3.0 -nw -x urllib -x next $(PYTHON_SOURCES) >/dev/null
else
for i in $(PYTHON_SOURCES); do\
2to3-3.0 -nw -x urllib -x next $$i >/dev/null || :; \
done
endif
# fix breakages
sed -i -e 's@^\( *\)\t@\1 @g' \
-e 's@subprocess[.]\(AutogenMagic\|Chmod\|Conditional\|Copy\|CreateShar\|Dump\|ForcedAutogenMagic\|Func\|MapLocate\|Message\|Mkdir\|PackageGlobs\|Remove\|Rename\|Rmtree\|ShadowTree\|Substitute\|Symlink\|System\|UpdateSourceDir\)@commands.\1@g' \
$(PYTHON_SOURCES)
# cleaning
sed -i \
-e 's@\(for .* in\) list(\(.*[.]\(keys\|items\|values\)\) *()):@\1 \2 ():@' $(git ls-files | grep -E '(^bin/|*.py$)') \
-e 's@\(list\|next\|print\)(@\1 (@g' \
$(PYTHON_SOURCES)
python3-stats:
git diff origin p3 | grep -E '^(\+|X-) '| sed -e 's@^\(.\) *@\1@g' -e 's@^\(.\).*\(dbhash\|dbm\|md5\|0o\|new\|list (\|__self__\)@\1\2@g' | sort
python3-printf:
sed -i \
-e 's@ print \([^(].*\)@ printf (\1)@g' \
-e 's@ print @ printf @g' \
$(PYTHON_SOURCES)
sed -i \
-e 's@#\nfrom gub import@#\nfrom gub.syntax import printf\nfrom gub import@' $$(grep -l printf $$(git diff --name-only))
# sed 4.0.1 is broken, what t[ext]t[tool] do you use?
pytt '#\nfrom gub import' '#\nfrom gub.syntax import printf\nfrom gub import' $$(grep -l printf $$(git diff --name-only))