Remove GTHREAD_CFLAGS and GTHREAD_LIBS usage
[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
12 nodist_include_HEADERS = include/version.h
13
14 noinst_HEADERS = include/driver.h include/element.h include/property.h \
15                         include/rtnl.h include/wifi.h include/task.h \
16                         include/dbus.h include/rfkill.h include/option.h \
17                         include/profile.h include/provider.h
18
19 local_headers = $(foreach file,$(include_HEADERS) $(nodist_include_HEADERS) \
20                         $(noinst_HEADERS), include/connman/$(notdir $(file)))
21
22
23 gdbus_sources = gdbus/gdbus.h gdbus/mainloop.c gdbus/object.c gdbus/watch.c
24
25 if DATAFILES
26 dbusdir = @DBUS_DATADIR@
27
28 dbus_DATA = src/connman.conf
29 endif
30
31 plugin_LTLIBRARIES =
32
33 plugin_objects =
34
35 builtin_modules =
36 builtin_sources =
37 builtin_libadd =
38 builtin_cflags =
39
40 noinst_PROGRAMS =
41
42 sbin_PROGRAMS = src/connmand
43
44 src_connmand_SOURCES = $(gdbus_sources) $(builtin_sources) \
45                         src/main.c src/connman.h src/log.c src/selftest.c \
46                         src/error.c src/plugin.c src/task.c src/element.c \
47                         src/device.c src/network.c src/connection.c \
48                         src/manager.c src/profile.c src/service.c \
49                         src/agent.c src/notifier.c src/provider.c \
50                         src/security.c src/resolver.c src/ipconfig.c \
51                         src/ipv4.c src/storage.c src/rfkill.c src/rtnl.c \
52                         src/inet.c src/wifi.c src/dbus.c
53
54 if UDEV
55 src_connmand_SOURCES += src/udev.c
56 else
57 src_connmand_SOURCES += src/udev-compat.c
58 endif
59
60 src_connmand_LDADD = $(builtin_libadd) \
61                                 @GLIB_LIBS@ @DBUS_LIBS@ @UDEV_LIBS@ -ldl
62
63 src_connmand_LDFLAGS = -Wl,--export-dynamic -Wl,--version-script=src/connman.ver
64
65 src_connmand_DEPENDENCIES = src/connman.ver
66
67 CLEANFILES = src/connman.ver src/connman.exp src/connman.conf \
68                                                 src/builtin.h $(local_headers)
69
70 statedir = $(localstatedir)/run/connman
71
72 plugindir = $(libdir)/connman/plugins
73
74 scriptdir = $(libdir)/connman/scripts
75
76 storagedir = $(localstatedir)/lib/connman
77
78 if MAINTAINER_MODE
79 build_plugindir = $(abs_top_srcdir)/plugins/.libs
80 build_scriptdir = $(abs_top_srcdir)/scripts
81 else
82 build_plugindir = $(plugindir)
83 build_scriptdir = $(scriptdir)
84 endif
85
86 AM_CFLAGS = @UDEV_CFLAGS@ @NETLINK_CFLAGS@ @DBUS_CFLAGS@ \
87                                 @GLIB_CFLAGS@ $(builtin_cflags) \
88                                 -DCONNMAN_PLUGIN_BUILTIN \
89                                 -DSTATEDIR=\""$(statedir)"\" \
90                                 -DPLUGINDIR=\""$(build_plugindir)"\" \
91                                 -DSCRIPTDIR=\""$(build_scriptdir)"\" \
92                                 -DSTORAGEDIR=\""$(storagedir)\""
93
94 INCLUDES = -I$(builddir)/include -I$(builddir)/src -I$(srcdir)/gdbus
95
96 EXTRA_DIST = src/genbuiltin src/connman-dbus.conf src/connman-polkit.conf
97
98
99 script_DATA =
100 script_PROGRAMS =
101 script_LTLIBRARIES =
102
103 include Makefile.plugins
104
105 if CLIENT
106 noinst_PROGRAMS += client/cm
107
108 client_cm_SOURCES = client/main.c
109 client_cm_LDADD = @DBUS_LIBS@
110 endif
111
112 if TOOLS
113 noinst_PROGRAMS += tools/wifi-scan tools/addr-test tools/tap-test
114
115 tools_wifi_scan_LDADD = @GLIB_LIBS@ @NETLINK_LIBS@
116 endif
117
118 test_scripts = test/get-state test/list-profiles test/list-services \
119                 test/connect-service test/list-connections \
120                 test/select-connection test/list-devices test/enable-device \
121                 test/disable-device test/start-scanning test/list-networks \
122                 test/set-passphrase test/set-address test/test-profile \
123                 test/simple-agent test/show-introspection test/test-compat \
124                 test/test-manager test/test-connman test/monitor-connman \
125                 test/monitor-services test/debug-connman
126
127 if TEST
128 testdir = $(pkglibdir)/test
129 test_SCRIPTS = $(test_scripts)
130 endif
131
132 EXTRA_DIST += $(test_scripts)
133
134 EXTRA_DIST += doc/overview-api.txt doc/behavior-api.txt \
135                                 doc/ipconfig-api.txt doc/plugin-api.txt \
136                                 doc/manager-api.txt doc/agent-api.txt \
137                                 doc/profile-api.txt doc/service-api.txt \
138                                 doc/device-lowlevel-api.txt \
139                                 doc/network-lowlevel-api.txt \
140                                 doc/connection-lowlevel-api.txt
141
142 pkgconfigdir = $(libdir)/pkgconfig
143
144 pkgconfig_DATA = connman.pc
145
146 DISTCHECK_CONFIGURE_FLAGS = --disable-gtk-doc \
147                                 --disable-datafiles \
148                                 --enable-loopback \
149                                 --enable-ethernet \
150                                 --enable-wifi \
151                                 --enable-bluetooth \
152                                 --enable-ofono \
153                                 --enable-udhcp \
154                                 --enable-dhclient \
155                                 --enable-resolvconf \
156                                 --enable-dnsproxy \
157                                 --enable-novatel \
158                                 --enable-huawei \
159                                 --enable-hso \
160                                 --enable-mbm \
161                                 --enable-udev \
162                                 --enable-polkit \
163                                 --enable-client \
164                                 --enable-tools
165
166 DISTCLEANFILES = $(pkgconfig_DATA)
167
168 MAINTAINERCLEANFILES = Makefile.in \
169         aclocal.m4 configure config.h.in config.sub config.guess \
170         ltmain.sh depcomp compile missing install-sh mkinstalldirs
171
172
173 src/plugin.$(OBJEXT): src/builtin.h
174
175 src/builtin.h: src/genbuiltin $(builtin_sources)
176         $(AM_V_GEN)$(srcdir)/src/genbuiltin $(builtin_modules) > $@
177
178 src/connman.exp: $(src_connmand_OBJECTS)
179         $(AM_V_GEN)$(NM) $^ | $(AWK) '{ print $$3 }' | sort -u | \
180                                 $(EGREP) -e '^connman_' -e '^g_dbus_' > $@
181
182 src/connman.ver: src/connman.exp
183         $(AM_V_at)echo "{ global:" > $@
184         $(AM_V_GEN)$(SED) -e "s/\(.*\)/\1;/" $< >> $@
185         $(AM_V_at)echo "local: *; };" >> $@
186
187 src/connman.conf: src/connman-dbus.conf src/connman-polkit.conf
188 if POLKIT
189         $(AM_V_GEN)cp $(srcdir)/src/connman-polkit.conf $@
190 else
191         $(AM_V_GEN)cp $(srcdir)/src/connman-dbus.conf $@
192 endif
193
194 $(src_connmand_OBJECTS) $(plugin_objects): $(local_headers)
195
196 include/connman/version.h: include/version.h
197         $(AM_V_at)$(MKDIR_P) include/connman
198         $(AM_V_GEN)$(LN_S) $(abs_top_builddir)/$< $@
199
200 include/connman/%.h: include/%.h
201         $(AM_V_at)$(MKDIR_P) include/connman
202         $(AM_V_GEN)$(LN_S) $(abs_top_srcdir)/$< $@
203
204 clean-local: include/connman
205         @$(RM) -r $<