citrun

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

Makefile.inc (1168B)


      1 #
      2 # Uncomment this to build with coverage.
      3 #COVERAGE=
      4 #
      5 
      6 #actions TestCoverage
      7 #{
      8 #	set -e
      9 #	#CFLAGS="-coverage" LDFLAGS="-coverage" ./configure
     10 #	#CFLAGS="--coverage" LDFLAGS="--coverage" jam -j4
     11 #	CXX=/usr/local/bin/clang++ CFLAGS="-fprofile-instr-generate -fcoverage-mapping" LDFLAGS=${CFLAGS} jam -dx
     12 #
     13 #exit 1
     14 #	# Roll libgcov.a into libcitrun.a.
     15 #	ar -M < t/libcitrun_gcov.mri
     16 
     17 #	prove
     18 #	# prove tt
     19 
     20 #	mkdir gcov
     21 #	# The output from gcov is valuable to save too.
     22 #	gcov -o lib lib/lib*.c | tee gcov/SUMMARY
     23 #	egcov -r bin/*.cc | tee -a gcov/SUMMARY
     24 #	mv *.gcov gcov/
     25 #}
     26 
     27 CFLAGS +=	-Wall -W -Wcast-qual -Wwrite-strings
     28 CXXFLAGS +=	-Wall -W -Wcast-qual \
     29 		-std=c++14 \
     30 		-fno-exceptions \
     31 		-fno-rtti \
     32 		-Wno-unused-parameter \
     33 		-Werror=date-time \
     34 		-fvisibility-inlines-hidden \
     35 		-Wdelete-non-virtual-dtor
     36 
     37 .if defined(COVERAGE)
     38 #CXX = /usr/local/bin/clang++
     39 CFLAGS += -fprofile-instr-generate -fcoverage-mapping
     40 CXXFLAGS += -fprofile-instr-generate -fcoverage-mapping
     41 LDFLAGS += -v -fprofile-instr-generate
     42 .endif
     43 
     44 PREFIX ?!=	readlink -f ${.CURDIR}/..
     45 
     46 CPPFLAGS += -I../include
     47 
     48 tags: ${SRCS}
     49 	ctags -d *.c *.cc *.h
     50 
     51 analysis:
     52 	make clean
     53 	scan-build make
     54