aboutsummaryrefslogtreecommitdiffstats
path: root/makefile
diff options
context:
space:
mode:
authorbloodstalker <thabogre@gmail.com>2016-12-17 18:07:54 +0000
committerbloodstalker <thabogre@gmail.com>2016-12-17 18:07:54 +0000
commit9d592566e8551b84122dd504255173fc1efff7dc (patch)
tree0a26f355e45c325fbcfbdaf8445520aacfba93c1 /makefile
parentupdated (diff)
downloadmutator-9d592566e8551b84122dd504255173fc1efff7dc.tar.gz
mutator-9d592566e8551b84122dd504255173fc1efff7dc.zip
added coverage options, the g++ build mode is no longer broken
Diffstat (limited to '')
-rw-r--r--makefile33
1 files changed, 31 insertions, 2 deletions
diff --git a/makefile b/makefile
index f2e112e..5f460c5 100644
--- a/makefile
+++ b/makefile
@@ -2,11 +2,40 @@
#######################################VARS####################################
CXX?=clang++
LLVM_CONF?=llvm-config
+BUILD_MODE?=COV_NO
CXX_FLAGS=$(shell $(LLVM_CONF) --cxxflags)
-EXTRA_CXX_FALGS=-I$(shell $(LLVM_CONF) --src-root)/tools/clang/include -I$(shell $(LLVM_CONF) --obj-root)/tools/clang/include -std=c++11 -stdlib=libstdc++
+ifeq ($(BUILD_MODE), COV_USE)
+EXTRA_CXX_FALGS=-I$(shell $(LLVM_CONF) --src-root)/tools/clang/include -I$(shell $(LLVM_CONF) --obj-root)/tools/clang/include\
+ -std=c++11 -stdlib=libstdc++ -UNDEBUG -fprofile-instr-use=code.profdata
+EXTRA_LD_FLAGS=-v tinyxml2/tinyxml2.o -fprofile-instr-use=code.profdata
+endif
+
+ifeq ($(BUILD_MODE), COV_GEN)
+EXTRA_CXX_FALGS=-I$(shell $(LLVM_CONF) --src-root)/tools/clang/include -I$(shell $(LLVM_CONF) --obj-root)/tools/clang/include\
+ -std=c++11 -stdlib=libstdc++ -UNDEBUG -fprofile-instr-generate
+EXTRA_LD_FLAGS=-v tinyxml2/tinyxml2.o -fprofile-instr-generate
+endif
+
+#for gcov compatibility
+ifeq ($(BUILD_MODE), COV_GNU)
+EXTRA_CXX_FALGS=-I$(shell $(LLVM_CONF) --src-root)/tools/clang/include -I$(shell $(LLVM_CONF) --obj-root)/tools/clang/include\
+ -std=c++11 -stdlib=libstdc++ -UNDEBUG -fprofile-arcs -ftest-coverage
+EXTRA_LD_FLAGS=-v tinyxml2/tinyxml2.o -fprofile-arcs -ftest-coverage
+endif
+
+ifeq ($(BUILD_MODE), COV_NO_CLANG)
+EXTRA_CXX_FALGS=-I$(shell $(LLVM_CONF) --src-root)/tools/clang/include -I$(shell $(LLVM_CONF) --obj-root)/tools/clang/include\
+ -std=c++11 -stdlib=libstdc++ -UNDEBUG
+EXTRA_LD_FLAGS=-v tinyxml2/tinyxml2.o
+endif
+
+ifeq ($(BUILD_MODE), GNU_MODE)
+EXTRA_CXX_FALGS=-I$(shell $(LLVM_CONF) --src-root)/tools/clang/include -I$(shell $(LLVM_CONF) --obj-root)/tools/clang/include\
+ -std=c++11 -stdlib=libstdc++ -UNDEBUG
EXTRA_LD_FLAGS=-v tinyxml2/tinyxml2.o
+endif
LD_FLAGS=-Wl,--start-group -lclangAST -lclangAnalysis -lclangBasic\
-lclangDriver -lclangEdit -lclangFrontend -lclangFrontendTool\
@@ -26,7 +55,7 @@ TARGET2=mutator-lvl2
######################################RULES####################################
.DEFAULT: all
-.PHONY:all clean help
+.PHONY:all clean help $(TARGET) $(TARGET0) $(TARGET2)
all: $(TARGET) $(TARGET2) $(TARGET0)