]> gitweb.michael.orlitzky.com - charm-bypass.git/blob - Makefile.am
3de169cebd8e9a7ae77221cc9d8cffd910b2e7d7
[charm-bypass.git] / Makefile.am
1 # List of element IDs that we use in the HTML document.
2 PRECIOUS_IDS = \
3 bus \
4 city \
5 citycopy \
6 codebg \
7 codetext \
8 clouds \
9 cloudscopy \
10 destination \
11 origin \
12 origindest \
13 train \
14 tram \
15 trees \
16 treescopy \
17 serviceid \
18 servicename \
19 sky \
20 ticket \
21 ticketbg \
22 ticketdate \
23 tickettime \
24 zone
25
26 SCOUR = @SCOUR@ --enable-id-stripping \
27 --enable-comment-stripping \
28 --remove-descriptive-elements \
29 --no-renderer-workaround \
30 --no-line-breaks \
31 --error-on-flowtext
32
33 # Optimize the favicon just like we do the tableau.
34 favicon.min.svg: favicon.svg
35 $(SCOUR) $< > $@
36
37 # Optimize our SVG once using XSL, to catch a few things
38 # that "scour" misses.
39 tableau.min.svg: tableau.svg svgclean.xsl
40 @XSLTPROC@ svgclean.xsl $< > $@
41
42 # Optimize our SVG again, and remove its XML prologue so that it can
43 # be included directly into the HTML document.
44 tableau.min.min.svg: tableau.min.svg
45 $(SCOUR) --protect-ids-list=$$(echo $(PRECIOUS_IDS) | tr ' ' ',') \
46 --strip-xml-prolog \
47 $< > $@
48
49 # Use FontForge to convert the sfd source files to woff2.
50 .sfd.woff2:
51 @FONTFORGE@ -script sfd2woff.ff $<
52
53 # Base64-encode a woff2 (web open font format 2.0) file. We use this
54 # to embed fonts directly into the CSS that requires them.
55 .woff2.base64:
56 @BASE64@ -w0 $< > $@
57
58 # Same with the favicon SVG.
59 .svg.base64:
60 @BASE64@ -w0 $< > $@
61
62 # Build index.html by substituting the contents of a few (single
63 # line!) files into @PLACEHOLDERS@ within index.html.in. If you put
64 # tildes in tableau.svg this will probably break, so please don't do
65 # that.
66 index.html: index.html.in tableau.min.min.svg CharmBypass-Regular.base64 CharmBypass-Bold.base64 favicon.base64
67
68 sed -e "s~@CBPREGULAR@~$$(cat CharmBypass-Regular.base64)~" \
69 -e "s~@CBPBOLD@~$$(cat CharmBypass-Bold.base64)~" \
70 -e "s~@FAVICON@~$$(cat favicon.base64)~" \
71 -e "s~@SVGDATA@~$$(cat tableau.min.min.svg)~" \
72 $< > $@
73
74 # If you really want to, we support installing index.html
75 # to (say) /usr/share/charm-bypass/index.html.
76 dist_pkgdata_DATA = index.html
77
78 # Automake doesn't understand our wacky build process so we have to
79 # tell it which files are produced by running "make"
80 CLEANFILES = $(dist_pkgdata_DATA) \
81 CharmBypass-Regular.base64 \
82 CharmBypass-Bold.base64 \
83 favicon.min.svg \
84 tableau.min.svg \
85 tableau.min.min.svg