Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Binaries and build artifacts
*.o
*.a
bench
test-all

Expand Down
4 changes: 4 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
[submodule "deps/url-cpp"]
path = deps/url-cpp
url = https://github.com/seomoz/url-cpp
[submodule "deps/googletest"]
path = deps/googletest
url = https://github.com/google/googletest/
ignore = untracked
13 changes: 9 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
GTEST_DIR ?= deps/googletest/googletest

CXX ?= g++
CXXOPTS ?= -Wall -Werror -std=c++11 -Iinclude/ -Ideps/url-cpp/include
CXXOPTS ?= -Wall -Werror -std=c++11 -Iinclude/ -Ideps/url-cpp/include -I$(GTEST_DIR)/include
DEBUG_OPTS ?= -g -fprofile-arcs -ftest-coverage -O0 -fPIC
RELEASE_OPTS ?= -O3
BINARIES =
BINARIES =

all: test release/librep.o $(BINARIES)

$(GTEST_DIR)/libgtest.a:
g++ -isystem $(GTEST_DIR)/include -I$(GTEST_DIR) -pthread -c $(GTEST_DIR)/src/gtest-all.cc -o $(GTEST_DIR)/libgtest.a

# Release libraries
release:
mkdir -p release
Expand Down Expand Up @@ -42,8 +47,8 @@ test/%.o: test/%.cpp
$(CXX) $(CXXOPTS) $(DEBUG_OPTS) -o $@ -c $<

# Tests
test-all: test/test-all.o test/test-agent.o test/test-directive.o test/test-robots.o debug/librep.o
$(CXX) $(CXXOPTS) $(DEBUG_OPTS) -o $@ $^ -lgtest -lpthread
test-all: test/test-all.o test/test-agent.o test/test-directive.o test/test-robots.o debug/librep.o $(GTEST_DIR)/libgtest.a
$(CXX) $(CXXOPTS) -L$(GTEST_DIR) $(DEBUG_OPTS) -o $@ $^ -lpthread

# Bench
bench: bench.cpp release/librep.o
Expand Down
1 change: 1 addition & 0 deletions deps/googletest
Submodule googletest added at ca102b
9 changes: 0 additions & 9 deletions scripts/travis/before_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,3 @@ set -e
sudo apt-get install -y g++ libgtest-dev cmake python-pip

sudo pip install gcovr==3.2

pushd /tmp
mkdir -p gtest-build
pushd gtest-build
cmake -DCMAKE_BUILD_TYPE=RELEASE /usr/src/gtest/
make
find . -name 'libg*.a' | xargs sudo cp -f --target-directory=/usr/lib/
popd
popd