• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# ################################################################
2# xxHash benchHash Makefile
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# benchHash: A generic benchmark for hash algorithms
26#            measuring throughput, latency and bandwidth
27# ################################################################
28
29
30CPPFLAGS += -I../..   # directory of xxHash source files
31CFLAGS   ?= -O3
32CFLAGS   += -std=c99 -Wall -Wextra -Wstrict-aliasing=1
33CFLAGS   += $(MOREFLAGS)   # custom way to add flags
34CXXFLAGS ?= -O3
35LDFLAGS  += $(MOREFLAGS)
36
37
38OBJ_LIST  = main.o bhDisplay.o benchHash.o benchfn.o timefn.o
39
40
41default: benchHash
42
43all: benchHash
44
45benchHash32: CFLAGS   += -m32
46benchHash32: CXXFLAGS += -m32
47
48benchHash_avx2: CFLAGS   += -mavx2
49benchHash_avx2: CXXFLAGS += -mavx2
50
51benchHash_hw: CPPFLAGS += -DHARDWARE_SUPPORT
52benchHash_hw: CFLAGS   += -mavx2 -maes
53benchHash_hw: CXXFLAGS += -mavx2 -mpclmul -std=c++14
54
55benchHash benchHash32 benchHash_avx2 benchHash_nosimd benchHash_hw: $(OBJ_LIST)
56	$(CXX) $(CPPFLAGS) $(CXXFLAGS) $^ $(LDFLAGS) -o $@
57
58
59main.o: bhDisplay.h hashes.h
60
61bhDisplay.o: bhDisplay.h benchHash.h
62
63benchHash.o: benchHash.h
64
65
66clean:
67	$(RM) *.o benchHash benchHash32 benchHash_avx2 benchHash_hw
68