diff options
author | bloodstalker <thabogre@gmail.com> | 2016-12-17 18:07:54 +0000 |
---|---|---|
committer | bloodstalker <thabogre@gmail.com> | 2016-12-17 18:07:54 +0000 |
commit | 9d592566e8551b84122dd504255173fc1efff7dc (patch) | |
tree | 0a26f355e45c325fbcfbdaf8445520aacfba93c1 /makefile | |
parent | updated (diff) | |
download | mutator-9d592566e8551b84122dd504255173fc1efff7dc.tar.gz mutator-9d592566e8551b84122dd504255173fc1efff7dc.zip |
added coverage options, the g++ build mode is no longer broken
Diffstat (limited to 'makefile')
-rw-r--r-- | makefile | 33 |
1 files changed, 31 insertions, 2 deletions
@@ -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) |