Makefile 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. # ##########################################################################
  2. # LZ4 programs - Makefile
  3. # Copyright (C) Yann Collet 2016-2020
  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. # - LZ4 homepage : http://www.lz4.org
  23. # - LZ4 source repository : https://github.com/lz4/lz4
  24. # ##########################################################################
  25. VOID := /dev/null
  26. LZ4DIR := ../include
  27. LIBDIR := ../static
  28. DLLDIR := ../dll
  29. CFLAGS ?= -O3 # can select custom flags. For example : CFLAGS="-O2 -g" make
  30. CFLAGS += -Wall -Wextra -Wundef -Wcast-qual -Wcast-align -Wshadow -Wswitch-enum \
  31. -Wdeclaration-after-statement -Wstrict-prototypes \
  32. -Wpointer-arith -Wstrict-aliasing=1
  33. CFLAGS += $(MOREFLAGS)
  34. CPPFLAGS:= -I$(LZ4DIR) -DXXH_NAMESPACE=LZ4_
  35. FLAGS := $(CFLAGS) $(CPPFLAGS) $(LDFLAGS)
  36. # Define *.exe as extension for Windows systems
  37. ifneq (,$(filter Windows%,$(OS)))
  38. EXT =.exe
  39. else
  40. EXT =
  41. endif
  42. .PHONY: default fullbench-dll fullbench-lib
  43. default: all
  44. all: fullbench-dll fullbench-lib
  45. fullbench-lib: fullbench.c xxhash.c
  46. $(CC) $(FLAGS) $^ -o $@$(EXT) $(LIBDIR)/liblz4_static.lib
  47. fullbench-dll: fullbench.c xxhash.c
  48. $(CC) $(FLAGS) $^ -o $@$(EXT) -DLZ4_DLL_IMPORT=1 $(DLLDIR)/liblz4.dll
  49. clean:
  50. @$(RM) fullbench-dll$(EXT) fullbench-lib$(EXT) \
  51. @echo Cleaning completed