"Fossies" - the Fresh Open Source Software Archive

Member "xxHash-0.8.0/tests/collisions/Makefile" (27 Jul 2020, 2087 Bytes) of package /linux/misc/xxHash-0.8.0.tar.gz:


As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. See also the latest Fossies "Diffs" side-by-side code changes report for "Makefile": 0.7.4_vs_0.8.0.

    1 #  Brute force collision tester for 64-bit hashes
    2 #  Part of xxHash project
    3 #  Copyright (C) 2019-2020 Yann Collet
    4 #
    5 # GPL v2 License
    6 #
    7 # This program is free software; you can redistribute it and/or modify
    8 # it under the terms of the GNU General Public License as published by
    9 # the Free Software Foundation; either version 2 of the License, or
   10 # (at your option) any later version.
   11 #
   12 # This program is distributed in the hope that it will be useful,
   13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
   14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   15 # GNU General Public License for more details.
   16 #
   17 # You should have received a copy of the GNU General Public License along
   18 # with this program; if not, write to the Free Software Foundation, Inc.,
   19 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
   20 #
   21 #  You can contact the author at:
   22 #  - xxHash homepage: https://www.xxhash.com
   23 #  - xxHash source repository: https://github.com/Cyan4973/xxHash
   24 #
   25 
   26 SRC_DIRS = ./ ../../ allcodecs/
   27 VPATH = $(SRC_DIRS)
   28 CPPFLAGS += $(addprefix -I ,$(SRC_DIRS))
   29 CFLAGS   ?= -std=c99 \
   30             -Wall -Wextra -Wconversion
   31 CXXFLAGS ?= -Wall -Wextra -Wconversion -std=c++11
   32 LDFLAGS  += -pthread
   33 TESTHASHES = 110000000
   34 
   35 HASH_SRC := $(sort $(wildcard allcodecs/*.c allcodecs/*.cc))
   36 HASH_OBJ := $(patsubst %.c,%.o,$(HASH_SRC))
   37 
   38 
   39 .PHONY: default
   40 default: release
   41 
   42 .PHONY: all
   43 all: release
   44 
   45 collisionsTest: main.o pool.o threading.o sort.o $(HASH_OBJ)
   46 	$(CXX) $(CPPFLAGS) $(CXXFLAGS) $^ $(LDFLAGS) -o $@
   47 
   48 main.o: hashes.h xxhash.h
   49 
   50 release: CXXFLAGS += -O3
   51 release: CFLAGS += -O3
   52 release: collisionsTest
   53 
   54 debug: CXXFLAGS += -g3 -O0 -DDEBUG
   55 debug: CFLAGS += -g3 -O0 -DDEBUG
   56 debug: collisionsTest
   57 
   58 .PHONY: check
   59 check: test
   60 
   61 .PHONY: test
   62 test: debug
   63 	@echo ""
   64 	@echo "## $(TESTHASHES) hashes with original and 0 threads"
   65 	@time ./collisionsTest --nbh=$(TESTHASHES)
   66 	@echo ""
   67 	@echo "## $(TESTHASHES) hashes with original and 4 threads"
   68 	@time ./collisionsTest --nbh=$(TESTHASHES) --threadlog=2
   69 	@echo ""
   70 
   71 .PHONY: clean
   72 clean:
   73 	$(RM) *.o allcodecs/*.o
   74 	$(RM) collisionsTest