11 # GNU General Public License for more details. |
11 # GNU General Public License for more details. |
12 # |
12 # |
13 # You should have received a copy of the GNU General Public License |
13 # You should have received a copy of the GNU General Public License |
14 # along with this program. If not, see <https://www.gnu.org/licenses/>. |
14 # along with this program. If not, see <https://www.gnu.org/licenses/>. |
15 |
15 |
|
16 VERSION_PARAMS := $(shell hg log -r '.' --template '--stringparam versionTag {latesttag} --stringparam versionDistance {latesttagdistance} --stringparam versionHash {node|short}') |
|
17 |
16 all: validate xhtml txt pdf logo-png statistics |
18 all: validate xhtml txt pdf logo-png statistics |
17 |
19 |
18 validate: |
20 validate: |
19 xmllint --noout --schema schema/ssm.xsd text/ssm.en.xml |
21 xmllint --noout --schema schema/ssm.xsd text/ssm.en.xml |
20 |
22 |
21 xhtml: |
23 xhtml: |
22 mkdir -p build |
24 mkdir -p build |
23 xsltproc --output build/index.xhtml --nonet templates/ssm.xhtml.xsl text/ssm.en.xml |
25 xsltproc $(VERSION_PARAMS) --output build/index.xhtml --nonet templates/ssm.xhtml.xsl text/ssm.en.xml |
24 cp templates/*.css build |
26 cp templates/*.css build |
25 cp templates/*.woff build |
27 cp templates/*.woff build |
26 |
28 |
27 pdf: |
29 pdf: |
28 mkdir -p build |
30 mkdir -p build |
29 xsltproc --output build/ssm.en.fodt --nonet templates/ssm.odt.xsl text/ssm.en.xml |
31 xsltproc $(VERSION_PARAMS) --output build/ssm.en.fodt --nonet templates/ssm.odt.xsl text/ssm.en.xml |
30 libreoffice --convert-to pdf --outdir build build/ssm.en.fodt |
32 libreoffice --convert-to pdf --outdir build build/ssm.en.fodt |
31 |
33 |
32 # TODO: better line wrapping |
34 # TODO: better line wrapping |
33 txt: |
35 txt: |
34 mkdir -p build |
36 mkdir -p build |
35 xsltproc --nonet templates/ssm.txt.xsl text/ssm.en.xml | fmt -w 74 -s | sed -E 's/( +)([^- ])/\1 \2/g' > build/ssm.en.txt |
37 xsltproc $(VERSION_PARAMS) --nonet templates/ssm.txt.xsl text/ssm.en.xml | fmt -w 74 -s | sed -E 's/( +)([^- ])/\1 \2/g' > build/ssm.en.txt |
36 |
38 |
37 logo-png: |
39 logo-png: |
38 mkdir -p build |
40 mkdir -p build |
39 inkscape -z -e build/sane-software-logo-circle.png logo/sane-software-logo-circle.svg |
41 inkscape -z -e build/sane-software-logo-circle.png logo/sane-software-logo-circle.svg |
40 inkscape -z -e build/sane-software-logo-rectangle.png logo/sane-software-logo-rectangle.svg |
42 inkscape -z -e build/sane-software-logo-rectangle.png logo/sane-software-logo-rectangle.svg |