118520faecd7230d8ba6ee0eeac1506619399548
[platform/upstream/libnice.git] / agent / Makefile.am
1 #
2 # Makefile.am for the Nice Glib ICE library
3 #
4 # (C) 2006, 2007 Collabora Ltd.
5 # (C) 2006, 2007 Nokia Corporation. All rights reserved.
6 #
7 # Licensed under MPL 1.1/LGPL 2.1. See file COPYING.
8
9 include $(top_srcdir)/common.mk
10
11 AM_CFLAGS = \
12         -DG_LOG_DOMAIN=\"libnice\" \
13         $(LIBNICE_CFLAGS) \
14         $(GLIB_CFLAGS) \
15         $(GUPNP_CFLAGS) \
16         -I $(top_srcdir) \
17         -I $(top_srcdir)/random \
18         -I $(top_srcdir)/socket \
19         -I $(top_srcdir)/stun
20
21 if WINDOWS
22   AM_CFLAGS += -DWINVER=0x0501 # _WIN32_WINNT_WINXP
23 endif
24
25 BUILT_SOURCES = \
26         agent-enum-types.h \
27         agent-enum-types.c
28
29 CLEANFILES += $(BUILT_SOURCES)
30
31 noinst_LTLIBRARIES = libagent.la
32
33 pkginclude_HEADERS = \
34         agent.h \
35         candidate.h \
36         debug.h \
37         address.h \
38         interfaces.h \
39         pseudotcp.h \
40         $(NULL)
41
42 libagent_la_SOURCES = \
43         address.h \
44         address.c \
45         debug.h \
46         debug.c \
47         candidate.h \
48         candidate.c \
49         component.h \
50         component.c \
51         agent.h \
52         agent-priv.h \
53         agent.c \
54         stream.h \
55         stream.c \
56         conncheck.c \
57         conncheck.h \
58         discovery.c \
59         discovery.h \
60         interfaces.c \
61         interfaces.h \
62         pseudotcp.h \
63         pseudotcp.c \
64         iostream.h \
65         iostream.c \
66         inputstream.h \
67         inputstream.c \
68         outputstream.h \
69         outputstream.c \
70         $(BUILT_SOURCES)
71
72 agent-enum-types.h: $(pkginclude_HEADERS) Makefile
73         $(AM_V_GEN)$(GLIB_MKENUMS) \
74                 --fhead "#ifndef __AGENT_ENUM_TYPES_H__\n#define __AGENT_ENUM_TYPES_H__ 1\n\n#include <glib-object.h>\n\nG_BEGIN_DECLS\n" \
75                 --fprod "/* enumerations from \"@filename@\" */\n" \
76                 --vhead "GType @enum_name@_get_type (void) G_GNUC_CONST;\n#define NICE_TYPE_@ENUMSHORT@ (@enum_name@_get_type())\n" \
77                 --ftail "G_END_DECLS\n\n#endif /* !AGENT_ENUM_TYPES_H */" \
78                 $(addprefix $(srcdir)/,$(pkginclude_HEADERS)) > $@
79
80 agent-enum-types.c: $(pkginclude_HEADERS) Makefile agent-enum-types.h
81         $(AM_V_GEN)$(GLIB_MKENUMS) \
82                 --fhead "#include <config.h>\n#include <glib-object.h>\n#include \"agent.h\"\n#include \"pseudotcp.h\"\n#include \"agent-enum-types.h\"" \
83                 --fprod "\n/* enumerations from \"@filename@\" */" \
84                 --vhead "GType\n@enum_name@_get_type (void)\n{\n  static GType type = 0;\n  if (!type) {\n    static const G@Type@Value values[] = {" \
85                 --vprod "      { @VALUENAME@, \"@VALUENAME@\", \"@valuenick@\" }," \
86                 --vtail "      { 0, NULL, NULL }\n    };\n    type = g_@type@_register_static (\"@EnumName@\", values);\n  }\n  return type;\n}\n\n" \
87                 $(addprefix $(srcdir)/,$(pkginclude_HEADERS)) > $@
88
89 libagent_la_LIBADD = \
90         $(top_builddir)/random/libnice-random.la \
91         $(top_builddir)/socket/libsocket.la \
92         $(top_builddir)/stun/libstun.la \
93         $(GLIB_LIBS) \
94         $(GUPNP_LIBS) \
95         $(NULL)
96 libagent_la_DEPENDENCIES = \
97         $(top_builddir)/random/libnice-random.la \
98         $(top_builddir)/socket/libsocket.la \
99         $(top_builddir)/stun/libstun.la
100
101 if WINDOWS
102   libagent_la_LIBADD += -liphlpapi -lws2_32
103 endif
104
105 #
106 # GObject introspection
107 #
108 # We need --accept-unprefixed because of PseudoTcp and TurnServer.
109 #
110 -include $(INTROSPECTION_MAKEFILE)
111 INTROSPECTION_GIRS =
112 INTROSPECTION_SCANNER_ARGS = --add-include-path=$(srcdir) --warn-all --accept-unprefixed
113 INTROSPECTION_COMPILER_ARGS = --includedir=$(srcdir)
114
115 if HAVE_INTROSPECTION
116 introspection_sources = $(pkginclude_HEADERS)
117
118 Nice-0.1.gir: libagent.la
119 Nice_0_1_gir_INCLUDES = GObject-2.0 Gio-2.0
120 Nice_0_1_gir_EXPORT_PACKAGES = nice
121 Nice_0_1_gir_CFLAGS = $(AM_CFLAGS)
122 Nice_0_1_gir_LIBS = libagent.la
123 Nice_0_1_gir_FILES = $(introspection_sources)
124 INTROSPECTION_GIRS += Nice-0.1.gir
125
126 girdir = $(datadir)/gir-1.0
127 gir_DATA = $(INTROSPECTION_GIRS)
128
129 typelibdir = $(libdir)/girepository-1.0
130 typelib_DATA = $(INTROSPECTION_GIRS:.gir=.typelib)
131
132 CLEANFILES += $(gir_DATA) $(typelib_DATA)
133 endif
134
135 EXTRA_DIST = meson.build