]> gitweb.michael.orlitzky.com - charm-bypass.git/blob - Makefile.am
Makefile.am: use scour to optimize the SVG as part of the build
[charm-bypass.git] / Makefile.am
1 EXTRA_DIST = doc src
2
3 # List of element IDs that we use in the HTML document.
4 PRECIOUS_IDS = \
5 bus \
6 city \
7 citycopy \
8 clouds \
9 cloudscopy \
10 train \
11 tram \
12 trees \
13 treescopy \
14 serviceletter \
15 servicename \
16 sky \
17 ticketdate \
18 tickettime
19
20 # Optimize our SVG, and remove its XML prologue so that it can be
21 # included directly into the HTML document.
22 day.svg: src/day.svg
23 @SCOUR@ --protect-ids-list=$$(echo $(PRECIOUS_IDS) | tr ' ' ',') \
24 --enable-id-stripping \
25 --enable-comment-stripping \
26 --remove-descriptive-elements \
27 --no-renderer-workaround \
28 --strip-xml-prolog \
29 --no-line-breaks \
30 --error-on-flowtext \
31 $< > $@
32
33 # Base64-encode a woff2 (web open font format 2.0) file. We use this
34 # to embed fonts directly into the CSS that requires them.
35 CharmBypass-Regular.base64: src/CharmBypass-Regular.woff2
36 @BASE64@ -w0 $< > $@
37 CharmBypass-Bold.base64: src/CharmBypass-Bold.woff2
38 @BASE64@ -w0 $< > $@
39
40 # Build index.html by substituting the contents of a few (single
41 # line!) files into @PLACEHOLDERS@ within src/index.html.in. If you
42 # put tildes in src/day.svg this will probably break, so please don't
43 # do that.
44 index.html: src/index.html.in day.svg CharmBypass-Regular.base64 CharmBypass-Bold.base64
45 sed -e "s~@CBPREGULAR@~$$(cat CharmBypass-Regular.base64)~" \
46 -e "s~@CBPBOLD@~$$(cat CharmBypass-Bold.base64)~" \
47 -e "s~@SVGDATA@~$$(cat day.svg)~" \
48 $< > $@
49
50 # If you really want to, we support installing index.html
51 # to (say) /usr/share/charm-bypass/index.html.
52 dist_pkgdata_DATA = index.html
53
54 # Automake doesn't understand our wacky build process so we have to
55 # tell it which files are produced by running "make"
56 CLEANFILES = $(dist_pkgdata_DATA) CharmBypass-Regular.base64 CharmBypass-Bold.base64 day.svg