dnsproxy: Move from plugins to core
[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                         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 include/proxy.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/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 dbusconfdir = @DBUS_CONFDIR@
37
38 dbusconf_DATA = src/connman.conf
39
40 if SYSTEMD
41 systemdunitdir = @SYSTEMD_UNITDIR@
42
43 systemdunit_DATA = src/connman.service
44 endif
45 endif
46
47 plugin_LTLIBRARIES =
48
49 plugin_objects =
50
51 builtin_modules =
52 builtin_sources =
53 builtin_libadd =
54 builtin_cflags =
55
56 noinst_PROGRAMS =
57
58 sbin_PROGRAMS = src/connmand
59
60 src_connmand_SOURCES = $(gdbus_sources) $(gdhcp_sources) \
61                         gweb/gweb.h gweb/gweb.c \
62                         gweb/gresolv.h gweb/gresolv.c \
63                         gweb/giognutls.h gweb/gionotls.c \
64                         $(builtin_sources) src/connman.ver \
65                         src/main.c src/connman.h src/log.c \
66                         src/error.c src/plugin.c src/task.c src/element.c \
67                         src/device.c src/network.c src/connection.c \
68                         src/manager.c src/profile.c src/service.c \
69                         src/agent.c src/notifier.c src/provider.c \
70                         src/resolver.c src/ipconfig.c src/detect.c src/inet.c \
71                         src/ipv4.c src/dhcp.c src/rtnl.c src/proxy.c \
72                         src/utsname.c src/timeserver.c src/rfkill.c \
73                         src/wifi.c src/storage.c src/dbus.c src/config.c \
74                         src/technology.c src/counter.c src/location.c \
75                         src/session.c src/tethering.c src/ondemand.c \
76                         src/wpad.c src/wispr.c src/stats.c src/iptables.c \
77                         src/dnsproxy.c
78
79 src_connmand_LDADD = $(builtin_libadd) @GLIB_LIBS@ @DBUS_LIBS@ \
80                                 @CAPNG_LIBS@ @XTABLES_LIBS@ -lresolv -ldl
81
82 src_connmand_LDFLAGS = -Wl,--export-dynamic \
83                                 -Wl,--version-script=$(srcdir)/src/connman.ver
84
85 CLEANFILES = src/connman.conf src/builtin.h $(local_headers)
86
87 statedir = $(localstatedir)/run/connman
88
89 plugindir = $(libdir)/connman/plugins
90
91 scriptdir = $(libdir)/connman/scripts
92
93 storagedir = $(localstatedir)/lib/connman
94
95 if MAINTAINER_MODE
96 build_plugindir = $(abs_top_srcdir)/plugins/.libs
97 build_scriptdir = $(abs_top_srcdir)/scripts
98 else
99 build_plugindir = $(plugindir)
100 build_scriptdir = $(scriptdir)
101 endif
102
103 AM_CFLAGS = @DBUS_CFLAGS@ @GLIB_CFLAGS@ @CAPNG_CFLAGS@ @XTABLES_CFLAGS@ \
104                                 @NETLINK_CFLAGS@ @GNUTLS_CFLAGS@ \
105                                 $(builtin_cflags) \
106                                 -DCONNMAN_PLUGIN_BUILTIN \
107                                 -DSTATEDIR=\""$(statedir)"\" \
108                                 -DPLUGINDIR=\""$(build_plugindir)"\" \
109                                 -DSCRIPTDIR=\""$(build_scriptdir)"\" \
110                                 -DSTORAGEDIR=\""$(storagedir)\""
111
112 INCLUDES = -I$(builddir)/include -I$(builddir)/src -I$(srcdir)/gdbus
113
114 EXTRA_DIST = src/genbuiltin src/connman-dbus.conf src/connman-polkit.conf
115
116
117 script_DATA =
118 script_PROGRAMS =
119 script_LTLIBRARIES =
120
121 include Makefile.plugins
122
123 if CLIENT
124 noinst_PROGRAMS += client/cm
125
126 client_cm_SOURCES = client/main.c
127 client_cm_LDADD = @DBUS_LIBS@
128 endif
129
130 if TOOLS
131 noinst_PROGRAMS += tools/wispr tools/wifi-scan tools/supplicant-test \
132                         tools/dhcp-test tools/dhcp-server-test \
133                         tools/addr-test tools/web-test tools/resolv-test \
134                         tools/dbus-test tools/polkit-test \
135                         tools/iptables-test tools/tap-test tools/wpad-test \
136                         tools/stats-tool
137
138 tools_wispr_SOURCES = $(gweb_sources) tools/wispr.c
139 tools_wispr_LDADD = @GLIB_LIBS@ @GNUTLS_LIBS@ -lresolv
140
141 tools_wifi_scan_LDADD = @GLIB_LIBS@ @NETLINK_LIBS@
142
143 tools_supplicant_test_SOURCES = $(gdbus_sources) tools/supplicant-test.c \
144                         tools/supplicant-dbus.h tools/supplicant-dbus.c \
145                         tools/supplicant.h tools/supplicant.c
146 tools_supplicant_test_LDADD = @GLIB_LIBS@ @DBUS_LIBS@
147
148 tools_web_test_SOURCES = $(gweb_sources) tools/web-test.c
149 tools_web_test_LDADD = @GLIB_LIBS@ @GNUTLS_LIBS@ -lresolv
150
151 tools_resolv_test_SOURCES = gweb/gresolv.h gweb/gresolv.c tools/resolv-test.c
152 tools_resolv_test_LDADD = @GLIB_LIBS@ -lresolv
153
154 tools_wpad_test_SOURCES = gweb/gresolv.h gweb/gresolv.c tools/wpad-test.c
155 tools_wpad_test_LDADD = @GLIB_LIBS@ -lresolv
156
157 tools_stats_tool_LDADD = @GLIB_LIBS@
158
159 tools_dhcp_test_SOURCES = $(gdhcp_sources) tools/dhcp-test.c
160 tools_dhcp_test_LDADD = @GLIB_LIBS@
161
162 tools_dhcp_server_test_SOURCES = $(gdhcp_sources) tools/dhcp-server-test.c
163 tools_dhcp_server_test_LDADD = @GLIB_LIBS@
164
165 tools_dbus_test_SOURCES = $(gdbus_sources) tools/dbus-test.c
166 tools_dbus_test_LDADD = @GLIB_LIBS@ @DBUS_LIBS@
167
168 tools_polkit_test_LDADD = @DBUS_LIBS@
169
170 tools_iptables_test_LDADD = @GLIB_LIBS@ @XTABLES_LIBS@
171 endif
172
173 test_scripts = test/get-state test/list-profiles test/list-services \
174                 test/connect-service test/monitor-services \
175                 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/monitor-manager \
179                 test/test-counter test/set-ipv4-method test/set-ipv6-method \
180                 test/set-nameservers test/set-domains test/find-service \
181                 test/get-services test/get-proxy-autoconfig test/set-proxy \
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/advanced-configuration.txt \
197                                 doc/config-format.txt
198
199 pkgconfigdir = $(libdir)/pkgconfig
200
201 pkgconfig_DATA = connman.pc
202
203 DISTCHECK_CONFIGURE_FLAGS = --disable-gtk-doc \
204                                 --disable-datafiles \
205                                 --enable-loopback \
206                                 --enable-ethernet \
207                                 --enable-wifi \
208                                 --enable-bluetooth \
209                                 --enable-ofono \
210                                 --enable-pacrunner \
211                                 --enable-google \
212                                 --enable-meego \
213                                 --enable-client \
214                                 --enable-portal \
215                                 --enable-hh2serial-gps \
216                                 --enable-ntpd \
217                                 --enable-openconnect \
218                                 --enable-tools
219
220 DISTCLEANFILES = $(pkgconfig_DATA)
221
222 MAINTAINERCLEANFILES = Makefile.in \
223         aclocal.m4 configure config.h.in config.sub config.guess \
224         ltmain.sh depcomp compile missing install-sh mkinstalldirs
225
226
227 src/plugin.$(OBJEXT): src/builtin.h
228
229 src/builtin.h: src/genbuiltin $(builtin_sources)
230         $(AM_V_GEN)$(srcdir)/src/genbuiltin $(builtin_modules) > $@
231
232 src/connman.conf: src/connman-dbus.conf src/connman-polkit.conf
233 if POLKIT
234         $(AM_V_GEN)cp $(srcdir)/src/connman-polkit.conf $@
235 else
236         $(AM_V_GEN)cp $(srcdir)/src/connman-dbus.conf $@
237 endif
238
239 $(src_connmand_OBJECTS) $(plugin_objects): $(local_headers)
240
241 include/connman/version.h: include/version.h
242         $(AM_V_at)$(MKDIR_P) include/connman
243         $(AM_V_GEN)$(LN_S) $(abs_top_builddir)/$< $@
244
245 include/connman/%.h: include/%.h
246         $(AM_V_at)$(MKDIR_P) include/connman
247         $(AM_V_GEN)$(LN_S) $(abs_top_srcdir)/$< $@
248
249 clean-local:
250         @$(RM) -rf include/connman