aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@lanedo.com>2012-02-13 11:59:51 +0100
committerAleksander Morgado <aleksander@lanedo.com>2012-03-15 14:15:04 +0100
commit4d3a61d58b3534a1abe1fe2b290832e237068728 (patch)
tree0c31b833a7f88db6f5c20ae53fd987f936c9977b /src
parentffdb034413d281361803ebb52fcbb4f569e1b9f2 (diff)
build: generate libserial-specific enum types
Diffstat (limited to 'src')
-rw-r--r--src/Makefile.am20
-rw-r--r--src/mm-port.h5
2 files changed, 21 insertions, 4 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
index bc2f7d2f..c2615437 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -35,6 +35,22 @@ libmodem_helpers_la_SOURCES = \
mm-sms-utils.c \
mm-sms-utils.h
+# libserial specific enum types
+SERIAL_ENUMS = mm-port.h
+
+mm-serial-enums-types.h: Makefile.am $(SERIAL_ENUMS) $(top_srcdir)/build-aux/mm-enums-template.h
+ $(AM_V_GEN) glib-mkenums \
+ --fhead "#include \"mm-port.h\"\n#ifndef __MM_SERIAL_ENUMS_TYPES_H__\n#define __MM_SERIAL_ENUMS_TYPES_H__\n" \
+ --template $(top_srcdir)/build-aux/mm-enums-template.h \
+ --ftail "#endif /* __MM_SERIAL_ENUMS_TYPES_H__ */\n" \
+ $(SERIAL_ENUMS) > $@
+
+mm-serial-enums-types.c: Makefile.am $(top_srcdir)/include/ModemManager-enums.h $(top_srcdir)/build-aux/mm-enums-template.c mm-serial-enums-types.h
+ $(AM_V_GEN) glib-mkenums \
+ --fhead "#include \"mm-serial-enums-types.h\"" \
+ --template $(top_srcdir)/build-aux/mm-enums-template.c \
+ $(SERIAL_ENUMS) > $@
+
libserial_la_CPPFLAGS = \
$(MM_CFLAGS) \
-I$(top_srcdir) \
@@ -51,7 +67,9 @@ libserial_la_SOURCES = \
mm-at-serial-port.c \
mm-at-serial-port.h \
mm-qcdm-serial-port.c \
- mm-qcdm-serial-port.h
+ mm-qcdm-serial-port.h \
+ mm-serial-enums-types.h \
+ mm-serial-enums-types.c
# Daemon specific enum types
DAEMON_ENUMS = mm-bearer.h
diff --git a/src/mm-port.h b/src/mm-port.h
index 21e2f605..ea5ebad8 100644
--- a/src/mm-port.h
+++ b/src/mm-port.h
@@ -19,7 +19,7 @@
#include <glib.h>
#include <glib-object.h>
-typedef enum {
+typedef enum { /*< underscore_name=mm_port_subsys >*/
MM_PORT_SUBSYS_UNKNOWN = 0x0,
MM_PORT_SUBSYS_TTY,
MM_PORT_SUBSYS_NET,
@@ -27,7 +27,7 @@ typedef enum {
MM_PORT_SUBSYS_LAST = MM_PORT_SUBSYS_NET
} MMPortSubsys;
-typedef enum {
+typedef enum { /*< underscore_name=mm_port_type >*/
MM_PORT_TYPE_UNKNOWN = 0x0,
MM_PORT_TYPE_AT,
MM_PORT_TYPE_IGNORED,
@@ -79,4 +79,3 @@ const char * mm_port_type_to_name (MMPortType ptype);
const char * mm_port_subsys_to_name (MMPortSubsys psubsys);
#endif /* MM_PORT_H */
-