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