]> git.draconx.ca Git - upkg.git/blobdiff - src/engine/Makefile.inc
music: Migrate to GOB2.
[upkg.git] / src / engine / Makefile.inc
index 897ba2b4b297529e769f3731771d880a15c35453..a5ef99b51dd4dc9e6fa881c365aa469c7de98f19 100644 (file)
@@ -1,7 +1,33 @@
-noinst_HEADERS += engine/music.h engine/texture.h
+# Copyright 2009-2011 Nick Bowler
+# Copying and distribution of this file, with or without modification,
+# are permitted in any medium without royalty provided the copyright
+# notice and this notice are preserved.  This file is offered as-is,
+# without any warranty.
 
-lib_LTLIBRARIES   += engine.la
-engine_la_SOURCES  = engine/music.c engine/texture.c engine/engine.c
-engine_la_CFLAGS   = $(GLIB_CFLAGS)
-engine_la_LDFLAGS  = $(GLIB_LIBS)
-engine_la_LDFLAGS += -module -avoid-version -export-symbols-regex _LTX_
+noinst_HEADERS += engine/music-module.h
+
+engine_GOBS = engine/palette.gob engine/texture.gob engine/music.gob
+
+EXTRA_DIST += $(engine_GOBS) $(engine_GOBS:.gob=.gobstamp)
+noinst_HEADERS += $(engine_GOBS:.gob=.h)
+MAINTAINERCLEANFILES += $(engine_GOBS:.gob=.gobstamp) \
+       $(engine_GOBS:.gob=.c) $(engine_GOBS:.gob=.h)
+
+pkglib_LTLIBRARIES += engine.la
+engine_la_SOURCES   = engine/engine.c $(engine_GOBS:.gob=.c)
+engine_la_CFLAGS    = $(GLIB_CFLAGS)
+engine_la_LIBADD    = $(GLIB_LIBS)
+engine_la_LDFLAGS   = -module -avoid-version -export-symbols-regex _LTX_
+
+# Force all GOB objects to be generated before building anything.
+$(engine_la_OBJECTS): $(orderonly) $(engine_GOBS:.gob=.gobstamp)
+
+if USE_DUMMYMOD
+engine_la_SOURCES += engine/music-dummymod.c
+endif
+
+if USE_LIBMODPLUG
+engine_la_SOURCES += engine/music-modplug.c engine/modplug-types.h
+engine_la_CFLAGS  += $(LIBMODPLUG_CFLAGS)
+engine_la_LIBADD  += $(LIBMODPLUG_LIBS)
+endif