2013-09-09 09:06:21 +00:00
|
|
|
# ################################################################
|
|
|
|
# LZ4 Makefile
|
|
|
|
# Copyright (C) Yann Collet 2011-2013
|
|
|
|
# GPL v2 License
|
|
|
|
#
|
|
|
|
# This program is free software; you can redistribute it and/or modify
|
|
|
|
# it under the terms of the GNU General Public License as published by
|
|
|
|
# the Free Software Foundation; either version 2 of the License, or
|
|
|
|
# (at your option) any later version.
|
|
|
|
#
|
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU General Public License for more details.
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU General Public License along
|
|
|
|
# with this program; if not, write to the Free Software Foundation, Inc.,
|
|
|
|
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
|
|
#
|
|
|
|
# You can contact the author at :
|
|
|
|
# - LZ4 source repository : http://code.google.com/p/lz4/
|
2013-09-25 09:00:37 +00:00
|
|
|
# - LZ4 forum froup : https://groups.google.com/forum/#!forum/lz4c
|
2013-09-09 09:06:21 +00:00
|
|
|
# ################################################################
|
|
|
|
# lz4 : Command Line Utility, supporting gzip-like arguments
|
|
|
|
# lz4c : CLU, supporting also legacy lz4demo arguments
|
|
|
|
# lz4c32: Same as lz4c, but forced to compile in 32-bits mode
|
|
|
|
# fuzzer : Test tool, to check lz4 integrity on target platform
|
|
|
|
# fuzzer32: Same as fuzzer, but forced to compile in 32-bits mode
|
|
|
|
# fullbench : Precisely measure speed for each LZ4 function variant
|
|
|
|
# fullbench32: Same as fullbench, but forced to compile in 32-bits mode
|
|
|
|
# ################################################################
|
|
|
|
|
2013-12-03 15:50:46 +00:00
|
|
|
RELEASE=r109
|
2013-10-21 08:03:40 +00:00
|
|
|
DESTDIR=
|
|
|
|
PREFIX=${DESTDIR}/usr
|
2013-09-25 09:00:37 +00:00
|
|
|
BINDIR=$(PREFIX)/bin
|
|
|
|
MANDIR=$(PREFIX)/share/man/man1
|
2013-10-01 20:32:43 +00:00
|
|
|
DISTRIBNAME=lz4-$(RELEASE).tar.gz
|
2012-10-24 12:59:19 +00:00
|
|
|
CC=gcc
|
2013-12-03 15:50:46 +00:00
|
|
|
CFLAGS=-I. -std=c99 -Wall -W -Wundef -DLZ4_VERSION=\"v1.0.9\"
|
2012-03-09 21:46:59 +00:00
|
|
|
|
2013-09-09 09:06:21 +00:00
|
|
|
# Define *.exe as extension for Windows systems
|
2013-09-25 09:00:37 +00:00
|
|
|
# ifeq ($(OS),Windows_NT)
|
|
|
|
ifneq (,$(filter Windows%,$(OS)))
|
2012-10-24 12:59:19 +00:00
|
|
|
EXT =.exe
|
2013-09-25 09:00:37 +00:00
|
|
|
else
|
|
|
|
EXT =
|
2012-03-09 21:46:59 +00:00
|
|
|
endif
|
|
|
|
|
2013-10-01 20:32:43 +00:00
|
|
|
TEXT = bench.c bench.h fullbench.c fuzzer.c lz4.1 lz4.c lz4cli.c \
|
2013-09-25 09:00:37 +00:00
|
|
|
lz4_format_description.txt lz4.h lz4hc.c lz4hc.h \
|
2013-10-01 20:32:43 +00:00
|
|
|
Makefile xxhash.c xxhash.h \
|
2013-09-25 09:00:37 +00:00
|
|
|
NEWS COPYING \
|
|
|
|
cmake/CMakeLists.txt cmake/pack/release_COPYING.txt \
|
|
|
|
cmake/pack/CMakeLists.txt
|
2013-10-01 20:32:43 +00:00
|
|
|
NONTEXT = LZ4_Streaming_Format.odt
|
|
|
|
SOURCES = $(TEXT) $(NONTEXT)
|
2013-09-25 09:00:37 +00:00
|
|
|
|
|
|
|
|
|
|
|
default: lz4 lz4c
|
2012-07-24 17:12:23 +00:00
|
|
|
|
2013-09-09 09:06:21 +00:00
|
|
|
all: lz4 lz4c lz4c32 fuzzer fuzzer32 fullbench fullbench32
|
2011-05-25 22:25:57 +00:00
|
|
|
|
2013-09-09 09:06:21 +00:00
|
|
|
lz4: lz4.c lz4hc.c bench.c xxhash.c lz4cli.c
|
|
|
|
$(CC) -O3 $(CFLAGS) -DDISABLE_LZ4C_LEGACY_OPTIONS $^ -o $@$(EXT)
|
2011-05-25 22:25:57 +00:00
|
|
|
|
2013-09-25 09:00:37 +00:00
|
|
|
lz4c : lz4.c lz4hc.c bench.c xxhash.c lz4cli.c
|
2013-09-09 09:06:21 +00:00
|
|
|
$(CC) -O3 $(CFLAGS) $^ -o $@$(EXT)
|
2013-07-01 07:50:40 +00:00
|
|
|
|
2013-09-09 09:06:21 +00:00
|
|
|
lz4c32: lz4.c lz4hc.c bench.c xxhash.c lz4cli.c
|
2013-07-01 07:50:40 +00:00
|
|
|
$(CC) -m32 -O3 $(CFLAGS) $^ -o $@$(EXT)
|
2011-05-25 22:25:57 +00:00
|
|
|
|
2013-09-25 09:00:37 +00:00
|
|
|
fuzzer : lz4.c lz4hc.c fuzzer.c
|
2013-09-09 09:06:21 +00:00
|
|
|
@echo fuzzer is a test tool to check lz4 integrity on target platform
|
2012-10-24 12:59:19 +00:00
|
|
|
$(CC) -O3 $(CFLAGS) $^ -o $@$(EXT)
|
2013-09-09 09:06:21 +00:00
|
|
|
|
2013-09-25 09:00:37 +00:00
|
|
|
fuzzer32: lz4.c lz4hc.c fuzzer.c
|
2013-08-12 08:35:52 +00:00
|
|
|
$(CC) -m32 -O3 $(CFLAGS) $^ -o $@$(EXT)
|
|
|
|
|
2013-09-25 09:00:37 +00:00
|
|
|
fullbench : lz4.c lz4hc.c xxhash.c fullbench.c
|
2013-06-10 17:29:13 +00:00
|
|
|
$(CC) -O3 $(CFLAGS) $^ -o $@$(EXT)
|
|
|
|
|
2013-09-25 09:00:37 +00:00
|
|
|
fullbench32: lz4.c lz4hc.c xxhash.c fullbench.c
|
2013-08-12 08:35:52 +00:00
|
|
|
$(CC) -m32 -O3 $(CFLAGS) $^ -o $@$(EXT)
|
|
|
|
|
2011-05-25 22:25:57 +00:00
|
|
|
clean:
|
2013-09-25 09:00:37 +00:00
|
|
|
@rm -f core *.o lz4$(EXT) lz4c$(EXT) lz4c32$(EXT) \
|
|
|
|
fuzzer$(EXT) fuzzer32$(EXT) fullbench$(EXT) fullbench32$(EXT)
|
|
|
|
@echo Cleaning completed
|
|
|
|
|
|
|
|
|
|
|
|
ifeq ($(shell uname),Linux)
|
|
|
|
|
2013-10-21 08:03:40 +00:00
|
|
|
install: lz4 lz4c
|
2013-09-25 09:00:37 +00:00
|
|
|
@install -d -m 755 $(BINDIR)/ $(MANDIR)/
|
|
|
|
@install -m 755 lz4 $(BINDIR)/lz4
|
2013-10-21 08:03:40 +00:00
|
|
|
@install -m 755 lz4c $(BINDIR)/lz4c
|
2013-09-25 09:00:37 +00:00
|
|
|
@install -m 644 lz4.1 $(MANDIR)/lz4.1
|
|
|
|
|
|
|
|
uninstall:
|
|
|
|
[ -x $(BINDIR)/lz4 ] && rm -f $(BINDIR)/lz4
|
2013-10-21 08:03:40 +00:00
|
|
|
[ -x $(BINDIR)/lz4c ] && rm -f $(BINDIR)/lz4c
|
2013-09-25 09:00:37 +00:00
|
|
|
[ -f $(MANDIR)/lz4.1 ] && rm -f $(MANDIR)/lz4.1
|
|
|
|
|
|
|
|
dist: clean
|
|
|
|
@install -dD -m 700 lz4-$(RELEASE)/cmake/pack/
|
2013-10-01 20:32:43 +00:00
|
|
|
@for f in $(TEXT); do \
|
|
|
|
tr -d '\r' < $$f > .tmp; \
|
|
|
|
install -m 600 .tmp lz4-$(RELEASE)/$$f; \
|
|
|
|
done
|
|
|
|
@rm .tmp
|
|
|
|
@for f in $(NONTEXT); do \
|
2013-09-25 09:00:37 +00:00
|
|
|
install -m 600 $$f lz4-$(RELEASE)/$$f; \
|
|
|
|
done
|
2013-10-01 20:32:43 +00:00
|
|
|
@tar -czf $(DISTRIBNAME) lz4-$(RELEASE)/
|
2013-09-25 09:00:37 +00:00
|
|
|
@rm -rf lz4-$(RELEASE)
|
2013-10-01 20:32:43 +00:00
|
|
|
@echo Distribution $(DISTRIBNAME) built
|
2013-09-25 09:00:37 +00:00
|
|
|
|
|
|
|
endif
|