Makefile.am 170 KB
Newer Older
1
include $(GLIB_MAKEFILE)
2
-include $(INTROSPECTION_MAKEFILE)
3
include Makefile.vapigen
4

5 6
@GNOME_CODE_COVERAGE_RULES@

7 8
@NM_LOG_COMPILER@

9 10
###############################################################################

11 12
AUTOMAKE_OPTIONS = subdir-objects

13
noinst_LTLIBRARIES =
14
check_LTLIBRARIES =
15
noinst_PROGRAMS =
16
noinst_LIBRARIES =
17
check_PROGRAMS =
18
noinst_DATA =
19
sbin_PROGRAMS =
20
bin_PROGRAMS =
21
libexec_PROGRAMS =
22
lib_LTLIBRARIES =
23
plugin_LTLIBRARIES =
24
core_plugins =
25
service_DATA =
26
man_MANS =
27
examples_DATA =
28
CLEANFILES =
29
DISTCLEANFILES =
30
EXTRA_DIST =
31
EXTRA_LTLIBRARIES =
32
dist_hook =
33 34
dist_dependencies =
dist_configure_check =
35
install_data_hook =
36
install_exec_hook =
37
uninstall_hook =
38
TESTS =
39
BUILT_SOURCES =
40
GLIB_GENERATED =
41 42
man_pages =
man_pages_autogen =
43
check_programs =
44
check_programs_norun =
45
check_ltlibraries =
46
check_local =
47
VAPIGEN_VAPIS =
48
dbusservice_DATA =
49
dbusactivation_DATA =
50 51 52 53 54 55

INTROSPECTION_GIRS =
INTROSPECTION_SCANNER_ARGS =
INTROSPECTION_COMPILER_ARGS =
# Pass SANITIZER_ENV where a command that uses built libraries is
# executed, to suppress possible errors
56
INTROSPECTION_SCANNER_ENV = $(SANITIZER_ENV) LDFLAGS="$(SANITIZER_LIB_LDFLAGS)"
57 58 59

libnmincludedir = $(includedir)/libnm
libnminclude_HEADERS =
60
nodist_libnminclude_HEADERS =
61 62 63

pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA =
64

65 66 67
pppd_plugindir = $(PPPD_PLUGIN_DIR)
pppd_plugin_LTLIBRARIES =

68 69 70
vapidir = $(datadir)/vala/vapi
vapi_DATA =

71 72
examplesdir = $(docdir)/examples

73 74 75
rundir=$(runstatedir)/NetworkManager
statedir=$(localstatedir)/lib/NetworkManager

76 77
plugindir=$(pkglibdir)/$(NM_DIST_VERSION)

78 79
dbusactivationdir = $(datadir)/dbus-1/system-services

80 81
servicedir = $(datadir)/dbus-1/system-services

82 83
completiondir = $(datadir)/bash-completion/completions

84 85 86
GLIB_MKENUMS_H_FLAGS = --identifier-prefix NM
GLIB_MKENUMS_C_FLAGS = --identifier-prefix NM

87
SUBDIRS = \
88
	. \
89 90
	po

91
if HAVE_DOCS
92 93

SUBDIRS += \
94 95 96 97 98 99 100 101 102
	docs/libnm \
	docs/api

if WITH_LEGACY_LIBRARIES
SUBDIRS += \
	docs/libnm-util \
	docs/libnm-glib
endif

103 104
endif

105 106
###############################################################################

107 108
set_sanitizer_env = \
	[ -n "$(SANITIZER_ENV)" ] && export $(SANITIZER_ENV) ; \
109 110 111
	if echo $(SANITIZER_LIB_CFLAGS) $(SANITIZER_EXEC_CFLAGS) | grep -e -fsanitize=address > /dev/null; then \
		[ -n "$(1)" ] && export LD_PRELOAD="$${LD_PRELOAD}:$$(ldd $(1) | grep libasan\.so\.. -o | head -n 1)"; \
		[ -n "$(2)" ] && export LD_PRELOAD="$${LD_PRELOAD}:$$(ldd $(2) | grep libasan\.so\.. -o | head -n 1)"; \
112 113 114
	fi

check_so_symbols = \
115
	$(call set_sanitizer_env,$(1),$(builddir)/src/NetworkManager); \
116
	LD_BIND_NOW=1 LD_PRELOAD=$${LD_PRELOAD}:$(1) $(builddir)/src/NetworkManager --version >/dev/null
117 118 119

###############################################################################

120 121 122 123 124 125 126 127 128
DISTCHECK_CONFIGURE_FLAGS = \
	--enable-tests=yes \
	--with-valgrind=no \
	--enable-gtk-doc \
	--enable-more-warnings=error \
	--with-udev-dir=$$dc_install_base/lib/udev \
	--with-wext=no \
	--enable-ifcfg-rh \
	--enable-ifupdown \
129
	--disable-dependency-tracking
130

131
dist-configure-check:
132
	@echo "*** 'make dist' requires '--enable-gtk-doc --enable-introspection --with-libnm-glib'. ***"
133
	@false
134
if !BUILD_DOCS
135 136 137 138
dist_configure_check += dist-configure-check
endif
if !WITH_LEGACY_LIBRARIES
dist_configure_check += dist-configure-check
139 140
endif

141
dist: $(dist_configure_check) $(dist_dependencies)
142

143
DISTCLEANFILES += intltool-extract intltool-merge intltool-update
144 145 146

###############################################################################

147
if WITH_LEGACY_LIBRARIES
148
pkgconfig_DATA += NetworkManager.pc
149
endif
150 151

###############################################################################
152

153 154 155
polkit_policydir = $(datadir)/polkit-1/actions

dist_polkit_policy_in_in_files = \
156
	data/org.freedesktop.NetworkManager.policy.in.in
157 158 159 160 161 162 163 164 165

polkit_policy_DATA = $(dist_polkit_policy_in_in_files:.policy.in.in=.policy)

@INTLTOOL_POLICY_RULE@

DISTCLEANFILES += $(polkit_policy_DATA)

###############################################################################

166 167 168
noinst_LTLIBRARIES += \
	introspection/libnmdbus.la

169
introspection_libnmdbus_la_CPPFLAGS = $(GLIB_CFLAGS)
170

171
introspection_sources = \
172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187
	introspection/org.freedesktop.NetworkManager.AccessPoint.c \
	introspection/org.freedesktop.NetworkManager.AccessPoint.h \
	introspection/org.freedesktop.NetworkManager.Connection.Active.c \
	introspection/org.freedesktop.NetworkManager.Connection.Active.h \
	introspection/org.freedesktop.NetworkManager.AgentManager.c \
	introspection/org.freedesktop.NetworkManager.AgentManager.h \
	introspection/org.freedesktop.NetworkManager.Checkpoint.c \
	introspection/org.freedesktop.NetworkManager.Checkpoint.h \
	introspection/org.freedesktop.NetworkManager.Device.Adsl.c \
	introspection/org.freedesktop.NetworkManager.Device.Adsl.h \
	introspection/org.freedesktop.NetworkManager.Device.Bond.c \
	introspection/org.freedesktop.NetworkManager.Device.Bond.h \
	introspection/org.freedesktop.NetworkManager.Device.Bridge.c \
	introspection/org.freedesktop.NetworkManager.Device.Bridge.h \
	introspection/org.freedesktop.NetworkManager.Device.Bluetooth.c \
	introspection/org.freedesktop.NetworkManager.Device.Bluetooth.h \
188 189
	introspection/org.freedesktop.NetworkManager.Device.Dummy.c \
	introspection/org.freedesktop.NetworkManager.Device.Dummy.h \
190 191 192 193 194 195 196 197
	introspection/org.freedesktop.NetworkManager.Device.Wired.c \
	introspection/org.freedesktop.NetworkManager.Device.Wired.h \
	introspection/org.freedesktop.NetworkManager.Device.Generic.c \
	introspection/org.freedesktop.NetworkManager.Device.Generic.h \
	introspection/org.freedesktop.NetworkManager.Device.Infiniband.c \
	introspection/org.freedesktop.NetworkManager.Device.Infiniband.h \
	introspection/org.freedesktop.NetworkManager.Device.IPTunnel.c \
	introspection/org.freedesktop.NetworkManager.Device.IPTunnel.h \
198 199
	introspection/org.freedesktop.NetworkManager.Device.Macsec.c \
	introspection/org.freedesktop.NetworkManager.Device.Macsec.h \
200 201 202 203 204 205
	introspection/org.freedesktop.NetworkManager.Device.Macvlan.c \
	introspection/org.freedesktop.NetworkManager.Device.Macvlan.h \
	introspection/org.freedesktop.NetworkManager.Device.Modem.c \
	introspection/org.freedesktop.NetworkManager.Device.Modem.h \
	introspection/org.freedesktop.NetworkManager.Device.OlpcMesh.c \
	introspection/org.freedesktop.NetworkManager.Device.OlpcMesh.h \
206 207
	introspection/org.freedesktop.NetworkManager.Device.OvsInterface.c \
	introspection/org.freedesktop.NetworkManager.Device.OvsInterface.h \
208 209
	introspection/org.freedesktop.NetworkManager.Device.OvsPort.c \
	introspection/org.freedesktop.NetworkManager.Device.OvsPort.h \
210 211
	introspection/org.freedesktop.NetworkManager.Device.OvsBridge.c \
	introspection/org.freedesktop.NetworkManager.Device.OvsBridge.h \
Beniamino Galvani's avatar
Beniamino Galvani committed
212 213
	introspection/org.freedesktop.NetworkManager.Device.Ppp.c \
	introspection/org.freedesktop.NetworkManager.Device.Ppp.h \
214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235
	introspection/org.freedesktop.NetworkManager.Device.Statistics.c \
	introspection/org.freedesktop.NetworkManager.Device.Statistics.h \
	introspection/org.freedesktop.NetworkManager.Device.Team.c \
	introspection/org.freedesktop.NetworkManager.Device.Team.h \
	introspection/org.freedesktop.NetworkManager.Device.Tun.c \
	introspection/org.freedesktop.NetworkManager.Device.Tun.h \
	introspection/org.freedesktop.NetworkManager.Device.Veth.c \
	introspection/org.freedesktop.NetworkManager.Device.Veth.h \
	introspection/org.freedesktop.NetworkManager.Device.Vlan.c \
	introspection/org.freedesktop.NetworkManager.Device.Vlan.h \
	introspection/org.freedesktop.NetworkManager.Device.Vxlan.c \
	introspection/org.freedesktop.NetworkManager.Device.Vxlan.h \
	introspection/org.freedesktop.NetworkManager.Device.Wireless.c \
	introspection/org.freedesktop.NetworkManager.Device.Wireless.h \
	introspection/org.freedesktop.NetworkManager.Device.WiMax.c \
	introspection/org.freedesktop.NetworkManager.Device.WiMax.h \
	introspection/org.freedesktop.NetworkManager.Device.c \
	introspection/org.freedesktop.NetworkManager.Device.h \
	introspection/org.freedesktop.NetworkManager.DHCP4Config.c \
	introspection/org.freedesktop.NetworkManager.DHCP4Config.h \
	introspection/org.freedesktop.NetworkManager.DHCP6Config.c \
	introspection/org.freedesktop.NetworkManager.DHCP6Config.h \
236 237
	introspection/org.freedesktop.NetworkManager.DnsManager.c \
	introspection/org.freedesktop.NetworkManager.DnsManager.h \
238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255
	introspection/org.freedesktop.NetworkManager.IP4Config.c \
	introspection/org.freedesktop.NetworkManager.IP4Config.h \
	introspection/org.freedesktop.NetworkManager.IP6Config.c \
	introspection/org.freedesktop.NetworkManager.IP6Config.h \
	introspection/org.freedesktop.NetworkManager.c \
	introspection/org.freedesktop.NetworkManager.h \
	introspection/org.freedesktop.NetworkManager.PPP.c \
	introspection/org.freedesktop.NetworkManager.PPP.h \
	introspection/org.freedesktop.NetworkManager.SecretAgent.c \
	introspection/org.freedesktop.NetworkManager.SecretAgent.h \
	introspection/org.freedesktop.NetworkManager.Settings.Connection.c \
	introspection/org.freedesktop.NetworkManager.Settings.Connection.h \
	introspection/org.freedesktop.NetworkManager.Settings.c \
	introspection/org.freedesktop.NetworkManager.Settings.h \
	introspection/org.freedesktop.NetworkManager.VPN.Connection.c \
	introspection/org.freedesktop.NetworkManager.VPN.Connection.h \
	introspection/org.freedesktop.NetworkManager.VPN.Plugin.c \
	introspection/org.freedesktop.NetworkManager.VPN.Plugin.h
256

257 258
nodist_introspection_libnmdbus_la_SOURCES = $(introspection_sources)

259
DBUS_INTERFACE_DOCS = \
260 261 262 263 264 265 266 267 268 269 270 271
	docs/api/dbus-org.freedesktop.NetworkManager.AccessPoint.xml \
	docs/api/dbus-org.freedesktop.NetworkManager.Connection.Active.xml \
	docs/api/dbus-org.freedesktop.NetworkManager.Checkpoint.xml \
	docs/api/dbus-org.freedesktop.NetworkManager.Device.Team.xml \
	docs/api/dbus-org.freedesktop.NetworkManager.DHCP6Config.xml \
	docs/api/dbus-org.freedesktop.NetworkManager.Device.Wireless.xml \
	docs/api/dbus-org.freedesktop.NetworkManager.xml \
	docs/api/dbus-org.freedesktop.NetworkManager.VPN.Connection.xml \
	docs/api/dbus-org.freedesktop.NetworkManager.SecretAgent.xml \
	docs/api/dbus-org.freedesktop.NetworkManager.Device.xml \
	docs/api/dbus-org.freedesktop.NetworkManager.VPN.Plugin.xml \
	docs/api/dbus-org.freedesktop.NetworkManager.Device.Bluetooth.xml \
272
	docs/api/dbus-org.freedesktop.NetworkManager.Device.Dummy.xml \
273 274 275
	docs/api/dbus-org.freedesktop.NetworkManager.Device.Vxlan.xml \
	docs/api/dbus-org.freedesktop.NetworkManager.Settings.Connection.xml \
	docs/api/dbus-org.freedesktop.NetworkManager.Device.Bond.xml \
276
	docs/api/dbus-org.freedesktop.NetworkManager.Device.Macsec.xml \
277 278 279 280 281 282 283 284 285 286
	docs/api/dbus-org.freedesktop.NetworkManager.Device.Macvlan.xml \
	docs/api/dbus-org.freedesktop.NetworkManager.PPP.xml \
	docs/api/dbus-org.freedesktop.NetworkManager.Device.Vlan.xml \
	docs/api/dbus-org.freedesktop.NetworkManager.Device.Adsl.xml \
	docs/api/dbus-org.freedesktop.NetworkManager.AgentManager.xml \
	docs/api/dbus-org.freedesktop.NetworkManager.Device.WiMax.xml \
	docs/api/dbus-org.freedesktop.NetworkManager.Device.IPTunnel.xml \
	docs/api/dbus-org.freedesktop.NetworkManager.Device.Tun.xml \
	docs/api/dbus-org.freedesktop.NetworkManager.Device.Bridge.xml \
	docs/api/dbus-org.freedesktop.NetworkManager.Device.OlpcMesh.xml \
287
	docs/api/dbus-org.freedesktop.NetworkManager.Device.OvsInterface.xml \
288
	docs/api/dbus-org.freedesktop.NetworkManager.Device.OvsPort.xml \
289
	docs/api/dbus-org.freedesktop.NetworkManager.Device.OvsBridge.xml \
Beniamino Galvani's avatar
Beniamino Galvani committed
290
	docs/api/dbus-org.freedesktop.NetworkManager.Device.Ppp.xml \
291 292 293 294 295 296 297 298 299
	docs/api/dbus-org.freedesktop.NetworkManager.DHCP4Config.xml \
	docs/api/dbus-org.freedesktop.NetworkManager.Device.Generic.xml \
	docs/api/dbus-org.freedesktop.NetworkManager.Device.Infiniband.xml \
	docs/api/dbus-org.freedesktop.NetworkManager.Device.Modem.xml \
	docs/api/dbus-org.freedesktop.NetworkManager.IP6Config.xml \
	docs/api/dbus-org.freedesktop.NetworkManager.Device.Veth.xml \
	docs/api/dbus-org.freedesktop.NetworkManager.Settings.xml \
	docs/api/dbus-org.freedesktop.NetworkManager.Device.Wired.xml \
	docs/api/dbus-org.freedesktop.NetworkManager.IP4Config.xml \
300 301
	docs/api/dbus-org.freedesktop.NetworkManager.Device.Statistics.xml \
	docs/api/dbus-org.freedesktop.NetworkManager.DnsManager.xml
302 303

introspection/%.c: introspection/%.xml
304
	@$(MKDIR_P) introspection/
305 306 307
	$(AM_V_GEN) gdbus-codegen \
		--generate-c-code $(basename $@) \
		--generate-docbook docs/api/dbus \
308 309
		--c-namespace NMDBus \
		--interface-prefix org.freedesktop.NetworkManager \
310
		$<
311

312 313
introspection/%.h: introspection/%.c
	$()
314

315 316
docs/api/dbus-%.xml: introspection/%.c
	$()
317

318
dbusinterfacesdir = $(datadir)/dbus-1/interfaces
319

320
dbusinterfaces_DATA = \
321 322 323 324 325 326 327 328
	introspection/org.freedesktop.NetworkManager.AccessPoint.xml \
	introspection/org.freedesktop.NetworkManager.Connection.Active.xml \
	introspection/org.freedesktop.NetworkManager.AgentManager.xml \
	introspection/org.freedesktop.NetworkManager.Checkpoint.xml \
	introspection/org.freedesktop.NetworkManager.Device.Adsl.xml \
	introspection/org.freedesktop.NetworkManager.Device.Bond.xml \
	introspection/org.freedesktop.NetworkManager.Device.Bridge.xml \
	introspection/org.freedesktop.NetworkManager.Device.Bluetooth.xml \
329
	introspection/org.freedesktop.NetworkManager.Device.Dummy.xml \
330 331 332 333
	introspection/org.freedesktop.NetworkManager.Device.Wired.xml \
	introspection/org.freedesktop.NetworkManager.Device.Generic.xml \
	introspection/org.freedesktop.NetworkManager.Device.Infiniband.xml \
	introspection/org.freedesktop.NetworkManager.Device.IPTunnel.xml \
334
	introspection/org.freedesktop.NetworkManager.Device.Macsec.xml \
335 336 337
	introspection/org.freedesktop.NetworkManager.Device.Macvlan.xml \
	introspection/org.freedesktop.NetworkManager.Device.Modem.xml \
	introspection/org.freedesktop.NetworkManager.Device.OlpcMesh.xml \
338
	introspection/org.freedesktop.NetworkManager.Device.OvsInterface.xml \
339
	introspection/org.freedesktop.NetworkManager.Device.OvsPort.xml \
340
	introspection/org.freedesktop.NetworkManager.Device.OvsBridge.xml \
Beniamino Galvani's avatar
Beniamino Galvani committed
341
	introspection/org.freedesktop.NetworkManager.Device.Ppp.xml \
342 343 344 345 346 347 348 349 350 351 352
	introspection/org.freedesktop.NetworkManager.Device.Statistics.xml \
	introspection/org.freedesktop.NetworkManager.Device.Team.xml \
	introspection/org.freedesktop.NetworkManager.Device.Tun.xml \
	introspection/org.freedesktop.NetworkManager.Device.Veth.xml \
	introspection/org.freedesktop.NetworkManager.Device.Vlan.xml \
	introspection/org.freedesktop.NetworkManager.Device.Vxlan.xml \
	introspection/org.freedesktop.NetworkManager.Device.Wireless.xml \
	introspection/org.freedesktop.NetworkManager.Device.WiMax.xml \
	introspection/org.freedesktop.NetworkManager.Device.xml \
	introspection/org.freedesktop.NetworkManager.DHCP4Config.xml \
	introspection/org.freedesktop.NetworkManager.DHCP6Config.xml \
353
	introspection/org.freedesktop.NetworkManager.DnsManager.xml \
354 355 356 357 358 359 360 361 362 363
	introspection/org.freedesktop.NetworkManager.IP4Config.xml \
	introspection/org.freedesktop.NetworkManager.IP6Config.xml \
	introspection/org.freedesktop.NetworkManager.xml \
	introspection/org.freedesktop.NetworkManager.PPP.xml \
	introspection/org.freedesktop.NetworkManager.SecretAgent.xml \
	introspection/org.freedesktop.NetworkManager.Settings.Connection.xml \
	introspection/org.freedesktop.NetworkManager.Settings.xml \
	introspection/org.freedesktop.NetworkManager.VPN.Connection.xml \
	introspection/org.freedesktop.NetworkManager.VPN.Plugin.xml \
	introspection/org.freedesktop.NetworkManager.WiMax.Nsp.xml
364

365 366
CLEANFILES += $(introspection_sources)
CLEANFILES += $(DBUS_INTERFACE_DOCS)
367

368 369 370 371
$(dispatcher_libnm_dispatcher_core_la_OBJECTS): $(introspection_sources)
$(dispatcher_nm_dispatcher_OBJECTS):            $(introspection_sources)
$(libnm_libnm_la_OBJECTS):                      $(introspection_sources)

372
EXTRA_DIST += \
373 374
	$(dbusinterfaces_DATA) \
	introspection/meson.build
375

376 377
###############################################################################

378
libnm_core_lib_h_pub_real = \
379 380 381 382 383 384 385 386 387 388 389 390 391 392
	shared/nm-version-macros.h \
	libnm-core/nm-connection.h \
	libnm-core/nm-core-types.h \
	libnm-core/nm-dbus-interface.h \
	libnm-core/nm-errors.h \
	libnm-core/nm-setting-8021x.h \
	libnm-core/nm-setting-adsl.h \
	libnm-core/nm-setting-bluetooth.h \
	libnm-core/nm-setting-bond.h \
	libnm-core/nm-setting-bridge-port.h \
	libnm-core/nm-setting-bridge.h \
	libnm-core/nm-setting-cdma.h \
	libnm-core/nm-setting-connection.h \
	libnm-core/nm-setting-dcb.h \
393
	libnm-core/nm-setting-dummy.h \
394 395 396 397 398 399 400
	libnm-core/nm-setting-generic.h \
	libnm-core/nm-setting-gsm.h \
	libnm-core/nm-setting-infiniband.h \
	libnm-core/nm-setting-ip-config.h \
	libnm-core/nm-setting-ip-tunnel.h \
	libnm-core/nm-setting-ip4-config.h \
	libnm-core/nm-setting-ip6-config.h \
401
	libnm-core/nm-setting-macsec.h \
402 403
	libnm-core/nm-setting-macvlan.h \
	libnm-core/nm-setting-olpc-mesh.h \
404
	libnm-core/nm-setting-ovs-bridge.h \
405
	libnm-core/nm-setting-ovs-interface.h \
406
	libnm-core/nm-setting-ovs-patch.h \
407
	libnm-core/nm-setting-ovs-port.h \
408 409 410 411
	libnm-core/nm-setting-ppp.h \
	libnm-core/nm-setting-pppoe.h \
	libnm-core/nm-setting-proxy.h \
	libnm-core/nm-setting-serial.h \
412
	libnm-core/nm-setting-tc-config.h \
413 414 415
	libnm-core/nm-setting-team-port.h \
	libnm-core/nm-setting-team.h \
	libnm-core/nm-setting-tun.h \
Thomas Haller's avatar
Thomas Haller committed
416
	libnm-core/nm-setting-user.h \
417 418 419 420 421 422 423 424 425 426 427 428 429 430
	libnm-core/nm-setting-vlan.h \
	libnm-core/nm-setting-vpn.h \
	libnm-core/nm-setting-vxlan.h \
	libnm-core/nm-setting-wimax.h \
	libnm-core/nm-setting-wired.h \
	libnm-core/nm-setting-wireless-security.h \
	libnm-core/nm-setting-wireless.h \
	libnm-core/nm-setting.h \
	libnm-core/nm-simple-connection.h \
	libnm-core/nm-utils.h \
	libnm-core/nm-version.h \
	libnm-core/nm-vpn-dbus-interface.h \
	libnm-core/nm-vpn-editor-plugin.h \
	libnm-core/nm-vpn-plugin-info.h
431
libnm_core_lib_h_pub_mkenums = \
432 433
	libnm-core/nm-core-enum-types.h
libnm_core_lib_h_priv = \
Thomas Haller's avatar
Thomas Haller committed
434
	shared/nm-utils/c-list-util.h \
435
	shared/nm-utils/nm-dedup-multi.h \
436
	shared/nm-utils/nm-enum-utils.h \
437
	shared/nm-utils/nm-hash-utils.h \
438
	shared/nm-utils/nm-shared-utils.h \
439
	shared/nm-utils/nm-random-utils.h \
440
	shared/nm-utils/nm-udev-utils.h \
441
	shared/nm-utils/siphash24.h \
442
	shared/nm-meta-setting.h \
443 444 445 446 447 448 449 450 451
	libnm-core/crypto.h \
	libnm-core/nm-connection-private.h \
	libnm-core/nm-core-internal.h \
	libnm-core/nm-core-types-internal.h \
	libnm-core/nm-keyfile-internal.h \
	libnm-core/nm-keyfile-utils.h \
	libnm-core/nm-property-compare.h \
	libnm-core/nm-setting-private.h \
	libnm-core/nm-utils-private.h
452
libnm_core_lib_c_settings_real = \
453 454 455 456 457 458 459 460 461
	libnm-core/nm-setting-8021x.c \
	libnm-core/nm-setting-adsl.c \
	libnm-core/nm-setting-bluetooth.c \
	libnm-core/nm-setting-bond.c \
	libnm-core/nm-setting-bridge-port.c \
	libnm-core/nm-setting-bridge.c \
	libnm-core/nm-setting-cdma.c \
	libnm-core/nm-setting-connection.c \
	libnm-core/nm-setting-dcb.c \
462
	libnm-core/nm-setting-dummy.c \
463 464 465 466 467 468 469
	libnm-core/nm-setting-generic.c \
	libnm-core/nm-setting-gsm.c \
	libnm-core/nm-setting-infiniband.c \
	libnm-core/nm-setting-ip-config.c \
	libnm-core/nm-setting-ip-tunnel.c \
	libnm-core/nm-setting-ip4-config.c \
	libnm-core/nm-setting-ip6-config.c \
470
	libnm-core/nm-setting-macsec.c \
471 472
	libnm-core/nm-setting-macvlan.c \
	libnm-core/nm-setting-olpc-mesh.c \
473
	libnm-core/nm-setting-ovs-bridge.c \
474
	libnm-core/nm-setting-ovs-interface.c \
475
	libnm-core/nm-setting-ovs-patch.c \
476
	libnm-core/nm-setting-ovs-port.c \
477 478 479 480
	libnm-core/nm-setting-ppp.c \
	libnm-core/nm-setting-pppoe.c \
	libnm-core/nm-setting-proxy.c \
	libnm-core/nm-setting-serial.c \
481
	libnm-core/nm-setting-tc-config.c \
482 483 484
	libnm-core/nm-setting-team-port.c \
	libnm-core/nm-setting-team.c \
	libnm-core/nm-setting-tun.c \
Thomas Haller's avatar
Thomas Haller committed
485
	libnm-core/nm-setting-user.c \
486 487 488 489 490 491
	libnm-core/nm-setting-vlan.c \
	libnm-core/nm-setting-vpn.c \
	libnm-core/nm-setting-vxlan.c \
	libnm-core/nm-setting-wimax.c \
	libnm-core/nm-setting-wired.c \
	libnm-core/nm-setting-wireless-security.c \
492 493 494 495 496 497 498 499 500 501 502 503 504 505 506
	libnm-core/nm-setting-wireless.c
libnm_core_lib_c_real = \
	$(libnm_core_lib_c_settings_real) \
	shared/nm-utils/c-list-util.c \
	shared/nm-utils/nm-dedup-multi.c \
	shared/nm-utils/nm-enum-utils.c \
	shared/nm-utils/nm-hash-utils.c \
	shared/nm-utils/nm-shared-utils.c \
	shared/nm-utils/nm-random-utils.c \
	shared/nm-utils/nm-udev-utils.c \
	shared/nm-meta-setting.c \
	libnm-core/crypto.c \
	libnm-core/nm-connection.c \
	libnm-core/nm-dbus-utils.c \
	libnm-core/nm-errors.c \
507
	libnm-core/nm-keyfile.c \
508 509
	libnm-core/nm-keyfile-utils.c \
	libnm-core/nm-property-compare.c \
510 511 512 513 514
	libnm-core/nm-setting.c \
	libnm-core/nm-simple-connection.c \
	libnm-core/nm-utils.c \
	libnm-core/nm-vpn-editor-plugin.c \
	libnm-core/nm-vpn-plugin-info.c
515 516 517

if WITH_JSON_VALIDATION
libnm_core_lib_h_priv += \
518
	libnm-core/nm-json.h
519
libnm_core_lib_c_real += \
520
	libnm-core/nm-json.c
521 522
endif

523
libnm_core_lib_c_mkenums = \
524 525 526 527
	libnm-core/nm-core-enum-types.c

libnminclude_HEADERS += \
	$(libnm_core_lib_h_pub_real)
528

529
nodist_libnminclude_HEADERS += \
530
	$(libnm_core_lib_h_pub_mkenums)
531 532 533

###############################################################################

534
dflt_cppflags_libnm_core = \
535 536 537 538
	-I$(srcdir)/shared \
	-I$(builddir)/shared \
	-I$(srcdir)/libnm-core \
	-I$(builddir)/libnm-core \
539
	$(CODE_COVERAGE_CFLAGS) \
540
	$(GLIB_CFLAGS) \
541 542
	$(LIBUDEV_CFLAGS) \
	$(SANITIZER_LIB_CFLAGS)
543

544 545 546 547 548 549 550 551
if WITH_GNUTLS
dflt_cppflags_libnm_core += $(GNUTLS_CFLAGS)
endif

if WITH_NSS
dflt_cppflags_libnm_core += $(NSS_CFLAGS)
endif

552 553 554
noinst_LTLIBRARIES += libnm-core/libnm-core.la

GLIB_GENERATED += \
555 556
	$(libnm_core_lib_h_pub_mkenums) \
	$(libnm_core_lib_c_mkenums)
557
nm_core_enum_types_sources = $(libnm_core_lib_h_pub_real)
558

559 560
nm_core_enum_types_MKENUMS_C_FLAGS = --identifier-prefix NM --fhead '\#include "nm-default.h"\n'

561 562
libnm-core/nm-core-enum-types.h.stamp:                                      libnm-core/.dirstamp
libnm-core/nm-core-enum-types.c.stamp:                                      libnm-core/.dirstamp
563

564 565 566 567 568 569 570 571 572 573 574
$(dispatcher_libnm_dispatcher_core_la_OBJECTS):                             $(libnm_core_lib_h_pub_mkenums)
$(dispatcher_nm_dispatcher_OBJECTS):                                        $(libnm_core_lib_h_pub_mkenums)
$(libnm_core_libnm_core_la_OBJECTS):                                        $(libnm_core_lib_h_pub_mkenums)
$(libnm_libnm_la_OBJECTS):                                                  $(libnm_core_lib_h_pub_mkenums)
$(libnm_tests_libnm_vpn_plugin_utils_test_la_OBJECTS):                      $(libnm_core_lib_h_pub_mkenums)
$(src_NetworkManager_OBJECTS):                                              $(libnm_core_lib_h_pub_mkenums)
$(src_devices_adsl_libnm_device_plugin_adsl_la_OBJECTS):                    $(libnm_core_lib_h_pub_mkenums)
$(src_devices_bluetooth_libnm_device_plugin_bluetooth_la_OBJECTS):          $(libnm_core_lib_h_pub_mkenums)
$(src_devices_team_libnm_device_plugin_team_la_OBJECTS):                    $(libnm_core_lib_h_pub_mkenums)
$(src_devices_wifi_libnm_device_plugin_wifi_la_OBJECTS):                    $(libnm_core_lib_h_pub_mkenums)
$(src_devices_wwan_libnm_device_plugin_wwan_la_OBJECTS):                    $(libnm_core_lib_h_pub_mkenums)
575

576
libnm_core_libnm_core_la_CPPFLAGS = \
577
	$(dflt_cppflags_libnm_core) \
578
	-DG_LOG_DOMAIN=\""libnm"\" \
579
	-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_LIBNM_CORE \
580 581 582
	-DLOCALEDIR=\"$(datadir)/locale\" \
	-DNMCONFDIR=\"$(nmconfdir)\" \
	-DNMLIBDIR=\"$(nmlibdir)\" \
583 584
	-DNMVPNDIR=\"$(pkglibdir)\" \
	-DNMPLUGINDIR=\"$(plugindir)\" \
585
	-DLIBEXECDIR=\"$(libexecdir)\" \
586
	$(NULL)
587

588 589 590 591
if WITH_JSON_VALIDATION
libnm_core_libnm_core_la_CPPFLAGS += $(JANSSON_CFLAGS)
endif

592
libnm_core_libnm_core_la_SOURCES = \
593 594 595 596 597
	$(libnm_core_lib_h_pub_real) \
	$(libnm_core_lib_h_priv) \
	$(libnm_core_lib_c_real)

nodist_libnm_core_libnm_core_la_SOURCES = \
598 599
	$(libnm_core_lib_h_pub_mkenums) \
	$(libnm_core_lib_c_mkenums)
600 601 602

libnm_core_libnm_core_la_LIBADD = \
	$(GLIB_LIBS) \
603 604
	$(UUID_LIBS) \
	$(LIBUDEV_LIBS)
605

606
libnm_core_libnm_core_la_LDFLAGS = \
607 608
	$(CODE_COVERAGE_LDFLAGS) \
	$(SANITIZER_LIB_LDFLAGS)
609 610

if WITH_GNUTLS
611
libnm_core_lib_c_real += libnm-core/crypto_gnutls.c
612 613 614 615
libnm_core_libnm_core_la_LIBADD += $(GNUTLS_LIBS)
endif

if WITH_NSS
616
libnm_core_lib_c_real += libnm-core/crypto_nss.c
617 618 619
libnm_core_libnm_core_la_LIBADD += $(NSS_LIBS)
endif

620 621
EXTRA_DIST += \
	libnm-core/crypto_gnutls.c \
622
	libnm-core/crypto_nss.c \
623 624 625
	libnm-core/nm-core-enum-types.c.template \
	libnm-core/nm-core-enum-types.h.template \
	libnm-core/meson.build
626

627
libnm-core/nm-vpn-dbus-types.xml: libnm-core/nm-vpn-dbus-interface.h tools/enums-to-docbook.pl
628
	@$(MKDIR_P) libnm-core/
629
	$(AM_V_GEN) @PERL@ $(srcdir)/tools/enums-to-docbook.pl 'nm-vpn-dbus-types' 'VPN Plugin D-Bus API Types' $< >$@
630

631
libnm-core/nm-dbus-types.xml: libnm-core/nm-dbus-interface.h tools/enums-to-docbook.pl
632
	@$(MKDIR_P) libnm-core/
633
	$(AM_V_GEN) @PERL@ $(srcdir)/tools/enums-to-docbook.pl 'nm-dbus-types' 'NetworkManager D-Bus API Types' $< >$@
634 635 636 637 638

BUILT_SOURCES += \
	libnm-core/nm-vpn-dbus-types.xml \
	libnm-core/nm-dbus-types.xml

639 640 641 642
dist_dependencies += \
	libnm-core/nm-vpn-dbus-types.xml \
	libnm-core/nm-dbus-types.xml

643 644
###############################################################################

645
check_programs += \
646 647 648 649 650
	libnm-core/tests/test-compare \
	libnm-core/tests/test-crypto \
	libnm-core/tests/test-general \
	libnm-core/tests/test-keyfile \
	libnm-core/tests/test-secrets \
651
	libnm-core/tests/test-setting \
652 653 654 655 656 657 658
	libnm-core/tests/test-settings-defaults

GLIB_GENERATED += \
	libnm-core/tests/nm-core-tests-enum-types.h \
	libnm-core/tests/nm-core-tests-enum-types.c
nm_core_tests_enum_types_sources = libnm-core/tests/test-general-enums.h

659 660 661
libnm-core/tests/nm-core-tests-enum-types.h.stamp: libnm-core/tests/.dirstamp
libnm-core/tests/nm-core-tests-enum-types.c.stamp: libnm-core/tests/.dirstamp

662 663
$(libnm_core_tests_test_general_OBJECTS): libnm-core/tests/nm-core-tests-enum-types.h

664
libnm_core_tests_cppflags = \
665
	$(dflt_cppflags_libnm_core) \
666
	-I$(srcdir)/libnm-core/tests \
667
	-I$(builddir)/libnm-core/tests \
668 669
	-DNETWORKMANAGER_COMPILATION_TEST \
	-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_LIBNM_CORE \
670 671 672 673 674 675 676
	-DTEST_CERT_DIR=\"$(abs_srcdir)/libnm-core/tests/certs\"

libnm_core_tests_test_compare_CPPFLAGS = $(libnm_core_tests_cppflags)
libnm_core_tests_test_crypto_CPPFLAGS = $(libnm_core_tests_cppflags)
libnm_core_tests_test_general_CPPFLAGS = $(libnm_core_tests_cppflags)
libnm_core_tests_test_keyfile_CPPFLAGS = $(libnm_core_tests_cppflags)
libnm_core_tests_test_secrets_CPPFLAGS = $(libnm_core_tests_cppflags)
677
libnm_core_tests_test_setting_CPPFLAGS = $(libnm_core_tests_cppflags)
678 679 680 681 682 683
libnm_core_tests_test_settings_defaults_CPPFLAGS = $(libnm_core_tests_cppflags)

libnm_core_tests_test_general_SOURCES = \
	libnm-core/tests/test-general-enums.h \
	libnm-core/tests/test-general.c

684 685 686 687
nodist_libnm_core_tests_test_general_SOURCES = \
	libnm-core/tests/nm-core-tests-enum-types.c \
	libnm-core/tests/nm-core-tests-enum-types.h

688 689 690 691
libnm_core_tests_ldadd = \
	libnm-core/libnm-core.la \
	$(GLIB_LIBS)

692 693 694
libnm_core_tests_ldflags = \
	$(SANITIZER_LIB_LDFLAGS)

695 696 697 698 699
libnm_core_tests_test_compare_LDADD = $(libnm_core_tests_ldadd)
libnm_core_tests_test_crypto_LDADD = $(libnm_core_tests_ldadd)
libnm_core_tests_test_general_LDADD = $(libnm_core_tests_ldadd)
libnm_core_tests_test_keyfile_LDADD = $(libnm_core_tests_ldadd)
libnm_core_tests_test_secrets_LDADD = $(libnm_core_tests_ldadd)
700
libnm_core_tests_test_setting_LDADD = $(libnm_core_tests_ldadd)
701 702
libnm_core_tests_test_settings_defaults_LDADD = $(libnm_core_tests_ldadd)

703 704 705 706 707 708 709 710
libnm_core_tests_test_compare_LDFLAGS = $(libnm_core_tests_ldflags)
libnm_core_tests_test_crypto_LDFLAGS = $(libnm_core_tests_ldflags)
libnm_core_tests_test_general_LDFLAGS = $(libnm_core_tests_ldflags)
libnm_core_tests_test_keyfile_LDFLAGS = $(libnm_core_tests_ldflags)
libnm_core_tests_test_secrets_LDFLAGS = $(libnm_core_tests_ldflags)
libnm_core_tests_test_setting_LDFLAGS = $(libnm_core_tests_ldflags)
libnm_core_tests_test_settings_defaults_LDFLAGS = $(libnm_core_tests_ldflags)

711 712 713 714 715
$(libnm_core_tests_test_compare_OBJECTS): $(libnm_core_lib_h_pub_mkenums)
$(libnm_core_tests_test_crypto_OBJECTS): $(libnm_core_lib_h_pub_mkenums)
$(libnm_core_tests_test_general_OBJECTS): $(libnm_core_lib_h_pub_mkenums)
$(libnm_core_tests_test_keyfile_OBJECTS): $(libnm_core_lib_h_pub_mkenums)
$(libnm_core_tests_test_secrets_OBJECTS): $(libnm_core_lib_h_pub_mkenums)
716
$(libnm_core_tests_test_setting_OBJECTS): $(libnm_core_lib_h_pub_mkenums)
717 718
$(libnm_core_tests_test_settings_defaults_OBJECTS): $(libnm_core_lib_h_pub_mkenums)

719 720 721
# test-cert.p12 created with:
#
# openssl pkcs12 -export \
722 723 724 725 726
#    -in test_key_and_cert.pem \
#    -inkey test_key_and_cert.pem \
#    -certfile test_ca_cert.pem \
#    -name "test-pkcs12" \
#    -out test-cert.p12
727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744

EXTRA_DIST += \
	libnm-core/tests/certs/ca-no-ending-newline.pem \
	libnm-core/tests/certs/pkcs8-decrypted.der \
	libnm-core/tests/certs/pkcs8-enc-key.pem \
	libnm-core/tests/certs/pkcs8-noenc-key.pem \
	libnm-core/tests/certs/test2_ca_cert.pem \
	libnm-core/tests/certs/test2-cert.p12 \
	libnm-core/tests/certs/test2_key_and_cert.pem \
	libnm-core/tests/certs/test-aes-key.pem \
	libnm-core/tests/certs/test_ca_cert.der \
	libnm-core/tests/certs/test_ca_cert.pem \
	libnm-core/tests/certs/test-ca-cert.pem \
	libnm-core/tests/certs/test-cert.p12 \
	libnm-core/tests/certs/test_key_and_cert.pem \
	libnm-core/tests/certs/test-key-and-cert.pem \
	libnm-core/tests/certs/test-key-only-decrypted.der \
	libnm-core/tests/certs/test-key-only-decrypted.pem \
745 746 747 748
	libnm-core/tests/certs/test-key-only.pem \
	libnm-core/tests/nm-core-tests-enum-types.c.template \
	libnm-core/tests/nm-core-tests-enum-types.h.template \
	libnm-core/tests/meson.build
749 750 751

###############################################################################

752
libnm_lib_h_pub_real = \
753 754 755 756
	shared/nm-version-macros.h \
	libnm/NetworkManager.h \
	libnm/nm-access-point.h \
	libnm/nm-active-connection.h \
757
	libnm/nm-autoptr.h \
758
	libnm/nm-checkpoint.h \
759 760 761 762 763
	libnm/nm-client.h \
	libnm/nm-device-adsl.h \
	libnm/nm-device-bond.h \
	libnm/nm-device-bridge.h \
	libnm/nm-device-bt.h \
764
	libnm/nm-device-dummy.h \
765 766 767 768
	libnm/nm-device-ethernet.h \
	libnm/nm-device-generic.h \
	libnm/nm-device-infiniband.h \
	libnm/nm-device-ip-tunnel.h \
769
	libnm/nm-device-macsec.h \
770 771 772
	libnm/nm-device-macvlan.h \
	libnm/nm-device-modem.h \
	libnm/nm-device-olpc-mesh.h \
773
	libnm/nm-device-ovs-interface.h \
774
	libnm/nm-device-ovs-port.h \
775
	libnm/nm-device-ovs-bridge.h \
Beniamino Galvani's avatar
Beniamino Galvani committed
776
	libnm/nm-device-ppp.h \
777 778 779 780 781 782 783 784 785 786 787
	libnm/nm-device-team.h \
	libnm/nm-device-tun.h \
	libnm/nm-device-vlan.h \
	libnm/nm-device-vxlan.h \
	libnm/nm-device-wifi.h \
	libnm/nm-device-wimax.h \
	libnm/nm-device.h \
	libnm/nm-dhcp-config.h \
	libnm/nm-ip-config.h \
	libnm/nm-object.h \
	libnm/nm-remote-connection.h \
788
	libnm/nm-secret-agent-old.h \
789 790 791 792
	libnm/nm-types.h \
	libnm/nm-vpn-connection.h \
	libnm/nm-vpn-editor.h \
	libnm/nm-vpn-plugin-old.h \
793 794
	libnm/nm-vpn-service-plugin.h \
	libnm/nm-wimax-nsp.h
795
libnm_lib_h_pub_mkenums = \
796 797
	libnm/nm-enum-types.h
libnm_lib_h_priv = \
798
	libnm/nm-libnm-utils.h \
799 800 801 802
	libnm/nm-dbus-helpers.h \
	libnm/nm-device-private.h \
	libnm/nm-dhcp4-config.h \
	libnm/nm-dhcp6-config.h \
803
	libnm/nm-dns-manager.h \
804 805 806 807 808 809
	libnm/nm-ip4-config.h \
	libnm/nm-ip6-config.h \
	libnm/nm-manager.h \
	libnm/nm-object-private.h \
	libnm/nm-remote-connection-private.h \
	libnm/nm-remote-settings.h
810
libnm_lib_c_real = \
811 812
	libnm/nm-access-point.c \
	libnm/nm-active-connection.c \
813
	libnm/nm-checkpoint.c \
814 815 816 817 818 819
	libnm/nm-client.c \
	libnm/nm-dbus-helpers.c \
	libnm/nm-device-adsl.c \
	libnm/nm-device-bond.c \
	libnm/nm-device-bridge.c \
	libnm/nm-device-bt.c \
820
	libnm/nm-device-dummy.c \
821 822 823 824
	libnm/nm-device-ethernet.c \
	libnm/nm-device-generic.c \
	libnm/nm-device-infiniband.c \
	libnm/nm-device-ip-tunnel.c \
825
	libnm/nm-device-macsec.c \
826 827 828
	libnm/nm-device-macvlan.c \
	libnm/nm-device-modem.c \
	libnm/nm-device-olpc-mesh.c \
829
	libnm/nm-device-ovs-interface.c \
830
	libnm/nm-device-ovs-port.c \
831
	libnm/nm-device-ovs-bridge.c \
Beniamino Galvani's avatar
Beniamino Galvani committed
832
	libnm/nm-device-ppp.c \
833 834 835 836 837 838 839 840 841 842
	libnm/nm-device-team.c \
	libnm/nm-device-tun.c \
	libnm/nm-device-vlan.c \
	libnm/nm-device-vxlan.c \
	libnm/nm-device-wifi.c \
	libnm/nm-device-wimax.c \
	libnm/nm-device.c \
	libnm/nm-dhcp-config.c \
	libnm/nm-dhcp4-config.c \
	libnm/nm-dhcp6-config.c \
843
	libnm/nm-dns-manager.c \
844 845 846 847 848 849 850 851 852 853 854 855 856
	libnm/nm-ip-config.c \
	libnm/nm-ip4-config.c \
	libnm/nm-ip6-config.c \
	libnm/nm-manager.c \
	libnm/nm-object.c \
	libnm/nm-remote-connection.c \
	libnm/nm-remote-settings.c \
	libnm/nm-secret-agent-old.c \
	libnm/nm-vpn-connection.c \
	libnm/nm-vpn-plugin-old.c \
	libnm/nm-vpn-editor.c \
	libnm/nm-vpn-service-plugin.c \
	libnm/nm-wimax-nsp.c
857
libnm_lib_c_mkenums = \
858 859
	libnm/nm-enum-types.c

860 861 862 863 864
libnm_lib_cppflags = \
	$(dflt_cppflags_libnm_core) \
	-I$(srcdir)/libnm \
	-I$(builddir)/libnm \
	-DG_LOG_DOMAIN=\""libnm"\" \
865
	-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_LIBNM \
866 867
	-DNMRUNDIR=\"$(nmrundir)\"

868
libnminclude_HEADERS += \
869
	$(libnm_lib_h_pub_real)
870 871

nodist_libnminclude_HEADERS += \
872
	$(libnm_lib_h_pub_mkenums)
873 874 875

###############################################################################

876
noinst_LTLIBRARIES += libnm/libnm-utils.la
877 878

libnm_libnm_utils_la_CPPFLAGS = \
879
	$(INTROSPECTION_CFLAGS) \
880 881 882 883 884 885 886 887 888 889 890 891 892 893
	$(libnm_lib_cppflags)

libnm_libnm_utils_la_SOURCES = \
	libnm/nm-libnm-utils.c

libnm_libnm_utils_la_LIBADD = \
	libnm-core/libnm-core.la \
	introspection/libnmdbus.la \
	$(GLIB_LIBS)

$(libnm_libnm_utils_la_OBJECTS) : $(libnm_lib_h_pub_mkenums)

###############################################################################

894 895 896
lib_LTLIBRARIES += libnm/libnm.la

GLIB_GENERATED += \
897 898
	$(libnm_lib_h_pub_mkenums) \
	$(libnm_lib_c_mkenums)
899
nm_enum_types_sources = \
900
	$(libnm_lib_h_pub_mkenums) \
901
	$(libnm_lib_h_pub_real)
902 903 904
nm_enum_types_MKENUMS_H_FLAGS = --identifier-prefix NM --fhead '\#include <nm-core-enum-types.h>\n'
nm_enum_types_MKENUMS_C_FLAGS = --identifier-prefix NM --fhead '\#include "nm-default.h"\n'

905 906 907 908
$(dispatcher_nm_dispatcher_OBJECTS):                    $(libnm_lib_h_pub_mkenums)
$(dispatcher_libnm_dispatcher_core_la_OBJECTS):         $(libnm_lib_h_pub_mkenums)
$(libnm_libnm_la_OBJECTS):                              $(libnm_lib_h_pub_mkenums)
$(libnm_tests_libnm_vpn_plugin_utils_test_la_OBJECTS):  $(libnm_core_lib_h_pub_mkenums)
909

910
libnm_libnm_la_CPPFLAGS = \
911
	$(libnm_lib_cppflags) \
912 913
	$(LIBUDEV_CFLAGS) \
	$(SANITIZER_LIB_CFLAGS)
914 915

libnm_libnm_la_SOURCES = \
916 917 918 919 920
	$(libnm_lib_h_pub_real) \
	$(libnm_lib_h_priv) \
	$(libnm_lib_c_real)

nodist_libnm_libnm_la_SOURCES = \
921 922
	$(libnm_lib_h_pub_mkenums) \
	$(libnm_lib_c_mkenums)
923 924 925 926 927

EXTRA_libnm_libnm_la_DEPENDENCIES = \
	libnm/libnm.ver

libnm_libnm_la_LIBADD = \
928
	libnm/libnm-utils.la \
929 930 931
	$(DL_LIBS) \
	$(GLIB_LIBS) \
	$(UUID_LIBS) \
932
	$(LIBUDEV_LIBS)
933 934 935 936

libnm_libnm_la_LDFLAGS = \
	-Wl,--version-script="$(srcdir)/libnm/libnm.ver" \
	$(CODE_COVERAGE_LDFLAGS) \
937
	$(SANITIZER_LIB_LDFLAGS) \
938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953
	-version-info "1:0:1"

check-local-exports-libnm: libnm/libnm.la
	$(srcdir)/tools/check-exports.sh "$(builddir)/libnm/.libs/libnm.so" "$(srcdir)/libnm/libnm.ver"

check_local += check-local-exports-libnm

pkgconfig_DATA += libnm/libnm.pc

DISTCLEANFILES += \
	libnm/libnm.pc

EXTRA_DIST += \
	libnm/libnm.pc.in \
	libnm/libnm.ver

954
libnm_NM_1_0_typelib =
955 956

if HAVE_INTROSPECTION
957 958
libnm_NM_1_0_typelib += libnm/NM-1.0.typelib

959 960
libnm/NM-1.0.gir: libnm/libnm.la
libnm_NM_1_0_gir_INCLUDES = Gio-2.0
961
libnm_NM_1_0_gir_PACKAGES = gio-2.0
962 963 964
libnm_NM_1_0_gir_EXPORT_PACKAGES = libnm
libnm_NM_1_0_gir_CFLAGS = $(libnm_libnm_la_CPPFLAGS)
libnm_NM_1_0_gir_LIBS = libnm/libnm.la
965
libnm_NM_1_0_gir_FILES = \
966
	$(libnm_core_lib_h_pub_mkenums) \
967
	$(libnm_core_lib_h_pub_real) \
968
	$(libnm_core_lib_c_mkenums) \
969
	$(libnm_core_lib_c_real) \
970
	$(libnm_lib_h_pub_mkenums) \
971
	$(libnm_lib_h_pub_real) \
972
	$(libnm_lib_c_mkenums) \
973
	$(libnm_lib_c_real)
974 975
libnm_NM_1_0_gir_SCANNERFLAGS = --warn-all --identifier-prefix=NM --symbol-prefix=nm

976 977 978 979
libnm/libnm.typelib: libnm/libnm.gir
	$(INTROSPECTION_COMPILER) --includedir=$(srcdir)/libnm-core --includedir=$(builddir)/libnm-core --includedir=$(srcdir)/libnm --includedir=$(builddir)/libnm $< -o $@

INTROSPECTION_GIRS += libnm/NM-1.0.gir
980 981 982

if WITH_FAKE_TYPELIBS

983
libnm/fake-typelib/NetworkManager.typelib: libnm/fake-typelib/NetworkManager.gir libnm/fake-typelib/.dirstamp
984 985
	$(AM_V_GEN)  $(INTROSPECTION_COMPILER) $< -o $@

986
libnm/fake-typelib/NMClient.typelib: libnm/fake-typelib/NMClient.gir libnm/fake-typelib/.dirstamp
987 988 989
	$(AM_V_GEN) $(INTROSPECTION_COMPILER) $< -o $@

libnm/fake-typelib/typelibs.c: libnm/fake-typelib/typelibs.gresource.xml libnm/fake-typelib/NetworkManager.typelib libnm/fake-typelib/NMClient.typelib
990
	$(AM_V_GEN) $(GLIB_COMPILE_RESOURCES) $< --target=$@ --sourcedir=$(builddir)/libnm/fake-typelib --generate-source --manual-register
991

992
nodist_libnm_libnm_utils_la_SOURCES = \
993 994
	libnm/fake-typelib/typelibs.c

995 996 997 998
CLEANFILES += \
	libnm/fake-typelib/typelibs.c \
	libnm/fake-typelib/NMClient.typelib \
	libnm/fake-typelib/NetworkManager.typelib
999 1000
endif

1001 1002
endif

1003 1004 1005
EXTRA_DIST += \
	libnm/fake-typelib/NetworkManager.gir \
	libnm/fake-typelib/NMClient.gir \
1006 1007
	libnm/fake-typelib/typelibs.gresource.xml \
	libnm/fake-typelib/meson.build
1008

1009
if HAVE_INTROSPECTION
1010 1011 1012

libnm_noinst_data = \
	libnm/nm-property-docs.xml \
1013 1014 1015 1016
	libnm/nm-settings-docs-overrides.xml \
	libnm/nm-settings-docs.xml \
	libnm/nm-settings-keyfile-docs.xml \
	libnm/nm-settings-ifcfg-rh-docs.xml
1017 1018 1019

noinst_DATA += $(libnm_noinst_data)

1020
libnm_docs_sources = $(libnm_core_lib_c_settings_real)
1021

1022
libnm/nm-settings-docs-overrides.xml: libnm/generate-plugin-docs.pl $(libnm_docs_sources)
1023
	$(AM_V_GEN) $(srcdir)/libnm/generate-plugin-docs.pl dbus $@ $(filter-out $<,$^)
1024 1025 1026 1027 1028

# When the python scripts loads libnm and the address sanitizers is
# enabled, we must LD_PRELOAD libasan otherwise it will complain that
# it was not loaded as initial library.
libnm/nm-property-docs.xml: libnm/generate-setting-docs.py $(libnm_docs_sources) | libnm/NM-1.0.gir libnm/NM-1.0.typelib libnm/libnm.la
1029
	$(AM_V_GEN) \
1030 1031 1032
	export GI_TYPELIB_PATH=$(abs_builddir)/libnm$${GI_TYPELIB_PATH:+:$$GI_TYPELIB_PATH}; \
	export LD_LIBRARY_PATH=$(abs_builddir)/libnm/.libs$${LD_LIBRARY_PATH:+:$$LD_LIBRARY_PATH}; \
	$(call set_sanitizer_env,$(abs_builddir)/libnm/.libs/libnm.so); \
1033
	"$(PYTHON)" \
1034 1035 1036 1037
	$(srcdir)/libnm/generate-setting-docs.py \
		--gir $(builddir)/libnm/NM-1.0.gir \
		--output $@

1038
libnm/nm-settings-docs.xml: libnm/generate-setting-docs.py libnm/nm-settings-docs-overrides.xml $(libnm_docs_sources) | libnm/NM-1.0.gir libnm/NM-1.0.typelib libnm/libnm.la
1039
	$(AM_V_GEN) \
1040 1041 1042
	export GI_TYPELIB_PATH=$(abs_builddir)/libnm$${GI_TYPELIB_PATH:+:$$GI_TYPELIB_PATH}; \
	export LD_LIBRARY_PATH=$(abs_builddir)/libnm/.libs$${LD_LIBRARY_PATH:+:$$LD_LIBRARY_PATH}; \
	$(call set_sanitizer_env,$(abs_builddir)/libnm/.libs/libnm.so); \
1043
	"$(PYTHON)" \
1044 1045
	$(srcdir)/libnm/generate-setting-docs.py \
		--gir $(builddir)/libnm/NM-1.0.gir \
1046
		--overrides $(word 2,$^) \
1047 1048
		--output $@

1049
libnm/nm-settings-keyfile-docs.xml: libnm/generate-plugin-docs.pl $(libnm_docs_sources)
1050
	$(AM_V_GEN) $(srcdir)/libnm/generate-plugin-docs.pl keyfile $@ $(filter-out $<,$^)
1051
libnm/nm-settings-ifcfg-rh-docs.xml: libnm/generate-plugin-docs.pl $(libnm_docs_sources)
1052
	$(AM_V_GEN) $(srcdir)/libnm/generate-plugin-docs.pl ifcfg-rh $@ $(filter-out $<,$^)
1053 1054 1055 1056 1057 1058 1059

EXTRA_DIST += $(libnm_noinst_data)

endif

EXTRA_DIST += \
	libnm/generate-setting-docs.py \
1060 1061 1062 1063
	libnm/generate-plugin-docs.pl \
	libnm/nm-enum-types.c.template \
	libnm/nm-enum-types.h.template \
	libnm/meson.build
1064 1065 1066

###############################################################################

1067
libnm_tests_programs = \
1068 1069 1070 1071 1072
	libnm/tests/test-general

check_programs += $(libnm_tests_programs)

libnm_tests_programs_req_introspection = \
1073 1074 1075 1076
	libnm/tests/test-nm-client \
	libnm/tests/test-remote-settings-client \
	libnm/tests/test-secret-agent

1077 1078 1079 1080 1081
if HAVE_INTROSPECTION
check_programs += $(libnm_tests_programs_req_introspection)
else
check_programs_norun += $(libnm_tests_programs_req_introspection)
endif
1082 1083

libnm_tests_cppflags = \
1084
	$(dflt_cppflags_libnm_core) \
1085 1086
	-I$(srcdir)/libnm \
	-I$(builddir)/libnm \
1087 1088
	-DNETWORKMANAGER_COMPILATION_TEST \
	-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_LIBNM \
1089
	-DTEST_NM_SERVICE=\"$(abs_srcdir)/tools/test-networkmanager-service.py\"
1090 1091

libnm_tests_ldadd = \
1092
	libnm/libnm.la \
1093 1094
	$(GLIB_LIBS)

1095 1096 1097
libnm_tests_ldflags = \
	$(SANITIZER_LIB_LDFLAGS)

1098
libnm_tests_test_general_CPPFLAGS = $(libnm_tests_cppflags)
1099 1100 1101 1102
libnm_tests_test_nm_client_CPPFLAGS = $(libnm_tests_cppflags)
libnm_tests_test_remote_settings_client_CPPFLAGS = $(libnm_tests_cppflags)
libnm_tests_test_secret_agent_CPPFLAGS = $(libnm_tests_cppflags)

1103
libnm_tests_test_general_SOURCES = \
1104
	shared/nm-utils/nm-compat.c \
1105 1106
	libnm/tests/test-general.c

1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121
libnm_tests_test_nm_client_SOURCES = \
	shared/nm-test-utils-impl.c \
	shared/nm-test-libnm-utils.h \
	libnm/tests/test-nm-client.c

libnm_tests_test_remote_settings_client_SOURCES = \
	shared/nm-test-utils-impl.c \
	shared/nm-test-libnm-utils.h \
	libnm/tests/test-remote-settings-client.c

libnm_tests_test_secret_agent_SOURCES = \
	shared/nm-test-utils-impl.c \
	shared/nm-test-libnm-utils.h \
	libnm/tests/test-secret-agent.c

1122 1123 1124
libnm_tests_test_general_LDADD = \
	libnm/libnm-utils.la \
	$(libnm_tests_ldadd)
1125 1126 1127 1128
libnm_tests_test_nm_client_LDADD = $(libnm_tests_ldadd)
libnm_tests_test_remote_settings_client_LDADD = $(libnm_tests_ldadd)
libnm_tests_test_secret_agent_LDADD = $(libnm_tests_ldadd)

1129 1130 1131 1132 1133
libnm_tests_test_general_LDFLAGS = $(libnm_tests_ldflags)
libnm_tests_test_nm_client_LDFLAGS = $(libnm_tests_ldflags)
libnm_tests_test_remote_settings_client_LDFLAGS = $(libnm_tests_ldflags)
libnm_tests_test_secret_agent_LDFLAGS = $(libnm_tests_ldflags)

1134
$(libnm_tests_test_general_OBJECTS): $(libnm_core_lib_h_pub_mkenums)
1135 1136 1137 1138
$(libnm_tests_test_nm_client_OBJECTS): $(libnm_core_lib_h_pub_mkenums)
$(libnm_tests_test_remote_settings_client_OBJECTS): $(libnm_core_lib_h_pub_mkenums)
$(libnm_tests_test_secret_agent_OBJECTS): $(libnm_core_lib_h_pub_mkenums)

1139 1140 1141 1142 1143 1144
# tools/test-networkmanager-service.py uses libnm's typelib. Ensure it
# is built first.
$(libnm_tests_test_nm_client_OBJECTS):              $(libnm_NM_1_0_typelib)
$(libnm_tests_test_remote_settings_client_OBJECTS): $(libnm_NM_1_0_typelib)
$(libnm_tests_test_secret_agent_OBJECTS):           $(libnm_NM_1_0_typelib)

1145 1146 1147 1148
###############################################################################

# just test, that we can build "nm-vpn-plugin-utils.c"

1149
check_ltlibraries += libnm/tests/libnm-vpn-plugin-utils-test.la
1150 1151

libnm_tests_libnm_vpn_plugin_utils_test_la_SOURCES = \
1152 1153
	shared/nm-utils/nm-vpn-plugin-utils.c \
	shared/nm-utils/nm-vpn-plugin-utils.h
1154 1155

libnm_tests_libnm_vpn_plugin_utils_test_la_CFLAGS = \
1156 1157 1158 1159 1160 1161
	-I$(srcdir)/shared \
	-I$(builddir)/shared \
	-I$(srcdir)/libnm-core \
	-I$(builddir)/libnm-core \
	-I$(srcdir)/libnm \
	-I$(builddir)/libnm \
1162
	$(GLIB_CFLAGS) \
1163
	$(SANITIZER_EXEC_CFLAGS) \
1164 1165
	-DNETWORKMANAGER_COMPILATION_TEST \
	-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_CLIENT
1166 1167

libnm_tests_libnm_vpn_plugin_utils_test_la_LIBADD = \
1168
	$(GLIB_LIBS)
1169

1170 1171 1172
EXTRA_DIST += \
	libnm/tests/meson.build

1173 1174 1175 1176 1177
###############################################################################
# src/
###############################################################################

src_cppflags = \
1178
	$(dflt_cppflags_libnm_core) \
1179 1180
	-I$(srcdir)/src \
	-I$(builddir)/src \
1181
	\
1182
	-DPREFIX=\"$(prefix)\" \
1183
	-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_DAEMON \
1184 1185 1186 1187 1188