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