[nautilus-sendto] Move enum types parsing to src/plugins



commit 5c824137b3b1df0d87e2841a2640c14bcbb2f57b
Author: Bastien Nocera <hadess hadess net>
Date:   Fri Aug 20 18:57:19 2010 +0100

    Move enum types parsing to src/plugins
    
    So it can be exported in the public library

 src/Makefile.am         |   26 --------------------------
 src/plugins/Makefile.am |   30 +++++++++++++++++++++++++++++-
 2 files changed, 29 insertions(+), 27 deletions(-)
---
diff --git a/src/Makefile.am b/src/Makefile.am
index ac36087..4609776 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -36,30 +36,4 @@ TEST_PROGS += test-mimetype
 test_mimetype_SOURCES = test-mimetype.c
 test_mimetype_LDADD = $(NAUTILUS_SENDTO_LIBS) libnstplugin.la $(builddir)/plugins/libnautilussendto-1.0.la
 
-nst_headers_to_scan_for_enums = plugins/nautilus-sendto-plugin.h
-# Generate the enums source code, with glib-mkenums:
-# This is based on the same Makefile.am stuff in pango:
-nst_built_headers = nst-enum-types.h
-nst_built_cfiles = nst-enum-types.c
-
-nst-enum-types.h: $(nst_headers_to_scan_for_enums) Makefile
-	$(AM_V_GEN) (cd $(srcdir) && glib-mkenums \
-			--fhead "#ifndef __NST_ENUM_TYPES_H__\n#define __NST_ENUM_TYPES_H__\n\n#include <glib-object.h>\n\nG_BEGIN_DECLS\n" \
-			--fprod "/* enumerations from \"@filename \" */\n" \
-			--vhead "GType @enum_name _get_type (void);\n#define NST_TYPE_ ENUMSHORT@ (@enum_name _get_type())\n" 	\
-			--ftail "G_END_DECLS\n\n#endif /* __NST_ENUM_TYPES_H__ */" \
-		$(nst_headers_to_scan_for_enums)) > $@
-
-nst-enum-types.c: $(nst_headers_to_scan_for_enums) Makefile nst-enum-types.h
-	$(AM_V_GEN) (cd $(srcdir) && glib-mkenums \
-			--fhead "#include <plugins/nautilus-sendto-plugin.h>\n" \
-			--fhead "#include \"nst-enum-types.h\"\n" \
-			--fhead "#include <glib-object.h>" \
-			--fprod "\n/* enumerations from \"@filename \" */" \
-			--vhead "GType\n enum_name@_get_type (void)\n{\n  static GType etype = 0;\n  if (etype == 0) {\n    static const G Type@Value values[] = {" 	\
-			--vprod "      { @VALUENAME@, \"@VALUENAME \", \"@valuenick \" }," \
-			--vtail "      { 0, NULL, NULL }\n    };\n    etype = g_ type@_register_static (\"@EnumName \", values);\n  }\n  return etype;\n}\n" \
-		$(nst_headers_to_scan_for_enums)) > $@
-
 EXTRA_DIST = test-mimetype-data
-CLEANFILES = $(nst_built_headers) $(nst_built_cfiles)
diff --git a/src/plugins/Makefile.am b/src/plugins/Makefile.am
index 9f5531b..4b7fea5 100644
--- a/src/plugins/Makefile.am
+++ b/src/plugins/Makefile.am
@@ -10,6 +10,8 @@ libnautilussendto_1_0_la_SOURCES =				\
 	nautilus-sendto-plugin.c				\
 	nst-common.c						\
 	nautilus-sendto-packer.c				\
+	nst-enum-types.h					\
+	nst-enum-types.c					\
 	$(nautilus_sendto_include_HEADERS)
 libnautilussendto_1_0_la_LIBADD = $(NAUTILUS_SENDTO_LIBS)
 libnautilussendto_1_0_la_CFLAGS = $(NAUTILUS_SENDTO_CFLAGS) -DUIDIR=\""$(uidir)"\"
@@ -35,5 +37,31 @@ gir_DATA = $(INTROSPECTION_GIRS)
 typelibdir = $(libdir)/girepository-1.0
 typelib_DATA = $(INTROSPECTION_GIRS:.gir=.typelib)
 
-CLEANFILES = $(gir_DATA) $(typelib_DATA)
+nst_headers_to_scan_for_enums = nautilus-sendto-plugin.h
+# Generate the enums source code, with glib-mkenums:
+# This is based on the same Makefile.am stuff in pango:
+nst_built_headers = nst-enum-types.h
+nst_built_cfiles = nst-enum-types.c
+
+nst-enum-types.h: $(nst_headers_to_scan_for_enums) Makefile
+	$(AM_V_GEN) (cd $(srcdir) && glib-mkenums \
+			--fhead "#ifndef __NST_ENUM_TYPES_H__\n#define __NST_ENUM_TYPES_H__\n\n#include <glib-object.h>\n\nG_BEGIN_DECLS\n" \
+			--fprod "/* enumerations from \"@filename \" */\n" \
+			--vhead "GType @enum_name _get_type (void);\n#define NST_TYPE_ ENUMSHORT@ (@enum_name _get_type())\n" 	\
+			--ftail "G_END_DECLS\n\n#endif /* __NST_ENUM_TYPES_H__ */" \
+		$(nst_headers_to_scan_for_enums)) > $@
+
+nst-enum-types.c: $(nst_headers_to_scan_for_enums) Makefile nst-enum-types.h
+	$(AM_V_GEN) (cd $(srcdir) && glib-mkenums \
+			--fhead "#include \"nautilus-sendto-plugin.h\"\n" \
+			--fhead "#include \"nst-enum-types.h\"\n" \
+			--fhead "#include <glib-object.h>" \
+			--fprod "\n/* enumerations from \"@filename \" */" \
+			--vhead "GType\n enum_name@_get_type (void)\n{\n  static GType etype = 0;\n  if (etype == 0) {\n    static const G Type@Value values[] = {" 	\
+			--vprod "      { @VALUENAME@, \"@VALUENAME \", \"@valuenick \" }," \
+			--vtail "      { 0, NULL, NULL }\n    };\n    etype = g_ type@_register_static (\"@EnumName \", values);\n  }\n  return etype;\n}\n" \
+		$(nst_headers_to_scan_for_enums)) > $@
+
+
+CLEANFILES = $(gir_DATA) $(typelib_DATA) $(nst_built_headers) $(nst_built_cfiles)
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]