]> git.draconx.ca Git - upkg.git/blobdiff - Makefile.am
libupkg: Make decodeindex test accept an empty string.
[upkg.git] / Makefile.am
index f8238b2370ae0a82a37bb0d8fc82e579bd9f2811..fed99c164e25cdc88871d592c9ac63ba1ce6fb7e 100644 (file)
@@ -1,3 +1,110 @@
+# Copyright © 2009-2012 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.
+# There is NO WARRANTY, to the extent permitted by law.
+
+AUTOMAKE_OPTIONS = parallel-tests color-tests
 ACLOCAL_AMFLAGS = -I m4
+MAINTAINERCLEANFILES =
+MOSTLYCLEANFILES =
+CLEANFILES =
+
+EXTRA_DIST = $(MAINTAINERCLEANFILES) m4/gnulib-cache.m4
+
+AM_CPPFLAGS = -I$(top_builddir)/src -I$(top_srcdir)/src \
+       -I$(top_builddir)/lib -I$(top_srcdir)/lib \
+       -DPKGLIBDIR=\"$(pkglibdir)\" -DPKGDATADIR=\"$(pkgdatadir)\"
+
+AM_CFLAGS = $(LTDLINCL) $(GLIB_CFLAGS) $(LIBMODPLUG_CFLAGS)
+
+bin_PROGRAMS = upkg
+lib_LTLIBRARIES = libupkg.la libuobject.la
+pkglib_LTLIBRARIES = engine.la
+noinst_LTLIBRARIES =
+EXTRA_LTLIBRARIES =
+include_HEADERS =
+
+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
+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
+
+uobjectdir = $(includedir)/uobject
+uobject_HEADERS = src/uobject/uobject.h src/uobject/exportable.h \
+       src/uobject/loadable.h src/uobject/module.h src/uobject/package.h \
+       src/uobject/vfs.h
+
+libuobject_la_SOURCES = src/uobject/uobject.c src/uobject/module.c \
+       src/uobject/avl.c src/uobject/avl.h src/uobject/package.c \
+       src/uobject/exportable.c src/uobject/loadable.c src/uobject/vfs.c
+libuobject_la_LDFLAGS  = $(AM_LDFLAGS) -export-symbols-regex '^u_'
+libuobject_la_LIBADD   = libgnu.la $(LIBLTDL) $(GLIB_LIBS)
+$(libuobject_la_OBJECTS): $(gnulib_headers)
+
+libuobject_la = libuobject.la
+$(libuobject_la): $(LTDLDEPS)
+
+moduleflags = -module -avoid-version -export-symbols-regex _LTX_
+
+engine_GOBS = src/engine/palette.gob src/engine/texture.gob \
+       src/engine/music.gob
+
+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
+engine_la_LDFLAGS  = $(AM_LDFLAGS) $(moduleflags)
+engine_la_LIBADD   = $(GLIB_LIBS)
+$(engine_la_OBJECTS): $(orderonly) $(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_decodeindex_LDADD = libupkg.la libgnu.la
+$(test_decodeindex_OBJECTS): $(gnulib_headers)
+
+TESTS_ENVIRONMENT = SHELL='$(SHELL)' EXEEXT='$(EXEEXT)'
+TEST_EXTENSIONS = .sh
+SH_LOG_COMPILER = $(SHELL)
+
+TESTS = tests/libupkg-index-decode.sh
+EXTRA_DIST += $(TESTS)
+
+# Supporting rules for GObject Builder
+GOB_V   = $(GOB_V_$(V))
+GOB_V_  = $(GOB_V_$(AM_DEFAULT_VERBOSITY))
+GOB_V_0 = @echo "  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:
+       $(GOB_V) $(GOB2) -o src --file-sep=/ --no-private-header $<
+       $(AM_V_at) touch $@
+
+STAMP_RECOVER = \
+       @if test -f $@; then :; else rm -f $<; $(MAKE) $(AM_MAKEFLAGS) $<; fi
+.gobstamp.c: ; $(STAMP_RECOVER)
+.gobstamp.h: ; $(STAMP_RECOVER)
 
-SUBDIRS = src
+include $(top_srcdir)/lib/gnulib.mk
+if BUNDLED_LIBLTDL
+include $(top_srcdir)/libltdl/ltdl.mk
+endif