diff options
author | Przemyslaw Skibinski <inikep@gmail.com> | 2016-12-27 09:43:07 (GMT) |
---|---|---|
committer | Przemyslaw Skibinski <inikep@gmail.com> | 2016-12-27 09:43:07 (GMT) |
commit | efaa9b7bc72a037bddee530b8dcaefa53c9c999d (patch) | |
tree | 2ae32cac8cd397e2d3604d8172d18c61761496fa /programs | |
parent | b22e2bed5e44f2cdacb11cf01d4a15a00bcb76ca (diff) | |
parent | 19c0f21b000ababf11cb38e0d6154742f5e1cd83 (diff) | |
download | lz4-efaa9b7bc72a037bddee530b8dcaefa53c9c999d.zip lz4-efaa9b7bc72a037bddee530b8dcaefa53c9c999d.tar.gz lz4-efaa9b7bc72a037bddee530b8dcaefa53c9c999d.tar.bz2 |
Merge remote-tracking branch 'refs/remotes/lz4/dev' into dev
# Conflicts:
# lib/Makefile
Diffstat (limited to 'programs')
-rw-r--r-- | programs/Makefile | 29 | ||||
-rw-r--r-- | programs/bench.c | 6 | ||||
-rw-r--r-- | programs/lz4cli.c | 2 |
3 files changed, 21 insertions, 16 deletions
diff --git a/programs/Makefile b/programs/Makefile index 14b042a..07bec03 100644 --- a/programs/Makefile +++ b/programs/Makefile @@ -39,7 +39,9 @@ LIBVER_PATCH := $(shell echo $(LIBVER_PATCH_SCRIPT)) LIBVER := $(shell echo $(LIBVER_SCRIPT)) LZ4DIR := ../lib -VOID := /dev/null + +SRCFILES := $(wildcard $(LZ4DIR)/*.c) $(wildcard *.c) +OBJFILES := $(patsubst %.c,%.o,$(SRCFILES)) CPPFLAGS+= -I$(LZ4DIR) -DXXH_NAMESPACE=LZ4_ CFLAGS ?= -O3 @@ -56,33 +58,36 @@ MD2ROFF_FLAGS = --roff --warnings --manual="User Commands" --organization="lz4 # Define *.exe as extension for Windows systems ifneq (,$(filter Windows%,$(OS))) -EXT =.exe +VOID := nul +EXT :=.exe else -EXT = +VOID := /dev/null +EXT := endif default: lz4-release -lz4-release: $(LZ4DIR)/lz4.o $(LZ4DIR)/lz4hc.o $(LZ4DIR)/lz4frame.o $(LZ4DIR)/xxhash.o bench.o lz4io.o lz4cli.o datagen.o - $(CC) $(FLAGS) $^ -o lz4$(EXT) - all: lz4 lz4c all32: CFLAGS+=-m32 all32: all lz4: CFLAGS += $(DEBUGFLAGS) -lz4: lz4-release +lz4: $(OBJFILES) + $(CC) $(FLAGS) $^ -o $@$(EXT) + +lz4-release: DEBUGFLAGS= +lz4-release: lz4 -lz4c: CFLAGS += $(DEBUGFLAGS) -lz4c : $(LZ4DIR)/lz4.o $(LZ4DIR)/lz4hc.o $(LZ4DIR)/lz4frame.o $(LZ4DIR)/xxhash.o bench.o lz4io.o lz4cli.c datagen.o +lz4c : CFLAGS += $(DEBUGFLAGS) +lz4c : $(SRCFILES) $(CC) $(FLAGS) -DENABLE_LZ4C_LEGACY_OPTIONS $^ -o $@$(EXT) -lz4c32: CFLAGS+=-m32 -lz4c32: lz4 - @cp lz4$(EXT) lz4c32$(EXT) +lz4c32: CFLAGS += -m32 $(DEBUGFLAGS) +lz4c32: $(SRCFILES) + $(CC) $(FLAGS) $^ -o $@$(EXT) clean: @$(MAKE) -C $(LZ4DIR) $@ > $(VOID) diff --git a/programs/bench.c b/programs/bench.c index 01e610c..8311503 100644 --- a/programs/bench.c +++ b/programs/bench.c @@ -179,7 +179,7 @@ static int BMK_benchMem(const void* srcBuffer, size_t srcSize, UTIL_initTimer(&ticksPerSecond); /* Init */ - if (cLevel < LZ4HC_MIN_CLEVEL) cfunctionId = 0; else cfunctionId = 1; + if (cLevel < LZ4HC_CLEVEL_MIN) cfunctionId = 0; else cfunctionId = 1; switch (cfunctionId) { #ifdef COMPRESSOR0 @@ -503,8 +503,8 @@ int BMK_benchFiles(const char** fileNamesTable, unsigned nbFiles, { double const compressibility = (double)g_compressibilityDefault / 100; - if (cLevel > LZ4HC_MAX_CLEVEL) cLevel = LZ4HC_MAX_CLEVEL; - if (cLevelLast > LZ4HC_MAX_CLEVEL) cLevelLast = LZ4HC_MAX_CLEVEL; + if (cLevel > LZ4HC_CLEVEL_MAX) cLevel = LZ4HC_CLEVEL_MAX; + if (cLevelLast > LZ4HC_CLEVEL_MAX) cLevelLast = LZ4HC_CLEVEL_MAX; if (cLevelLast < cLevel) cLevelLast = cLevel; if (cLevelLast > cLevel) DISPLAYLEVEL(2, "Benchmarking levels from %d to %d\n", cLevel, cLevelLast); diff --git a/programs/lz4cli.c b/programs/lz4cli.c index e03aa98..cf91a99 100644 --- a/programs/lz4cli.c +++ b/programs/lz4cli.c @@ -188,7 +188,7 @@ static int usage_longhelp(const char* exeName) DISPLAY( "Compression levels : \n"); DISPLAY( "---------------------\n"); DISPLAY( "-0 ... -2 => Fast compression, all identicals\n"); - DISPLAY( "-3 ... -%d => High compression; higher number == more compression but slower\n", LZ4HC_MAX_CLEVEL); + DISPLAY( "-3 ... -%d => High compression; higher number == more compression but slower\n", LZ4HC_CLEVEL_MAX); DISPLAY( "\n"); DISPLAY( "stdin, stdout and the console : \n"); DISPLAY( "--------------------------------\n"); |