diff options
author | Aleksander Morgado <aleksander@lanedo.com> | 2011-12-19 17:24:33 +0100 |
---|---|---|
committer | Aleksander Morgado <aleksander@lanedo.com> | 2012-03-15 14:14:34 +0100 |
commit | d22def9309d4051ebd82b76f6704f65ad39d98b5 (patch) | |
tree | a3fdf326655bfd3e48c4a438cb5a1394fbdf6165 | |
parent | 4b8b99ee96f16e3f2d623cb896a4d1bf7f12820f (diff) |
build: let enum and error templates be completely generic
Don't include anything in the templates specific to the file to be built, like
#ifdef guards in headers or #include in sources.
-rw-r--r-- | build-aux/Makefile.am | 8 | ||||
-rw-r--r-- | build-aux/mm-enums-template.c (renamed from build-aux/mm-enums-types.c.template) | 2 | ||||
-rw-r--r-- | build-aux/mm-enums-template.h (renamed from build-aux/mm-enums-types.h.template) | 3 | ||||
-rw-r--r-- | build-aux/mm-errors-template.c (renamed from build-aux/mm-errors-types.c.template) | 3 | ||||
-rw-r--r-- | build-aux/mm-errors-template.h (renamed from build-aux/mm-errors-types.h.template) | 6 | ||||
-rw-r--r-- | libmm-common/Makefile.am | 22 |
6 files changed, 19 insertions, 25 deletions
diff --git a/build-aux/Makefile.am b/build-aux/Makefile.am index 1bf1c38d..8d4ff535 100644 --- a/build-aux/Makefile.am +++ b/build-aux/Makefile.am @@ -1,7 +1,7 @@ EXTRA_DIST = \ header-generator.xsl \ - mm-enums-types.h.template \ - mm-enums-types.c.template \ - mm-enums-errors.h.template \ - mm-enums-errors.c.template + mm-enums-template.h \ + mm-enums-template.c \ + mm-errors-template.h \ + mm-errors-template.c diff --git a/build-aux/mm-enums-types.c.template b/build-aux/mm-enums-template.c index 680a3264..1e789c39 100644 --- a/build-aux/mm-enums-types.c.template +++ b/build-aux/mm-enums-template.c @@ -1,6 +1,4 @@ /*** BEGIN file-header ***/ -#include "ModemManager-enums.h" -#include "mm-enums-types.h" /*** END file-header ***/ diff --git a/build-aux/mm-enums-types.h.template b/build-aux/mm-enums-template.h index 0f016630..bf7a059c 100644 --- a/build-aux/mm-enums-types.h.template +++ b/build-aux/mm-enums-template.h @@ -1,6 +1,4 @@ /*** BEGIN file-header ***/ -#ifndef __MM_ENUMS_TYPES_H__ -#define __MM_ENUMS_TYPES_H__ #include <glib-object.h> @@ -20,5 +18,4 @@ GType @enum_name@_get_type (void) G_GNUC_CONST; /*** BEGIN file-tail ***/ G_END_DECLS -#endif /* __MM_ENUMS_TYPES_H__ */ /*** END file-tail ***/ diff --git a/build-aux/mm-errors-types.c.template b/build-aux/mm-errors-template.c index 4505b7d9..3b3127f5 100644 --- a/build-aux/mm-errors-types.c.template +++ b/build-aux/mm-errors-template.c @@ -1,7 +1,4 @@ /*** BEGIN file-header ***/ -#include "ModemManager-errors.h" -#include "mm-errors-types.h" - /*** END file-header ***/ /*** BEGIN file-production ***/ diff --git a/build-aux/mm-errors-types.h.template b/build-aux/mm-errors-template.h index 1a9baf42..78124d4d 100644 --- a/build-aux/mm-errors-types.h.template +++ b/build-aux/mm-errors-template.h @@ -1,8 +1,5 @@ /*** BEGIN file-header ***/ -#ifndef __MM_ERRORS_TYPES_H__ -#define __MM_ERRORS_TYPES_H__ - #include <glib-object.h> G_BEGIN_DECLS @@ -23,5 +20,4 @@ GType @enum_name@_get_type (void) G_GNUC_CONST; /*** BEGIN file-tail ***/ G_END_DECLS -#endif /* __MM_ERRORS_TYPES_H__ */ -/*** END file-tail ***/
\ No newline at end of file +/*** END file-tail ***/ diff --git a/libmm-common/Makefile.am b/libmm-common/Makefile.am index 56e059a5..83259a9c 100644 --- a/libmm-common/Makefile.am +++ b/libmm-common/Makefile.am @@ -35,25 +35,31 @@ GENERATED_DOC = \ mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.Simple.xml # Enum types -mm-enums-types.h: $(top_srcdir)/include/ModemManager-enums.h $(top_srcdir)/build-aux/mm-enums-types.h.template +mm-enums-types.h: Makefile.am $(top_srcdir)/include/ModemManager-enums.h $(top_srcdir)/build-aux/mm-enums-template.h $(AM_V_GEN) glib-mkenums \ - --template $(top_srcdir)/build-aux/mm-enums-types.h.template \ + --fhead "#ifndef __MM_ENUMS_TYPES_H__\n#define __MM_ENUMS_TYPES_H__\n" \ + --template $(top_srcdir)/build-aux/mm-enums-template.h \ + --ftail "#endif /* __MM_ENUMS_TYPES_H__ */\n" \ $(top_srcdir)/include/ModemManager-enums.h > $@ -mm-enums-types.c: $(top_srcdir)/include/ModemManager-enums.h $(top_srcdir)/build-aux/mm-enums-types.c.template mm-enums-types.h +mm-enums-types.c: Makefile.am $(top_srcdir)/include/ModemManager-enums.h $(top_srcdir)/build-aux/mm-enums-template.c mm-enums-types.h $(AM_V_GEN) glib-mkenums \ - --template $(top_srcdir)/build-aux/mm-enums-types.c.template \ + --fhead "#include <ModemManager-enums.h>\n#include \"mm-enums-types.h\"\n" \ + --template $(top_srcdir)/build-aux/mm-enums-template.c \ $(top_srcdir)/include/ModemManager-enums.h > $@ # Error types -mm-errors-types.h: $(top_srcdir)/include/ModemManager-errors.h $(top_srcdir)/build-aux/mm-errors-types.h.template +mm-errors-types.h: Makefile.am $(top_srcdir)/include/ModemManager-errors.h $(top_srcdir)/build-aux/mm-errors-template.h $(AM_V_GEN) glib-mkenums \ - --template $(top_srcdir)/build-aux/mm-errors-types.h.template \ + --fhead "#ifndef __MM_ERRORS_TYPES_H__\n#define __MM_ERRORS_TYPES_H__\n" \ + --template $(top_srcdir)/build-aux/mm-errors-template.h \ + --ftail "#endif /* __MM_ERRORS_TYPES_H__ */\n" \ $(top_srcdir)/include/ModemManager-errors.h > $@ -mm-errors-types.c: $(top_srcdir)/include/ModemManager-errors.h $(top_srcdir)/build-aux/mm-errors-types.c.template mm-errors-types.h +mm-errors-types.c: Makefile.am $(top_srcdir)/include/ModemManager-errors.h $(top_srcdir)/build-aux/mm-errors-template.c mm-errors-types.h $(AM_V_GEN) glib-mkenums \ - --template $(top_srcdir)/build-aux/mm-errors-types.c.template \ + --fhead "#include <ModemManager-errors.h>\n#include \"mm-errors-types.h\"\n" \ + --template $(top_srcdir)/build-aux/mm-errors-template.h \ $(top_srcdir)/include/ModemManager-errors.h > $@ # Manager interface |