]> git.droids-corp.org - dpdk.git/commitdiff
mk: do not build tests by default
authorFerruh Yigit <ferruh.yigit@intel.com>
Thu, 16 Feb 2017 14:57:43 +0000 (14:57 +0000)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Tue, 28 Feb 2017 15:04:18 +0000 (16:04 +0100)
Don't build tests with default "make" command.

Require explicit command to build tests because not everybody interested
in running unit tests.

Following changes done in make rules:
"make test-build"  <--- Added
"make test"        <--- Updated functionality (build + run basic tests)

Now "make test" builds all tests and runs unit test (test).

Thanks to dependency resolving, it is possible to call "make test"
directly after config, "make test" will compile dependent components
(lib and drivers, but not apps).

And a new "make test-build" make rule added which will build
tests but not run unit test. "make test-build" has same dependency
resolving features with "make test"

To include "test" folder into makesystem, existing ROOTDIRS- variable
is used instead of hardcoding folder name into makefiles, current usage
of ROOTDIRS* variables are:

ROOTDIRS-y <-- root level folders prepared and compiled by default
ROOTDIRS-  <-- root level folders prepared but not compiled by default

The preparation is required for dependency resolving and cleaning.

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
GNUmakefile
mk/rte.sdkbuild.mk
mk/rte.sdkdepdirs.mk
mk/rte.sdkroot.mk

index b1a5b761ab6c6a0cb3ee8c831add847cc8ede4b6..45b7fbbe244c93208b4252ca7e8e04702c839b37 100644 (file)
@@ -40,6 +40,7 @@ export RTE_SDK
 # directory list
 #
 
-ROOTDIRS-y := buildtools lib drivers app test
+ROOTDIRS-y := buildtools lib drivers app
+ROOTDIRS-  := test
 
 include $(RTE_SDK)/mk/rte.sdkroot.mk
index db6b98326a4c06275b5ef67fb79dccccc658e3f4..02ff35b029e66bd5cbb946bd24c8c20e430fada2 100644 (file)
@@ -48,7 +48,7 @@ define depdirs_rule
 $(1): $(sort $(LOCAL_DEPDIRS-$(1)))
 endef
 
-$(foreach d,$(ROOTDIRS-y),$(eval $(call depdirs_rule,$(d))))
+$(foreach d,$(ROOTDIRS-y) $(ROOTDIRS-),$(eval $(call depdirs_rule,$(d))))
 drivers: | buildtools
 
 #
@@ -72,9 +72,12 @@ clean: $(CLEANDIRS)
        $(Q)$(MAKE) -f $(RTE_SDK)/GNUmakefile gcovclean
        @echo Clean complete
 
+.PHONY: test-build
+test-build: test
+
 .SECONDEXPANSION:
-.PHONY: $(ROOTDIRS-y)
-$(ROOTDIRS-y):
+.PHONY: $(ROOTDIRS-y) $(ROOTDIRS-)
+$(ROOTDIRS-y) $(ROOTDIRS-):
        @[ -d $(BUILDDIR)/$@ ] || mkdir -p $(BUILDDIR)/$@
        @echo "== Build $@"
        $(Q)$(MAKE) S=$@ -f $(RTE_SRCDIR)/$@/Makefile -C $(BUILDDIR)/$@ all
index 38fd8636819ff9c011783e5b8fab892f5ff31945..1d4b12f27fcd4f00300a16edbf09672e2099b9c3 100644 (file)
@@ -36,7 +36,7 @@ ifeq (,$(wildcard $(RTE_OUTPUT)/Makefile))
   $(error "need a make config first")
 endif
 
-DEPDIR_FILES = $(addsuffix /.depdirs, $(addprefix $(BUILDDIR)/,$(ROOTDIRS-y)))
+DEPDIR_FILES = $(addsuffix /.depdirs, $(addprefix $(BUILDDIR)/,$(ROOTDIRS-y) $(ROOTDIRS-)))
 
 .PHONY: depdirs
 depdirs: $(RTE_OUTPUT)/.depdirs
index 04ad523bb43af628728a9d40ad64ba79ecce5b9b..1bc0f94de85b02e2b5e07f46690372237687e86b 100644 (file)
@@ -96,6 +96,9 @@ config showconfigs showversion showversionum:
 test fast_test ring_test mempool_test perf_test coverage:
        $(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdktest.mk $@
 
+.PHONY: test-buid
+test: test-build
+
 .PHONY: install
 install:
        $(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdkinstall.mk pre_install