Updated the build system to use a build directory and a common marshal Makefile.
authorMikael Hallendal <micke@imendio.com>
Fri, 10 Oct 2008 23:13:03 +0200
changeset 521 50294ce6587e
parent 520 b7d00ada8857
child 522 0cc51238d83e
Updated the build system to use a build directory and a common marshal Makefile. Inspired by Richards commit to Devhelp in order to clean up the build system a bit. Makefile setup for generating signal marshal are now defined in build/Makefile.am.marshal which is included in the loudmough/Makefile.am file.
build/Makefile.am.common
build/Makefile.am.marshal
configure.ac
loudmouth/Makefile.am
loudmouth/lm-dummy.c
loudmouth/lm-feature-ping.c
loudmouth/lm-marshal-main.c
loudmouth/lm-socket.c
loudmouth/lm-tcp-socket.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/build/Makefile.am.common	Fri Oct 10 23:13:03 2008 +0200
@@ -0,0 +1,9 @@
+BUILT_SOURCES =
+CLEANFILES =
+DISTCLEANFILES =
+EXTRA_DIST =
+MAINTAINERCLEANFILES =
+
+CLEANFILES += $(BUILT_SOURCES)
+MAINTAINERCLEANFILES += Makefile.in
+AM_CPPFLAGS = -I$(top_srcdir)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/build/Makefile.am.marshal	Fri Oct 10 23:13:03 2008 +0200
@@ -0,0 +1,21 @@
+$(MARSHAL)-marshal.h: $(MARSHAL)-marshal.list
+	(cd $(srcdir) && \
+	$(GLIB_GENMARSHAL) --prefix=_$(MARSHAL)_marshal $(MARSHAL)-marshal.list --header) > xgen-gmh \
+	&& (cmp -s xgen-gmh $(MARSHAL)-marshal.h || cp xgen-gmh $(MARSHAL)-marshal.h) \
+	&& rm -f xgen-gmh xgen-gmh~
+
+$(MARSHAL)-marshal.c: $(MARSHAL)-marshal.list
+	(cd $(srcdir) && \
+	echo "#include \"$(MARSHAL)-marshal.h\""; \
+	$(GLIB_GENMARSHAL) --prefix=_$(MARSHAL)_marshal $(MARSHAL)-marshal.list --body) > xgen-gmc \
+	&& cp xgen-gmc $(MARSHAL)-marshal.c \
+	&& rm -f xgen-gmc xgen-gmc~
+
+BUILT_SOURCES += 			\
+	$(MARSHAL)-marshal.h		\
+	$(MARSHAL)-marshal.c		\
+	$(NULL)
+
+EXTRA_DIST +=				\
+	$(MARSHAL)-marshal.list		\
+	$(NULL)
--- a/configure.ac	Fri Oct 10 20:31:18 2008 +0200
+++ b/configure.ac	Fri Oct 10 23:13:03 2008 +0200
@@ -1,14 +1,15 @@
-AC_INIT(Loudmouth, 1.5.0, loudmouth)
-AC_PREREQ(2.59)
+AC_PREREQ(2.60)
+AC_INIT([Loudmouth], [1.5.0], [http://loudmouth.lighthouseapp.com/projects/17276-libloudmouth/tickets/new], [loudmouth])
 AC_COPYRIGHT([
-	Copyright (C) 2003-2007 Imendio AB
+	Copyright (C) 2003-2008 Imendio AB
 	Copyright (C) 2007 Collabora Ltd
 	Copyright (C) 2007 Nokia Corporation
 ])
 
 AC_CONFIG_SRCDIR(loudmouth/loudmouth.h)
-AM_CONFIG_HEADER(config.h)
-AM_INIT_AUTOMAKE(1.9 dist-bzip2 no-define)
+AC_CONFIG_HEADERS(config.h)
+AC_CONFIG_AUX_DIR(build)
+AM_INIT_AUTOMAKE([1.9 dist-bzip2 no-define -Wall])
 
 AM_MAINTAINER_MODE
 
--- a/loudmouth/Makefile.am	Fri Oct 10 20:31:18 2008 +0200
+++ b/loudmouth/Makefile.am	Fri Oct 10 23:13:03 2008 +0200
@@ -1,4 +1,6 @@
 include $(top_srcdir)/Makefile.decl
+include $(top_srcdir)/build/Makefile.am.common
+include $(top_srcdir)/build/Makefile.am.marshal
 
 NULL=
 
@@ -38,7 +40,8 @@
 	lm-dummy.c                      \
 	lm-dummy.h                      \
 	lm-error.c			\
-	lm-marshal-main.c               \
+	lm-marshal.c               \
+	lm-marshal.h                    \
 	lm-message.c	 		\
 	lm-message-handler.c		\
 	lm-message-node.c		\
@@ -113,19 +116,7 @@
 	-export-symbols $(srcdir)/loudmouth.sym
 libloudmouthincludedir = $(includedir)/loudmouth-1.0/loudmouth
 
-lm-marshal.h: lm-marshal.list
-	(cd $(srcdir) && \
-	$(GLIB_GENMARSHAL) --prefix=lm_marshal lm-marshal.list --header) > xgen-gmh \
-	&& (cmp -s xgen-gmh lm-marshal.h || cp xgen-gmh lm-marshal.h) \
-	&& rm -f xgen-gmh xgen-gmh~
-
-lm-marshal.c: lm-marshal.list
-	(cd $(srcdir) && \
-	$(GLIB_GENMARSHAL) --prefix=lm_marshal lm-marshal.list --body) > xgen-gmc \
-	&& cp xgen-gmc lm-marshal.c \
-	&& rm -f xgen-gmc xgen-gmc~
-
-lm-marshal-main.c: lm-marshal.c lm-marshal.h
+MARSHAL=lm
 
 BUILT_SOURCES =				\
 	lm-marshal.h			\
--- a/loudmouth/lm-dummy.c	Fri Oct 10 20:31:18 2008 +0200
+++ b/loudmouth/lm-dummy.c	Fri Oct 10 23:13:03 2008 +0200
@@ -77,7 +77,7 @@
                       G_SIGNAL_RUN_LAST,
                       0,
                       NULL, NULL,
-                      lm_marshal_VOID__INT,
+                      _lm_marshal_VOID__INT,
                       G_TYPE_NONE, 
                       1, G_TYPE_INT);
     
--- a/loudmouth/lm-feature-ping.c	Fri Oct 10 20:31:18 2008 +0200
+++ b/loudmouth/lm-feature-ping.c	Fri Oct 10 23:13:03 2008 +0200
@@ -103,7 +103,7 @@
                       G_SIGNAL_RUN_LAST,
                       0,
                       NULL, NULL,
-                      lm_marshal_VOID__VOID,
+                      _lm_marshal_VOID__VOID,
                       G_TYPE_NONE, 0);
     
     g_type_class_add_private (object_class, sizeof (LmFeaturePingPriv));
--- a/loudmouth/lm-marshal-main.c	Fri Oct 10 20:31:18 2008 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,2 +0,0 @@
-#include "lm-marshal.h"
-#include "lm-marshal.c"
--- a/loudmouth/lm-socket.c	Fri Oct 10 20:31:18 2008 +0200
+++ b/loudmouth/lm-socket.c	Fri Oct 10 23:13:03 2008 +0200
@@ -69,7 +69,7 @@
                           G_SIGNAL_RUN_LAST,
                           0,
                           NULL, NULL,
-                          lm_marshal_VOID__VOID,
+                          _lm_marshal_VOID__VOID,
                           G_TYPE_NONE,
                           0);
         signals[WRITABLE] = 
@@ -78,7 +78,7 @@
                           G_SIGNAL_RUN_LAST,
                           0,
                           NULL, NULL,
-                          lm_marshal_VOID__VOID,
+                          _lm_marshal_VOID__VOID,
                           G_TYPE_NONE,
                           0);
         signals[DISCONNECTED] =
@@ -87,7 +87,7 @@
                           G_SIGNAL_RUN_LAST,
                           0,
                           NULL, NULL,
-                          lm_marshal_VOID__VOID,
+                          _lm_marshal_VOID__VOID,
                           G_TYPE_NONE,
                           0);
         initialized = TRUE;
--- a/loudmouth/lm-tcp-socket.c	Fri Oct 10 20:31:18 2008 +0200
+++ b/loudmouth/lm-tcp-socket.c	Fri Oct 10 23:13:03 2008 +0200
@@ -90,7 +90,7 @@
                       G_SIGNAL_RUN_LAST,
                       0,
                       NULL, NULL,
-                      lm_marshal_VOID__INT,
+                      _lm_marshal_VOID__INT,
                       G_TYPE_NONE, 
                       1, G_TYPE_INT);