]> git.draconx.ca Git - upkg.git/blobdiff - Makefile.am
Use GLib detection macros from dxcommon.
[upkg.git] / Makefile.am
index 74463a40b3df59a1a061ba61561aaedf7f7f5e4f..b1330d05cd1dfa0a9e94fbf3173d2271ea070e65 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright © 2009-2012, 2015 Nick Bowler
+# Copyright © 2009-2012, 2015, 2019-2020 Nick Bowler
 #
 # License WTFPL2: Do What The Fuck You Want To Public License, version 2.
 # This is free software: you are free to do what the fuck you want to.
@@ -8,11 +8,13 @@ AUTOMAKE_OPTIONS = parallel-tests color-tests
 ACLOCAL_AMFLAGS = -I m4 -I common/m4
 MAINTAINERCLEANFILES =
 MOSTLYCLEANFILES =
+DISTCLEANFILES =
 CLEANFILES =
 
 EXTRA_DIST = $(MAINTAINERCLEANFILES) m4/gnulib-cache.m4
 
 AM_CPPFLAGS = -I$(top_builddir)/src -I$(top_srcdir)/src \
+       -I$(top_srcdir)/$(DX_BASEDIR)/src \
        -I$(top_builddir)/lib -I$(top_srcdir)/lib \
        -DPKGLIBDIR=\"$(pkglibdir)\" -DPKGDATADIR=\"$(pkgdatadir)\"
 
@@ -31,12 +33,12 @@ dist_man_MANS = doc/man/upkg.1
 have_orderonly = $(findstring order-only,$(.FEATURES))
 orderonly = $(have_orderonly:order-only=|)
 
-upkg_SOURCES  = src/upkg.c
+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)
 
-libupkg_la_SOURCES = src/libupkg.c src/pack.c
+libupkg_la_SOURCES = src/libupkg.c common/src/pack.c common/src/pack.h
 
 uobjectdir = $(includedir)/uobject
 uobject_HEADERS = src/uobject/uobject.h src/uobject/exportable.h \
@@ -62,7 +64,10 @@ MAINTAINERCLEANFILES += $(engine_GOBS:.gob=.gobstamp) \
        $(engine_GOBS:.gob=.c) $(engine_GOBS:.gob=.h)
 
 engine_la_SOURCES = $(engine_GOBS:.gob=.c) $(engine_GOBS:.gob=.h) \
-       src/engine/engine.c src/engine/pcx.c
+       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): $(orderonly) $(engine_GOBS:.gob=.gobstamp)
@@ -79,7 +84,7 @@ endif
 check_LTLIBRARIES = libtest.la
 check_PROGRAMS = test/decodeindex test/pcxrle
 
-libtest_la_SOURCES = test/common.c
+libtest_la_SOURCES = test/common.c test/common.h
 
 test_decodeindex_LDADD = libupkg.la libgnu.la libtest.la
 $(test_decodeindex_OBJECTS): $(gnulib_headers)
@@ -102,8 +107,24 @@ GOB_V_0 = @printf '  %$(DX_ALIGN_V)s %s\n' 'GOB     ' $<;
 # 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