[Telepathy-commits] [telepathy-sofiasip/master] Made source generation rules more robust

Mikhail Zabaluev mikhail.zabaluev at nokia.com
Mon Nov 17 07:53:58 PST 2008


In case of a tool failure, the output file is removed.
---
 src/Makefile.am   |   12 ++++++------
 tpsip/Makefile.am |    4 ++--
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/src/Makefile.am b/src/Makefile.am
index d7548a3..753bd0d 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1,8 +1,8 @@
 #
 # Makefile.am for telepathy-sofiasip/src
 #
-# Copyright (C) 2006 Nokia Corporation
-# Contact: Kai Vehmanen <first.surname at nokia.com>
+# Copyright (C) 2006-2008 Nokia Corporation
+# Contact: Mikhail Zabaluev <mikhail.zabaluev at nokia.com>
 # Licensed under LGPL. See file COPYING.
 #
 
@@ -34,10 +34,10 @@ noinst_LTLIBRARIES = libtpsip-convenience.la
 # Rules for building the targets
 
 signals-marshal.c: ${srcdir}/signals-marshal.list
-	glib-genmarshal --body --prefix=_tpsip_marshal $< >$@
+	glib-genmarshal --body --prefix=_tpsip_marshal $< >$@ || rm -f $@
 
 signals-marshal.h: ${srcdir}/signals-marshal.list
-	glib-genmarshal --header --prefix=_tpsip_marshal $< >$@
+	glib-genmarshal --header --prefix=_tpsip_marshal $< >$@ || rm -f $@
 
 # rules for makeing the glib enum objects
 %-enumtypes.h: %.h
@@ -46,7 +46,7 @@ signals-marshal.h: ${srcdir}/signals-marshal.list
 	--fprod "/* enumerations from \"@filename@\" */\n" \
 	--vhead "GType @enum_name at _get_type (void);\n#define $(shell echo $* | tr [:lower:]- [:upper:]_ | sed 's/_.*//')_TYPE_ at ENUMSHORT@ (@enum_name at _get_type())\n"         \
 	--ftail "G_END_DECLS\n\n#endif /* __$(shell echo $* | tr [:lower:]- [:upper:]_)_ENUM_TYPES_H__ */" \
-	$< > $@
+	$< > $@ || rm -f $@
 
 %-enumtypes.c: %.h
 	glib-mkenums \
@@ -55,7 +55,7 @@ signals-marshal.h: ${srcdir}/signals-marshal.list
 	--vhead "GType\n at enum_name@_get_type (void)\n{\n  static GType etype = 0;\n  if (etype == 0) {\n    static const G at Type@Value values[] = {"     \
 	--vprod "      { @VALUENAME@, \"@VALUENAME@\", \"@valuenick@\" }," \
 	--vtail "      { 0, NULL, NULL }\n    };\n    etype = g_ at type@_register_static (\"@EnumName@\", values);\n  }\n  return etype;\n}\n" \
-	$< > $@
+	$< > $@ || rm -f $@
 
 sofiasip.manager: write-mgr-file
 	if ./write-mgr-file > $@.tmp; then \
diff --git a/tpsip/Makefile.am b/tpsip/Makefile.am
index 0160b31..075ce49 100644
--- a/tpsip/Makefile.am
+++ b/tpsip/Makefile.am
@@ -33,7 +33,7 @@ EXTRA_DIST = signals-marshal.list
 CLEANFILES = $(BUILT_SOURCES)
 
 signals-marshal.c: ${srcdir}/signals-marshal.list
-	glib-genmarshal --body --prefix=_tpsip_marshal $< >$@
+	glib-genmarshal --body --prefix=_tpsip_marshal $< >$@ || rm -f $@
 
 signals-marshal.h: ${srcdir}/signals-marshal.list
-	glib-genmarshal --header --prefix=_tpsip_marshal $< >$@
+	glib-genmarshal --header --prefix=_tpsip_marshal $< >$@ || rm -f $@
-- 
1.5.6.5




More information about the Telepathy-commits mailing list