-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMAKE.sh
executable file
·110 lines (91 loc) · 2.97 KB
/
MAKE.sh
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
#!/bin/bash
help_output()
{
cat <<EOF
Invocation:
`basename $0` [--wrapper] [--draft] [--linux] [--eabi] [--unified] [--tagid]
Options:
Note: None of the following options are mutually exclusive.
--wrapper)
This directive tells the stylesheet engine to include the attribute
tags in the generated output. This is useful during writing and
reviewing of the document. This applies to all further options
selected.
--draft)
This directive tells the stylesheet engine to include 'DRAFT' on page
and titles and other important areas of the document. This applies to
all further options selected.
--linux)
This directive tells the stylesheet engine to assemble the Linux
ABI document.
--eabi)
This directive tells the stylesheet engine to assemble the Embedded
ABI document.
--unified)
This directive tells the stylesheet engine to assemble the Embedded
ABI and Linux ABI into a single unified document.
--tagid)
This directive tells the stylesheet engine to append SGML id elements
to the header names (sections, titles, tables, etc.). This is used
during document creation and editing to create easy reference points.
e.g.
./`basename $0` --linux --wrapper --unified
results in the generation of:
2008-09-03-Unified-PPC-elf32abi.pdf
2008-09-03-Linux-PPC-elf32abi.pdf
EOF
}
if [ $# -eq 0 ]; then
help_output;
exit 0;
fi
for switch in "$@"; do
case $switch in
--h*|-h*)
help_output
exit 0;
;;
--wrapper|-wrapper)
wrapper="yes"
;;
--draft|-draft)
draft="yes"
;;
--linux|-linux|--linuxabi|-linuxabi)
linux="yes"
;;
--eabi|-eabi)
eabi="yes"
;;
--unified|-unified|--unifiedabi|-unifiedabi)
unified="yes"
;;
--tag*|-tag*)
tagid="yes"
;;
esac
done
if test ! -e colordef.dsl; then
wget "http://www.cranesoftwrights.com/resources/color/colordef.dsl" -O colordef.dsl
fi
#DATE=`date +%Y-%m-%d`
VERSION=`grep "entity specversion" PPC-elf32abi.sgml | awk -F' ' '{print $3}' | sed 's/\"\([0-9]*.[0-9]*\)\">/\1/'`
if test ! -z "$unified"; then
echo jw -b pdf PPC-elf32abi.sgml -d 'abi.dsl#print' -i UNIFIED${draft:+ -i DRAFT}${wrapper:+ -i WRAPPER}${tagid:+ -i TAGID}
jw -b pdf PPC-elf32abi.sgml -d 'abi.dsl#print' -i UNIFIED${draft:+ -i DRAFT}${wrapper:+ -i WRAPPER}${tagid:+ -i TAGID}
if test -e "PPC-elf32abi.pdf"; then
mv PPC-elf32abi.pdf ${DATE:${DATE}-}${draft:+Draft-}Power-Arch-32-bit-ABI-supp-${VERSION}-Unified.pdf
fi
fi
if test ! -z "$linux"; then
jw -b pdf PPC-elf32abi.sgml -d 'abi.dsl#print' -i LINUX${draft:+ -i DRAFT}${wrapper:+ -i WRAPPER}${tagid:+ -i TAGID}
if test -e "PPC-elf32abi.pdf"; then
mv PPC-elf32abi.pdf ${DATE:${DATE}-}${draft:+Draft-}Power-Arch-32-bit-ABI-supp-${VERSION}-Linux.pdf
fi
fi
if test ! -z "$eabi"; then
jw -b pdf PPC-elf32abi.sgml -d 'abi.dsl#print' -i EABI${draft:+ -i DRAFT}${wrapper:+ -i WRAPPER}${tagid:+ -i TAGID}
if test -e "PPC-elf32abi.pdf"; then
mv PPC-elf32abi.pdf ${DATE:${DATE}-}${draft:+Draft-}Power-Arch-32-bit-ABI-supp-${VERSION}-Embedded.pdf
fi
fi