build: Fix srcdir != builddir
authorColin Walters <walters@verbum.org>
Mon, 14 Dec 2015 19:19:35 +0000 (14:19 -0500)
committerColin Walters <walters@verbum.org>
Mon, 14 Dec 2015 19:19:35 +0000 (14:19 -0500)
Caught by GContinuous.  Also change the file writes to be atomic,
otherwise we're not Ctrl-c safe.

Makefile-libostree.am

index 41976ffb560a59b0b3d00f2b1d81e732326adfaa..238cb0b45c2d8a458ae5e99208eeacb9ff617b8e 100644 (file)
@@ -34,19 +34,19 @@ libostreeincludedir = $(includedir)/ostree-1
 libostreeinclude_HEADERS = $(libostree_public_headers)
 
 ENUM_TYPES = \
-       src/libostree/ostree-fetcher.h \
+       $(srcdir)/src/libostree/ostree-fetcher.h \
        $(NULL)
 
 src/libostree/ostree-enumtypes.h: src/libostree/ostree-enumtypes.h.template $(ENUM_TYPES)
        $(AM_V_GEN) $(GLIB_MKENUMS) \
-       --template src/libostree/ostree-enumtypes.h.template \
-       $(ENUM_TYPES) > $@
+       --template $< \
+       $(ENUM_TYPES) > $@.tmp && mv $@.tmp $@
 
 src/libostree/ostree-enumtypes.c: src/libostree/ostree-enumtypes.c.template $(ENUM_TYPES)
        $(AM_V_GEN) $(GLIB_MKENUMS) \
-       --template src/libostree/ostree-enumtypes.c.template \
+       --template $< \
        --fhead "#include \"ostree-enumtypes.h\"" \
-       $(ENUM_TYPES) > $@
+       $(ENUM_TYPES) > $@.tmp && mv $@.tmp $@
 
 ENUM_GENERATED = \
        src/libostree/ostree-enumtypes.h \
@@ -136,7 +136,7 @@ libostree_1_la_SOURCES += \
        $(NULL)
 endif
 
-libostree_1_la_CFLAGS = $(AM_CFLAGS) -I$(srcdir)/bsdiff -I$(srcdir)/libglnx -I$(srcdir)/src/libotutil -I$(srcdir)/src/libostree \
+libostree_1_la_CFLAGS = $(AM_CFLAGS) -I$(srcdir)/bsdiff -I$(srcdir)/libglnx -I$(srcdir)/src/libotutil -I$(srcdir)/src/libostree -I$(builddir)/src/libostree \
        $(OT_INTERNAL_GIO_UNIX_CFLAGS) $(OT_INTERNAL_GPGME_CFLAGS) $(OT_DEP_LZMA_CFLAGS) $(OT_DEP_ZLIB_CFLAGS)
 libostree_1_la_LDFLAGS = -version-number 1:0:0 -Bsymbolic-functions -export-symbols-regex '^ostree_'
 libostree_1_la_LIBADD = libotutil.la libbupsplit.la libglnx.la libbsdiff.la libostree-kernel-args.la $(OT_INTERNAL_GIO_UNIX_LIBS) $(OT_INTERNAL_GPGME_LIBS) $(OT_DEP_LZMA_LIBS) $(OT_DEP_ZLIB_LIBS)