-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.aap
77 lines (68 loc) · 2.68 KB
/
main.aap
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
#####################################################################
#
# A-A-P file for making AsciiDoc distribution.
# (you can obtain A-A-P from http://www.a-a-p.org)
#
# Stuart Rackham <[email protected]>
#####################################################################
:execute ./common.aap
all: distribution
vers:
:print Version: $VERS (released $DATE)
vers_update:
# Propagate version number in common.aap to other versioned files.
:syseval grep "$$VERSION = '$(VERS)'" asciidoc.py | :assign dummy
@if exit != 0:
:print updating version numbers...
@for (fname,match) in (('asciidoc.py',r'^VERSION = '),('a2x.py',r'^VERSION = '),('configure.ac',r'^AC_INIT\(.*\)')):
:sys sed '/$match/ s/[0-9.][0-9.a-zA-Z_]\+/$VERS/' <$fname >$(fname).tmp
:sys mv -f $(fname).tmp $fname
@if fname in ('asciidoc.py','a2x.py'):
:sys chmod +x $fname
tags:
:sys rm -f tags
:sys ctags asciidoc.py asciidocapi.py tests/testasciidoc.py
docs:
:execute ./doc/main.aap
website:
:execute ./examples/website/main.aap
distribution: vers_update docs website
NAME = asciidoc-$(VERS)
# Make configure script.
:sys autoconf
:sys ln -s . $(NAME)
# Make tarball of all files in MANIFEST.
:sys tar -czf $(NAME).tar.gz \
``sed s:^:$(NAME)/: MANIFEST``
# Make zip file.
ZIP = `program_path("zip")`
@if ZIP:
:sys rm -f $(NAME).zip
:sys ls ``sed s:^:$(NAME)/: MANIFEST`` | $ZIP $(NAME).zip -@
# Zip files don't know about symlinks so just duplicate the
# files.
:sys $ZIP $(NAME).zip \
$(NAME)/doc/images/tiger.png \
$(NAME)/doc/images/smallnew.png \
$(NAME)/doc/images/icons/README \
$(NAME)/doc/images/icons/*.png \
$(NAME)/doc/images/icons/callouts/*.png \
$(NAME)/examples/website/images/tiger.png \
$(NAME)/examples/website/images/highlighter.png \
$(NAME)/examples/website/images/smallnew.png \
$(NAME)/examples/website/images/icons/README \
$(NAME)/examples/website/images/icons/*.png \
$(NAME)/examples/website/images/icons/callouts/*.png
:sys rm -f $(NAME)
@else:
:print WARNING: zip(1) unavailable, skipping zip file creation
:sys rm -f $(NAME)
test:
:sys python ./asciidoc.py --doctest
:sys python ./asciidocapi.py
:execute ./doc/main.aap test
:syseval ls ./tests/data/*.html | :assign TESTFILES
@if _no.TESTFILES:
:sys python ./tests/testasciidoc.py run
@else:
:print WARNING: no test files, run './tests/testasciidoc.py update'