+if USE_LIBMODPLUG
+engine_la_SOURCES += src/engine/music-modplug.c src/engine/modplug-types.h
+engine_la_LIBADD += $(LIBMODPLUG_LIBS)
+endif
+
+check_LTLIBRARIES = libtest.la
+check_PROGRAMS = test/decodeindex test/pcxrle
+
+libtest_la_SOURCES = test/common.c test/common.h
+
+test_decodeindex_LDADD = libupkg.la libgnu.la libtest.la
+$(test_decodeindex_OBJECTS): $(gnulib_headers)
+test_pcxrle_LDADD = src/engine/pcx.lo libupkg.la libgnu.la libtest.la
+$(test_pcxrle_OBJECTS): $(gnulib_headers)
+
+TESTS_ENVIRONMENT = SHELL='$(SHELL)' EXEEXT='$(EXEEXT)'
+TEST_EXTENSIONS = .sh
+SH_LOG_COMPILER = $(SHELL)
+
+TESTS = tests/libupkg-index-decode.sh tests/engine-pcx-rlencode.sh
+EXTRA_DIST += $(TESTS)
+
+# Supporting rules for GObject Builder
+GOB_V = $(GOB_V_@AM_V@)
+GOB_V_ = $(GOB_V_@AM_DEFAULT_V@)
+GOB_V_0 = @printf ' %$(DX_ALIGN_V)s %s\n' 'GOB ' $<;
+
+# Unfortunately, GOB's output filenames depend on the contents of the gob file,
+# rather than its filename. This isn't really suitable for use with make, so
+# this rule has to make some assumptions about the source tree layout.
+.gob.gobstamp:
+if HAVE_GOB2_DYN
+ $(GOB_V) $(GOB2) -o src --file-sep=/ --no-private-header $<
+ $(AM_V_at) touch $@
+else
+if HAVE_GOB2
+ @echo "ERROR: *** $(GOB2) does not support dynamic types." 1>&2
+else
+ @echo "ERROR: *** gob2 is missing on your system." 1>&2
+endif
+ @:; { \
+ echo " *** Because of this, I cannot compile $<, but"; \
+ echo " *** (perhaps because you modified it) the sources appear out of date."; \
+ echo " *** A newer version of gob2 may be required; the latest version"; \
+ echo " *** may be found at <https://draconx.ca/projects/gob-dx/>."; \
+ echo " *** See config.log for more details."; \
+ } 1>&2
+ @false
+endif
+
+STAMP_RECOVER = \
+ @if test -f $@; then :; else rm -f $<; $(MAKE) $(AM_MAKEFLAGS) $<; fi
+.gobstamp.c: ; $(STAMP_RECOVER)
+.gobstamp.h: ; $(STAMP_RECOVER)
+
+include $(top_srcdir)/lib/gnulib.mk
+include $(top_srcdir)/libltdl/ltdl.mk