Fix build with libnuma-dev on some distributions
On some distributions when libnuma-dev is installed the tst_numa.o,
which was added to libltp.a pulls in symbols from numa library to random
unrealted tests which breaks the build.
This commit hence moves the tst_numa to a separate libltpnuma.a library
that is used for linking only for tests that actually use it and link
with -lnuma.
It also adds a libs/ directory to the top level directory which is
intended to collect all possible library code that is used from
different tests but couldn't be included in the main library.
Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
Acked-by: Jan Stancek <jstancek@redhat.com>
diff --git a/Makefile b/Makefile
index bcadd21..bc6e9a3 100644
--- a/Makefile
+++ b/Makefile
@@ -77,7 +77,7 @@
CLEAN_TARGETS += include runtest scenario_groups testscripts
endif
INSTALL_TARGETS += $(COMMON_TARGETS)
-CLEAN_TARGETS += $(COMMON_TARGETS) lib
+CLEAN_TARGETS += $(COMMON_TARGETS) lib libs
BOOTSTRAP_TARGETS := $(sort $(COMMON_TARGETS) $(CLEAN_TARGETS) $(INSTALL_TARGETS))
CLEAN_TARGETS := $(addsuffix -clean,$(CLEAN_TARGETS))
@@ -89,7 +89,7 @@
# overtaxed one, or one where -j => 1 was specified.
all: $(addsuffix -all,$(COMMON_TARGETS)) Version
-$(MAKE_TARGETS): lib-all
+$(MAKE_TARGETS): lib-all libs-all
.PHONY: include-all include-install
include-install: $(top_builddir)/include/config.h include/mk/config.mk include-all
@@ -110,7 +110,7 @@
## Pattern based subtarget rules.
lib-install: lib-all
-$(MAKE_TARGETS) include-all lib-all:
+$(MAKE_TARGETS) include-all lib-all libs-all:
$(MAKE) -C "$(subst -all,,$@)" \
-f "$(abs_top_srcdir)/$(subst -all,,$@)/Makefile" all