Makefile 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. # ################################################################
  2. # Copyright (c) Yann Collet, Facebook, Inc.
  3. # All rights reserved.
  4. #
  5. # This source code is licensed under both the BSD-style license (found in the
  6. # LICENSE file in the root directory of this source tree) and the GPLv2 (found
  7. # in the COPYING file in the root directory of this source tree).
  8. # You may select, at your option, one of the above-listed licenses.
  9. # ################################################################
  10. VOID := /dev/null
  11. ZSTDDIR := ../include
  12. LIBDIR := ../static
  13. DLLDIR := ../dll
  14. CFLAGS ?= -O3 # can select custom flags. For example : CFLAGS="-O2 -g" make
  15. CFLAGS += -Wall -Wextra -Wundef -Wcast-qual -Wcast-align -Wshadow -Wswitch-enum \
  16. -Wdeclaration-after-statement -Wstrict-prototypes \
  17. -Wpointer-arith -Wstrict-aliasing=1
  18. CFLAGS += $(MOREFLAGS)
  19. CPPFLAGS:= -I$(ZSTDDIR) -DXXH_NAMESPACE=ZSTD_
  20. FLAGS := $(CFLAGS) $(CPPFLAGS) $(LDFLAGS)
  21. # Define *.exe as extension for Windows systems
  22. ifneq (,$(filter Windows%,$(OS)))
  23. EXT =.exe
  24. else
  25. EXT =
  26. endif
  27. .PHONY: default fullbench-dll fullbench-lib
  28. default: all
  29. all: fullbench-dll fullbench-lib
  30. fullbench-lib: fullbench.c datagen.c
  31. $(CC) $(FLAGS) $^ -o $@$(EXT) $(LIBDIR)/libzstd_static.lib
  32. fullbench-dll: fullbench.c datagen.c
  33. $(CC) $(FLAGS) $^ -o $@$(EXT) -DZSTD_DLL_IMPORT=1 $(DLLDIR)/libzstd.dll
  34. clean:
  35. @$(RM) fullbench-dll$(EXT) fullbench-lib$(EXT) \
  36. @echo Cleaning completed