+engine_la_SOURCES = $(engine_GOBS:.gob=.c) $(engine_GOBS:.gob=.h) \
+ src/engine/engine.c \
+ src/engine/music-module.h \
+ src/engine/pcx.c \
+ src/engine/pcx.h
+engine_la_LDFLAGS = $(AM_LDFLAGS) $(moduleflags)
+engine_la_LIBADD = $(GLIB_LIBS)
+$(engine_la_OBJECTS): $(gnulib_headers) $(engine_GOBS:.gob=.gobstamp)
+
+if USE_DUMMYMOD
+engine_la_SOURCES += src/engine/music-dummymod.c
+endif
+
+if USE_LIBMODPLUG
+engine_la_SOURCES += src/engine/music-modplug.c src/engine/modplug-types.h
+engine_la_LIBADD += $(LIBMODPLUG_LIBS)
+endif
+
+check_PROGRAMS = test/decodeindex test/pcxrle
+check_LIBRARIES = libtest.a
+
+libtest_a_SOURCES = test/common.c test/common.h common/src/help.c
+$(libtest_a_OBJECTS): $(gnulib_headers)
+
+TEST_LIBS = libtest.a libgnu.la
+
+test_decodeindex_LDADD = libupkg.la $(TEST_LIBS)
+$(test_decodeindex_OBJECTS): $(gnulib_headers)
+test_pcxrle_LDADD = src/engine/pcx.lo libupkg.la $(TEST_LIBS)
+$(test_pcxrle_OBJECTS): $(gnulib_headers)
+
+EXTRA_DIST += tests/data/test0.utx tests/data/hatch2x2.pcx
+
+# 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
+ $(AM_V_at) touch $@.tmp
+ $(GOB_V) od='$(@D)'; case $$od in \
+ src/*) od=src ;; \
+ */src/*) od=$${od%/src/*}/src ;; \
+ esac; $(GOB2) -o "$$od" --file-sep=/ \
+ --no-private-header --no-touch-headers $<
+ $(AM_V_at) mv -f $@.tmp $@
+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