From b666cc1867e04d697f381fa8033803b9e7d0f61d Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Thu, 15 Oct 2009 21:12:52 -0500 Subject: Building a basic library starting out. --- src/Makefile.am | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) (limited to 'src/Makefile.am') diff --git a/src/Makefile.am b/src/Makefile.am index 2139b62..bcaba37 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -32,6 +32,39 @@ indicator_custom_service_CFLAGS = \ indicator_custom_service_LDADD = \ $(INDICATOR_LIBS) +################################## +# Library +################################## + +lib_LTLIBRARIES = \ + libcustomindicator.la + +libcustomindicatorincludedir=$(includedir)/libcustomindicator-0.1/libcustomindicator + +libcustomindicator_headers = \ + libcustomindicator/custom-indicator.h + +libcustomindicatorinclude_HEADERS = \ + $(libcustomindicator_headers) + +libcustomindicator_la_SOURCES = \ + $(libcustomindicator_headers) \ + notification-watcher-client.h \ + notification-item-server.h \ + libcustomindicator/custom-indicator.c + +libcustomindicator_la_LDFLAGS = \ + -version-info 0:0:0 \ + -no-undefined \ + -export-symbols-regex "^[^_d].*" + +libcustomindicator_la_CFLAGS = \ + $(INDICATOR_CFLAGS) \ + -Wall -Werror + +libcustomindicator_la_LIBADD = \ + $(INDICATOR_LIBS) + ################################## # DBus Specs ################################## -- cgit v1.2.3 From 5b8ab09e59342e7214117d2ebb02b89da6fa6503 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Fri, 16 Oct 2009 13:20:56 -0500 Subject: Setting up build to build the enums. --- src/Makefile.am | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) (limited to 'src/Makefile.am') diff --git a/src/Makefile.am b/src/Makefile.am index bcaba37..ca5de35 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,3 +1,9 @@ +CLEANFILES = +DISTCLEANFILES = +BUILT_SOURCES = +EXTRA_DIST = + +include $(top_srcdir)/Makefile.am.enum ################################## # Indicator @@ -36,6 +42,10 @@ indicator_custom_service_LDADD = \ # Library ################################## +glib_enum_h = libcustomindicator/custom-indicator-enum.h +glib_enum_c = libcustomindicator/custom-indicator-enum.c +glib_enum_headers = $(libcustomindicator_headers) + lib_LTLIBRARIES = \ libcustomindicator.la @@ -45,7 +55,8 @@ libcustomindicator_headers = \ libcustomindicator/custom-indicator.h libcustomindicatorinclude_HEADERS = \ - $(libcustomindicator_headers) + $(libcustomindicator_headers) \ + $(glib_enum_h) libcustomindicator_la_SOURCES = \ $(libcustomindicator_headers) \ @@ -87,10 +98,10 @@ DBUS_SPECS = \ --output=$@ \ $< -BUILT_SOURCES = \ +BUILT_SOURCES += \ $(DBUS_SPECS:.xml=-client.h) \ $(DBUS_SPECS:.xml=-server.h) -CLEANFILES = $(BUILT_SOURCES) +CLEANFILES += $(BUILT_SOURCES) -EXTRA_DIST = $(DBUS_SPECS) +EXTRA_DIST += $(DBUS_SPECS) -- cgit v1.2.3 From ba81d4a04a4291ad065c64f4fc79fd51c4b68bc9 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Fri, 16 Oct 2009 13:43:47 -0500 Subject: Putting in the enum templates and building them. --- .bzrignore | 3 ++ src/Makefile.am | 4 +-- .../custom-indicator-enum-types.c.in | 33 +++++++++++++++++++++ .../custom-indicator-enum-types.h.in | 34 ++++++++++++++++++++++ 4 files changed, 72 insertions(+), 2 deletions(-) create mode 100644 src/libcustomindicator/custom-indicator-enum-types.c.in create mode 100644 src/libcustomindicator/custom-indicator-enum-types.h.in (limited to 'src/Makefile.am') diff --git a/.bzrignore b/.bzrignore index a984427..9e04c16 100644 --- a/.bzrignore +++ b/.bzrignore @@ -11,3 +11,6 @@ src/notification-watcher-client.h src/notification-watcher-server.h src/libcustomindicator.la src/libcustomindicator_la-custom-indicator.lo +src/libcustomindicator/custom-indicator-enum-types.h +src/libcustomindicator/custom-indicator-enum-types.c +src/stamp-enum-types diff --git a/src/Makefile.am b/src/Makefile.am index ca5de35..4989c51 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -42,8 +42,8 @@ indicator_custom_service_LDADD = \ # Library ################################## -glib_enum_h = libcustomindicator/custom-indicator-enum.h -glib_enum_c = libcustomindicator/custom-indicator-enum.c +glib_enum_h = libcustomindicator/custom-indicator-enum-types.h +glib_enum_c = libcustomindicator/custom-indicator-enum-types.c glib_enum_headers = $(libcustomindicator_headers) lib_LTLIBRARIES = \ diff --git a/src/libcustomindicator/custom-indicator-enum-types.c.in b/src/libcustomindicator/custom-indicator-enum-types.c.in new file mode 100644 index 0000000..51512f6 --- /dev/null +++ b/src/libcustomindicator/custom-indicator-enum-types.c.in @@ -0,0 +1,33 @@ +/*** BEGIN file-header ***/ +#include "libcustomindicator/custom-indicator-enum-types.h" + +/*** END file-header ***/ + +/*** BEGIN file-production ***/ +#include "@filename@" +/*** END file-production ***/ + +/*** BEGIN value-header ***/ +GType +@enum_name@_get_type (void) +{ + static GType etype = 0; + if (G_UNLIKELY(etype == 0)) { + static const G@Type@Value values[] = { +/*** END value-header ***/ + +/*** BEGIN value-production ***/ + { @VALUENAME@, "@VALUENAME@", "@valuenick@" }, +/*** END value-production ***/ + +/*** BEGIN value-tail ***/ + { 0, NULL, NULL} + }; + + etype = g_@type@_register_static (g_intern_static_string("@EnumName@"), values); + } + + return etype; +} + +/*** END value-tail ***/ diff --git a/src/libcustomindicator/custom-indicator-enum-types.h.in b/src/libcustomindicator/custom-indicator-enum-types.h.in new file mode 100644 index 0000000..8afe619 --- /dev/null +++ b/src/libcustomindicator/custom-indicator-enum-types.h.in @@ -0,0 +1,34 @@ +/*** BEGIN file-header ***/ +#ifndef __CUSTOM_INDICATOR_ENUM_TYPES_H__ +#define __CUSTOM_INDICATOR_ENUM_TYPES_H__ + +#include + +G_BEGIN_DECLS + +/*** END file-header ***/ + +/*** BEGIN file-tail ***/ + +G_END_DECLS + +#endif /* __CUSTOM_INDICATOR_ENUM_TYPES_H__ */ +/*** END file-tail ***/ + +/*** BEGIN file-production ***/ +/* Enumerations from file: "@filename@" */ +/*** END file-production ***/ + +/*** BEGIN value-header ***/ +/** + @enum_name@_get_type: + + Builds a glib type for the @enum_name@ enumeration + defined in the file @filename@. + + Return value: A registered type for the enum +*/ +GType @enum_name@_get_type (void) G_GNUC_CONST; +#define CLUTTER_TYPE_@ENUMSHORT@ (@enum_name@_get_type()) + +/*** END value-header ***/ -- cgit v1.2.3 From d7e37560395505724e611326203b31e4649b773f Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Fri, 16 Oct 2009 14:08:47 -0500 Subject: Adding the C file into the build as well. --- src/Makefile.am | 1 + 1 file changed, 1 insertion(+) (limited to 'src/Makefile.am') diff --git a/src/Makefile.am b/src/Makefile.am index 4989c51..07f3887 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -60,6 +60,7 @@ libcustomindicatorinclude_HEADERS = \ libcustomindicator_la_SOURCES = \ $(libcustomindicator_headers) \ + $(glib_enum_c) \ notification-watcher-client.h \ notification-item-server.h \ libcustomindicator/custom-indicator.c -- cgit v1.2.3 From f4f482c9f5a87ac7544e45f53f02117a50abf2d6 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Fri, 16 Oct 2009 14:47:28 -0500 Subject: Some small changes to make 'distcheck' happy. --- Makefile.am.enum | 10 ++++++---- src/Makefile.am | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) (limited to 'src/Makefile.am') diff --git a/Makefile.am.enum b/Makefile.am.enum index 208dee3..0f1a637 100644 --- a/Makefile.am.enum +++ b/Makefile.am.enum @@ -24,10 +24,11 @@ BUILT_SOURCES += $(glib_enum_h) $(glib_enum_c) EXTRA_DIST += $(enum_tmpl_h) $(enum_tmpl_c) stamp-enum-types: $(glib_enum_headers) + mkdir -p `dirname $(builddir)/$(glib_enum_h)` $(QUIET_GEN)$(GLIB_MKENUMS) \ - --template $(enum_tmpl_h) \ + --template $(srcdir)/$(enum_tmpl_h) \ $(glib_enum_headers) > xgen-eh \ - && (cmp -s xgen-eh $(glib_enum_h) || cp -f xgen-eh $(glib_enum_h)) \ + && (cmp -s xgen-eh $(builddir)/$(glib_enum_h) || cp -f xgen-eh $(builddir)/$(glib_enum_h)) \ && rm -f xgen-eh \ && echo timestamp > $(@F) @@ -35,9 +36,10 @@ $(glib_enum_h): stamp-enum-types @true $(glib_enum_c): $(glib_enum_h) + mkdir -p `dirname $(builddir)/$(glib_enum_c)` $(QUIET_GEN)$(GLIB_MKENUMS) \ - --template $(enum_tmpl_c) \ + --template $(srcdir)/$(enum_tmpl_c) \ $(glib_enum_headers) > xgen-ec \ - && cp -f xgen-ec $(glib_enum_c) \ + && cp -f xgen-ec $(builddir)/$(glib_enum_c) \ && rm -f xgen-ec diff --git a/src/Makefile.am b/src/Makefile.am index 07f3887..ff5b26e 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -52,7 +52,7 @@ lib_LTLIBRARIES = \ libcustomindicatorincludedir=$(includedir)/libcustomindicator-0.1/libcustomindicator libcustomindicator_headers = \ - libcustomindicator/custom-indicator.h + $(srcdir)/libcustomindicator/custom-indicator.h libcustomindicatorinclude_HEADERS = \ $(libcustomindicator_headers) \ -- cgit v1.2.3