core: use non-recursive build

Although having different parts of NM in different subdirectories
keeps the source tree neat, it has made the build messy, particularly
because of cross-dependencies between the subdirs.

Reorganize to build all of the pieces of the NetworkManager binary
from src/Makefile, and only use recursive make for test programs,
helper binaries, and plugins.

As part of this, get rid of all the per-directory convenience
libraries, and switch to building a single top-level
libNetworkManager.la, containing everything except main.c, which all
of the test programs can then link against.
This commit is contained in:
Dan Winship
2013-05-06 14:18:26 -04:00
parent 6c2a35a090
commit c4417c71b6
34 changed files with 355 additions and 1035 deletions

View File

@@ -1,76 +1,3 @@
SUBDIRS = . tests
INCLUDES = \
-I${top_srcdir} \
-I${top_builddir}/include \
-I${top_srcdir}/include \
-I${top_builddir}/src/generated \
-I${top_srcdir}/src/generated \
-I${top_srcdir}/src/logging \
-I${top_srcdir}/src/config \
-I${top_srcdir}/src/posix-signals \
-I${top_builddir}/libnm-util \
-I${top_srcdir}/libnm-util \
-I${top_srcdir}/src
noinst_LTLIBRARIES = libdhcp-manager.la libdhcp-dhclient.la
################## dhclient ##################
libdhcp_dhclient_la_SOURCES = \
nm-dhcp-dhclient-utils.h \
nm-dhcp-dhclient-utils.c \
nm-dhcp-dhclient.h \
nm-dhcp-dhclient.c
libdhcp_dhclient_la_CPPFLAGS = \
$(DBUS_CFLAGS) \
$(GLIB_CFLAGS) \
-DSYSCONFDIR=\"$(sysconfdir)\" \
-DLIBEXECDIR=\"$(libexecdir)\" \
-DLOCALSTATEDIR=\"$(localstatedir)\" \
-DDHCLIENT_PATH=\"$(DHCLIENT_PATH)\" \
-DNMSTATEDIR=\"$(nmstatedir)\" \
-DNMCONFDIR=\"$(nmconfdir)\"
libdhcp_dhclient_la_LIBADD = \
$(top_builddir)/src/logging/libnm-logging.la \
$(top_builddir)/src/posix-signals/libnm-posix-signals.la \
$(top_builddir)/libnm-util/libnm-util.la \
$(DBUS_LIBS) \
$(GLIB_LIBS)
################## main lib ##################
libdhcp_manager_la_SOURCES = \
nm-dhcp-client.c \
nm-dhcp-client.h \
nm-dhcp-manager.c \
nm-dhcp-manager.h \
nm-dhcp-dhcpcd.h \
nm-dhcp-dhcpcd.c
libdhcp_manager_la_CPPFLAGS = \
$(DBUS_CFLAGS) \
$(GLIB_CFLAGS) \
-DSYSCONFDIR=\"$(sysconfdir)\" \
-DLIBEXECDIR=\"$(libexecdir)\" \
-DLOCALSTATEDIR=\"$(localstatedir)\" \
-DDHCLIENT_PATH=\"$(DHCLIENT_PATH)\" \
-DDHCPCD_PATH=\"$(DHCPCD_PATH)\" \
-DNMSTATEDIR=\"$(nmstatedir)\" \
-DNMRUNDIR=\"$(nmrundir)\"
libdhcp_manager_la_LIBADD = \
$(top_builddir)/src/logging/libnm-logging.la \
$(top_builddir)/src/config/libnm-config.la \
$(top_builddir)/src/posix-signals/libnm-posix-signals.la \
$(builddir)/libdhcp-dhclient.la \
$(DBUS_LIBS) \
$(GLIB_LIBS)
################### dhclient helper ###################
libexec_PROGRAMS = nm-dhcp-helper
nm_dhcp_helper_SOURCES = nm-dhcp-helper.c

View File

@@ -1,5 +1,3 @@
if ENABLE_TESTS
INCLUDES = \
-I$(top_srcdir)/include \
-I$(top_builddir)/include \
@@ -19,16 +17,11 @@ test_dhcp_dhclient_CPPFLAGS = \
-DTESTDIR="\"$(abs_srcdir)\""
test_dhcp_dhclient_LDADD = \
-ldl \
$(top_builddir)/src/dhcp-manager/libdhcp-dhclient.la \
$(top_builddir)/libnm-util/libnm-util.la \
$(GLIB_LIBS)
$(top_builddir)/src/libNetworkManager.la
check-local: test-dhcp-dhclient
$(abs_builddir)/test-dhcp-dhclient
endif
EXTRA_DIST = \
test-dhclient-duid.leases \
test-dhclient-commented-duid.leases