diff --git a/GNUmakefile b/GNUmakefile index 2d8c0988..3bfe7d4e 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -148,21 +148,6 @@ MDBX_BUILD_SOURCERY = $(shell set -o pipefail; $(MAKE) -s src/version.c && (open check: test dist -check-analyzer: - @echo "NOTE: There a lot of false-positive warnings at 2020-05-01 by pre-release GCC-10 (20200328, Red Hat 10.0.1-0.11)" - $(MAKE) --always-make CFLAGS_EXTRA="-Og -fanalyzer -Wno-error" build-test - -check-ubsan: - $(MAKE) clean && $(MAKE) CFLAGS_EXTRA="-Ofast -fsanitize=undefined -fsanitize-undefined-trap-on-error" check - -check-asan: - $(MAKE) clean && $(MAKE) CFLAGS_EXTRA="-Os -fsanitize=address" check - -check-leak: - $(MAKE) clean && $(MAKE) CFLAGS_EXTRA="-fsanitize=leak" check - -build-test: all mdbx_example mdbx_test - test: build-test rm -f $(TEST_DB) $(TEST_LOG) && (set -o pipefail; \ (./mdbx_test --progress --console=no --repeat=$(TEST_ITER) --pathname=$(TEST_DB) --dont-cleanup-after basic && \ @@ -170,9 +155,6 @@ test: build-test | tee >(gzip --stdout > $(TEST_LOG)) | tail -n 42) \ && ./mdbx_chk -vvn $(TEST_DB) && ./mdbx_chk -vvn $(TEST_DB)-copy -mdbx_example: mdbx.h example/example-mdbx.c libmdbx.$(SO_SUFFIX) - $(CC) $(CFLAGS) -I. example/example-mdbx.c ./libmdbx.$(SO_SUFFIX) -o $@ - test-singleprocess: all mdbx_test rm -f $(TEST_DB) $(TEST_LOG) && (set -o pipefail; \ (./mdbx_test --progress --console=no --repeat=42 --pathname=$(TEST_DB) --dont-cleanup-after --hill && \ @@ -197,6 +179,24 @@ memcheck test-valgrind: $(VALGRIND) ./mdbx_chk -vvn $(TEST_DB)-copy \ ) | tee >(gzip --stdout > $(TEST_LOG)) | tail -n 42) +gcc-analyzer: + @echo "NOTE: There a lot of false-positive warnings at 2020-05-01 by pre-release GCC-10 (20200328, Red Hat 10.0.1-0.11)" + $(MAKE) --always-make CFLAGS_EXTRA="-Og -fanalyzer -Wno-error" build-test + +test-ubsan: + $(MAKE) clean && $(MAKE) CFLAGS_EXTRA="-Ofast -fsanitize=undefined -fsanitize-undefined-trap-on-error" check + +test-asan: + $(MAKE) clean && $(MAKE) CFLAGS_EXTRA="-Os -fsanitize=address" check + +test-leak: + $(MAKE) clean && $(MAKE) CFLAGS_EXTRA="-fsanitize=leak" check + +mdbx_example: mdbx.h example/example-mdbx.c libmdbx.$(SO_SUFFIX) + $(CC) $(CFLAGS) -I. example/example-mdbx.c ./libmdbx.$(SO_SUFFIX) -o $@ + +build-test: all mdbx_example mdbx_test + define test-rule $(patsubst %.cc,%.o,$(1)): $(1) $(TEST_INC) mdbx.h $(lastword $(MAKEFILE_LIST)) $(CXX) $(CXXFLAGS) $(MDBX_OPTIONS) -c $(1) -o $$@ diff --git a/Makefile b/Makefile index 24c2f04f..187b748f 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -all install mdbx tools strip clean test check dist test-singleprocess test-fault memcheck test-valgrind cross-gcc cross-qemu bench bench-quartet clean-bench reformat build-test check-analyzer check-ubsan check-asan check-leak: +all bench bench-quartet build-test check clean clean-bench cross-gcc cross-qemu dist gcc-analyzer install mdbx memcheck reformat strip test test-asan test-fault test-leak test-singleprocess test-ubsan test-valgrind tools: @CC=$(CC) \ CXX=`if test -n "$(CXX)" && which "$(CXX)" > /dev/null; then echo "$(CXX)"; elif test -n "$(CCC)" && which "$(CCC)" > /dev/null; then echo "$(CCC)"; else echo "c++"; fi` \ `which gmake || which gnumake || echo 'echo "GNU Make is required"; exit 2;'` \