aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/development/gcov/Makefile
blob: f27f8d8e2fe20018d1d1acdd382e2acb5fc7a561 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# Copyright (C) 2023 johannst

CXXFLAGS = -fprofile-arcs -ftest-coverage
# or the alias
#CXXFLAGS = --coverage

cov-gcc: clean
	g++ $(CXXFLAGS) -c -o cov.o cov.cc
	g++ $(CXXFLAGS) -o $@ cov.o
	./$@
	gcov --demangled-names cov.cc
	cat cov.cc.gcov
.PHONY: cov-gcc

cov-clang: clean
	clang++ $(CXXFLAGS) -c -o cov.o cov.cc
	clang++ $(CXXFLAGS) -o $@ cov.o
	./$@
	llvm-cov gcov --demangled-names cov.cc
	cat cov.cc.gcov
.PHONY: cov-clang

clean:
	$(RM) *.gcov *.gcno *.gcda *.o cov-*