build: Use $(MAKE) instead of direct call to make
[vpp.git] / Makefile
index 6675b51..18908fa 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -72,7 +72,7 @@ DEB_DEPENDS += debhelper dkms git libtool libapr1-dev dh-python
 DEB_DEPENDS += libconfuse-dev git-review exuberant-ctags cscope pkg-config
 DEB_DEPENDS += gcovr lcov chrpath autoconf libnuma-dev
 DEB_DEPENDS += python3-all python3-setuptools check
-DEB_DEPENDS += libffi-dev python3-ply
+DEB_DEPENDS += libffi-dev python3-ply libunwind-dev
 DEB_DEPENDS += cmake ninja-build python3-jsonschema python3-yaml
 DEB_DEPENDS += python3-venv  # ensurepip
 DEB_DEPENDS += python3-dev python3-pip
@@ -245,6 +245,7 @@ help:
        @echo " build                - build debug binaries"
        @echo " build-release        - build release binaries"
        @echo " build-coverity       - build coverity artifacts"
+       @echo " build-vpp-gcov           - build gcov vpp only"
        @echo " rebuild              - wipe and build debug binaries"
        @echo " rebuild-release      - wipe and build release binaries"
        @echo " run                  - run debug binary"
@@ -252,6 +253,8 @@ help:
        @echo " debug                - run debug binary with debugger"
        @echo " debug-release        - run release binary with debugger"
        @echo " test                 - build and run tests"
+       @echo " test-cov-hs              - build and run host stack tests with coverage"
+       @echo " test-cov-both            - build and run python and host stack tests, merge coverage data"
        @echo " test-help            - show help on test framework"
        @echo " run-vat              - run vpp-api-test tool"
        @echo " pkg-deb              - build DEB packages"
@@ -440,6 +443,10 @@ rebuild: wipe build
 build-release: $(BR)/.deps.ok
        $(call make,$(PLATFORM),$(addsuffix -install,$(TARGETS)))
 
+.PHONY: build-vpp-gcov
+build-vpp-gcov:
+       $(call test,vpp_gcov)
+
 .PHONY: wipe-release
 wipe-release: test-wipe $(BR)/.deps.ok
        $(call make,$(PLATFORM),$(addsuffix -wipe,$(TARGETS)))
@@ -486,6 +493,20 @@ test-cov:
        $(eval TEST_GCOV=1)
        $(call test,vpp_gcov,cov)
 
+.PHONY: test-cov-hs
+test-cov-hs:
+       @$(MAKE) -C extras/hs-test build-cov
+       @$(MAKE) -C extras/hs-test test-cov
+
+.PHONY: test-cov-both
+test-cov-both:
+       @echo "Running Python, Golang tests and merging coverage reports."
+       find $(BR) -name '*.gcda' -delete
+       @$(MAKE) test-cov
+       find $(BR) -name '*.gcda' -delete
+       @$(MAKE) test-cov-hs
+       @$(MAKE) cov-merge
+
 .PHONY: test-cov-build
 test-cov-build:
        $(eval CC=gcc)
@@ -502,6 +523,14 @@ test-cov-post:
        $(eval CC=gcc)
        $(call test,vpp_gcov,cov-post)
 
+.PHONY: cov-merge
+cov-merge:
+       @lcov --add-tracefile $(BR)/test-coverage-merged/coverage-filtered.info \
+               -a $(BR)/test-coverage-merged/coverage-filtered1.info -o $(BR)/test-coverage-merged/coverage-merged.info
+       @genhtml $(BR)/test-coverage-merged/coverage-merged.info \
+               --output-directory $(BR)/test-coverage-merged/html
+       @echo "Code coverage report is in $(BR)/test-coverage-merged/html/index.html"
+
 .PHONY: test-all
 test-all:
        $(eval EXTENDED_TESTS=1)
@@ -551,7 +580,7 @@ test-shell-cov:
 
 .PHONY: test-dep
 test-dep:
-       @make -C test test-dep
+       @$(MAKE) -C test test-dep
 
 .PHONY: test-doc
 test-doc: