Merge "[SPIN]Set interface callback during scan request" into tizen
[platform/upstream/connman.git] / Makefile.am
1
2 AM_MAKEFLAGS = --no-print-directory
3
4 noinst_LTLIBRARIES =
5
6 includedir = @includedir@/connman
7
8 include_HEADERS = include/log.h include/plugin.h \
9                         include/notifier.h include/service.h \
10                         include/resolver.h include/ipconfig.h \
11                         include/device.h include/network.h include/inet.h \
12                         include/storage.h include/provision.h \
13                         include/session.h include/ipaddress.h include/agent.h \
14                         include/inotify.h include/peer.h include/machine.h
15
16 nodist_include_HEADERS = include/version.h
17
18 noinst_HEADERS = include/rtnl.h include/task.h \
19                         include/dbus.h include/option.h \
20                         include/provider.h include/vpn-dbus.h \
21                         include/utsname.h include/timeserver.h include/proxy.h \
22                         include/technology.h include/setting.h
23
24 local_headers = $(foreach file,$(include_HEADERS) $(nodist_include_HEADERS) \
25                         $(noinst_HEADERS), include/connman/$(notdir $(file)))
26
27
28 noinst_LTLIBRARIES += gdbus/libgdbus-internal.la
29
30 gdbus_libgdbus_internal_la_SOURCES = gdbus/gdbus.h \
31                                 gdbus/mainloop.c gdbus/watch.c \
32                                 gdbus/object.c gdbus/client.c gdbus/polkit.c
33
34 gdhcp_sources = gdhcp/gdhcp.h gdhcp/common.h gdhcp/common.c gdhcp/client.c \
35                 gdhcp/server.c gdhcp/ipv4ll.h gdhcp/ipv4ll.c gdhcp/unaligned.h
36
37 gweb_sources = gweb/gweb.h gweb/gweb.c gweb/gresolv.h gweb/gresolv.c
38
39 if WISPR
40 gweb_sources += gweb/giognutls.h gweb/giognutls.c
41 else
42 gweb_sources += gweb/giognutls.h gweb/gionotls.c
43 endif
44
45 shared_sources = src/shared/util.h src/shared/util.c \
46                 src/shared/netlink.h src/shared/netlink.c
47
48 if DATAFILES
49
50 if NMCOMPAT
51 nmcompat_conf = plugins/connman-nmcompat.conf
52 endif
53
54 dbusconfdir = @DBUS_CONFDIR@
55
56 dbusconf_DATA = src/connman.conf $(nmcompat_conf)
57
58 if VPN
59 dbusconf_DATA += vpn/connman-vpn-dbus.conf
60 dbusservicedir = @DBUS_DATADIR@
61 dbusservice_DATA = vpn/net.connman.vpn.service
62 endif
63
64 if SYSTEMD
65 systemdunitdir = @SYSTEMD_UNITDIR@
66 systemdunit_DATA = src/connman.service vpn/connman-vpn.service
67
68 endif
69 endif
70
71 service_files_sources = src/connman.service.in src/net.connman.service.in \
72                                 vpn/net.connman.vpn.service.in vpn/connman-vpn.service.in
73 service_files = src/connman.service src/net.connman.service \
74                                 vpn/net.connman.vpn.service vpn/connman-vpn.service
75
76 plugin_LTLIBRARIES =
77
78 plugin_objects =
79
80 builtin_modules =
81 builtin_sources =
82 builtin_libadd =
83 builtin_cflags =
84
85 noinst_PROGRAMS =
86 bin_PROGRAMS =
87
88 unit_objects =
89
90 MANUAL_PAGES =
91
92 sbin_PROGRAMS = src/connmand
93
94 src_connmand_SOURCES = $(gdhcp_sources) $(gweb_sources) \
95                         $(builtin_sources) $(shared_sources) src/connman.ver \
96                         src/main.c src/connman.h src/log.c \
97                         src/error.c src/plugin.c src/task.c \
98                         src/device.c src/network.c src/connection.c \
99                         src/manager.c src/service.c \
100                         src/clock.c src/timezone.c src/agent-connman.c \
101                         src/agent.c src/notifier.c src/provider.c \
102                         src/resolver.c src/ipconfig.c src/detect.c src/inet.c \
103                         src/dhcp.c src/dhcpv6.c src/rtnl.c src/proxy.c \
104                         src/utsname.c src/timeserver.c src/rfkill.c \
105                         src/storage.c src/dbus.c src/config.c \
106                         src/technology.c src/counter.c src/ntp.c \
107                         src/session.c src/tethering.c src/wpad.c src/wispr.c \
108                         src/stats.c src/iptables.c src/dnsproxy.c src/6to4.c \
109                         src/ippool.c src/bridge.c src/nat.c src/ipaddress.c \
110                         src/inotify.c src/firewall.c src/ipv6pd.c src/peer.c \
111                         src/peer_service.c src/machine.c src/util.c
112
113 src_connmand_LDADD = gdbus/libgdbus-internal.la $(builtin_libadd) \
114                         @GLIB_LIBS@ @DBUS_LIBS@ @XTABLES_LIBS@ @GNUTLS_LIBS@ \
115                         @TPKP_GNUTLS_LIBS@ \
116                         -lresolv -ldl -lrt
117
118 src_connmand_LDFLAGS = -Wl,--export-dynamic \
119                                 -Wl,--version-script=$(srcdir)/src/connman.ver
120
121 if VPN
122 vpn_plugin_LTLIBRARIES =
123
124 vpn_plugin_objects =
125
126 builtin_vpn_modules =
127 builtin_vpn_sources =
128 builtin_vpn_libadd =
129 builtin_vpn_cflags =
130
131 sbin_PROGRAMS += vpn/connman-vpnd
132
133 vpn_connman_vpnd_SOURCES = $(gdhcp_sources) $(builtin_vpn_sources) \
134                         $(gweb_sources) vpn/vpn.ver vpn/main.c vpn/vpn.h \
135                         vpn/vpn-manager.c vpn/vpn-provider.c \
136                         vpn/vpn-provider.h vpn/vpn-rtnl.h \
137                         vpn/vpn-ipconfig.c src/inet.c vpn/vpn-rtnl.c \
138                         src/log.c src/error.c src/plugin.c src/task.c \
139                         src/device.c src/network.c src/connection.c \
140                         src/manager.c src/service.c \
141                         src/clock.c src/timezone.c src/agent-connman.c \
142                         src/agent.c src/notifier.c src/provider.c \
143                         src/resolver.c src/ipconfig.c src/detect.c \
144                         src/dhcp.c src/dhcpv6.c src/rtnl.c src/proxy.c \
145                         src/utsname.c src/timeserver.c src/rfkill.c \
146                         src/storage.c src/dbus.c src/config.c \
147                         src/technology.c src/counter.c src/ntp.c \
148                         src/session.c src/tethering.c src/wpad.c src/wispr.c \
149                         src/stats.c src/iptables.c src/dnsproxy.c src/6to4.c \
150                         src/ippool.c src/bridge.c src/nat.c src/ipaddress.c \
151                         src/inotify.c src/firewall.c src/ipv6pd.c src/peer.c \
152                         src/peer_service.c src/machine.c src/util.c \
153                         vpn/vpn-agent.c vpn/vpn-agent.h \
154                         vpn/vpn-config.c
155
156 vpn_connman_vpnd_LDADD = gdbus/libgdbus-internal.la $(builtin_vpn_libadd) \
157                                 @GLIB_LIBS@ @DBUS_LIBS@ @XTABLES_LIBS@ @GNUTLS_LIBS@ \
158                                 @TPKP_GNUTLS_LIBS@ \
159                                 -lresolv -ldl
160
161 vpn_connman_vpnd_LDFLAGS = -Wl,--export-dynamic \
162                                 -Wl,--version-script=$(srcdir)/vpn/vpn.ver
163 endif
164
165 BUILT_SOURCES = $(local_headers) src/builtin.h $(service_files) scripts/connman
166
167 if VPN
168 BUILT_SOURCES += vpn/builtin.h
169 endif
170
171 CLEANFILES = src/connman.conf $(BUILT_SOURCES) $(service_files)
172
173 statedir = $(localstatedir)/run/connman
174 vpn_statedir = $(localstatedir)/run/connman-vpn
175
176 if VPN
177 vpn_plugindir = $(libdir)/connman/plugins-vpn
178 endif
179
180 plugindir = $(libdir)/connman/plugins
181
182 scriptdir = $(libdir)/connman/scripts
183
184 storagedir = $(localstatedir)/lib/connman
185 vpn_storagedir = $(localstatedir)/lib/connman-vpn
186
187 configdir = ${sysconfdir}/connman
188
189 if MAINTAINER_MODE
190 if VPN
191 build_vpn_plugindir = $(abs_top_srcdir)/vpn/plugins/.libs
192 endif
193 build_plugindir = $(abs_top_srcdir)/plugins/.libs
194 build_scriptdir = $(abs_top_srcdir)/scripts
195 else
196 build_plugindir = $(plugindir)
197 build_scriptdir = $(scriptdir)
198 if VPN
199 build_vpn_plugindir = $(vpn_plugindir)
200 endif
201 endif
202
203 AM_CFLAGS = @DBUS_CFLAGS@ @GLIB_CFLAGS@ @XTABLES_CFLAGS@ \
204                                 @GNUTLS_CFLAGS@ @TPKP_GNUTLS_CFLAGS@ $(builtin_cflags) \
205                                 -DCONNMAN_PLUGIN_BUILTIN \
206                                 -DSTATEDIR=\""$(statedir)"\" \
207                                 -DVPN_STATEDIR=\""$(vpn_statedir)"\" \
208                                 -DPLUGINDIR=\""$(build_plugindir)"\" \
209                                 -DSCRIPTDIR=\""$(build_scriptdir)"\" \
210                                 -DSTORAGEDIR=\""$(storagedir)\"" \
211                                 -DVPN_STORAGEDIR=\""$(vpn_storagedir)\"" \
212                                 -DCONFIGDIR=\""$(configdir)\""
213
214 if VPN
215 AM_CPPFLAGS = @TPKP_GNUTLS_CFLAGS@ -I$(builddir)/include -I$(srcdir)/gdbus
216 else
217 AM_CPPFLAGS = @TPKP_GNUTLS_CFLAGS@ -I$(builddir)/include -I$(builddir)/src -I$(srcdir)/gdbus
218 endif
219
220 src_connmand_CFLAGS = @DBUS_CFLAGS@ @GLIB_CFLAGS@ @XTABLES_CFLAGS@ \
221                                 @GNUTLS_CFLAGS@ @TPKP_GNUTLS_CFLAGS@ $(builtin_cflags) \
222                                 -DCONNMAN_PLUGIN_BUILTIN \
223                                 -DSTATEDIR=\""$(statedir)"\" \
224                                 -DPLUGINDIR=\""$(build_plugindir)"\" \
225                                 -DSCRIPTDIR=\""$(build_scriptdir)"\" \
226                                 -DSTORAGEDIR=\""$(storagedir)\"" \
227                                 -DVPN_STORAGEDIR=\""$(vpn_storagedir)\"" \
228                                 -DCONFIGDIR=\""$(configdir)\"" \
229                                 -I$(builddir)/src
230
231 EXTRA_DIST = src/genbuiltin src/connman-dbus.conf src/connman-polkit.conf \
232                                 plugins/connman-nmcompat.conf \
233                                 $(service_files_sources) scripts/connman.in
234
235 if VPN
236 vpn_connman_vpnd_CFLAGS = @DBUS_CFLAGS@ @GLIB_CFLAGS@ @XTABLES_CFLAGS@ \
237                                 $(builtin_vpn_cflags) \
238                                 -DCONNMAN_PLUGIN_BUILTIN \
239                                 -DVPN_STATEDIR=\""$(vpn_statedir)"\" \
240                                 -DPLUGINDIR=\""$(build_vpn_plugindir)"\" \
241                                 -DSCRIPTDIR=\""$(build_scriptdir)"\" \
242                                 -DSTORAGEDIR=\""$(storagedir)\"" \
243                                 -DVPN_STORAGEDIR=\""$(vpn_storagedir)\"" \
244                                 -DCONFIGDIR=\""$(configdir)\"" \
245                                 -I$(builddir)/vpn
246
247 endif
248
249 EXTRA_DIST += vpn/vpn-dbus.conf vpn/vpn-polkit.conf
250
251 script_DATA =
252 script_PROGRAMS =
253 script_LTLIBRARIES =
254
255 include Makefile.plugins
256
257 if CLIENT
258 bin_PROGRAMS += client/connmanctl
259
260 MANUAL_PAGES = doc/connmanctl.1
261
262 client_connmanctl_SOURCES = client/dbus_helpers.h client/dbus_helpers.c \
263                         client/services.h client/services.c \
264                         client/commands.h client/commands.c \
265                         client/input.h client/input.c \
266                         client/agent.h client/agent.c \
267                         client/peers.h client/peers.c \
268                         client/vpnconnections.h client/vpnconnections.c \
269                         client/main.c
270
271 client_connmanctl_LDADD = gdbus/libgdbus-internal.la @DBUS_LIBS@ @GLIB_LIBS@ \
272                                 -lreadline -ldl -lncurses
273 endif
274
275 noinst_PROGRAMS += unit/test-ippool
276
277 unit_test_ippool_SOURCES = src/log.c src/dbus.c src/error.c \
278                                         src/ippool.c unit/test-ippool.c
279 unit_test_ippool_LDADD = gdbus/libgdbus-internal.la \
280                                 @GLIB_LIBS@ @DBUS_LIBS@ -ldl
281
282 TESTS = unit/test-ippool
283
284 if WISPR
285 noinst_PROGRAMS += tools/wispr
286
287 tools_wispr_SOURCES = $(gweb_sources) tools/wispr.c
288 tools_wispr_LDADD = @GLIB_LIBS@ @GNUTLS_LIBS@ @TPKP_GNUTLS_LIBS@ -lresolv
289 endif
290
291 if TOOLS
292 noinst_PROGRAMS += tools/supplicant-test \
293                         tools/dhcp-test tools/dhcp-server-test \
294                         tools/addr-test tools/web-test tools/resolv-test \
295                         tools/dbus-test tools/polkit-test \
296                         tools/iptables-test tools/tap-test tools/wpad-test \
297                         tools/stats-tool tools/private-network-test \
298                         tools/session-test tools/iptables-unit \
299                         tools/dnsproxy-test tools/netlink-test
300
301 tools_supplicant_test_SOURCES = tools/supplicant-test.c \
302                         tools/supplicant-dbus.h tools/supplicant-dbus.c \
303                         tools/supplicant.h tools/supplicant.c
304 tools_supplicant_test_LDADD = gdbus/libgdbus-internal.la \
305                                 @GLIB_LIBS@ @DBUS_LIBS@
306
307 tools_web_test_SOURCES = $(gweb_sources) tools/web-test.c
308 tools_web_test_LDADD = @GLIB_LIBS@ @GNUTLS_LIBS@ @TPKP_GNUTLS_LIBS@ -lresolv
309
310 tools_resolv_test_SOURCES = gweb/gresolv.h gweb/gresolv.c tools/resolv-test.c
311 tools_resolv_test_LDADD = @GLIB_LIBS@ -lresolv
312
313 tools_wpad_test_SOURCES = gweb/gresolv.h gweb/gresolv.c tools/wpad-test.c
314 tools_wpad_test_LDADD = @GLIB_LIBS@ -lresolv
315
316 tools_stats_tool_LDADD = @GLIB_LIBS@
317
318 tools_dhcp_test_SOURCES = $(gdhcp_sources) tools/dhcp-test.c
319 tools_dhcp_test_LDADD = @GLIB_LIBS@
320
321 tools_dhcp_server_test_SOURCES = $(gdhcp_sources) tools/dhcp-server-test.c
322 tools_dhcp_server_test_LDADD = @GLIB_LIBS@
323
324 tools_dbus_test_SOURCES = tools/dbus-test.c
325 tools_dbus_test_LDADD = gdbus/libgdbus-internal.la @GLIB_LIBS@ @DBUS_LIBS@
326
327 tools_polkit_test_LDADD = @DBUS_LIBS@
328
329 tools_iptables_test_SOURCES = src/log.c src/iptables.c tools/iptables-test.c
330 tools_iptables_test_LDADD = @GLIB_LIBS@ @XTABLES_LIBS@ -ldl
331
332 tools_private_network_test_LDADD = @GLIB_LIBS@ @DBUS_LIBS@
333
334 tools_session_test_SOURCES = src/log.c src/dbus.c src/error.c \
335                 tools/session-test.c tools/session-utils.c tools/manager-api.c \
336                 tools/session-api.c tools/session-test.h
337 tools_session_test_LDADD = gdbus/libgdbus-internal.la \
338                                 @GLIB_LIBS@ @DBUS_LIBS@ -ldl
339
340 tools_iptables_unit_CFLAGS = @DBUS_CFLAGS@ @GLIB_CFLAGS@ @XTABLES_CFLAGS@ \
341                 -DIPTABLES_SAVE=\""${IPTABLES_SAVE}"\"
342 tools_iptables_unit_SOURCES = src/log.c \
343                  src/iptables.c src/firewall.c src/nat.c tools/iptables-unit.c
344 tools_iptables_unit_LDADD = gdbus/libgdbus-internal.la \
345                                 @GLIB_LIBS@ @DBUS_LIBS@ @XTABLES_LIBS@ -ldl
346
347 tools_dnsproxy_test_SOURCES = tools/dnsproxy-test.c
348 tools_dnsproxy_test_LDADD = @GLIB_LIBS@
349
350 tools_netlink_test_SOURCES =$(shared_sources) tools/netlink-test.c
351 tools_netlink_test_LDADD = @GLIB_LIBS@
352
353 endif
354
355 test_scripts = test/get-state test/list-services \
356                 test/monitor-services test/test-clock \
357                 test/simple-agent test/show-introspection test/test-compat \
358                 test/test-manager test/test-connman test/monitor-connman \
359                 test/connect-provider test/remove-provider \
360                 test/test-counter test/set-ipv4-method test/set-ipv6-method \
361                 test/get-services test/get-proxy-autoconfig test/set-proxy \
362                 test/enable-tethering test/disable-tethering test/backtrace \
363                 test/test-session test/p2p-on-supplicant \
364                 test/test-new-supplicant test/service-move-before \
365                 test/set-global-timeservers test/get-global-timeservers \
366                 test/set-nameservers test/set-domains test/set-timeservers \
367                 test/set-clock
368
369 test_scripts += test/vpn-connect test/vpn-disconnect test/vpn-get \
370                 test/monitor-vpn test/vpn-property
371
372 if TEST
373 testdir = $(pkglibdir)/test
374 test_SCRIPTS = $(test_scripts)
375 endif
376
377 EXTRA_DIST += $(test_scripts)
378
379 EXTRA_DIST += doc/overview-api.txt doc/behavior-api.txt \
380                                 doc/coding-style.txt doc/wifi-p2p-overview.txt \
381                                 doc/vpn-agent-api.txt doc/peer-api.txt \
382                                 doc/ipconfig-api.txt doc/plugin-api.txt \
383                                 doc/manager-api.txt doc/agent-api.txt \
384                                 doc/service-api.txt doc/technology-api.txt \
385                                 doc/counter-api.txt doc/config-format.txt \
386                                 doc/clock-api.txt doc/session-api.txt \
387                                 doc/session-overview.txt doc/backtrace.txt \
388                                 doc/advanced-configuration.txt \
389                                 doc/vpn-config-format.txt \
390                                 doc/vpn-connection-api.txt \
391                                 doc/vpn-manager-api.txt doc/vpn-overview.txt \
392                                 doc/session-policy-format.txt
393
394 EXTRA_DIST += src/main.conf \
395                 src/eduroam.config
396
397 MANUAL_PAGES += doc/connman.8 doc/connman.conf.5
398
399 dist_man_MANS = $(MANUAL_PAGES)
400
401 pkgconfigdir = $(libdir)/pkgconfig
402
403 pkgconfig_DATA = connman.pc
404
405 DISTCHECK_CONFIGURE_FLAGS = --disable-datafiles \
406                                 --enable-hh2serial-gps \
407                                 --enable-openconnect \
408                                 --enable-openvpn \
409                                 --enable-vpnc \
410                                 --enable-session-policy-local \
411                                 --enable-nmcompat \
412                                 --enable-polkit
413
414 DISTCLEANFILES = $(pkgconfig_DATA)
415
416 MAINTAINERCLEANFILES = Makefile.in \
417         aclocal.m4 configure config.h.in config.sub config.guess \
418         ltmain.sh depcomp compile missing install-sh mkinstalldirs test-driver
419
420
421 src/builtin.h: src/genbuiltin $(builtin_sources)
422         $(AM_V_GEN)$(srcdir)/src/genbuiltin $(builtin_modules) > $@
423
424 vpn/builtin.h: src/genbuiltin $(builtin_vpn_sources)
425         $(AM_V_GEN)$(srcdir)/src/genbuiltin $(builtin_vpn_modules) > $@
426
427 src/connman.conf: src/connman-dbus.conf src/connman-polkit.conf
428 if POLKIT
429         $(AM_V_GEN)cp $(srcdir)/src/connman-polkit.conf $@
430 else
431         $(AM_V_GEN)cp $(srcdir)/src/connman-dbus.conf $@
432 endif
433
434 if VPN
435 vpn/connman-vpn-dbus.conf: vpn/vpn-dbus.conf vpn/vpn-polkit.conf
436 if POLKIT
437         $(AM_V_GEN)cp $(srcdir)/vpn/vpn-polkit.conf $@
438 else
439         $(AM_V_GEN)cp $(srcdir)/vpn/vpn-dbus.conf $@
440 endif
441 endif
442
443 if SELINUX
444 if VPN
445 EXTRA_DIST += connman-task.pp
446 CLEANFILES += connman-task.pp
447 endif
448
449 connman-task.pp: vpn/connman-task.te
450         make -f /usr/share/selinux/devel/Makefile
451 endif
452
453 EXTRA_DIST += vpn/connman-task.te
454
455 do_subst = $(AM_V_GEN)$(SED) \
456                 -e 's,[@]prefix[@],$(prefix),g' \
457                 -e 's,[@]sbindir[@],$(sbindir),g' \
458                 -e 's,[@]sysconfdir[@],$(sysconfdir),g'
459
460 %.service: %.service.in Makefile
461         $(do_subst) < $< > $@
462
463 scripts/connman: scripts/connman.in Makefile
464         $(do_subst) < $< > $@
465
466 include/connman/version.h: include/version.h
467         $(AM_V_at)$(MKDIR_P) include/connman
468         $(AM_V_GEN)$(LN_S) $(abs_top_builddir)/$< $@
469
470 include/connman/%.h: $(abs_top_srcdir)/include/%.h
471         $(AM_V_at)$(MKDIR_P) include/connman
472         $(AM_V_GEN)$(LN_S) $< $@
473
474 clean-local:
475         @$(RM) -rf include/connman