1 # If you really want to, we support installing index.html
2 # to (say) /usr/share/charm-bypass/index.html
3 dist_pkgdata_DATA = index.html
5 # A single POSIX shell script is our "test suite."
10 # https://www.gnu.org/software/automake/manual/html_node/Scripts.html
12 # this looks like the best way to include "sources" for things that
13 # aren't true programs/libraries.
16 CharmBypass-Regular.sfd \
17 CharmBypass-Bold.sfd \
24 # List of element IDs that we use in the HTML document.
49 # The base "scour" command used to optimize the tableau and favicon.
51 --enable-id-stripping \
52 --enable-comment-stripping \
53 --remove-descriptive-elements \
54 --no-renderer-workaround \
58 # Optimize the favicon using scour.
59 favicon.min.svg: favicon.svg
62 # Optimize the tableau once using XSL, to catch a few things that
63 # "scour" will miss...
64 tableau.min.svg: tableau.svg svgclean.xsl
65 @XSLTPROC@ $(srcdir)/svgclean.xsl $< > $@
67 # Optimize the tableau (again) using scour, removing its XML prologue
68 # so that it can be included directly into the HTML document.
69 tableau.min.min.svg: tableau.min.svg
70 $(SCOUR) --protect-ids-list=$$(echo $(PRECIOUS_IDS) | tr ' ' ',') \
74 # Use FontForge to convert the sfd source files to woff2.
76 @FONTFORGE@ -script $(srcdir)/sfd2woff.ff $< $@
78 # Base64-encode a woff2 (web open font format 2.0) file. We use this
79 # to embed fonts directly into the CSS that requires them.
83 # Same with the favicon SVG.
87 # List all of the dependencies of the final index.html that themselves
88 # had to be built. We collect them here because they need to be listed
89 # in two places, as dependencies of index.html, and in CLEANFILES.
90 index_html_BUILTDEPS = \
91 CharmBypass-Regular.base64 \
92 CharmBypass-Bold.base64 \
96 # Build index.html by substituting the contents of a few (single
97 # line!) files into @PLACEHOLDERS@ within index.html.in. If you put
98 # tildes in tableau.svg this will break, so please don't do that.
99 index.html: index.html.in $(index_html_BUILTDEPS)
100 sed -e "s~@CBPREGULAR@~$$(cat CharmBypass-Regular.base64)~" \
101 -e "s~@CBPBOLD@~$$(cat CharmBypass-Bold.base64)~" \
102 -e "s~@FAVICON@~$$(cat favicon.base64)~" \
103 -e "s~@SVGDATA@~$$(cat tableau.min.min.svg)~" \
106 # Automake doesn't understand our wacky build process so we have to
107 # tell it which files are produced by running "make".
109 $(dist_pkgdata_DATA) \
110 $(index_html_BUILTDEPS) \