Skip to content

Commit

Permalink
Merge pull request #8 from Cyan4973/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
Cyan4973 committed Oct 3, 2014
2 parents 3332e5d + cc124e4 commit d54caef
Show file tree
Hide file tree
Showing 5 changed files with 1,736 additions and 1,559 deletions.
8 changes: 1 addition & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,8 @@
language: c
compiler: gcc
script: make test
script: make test-all
before_install:
- sudo apt-get update -qq
- sudo apt-get install -qq gcc-multilib
- sudo apt-get install -qq valgrind

env:
- XXH_TRAVIS_CI_ENV=-m32
- XXH_TRAVIS_CI_ENV=-m64

matrix:
fast_finish: true
40 changes: 18 additions & 22 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,42 +27,38 @@ CC=gcc
CFLAGS+= -I. -std=c99 -O3 -Wall -Wextra -Wundef -Wshadow -Wstrict-prototypes


OS := $(shell uname)
ifeq ($(OS),Linux)
EXT =
else
# Define *.exe as extension for Windows systems
ifneq (,$(filter Windows%,$(OS)))
EXT =.exe
endif

# Minimize test target for Travis CI's Build Matrix
ifeq ($(XXH_TRAVIS_CI_ENV),-m32)
TEST_TARGETS=test-32
else ifeq ($(XXH_TRAVIS_CI_ENV),-m64)
TEST_TARGETS=test-64
else
TEST_TARGETS=test-64 test-32
EXT =
endif

default: xxHash
default: xxhsum

all: xxHash xxHash32
all: xxhsum xxhsum32

xxHash: xxhash.c bench.c
xxhsum: xxhash.c bench.c
$(CC) $(CFLAGS) $^ -o $@$(EXT)
ln -sf $@ xxh32sum
ln -sf $@ xxh64sum

xxHash32: xxhash.c bench.c
xxhsum32: xxhash.c bench.c
$(CC) -m32 $(CFLAGS) $^ -o $@$(EXT)

test: $(TEST_TARGETS)

test-64: xxHash
./xxHash bench.c
valgrind ./xxHash -i1 bench.c
test: xxhsum
./xxhsum -b bench.c
valgrind ./xxhsum -bi1 bench.c
valgrind ./xxhsum -H0 bench.c
valgrind ./xxhsum -H1 bench.c

test-32: xxHash32
./xxHash32 bench.c
test-all: test xxhsum32
./xxhsum32 -b bench.c

clean:
rm -f core *.o xxHash$(EXT) xxHash32$(EXT)
@rm -f core *.o xxhsum$(EXT) xxhsum32$(EXT) xxh32sum xxh64sum
@echo cleaning completed


0 comments on commit d54caef

Please sign in to comment.