Skip to content

Commit

Permalink
Use clang to compile coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisvasz committed Jan 1, 2012
1 parent 5ecf49c commit dc1ae7c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ bin/
obj/
main.cpp
Debug*/
lib/

# eclipse project files
.*project
Expand Down
13 changes: 4 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,26 +1,21 @@
# List objects in order of DEPENDENCY. For example, if obj/main.o depends on
# obj/matrix.o, list obj/matrix.o first.
OBJECTS =
EXE = bin/main

TESTOBJS = obj/array_hash_test.o
TESTEXE = bin/test

# make variables
OFLAGS = -O0
CXX = gcc-4.2 --coverage
CXX = /opt/llvm/bin/clang++
CXXFLAGS = -Wall -c $(OFLAGS)
LDFLAGS = -lboost_unit_test_framework-mt -lstdc++
LDFLAGS = -lboost_unit_test_framework-mt -lprofile_rt -L/opt/llvm/lib

COMPILE.cpp = $(CXX) $(CXXFLAGS)

all: test

main: $(OBJECTS)
$(CXX) $(OFLAGS) $(OBJECTS) -o $(EXE) $(LDFLAGS)

test: $(TESTOBJS)
$(CXX) $(OFLAGS) $(TESTOBJS) -o $(TESTEXE) $(LDFLAGS)
./$(TESTEXE)

cover: $(TESTOBJS)
$(CXX) --coverage -o $(TESTEXE) $(LDFLAGS) $(TESTOBJS)
Expand All @@ -32,7 +27,7 @@ obj/%.o: src/%.cpp
$(COMPILE.cpp) -o $@ $<

obj/%.o: test/%.cpp
$(COMPILE.cpp) -o $@ $<
$(COMPILE.cpp) --coverage -o $@ $<

clean:
rm -f $(OBJECTS) $(EXE)
Expand Down

0 comments on commit dc1ae7c

Please sign in to comment.