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