-bin_SCRIPTS = srt2vtt
+GOBJECTS = $(SOURCES:%.scm=%.go)
+
+nobase_mod_DATA = $(SOURCES)
+nobase_go_DATA = $(GOBJECTS)
+
+# Make sure source files are installed first, so that the mtime of
+# installed compiled files is greater than that of installed source
+# files. See
+# <http://lists.gnu.org/archive/html/guile-devel/2010-07/msg00125.html>
+# for details.
+guile_install_go_files = install-nobase_goDATA
+$(guile_install_go_files): install-nobase_modDATA
+
+GUILE_WARNINGS = -Wunbound-variable -Warity-mismatch -Wformat
+SUFFIXES = .scm .go
+.scm.go:
+ $(AM_V_GEN)$(top_builddir)/pre-inst-env $(GUILE_TOOLS) compile $(GUILE_WARNINGS) -o "$@" "$<"
+
+moddir=$(prefix)/share/guile/site/2.0
+godir=$(libdir)/guile/2.0/ccache
+
+SOURCES = \
+ srt2vtt.scm \
+ srt2vtt/subrip.scm \
+ srt2vtt/webvtt.scm \
+ srt2vtt/ui.scm
+
+TESTS = \
+ tests/subrip.scm \
+ tests/webvtt.scm
+
+TEST_EXTENSIONS = .scm
+
+SCM_LOG_COMPILER = $(GUILE)
+AM_SCM_LOG_FLAGS = --no-auto-compile -L $(top_srcdir)
+
+CLEANFILES = \
+ $(GOBJECTS) \
+ $(TESTS:tests/%.scm=%.log)
+
+EXTRA_DIST = \
+ $(SOURCES) \
+ $(TESTS) \
+ tests/utils.scm \
+ pre-inst-env.in
+
+dist_bin_SCRIPTS = scripts/srt2vtt