summaryrefslogtreecommitdiff
path: root/Makefile.am
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2020-12-25 16:35:47 +0100
committerThomas Haller <thaller@redhat.com>2021-01-15 11:32:30 +0100
commit186f2da2fc82cdac81a5fd01a21912301d6c036c (patch)
tree5ee49667ea3db3e9c6c8239f36f5f70380f74ee7 /Makefile.am
parent05008faf6ef88a5ec75e220ff41216153bc02a2d (diff)
downloadNetworkManager-186f2da2fc82cdac81a5fd01a21912301d6c036c.tar.gz
shared,platform: add "shared/nm-platform" library
NetworkManager core is huge. We should try to split out parts that are independent. Platform code is already mostly independent. But due to having it under "src/", there is no strict separation/layering which determines the parts that can work independently. So, while the code is mostly independent (in practice), that is not obvious from looking at the source tree. It thus still contributes to cognitive load. Add a shared library "shared/nm-platform", which should have no dependencies on libnm-core or NetworkManager core. In a first step, move the netlink code there. More should follow.
Diffstat (limited to 'Makefile.am')
-rw-r--r--Makefile.am59
1 files changed, 56 insertions, 3 deletions
diff --git a/Makefile.am b/Makefile.am
index 493081373c..269fec1e50 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -464,6 +464,59 @@ shared_nm_udev_aux_libnm_udev_aux_la_LIBADD = \
###############################################################################
+noinst_LTLIBRARIES += shared/nm-platform/libnm-platform.la
+
+shared_nm_platform_libnm_platform_la_CPPFLAGS = \
+ $(shared_nm_glib_aux_cppflags) \
+ $(NULL)
+
+shared_nm_platform_libnm_platform_la_SOURCES = \
+ shared/nm-platform/nm-netlink.c \
+ shared/nm-platform/nm-netlink.h \
+ $(NULL)
+
+shared_nm_platform_libnm_platform_la_LDFLAGS = \
+ $(CODE_COVERAGE_LDFLAGS) \
+ $(SANITIZER_LIB_LDFLAGS) \
+ $(NULL)
+
+shared_nm_platform_libnm_platform_la_LIBADD = \
+ $(GLIB_LIBS) \
+ $(NULL)
+
+###############################################################################
+
+check_programs += shared/nm-platform/tests/test-nm-platform
+
+shared_nm_platform_tests_test_nm_platform_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) \
+ $(NULL)
+
+shared_nm_platform_tests_test_nm_platform_LDFLAGS = \
+ $(CODE_COVERAGE_LDFLAGS) \
+ $(SANITIZER_EXEC_LDFLAGS) \
+ $(NULL)
+
+shared_nm_platform_tests_test_nm_platform_LDADD = \
+ shared/nm-platform/libnm-platform.la \
+ shared/nm-glib-aux/libnm-glib-aux.la \
+ shared/nm-std-aux/libnm-std-aux.la \
+ shared/libcsiphash.la \
+ $(GLIB_LIBS) \
+ $(NULL)
+
+EXTRA_DIST += \
+ shared/nm-platform/tests/meson.build \
+ $(NULL)
+
+###############################################################################
+
noinst_LTLIBRARIES += libnm-core/nm-libnm-core-intern/libnm-libnm-core-intern.la
libnm_core_nm_libnm_core_intern_libnm_libnm_core_intern_la_CPPFLAGS = \
@@ -2121,9 +2174,6 @@ src_libNetworkManagerBase_la_SOURCES = \
src/NetworkManagerUtils.c \
src/NetworkManagerUtils.h \
\
- src/platform/nm-netlink.c \
- src/platform/nm-netlink.h \
- \
src/platform/nmp-netns.c \
src/platform/nmp-netns.h \
src/platform/nmp-object.c \
@@ -2392,6 +2442,7 @@ src_libNetworkManager_la_LIBADD = \
libnm-core/libnm-core.la \
$(libnm_crypto_lib) \
libnm-core/nm-libnm-core-intern/libnm-libnm-core-intern.la \
+ shared/nm-platform/libnm-platform.la \
shared/nm-udev-aux/libnm-udev-aux.la \
shared/nm-glib-aux/libnm-glib-aux.la \
shared/nm-std-aux/libnm-std-aux.la \
@@ -2503,6 +2554,7 @@ src_nm_iface_helper_LDADD = \
libnm-core/libnm-core.la \
$(libnm_crypto_lib) \
libnm-core/nm-libnm-core-intern/libnm-libnm-core-intern.la \
+ shared/nm-platform/libnm-platform.la \
shared/nm-udev-aux/libnm-udev-aux.la \
shared/nm-glib-aux/libnm-glib-aux.la \
shared/nm-std-aux/libnm-std-aux.la \
@@ -2555,6 +2607,7 @@ src_initrd_nm_initrd_generator_LDADD = \
libnm-core/libnm-core.la \
$(libnm_crypto_lib) \
libnm-core/nm-libnm-core-intern/libnm-libnm-core-intern.la \
+ shared/nm-platform/libnm-platform.la \
shared/nm-udev-aux/libnm-udev-aux.la \
shared/nm-glib-aux/libnm-glib-aux.la \
shared/nm-std-aux/libnm-std-aux.la \