Ensure to also replace colon in provider D-Bus object path
[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/security.h 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                         include/ondemand.h
12
13 nodist_include_HEADERS = include/version.h
14
15 noinst_HEADERS = include/driver.h include/element.h include/property.h \
16                         include/rtnl.h include/wifi.h include/task.h \
17                         include/dbus.h include/rfkill.h include/option.h \
18                         include/profile.h include/provider.h include/dhcp.h \
19                         include/utsname.h include/timeserver.h \
20                         include/location.h include/technology.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/object.c gdbus/watch.c
27
28 gdhcp_sources = gdhcp/gdhcp.h gdhcp/common.h gdhcp/common.c gdhcp/client.c
29
30 gresolv_sources = gresolv/gresolv.h gresolv/gresolv.c
31
32 gweb_sources = gweb/gweb.h gweb/gweb.c
33
34 if DATAFILES
35 dbusdir = @DBUS_DATADIR@
36
37 dbus_DATA = src/connman.conf
38 endif
39
40 plugin_LTLIBRARIES =
41
42 plugin_objects =
43
44 builtin_modules =
45 builtin_sources =
46 builtin_libadd =
47 builtin_cflags =
48
49 noinst_PROGRAMS =
50
51 sbin_PROGRAMS = src/connmand
52
53 src_connmand_SOURCES = $(gdbus_sources) $(gdhcp_sources) $(gresolv_sources) \
54                                         $(gweb_sources) $(builtin_sources) \
55                         src/main.c src/connman.h src/log.c src/selftest.c \
56                         src/error.c src/plugin.c src/task.c src/element.c \
57                         src/device.c src/network.c src/connection.c \
58                         src/manager.c src/profile.c src/service.c \
59                         src/agent.c src/notifier.c src/provider.c \
60                         src/security.c src/resolver.c src/ipconfig.c \
61                         src/ipv4.c src/dhcp.c src/rtnl.c src/inet.c \
62                         src/utsname.c src/timeserver.c src/rfkill.c \
63                         src/wifi.c src/storage.c src/dbus.c src/config.c \
64                         src/technology.c src/counter.c src/location.c \
65                         src/session.c src/tethering.c src/ondemand.c \
66                         src/wpad.c
67
68 if UDEV
69 src_connmand_SOURCES += src/udev.c
70 else
71 src_connmand_SOURCES += src/udev-compat.c
72 endif
73
74 src_connmand_LDADD = $(builtin_libadd) @GLIB_LIBS@ @DBUS_LIBS@ \
75                                         @CAPNG_LIBS@ @UDEV_LIBS@ -lresolv -ldl
76
77 src_connmand_LDFLAGS = -Wl,--export-dynamic -Wl,--version-script=src/connman.ver
78
79 src_connmand_DEPENDENCIES = src/connman.ver
80
81 CLEANFILES = src/connman.ver src/connman.exp src/connman.conf \
82                                                 src/builtin.h $(local_headers)
83
84 statedir = $(localstatedir)/run/connman
85
86 plugindir = $(libdir)/connman/plugins
87
88 scriptdir = $(libdir)/connman/scripts
89
90 storagedir = $(localstatedir)/lib/connman
91
92 if MAINTAINER_MODE
93 build_plugindir = $(abs_top_srcdir)/plugins/.libs
94 build_scriptdir = $(abs_top_srcdir)/scripts
95 else
96 build_plugindir = $(plugindir)
97 build_scriptdir = $(scriptdir)
98 endif
99
100 AM_CFLAGS = @UDEV_CFLAGS@ @IPTC_CFLAGS@ @NETLINK_CFLAGS@ @CAPNG_CFLAGS@ \
101                         @DBUS_CFLAGS@ @GLIB_CFLAGS@ $(builtin_cflags) \
102                                 -DCONNMAN_PLUGIN_BUILTIN \
103                                 -DSTATEDIR=\""$(statedir)"\" \
104                                 -DPLUGINDIR=\""$(build_plugindir)"\" \
105                                 -DSCRIPTDIR=\""$(build_scriptdir)"\" \
106                                 -DSTORAGEDIR=\""$(storagedir)\""
107
108 INCLUDES = -I$(builddir)/include -I$(builddir)/src -I$(srcdir)/gdbus
109
110 EXTRA_DIST = src/genbuiltin src/connman-dbus.conf src/connman-polkit.conf
111
112
113 script_DATA =
114 script_PROGRAMS =
115 script_LTLIBRARIES =
116
117 include Makefile.plugins
118
119 if CLIENT
120 noinst_PROGRAMS += client/cm
121
122 client_cm_SOURCES = client/main.c
123 client_cm_LDADD = @DBUS_LIBS@
124 endif
125
126 if TOOLS
127 noinst_PROGRAMS += tools/wifi-scan tools/supplicant-test tools/dhcp-test \
128                         tools/addr-test tools/web-test tools/resolv-test \
129                         tools/dbus-test tools/polkit-test tools/portal-test \
130                         tools/iptables-test tools/tap-test tools/wpad-test
131
132 tools_wifi_scan_LDADD = @GLIB_LIBS@ @NETLINK_LIBS@
133
134 tools_supplicant_test_SOURCES = $(gdbus_sources) tools/supplicant-test.c \
135                         tools/supplicant-dbus.h tools/supplicant-dbus.c \
136                         tools/supplicant.h tools/supplicant.c
137 tools_supplicant_test_LDADD = @GLIB_LIBS@ @DBUS_LIBS@
138
139 tools_web_test_SOURCES = $(gweb_sources) tools/web-test.c
140 tools_web_test_LDADD = @GLIB_LIBS@
141
142 tools_resolv_test_SOURCES = $(gresolv_sources) tools/resolv-test.c
143 tools_resolv_test_LDADD = @GLIB_LIBS@ -lresolv
144
145 tools_wpad_test_SOURCES = $(gresolv_sources) tools/wpad-test.c
146 tools_wpad_test_LDADD = @GLIB_LIBS@ -lresolv
147
148 tools_dhcp_test_SOURCES = $(gdhcp_sources) tools/dhcp-test.c
149 tools_dhcp_test_LDADD = @GLIB_LIBS@
150
151 tools_dbus_test_SOURCES = $(gdbus_sources) tools/dbus-test.c
152 tools_dbus_test_LDADD = @GLIB_LIBS@ @DBUS_LIBS@
153
154 tools_polkit_test_LDADD = @DBUS_LIBS@
155
156 tools_portal_test_LDADD = @GLIB_LIBS@
157
158 tools_iptables_test_LDADD = @IPTC_LIBS@ -lip4tc -lxtables
159
160 if DHCLIENT
161 noinst_PROGRAMS += tools/dhclient-test
162
163 tools_dhclient_test_SOURCES = gdbus/gdbus.h gdbus/mainloop.c gdbus/watch.c \
164                                                         tools/dhclient-test.c
165 tools_dhclient_test_LDADD = @GLIB_LIBS@ @DBUS_LIBS@
166
167 tools_dhclient_test_CFLAGS = $(AM_CFLAGS) -DDHCLIENT=\"@DHCLIENT@\"
168 endif
169 endif
170
171 test_scripts = test/get-state test/list-profiles test/list-services \
172                 test/connect-service test/monitor-services \
173                 test/list-devices test/enable-device test/disable-device \
174                 test/start-scanning test/list-networks \
175                 test/set-passphrase test/set-address test/test-profile \
176                 test/simple-agent test/show-introspection test/test-compat \
177                 test/test-manager test/test-connman test/monitor-connman \
178                 test/connect-vpn test/disconnect-vpn test/list-providers \
179                 test/monitor-manager test/test-counter test/set-ip-method \
180                 test/set-nameservers test/set-domains test/find-service \
181                 test/get-services test/get-proxy-autoconfig \
182                 test/enable-tethering test/disable-tethering test/backtrace
183
184 if TEST
185 testdir = $(pkglibdir)/test
186 test_SCRIPTS = $(test_scripts)
187 endif
188
189 EXTRA_DIST += $(test_scripts)
190
191 EXTRA_DIST += doc/overview-api.txt doc/behavior-api.txt \
192                                 doc/ipconfig-api.txt doc/plugin-api.txt \
193                                 doc/manager-api.txt doc/agent-api.txt \
194                                 doc/profile-api.txt doc/service-api.txt \
195                                 doc/technology-api.txt doc/counter-api.txt \
196                                 doc/device-lowlevel-api.txt \
197                                 doc/network-lowlevel-api.txt \
198                                 doc/advanced-configuration.txt \
199                                 doc/config-format.txt
200
201 pkgconfigdir = $(libdir)/pkgconfig
202
203 pkgconfig_DATA = connman.pc
204
205 DISTCHECK_CONFIGURE_FLAGS = --disable-gtk-doc \
206                                 --disable-datafiles \
207                                 --enable-loopback \
208                                 --enable-ethernet \
209                                 --enable-wifi \
210                                 --enable-bluetooth \
211                                 --enable-ofono \
212                                 --enable-dhclient \
213                                 --enable-dnsproxy \
214                                 --enable-google \
215                                 --enable-meego \
216                                 --enable-udev \
217                                 --enable-client \
218                                 --enable-portal \
219                                 --enable-hh2serial-gps \
220                                 --enable-ntpd \
221                                 --enable-tools
222
223 DISTCLEANFILES = $(pkgconfig_DATA)
224
225 MAINTAINERCLEANFILES = Makefile.in \
226         aclocal.m4 configure config.h.in config.sub config.guess \
227         ltmain.sh depcomp compile missing install-sh mkinstalldirs
228
229
230 src/plugin.$(OBJEXT): src/builtin.h
231
232 src/builtin.h: src/genbuiltin $(builtin_sources)
233         $(AM_V_GEN)$(srcdir)/src/genbuiltin $(builtin_modules) > $@
234
235 src/connman.exp: $(src_connmand_OBJECTS)
236         $(AM_V_GEN)$(NM) $^ | $(AWK) '{ print $$3 }' | sort -u | \
237                 $(EGREP) -e '^connman_' -e '^g_dbus_' -e '^g_dhcp_' > $@
238
239 src/connman.ver: src/connman.exp
240         $(AM_V_at)echo "{ global:" > $@
241         $(AM_V_GEN)$(SED) -e "s/\(.*\)/\1;/" $< >> $@
242         $(AM_V_at)echo "local: *; };" >> $@
243
244 src/connman.conf: src/connman-dbus.conf src/connman-polkit.conf
245 if POLKIT
246         $(AM_V_GEN)cp $(srcdir)/src/connman-polkit.conf $@
247 else
248         $(AM_V_GEN)cp $(srcdir)/src/connman-dbus.conf $@
249 endif
250
251 $(src_connmand_OBJECTS) $(plugin_objects): $(local_headers)
252
253 include/connman/version.h: include/version.h
254         $(AM_V_at)$(MKDIR_P) include/connman
255         $(AM_V_GEN)$(LN_S) $(abs_top_builddir)/$< $@
256
257 include/connman/%.h: include/%.h
258         $(AM_V_at)$(MKDIR_P) include/connman
259         $(AM_V_GEN)$(LN_S) $(abs_top_srcdir)/$< $@
260
261 clean-local:
262         @$(RM) -rf include/connman