# This is free software: you are free to do what the fuck you want to.
# There is NO WARRANTY, to the extent permitted by law.
-AUTOMAKE_OPTIONS = parallel-tests color-tests
ACLOCAL_AMFLAGS = -I m4 -I common/m4
MAINTAINERCLEANFILES =
MOSTLYCLEANFILES =
dist_man_MANS = doc/man/upkg.1
-# This trick should define orderonly to | iff we're using GNU make.
-have_orderonly = $(findstring order-only,$(.FEATURES))
-orderonly = $(have_orderonly:order-only=|)
-
-upkg_SOURCES = src/upkg.c src/upkg.h
-upkg_LDFLAGS = $(AM_LDFLAGS) -export-dynamic
-upkg_LDADD = libuobject.la libupkg.la libgnu.la $(GLIB_LIBS)
-$(upkg_OBJECTS): $(gnulib_headers)
+upkg_SOURCES = src/upkg.c src/upkg.h src/upkgopts.h \
+ common/src/help.c common/src/help.h
+upkg_LDFLAGS = $(AM_LDFLAGS) -export-dynamic
+upkg_LDADD = libuobject.la libupkg.la libgnu.la $(GLIB_LIBS)
+$(upkg_OBJECTS): $(gnulib_headers) src/upkgopts.h
libupkg_la_SOURCES = src/libupkg.c common/src/pack.c common/src/pack.h
+$(libupkg_la_OBJECTS): $(gnulib_headers)
uobjectdir = $(includedir)/uobject
uobject_HEADERS = src/uobject/uobject.h src/uobject/exportable.h \
src/engine/pcx.h
engine_la_LDFLAGS = $(AM_LDFLAGS) $(moduleflags)
engine_la_LIBADD = $(GLIB_LIBS)
-$(engine_la_OBJECTS): $(orderonly) $(engine_GOBS:.gob=.gobstamp)
+$(engine_la_OBJECTS): $(gnulib_headers) $(engine_GOBS:.gob=.gobstamp)
if USE_DUMMYMOD
engine_la_SOURCES += src/engine/music-dummymod.c
engine_la_LIBADD += $(LIBMODPLUG_LIBS)
endif
-check_LTLIBRARIES = libtest.la
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)
-libtest_la_SOURCES = test/common.c test/common.h
+TEST_LIBS = libtest.a libgnu.la
-test_decodeindex_LDADD = libupkg.la libgnu.la libtest.la
+test_decodeindex_LDADD = libupkg.la $(TEST_LIBS)
$(test_decodeindex_OBJECTS): $(gnulib_headers)
-test_pcxrle_LDADD = src/engine/pcx.lo libupkg.la libgnu.la libtest.la
+test_pcxrle_LDADD = src/engine/pcx.lo libupkg.la $(TEST_LIBS)
$(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)
+EXTRA_DIST += tests/data/test0.utx tests/data/hatch2x2.pcx
# Supporting rules for GObject Builder
GOB_V = $(GOB_V_@AM_V@)
.gobstamp.c: ; $(STAMP_RECOVER)
.gobstamp.h: ; $(STAMP_RECOVER)
+OPTFILES = src/upkgopts.opt
+.opt.h:
+ $(AM_V_GEN) $(AWK) -f $(DX_BASEDIR)/scripts/gen-options.awk $< >$@.tmp
+ $(AM_V_at) mv -f $@.tmp $@
+$(OPTFILES:.opt=.h): $(DX_BASEDIR)/scripts/gen-options.awk
+MAINTAINERCLEANFILES += $(OPTFILES:.opt=.h)
+EXTRA_DIST += $(DX_BASEDIR)/scripts/gen-options.awk $(OPTFILES)
+
# The gob rules refrain from updating unchanged headers for the convenience of
# developers, but the headers should be distributed with up-to-date timestamps.
dist-hook: update-headers
include $(top_srcdir)/lib/gnulib.mk
include $(top_srcdir)/libltdl/ltdl.mk
+include $(top_srcdir)/common/snippet/autotest.mk