dundee: Set network available is needed only when scanning
[platform/upstream/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 include/service.h \
8                         include/resolver.h include/ipconfig.h \
9                         include/device.h include/network.h include/inet.h \
10                         include/storage.h include/provision.h \
11                         include/session.h include/ipaddress.h include/agent.h \
12                         include/inotify.h
13
14 nodist_include_HEADERS = include/version.h
15
16 noinst_HEADERS = include/rtnl.h include/task.h \
17                         include/dbus.h include/option.h \
18                         include/provider.h include/vpn-dbus.h \
19                         include/utsname.h include/timeserver.h include/proxy.h \
20                         include/technology.h 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/client.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 gdhcp/unaligned.h
31
32 gweb_sources = gweb/gweb.h gweb/gweb.c gweb/gresolv.h gweb/gresolv.c
33
34 if WISPR
35 gweb_sources += gweb/giognutls.h gweb/giognutls.c
36 else
37 gweb_sources += gweb/giognutls.h gweb/gionotls.c
38 endif
39
40 if DATAFILES
41
42 if NMCOMPAT
43 nmcompat_conf = plugins/connman-nmcompat.conf
44 endif
45
46 dbusconfdir = @DBUS_CONFDIR@
47
48 dbusconf_DATA = src/connman.conf $(nmcompat_conf)
49
50 if VPN
51 dbusconf_DATA += vpn/connman-vpn-dbus.conf
52 dbusservicedir = @DBUS_DATADIR@
53 dbusservice_DATA = vpn/net.connman.vpn.service
54 endif
55
56 if SYSTEMD
57 systemdunitdir = @SYSTEMD_UNITDIR@
58
59 systemdunit_DATA = src/connman.service
60
61 if VPN
62 systemdunit_DATA += vpn/connman-vpn.service
63 endif
64 endif
65 endif
66
67 plugin_LTLIBRARIES =
68
69 plugin_objects =
70
71 builtin_modules =
72 builtin_sources =
73 builtin_libadd =
74 builtin_cflags =
75
76 noinst_PROGRAMS =
77
78 unit_objects =
79
80 MANUAL_PAGES =
81
82 sbin_PROGRAMS = src/connmand
83
84 src_connmand_SOURCES = $(gdbus_sources) $(gdhcp_sources) $(gweb_sources) \
85                         $(builtin_sources) src/connman.ver \
86                         src/main.c src/connman.h src/log.c \
87                         src/error.c src/plugin.c src/task.c \
88                         src/device.c src/network.c src/connection.c \
89                         src/manager.c src/service.c \
90                         src/clock.c src/timezone.c src/agent-connman.c \
91                         src/agent.c src/notifier.c src/provider.c \
92                         src/resolver.c src/ipconfig.c src/detect.c src/inet.c \
93                         src/dhcp.c src/dhcpv6.c src/rtnl.c src/proxy.c \
94                         src/utsname.c src/timeserver.c src/rfkill.c \
95                         src/storage.c src/dbus.c src/config.c \
96                         src/technology.c src/counter.c src/ntp.c \
97                         src/session.c src/tethering.c src/wpad.c src/wispr.c \
98                         src/stats.c src/iptables.c src/dnsproxy.c src/6to4.c \
99                         src/ippool.c src/bridge.c src/nat.c src/ipaddress.c \
100                         src/inotify.c
101
102 src_connmand_LDADD = $(builtin_libadd) @GLIB_LIBS@ @DBUS_LIBS@ \
103                                 @XTABLES_LIBS@ @GNUTLS_LIBS@ -lresolv -ldl -lrt
104
105 src_connmand_LDFLAGS = -Wl,--export-dynamic \
106                                 -Wl,--version-script=$(srcdir)/src/connman.ver
107
108 if VPN
109 vpn_plugin_LTLIBRARIES =
110
111 vpn_plugin_objects =
112
113 builtin_vpn_modules =
114 builtin_vpn_sources =
115 builtin_vpn_libadd =
116 builtin_vpn_cflags =
117
118 sbin_PROGRAMS += vpn/connman-vpnd
119
120 vpn_connman_vpnd_SOURCES = $(gdbus_sources) $(builtin_vpn_sources) \
121                         $(gweb_sources) vpn/vpn.ver vpn/main.c vpn/vpn.h \
122                         src/log.c src/error.c src/plugin.c src/task.c \
123                         vpn/vpn-manager.c vpn/vpn-provider.c \
124                         vpn/vpn-provider.h vpn/vpn-rtnl.h \
125                         vpn/vpn-ipconfig.c src/inet.c vpn/vpn-rtnl.c \
126                         src/dbus.c src/storage.c src/ipaddress.c src/agent.c \
127                         vpn/vpn-agent.c vpn/vpn-agent.h
128
129 vpn_connman_vpnd_LDADD = $(builtin_vpn_libadd) @GLIB_LIBS@ @DBUS_LIBS@ \
130                                 @GNUTLS_LIBS@ -lresolv -ldl
131
132 vpn_connman_vpnd_LDFLAGS = -Wl,--export-dynamic \
133                                 -Wl,--version-script=$(srcdir)/vpn/vpn.ver
134 endif
135
136 BUILT_SOURCES = $(local_headers) src/builtin.h
137
138 if VPN
139 BUILT_SOURCES += vpn/builtin.h
140 endif
141
142 CLEANFILES = src/connman.conf $(BUILT_SOURCES)
143
144 statedir = $(localstatedir)/run/connman
145
146 if VPN
147 vpn_plugindir = $(libdir)/connman/plugins-vpn
148 endif
149
150 plugindir = $(libdir)/connman/plugins
151
152 scriptdir = $(libdir)/connman/scripts
153
154 storagedir = $(localstatedir)/lib/connman
155
156 configdir = ${sysconfdir}/connman
157
158 if MAINTAINER_MODE
159 if VPN
160 build_vpn_plugindir = $(abs_top_srcdir)/vpn/plugins/.libs
161 endif
162 build_plugindir = $(abs_top_srcdir)/plugins/.libs
163 build_scriptdir = $(abs_top_srcdir)/scripts
164 else
165 build_plugindir = $(plugindir)
166 build_scriptdir = $(scriptdir)
167 if VPN
168 build_vpn_plugindir = $(vpn_plugindir)
169 endif
170 endif
171
172 AM_CFLAGS = @DBUS_CFLAGS@ @GLIB_CFLAGS@ @XTABLES_CFLAGS@ \
173                                 @GNUTLS_CFLAGS@ $(builtin_cflags) \
174                                 -DCONNMAN_PLUGIN_BUILTIN \
175                                 -DSTATEDIR=\""$(statedir)"\" \
176                                 -DPLUGINDIR=\""$(build_plugindir)"\" \
177                                 -DSCRIPTDIR=\""$(build_scriptdir)"\" \
178                                 -DSTORAGEDIR=\""$(storagedir)\"" \
179                                 -DCONFIGDIR=\""$(configdir)\""
180
181 if VPN
182 AM_CPPFLAGS = -I$(builddir)/include -I$(srcdir)/gdbus
183 else
184 AM_CPPFLAGS = -I$(builddir)/include -I$(builddir)/src -I$(srcdir)/gdbus
185 endif
186
187 src_connmand_CFLAGS = @DBUS_CFLAGS@ @GLIB_CFLAGS@ @XTABLES_CFLAGS@ \
188                                 @GNUTLS_CFLAGS@ $(builtin_cflags) \
189                                 -DCONNMAN_PLUGIN_BUILTIN \
190                                 -DSTATEDIR=\""$(statedir)"\" \
191                                 -DPLUGINDIR=\""$(build_plugindir)"\" \
192                                 -DSCRIPTDIR=\""$(build_scriptdir)"\" \
193                                 -DSTORAGEDIR=\""$(storagedir)\"" \
194                                 -DCONFIGDIR=\""$(configdir)\"" \
195                                 -I$(builddir)/src
196
197 EXTRA_DIST = src/genbuiltin src/connman-dbus.conf src/connman-polkit.conf \
198                                                 plugins/connman-nmcompat.conf
199
200 if VPN
201 vpn_connman_vpnd_CFLAGS = @DBUS_CFLAGS@ @GLIB_CFLAGS@ \
202                                 $(builtin_vpn_cflags) \
203                                 -DCONNMAN_PLUGIN_BUILTIN \
204                                 -DSTATEDIR=\""$(statedir)"\" \
205                                 -DPLUGINDIR=\""$(build_vpn_plugindir)"\" \
206                                 -DSCRIPTDIR=\""$(build_scriptdir)"\" \
207                                 -DSTORAGEDIR=\""$(storagedir)\"" \
208                                 -DCONFIGDIR=\""$(configdir)\"" \
209                                 -I$(builddir)/vpn
210
211 endif
212
213 EXTRA_DIST += vpn/vpn-dbus.conf vpn/vpn-polkit.conf
214
215 script_DATA =
216 script_PROGRAMS =
217 script_LTLIBRARIES =
218
219 include Makefile.plugins
220
221 if CLIENT
222 noinst_PROGRAMS += client/connmanctl
223
224 MANUAL_PAGES += doc/connmanctl.1
225
226 client_connmanctl_SOURCES =  $(gdbus_sources) src/connman.h \
227                         client/dbus.h client/dbus.c \
228                         client/data_manager.h client/data_manager.c \
229                         client/services.h client/services.c \
230                         client/technology.h client/technology.c \
231                         client/interactive.h client/interactive.c \
232                         client/monitor.h client/monitor.c \
233                         client/commands.c client/main.c
234
235 client_connmanctl_LDADD = @DBUS_LIBS@ @GLIB_LIBS@ -lreadline -ldl
236 endif
237
238 if WISPR
239 noinst_PROGRAMS += tools/wispr
240
241 tools_wispr_SOURCES = $(gweb_sources) tools/wispr.c
242 tools_wispr_LDADD = @GLIB_LIBS@ @GNUTLS_LIBS@ -lresolv
243 endif
244
245 if TOOLS
246 noinst_PROGRAMS += tools/supplicant-test \
247                         tools/dhcp-test tools/dhcp-server-test \
248                         tools/addr-test tools/web-test tools/resolv-test \
249                         tools/dbus-test tools/polkit-test \
250                         tools/iptables-test tools/tap-test tools/wpad-test \
251                         tools/stats-tool tools/private-network-test \
252                         unit/test-session unit/test-ippool unit/test-nat
253
254 tools_supplicant_test_SOURCES = $(gdbus_sources) tools/supplicant-test.c \
255                         tools/supplicant-dbus.h tools/supplicant-dbus.c \
256                         tools/supplicant.h tools/supplicant.c
257 tools_supplicant_test_LDADD = @GLIB_LIBS@ @DBUS_LIBS@
258
259 tools_web_test_SOURCES = $(gweb_sources) tools/web-test.c
260 tools_web_test_LDADD = @GLIB_LIBS@ @GNUTLS_LIBS@ -lresolv
261
262 tools_resolv_test_SOURCES = gweb/gresolv.h gweb/gresolv.c tools/resolv-test.c
263 tools_resolv_test_LDADD = @GLIB_LIBS@ -lresolv
264
265 tools_wpad_test_SOURCES = gweb/gresolv.h gweb/gresolv.c tools/wpad-test.c
266 tools_wpad_test_LDADD = @GLIB_LIBS@ -lresolv
267
268 tools_stats_tool_LDADD = @GLIB_LIBS@
269
270 tools_dhcp_test_SOURCES = $(gdhcp_sources) tools/dhcp-test.c
271 tools_dhcp_test_LDADD = @GLIB_LIBS@
272
273 tools_dhcp_server_test_SOURCES = $(gdhcp_sources) tools/dhcp-server-test.c
274 tools_dhcp_server_test_LDADD = @GLIB_LIBS@
275
276 tools_dbus_test_SOURCES = $(gdbus_sources) tools/dbus-test.c
277 tools_dbus_test_LDADD = @GLIB_LIBS@ @DBUS_LIBS@
278
279 tools_polkit_test_LDADD = @DBUS_LIBS@
280
281 tools_iptables_test_LDADD = @GLIB_LIBS@ @XTABLES_LIBS@
282
283 tools_private_network_test_LDADD = @GLIB_LIBS@ @DBUS_LIBS@
284
285 unit_test_session_SOURCES = $(gdbus_sources) src/log.c src/dbus.c \
286                 unit/test-session.c unit/utils.c unit/manager-api.c \
287                 unit/session-api.c unit/test-connman.h
288 unit_test_session_LDADD = @GLIB_LIBS@ @DBUS_LIBS@ -ldl
289 unit_objects += $(unit_test_session_OBJECTS)
290
291 unit_test_ippool_SOURCES = $(gdbus_sources) src/log.c src/dbus.c \
292                  src/ippool.c unit/test-ippool.c
293 unit_test_ippool_LDADD = @GLIB_LIBS@ @DBUS_LIBS@ -ldl
294 unit_objects += $(unit_test_ippool_OBJECTS)
295
296 unit_test_nat_SOURCES = $(gdbus_sources) src/log.c src/dbus.c \
297                 src/iptables.c  src/nat.c unit/test-nat.c
298 unit_test_nat_LDADD = @GLIB_LIBS@ @DBUS_LIBS@  @XTABLES_LIBS@ -ldl
299 unit_objects += $(unit_nat_ippool_OBJECTS)
300 endif
301
302 test_scripts = test/get-state test/list-services \
303                 test/monitor-services test/test-clock \
304                 test/simple-agent test/show-introspection test/test-compat \
305                 test/test-manager test/test-connman test/monitor-connman \
306                 test/connect-provider test/remove-provider \
307                 test/test-counter test/set-ipv4-method test/set-ipv6-method \
308                 test/get-services test/get-proxy-autoconfig test/set-proxy \
309                 test/enable-tethering test/disable-tethering test/backtrace \
310                 test/test-session test/test-supplicant \
311                 test/test-new-supplicant test/service-move-before \
312                 test/set-global-timeservers test/get-global-timeservers \
313                 test/set-nameservers test/set-domains test/set-timeservers
314
315 test_scripts += test/vpn-connect test/vpn-disconnect test/vpn-get \
316                 test/monitor-vpn
317
318 if TEST
319 testdir = $(pkglibdir)/test
320 test_SCRIPTS = $(test_scripts)
321 endif
322
323 EXTRA_DIST += $(test_scripts)
324
325 EXTRA_DIST += doc/overview-api.txt doc/behavior-api.txt \
326                                 doc/ipconfig-api.txt doc/plugin-api.txt \
327                                 doc/manager-api.txt doc/agent-api.txt \
328                                 doc/service-api.txt doc/technology-api.txt \
329                                 doc/counter-api.txt doc/config-format.txt \
330                                 doc/clock-api.txt doc/session-api.txt \
331                                 doc/session-overview.txt doc/backtrace.txt \
332                                 doc/advanced-configuration.txt \
333                                 doc/vpn-connection-api.txt \
334                                 doc/vpn-manager-api.txt doc/vpn-overview.txt
335
336 MANUAL_PAGES += doc/connman.8 doc/connman.conf.5
337
338 noinst_dist_man_MANS = $(MANUAL_PAGES)
339
340 pkgconfigdir = $(libdir)/pkgconfig
341
342 pkgconfig_DATA = connman.pc
343
344 DISTCHECK_CONFIGURE_FLAGS = --disable-gtk-doc \
345                                 --disable-datafiles \
346                                 --enable-hh2serial-gps \
347                                 --enable-openconnect \
348                                 --enable-openvpn \
349                                 --enable-vpnc \
350                                 --enable-session-policy-local \
351                                 --enable-nmcompat \
352                                 --enable-polkit
353
354 DISTCLEANFILES = $(pkgconfig_DATA)
355
356 MAINTAINERCLEANFILES = Makefile.in \
357         aclocal.m4 configure config.h.in config.sub config.guess \
358         ltmain.sh depcomp compile missing install-sh mkinstalldirs
359
360
361 src/builtin.h: src/genbuiltin $(builtin_sources)
362         $(AM_V_GEN)$(srcdir)/src/genbuiltin $(builtin_modules) > $@
363
364 vpn/builtin.h: src/genbuiltin $(builtin_vpn_sources)
365         $(AM_V_GEN)$(srcdir)/src/genbuiltin $(builtin_vpn_modules) > $@
366
367 src/connman.conf: src/connman-dbus.conf src/connman-polkit.conf
368 if POLKIT
369         $(AM_V_GEN)cp $(srcdir)/src/connman-polkit.conf $@
370 else
371         $(AM_V_GEN)cp $(srcdir)/src/connman-dbus.conf $@
372 endif
373
374 if VPN
375 vpn/connman-vpn-dbus.conf: vpn/vpn-dbus.conf vpn/vpn-polkit.conf
376 if POLKIT
377         $(AM_V_GEN)cp $(srcdir)/vpn/vpn-polkit.conf $@
378 else
379         $(AM_V_GEN)cp $(srcdir)/vpn/vpn-dbus.conf $@
380 endif
381 endif
382
383 if SELINUX
384 if VPN
385 EXTRA_DIST += connman-task.pp
386 CLEANFILES += connman-task.pp
387 endif
388
389 connman-task.pp: vpn/connman-task.te
390         make -f /usr/share/selinux/devel/Makefile
391 endif
392
393 EXTRA_DIST += vpn/connman-task.te
394
395 include/connman/version.h: include/version.h
396         $(AM_V_at)$(MKDIR_P) include/connman
397         $(AM_V_GEN)$(LN_S) $(abs_top_builddir)/$< $@
398
399 include/connman/%.h: $(abs_top_srcdir)/include/%.h
400         $(AM_V_at)$(MKDIR_P) include/connman
401         $(AM_V_GEN)$(LN_S) $< $@
402
403 clean-local:
404         @$(RM) -rf include/connman