Makefile.am 191 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
dist_libexec_SCRIPTS =
23
lib_LTLIBRARIES =
24
plugin_LTLIBRARIES =
25
core_plugins =
26
service_DATA =
27
man_MANS =
28
examples_DATA =
29
CLEANFILES =
30
DISTCLEANFILES =
31
EXTRA_DIST =
32
EXTRA_LTLIBRARIES =
33
dist_hook =
34 35
dist_dependencies =
dist_configure_check =
36
install_data_hook =
37
install_exec_hook =
38
uninstall_hook =
39
TESTS =
40
BUILT_SOURCES =
41
GLIB_GENERATED =
42 43
man_pages =
man_pages_autogen =
44
check_programs =
45
check_programs_norun =
46
check_ltlibraries =
47
check_local =
48
VAPIGEN_VAPIS =
49
dbusservice_DATA =
50
dbusactivation_DATA =
51 52 53 54 55 56

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

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

pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA =
65

66 67 68
pppd_plugindir = $(PPPD_PLUGIN_DIR)
pppd_plugin_LTLIBRARIES =

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

72 73
examplesdir = $(docdir)/examples

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

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

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

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

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

85 86
nmlocaledir = $(datadir)/locale

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

90
SUBDIRS = \
91
	. \
92 93
	po

94
if HAVE_DOCS
95 96

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

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

106 107
endif

108
dflt_cppflags = -std=gnu11
109

110 111
###############################################################################

112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145
# with autotools, it is not easily possible to generate these defines
# from configure.ac.
#
# See https://www.gnu.org/software/autoconf/manual/autoconf-2.63/html_node/Installation-Directory-Variables.html
#
# With meson-only, they could just be set via config.h.meson
config-extra.h: Makefile
	$(AM_V_GEN) \
	echo "/* Generated by Makefile.am */"                    >$@ && \
	echo "#define BINDIR            \"$(bindir)\""          >>$@ && \
	echo "#define DATADIR           \"$(datadir)\""         >>$@ && \
	echo "#define LIBEXECDIR        \"$(libexecdir)\""      >>$@ && \
	echo "#define LOCALSTATEDIR     \"$(localstatedir)\""   >>$@ && \
	echo "#define NMCONFDIR         \"$(nmconfdir)\""       >>$@ && \
	echo "#define NMLIBDIR          \"$(nmlibdir)\""        >>$@ && \
	echo "#define NMLOCALEDIR       \"$(nmlocaledir)\""     >>$@ && \
	echo "#define NMPLUGINDIR       \"$(plugindir)\""       >>$@ && \
	echo "#define NMRUNDIR          \"$(nmrundir)\""        >>$@ && \
	echo "#define NMSTATEDIR        \"$(nmstatedir)\""      >>$@ && \
	echo "#define NMVPNDIR          \"$(pkglibdir)\""       >>$@ && \
	echo "#define NM_BUILD_BUILDDIR \"$(abs_builddir)\""    >>$@ && \
	echo "#define NM_BUILD_SRCDIR   \"$(abs_srcdir)\""      >>$@ && \
	echo "#define PPPD_PLUGIN_DIR   \"$(PPPD_PLUGIN_DIR)\"" >>$@ && \
	echo "#define PREFIX            \"$(prefix)\""          >>$@ && \
	echo "#define RUNDIR            \"$(rundir)\""          >>$@ && \
	echo "#define RUNSTATEDIR       \"$(runstatedir)\""     >>$@ && \
	echo "#define SYSCONFDIR        \"$(sysconfdir)\""      >>$@ && \
	true

DISTCLEANFILES += config-extra.h

libnm-core/.dirstamp: config-extra.h

###############################################################################
146

147 148
set_sanitizer_env = \
	[ -n "$(SANITIZER_ENV)" ] && export $(SANITIZER_ENV) ; \
149 150 151
	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)"; \
152 153 154
	fi

check_so_symbols = \
155
	$(call set_sanitizer_env,$(1),$(builddir)/src/NetworkManager); \
156
	LD_BIND_NOW=1 LD_PRELOAD=$${LD_PRELOAD}:$(1) $(builddir)/src/NetworkManager --version >/dev/null
157 158 159

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

160 161 162
DISTCHECK_CONFIGURE_FLAGS = \
	--enable-tests=yes \
	--with-valgrind=no \
163
	--with-libnm-glib=yes \
164 165 166 167 168 169
	--enable-gtk-doc \
	--enable-more-warnings=error \
	--with-udev-dir=$$dc_install_base/lib/udev \
	--with-wext=no \
	--enable-ifcfg-rh \
	--enable-ifupdown \
170 171 172
	--enable-config-plugin-ibft \
	--disable-dependency-tracking \
	$(NULL)
173

174
dist-configure-check:
175
	@echo "*** 'make dist' requires '--enable-gtk-doc --enable-introspection --with-libnm-glib'. ***"
176
	@false
177
if !BUILD_DOCS
178 179 180 181
dist_configure_check += dist-configure-check
endif
if !WITH_LEGACY_LIBRARIES
dist_configure_check += dist-configure-check
182 183
endif

184
dist: $(dist_configure_check) $(dist_dependencies)
185

186
DISTCLEANFILES += intltool-extract intltool-merge intltool-update
187 188 189

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

190
if WITH_LEGACY_LIBRARIES
191
pkgconfig_DATA += NetworkManager.pc
192
endif
193 194

###############################################################################
195

196 197 198
polkit_policydir = $(datadir)/polkit-1/actions

dist_polkit_policy_in_in_files = \
199
	data/org.freedesktop.NetworkManager.policy.in.in
200 201 202 203 204 205 206 207 208

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

@INTLTOOL_POLICY_RULE@

DISTCLEANFILES += $(polkit_policy_DATA)

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

209 210 211 212 213 214 215 216 217
noinst_LTLIBRARIES += shared/libcsiphash.la

shared_libcsiphash_la_CPPFLAGS = \
	$(CODE_COVERAGE_CFLAGS) \
	$(SANITIZER_LIB_CFLAGS) \
	$(NULL)

shared_libcsiphash_la_SOURCES = \
	shared/c-siphash/src/c-siphash.c \
218 219
	shared/c-siphash/src/c-siphash.h \
	$(NULL)
220 221 222 223 224

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

noinst_LTLIBRARIES += shared/libcrbtree.la

225 226 227 228
shared_libcrbtree_la_CFLAGS = \
	$(AM_CFLAGS) \
	-std=c11 \
	$(NULL)
229 230 231 232 233 234 235 236 237

shared_libcrbtree_la_CPPFLAGS = \
	$(CODE_COVERAGE_CFLAGS) \
	$(SANITIZER_LIB_CFLAGS) \
	$(NULL)

shared_libcrbtree_la_SOURCES = \
	shared/c-rbtree/src/c-rbtree.c \
	shared/c-rbtree/src/c-rbtree.h \
238 239
	shared/c-rbtree/src/c-rbtree-private.h \
	$(NULL)
240 241 242 243 244

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

noinst_LTLIBRARIES += shared/libnacd.la

245 246 247 248 249 250
shared_libnacd_la_CFLAGS = \
	$(AM_CFLAGS) \
	-std=c11 \
	-Wno-pointer-arith \
	-Wno-vla \
	$(NULL)
251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267

shared_libnacd_la_CPPFLAGS = \
	-D_GNU_SOURCE \
	-DSO_ATTACH_BPF=50 \
	$(CODE_COVERAGE_CFLAGS) \
	$(SANITIZER_LIB_CFLAGS) \
	-I$(srcdir)/shared/c-list/src \
	-I$(srcdir)/shared/c-siphash/src \
	-I$(srcdir)/shared/c-rbtree/src \
	$(NULL)

shared_libnacd_la_SOURCES = \
	shared/n-acd/src/n-acd.c \
	shared/n-acd/src/n-acd.h \
	shared/n-acd/src/n-acd-private.h \
	shared/n-acd/src/n-acd-probe.c \
	shared/n-acd/src/util/timer.c \
268 269
	shared/n-acd/src/util/timer.h \
	$(NULL)
270 271 272 273 274 275 276

if WITH_EBPF
shared_libnacd_la_SOURCES += shared/n-acd/src/n-acd-bpf.c
else
shared_libnacd_la_SOURCES += shared/n-acd/src/n-acd-bpf-fallback.c
endif

277 278 279
shared_libnacd_la_LIBADD = \
	shared/libcrbtree.la \
	$(NULL)
280 281 282

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

283
shared_nm_utils_libnm_utils_cppflags = \
284 285 286 287
	$(dflt_cppflags) \
	-I$(srcdir)/shared \
	$(CODE_COVERAGE_CFLAGS) \
	$(SANITIZER_LIB_CFLAGS) \
288 289 290
	$(GLIB_CFLAGS) \
	-DG_LOG_DOMAIN=\""libnm"\" \
	-DNETWORKMANAGER_COMPILATION='(NM_NETWORKMANAGER_COMPILATION_GLIB|NM_NETWORKMANAGER_COMPILATION_WITH_GLIB_I18N_LIB)' \
291 292
	$(NULL)

293 294 295 296 297 298 299 300
noinst_LTLIBRARIES += shared/nm-utils/libnm-utils-base.la

shared_nm_utils_libnm_utils_base_la_CPPFLAGS = \
	$(shared_nm_utils_libnm_utils_cppflags) \
	$(NULL)

shared_nm_utils_libnm_utils_base_la_SOURCES = \
	shared/c-list/src/c-list.h \
301
	shared/nm-utils/c-list-util.c \
302 303
	shared/nm-utils/c-list-util.h \
	shared/nm-utils/nm-c-list.h \
304
	shared/nm-utils/nm-dedup-multi.c \
305
	shared/nm-utils/nm-dedup-multi.h \
306
	shared/nm-utils/nm-enum-utils.c \
307
	shared/nm-utils/nm-enum-utils.h \
308 309
	shared/nm-utils/nm-errno.c \
	shared/nm-utils/nm-errno.h \
310
	shared/nm-utils/nm-glib.h \
311
	shared/nm-utils/nm-hash-utils.c \
312
	shared/nm-utils/nm-hash-utils.h \
313
	shared/nm-utils/nm-io-utils.c \
314
	shared/nm-utils/nm-io-utils.h \
315
	shared/nm-utils/nm-logging-fwd.h \
316 317
	shared/nm-utils/nm-macros-internal.h \
	shared/nm-utils/nm-obj.h \
318
	shared/nm-utils/nm-random-utils.c \
319
	shared/nm-utils/nm-random-utils.h \
320
	shared/nm-utils/nm-secret-utils.c \
321
	shared/nm-utils/nm-secret-utils.h \
322
	shared/nm-utils/nm-shared-utils.c \
323
	shared/nm-utils/nm-shared-utils.h \
324
	shared/nm-utils/nm-time-utils.c \
325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374
	shared/nm-utils/nm-time-utils.h \
	shared/nm-utils/unaligned.h \
	$(NULL)

shared_nm_utils_libnm_utils_base_la_LDFLAGS = \
	$(CODE_COVERAGE_LDFLAGS) \
	$(SANITIZER_LIB_LDFLAGS) \
	$(NULL)

shared_nm_utils_libnm_utils_base_la_LIBADD = \
	shared/libcsiphash.la \
	$(GLIB_LIBS) \
	$(NULL)

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

noinst_LTLIBRARIES += shared/nm-utils/libnm-utils-udev.la

shared_nm_utils_libnm_utils_udev_la_CPPFLAGS = \
	$(shared_nm_utils_libnm_utils_cppflags) \
	$(LIBUDEV_CFLAGS) \
	$(NULL)

shared_nm_utils_libnm_utils_udev_la_SOURCES = \
	shared/nm-utils/nm-udev-utils.c \
	shared/nm-utils/nm-udev-utils.h \
	$(NULL)

shared_nm_utils_libnm_utils_udev_la_LDFLAGS = \
	$(CODE_COVERAGE_LDFLAGS) \
	$(SANITIZER_LIB_LDFLAGS) \
	$(NULL)

shared_nm_utils_libnm_utils_udev_la_LIBADD = \
	$(GLIB_LIBS) \
	$(LIBUDEV_LIBS) \
	$(NULL)

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

check_programs += shared/nm-utils/tests/test-shared-general

shared_nm_utils_tests_test_shared_general_CPPFLAGS = \
	$(dflt_cppflags) \
	-I$(srcdir)/shared \
	-DNETWORKMANAGER_COMPILATION_TEST \
	-DNETWORKMANAGER_COMPILATION='(NM_NETWORKMANAGER_COMPILATION_GLIB|NM_NETWORKMANAGER_COMPILATION_WITH_GLIB_I18N_PROG)' \
	$(CODE_COVERAGE_CFLAGS) \
	$(GLIB_CFLAGS) \
	$(SANITIZER_LIB_CFLAGS) \
375 376 377
	$(NULL)

shared_nm_utils_tests_test_shared_general_LDADD = \
378
	shared/nm-utils/libnm-utils-base.la \
379 380 381 382 383
	$(GLIB_LIBS) \
	$(NULL)

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

384 385 386
noinst_LTLIBRARIES += \
	introspection/libnmdbus.la

387
introspection_libnmdbus_la_CPPFLAGS = $(GLIB_CFLAGS)
388

389
introspection_sources = \
390 391 392 393 394 395
	introspection/org.freedesktop.NetworkManager.AccessPoint.c \
	introspection/org.freedesktop.NetworkManager.AccessPoint.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 \
396 397 398 399 400 401
	introspection/org.freedesktop.NetworkManager.Connection.Active.c \
	introspection/org.freedesktop.NetworkManager.Connection.Active.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 \
402 403
	introspection/org.freedesktop.NetworkManager.Device.Adsl.c \
	introspection/org.freedesktop.NetworkManager.Device.Adsl.h \
404 405
	introspection/org.freedesktop.NetworkManager.Device.Bluetooth.c \
	introspection/org.freedesktop.NetworkManager.Device.Bluetooth.h \
406 407 408 409
	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 \
410 411
	introspection/org.freedesktop.NetworkManager.Device.Dummy.c \
	introspection/org.freedesktop.NetworkManager.Device.Dummy.h \
412 413 414 415
	introspection/org.freedesktop.NetworkManager.Device.Generic.c \
	introspection/org.freedesktop.NetworkManager.Device.Generic.h \
	introspection/org.freedesktop.NetworkManager.Device.IPTunnel.c \
	introspection/org.freedesktop.NetworkManager.Device.IPTunnel.h \
416 417
	introspection/org.freedesktop.NetworkManager.Device.Infiniband.c \
	introspection/org.freedesktop.NetworkManager.Device.Infiniband.h \
418 419
	introspection/org.freedesktop.NetworkManager.Device.Lowpan.c \
	introspection/org.freedesktop.NetworkManager.Device.Lowpan.h \
420 421
	introspection/org.freedesktop.NetworkManager.Device.Macsec.c \
	introspection/org.freedesktop.NetworkManager.Device.Macsec.h \
422 423 424 425 426 427
	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 \
428 429
	introspection/org.freedesktop.NetworkManager.Device.OvsBridge.c \
	introspection/org.freedesktop.NetworkManager.Device.OvsBridge.h \
430 431
	introspection/org.freedesktop.NetworkManager.Device.OvsInterface.c \
	introspection/org.freedesktop.NetworkManager.Device.OvsInterface.h \
432 433
	introspection/org.freedesktop.NetworkManager.Device.OvsPort.c \
	introspection/org.freedesktop.NetworkManager.Device.OvsPort.h \
434 435
	introspection/org.freedesktop.NetworkManager.Device.Ppp.c \
	introspection/org.freedesktop.NetworkManager.Device.Ppp.h \
436 437 438 439 440 441 442 443 444 445 446 447
	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 \
448 449
	introspection/org.freedesktop.NetworkManager.Device.WiMax.c \
	introspection/org.freedesktop.NetworkManager.Device.WiMax.h \
450 451
	introspection/org.freedesktop.NetworkManager.Device.WifiP2P.c \
	introspection/org.freedesktop.NetworkManager.Device.WifiP2P.h \
452 453
	introspection/org.freedesktop.NetworkManager.Device.WireGuard.c \
	introspection/org.freedesktop.NetworkManager.Device.WireGuard.h \
454 455
	introspection/org.freedesktop.NetworkManager.Device.Wired.c \
	introspection/org.freedesktop.NetworkManager.Device.Wired.h \
456 457
	introspection/org.freedesktop.NetworkManager.Device.Wireless.c \
	introspection/org.freedesktop.NetworkManager.Device.Wireless.h \
458 459
	introspection/org.freedesktop.NetworkManager.Device.Wpan.c \
	introspection/org.freedesktop.NetworkManager.Device.Wpan.h \
460 461
	introspection/org.freedesktop.NetworkManager.Device.c \
	introspection/org.freedesktop.NetworkManager.Device.h \
462 463
	introspection/org.freedesktop.NetworkManager.DnsManager.c \
	introspection/org.freedesktop.NetworkManager.DnsManager.h \
464 465 466 467
	introspection/org.freedesktop.NetworkManager.IP4Config.c \
	introspection/org.freedesktop.NetworkManager.IP4Config.h \
	introspection/org.freedesktop.NetworkManager.IP6Config.c \
	introspection/org.freedesktop.NetworkManager.IP6Config.h \
468 469
	introspection/org.freedesktop.NetworkManager.WifiP2PPeer.c \
	introspection/org.freedesktop.NetworkManager.WifiP2PPeer.h \
470 471 472 473 474 475 476 477 478 479 480
	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 \
481 482 483 484
	introspection/org.freedesktop.NetworkManager.VPN.Plugin.h \
	introspection/org.freedesktop.NetworkManager.c \
	introspection/org.freedesktop.NetworkManager.h \
	$(NULL)
485

486 487
nodist_introspection_libnmdbus_la_SOURCES = $(introspection_sources)

488
DBUS_INTERFACE_DOCS = \
489
	docs/api/dbus-org.freedesktop.NetworkManager.AccessPoint.xml \
490
	docs/api/dbus-org.freedesktop.NetworkManager.AgentManager.xml \
491
	docs/api/dbus-org.freedesktop.NetworkManager.Checkpoint.xml \
492 493
	docs/api/dbus-org.freedesktop.NetworkManager.Connection.Active.xml \
	docs/api/dbus-org.freedesktop.NetworkManager.DHCP4Config.xml \
494
	docs/api/dbus-org.freedesktop.NetworkManager.DHCP6Config.xml \
495
	docs/api/dbus-org.freedesktop.NetworkManager.Device.Adsl.xml \
496 497
	docs/api/dbus-org.freedesktop.NetworkManager.Device.Bluetooth.xml \
	docs/api/dbus-org.freedesktop.NetworkManager.Device.Bond.xml \
498 499 500 501 502 503
	docs/api/dbus-org.freedesktop.NetworkManager.Device.Bridge.xml \
	docs/api/dbus-org.freedesktop.NetworkManager.Device.Dummy.xml \
	docs/api/dbus-org.freedesktop.NetworkManager.Device.Generic.xml \
	docs/api/dbus-org.freedesktop.NetworkManager.Device.IPTunnel.xml \
	docs/api/dbus-org.freedesktop.NetworkManager.Device.Infiniband.xml \
	docs/api/dbus-org.freedesktop.NetworkManager.Device.Lowpan.xml \
504
	docs/api/dbus-org.freedesktop.NetworkManager.Device.Macsec.xml \
505
	docs/api/dbus-org.freedesktop.NetworkManager.Device.Macvlan.xml \
506
	docs/api/dbus-org.freedesktop.NetworkManager.Device.Modem.xml \
507
	docs/api/dbus-org.freedesktop.NetworkManager.Device.OlpcMesh.xml \
508
	docs/api/dbus-org.freedesktop.NetworkManager.Device.OvsBridge.xml \
509
	docs/api/dbus-org.freedesktop.NetworkManager.Device.OvsInterface.xml \
510
	docs/api/dbus-org.freedesktop.NetworkManager.Device.OvsPort.xml \
511
	docs/api/dbus-org.freedesktop.NetworkManager.Device.Ppp.xml \
512 513 514
	docs/api/dbus-org.freedesktop.NetworkManager.Device.Statistics.xml \
	docs/api/dbus-org.freedesktop.NetworkManager.Device.Team.xml \
	docs/api/dbus-org.freedesktop.NetworkManager.Device.Tun.xml \
515
	docs/api/dbus-org.freedesktop.NetworkManager.Device.Veth.xml \
516 517 518
	docs/api/dbus-org.freedesktop.NetworkManager.Device.Vlan.xml \
	docs/api/dbus-org.freedesktop.NetworkManager.Device.Vxlan.xml \
	docs/api/dbus-org.freedesktop.NetworkManager.Device.WiMax.xml \
519
	docs/api/dbus-org.freedesktop.NetworkManager.Device.WifiP2P.xml \
520
	docs/api/dbus-org.freedesktop.NetworkManager.Device.WireGuard.xml \
521 522 523 524
	docs/api/dbus-org.freedesktop.NetworkManager.Device.Wired.xml \
	docs/api/dbus-org.freedesktop.NetworkManager.Device.Wireless.xml \
	docs/api/dbus-org.freedesktop.NetworkManager.Device.Wpan.xml \
	docs/api/dbus-org.freedesktop.NetworkManager.Device.xml \
525
	docs/api/dbus-org.freedesktop.NetworkManager.DnsManager.xml \
526 527 528 529 530 531 532 533
	docs/api/dbus-org.freedesktop.NetworkManager.IP4Config.xml \
	docs/api/dbus-org.freedesktop.NetworkManager.IP6Config.xml \
	docs/api/dbus-org.freedesktop.NetworkManager.PPP.xml \
	docs/api/dbus-org.freedesktop.NetworkManager.SecretAgent.xml \
	docs/api/dbus-org.freedesktop.NetworkManager.Settings.Connection.xml \
	docs/api/dbus-org.freedesktop.NetworkManager.Settings.xml \
	docs/api/dbus-org.freedesktop.NetworkManager.VPN.Connection.xml \
	docs/api/dbus-org.freedesktop.NetworkManager.VPN.Plugin.xml \
534
	docs/api/dbus-org.freedesktop.NetworkManager.WifiP2PPeer.xml \
535 536
	docs/api/dbus-org.freedesktop.NetworkManager.xml \
	$(NULL)
537 538

introspection/%.c: introspection/%.xml
539
	@$(MKDIR_P) introspection/
540 541 542
	$(AM_V_GEN) gdbus-codegen \
		--generate-c-code $(basename $@) \
		--generate-docbook docs/api/dbus \
543 544
		--c-namespace NMDBus \
		--interface-prefix org.freedesktop.NetworkManager \
545
		$<
546

547 548
introspection/%.h: introspection/%.c
	$()
549

550 551
docs/api/dbus-%.xml: introspection/%.c
	$()
552

553
dbusinterfacesdir = $(datadir)/dbus-1/interfaces
554

555
dbusinterfaces_DATA = \
556 557 558
	introspection/org.freedesktop.NetworkManager.AccessPoint.xml \
	introspection/org.freedesktop.NetworkManager.AgentManager.xml \
	introspection/org.freedesktop.NetworkManager.Checkpoint.xml \
559 560 561
	introspection/org.freedesktop.NetworkManager.Connection.Active.xml \
	introspection/org.freedesktop.NetworkManager.DHCP4Config.xml \
	introspection/org.freedesktop.NetworkManager.DHCP6Config.xml \
562
	introspection/org.freedesktop.NetworkManager.Device.Adsl.xml \
563
	introspection/org.freedesktop.NetworkManager.Device.Bluetooth.xml \
564 565
	introspection/org.freedesktop.NetworkManager.Device.Bond.xml \
	introspection/org.freedesktop.NetworkManager.Device.Bridge.xml \
566
	introspection/org.freedesktop.NetworkManager.Device.Dummy.xml \
567 568
	introspection/org.freedesktop.NetworkManager.Device.Generic.xml \
	introspection/org.freedesktop.NetworkManager.Device.IPTunnel.xml \
569
	introspection/org.freedesktop.NetworkManager.Device.Infiniband.xml \
570
	introspection/org.freedesktop.NetworkManager.Device.Lowpan.xml \
571
	introspection/org.freedesktop.NetworkManager.Device.Macsec.xml \
572 573 574
	introspection/org.freedesktop.NetworkManager.Device.Macvlan.xml \
	introspection/org.freedesktop.NetworkManager.Device.Modem.xml \
	introspection/org.freedesktop.NetworkManager.Device.OlpcMesh.xml \
575
	introspection/org.freedesktop.NetworkManager.Device.OvsBridge.xml \
576
	introspection/org.freedesktop.NetworkManager.Device.OvsInterface.xml \
577
	introspection/org.freedesktop.NetworkManager.Device.OvsPort.xml \
578
	introspection/org.freedesktop.NetworkManager.Device.Ppp.xml \
579 580 581 582 583 584
	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 \
585 586
	introspection/org.freedesktop.NetworkManager.Device.WiMax.xml \
	introspection/org.freedesktop.NetworkManager.Device.WifiP2P.xml \
587
	introspection/org.freedesktop.NetworkManager.Device.WireGuard.xml \
588
	introspection/org.freedesktop.NetworkManager.Device.Wired.xml \
589
	introspection/org.freedesktop.NetworkManager.Device.Wireless.xml \
590
	introspection/org.freedesktop.NetworkManager.Device.Wpan.xml \
591
	introspection/org.freedesktop.NetworkManager.Device.xml \
592
	introspection/org.freedesktop.NetworkManager.DnsManager.xml \
593 594 595 596 597 598 599 600
	introspection/org.freedesktop.NetworkManager.IP4Config.xml \
	introspection/org.freedesktop.NetworkManager.IP6Config.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 \
601 602 603 604
	introspection/org.freedesktop.NetworkManager.WiMax.Nsp.xml \
	introspection/org.freedesktop.NetworkManager.WifiP2PPeer.xml \
	introspection/org.freedesktop.NetworkManager.xml \
	$(NULL)
605

606 607
CLEANFILES += $(introspection_sources)
CLEANFILES += $(DBUS_INTERFACE_DOCS)
608

609 610 611 612
$(dispatcher_libnm_dispatcher_core_la_OBJECTS): $(introspection_sources)
$(dispatcher_nm_dispatcher_OBJECTS):            $(introspection_sources)
$(libnm_libnm_la_OBJECTS):                      $(introspection_sources)

613
EXTRA_DIST += \
614 615
	$(dbusinterfaces_DATA) \
	introspection/meson.build
616

617
check-docs:
618
	$(srcdir)/tools/check-docs.sh "$(srcdir)" "$(builddir)"
619 620 621

check_local += check-docs

622 623
###############################################################################

624
libnm_core_lib_h_pub_real = \
625 626 627 628 629
	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 \
630
	libnm-core/nm-setting-6lowpan.h \
631 632 633 634 635 636 637 638 639
	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 \
640
	libnm-core/nm-setting-dummy.h \
641
	libnm-core/nm-setting-ethtool.h \
642 643 644 645 646 647 648
	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 \
649
	libnm-core/nm-setting-macsec.h \
650
	libnm-core/nm-setting-macvlan.h \
651
	libnm-core/nm-setting-match.h \
652
	libnm-core/nm-setting-olpc-mesh.h \
653
	libnm-core/nm-setting-ovs-bridge.h \
654
	libnm-core/nm-setting-ovs-interface.h \
655
	libnm-core/nm-setting-ovs-patch.h \
656
	libnm-core/nm-setting-ovs-port.h \
657 658 659 660
	libnm-core/nm-setting-ppp.h \
	libnm-core/nm-setting-pppoe.h \
	libnm-core/nm-setting-proxy.h \
	libnm-core/nm-setting-serial.h \
661
	libnm-core/nm-setting-sriov.h \
662
	libnm-core/nm-setting-tc-config.h \
663 664 665
	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
666
	libnm-core/nm-setting-user.h \
667 668 669
	libnm-core/nm-setting-vlan.h \
	libnm-core/nm-setting-vpn.h \
	libnm-core/nm-setting-vxlan.h \
670
	libnm-core/nm-setting-wifi-p2p.h \
671 672
	libnm-core/nm-setting-wimax.h \
	libnm-core/nm-setting-wired.h \
673
	libnm-core/nm-setting-wireguard.h \
674 675
	libnm-core/nm-setting-wireless-security.h \
	libnm-core/nm-setting-wireless.h \
Lubomir Rintel's avatar
Lubomir Rintel committed
676
	libnm-core/nm-setting-wpan.h \
677 678 679 680 681 682 683
	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
684
libnm_core_lib_h_pub_mkenums = \
685 686
	libnm-core/nm-core-enum-types.h
libnm_core_lib_h_priv = \
687
	shared/nm-ethtool-utils.h \
688
	shared/nm-meta-setting.h \
689
	libnm-core/nm-crypto.h \
690
	libnm-core/nm-crypto-impl.h \
691 692 693 694 695 696 697 698
	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
699
libnm_core_lib_c_settings_real = \
700
	libnm-core/nm-setting-6lowpan.c \
701 702 703 704 705 706 707 708 709
	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 \
710
	libnm-core/nm-setting-dummy.c \
711
	libnm-core/nm-setting-ethtool.c \
712 713 714 715 716 717 718
	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 \
719
	libnm-core/nm-setting-macsec.c \
720
	libnm-core/nm-setting-macvlan.c \
721
	libnm-core/nm-setting-match.c \
722
	libnm-core/nm-setting-olpc-mesh.c \
723
	libnm-core/nm-setting-ovs-bridge.c \
724
	libnm-core/nm-setting-ovs-interface.c \
725
	libnm-core/nm-setting-ovs-patch.c \
726
	libnm-core/nm-setting-ovs-port.c \
727 728 729 730
	libnm-core/nm-setting-ppp.c \
	libnm-core/nm-setting-pppoe.c \
	libnm-core/nm-setting-proxy.c \
	libnm-core/nm-setting-serial.c \
731
	libnm-core/nm-setting-sriov.c \
732
	libnm-core/nm-setting-tc-config.c \
733 734 735
	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
736
	libnm-core/nm-setting-user.c \
737 738 739
	libnm-core/nm-setting-vlan.c \
	libnm-core/nm-setting-vpn.c \
	libnm-core/nm-setting-vxlan.c \
740
	libnm-core/nm-setting-wifi-p2p.c \
741 742
	libnm-core/nm-setting-wimax.c \
	libnm-core/nm-setting-wired.c \
743
	libnm-core/nm-setting-wireguard.c \
744
	libnm-core/nm-setting-wireless-security.c \
Lubomir Rintel's avatar
Lubomir Rintel committed
745 746
	libnm-core/nm-setting-wireless.c \
	libnm-core/nm-setting-wpan.c
747 748
libnm_core_lib_c_real = \
	$(libnm_core_lib_c_settings_real) \
749
	shared/nm-ethtool-utils.c \
750
	shared/nm-meta-setting.c \
751
	libnm-core/nm-crypto.c \
752 753 754
	libnm-core/nm-connection.c \
	libnm-core/nm-dbus-utils.c \
	libnm-core/nm-errors.c \
755
	libnm-core/nm-keyfile.c \
756 757
	libnm-core/nm-keyfile-utils.c \
	libnm-core/nm-property-compare.c \
758 759 760 761 762
	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
763 764 765

if WITH_JSON_VALIDATION
libnm_core_lib_h_priv += \
766
	libnm-core/nm-json.h
767
libnm_core_lib_c_real += \
768
	libnm-core/nm-json.c
769 770
endif

771
libnm_core_lib_c_mkenums = \
772 773 774 775
	libnm-core/nm-core-enum-types.c

libnminclude_HEADERS += \
	$(libnm_core_lib_h_pub_real)
776

777
nodist_libnminclude_HEADERS += \
778
	$(libnm_core_lib_h_pub_mkenums)
779 780 781

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

782
dflt_cppflags_libnm_core = \
783
	$(dflt_cppflags) \
784 785 786 787
	-I$(srcdir)/shared \
	-I$(builddir)/shared \
	-I$(srcdir)/libnm-core \
	-I$(builddir)/libnm-core \
788
	$(CODE_COVERAGE_CFLAGS) \
789
	$(GLIB_CFLAGS) \
790
	$(LIBUDEV_CFLAGS) \
791 792
	$(SANITIZER_LIB_CFLAGS) \
	$(NULL)
793

794 795 796
noinst_LTLIBRARIES += libnm-core/libnm-core.la

GLIB_GENERATED += \
797 798
	$(libnm_core_lib_h_pub_mkenums) \
	$(libnm_core_lib_c_mkenums)
799
nm_core_enum_types_sources = $(libnm_core_lib_h_pub_real)
800

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

803 804
libnm-core/nm-core-enum-types.h.stamp:                                      libnm-core/.dirstamp
libnm-core/nm-core-enum-types.c.stamp:                                      libnm-core/.dirstamp
805

806 807 808 809 810 811 812 813 814 815 816
$(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)
817
$(src_devices_ovs_libnm_device_plugin_ovs_la_OBJECTS):                      $(libnm_core_lib_h_pub_mkenums)
818

819
libnm_core_libnm_core_la_CPPFLAGS = \
820
	$(dflt_cppflags_libnm_core) \
821
	-DG_LOG_DOMAIN=\""libnm"\" \
822 823
	-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_LIBNM_CORE \
	$(NULL)
824

825 826 827 828
if WITH_JSON_VALIDATION
libnm_core_libnm_core_la_CPPFLAGS += $(JANSSON_CFLAGS)
endif

829
libnm_core_libnm_core_la_SOURCES = \
830 831 832 833 834
	$(libnm_core_lib_h_pub_real) \
	$(libnm_core_lib_h_priv) \
	$(libnm_core_lib_c_real)

nodist_libnm_core_libnm_core_la_SOURCES = \
835 836
	$(libnm_core_lib_h_pub_mkenums) \
	$(libnm_core_lib_c_mkenums)
837 838 839

libnm_core_libnm_core_la_LIBADD = \
	$(GLIB_LIBS) \
840
	$(UUID_LIBS) \
841
	$(NULL)
842

843
libnm_core_libnm_core_la_LDFLAGS = \
844 845
	$(CODE_COVERAGE_LDFLAGS) \
	$(SANITIZER_LIB_LDFLAGS)
846

847
EXTRA_DIST += \
848 849
	libnm-core/nm-crypto-gnutls.c \
	libnm-core/nm-crypto-nss.c \
850 851 852
	libnm-core/nm-core-enum-types.c.template \
	libnm-core/nm-core-enum-types.h.template \
	libnm-core/meson.build
853

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

858
libnm-core/nm-dbus-types.xml: libnm-core/nm-dbus-interface.h tools/enums-to-docbook.pl
859
	@$(MKDIR_P) libnm-core/
860
	$(AM_V_GEN) @PERL@ $(srcdir)/tools/enums-to-docbook.pl 'nm-dbus-types' 'NetworkManager D-Bus API Types' $< >$@
861 862 863 864 865

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

866 867 868 869
dist_dependencies += \
	libnm-core/nm-vpn-dbus-types.xml \
	libnm-core/nm-dbus-types.xml

870 871
###############################################################################

872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911
if HAVE_CRYPTO_GNUTLS
if WITH_GNUTLS
libnm_crypto_lib = libnm-core/libnm-crypto-gnutls.la
else
check_ltlibraries += libnm-core/libnm-crypto-gnutls.la
endif

libnm_core_libnm_crypto_gnutls_la_SOURCES = libnm-core/nm-crypto-gnutls.c
libnm_core_libnm_crypto_gnutls_la_CPPFLAGS = \
	$(libnm_core_libnm_core_la_CPPFLAGS) \
	$(GNUTLS_CFLAGS)
libnm_core_libnm_crypto_gnutls_la_LDFLAGS = \
	$(libnm_core_libnm_core_la_LDFLAGS)
libnm_core_libnm_crypto_gnutls_la_LIBADD = \
	$(libnm_core_libnm_core_la_LIBADD) \
	$(GNUTLS_LIBS)
endif

if HAVE_CRYPTO_NSS
if WITH_NSS
libnm_crypto_lib = libnm-core/libnm-crypto-nss.la
else
check_ltlibraries += libnm-core/libnm-crypto-nss.la
endif

libnm_core_libnm_crypto_nss_la_SOURCES = libnm-core/nm-crypto-nss.c
libnm_core_libnm_crypto_nss_la_CPPFLAGS = \
	$(libnm_core_libnm_core_la_CPPFLAGS) \
	$(NSS_CFLAGS)
libnm_core_libnm_crypto_nss_la_LDFLAGS = \
	$(libnm_core_libnm_core_la_LDFLAGS)
libnm_core_libnm_crypto_nss_la_LIBADD = \
	$(libnm_core_libnm_core_la_LIBADD) \
	$(NSS_LIBS)
endif

noinst_LTLIBRARIES += $(libnm_crypto_lib)

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

912
check_programs += \
913 914 915 916 917
	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 \
918
	libnm-core/tests/test-setting \
919 920 921 922 923 924 925
	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

926 927 928
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

929 930
$(libnm_core_tests_test_general_OBJECTS): libnm-core/tests/nm-core-tests-enum-types.h

931 932
libnm_core_tests_cppflags = \
	-I$(srcdir)/libnm-core/tests \
933
	-I$(builddir)/libnm-core/tests \
934
	$(dflt_cppflags_libnm_core) \
935 936
	-DNETWORKMANAGER_COMPILATION_TEST \
	-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_LIBNM_CORE \
937
	$(SANITIZER_EXEC_CFLAGS) \
938
	$(NULL)
939 940 941 942 943 944

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)
945
libnm_core_tests_test_setting_CPPFLAGS = $(libnm_core_tests_cppflags)
946 947 948 949 950 951
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

952 953 954 955
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

956 957
libnm_core_tests_ldadd = \
	libnm-core/libnm-core.la \
958 959
	shared/systemd/libnm-systemd-shared.la \
	shared/systemd/libnm-systemd-logging-stub.la \
960
	shared/nm-utils/libnm-utils-base.la \
961
	$(libnm_crypto_lib) \
962 963
	$(GLIB_LIBS)

964 965 966
libnm_core_tests_ldflags = \
	$(SANITIZER_LIB_LDFLAGS)

967 968 969 970 971
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)
972
libnm_core_tests_test_setting_LDADD = $(libnm_core_tests_ldadd)
973 974
libnm_core_tests_test_settings_defaults_LDADD = $(libnm_core_tests_ldadd)

975 976 977 978 979 980 981 982
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)

983 984 985 986 987
$(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)
988
$(libnm_core_tests_test_setting_OBJECTS): $(libnm_core_lib_h_pub_mkenums)
989 990
$(libnm_core_tests_test_settings_defaults_OBJECTS): $(libnm_core_lib_h_pub_mkenums)

991 992 993
# test-cert.p12 created with:
#
# openssl pkcs12 -export \
994 995 996 997 998
#    -in test_key_and_cert.pem \
#    -inkey test_key_and_cert.pem \
#    -certfile test_ca_cert.pem \
#    -name "test-pkcs12" \
#    -out test-cert.p12
999 1000 1001 1002 1003 1004 1005 1006 1007

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 \
1008 1009
	libnm-core/tests/certs/test-aes-128-key.pem \
	libnm-core/tests/certs/test-aes-256-key.pem \
1010 1011 1012 1013 1014 1015 1016 1017
	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 \
1018 1019 1020 1021
	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
1022 1023 1024

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

1025
libnm_lib_h_pub_real = \
1026 1027 1028 1029
	shared/nm-version-macros.h \
	libnm/NetworkManager.h \
	libnm/nm-access-point.h \
	libnm/nm-active-connection.h \
1030
	libnm/nm-autoptr.h \
1031
	libnm/nm-checkpoint.h \
1032
	libnm/nm-client.h \
1033
	libnm/nm-device-6lowpan.h \
1034 1035 1036 1037
	libnm/nm-device-adsl.h \
	libnm/nm-device-bond.h \
	libnm/nm-device-bridge.h \
	libnm/nm-device-bt.h \
1038
	libnm/nm-device-dummy.h \
1039 1040 1041 1042
	libnm/nm-device-ethernet.h \
	libnm/nm-device-generic.h \
	libnm/nm-device-infiniband.h \
	libnm/nm-device-ip-tunnel.h \
1043
	libnm/nm-device-macsec.h \
1044 1045 1046
	libnm/nm-device-macvlan.h \
	libnm/nm-device-modem.h \
	libnm/nm-device-olpc-mesh.h \
1047
	libnm/nm-device-ovs-bridge.h \
1048
	libnm/nm-device-ovs-interface.h \
1049
	libnm/nm-device-ovs-port.h \
1050
	libnm/nm-device-ppp.h \
1051 1052 1053 1054
	libnm/nm-device-team.h \
	libnm/nm-device-tun.h \
	libnm/nm-device-vlan.h \
	libnm/nm-device-vxlan.h \
1055
	libnm/nm-device-wifi-p2p.h \
1056 1057
	libnm/nm-device-wifi.h \
	libnm/nm-device-wimax.h \
1058
	libnm/nm-device-wireguard.h \
1059
	libnm/nm-device-wpan.h \
1060 1061 1062 1063 1064
	libnm/nm-device.h \
	libnm/nm-dhcp-config.h \
	libnm/nm-ip-config.h \
	libnm/nm-object.h \
	libnm/nm-remote-connection.h \
1065
	libnm/nm-secret-agent-old.h \
1066 1067 1068 1069
	libnm/nm-types.h \
	libnm/nm-vpn-connection.h \
	libnm/nm-vpn-editor.h \
	libnm/nm-vpn-plugin-old.h \
1070
	libnm/nm-vpn-service-plugin.h \
1071
	libnm/nm-wifi-p2p-peer.h \
1072
	libnm/nm-wimax-nsp.h
1073
libnm_lib_h_pub_mkenums = \
1074 1075
	libnm/nm-enum-types.h
libnm_lib_h_priv = \
1076
	libnm/nm-libnm-utils.h \
1077 1078 1079 1080
	libnm/nm-dbus-helpers.h \
	libnm/nm-device-private.h \
	libnm/nm-dhcp4-config.h \
	libnm/nm-dhcp6-config.h \
1081
	libnm/nm-dns-manager.h \
1082 1083 1084 1085 1086 1087
	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
1088
libnm_lib_c_real = \
1089 1090
	libnm/nm-access-point.c \
	libnm/nm-active-connection.c \
1091
	libnm/nm-checkpoint.c \
1092 1093
	libnm/nm-client.c \
	libnm/nm-dbus-helpers.c \
1094
	libnm/nm-device-6lowpan.c \
1095 1096 1097 1098
	libnm/nm-device-adsl.c \
	libnm/nm-device-bond.c \
	libnm/nm-device-bridge.c \
	libnm/nm-device-bt.c \
1099
	libnm/nm-device-dummy.c \
1100 1101 1102 1103
	libnm/nm-device-ethernet.c \
	libnm/nm-device-generic.c \
	libnm/nm-device-infiniband.c \
	libnm/nm-device-ip-tunnel.c \
1104
	libnm/nm-device-macsec.c \
1105 1106 1107
	libnm/nm-device-macvlan.c \
	libnm/nm-device-modem.c \
	libnm/nm-device-olpc-mesh.c \
1108
	libnm/nm-device-ovs-bridge.c \
1109
	libnm/nm-device-ovs-interface.c \
1110
	libnm/nm-device-ovs-port.c \
1111
	libnm/nm-device-ppp.c \
1112 1113 1114 1115
	libnm/nm-device-team.c \
	libnm/nm-device-tun.c \
	libnm/nm-device-vlan.c \
	libnm/nm-device-vxlan.c \
1116
	libnm/nm-device-wifi-p2p.c \
1117 1118
	libnm/nm-device-wifi.c \
	libnm/nm-device-wimax.c \
1119
	libnm/nm-device-wireguard.c \
1120
	libnm/nm-device-wpan.c \
1121 1122 1123 1124
	libnm/nm-device.c \
	libnm/nm-dhcp-config.c \
	libnm/nm-dhcp4-config.c \
	libnm/nm-dhcp6-config.c \
1125
	libnm/nm-dns-manager.c \
1126 1127 1128 1129 1130 1131 1132 1133 1134 1135
	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-editor.c \
1136
	libnm/nm-vpn-plugin-old.c \
1137
	libnm/nm-vpn-service-plugin.c \
1138
	libnm/nm-wifi-p2p-peer.c \
1139
	libnm/nm-wimax-nsp.c
1140
libnm_lib_c_mkenums = \
1141 1142
	libnm/nm-enum-types.c

1143 1144 1145
libnm_lib_cppflags = \
	-I$(srcdir)/libnm \
	-I$(builddir)/libnm \
1146
	$(dflt_cppflags_libnm_core) \
1147
	-DG_LOG_DOMAIN=\""libnm"\" \
1148
	-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_LIBNM \
1149
	$(NULL)
1150

1151
libnminclude_HEADERS += \
1152
	$(libnm_lib_h_pub_real)
1153 1154

nodist_libnminclude_HEADERS += \
1155
	$(libnm_lib_h_pub_mkenums)
1156 1157 1158

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

1159
noinst_LTLIBRARIES += libnm/libnm-utils.la
1160 1161

libnm_libnm_utils_la_CPPFLAGS = \
1162
	$(INTROSPECTION_CFLAGS) \
1163 1164 1165 1166 1167 1168 1169
	$(libnm_lib_cppflags)

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

libnm_libnm_utils_la_LIBADD = \
	libnm-core/libnm-core.la \
1170
	$(libnm_crypto_lib) \
1171
	introspection/libnmdbus.la \
1172 1173 1174
	shared/nm-utils/libnm-utils-base.la \
	$(GLIB_LIBS) \
	$(NULL)
1175 1176 1177 1178 1179

$(libnm_libnm_utils_la_OBJECTS) : $(libnm_lib_h_pub_mkenums)

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

1180 1181 1182
lib_LTLIBRARIES += libnm/libnm.la

GLIB_GENERATED += \
1183 1184
	$(libnm_lib_h_pub_mkenums) \
	$(libnm_lib_c_mkenums)
1185
nm_enum_types_sources = \
1186
	$(libnm_lib_h_pub_mkenums) \
1187
	$(libnm_lib_h_pub_real)
1188 1189 1190
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'

1191 1192 1193 1194
$(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)
1195

1196
libnm_libnm_la_CPPFLAGS = \
1197
	$(libnm_lib_cppflags) \
1198 1199
	$(LIBUDEV_CFLAGS) \
	$(SANITIZER_LIB_CFLAGS)
1200 1201

libnm_libnm_la_SOURCES = \
1202 1203 1204 1205 1206
	$(libnm_lib_h_pub_real) \
	$(libnm_lib_h_priv) \
	$(libnm_lib_c_real)

nodist_libnm_libnm_la_SOURCES = \
1207 1208
	$(libnm_lib_h_pub_mkenums) \
	$(libnm_lib_c_mkenums)
1209 1210 1211 1212 1213

EXTRA_libnm_libnm_la_DEPENDENCIES = \
	libnm/libnm.ver

libnm_libnm_la_LIBADD = \
1214
	libnm/libnm-utils.la \
1215 1216
	shared/systemd/libnm-systemd-shared.la \
	shared/systemd/libnm-systemd-logging-stub.la \
1217
	shared/nm-utils/libnm-utils-udev.la \
1218 1219 1220
	$(DL_LIBS) \
	$(GLIB_LIBS) \
	$(UUID_LIBS) \
1221
	$(NULL)
1222 1223 1224 1225

libnm_libnm_la_LDFLAGS = \
	-Wl,--version-script="$(srcdir)/libnm/libnm.ver" \
	$(CODE_COVERAGE_LDFLAGS) \
1226
	$(SANITIZER_LIB_LDFLAGS) \
1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242
	-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

1243
libnm_NM_1_0_typelib =
1244 1245

if HAVE_INTROSPECTION
1246 1247
libnm_NM_1_0_typelib += libnm/NM-1.0.typelib

1248 1249
libnm/NM-1.0.gir: libnm/libnm.la
libnm_NM_1_0_gir_INCLUDES = Gio-2.0
1250
libnm_NM_1_0_gir_PACKAGES = gio-2.0
1251 1252 1253
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
1254
libnm_NM_1_0_gir_FILES = \
1255
	$(libnm_core_lib_h_pub_mkenums) \
1256
	$(libnm_core_lib_h_pub_real) \
1257
	$(libnm_core_lib_c_mkenums) \
1258
	$(libnm_core_lib_c_real) \
1259
	$(libnm_lib_h_pub_mkenums) \
1260
	$(libnm_lib_h_pub_real) \
1261
	$(libnm_lib_c_mkenums) \
1262
	$(libnm_lib_c_real)
1263 1264
libnm_NM_1_0_gir_SCANNERFLAGS = --warn-all --identifier-prefix=NM --symbol-prefix=nm

1265 1266 1267 1268
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
1269 1270 1271

if WITH_FAKE_TYPELIBS

1272
libnm/fake-typelib/NetworkManager.typelib: libnm/fake-typelib/NetworkManager.gir libnm/fake-typelib/.dirstamp
1273
	$(AM_V_GEN) $(INTROSPECTION_COMPILER) $< -o $@
1274

1275
libnm/fake-typelib/NMClient.typelib: libnm/fake-typelib/NMClient.gir libnm/fake-typelib/.dirstamp
1276 1277 1278
	$(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
1279
	$(AM_V_GEN) $(GLIB_COMPILE_RESOURCES) $< --target=$@ --sourcedir=$(builddir)/libnm/fake-typelib --generate-source --manual-register
1280

1281
nodist_libnm_libnm_utils_la_SOURCES = \
1282 1283
	libnm/fake-typelib/typelibs.c

1284 1285 1286 1287
CLEANFILES += \
	libnm/fake-typelib/typelibs.c \
	libnm/fake-typelib/NMClient.typelib \
	libnm/fake-typelib/NetworkManager.typelib
1288 1289
endif

1290 1291
endif

1292 1293 1294
EXTRA_DIST += \
	libnm/fake-typelib/NetworkManager.gir \
	libnm/fake-typelib/NMClient.gir \
1295 1296
	libnm/fake-typelib/typelibs.gresource.xml \
	libnm/fake-typelib/meson.build
1297

1298
if HAVE_INTROSPECTION
1299 1300 1301

libnm_noinst_data = \
	libnm/nm-property-docs.xml \
1302 1303 1304 1305
	libnm/nm-settings-docs-overrides.xml \
	libnm/nm-settings-docs.xml \
	libnm/nm-settings-keyfile-docs.xml \
	libnm/nm-settings-ifcfg-rh-docs.xml
1306 1307 1308

noinst_DATA += $(libnm_noinst_data)

1309
libnm_docs_sources = $(libnm_core_lib_c_settings_real)
1310

1311
libnm/nm-settings-docs-overrides.xml: libnm/generate-plugin-docs.pl $(libnm_docs_sources)
1312
	$(AM_V_GEN) $(srcdir)/libnm/generate-plugin-docs.pl dbus $@ $(filter-out $<,$^)
1313 1314 1315 1316 1317

# 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
1318
	$(AM_V_GEN) \
1319 1320 1321
	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); \
1322