Refresh upstream 2.1.0 release
[profile/ivi/libgsignon-glib.git] / libgsignon-glib / Makefile.am
index 5cb8437..b27d525 100644 (file)
@@ -6,7 +6,6 @@ libgsignon_glib_la_CPPFLAGS = \
        -I$(srcdir) \
        -I$(top_builddir) \
        -I$(builddir) \
-       -I$(top_srcdir)/libgsignon-glib \
        $(DEPS_CFLAGS) \
        -Wall -Werror
 libgsignon_glib_la_LIBADD = $(DEPS_LIBS)
@@ -14,7 +13,26 @@ libgsignon_glib_la_LDFLAGS = \
        -version-info 1:0:0 \
        -export-symbols-regex '^signon_'
 
+nodist_libgsignon_glib_la_SOURCES = \
+       signon-marshal.c \
+       signon-marshal.h \
+       signon-enum-types.h \
+       signon-enum-types.c \
+       signon-errors-enum.c \
+       sso-auth-service-gen.c \
+       sso-auth-service-gen.h \
+       sso-auth-session-gen.c \
+       sso-auth-session-gen.h \
+       sso-identity-gen.c \
+       sso-identity-gen.h \
+       stamp-signon-enum-types.h
+
+BUILT_SOURCES = \
+       $(nodist_libgsignon_glib_la_SOURCES) \
+       signon-errors-map.c
+
 CLEANFILES = \
+       $(BUILT_SOURCES) \
        sso-auth-service-gen-doc-com.google.code.AccountsSSO.gSingleSignOn.AuthService.xml \
        sso-auth-session-gen-doc-com.google.code.AccountsSSO.gSingleSignOn.AuthSession.xml \
        sso-identity-gen-doc-com.google.code.AccountsSSO.gSingleSignOn.Identity.xml
@@ -39,20 +57,7 @@ libgsignon_glib_la_SOURCES = \
        signon-security-context.h \
        signon-security-context.c \
        sso-auth-service.c \
-       sso-auth-service.h \
-       signon-marshal.c \
-       signon-marshal.h \
-       signon-enum-types.h \
-       signon-enum-types.c \
-       signon-errors-enum.c \
-       sso-auth-service-gen.c \
-       sso-auth-service-gen.h \
-       sso-auth-session-gen.c \
-       sso-auth-session-gen.h \
-       sso-identity-gen.c \
-       sso-identity-gen.h \
-       stamp-signon-enum-types.h \
-       signon-errors-map.c
+       sso-auth-service.h
 
 libgsignon_glib_includedir = $(includedir)/libgsignon-glib
 libgsignon_glib_include_HEADERS = \
@@ -77,6 +82,84 @@ libgsignon_glib_headers_with_enums = \
 # default is /usr/share/dbus-1/interfaces
 INTERFACES_DIR = $(top_srcdir)/libgsignon-glib/interfaces
 
+sso-auth-service-gen.h sso-auth-service-gen.c: $(INTERFACES_DIR)/com.google.code.AccountsSSO.gSingleSignOn.AuthService.xml
+       $(AM_V_GEN)gdbus-codegen \
+               --generate-c-code sso-auth-service-gen \
+               --generate-docbook sso-auth-service-gen-doc \
+               --annotate "com.google.code.AccountsSSO.gSingleSignOn.AuthService" org.gtk.GDBus.C.Name SsoAuthService \
+               $<
+
+sso-auth-session-gen.h sso-auth-session-gen.c: $(INTERFACES_DIR)/com.google.code.AccountsSSO.gSingleSignOn.AuthSession.xml
+       $(AM_V_GEN)gdbus-codegen \
+               --generate-c-code sso-auth-session-gen \
+               --generate-docbook sso-auth-session-gen-doc \
+               --annotate "com.google.code.AccountsSSO.gSingleSignOn.AuthSession" org.gtk.GDBus.C.Name SsoAuthSession \
+               $<
+
+sso-identity-gen.h sso-identity-gen.c: $(INTERFACES_DIR)/com.google.code.AccountsSSO.gSingleSignOn.Identity.xml
+       $(AM_V_GEN)gdbus-codegen \
+               --generate-c-code sso-identity-gen \
+               --generate-docbook sso-identity-gen-doc \
+               --annotate "com.google.code.AccountsSSO.gSingleSignOn.Identity" org.gtk.GDBus.C.Name SsoIdentity \
+               $<
+
+signon-marshal.h: signon-marshal.list Makefile
+       $(AM_V_GEN)glib-genmarshal --header --prefix=_signon_marshal $< > $@
+
+signon-marshal.c: signon-marshal.list Makefile
+       $(AM_V_GEN)glib-genmarshal --body --prefix=_signon_marshal $< > $@
+
+signon-enum-types.h: stamp-signon-enum-types.h
+       $(AM_V_at)true
+
+stamp-signon-enum-types.h: Makefile \
+       $(libgsignon_glib_headers_with_enums) signon-errors.h
+       $(AM_V_GEN)( cd $(srcdir) &&  glib-mkenums \
+           --fhead "#ifndef __SIGNON_ENUM_TYPES_H__\n#define __SIGNON_ENUM_TYPES_H__\n#include <glib-object.h>\n\nG_BEGIN_DECLS\n" \
+           --fprod "/* enumerations from \"@filename@\" */\n" \
+           --vhead "GType @enum_name@_get_type (void) G_GNUC_CONST;\n#define SIGNON_TYPE_@ENUMSHORT@ (@enum_name@_get_type())\n" \
+           --ftail "G_END_DECLS\n\n#endif /* __SIGNON_ENUM_TYPES_H__ */" \
+           $(libgsignon_glib_headers_with_enums) signon-errors.h ) >> stamp-xgen-geth \
+           && (cmp -s stamp-xgen-geth signon-enum-types.h || cp stamp-xgen-geth signon-enum-types.h ) \
+           && rm -f stamp-xgen-geth \
+           && echo timestamp > $(@F)
+
+signon-enum-types.c: Makefile $(libgsignon_glib_headers_with_enums)
+       $(AM_V_GEN)( cd $(srcdir) && glib-mkenums \
+           --fhead "#include \"signon-enum-types.h\"\n" \
+           --fhead "#include \"signon-identity-info.h\"\n" \
+                       --fhead "#include \"signon-auth-session.h\"\n" \
+                       --fhead "#define g_intern_static_string(s) (s)\n" \
+           --fprod "\n/* enumerations from \"@filename@\" */" \
+           --ftail "\n#define __SIGNON_ENUM_TYPES_C__\n" \
+           --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 (g_intern_static_string (\"@EnumName@\"), values);\n  }\n  return etype;\n}\n" \
+           $(libgsignon_glib_headers_with_enums) ) > enum-xgen-getc \
+           && cp enum-xgen-getc signon-enum-types.c  \
+           && rm -f enum-xgen-getc
+
+signon-errors-enum.c: Makefile signon-errors.h
+       $(AM_V_GEN)( cd $(srcdir) && glib-mkenums \
+           --fhead "#include \"signon-enum-types.h\"\n#include \"signon-errors.h\"\n#include \"signon-internals.h\"\n#define g_intern_static_string(s) (s)\n" \
+           --fprod "\n/* enumerations from \"@filename@\" */" \
+           --ftail "\n#define __SIGNON_ENUM_TYPES_C__\n" \
+           --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@, SED@VALUENAME@, \"@valuenick@\" }," \
+           --vtail "      { 0, NULL, NULL }\n    };\n    etype = g_@type@_register_static (g_intern_static_string (\"@EnumName@\"), values);\n  }\n  return etype;\n}\n" \
+           signon-errors.h ) | \
+           $(SED) -e 's/SEDSIGNON_ERROR_\([^,]*\)/SIGNOND_\1_ERR_NAME/' \
+           > errors-xgen-getc \
+           && cp errors-xgen-getc signon-errors-enum.c  \
+           && rm -f errors-xgen-getc
+
+signon-errors-map.c: Makefile signon-errors.h
+       $(AM_V_GEN)( cd $(srcdir) && \
+         echo "static const GDBusErrorEntry signon_error_entries[] = {" && \
+         grep "^ *SIGNON_ERROR_" signon-errors.h | \
+           $(SED) -e 's/SIGNON_ERROR_\([A-Z_0-9]*\).*/{ SIGNON_ERROR_\1, SIGNOND_\1_ERR_NAME },/' && \
+         echo -e "};\n" ) > signon-errors-map.c
+
 dist_noinst_DATA = \
        signon-marshal.list \
        stamp-signon-enum-types.h