1
# ##########################################################################
2
# LZ4 programs - Makefile
3
# Copyright (C) Yann Collet 2016-2020
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.
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.
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.
21
# You can contact the author at :
22
# - LZ4 homepage : http://www.lz4.org
23
# - LZ4 source repository : https://github.com/lz4/lz4
24
# ##########################################################################
31
CFLAGS ?= -O3 # can select custom flags. For example : CFLAGS="-O2 -g" make
32
CFLAGS += -Wall -Wextra -Wundef -Wcast-qual -Wcast-align -Wshadow -Wswitch-enum \
33
-Wdeclaration-after-statement -Wstrict-prototypes \
34
-Wpointer-arith -Wstrict-aliasing=1
35
CFLAGS += $(MOREFLAGS)
36
CPPFLAGS:= -I$(LZ4DIR) -DXXH_NAMESPACE=LZ4_
37
FLAGS := $(CFLAGS) $(CPPFLAGS) $(LDFLAGS)
40
# Define *.exe as extension for Windows systems
41
ifneq (,$(filter Windows%,$(OS)))
47
.PHONY: default fullbench-dll fullbench-lib
52
all: fullbench-dll fullbench-lib
55
fullbench-lib: fullbench.c xxhash.c
56
$(CC) $(FLAGS) $^ -o $@$(EXT) $(LIBDIR)/liblz4_static.lib
58
fullbench-dll: fullbench.c xxhash.c
59
$(CC) $(FLAGS) $^ -o $@$(EXT) -DLZ4_DLL_IMPORT=1 $(DLLDIR)/liblz4.dll
62
@$(RM) fullbench-dll$(EXT) fullbench-lib$(EXT) \
63
@echo Cleaning completed