citrun

watch C/C++ source code execute
Log | Files | Refs | LICENSE

commit e7bdd506bb77c6d936cfb70eb7994695ea116009
parent 3d0936d10224f786523b36c3217ebce3f17e99bf
Author: Kyle Milz <milz@imac.0x30.net>
Date:   Thu,  4 Mar 2021 20:23:41 -0800

make: move coverage stuff

Diffstat:
MMakefile | 21---------------------
MMakefile.inc | 33+++++++++++++++++++++++++++++++++
Minst/Makefile | 3++-
3 files changed, 35 insertions(+), 22 deletions(-)

diff --git a/Makefile b/Makefile @@ -5,27 +5,6 @@ SUBDIR += lib # SUBDIR += share # SUBDIR += term -#actions TestCoverage -#{ -# set -e -# #CFLAGS="-coverage" LDFLAGS="-coverage" ./configure -# #CFLAGS="--coverage" LDFLAGS="--coverage" jam -j4 -# CXX=/usr/local/bin/clang++ CFLAGS="-fprofile-instr-generate -fcoverage-mapping" LDFLAGS=${CFLAGS} jam -dx -# -#exit 1 -# # Roll libgcov.a into libcitrun.a. -# ar -M < t/libcitrun_gcov.mri - -# prove -# # prove tt - -# mkdir gcov -# # The output from gcov is valuable to save too. -# gcov -o lib lib/lib*.c | tee gcov/SUMMARY -# egcov -r bin/*.cc | tee -a gcov/SUMMARY -# mv *.gcov gcov/ -#} - test: prove diff --git a/Makefile.inc b/Makefile.inc @@ -1,3 +1,29 @@ +# +# Uncomment this to build with coverage. +#COVERAGE= +# + +#actions TestCoverage +#{ +# set -e +# #CFLAGS="-coverage" LDFLAGS="-coverage" ./configure +# #CFLAGS="--coverage" LDFLAGS="--coverage" jam -j4 +# CXX=/usr/local/bin/clang++ CFLAGS="-fprofile-instr-generate -fcoverage-mapping" LDFLAGS=${CFLAGS} jam -dx +# +#exit 1 +# # Roll libgcov.a into libcitrun.a. +# ar -M < t/libcitrun_gcov.mri + +# prove +# # prove tt + +# mkdir gcov +# # The output from gcov is valuable to save too. +# gcov -o lib lib/lib*.c | tee gcov/SUMMARY +# egcov -r bin/*.cc | tee -a gcov/SUMMARY +# mv *.gcov gcov/ +#} + CFLAGS += -Wall -W -Wcast-qual -Wwrite-strings CXXFLAGS += -Wall -W -Wcast-qual \ -std=c++14 \ @@ -8,6 +34,13 @@ CXXFLAGS += -Wall -W -Wcast-qual \ -fvisibility-inlines-hidden \ -Wdelete-non-virtual-dtor +.if defined(COVERAGE) +#CXX = /usr/local/bin/clang++ +CFLAGS += -fprofile-instr-generate -fcoverage-mapping +CXXFLAGS += -fprofile-instr-generate -fcoverage-mapping +LDFLAGS += -v -fprofile-instr-generate +.endif + PREFIX ?!= readlink -f ${.CURDIR}/.. CPPFLAGS += -I../include diff --git a/inst/Makefile b/inst/Makefile @@ -8,10 +8,11 @@ PROG= citrun_inst LLVM_CONFIG ?= /usr/local/bin/llvm-config CXXFLAGS_LLVM !!= $(LLVM_CONFIG) --cppflags -LDFLAGS !!= $(LLVM_CONFIG) --ldflags +LDFLAGS_LLVM !!= $(LLVM_CONFIG) --ldflags LLVM_LDADD !!= $(LLVM_CONFIG) --libs CXXFLAGS += $(CXXFLAGS_LLVM) -DPREFIX=\"$(PREFIX)\" +LDFLAGS += $(LDFLAGS_LLVM) LDADD += -lclangTooling LDADD += -lclangFrontendTool