summaryrefslogtreecommitdiff
path: root/Makefile.am
blob: 3edb790988b01a457978784c75c09bbee1f929d5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224

AM_MAKEFLAGS = --no-print-directory

includedir = @includedir@/connman

include_HEADERS = include/types.h include/log.h include/plugin.h \
			include/security.h include/notifier.h \
			include/storage.h include/service.h \
			include/resolver.h include/ipconfig.h \
			include/device.h include/network.h include/inet.h

nodist_include_HEADERS = include/version.h

noinst_HEADERS = include/driver.h include/element.h include/property.h \
			include/rtnl.h include/wifi.h include/task.h \
			include/dbus.h include/rfkill.h include/option.h \
			include/profile.h include/provider.h include/dhcp.h \
			include/utsname.h include/timeserver.h \
			include/location.h

local_headers = $(foreach file,$(include_HEADERS) $(nodist_include_HEADERS) \
			$(noinst_HEADERS), include/connman/$(notdir $(file)))


gdbus_sources = gdbus/gdbus.h gdbus/mainloop.c gdbus/object.c gdbus/watch.c

if DATAFILES
dbusdir = @DBUS_DATADIR@

dbus_DATA = src/connman.conf
endif

plugin_LTLIBRARIES =

plugin_objects =

builtin_modules =
builtin_sources =
builtin_libadd =
builtin_cflags =

noinst_PROGRAMS =

sbin_PROGRAMS = src/connmand

src_connmand_SOURCES = $(gdbus_sources) $(builtin_sources) \
			src/main.c src/connman.h src/log.c src/selftest.c \
			src/error.c src/plugin.c src/task.c src/element.c \
			src/device.c src/network.c src/connection.c \
			src/manager.c src/profile.c src/service.c \
			src/agent.c src/notifier.c src/provider.c \
			src/security.c src/resolver.c src/ipconfig.c \
			src/ipv4.c src/dhcp.c src/rtnl.c src/inet.c \
			src/utsname.c src/timeserver.c src/rfkill.c \
			src/wifi.c src/storage.c src/dbus.c src/config.c \
			src/technology.c src/counter.c src/location.c

if UDEV
src_connmand_SOURCES += src/udev.c
else
src_connmand_SOURCES += src/udev-compat.c
endif

src_connmand_LDADD = $(builtin_libadd) \
			@GLIB_LIBS@ @DBUS_LIBS@ @CAPNG_LIBS@ @UDEV_LIBS@ -ldl

src_connmand_LDFLAGS = -Wl,--export-dynamic -Wl,--version-script=src/connman.ver

src_connmand_DEPENDENCIES = src/connman.ver

CLEANFILES = src/connman.ver src/connman.exp src/connman.conf \
						src/builtin.h $(local_headers)

statedir = $(localstatedir)/run/connman

plugindir = $(libdir)/connman/plugins

scriptdir = $(libdir)/connman/scripts

storagedir = $(localstatedir)/lib/connman

if MAINTAINER_MODE
build_plugindir = $(abs_top_srcdir)/plugins/.libs
build_scriptdir = $(abs_top_srcdir)/scripts
else
build_plugindir = $(plugindir)
build_scriptdir = $(scriptdir)
endif

AM_CFLAGS = @UDEV_CFLAGS@ @NETLINK_CFLAGS@ @CAPNG_CFLAGS@ \
			@DBUS_CFLAGS@ @GLIB_CFLAGS@ $(builtin_cflags) \
				-DCONNMAN_PLUGIN_BUILTIN \
				-DSTATEDIR=\""$(statedir)"\" \
				-DPLUGINDIR=\""$(build_plugindir)"\" \
				-DSCRIPTDIR=\""$(build_scriptdir)"\" \
				-DSTORAGEDIR=\""$(storagedir)\""

INCLUDES = -I$(builddir)/include -I$(builddir)/src -I$(srcdir)/gdbus

EXTRA_DIST = src/genbuiltin src/connman-dbus.conf src/connman-polkit.conf


script_DATA =
script_PROGRAMS =
script_LTLIBRARIES =

include Makefile.plugins

if CLIENT
noinst_PROGRAMS += client/cm

client_cm_SOURCES = client/main.c
client_cm_LDADD = @DBUS_LIBS@
endif

if TOOLS
noinst_PROGRAMS += tools/wifi-scan tools/supplicant-test tools/dbus-test \
			tools/addr-test tools/tap-test tools/polkit-test \
							tools/portal-test

tools_wifi_scan_LDADD = @GLIB_LIBS@ @NETLINK_LIBS@

tools_supplicant_test_SOURCES = $(gdbus_sources) tools/supplicant-test.c \
			tools/supplicant-dbus.h tools/supplicant-dbus.c \
			tools/supplicant.h tools/supplicant.c
tools_supplicant_test_LDADD = @GLIB_LIBS@ @DBUS_LIBS@

tools_dbus_test_SOURCES = $(gdbus_sources) tools/dbus-test.c
tools_dbus_test_LDADD = @GLIB_LIBS@ @DBUS_LIBS@

tools_polkit_test_LDADD = @DBUS_LIBS@

tools_portal_test_LDADD = @GLIB_LIBS@
endif

test_scripts = test/get-state test/list-profiles test/list-services \
		test/connect-service test/monitor-services \
		test/list-devices test/enable-device test/disable-device \
		test/start-scanning test/list-networks \
		test/set-passphrase test/set-address test/test-profile \
		test/simple-agent test/show-introspection test/test-compat \
		test/test-manager test/test-connman test/monitor-connman \
		test/connect-vpn test/disconnect-vpn test/list-providers \
		test/monitor-manager test/test-counter test/set-ip-method

if TEST
testdir = $(pkglibdir)/test
test_SCRIPTS = $(test_scripts)
endif

EXTRA_DIST += $(test_scripts)

EXTRA_DIST += doc/overview-api.txt doc/behavior-api.txt \
				doc/ipconfig-api.txt doc/plugin-api.txt \
				doc/manager-api.txt doc/agent-api.txt \
				doc/profile-api.txt doc/service-api.txt \
				doc/technology-api.txt doc/counter-api.txt \
				doc/device-lowlevel-api.txt \
				doc/network-lowlevel-api.txt \
				doc/advanced-configuration.txt \
				doc/config-format.txt

pkgconfigdir = $(libdir)/pkgconfig

pkgconfig_DATA = connman.pc

DISTCHECK_CONFIGURE_FLAGS = --disable-gtk-doc \
				--disable-datafiles \
				--enable-loopback \
				--enable-ethernet \
				--enable-wifi \
				--enable-bluetooth \
				--enable-ofono \
				--enable-udhcp \
				--enable-dhclient \
				--enable-resolvconf \
				--enable-dnsproxy \
				--enable-google \
				--enable-meego \
				--enable-udev \
				--enable-client \
				--enable-portal \
				--enable-tools

DISTCLEANFILES = $(pkgconfig_DATA)

MAINTAINERCLEANFILES = Makefile.in \
	aclocal.m4 configure config.h.in config.sub config.guess \
	ltmain.sh depcomp compile missing install-sh mkinstalldirs


src/plugin.$(OBJEXT): src/builtin.h

src/builtin.h: src/genbuiltin $(builtin_sources)
	$(AM_V_GEN)$(srcdir)/src/genbuiltin $(builtin_modules) > $@

src/connman.exp: $(src_connmand_OBJECTS)
	$(AM_V_GEN)$(NM) $^ | $(AWK) '{ print $$3 }' | sort -u | \
				$(EGREP) -e '^connman_' -e '^g_dbus_' > $@

src/connman.ver: src/connman.exp
	$(AM_V_at)echo "{ global:" > $@
	$(AM_V_GEN)$(SED) -e "s/\(.*\)/\1;/" $< >> $@
	$(AM_V_at)echo "local: *; };" >> $@

src/connman.conf: src/connman-dbus.conf src/connman-polkit.conf
if POLKIT
	$(AM_V_GEN)cp $(srcdir)/src/connman-polkit.conf $@
else
	$(AM_V_GEN)cp $(srcdir)/src/connman-dbus.conf $@
endif

$(src_connmand_OBJECTS) $(plugin_objects): $(local_headers)

include/connman/version.h: include/version.h
	$(AM_V_at)$(MKDIR_P) include/connman
	$(AM_V_GEN)$(LN_S) $(abs_top_builddir)/$< $@

include/connman/%.h: include/%.h
	$(AM_V_at)$(MKDIR_P) include/connman
	$(AM_V_GEN)$(LN_S) $(abs_top_srcdir)/$< $@

clean-local: include/connman
	@$(RM) -r $<