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