Makefile.am 169 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
nmlocaledir = $(datadir)/locale

86 87 88
GLIB_MKENUMS_H_FLAGS = --identifier-prefix NM
GLIB_MKENUMS_C_FLAGS = --identifier-prefix NM

89
SUBDIRS = \
90
	. \
91 92
	po

93
if HAVE_DOCS
94 95

SUBDIRS += \
96 97 98 99 100 101 102 103 104
	docs/libnm \
	docs/api

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

105 106
endif

107 108
###############################################################################

109 110 111 112 113
nm_build_cflags = \
	-DNM_BUILD_SRCDIR=\"$(abs_srcdir)\" \
	-DNM_BUILD_BUILDDIR=\"$(abs_builddir)\" \
	$(NULL)

114 115
set_sanitizer_env = \
	[ -n "$(SANITIZER_ENV)" ] && export $(SANITIZER_ENV) ; \
116 117 118
	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)"; \
119 120 121
	fi

check_so_symbols = \
122
	$(call set_sanitizer_env,$(1),$(builddir)/src/NetworkManager); \
123
	LD_BIND_NOW=1 LD_PRELOAD=$${LD_PRELOAD}:$(1) $(builddir)/src/NetworkManager --version >/dev/null
124 125 126

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

127 128 129 130 131 132 133 134 135
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 \
136
	--disable-dependency-tracking
137

138
dist-configure-check:
139
	@echo "*** 'make dist' requires '--enable-gtk-doc --enable-introspection --with-libnm-glib'. ***"
140
	@false
141
if !BUILD_DOCS
142 143 144 145
dist_configure_check += dist-configure-check
endif
if !WITH_LEGACY_LIBRARIES
dist_configure_check += dist-configure-check
146 147
endif

148
dist: $(dist_configure_check) $(dist_dependencies)
149

150
DISTCLEANFILES += intltool-extract intltool-merge intltool-update
151 152 153

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

154
if WITH_LEGACY_LIBRARIES
155
pkgconfig_DATA += NetworkManager.pc
156
endif
157 158

###############################################################################
159

160 161 162
polkit_policydir = $(datadir)/polkit-1/actions

dist_polkit_policy_in_in_files = \
163
	data/org.freedesktop.NetworkManager.policy.in.in
164 165 166 167 168 169 170 171 172

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

@INTLTOOL_POLICY_RULE@

DISTCLEANFILES += $(polkit_policy_DATA)

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

173 174 175
noinst_LTLIBRARIES += \
	introspection/libnmdbus.la

176
introspection_libnmdbus_la_CPPFLAGS = $(GLIB_CFLAGS)
177

178
introspection_sources = \
179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194
	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 \
195 196
	introspection/org.freedesktop.NetworkManager.Device.Dummy.c \
	introspection/org.freedesktop.NetworkManager.Device.Dummy.h \
197 198 199 200 201 202 203 204
	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 \
205 206
	introspection/org.freedesktop.NetworkManager.Device.Macsec.c \
	introspection/org.freedesktop.NetworkManager.Device.Macsec.h \
207 208 209 210 211 212
	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 \
213 214
	introspection/org.freedesktop.NetworkManager.Device.OvsInterface.c \
	introspection/org.freedesktop.NetworkManager.Device.OvsInterface.h \
215 216
	introspection/org.freedesktop.NetworkManager.Device.OvsPort.c \
	introspection/org.freedesktop.NetworkManager.Device.OvsPort.h \
217 218
	introspection/org.freedesktop.NetworkManager.Device.OvsBridge.c \
	introspection/org.freedesktop.NetworkManager.Device.OvsBridge.h \
Beniamino Galvani's avatar
Beniamino Galvani committed
219 220
	introspection/org.freedesktop.NetworkManager.Device.Ppp.c \
	introspection/org.freedesktop.NetworkManager.Device.Ppp.h \
221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242
	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 \
243 244
	introspection/org.freedesktop.NetworkManager.DnsManager.c \
	introspection/org.freedesktop.NetworkManager.DnsManager.h \
245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262
	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
263

264 265
nodist_introspection_libnmdbus_la_SOURCES = $(introspection_sources)

266
DBUS_INTERFACE_DOCS = \
267 268 269 270 271 272 273 274 275 276 277 278
	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 \
279
	docs/api/dbus-org.freedesktop.NetworkManager.Device.Dummy.xml \
280 281 282
	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 \
283
	docs/api/dbus-org.freedesktop.NetworkManager.Device.Macsec.xml \
284 285 286 287 288 289 290 291 292 293
	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 \
294
	docs/api/dbus-org.freedesktop.NetworkManager.Device.OvsInterface.xml \
295
	docs/api/dbus-org.freedesktop.NetworkManager.Device.OvsPort.xml \
296
	docs/api/dbus-org.freedesktop.NetworkManager.Device.OvsBridge.xml \
Beniamino Galvani's avatar
Beniamino Galvani committed
297
	docs/api/dbus-org.freedesktop.NetworkManager.Device.Ppp.xml \
298 299 300 301 302 303 304 305 306
	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 \
307 308
	docs/api/dbus-org.freedesktop.NetworkManager.Device.Statistics.xml \
	docs/api/dbus-org.freedesktop.NetworkManager.DnsManager.xml
309 310

introspection/%.c: introspection/%.xml
311
	@$(MKDIR_P) introspection/
312 313 314
	$(AM_V_GEN) gdbus-codegen \
		--generate-c-code $(basename $@) \
		--generate-docbook docs/api/dbus \
315 316
		--c-namespace NMDBus \
		--interface-prefix org.freedesktop.NetworkManager \
317
		$<
318

319 320
introspection/%.h: introspection/%.c
	$()
321

322 323
docs/api/dbus-%.xml: introspection/%.c
	$()
324

325
dbusinterfacesdir = $(datadir)/dbus-1/interfaces
326

327
dbusinterfaces_DATA = \
328 329 330 331 332 333 334 335
	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 \
336
	introspection/org.freedesktop.NetworkManager.Device.Dummy.xml \
337 338 339 340
	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 \
341
	introspection/org.freedesktop.NetworkManager.Device.Macsec.xml \
342 343 344
	introspection/org.freedesktop.NetworkManager.Device.Macvlan.xml \
	introspection/org.freedesktop.NetworkManager.Device.Modem.xml \
	introspection/org.freedesktop.NetworkManager.Device.OlpcMesh.xml \
345
	introspection/org.freedesktop.NetworkManager.Device.OvsInterface.xml \
346
	introspection/org.freedesktop.NetworkManager.Device.OvsPort.xml \
347
	introspection/org.freedesktop.NetworkManager.Device.OvsBridge.xml \
Beniamino Galvani's avatar
Beniamino Galvani committed
348
	introspection/org.freedesktop.NetworkManager.Device.Ppp.xml \
349 350 351 352 353 354 355 356 357 358 359
	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 \
360
	introspection/org.freedesktop.NetworkManager.DnsManager.xml \
361 362 363 364 365 366 367 368 369 370
	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
371

372 373
CLEANFILES += $(introspection_sources)
CLEANFILES += $(DBUS_INTERFACE_DOCS)
374

375 376 377 378
$(dispatcher_libnm_dispatcher_core_la_OBJECTS): $(introspection_sources)
$(dispatcher_nm_dispatcher_OBJECTS):            $(introspection_sources)
$(libnm_libnm_la_OBJECTS):                      $(introspection_sources)

379
EXTRA_DIST += \
380 381
	$(dbusinterfaces_DATA) \
	introspection/meson.build
382

383 384
###############################################################################

385
libnm_core_lib_h_pub_real = \
386 387 388 389 390 391 392 393 394 395 396 397 398 399
	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 \
400
	libnm-core/nm-setting-dummy.h \
401 402 403 404 405 406 407
	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 \
408
	libnm-core/nm-setting-macsec.h \
409 410
	libnm-core/nm-setting-macvlan.h \
	libnm-core/nm-setting-olpc-mesh.h \
411
	libnm-core/nm-setting-ovs-bridge.h \
412
	libnm-core/nm-setting-ovs-interface.h \
413
	libnm-core/nm-setting-ovs-patch.h \
414
	libnm-core/nm-setting-ovs-port.h \
415 416 417 418
	libnm-core/nm-setting-ppp.h \
	libnm-core/nm-setting-pppoe.h \
	libnm-core/nm-setting-proxy.h \
	libnm-core/nm-setting-serial.h \
419
	libnm-core/nm-setting-tc-config.h \
420 421 422
	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
423
	libnm-core/nm-setting-user.h \
424 425 426 427 428 429 430 431 432 433 434 435 436 437
	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
438
libnm_core_lib_h_pub_mkenums = \
439 440
	libnm-core/nm-core-enum-types.h
libnm_core_lib_h_priv = \
Thomas Haller's avatar
Thomas Haller committed
441
	shared/nm-utils/c-list-util.h \
442
	shared/nm-utils/nm-dedup-multi.h \
443
	shared/nm-utils/nm-enum-utils.h \
444
	shared/nm-utils/nm-hash-utils.h \
445
	shared/nm-utils/nm-shared-utils.h \
446
	shared/nm-utils/nm-random-utils.h \
447
	shared/nm-utils/nm-udev-utils.h \
448
	shared/nm-meta-setting.h \
449 450 451 452 453 454 455 456 457
	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
458
libnm_core_lib_c_settings_real = \
459 460 461 462 463 464 465 466 467
	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 \
468
	libnm-core/nm-setting-dummy.c \
469 470 471 472 473 474 475
	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 \
476
	libnm-core/nm-setting-macsec.c \
477 478
	libnm-core/nm-setting-macvlan.c \
	libnm-core/nm-setting-olpc-mesh.c \
479
	libnm-core/nm-setting-ovs-bridge.c \
480
	libnm-core/nm-setting-ovs-interface.c \
481
	libnm-core/nm-setting-ovs-patch.c \
482
	libnm-core/nm-setting-ovs-port.c \
483 484 485 486
	libnm-core/nm-setting-ppp.c \
	libnm-core/nm-setting-pppoe.c \
	libnm-core/nm-setting-proxy.c \
	libnm-core/nm-setting-serial.c \
487
	libnm-core/nm-setting-tc-config.c \
488 489 490
	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
491
	libnm-core/nm-setting-user.c \
492 493 494 495 496 497
	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 \
498 499 500 501 502 503 504 505 506 507 508 509 510 511 512
	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 \
513
	libnm-core/nm-keyfile.c \
514 515
	libnm-core/nm-keyfile-utils.c \
	libnm-core/nm-property-compare.c \
516 517 518 519 520
	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
521 522 523

if WITH_JSON_VALIDATION
libnm_core_lib_h_priv += \
524
	libnm-core/nm-json.h
525
libnm_core_lib_c_real += \
526
	libnm-core/nm-json.c
527 528
endif

529
libnm_core_lib_c_mkenums = \
530 531 532 533
	libnm-core/nm-core-enum-types.c

libnminclude_HEADERS += \
	$(libnm_core_lib_h_pub_real)
534

535
nodist_libnminclude_HEADERS += \
536
	$(libnm_core_lib_h_pub_mkenums)
537 538 539

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

540
dflt_cppflags_libnm_core = \
541 542 543 544
	-I$(srcdir)/shared \
	-I$(builddir)/shared \
	-I$(srcdir)/libnm-core \
	-I$(builddir)/libnm-core \
545
	$(CODE_COVERAGE_CFLAGS) \
546
	$(GLIB_CFLAGS) \
547 548
	$(LIBUDEV_CFLAGS) \
	$(SANITIZER_LIB_CFLAGS)
549

550 551 552 553 554 555 556 557
if WITH_GNUTLS
dflt_cppflags_libnm_core += $(GNUTLS_CFLAGS)
endif

if WITH_NSS
dflt_cppflags_libnm_core += $(NSS_CFLAGS)
endif

558 559 560
noinst_LTLIBRARIES += libnm-core/libnm-core.la

GLIB_GENERATED += \
561 562
	$(libnm_core_lib_h_pub_mkenums) \
	$(libnm_core_lib_c_mkenums)
563
nm_core_enum_types_sources = $(libnm_core_lib_h_pub_real)
564

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

567 568
libnm-core/nm-core-enum-types.h.stamp:                                      libnm-core/.dirstamp
libnm-core/nm-core-enum-types.c.stamp:                                      libnm-core/.dirstamp
569

570 571 572 573 574 575 576 577 578 579 580
$(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)
581

582
libnm_core_libnm_core_la_CPPFLAGS = \
583
	$(dflt_cppflags_libnm_core) \
584
	-DG_LOG_DOMAIN=\""libnm"\" \
585
	-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_LIBNM_CORE \
586
	-DNMLOCALEDIR=\"$(nmlocaledir)\" \
587 588
	-DNMCONFDIR=\"$(nmconfdir)\" \
	-DNMLIBDIR=\"$(nmlibdir)\" \
589 590
	-DNMVPNDIR=\"$(pkglibdir)\" \
	-DNMPLUGINDIR=\"$(plugindir)\" \
591
	-DLIBEXECDIR=\"$(libexecdir)\" \
592
	$(NULL)
593

594 595 596 597
if WITH_JSON_VALIDATION
libnm_core_libnm_core_la_CPPFLAGS += $(JANSSON_CFLAGS)
endif

598
libnm_core_libnm_core_la_SOURCES = \
599 600 601 602 603
	$(libnm_core_lib_h_pub_real) \
	$(libnm_core_lib_h_priv) \
	$(libnm_core_lib_c_real)

nodist_libnm_core_libnm_core_la_SOURCES = \
604 605
	$(libnm_core_lib_h_pub_mkenums) \
	$(libnm_core_lib_c_mkenums)
606 607

libnm_core_libnm_core_la_LIBADD = \
608
	shared/libcsiphash.la \
609
	$(GLIB_LIBS) \
610
	$(UUID_LIBS) \
611 612
	$(LIBUDEV_LIBS) \
	$(NULL)
613

614
libnm_core_libnm_core_la_LDFLAGS = \
615 616
	$(CODE_COVERAGE_LDFLAGS) \
	$(SANITIZER_LIB_LDFLAGS)
617 618

if WITH_GNUTLS
619
libnm_core_lib_c_real += libnm-core/crypto_gnutls.c
620 621 622 623
libnm_core_libnm_core_la_LIBADD += $(GNUTLS_LIBS)
endif

if WITH_NSS
624
libnm_core_lib_c_real += libnm-core/crypto_nss.c
625 626 627
libnm_core_libnm_core_la_LIBADD += $(NSS_LIBS)
endif

628 629
EXTRA_DIST += \
	libnm-core/crypto_gnutls.c \
630
	libnm-core/crypto_nss.c \
631 632 633
	libnm-core/nm-core-enum-types.c.template \
	libnm-core/nm-core-enum-types.h.template \
	libnm-core/meson.build
634

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

639
libnm-core/nm-dbus-types.xml: libnm-core/nm-dbus-interface.h tools/enums-to-docbook.pl
640
	@$(MKDIR_P) libnm-core/
641
	$(AM_V_GEN) @PERL@ $(srcdir)/tools/enums-to-docbook.pl 'nm-dbus-types' 'NetworkManager D-Bus API Types' $< >$@
642 643 644 645 646

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

647 648 649 650
dist_dependencies += \
	libnm-core/nm-vpn-dbus-types.xml \
	libnm-core/nm-dbus-types.xml

651 652
###############################################################################

653
check_programs += \
654 655 656 657 658
	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 \
659
	libnm-core/tests/test-setting \
660 661 662 663 664 665 666
	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

667 668 669
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

670 671
$(libnm_core_tests_test_general_OBJECTS): libnm-core/tests/nm-core-tests-enum-types.h

672
libnm_core_tests_cppflags = \
673
	$(dflt_cppflags_libnm_core) \
674
	-I$(srcdir)/libnm-core/tests \
675
	-I$(builddir)/libnm-core/tests \
676
	$(nm_build_cflags) \
677 678
	-DNETWORKMANAGER_COMPILATION_TEST \
	-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_LIBNM_CORE \
679
	$(NULL)
680 681 682 683 684 685

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)
686
libnm_core_tests_test_setting_CPPFLAGS = $(libnm_core_tests_cppflags)
687 688 689 690 691 692
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

693 694 695 696
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

697 698 699 700
libnm_core_tests_ldadd = \
	libnm-core/libnm-core.la \
	$(GLIB_LIBS)

701 702 703
libnm_core_tests_ldflags = \
	$(SANITIZER_LIB_LDFLAGS)

704 705 706 707 708
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)
709
libnm_core_tests_test_setting_LDADD = $(libnm_core_tests_ldadd)
710 711
libnm_core_tests_test_settings_defaults_LDADD = $(libnm_core_tests_ldadd)

712 713 714 715 716 717 718 719
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)

720 721 722 723 724
$(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)
725
$(libnm_core_tests_test_setting_OBJECTS): $(libnm_core_lib_h_pub_mkenums)
726 727
$(libnm_core_tests_test_settings_defaults_OBJECTS): $(libnm_core_lib_h_pub_mkenums)

728 729 730
# test-cert.p12 created with:
#
# openssl pkcs12 -export \
731 732 733 734 735
#    -in test_key_and_cert.pem \
#    -inkey test_key_and_cert.pem \
#    -certfile test_ca_cert.pem \
#    -name "test-pkcs12" \
#    -out test-cert.p12
736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753

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 \
754 755 756 757
	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
758 759 760

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

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

869 870 871 872 873
libnm_lib_cppflags = \
	$(dflt_cppflags_libnm_core) \
	-I$(srcdir)/libnm \
	-I$(builddir)/libnm \
	-DG_LOG_DOMAIN=\""libnm"\" \
874
	-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_LIBNM \
875
	$(NULL)
876

877
libnminclude_HEADERS += \
878
	$(libnm_lib_h_pub_real)
879 880

nodist_libnminclude_HEADERS += \
881
	$(libnm_lib_h_pub_mkenums)
882 883 884

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

885
noinst_LTLIBRARIES += libnm/libnm-utils.la
886 887

libnm_libnm_utils_la_CPPFLAGS = \
888
	$(INTROSPECTION_CFLAGS) \
889 890 891 892 893 894 895 896 897 898 899 900 901 902
	$(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)

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

903 904 905
lib_LTLIBRARIES += libnm/libnm.la

GLIB_GENERATED += \
906 907
	$(libnm_lib_h_pub_mkenums) \
	$(libnm_lib_c_mkenums)
908
nm_enum_types_sources = \
909
	$(libnm_lib_h_pub_mkenums) \
910
	$(libnm_lib_h_pub_real)
911 912 913
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'

914 915 916 917
$(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)
918

919
libnm_libnm_la_CPPFLAGS = \
920
	$(libnm_lib_cppflags) \
921 922
	$(LIBUDEV_CFLAGS) \
	$(SANITIZER_LIB_CFLAGS)
923 924

libnm_libnm_la_SOURCES = \
925 926 927 928 929
	$(libnm_lib_h_pub_real) \
	$(libnm_lib_h_priv) \
	$(libnm_lib_c_real)

nodist_libnm_libnm_la_SOURCES = \
930 931
	$(libnm_lib_h_pub_mkenums) \
	$(libnm_lib_c_mkenums)
932 933 934 935 936

EXTRA_libnm_libnm_la_DEPENDENCIES = \
	libnm/libnm.ver

libnm_libnm_la_LIBADD = \
937
	libnm/libnm-utils.la \
938 939 940
	$(DL_LIBS) \
	$(GLIB_LIBS) \
	$(UUID_LIBS) \
941
	$(LIBUDEV_LIBS)
942 943 944 945

libnm_libnm_la_LDFLAGS = \
	-Wl,--version-script="$(srcdir)/libnm/libnm.ver" \
	$(CODE_COVERAGE_LDFLAGS) \
946
	$(SANITIZER_LIB_LDFLAGS) \
947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962
	-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

963
libnm_NM_1_0_typelib =
964 965

if HAVE_INTROSPECTION
966 967
libnm_NM_1_0_typelib += libnm/NM-1.0.typelib

968 969
libnm/NM-1.0.gir: libnm/libnm.la
libnm_NM_1_0_gir_INCLUDES = Gio-2.0
970
libnm_NM_1_0_gir_PACKAGES = gio-2.0
971 972 973
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
974
libnm_NM_1_0_gir_FILES = \
975
	$(libnm_core_lib_h_pub_mkenums) \
976
	$(libnm_core_lib_h_pub_real) \
977
	$(libnm_core_lib_c_mkenums) \
978
	$(libnm_core_lib_c_real) \
979
	$(libnm_lib_h_pub_mkenums) \
980
	$(libnm_lib_h_pub_real) \
981
	$(libnm_lib_c_mkenums) \
982
	$(libnm_lib_c_real)
983 984
libnm_NM_1_0_gir_SCANNERFLAGS = --warn-all --identifier-prefix=NM --symbol-prefix=nm

985 986 987 988
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
989 990 991

if WITH_FAKE_TYPELIBS

992
libnm/fake-typelib/NetworkManager.typelib: libnm/fake-typelib/NetworkManager.gir libnm/fake-typelib/.dirstamp
993 994
	$(AM_V_GEN)  $(INTROSPECTION_COMPILER) $< -o $@

995
libnm/fake-typelib/NMClient.typelib: libnm/fake-typelib/NMClient.gir libnm/fake-typelib/.dirstamp
996 997 998
	$(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
999
	$(AM_V_GEN) $(GLIB_COMPILE_RESOURCES) $< --target=$@ --sourcedir=$(builddir)/libnm/fake-typelib --generate-source --manual-register
1000

1001
nodist_libnm_libnm_utils_la_SOURCES = \
1002 1003
	libnm/fake-typelib/typelibs.c

1004 1005 1006 1007
CLEANFILES += \
	libnm/fake-typelib/typelibs.c \
	libnm/fake-typelib/NMClient.typelib \
	libnm/fake-typelib/NetworkManager.typelib
1008 1009
endif

1010 1011
endif

1012 1013 1014
EXTRA_DIST += \
	libnm/fake-typelib/NetworkManager.gir \
	libnm/fake-typelib/NMClient.gir \
1015 1016
	libnm/fake-typelib/typelibs.gresource.xml \
	libnm/fake-typelib/meson.build
1017

1018
if HAVE_INTROSPECTION
1019 1020 1021

libnm_noinst_data = \
	libnm/nm-property-docs.xml \
1022 1023 1024 1025
	libnm/nm-settings-docs-overrides.xml \
	libnm/nm-settings-docs.xml \
	libnm/nm-settings-keyfile-docs.xml \
	libnm/nm-settings-ifcfg-rh-docs.xml
1026 1027 1028

noinst_DATA += $(libnm_noinst_data)

1029
libnm_docs_sources = $(libnm_core_lib_c_settings_real)
1030

1031
libnm/nm-settings-docs-overrides.xml: libnm/generate-plugin-docs.pl $(libnm_docs_sources)
1032
	$(AM_V_GEN) $(srcdir)/libnm/generate-plugin-docs.pl dbus $@ $(filter-out $<,$^)
1033 1034 1035 1036 1037

# 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
1038
	$(AM_V_GEN) \
1039 1040 1041
	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); \
1042
	"$(PYTHON)" \
1043 1044 1045 1046
	$(srcdir)/libnm/generate-setting-docs.py \
		--gir $(builddir)/libnm/NM-1.0.gir \
		--output $@

1047
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
1048
	$(AM_V_GEN) \
1049 1050 1051
	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); \
1052
	"$(PYTHON)" \
1053 1054
	$(srcdir)/libnm/generate-setting-docs.py \
		--gir $(builddir)/libnm/NM-1.0.gir \
1055
		--overrides $(word 2,$^) \
1056 1057
		--output $@

1058
libnm/nm-settings-keyfile-docs.xml: libnm/generate-plugin-docs.pl $(libnm_docs_sources)
1059
	$(AM_V_GEN) $(srcdir)/libnm/generate-plugin-docs.pl keyfile $@ $(filter-out $<,$^)
1060
libnm/nm-settings-ifcfg-rh-docs.xml: libnm/generate-plugin-docs.pl $(libnm_docs_sources)
1061
	$(AM_V_GEN) $(srcdir)/libnm/generate-plugin-docs.pl ifcfg-rh $@ $(filter-out $<,$^)
1062 1063 1064 1065 1066 1067 1068

EXTRA_DIST += $(libnm_noinst_data)

endif

EXTRA_DIST += \
	libnm/generate-setting-docs.py \
1069 1070 1071 1072
	libnm/generate-plugin-docs.pl \
	libnm/nm-enum-types.c.template \
	libnm/nm-enum-types.h.template \
	libnm/meson.build
1073 1074 1075

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

1076
libnm_tests_programs = \
1077 1078 1079 1080 1081
	libnm/tests/test-general

check_programs += $(libnm_tests_programs)

libnm_tests_programs_req_introspection = \
1082 1083 1084 1085
	libnm/tests/test-nm-client \
	libnm/tests/test-remote-settings-client \
	libnm/tests/test-secret-agent

1086 1087 1088 1089 1090
if HAVE_INTROSPECTION
check_programs += $(libnm_tests_programs_req_introspection)
else
check_programs_norun += $(libnm_tests_programs_req_introspection)
endif
1091 1092

libnm_tests_cppflags = \
1093
	$(dflt_cppflags_libnm_core) \
1094 1095
	-I$(srcdir)/libnm \
	-I$(builddir)/libnm \
1096
	$(nm_build_cflags) \
1097 1098
	-DNETWORKMANAGER_COMPILATION_TEST \
	-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_LIBNM \
1099
	$(NULL)
1100 1101

libnm_tests_ldadd = \
1102
	libnm/libnm.la \
1103 1104
	$(GLIB_LIBS)

1105 1106 1107
libnm_tests_ldflags = \
	$(SANITIZER_LIB_LDFLAGS)

1108
libnm_tests_test_general_CPPFLAGS = $(libnm_tests_cppflags)
1109 1110 1111 1112
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)

1113
libnm_tests_test_general_SOURCES = \
1114
	shared/nm-utils/nm-compat.c \
1115 1116
	libnm/tests/test-general.c

1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131
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

1132 1133 1134
libnm_tests_test_general_LDADD = \
	libnm/libnm-utils.la \
	$(libnm_tests_ldadd)
1135 1136 1137 1138
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)

1139 1140 1141 1142 1143
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)

1144
$(libnm_tests_test_general_OBJECTS): $(libnm_core_lib_h_pub_mkenums)
1145 1146 1147 1148
$(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)

1149 1150 1151 1152 1153 1154
# 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)

1155 1156 1157 1158
###############################################################################

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

1159
check_ltlibraries += libnm/tests/libnm-vpn-plugin-utils-test.la
1160 1161

libnm_tests_libnm_vpn_plugin_utils_test_la_SOURCES = \
1162 1163
	shared/nm-utils/nm-vpn-plugin-utils.c \
	shared/nm-utils/nm-vpn-plugin-utils.h
1164 1165

libnm_tests_libnm_vpn_plugin_utils_test_la_CFLAGS = \
1166 1167 1168 1169 1170 1171
	-I$(srcdir)/shared \
	-I$(builddir)/shared \
	-I$(srcdir)/libnm-core \
	-I$(builddir)/libnm-core \
	-I$(srcdir)/libnm \
	-I$(builddir)/libnm \
1172
	$(GLIB_CFLAGS) \
1173
	$(SANITIZER_EXEC_CFLAGS) \
1174 1175
	-DNETWORKMANAGER_COMPILATION_TEST \
	-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_CLIENT
1176 1177

libnm_tests_libnm_vpn_plugin_utils_test_la_LIBADD = \
1178
	$(GLIB_LIBS)
1179

1180 1181 1182
EXTRA_DIST += \
	libnm/tests/meson.build

1183