Makefile 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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. CPPFLAGS += -I../.. # directory of xxHash source files
  29. CFLAGS ?= -O3
  30. CFLAGS += -std=c99 -Wall -Wextra -Wstrict-aliasing=1
  31. CFLAGS += $(MOREFLAGS) # custom way to add flags
  32. CXXFLAGS ?= -O3
  33. LDFLAGS += $(MOREFLAGS)
  34. OBJ_LIST = main.o bhDisplay.o benchHash.o benchfn.o timefn.o
  35. default: benchHash
  36. all: benchHash
  37. benchHash32: CFLAGS += -m32
  38. benchHash32: CXXFLAGS += -m32
  39. benchHash_avx2: CFLAGS += -mavx2
  40. benchHash_avx2: CXXFLAGS += -mavx2
  41. benchHash_hw: CPPFLAGS += -DHARDWARE_SUPPORT
  42. benchHash_hw: CFLAGS += -mavx2 -maes
  43. benchHash_hw: CXXFLAGS += -mavx2 -mpclmul -std=c++14
  44. benchHash benchHash32 benchHash_avx2 benchHash_nosimd benchHash_hw: $(OBJ_LIST)
  45. $(CXX) $(CPPFLAGS) $(CXXFLAGS) $^ $(LDFLAGS) -o $@
  46. main.o: bhDisplay.h hashes.h
  47. bhDisplay.o: bhDisplay.h benchHash.h
  48. benchHash.o: benchHash.h
  49. clean:
  50. $(RM) *.o benchHash benchHash32 benchHash_avx2 benchHash_hw