Makefile 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. # ################################################################
  2. # Copyright (c) 2016-present, 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. # ################################################################
  9. VOID := /dev/null
  10. ZSTDDIR := ../include
  11. LIBDIR := ../static
  12. DLLDIR := ../dll
  13. CFLAGS ?= -O3 # can select custom flags. For example : CFLAGS="-O2 -g" make
  14. CFLAGS += -Wall -Wextra -Wundef -Wcast-qual -Wcast-align -Wshadow -Wswitch-enum \
  15. -Wdeclaration-after-statement -Wstrict-prototypes \
  16. -Wpointer-arith -Wstrict-aliasing=1
  17. CFLAGS += $(MOREFLAGS)
  18. CPPFLAGS:= -I$(ZSTDDIR) -DXXH_NAMESPACE=ZSTD_
  19. FLAGS := $(CFLAGS) $(CPPFLAGS) $(LDFLAGS)
  20. # Define *.exe as extension for Windows systems
  21. ifneq (,$(filter Windows%,$(OS)))
  22. EXT =.exe
  23. else
  24. EXT =
  25. endif
  26. .PHONY: default fullbench-dll fullbench-lib
  27. default: all
  28. all: fullbench-dll fullbench-lib
  29. fullbench-lib: fullbench.c datagen.c
  30. $(CC) $(FLAGS) $^ -o $@$(EXT) $(LIBDIR)/libzstd_static.lib
  31. fullbench-dll: fullbench.c datagen.c
  32. $(CC) $(FLAGS) $^ -o $@$(EXT) -DZSTD_DLL_IMPORT=1 $(DLLDIR)/libzstd.dll
  33. clean:
  34. @$(RM) fullbench-dll$(EXT) fullbench-lib$(EXT) \
  35. @echo Cleaning completed