]> git.draconx.ca Git - upkg.git/blobdiff - Makefile.am
Improve GOB rebuild rules for VPATH builds.
[upkg.git] / Makefile.am
index 495f40af87b39cdbf9c7ffe9a192592387f6d5c3..e5140a4679fddcccc4d4b2b9ddaa7e46a6aa2768 100644 (file)
@@ -47,7 +47,8 @@ uobject_HEADERS = src/uobject/uobject.h src/uobject/exportable.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
+       src/uobject/exportable.c src/uobject/loadable.c src/uobject/vfs.c \
+       src/uobject/primitives.c
 libuobject_la_LDFLAGS  = $(AM_LDFLAGS) -export-symbols-regex '^u_'
 libuobject_la_LIBADD   = libgnu.la $(LIBLTDL) $(GLIB_LIBS)
 $(libuobject_la_OBJECTS): $(gnulib_headers)
@@ -58,7 +59,7 @@ $(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 src/engine/sound.gob
+       src/engine/music.gob src/engine/sound.gob src/engine/mesh.gob
 
 MAINTAINERCLEANFILES += $(engine_GOBS:.gob=.gobstamp) \
        $(engine_GOBS:.gob=.c) $(engine_GOBS:.gob=.h)
@@ -107,8 +108,28 @@ 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:
-       $(GOB_V) $(GOB2) -o src --file-sep=/ --no-private-header $<
-       $(AM_V_at) touch $@
+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 $<
+       $(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
+endif
 
 STAMP_RECOVER = \
        @if test -f $@; then :; else rm -f $<; $(MAKE) $(AM_MAKEFLAGS) $<; fi