10bea94044415e97787bc114df6f86e50a12fd21
[platform/upstream/libgsignon-glib.git] / libsignon-glib / Makefile.am
1 INCLUDES = $(DBUS_CFLAGS) -I$(top_srcdir) \
2            -DLIBDIR="@libdir@" -DLIBVERSION="0"
3 lib_LTLIBRARIES = \
4         libsignon-glib.la
5
6 libsignon_glib_la_CFLAGS = $(DEPS_CFLAGS) -Wall -Werror
7 libsignon_glib_la_LIBADD = $(DEPS_LIBS)
8 libsignon_glib_la_LDFLAGS = \
9         -version-info 1:0:0 \
10         -export-symbols-regex '^signon_'
11
12 BUILT_SOURCES = \
13         signon-marshal.c \
14         signon-marshal.h \
15         signon-client-glib-gen.h \
16         signon-identity-glib-gen.h \
17         signon-auth-session-client-glib-gen.h \
18         signon-enum-types.h \
19         signon-enum-types.c \
20         stamp-signon-enum-types.h
21
22 CLEANFILES = $(BUILT_SOURCES)
23
24 libsignon_glib_la_SOURCES = \
25         signon-auth-service.h \
26         signon-identity-info.h \
27         signon-identity.h \
28         signon-dbus-queue.h \
29         signon-auth-session.h \
30         signon-internals.h \
31         signon-auth-service.c \
32         signon-identity-info.c \
33         signon-identity.c \
34         signon-dbus-queue.c \
35         signon-auth-session.c \
36         signon-errors.h \
37         signon-errors.c \
38         signon-proxy.h \
39         signon-proxy.c \
40         signon-utils.h \
41         signon-utils.c \
42         $(BUILT_SOURCES)
43
44 libsignon_glib_includedir = $(includedir)/libsignon-glib
45 libsignon_glib_include_HEADERS = \
46         signon-auth-service.h \
47         signon-auth-session.h \
48         signon-identity-info.h \
49         signon-identity.h \
50         signon-errors.h \
51         signon-enum-types.h \
52         $(signon_headers)
53
54 DBUS_INTERFACES_DIR = /usr/share/dbus-1/interfaces
55
56 signon-client-glib-gen.h: $(DBUS_INTERFACES_DIR)/com.nokia.SingleSignOn.AuthService.xml
57         dbus-binding-tool --prefix=signon-client-glib --mode=glib-client $< \
58         | sed s/com_nokia_SingleSignOn/SSO/g > $@
59
60 signon-auth-session-client-glib-gen.h: $(DBUS_INTERFACES_DIR)/com.nokia.SingleSignOn.AuthSession.xml
61         dbus-binding-tool --prefix=signon-auth-session-client-glib --mode=glib-client $< \
62         | sed s/com_nokia_SingleSignOn/SSO/g > $@
63
64 signon-identity-glib-gen.h: $(DBUS_INTERFACES_DIR)/com.nokia.SingleSignOn.Identity.xml
65         dbus-binding-tool --prefix=signon-identity-glib --mode=glib-client $< \
66         | sed s/com_nokia_SingleSignOn/SSO/g > $@
67
68 %-marshal.h: %-marshal.list Makefile
69         glib-genmarshal --header --prefix=_$(subst -,_,$*)_marshal $< > $*-marshal.h
70
71 %-marshal.c: %-marshal.list Makefile
72         glib-genmarshal --body --prefix=_$(subst -,_,$*)_marshal $< > $*-marshal.c
73
74 signon-enum-types.h: stamp-signon-enum-types.h
75         @true
76
77 stamp-signon-enum-types.h: Makefile signon-errors.h
78         ( cd $(srcdir) &&  glib-mkenums \
79             --fhead "#ifndef __SIGNON_ENUM_TYPES_H__\n#define __SIGNON_ENUM_TYPES_H__\n#include <glib-object.h>\n\nG_BEGIN_DECLS\n" \
80             --fprod "/* enumerations from \"@filename@\" */\n" \
81             --vhead "GType @enum_name@_get_type (void) G_GNUC_CONST;\n#define SIGNON_TYPE_@ENUMSHORT@ (@enum_name@_get_type())\n" \
82             --ftail "G_END_DECLS\n\n#endif /* __SIGNON_ENUM_TYPES_H__ */" \
83             signon-errors.h ) >> xgen-geth \
84             && (cmp -s xgen-geth signon-enum-types.h || cp xgen-geth signon-enum-types.h ) \
85             && rm -f xgen-geth \
86             && echo timestamp > $(@F)
87
88 signon-enum-types.c: Makefile signon-errors.h
89         ( cd $(srcdir) && glib-mkenums \
90             --fhead "#include \"signon-enum-types.h\"\n#include \"signon-errors.h\"\n#include \"signoncommon.h\"\n#define g_intern_static_string(s) (s)\n" \
91             --fprod "\n/* enumerations from \"@filename@\" */" \
92             --ftail "\n#define __SIGNON_ENUM_TYPES_C__\n" \
93             --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[] = {" \
94             --vprod "      { @VALUENAME@, SED@VALUENAME@, \"@valuenick@\" }," \
95             --vtail "      { 0, NULL, NULL }\n    };\n    etype = g_@type@_register_static (g_intern_static_string (\"@EnumName@\"), values);\n  }\n  return etype;\n}\n" \
96             signon-errors.h ) | \
97             sed -e 's/SEDSIGNON_ERROR_\([^,]*\)/SIGNOND_\1_ERR_NAME/' \
98             > xgen-getc \
99             && cp xgen-getc signon-enum-types.c  \
100             && rm -f xgen-getc
101
102 EXTRA_DIST = signon-marshal.list \
103              stamp-signon-enum-types.h
104
105 -include $(INTROSPECTION_MAKEFILE)
106 INTROSPECTION_GIRS =
107 INTROSPECTION_SCANNER_ARGS = --add-include-path=$(srcdir)
108 INTROSPECTION_COMPILER_ARGS = --includedir=$(srcdir)
109
110 if HAVE_INTROSPECTION
111 introspection_sources = \
112         signon-auth-service.c \
113         signon-auth-service.h \
114         signon-auth-session.c \
115         signon-auth-session.h \
116         signon-enum-types.h \
117         signon-enum-types.c \
118         signon-errors.c \
119         signon-errors.h \
120         signon-identity-info.c \
121         signon-identity-info.h \
122         signon-identity.c \
123         signon-identity.h
124
125 Signon-1.0.gir: libsignon-glib.la
126 Signon_1_0_gir_INCLUDES = GObject-2.0
127 Signon_1_0_gir_SCANNERFLAGS = --identifier-prefix=Signon --symbol-prefix=signon
128 Signon_1_0_gir_CFLAGS = $(DEPS_CFLAGS)
129 Signon_1_0_gir_LIBS = libsignon-glib.la
130 Signon_1_0_gir_FILES = $(introspection_sources)
131 INTROSPECTION_GIRS += Signon-1.0.gir
132
133 girdir = $(datadir)/gir-1.0
134 gir_DATA = $(INTROSPECTION_GIRS)
135
136 typelibdir = $(libdir)/girepository-1.0
137 typelib_DATA = $(INTROSPECTION_GIRS:.gir=.typelib)
138
139 CLEANFILES += $(gir_DATA) $(typelib_DATA)
140 endif