unit: Add Session API binding
[framework/connectivity/connman.git] / Makefile.am
1
2 AM_MAKEFLAGS = --no-print-directory
3
4 includedir = @includedir@/connman
5
6 include_HEADERS = include/types.h include/log.h include/plugin.h \
7                         include/notifier.h \
8                         include/storage.h include/service.h \
9                         include/resolver.h include/ipconfig.h \
10                         include/device.h include/network.h include/inet.h
11
12 nodist_include_HEADERS = include/version.h
13
14 noinst_HEADERS = include/driver.h include/element.h include/property.h \
15                         include/rtnl.h include/wifi.h include/task.h \
16                         include/dbus.h include/rfkill.h include/option.h \
17                         include/profile.h include/provider.h \
18                         include/utsname.h include/timeserver.h include/proxy.h \
19                         include/location.h include/technology.h \
20                         include/setting.h
21
22 local_headers = $(foreach file,$(include_HEADERS) $(nodist_include_HEADERS) \
23                         $(noinst_HEADERS), include/connman/$(notdir $(file)))
24
25
26 gdbus_sources = gdbus/gdbus.h gdbus/mainloop.c gdbus/watch.c \
27                                         gdbus/object.c gdbus/polkit.c
28
29 gdhcp_sources = gdhcp/gdhcp.h gdhcp/common.h gdhcp/common.c gdhcp/client.c \
30                 gdhcp/server.c gdhcp/ipv4ll.h gdhcp/ipv4ll.c
31
32 gweb_sources = gweb/gweb.h gweb/gweb.c gweb/gresolv.h gweb/gresolv.c \
33                                         gweb/giognutls.h gweb/giognutls.c
34
35 if DATAFILES
36
37 if NMCOMPAT
38 nmcompat_conf = plugins/connman-nmcompat.conf
39 endif
40
41 dbusconfdir = @DBUS_CONFDIR@
42
43 dbusconf_DATA = src/connman.conf $(nmcompat_conf)
44
45 if SYSTEMD
46 systemdunitdir = @SYSTEMD_UNITDIR@
47
48 systemdunit_DATA = src/connman.service
49 endif
50 endif
51
52 plugin_LTLIBRARIES =
53
54 plugin_objects =
55
56 builtin_modules =
57 builtin_sources =
58 builtin_libadd =
59 builtin_cflags =
60
61 noinst_PROGRAMS =
62
63 unit_objects =
64
65 sbin_PROGRAMS = src/connmand
66
67 src_connmand_SOURCES = $(gdbus_sources) $(gdhcp_sources) \
68                         gweb/gweb.h gweb/gweb.c \
69                         gweb/gresolv.h gweb/gresolv.c \
70                         gweb/giognutls.h gweb/gionotls.c \
71                         $(builtin_sources) src/connman.ver \
72                         src/main.c src/connman.h src/log.c \
73                         src/error.c src/plugin.c src/task.c src/element.c \
74                         src/device.c src/network.c src/connection.c \
75                         src/manager.c src/profile.c src/service.c \
76                         src/clock.c src/timezone.c \
77                         src/agent.c src/notifier.c src/provider.c \
78                         src/resolver.c src/ipconfig.c src/detect.c src/inet.c \
79                         src/dhcp.c src/rtnl.c src/proxy.c \
80                         src/utsname.c src/timeserver.c src/rfkill.c \
81                         src/wifi.c src/storage.c src/dbus.c src/config.c \
82                         src/technology.c src/counter.c src/location.c \
83                         src/session.c src/tethering.c src/wpad.c src/wispr.c \
84                         src/stats.c src/iptables.c src/dnsproxy.c src/6to4.c
85
86 src_connmand_LDADD = $(builtin_libadd) @GLIB_LIBS@ @DBUS_LIBS@ \
87                                 @CAPNG_LIBS@ @XTABLES_LIBS@ -lresolv -ldl
88
89 src_connmand_LDFLAGS = -Wl,--export-dynamic \
90                                 -Wl,--version-script=$(srcdir)/src/connman.ver
91
92 CLEANFILES = src/connman.conf src/builtin.h $(local_headers)
93
94 statedir = $(localstatedir)/run/connman
95
96 plugindir = $(libdir)/connman/plugins
97
98 scriptdir = $(libdir)/connman/scripts
99
100 storagedir = $(localstatedir)/lib/connman
101
102 configdir = ${sysconfdir}/connman
103
104 if MAINTAINER_MODE
105 build_plugindir = $(abs_top_srcdir)/plugins/.libs
106 build_scriptdir = $(abs_top_srcdir)/scripts
107 else
108 build_plugindir = $(plugindir)
109 build_scriptdir = $(scriptdir)
110 endif
111
112 AM_CFLAGS = @DBUS_CFLAGS@ @GLIB_CFLAGS@ @CAPNG_CFLAGS@ @XTABLES_CFLAGS@ \
113                                 @NETLINK_CFLAGS@ @GNUTLS_CFLAGS@ \
114                                 $(builtin_cflags) \
115                                 -DCONNMAN_PLUGIN_BUILTIN \
116                                 -DSTATEDIR=\""$(statedir)"\" \
117                                 -DPLUGINDIR=\""$(build_plugindir)"\" \
118                                 -DSCRIPTDIR=\""$(build_scriptdir)"\" \
119                                 -DSTORAGEDIR=\""$(storagedir)\"" \
120                                 -DCONFIGDIR=\""$(configdir)\""
121
122 INCLUDES = -I$(builddir)/include -I$(builddir)/src -I$(srcdir)/gdbus
123
124 EXTRA_DIST = src/genbuiltin src/connman-dbus.conf src/connman-polkit.conf \
125                 plugins/connman-nmcompat.conf
126
127
128 script_DATA =
129 script_PROGRAMS =
130 script_LTLIBRARIES =
131
132 include Makefile.plugins
133
134 if CLIENT
135 noinst_PROGRAMS += client/cm
136
137 client_cm_SOURCES = client/main.c
138 client_cm_LDADD = @DBUS_LIBS@
139 endif
140
141 if TOOLS
142 noinst_PROGRAMS += tools/wispr tools/wifi-scan tools/supplicant-test \
143                         tools/dhcp-test tools/dhcp-server-test \
144                         tools/addr-test tools/web-test tools/resolv-test \
145                         tools/dbus-test tools/polkit-test \
146                         tools/iptables-test tools/tap-test tools/wpad-test \
147                         tools/stats-tool tools/private-network-test \
148                         unit/test-session
149
150 tools_wispr_SOURCES = $(gweb_sources) tools/wispr.c
151 tools_wispr_LDADD = @GLIB_LIBS@ @GNUTLS_LIBS@ -lresolv
152
153 tools_wifi_scan_LDADD = @GLIB_LIBS@ @NETLINK_LIBS@
154
155 tools_supplicant_test_SOURCES = $(gdbus_sources) tools/supplicant-test.c \
156                         tools/supplicant-dbus.h tools/supplicant-dbus.c \
157                         tools/supplicant.h tools/supplicant.c
158 tools_supplicant_test_LDADD = @GLIB_LIBS@ @DBUS_LIBS@
159
160 tools_web_test_SOURCES = $(gweb_sources) tools/web-test.c
161 tools_web_test_LDADD = @GLIB_LIBS@ @GNUTLS_LIBS@ -lresolv
162
163 tools_resolv_test_SOURCES = gweb/gresolv.h gweb/gresolv.c tools/resolv-test.c
164 tools_resolv_test_LDADD = @GLIB_LIBS@ -lresolv
165
166 tools_wpad_test_SOURCES = gweb/gresolv.h gweb/gresolv.c tools/wpad-test.c
167 tools_wpad_test_LDADD = @GLIB_LIBS@ -lresolv
168
169 tools_stats_tool_LDADD = @GLIB_LIBS@
170
171 tools_dhcp_test_SOURCES = $(gdhcp_sources) tools/dhcp-test.c
172 tools_dhcp_test_LDADD = @GLIB_LIBS@
173
174 tools_dhcp_server_test_SOURCES = $(gdhcp_sources) tools/dhcp-server-test.c
175 tools_dhcp_server_test_LDADD = @GLIB_LIBS@
176
177 tools_dbus_test_SOURCES = $(gdbus_sources) tools/dbus-test.c
178 tools_dbus_test_LDADD = @GLIB_LIBS@ @DBUS_LIBS@
179
180 tools_polkit_test_LDADD = @DBUS_LIBS@
181
182 tools_iptables_test_LDADD = @GLIB_LIBS@ @XTABLES_LIBS@
183
184 tools_private_network_test_LDADD = @GLIB_LIBS@ @DBUS_LIBS@
185
186 unit_test_session_SOURCES = $(gdbus_sources) src/log.c src/dbus.c \
187                 unit/test-session.c unit/utils.c unit/manager-api.c \
188                 unit/session-api.c
189 unit_test_session_LDADD = @GLIB_LIBS@ @DBUS_LIBS@
190 unit_objects += $(unit_test_session_OBJECTS)
191 endif
192
193 test_scripts = test/get-state test/list-profiles test/list-services \
194                 test/connect-service test/monitor-services \
195                 test/set-address test/test-profile \
196                 test/simple-agent test/show-introspection test/test-compat \
197                 test/test-manager test/test-connman test/monitor-connman \
198                 test/connect-vpn test/disconnect-vpn test/monitor-manager \
199                 test/test-counter test/set-ipv4-method test/set-ipv6-method \
200                 test/set-nameservers test/set-domains test/find-service \
201                 test/get-services test/get-proxy-autoconfig test/set-proxy \
202                 test/enable-tethering test/disable-tethering test/backtrace \
203                 test/test-session test/provision-service
204
205 if TEST
206 testdir = $(pkglibdir)/test
207 test_SCRIPTS = $(test_scripts)
208 endif
209
210 EXTRA_DIST += $(test_scripts)
211
212 EXTRA_DIST += doc/overview-api.txt doc/behavior-api.txt \
213                                 doc/ipconfig-api.txt doc/plugin-api.txt \
214                                 doc/manager-api.txt doc/agent-api.txt \
215                                 doc/service-api.txt doc/technology-api.txt \
216                                 doc/counter-api.txt doc/config-format.txt \
217                                 doc/advanced-configuration.txt
218
219
220 pkgconfigdir = $(libdir)/pkgconfig
221
222 pkgconfig_DATA = connman.pc
223
224 DISTCHECK_CONFIGURE_FLAGS = --disable-gtk-doc \
225                                 --disable-datafiles \
226                                 --enable-loopback \
227                                 --enable-ethernet \
228                                 --enable-wifi \
229                                 --enable-bluetooth \
230                                 --enable-ofono \
231                                 --enable-pacrunner \
232                                 --enable-google \
233                                 --enable-meego \
234                                 --enable-client \
235                                 --enable-portal \
236                                 --enable-hh2serial-gps \
237                                 --enable-ntpd \
238                                 --enable-openconnect \
239                                 --enable-tools
240
241 DISTCLEANFILES = $(pkgconfig_DATA)
242
243 MAINTAINERCLEANFILES = Makefile.in \
244         aclocal.m4 configure config.h.in config.sub config.guess \
245         ltmain.sh depcomp compile missing install-sh mkinstalldirs
246
247
248 src/plugin.$(OBJEXT): src/builtin.h
249
250 src/builtin.h: src/genbuiltin $(builtin_sources)
251         $(AM_V_GEN)$(srcdir)/src/genbuiltin $(builtin_modules) > $@
252
253 src/connman.conf: src/connman-dbus.conf src/connman-polkit.conf
254 if POLKIT
255         $(AM_V_GEN)cp $(srcdir)/src/connman-polkit.conf $@
256 else
257         $(AM_V_GEN)cp $(srcdir)/src/connman-dbus.conf $@
258 endif
259
260 $(src_connmand_OBJECTS) $(plugin_objects): $(local_headers)
261
262 include/connman/version.h: include/version.h
263         $(AM_V_at)$(MKDIR_P) include/connman
264         $(AM_V_GEN)$(LN_S) $(abs_top_builddir)/$< $@
265
266 include/connman/%.h: include/%.h
267         $(AM_V_at)$(MKDIR_P) include/connman
268         $(AM_V_GEN)$(LN_S) $(abs_top_srcdir)/$< $@
269
270 clean-local:
271         @$(RM) -rf include/connman