Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisvasz committed Jan 1, 2012
2 parents 7b3bc93 + 112bbe1 commit 4dfa564
Show file tree
Hide file tree
Showing 13 changed files with 1,537 additions and 1,281 deletions.
28 changes: 22 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,26 @@
# executable files
# executable files and ouput directories
run
bin
obj
bin/
obj/
main.cpp
Debug*/
lib/

# google profiling tools
prof*
# eclipse project files
.*project
.settings/

# documentation files
doc/html
doc/html/

# unit testing files
cute/

# boost files
boost/

# coverage files
*.gcov

# input test data
inputs/
175 changes: 137 additions & 38 deletions Doxyfile

Large diffs are not rendered by default.

48 changes: 31 additions & 17 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,35 +1,49 @@
# List objects in order of DEPENDENCY. For example, if obj/main.o depends on
# obj/matrix.o, list obj/matrix.o first.
OBJECTS = obj/main.o
EXECUTABLE = bin/main
OBJS = obj/main.o
EXE = bin/main
TESTOBJS = obj/array_hash_test.o obj/hat_set_test.o
TESTEXE = bin/test

# make variables
OFLAGS = -O2
CXX = clang++
CXXFLAGS = -Wall -Wextra -c -I/opt/local/include -stdlib=libc++ $(OFLAGS)
LDFLAGS = -lprofiler -stdlib=libc++
CXX = /opt/llvm/bin/clang++
CXXFLAGS = -Wall -c
LDFLAGS = -lboost_unit_test_framework-mt -lprofile_rt -L/opt/llvm/lib

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

all: main

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

time: main
time bin/main < inputs/kjv

test: $(TESTOBJS)
$(CXX) --coverage -o $(TESTEXE) $(LDFLAGS) $(TESTOBJS)
./$(TESTEXE)
gcov -o obj test/array_hash_test.cpp > /dev/null
gcov -o obj test/hat_set_test.cpp > /dev/null
rm `ls *.gcov | grep -v "array_hash.h.gcov\|hat_trie.h.gcov"`

obj/%.o: src/%.cpp
$(COMPILE.cpp) -o $@ $<
$(COMPILE.cpp) $(OFLAGS) -o $@ $<

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

clean:
rm -f $(OBJECTS) $(EXECUTABLE)
rm -f $(OBJS) $(EXE)
rm -f $(TESTOBJS) $(TESTEXE)
rm obj/*

depend:
makedepend src/*.cpp 2>/dev/null
rm Makefile.bak
echo "========================================="
echo "Now change src/*.o to obj/*.o in Makefile"
echo "Now replace src/*.o with obj/*.o in Makefile"

# List dependencies here. Order doesn't matter. makedepend src/*.cpp
# works perfectly for this section.
# List dependencies here. Order doesn't matter.
# Ex:
# obj/main.o: src/main.* src/matrix.*
#
Expand All @@ -40,6 +54,6 @@ depend:
# Run this command:
# makedepend src/*.cpp
# ... then change src/*.o in this Makefile to obj/*.o.
# DO NOT DELETE

obj/main.o: src/array_hash.h src/hat_*.h
obj/array_hash_test.o: src/array_hash.h
obj/hat_set_test.o: src/array_hash.h src/hat*
obj/main.o: src/array_hash.h src/main.cpp src/hat*
Loading

0 comments on commit 4dfa564

Please sign in to comment.