Fixed build when srcdir != builddir, made mkenums and friends use
authorYevgen Muntyan <muntyan@tamu.edu>
Fri, 14 Dec 2007 14:28:35 +0000 (14:28 +0000)
committerYevgen Muntyan <muntyan@src.gnome.org>
Fri, 14 Dec 2007 14:28:35 +0000 (14:28 +0000)
2007-12-14  Yevgen Muntyan  <muntyan@tamu.edu>

* gio/Makefile.am:
* gio/inotify/Makefile.am: Fixed build when srcdir != builddir,
made mkenums and friends use temporary files to avoid leaving
empty generated files on failure (#503470).

svn path=/trunk/; revision=6126

ChangeLog
gio/Makefile.am
gio/inotify/Makefile.am

index b3ebc28..0322035 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2007-12-14  Yevgen Muntyan  <muntyan@tamu.edu>
+
+       * gio/Makefile.am:
+       * gio/inotify/Makefile.am: Fixed build when srcdir != builddir,
+       made mkenums and friends use temporary files to avoid leaving
+       empty generated files on failure (#503470).
+
 2007-12-13  Mathias Hasselmann  <mathias@openismus.com>
 
        Give exmples in error message unsupported case-changing escape
index e5dd24d..e88ca33 100644 (file)
@@ -9,13 +9,16 @@ SUBDIRS += xdgmime
 endif
 
 gio.def: gio.symbols
-       (echo -e EXPORTS; $(CPP) -P -DINCLUDE_VARIABLES -DINCLUDE_INTERNAL_SYMBOLS -DG_OS_WIN32 -DALL_FILES - <$(srcdir)/gio.symbols | sed -e '/^$$/d' -e 's/^/ /' -e 's/G_GNUC_[^ ]*//g' | sort) > gio.def
+       (echo -e EXPORTS; $(CPP) -P -DINCLUDE_VARIABLES -DINCLUDE_INTERNAL_SYMBOLS -DG_OS_WIN32 -DALL_FILES - <$(srcdir)/gio.symbols | sed -e '/^$$/d' -e 's/^/ /' -e 's/G_GNUC_[^ ]*//g' | sort) > gio.def.tmp && \
+         mv gio.def.tmp gio.def
 
 gioalias.h: gio.symbols
-       $(PERL) $(srcdir)/makegioalias.pl < $(srcdir)/gio.symbols > gioalias.h
+       $(PERL) $(srcdir)/makegioalias.pl < $(srcdir)/gio.symbols > gioalias.h.tmp && \
+         mv gioalias.h.tmp gioalias.h
 
 gioaliasdef.c: gio.symbols
-       $(PERL) $(srcdir)/makegioalias.pl -def < $(srcdir)/gio.symbols > gioaliasdef.c
+       $(PERL) $(srcdir)/makegioalias.pl -def < $(srcdir)/gio.symbols > gioaliasdef.c.tmp && \
+         mv gioaliasdef.c.tmp gioaliasdef.c
 
 if OS_LINUX
 if HAVE_GNUC_VISIBILITY
@@ -48,11 +51,13 @@ else
 endif
 
 gio-marshal.h: gio-marshal.list
-       $(glib_genmarshal) --prefix=_gio_marshal $(srcdir)/gio-marshal.list --header > $@
+       $(glib_genmarshal) --prefix=_gio_marshal $(srcdir)/gio-marshal.list --header > $@.tmp && \
+         mv $@.tmp $@
 
 gio-marshal.c: gio-marshal.h gio-marshal.list
        (echo "#include \"gio-marshal.h\""; \
-       $(glib_genmarshal) --prefix=_gio_marshal $(srcdir)/gio-marshal.list --body) > $@
+       $(glib_genmarshal) --prefix=_gio_marshal $(srcdir)/gio-marshal.list --body) > $@.tmp && \
+         mv $@.tmp $@
 
 local_sources = \
        glocaldirectorymonitor.c        \
@@ -265,8 +270,11 @@ CLEANFILES =                       \
        $(NULL)
 
 gioenumtypes.h: $(gio_headers) gioenumtypes.h.template
-       ( cd $(srcdir) && $(top_builddir)/gobject/glib-mkenums --template gioenumtypes.h.template $(gio_headers) ) > gioenumtypes.h
-       
+       ( top_builddir=`cd $(top_builddir) && pwd`; \
+         cd $(srcdir) && $$top_builddir/gobject/glib-mkenums --template gioenumtypes.h.template $(gio_headers) ) > \
+           gioenumtypes.h.tmp && mv gioenumtypes.h.tmp gioenumtypes.h
+
 gioenumtypes.c: $(gio_headers) gioenumtypes.c.template
-       ( cd $(srcdir) && $(top_builddir)/gobject/glib-mkenums --template gioenumtypes.c.template $(gio_headers) ) > gioenumtypes.c
-       
+       ( top_builddir=`cd $(top_builddir) && pwd`; \
+         cd $(srcdir) && $$top_builddir/gobject/glib-mkenums --template gioenumtypes.c.template $(gio_headers) ) > \
+           gioenumtypes.c.tmp && mv gioenumtypes.c.tmp gioenumtypes.c
index 36d920a..2186d48 100644 (file)
@@ -31,6 +31,7 @@ libinotify_la_CFLAGS = \
        -I$(top_srcdir)/glib            \
        -I$(top_srcdir)/gmodule         \
        -I$(top_srcdir)/gio             \
+       -I$(top_builddir)/gio           \
        -DGIO_MODULE_DIR=\"$(GIO_MODULE_DIR)\"  \
        -DGIO_COMPILATION               \
        -DG_DISABLE_DEPRECATED