1# ##########################################################################
2# LZ4 programs - Makefile
3# Copyright (C) Yann Collet 2016
4#
5# GPL v2 License
6#
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.
11#
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.
16#
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.
20#
21# You can contact the author at :
22#  - LZ4 homepage : http://www.lz4.org
23#  - LZ4 source repository : https://github.com/lz4/lz4
24# ##########################################################################
25
26VOID    := /dev/null
27LZ4DIR  := ../include
28LIBDIR  := ../static
29DLLDIR  := ../dll
30
31CFLAGS  ?= -O3   # can select custom flags. For example : CFLAGS="-O2 -g" make
32CFLAGS  += -Wall -Wextra -Wundef -Wcast-qual -Wcast-align -Wshadow -Wswitch-enum \
33           -Wdeclaration-after-statement -Wstrict-prototypes \
34           -Wpointer-arith -Wstrict-aliasing=1
35CFLAGS  += $(MOREFLAGS)
36CPPFLAGS:= -I$(LZ4DIR) -DXXH_NAMESPACE=LZ4_
37FLAGS   := $(CFLAGS) $(CPPFLAGS) $(LDFLAGS)
38
39
40# Define *.exe as extension for Windows systems
41ifneq (,$(filter Windows%,$(OS)))
42EXT =.exe
43else
44EXT =
45endif
46
47.PHONY: default fullbench-dll fullbench-lib
48
49
50default: all
51
52all: fullbench-dll fullbench-lib
53
54
55fullbench-lib: fullbench.c xxhash.c
56	$(CC) $(FLAGS) $^ -o $@$(EXT) $(LIBDIR)/liblz4_static.lib
57
58fullbench-dll: fullbench.c xxhash.c
59	$(CC) $(FLAGS) $^ -o $@$(EXT) -DLZ4_DLL_IMPORT=1 $(DLLDIR)/liblz4.dll
60
61clean:
62	@$(RM) fullbench-dll$(EXT) fullbench-lib$(EXT) \
63	@echo Cleaning completed
64