2017-08-31 12:20:50 -07:00
|
|
|
# ################################################################
|
|
|
|
# Copyright (c) 2015-present, Yann Collet, Facebook, Inc.
|
2016-10-11 15:27:44 -07:00
|
|
|
# All rights reserved.
|
2016-05-23 05:23:55 -07:00
|
|
|
#
|
2017-08-31 12:20:50 -07:00
|
|
|
# This source code is licensed under both the BSD-style license (found in the
|
|
|
|
# LICENSE file in the root directory of this source tree) and the GPLv2 (found
|
|
|
|
# in the COPYING file in the root directory of this source tree).
|
|
|
|
# ################################################################
|
2016-08-18 04:18:11 -07:00
|
|
|
# datagen : Synthetic and parametrable data generator, for tests
|
2016-08-24 23:47:18 -07:00
|
|
|
# fullbench : Precisely measure speed for each zstd inner functions
|
|
|
|
# fullbench32: Same as fullbench, but forced to compile in 32-bits mode
|
2016-08-18 04:18:11 -07:00
|
|
|
# fuzzer : Test tool, to check zstd integrity on target platform
|
|
|
|
# fuzzer32: Same as fuzzer, but forced to compile in 32-bits mode
|
2016-08-24 23:47:18 -07:00
|
|
|
# paramgrill : parameter tester for zstd
|
|
|
|
# test-zstd-speed.py : script for testing zstd speed difference between commits
|
|
|
|
# versionsTest : compatibility test between zstd versions stored on Github (v0.1+)
|
|
|
|
# zstreamtest : Fuzzer test tool for zstd streaming API
|
2016-11-16 08:50:54 -08:00
|
|
|
# zstreamtest32: Same as zstreamtest, but forced to compile in 32-bits mode
|
2016-05-23 05:23:55 -07:00
|
|
|
# ##########################################################################
|
|
|
|
|
2016-08-18 04:18:11 -07:00
|
|
|
ZSTDDIR = ../lib
|
2016-08-18 04:53:26 -07:00
|
|
|
PRGDIR = ../programs
|
2016-08-18 05:04:57 -07:00
|
|
|
PYTHON ?= python3
|
%.o objects files in /tests
Recipe in /tests rebuild everything from source for each target.
zstd is still a "small" project, so it's not prohibitive,
yet, rebuilding same files over and over represents substantial redundant work.
This patch replaces *.c files from /lib by their corresponding *.o files.
They cannot be compiled and stored directly within /lib,
since /tests triggers additional debug capabilities unwelcome in release binary.
So the resulting *.o are stored directly within /tests.
It turns out, it's difficult to find several target using *exactly* the same rules.
Using only the default rules (debug enabled, multi-threading disabled, no legacy)
a surprisingly small amount of targets share their work.
It's because, in many cases there are additional modifications requested :
some targets are 32-bits, some enable multi-threading, some enable legacy support,
some disable asserts, some want different kind of sanitizer, etc.
I created 2 sets of object files : with and without multithreading.
Several targets share their work, saving compilation time when running `make all`.
Also, obviously, when modifying one source file, only this one needs rebuilding.
For targets requiring some different setting, build from source *.c remain the rule.
The new rules have been tested within `-j` parallel compilation, and work fine with it.
2017-12-27 08:49:18 -08:00
|
|
|
TESTARTEFACT := versionsTest
|
2016-08-18 05:04:57 -07:00
|
|
|
|
2017-09-27 15:16:27 -07:00
|
|
|
DEBUGLEVEL ?= 1
|
2018-06-13 11:59:26 -07:00
|
|
|
DEBUGFLAGS = -g -DDEBUGLEVEL=$(DEBUGLEVEL)
|
2017-09-27 15:16:27 -07:00
|
|
|
CPPFLAGS += -I$(ZSTDDIR) -I$(ZSTDDIR)/common -I$(ZSTDDIR)/compress \
|
|
|
|
-I$(ZSTDDIR)/dictBuilder -I$(ZSTDDIR)/deprecated -I$(PRGDIR)
|
2018-07-30 07:29:20 -07:00
|
|
|
ifeq ($(OS),Windows_NT) # MinGW assumed
|
2018-07-30 07:56:18 -07:00
|
|
|
CPPFLAGS += -D__USE_MINGW_ANSI_STDIO # compatibility with %zu formatting
|
2018-07-30 07:29:20 -07:00
|
|
|
endif
|
2017-09-27 15:16:27 -07:00
|
|
|
CFLAGS ?= -O3
|
|
|
|
CFLAGS += -Wall -Wextra -Wcast-qual -Wcast-align -Wshadow \
|
|
|
|
-Wstrict-aliasing=1 -Wswitch-enum -Wdeclaration-after-statement \
|
2019-02-01 01:29:40 -08:00
|
|
|
-Wstrict-prototypes -Wundef \
|
2017-09-27 15:16:27 -07:00
|
|
|
-Wvla -Wformat=2 -Winit-self -Wfloat-equal -Wwrite-strings \
|
2018-09-27 15:13:43 -07:00
|
|
|
-Wredundant-decls -Wmissing-prototypes
|
2017-09-27 15:16:27 -07:00
|
|
|
CFLAGS += $(DEBUGFLAGS) $(MOREFLAGS)
|
|
|
|
FLAGS = $(CPPFLAGS) $(CFLAGS) $(LDFLAGS)
|
2016-08-09 23:14:48 -07:00
|
|
|
|
2016-05-23 05:23:55 -07:00
|
|
|
|
2016-08-18 04:18:11 -07:00
|
|
|
ZSTDCOMMON_FILES := $(ZSTDDIR)/common/*.c
|
2017-02-23 23:09:10 -08:00
|
|
|
ZSTDCOMP_FILES := $(ZSTDDIR)/compress/*.c
|
2016-12-05 19:28:19 -08:00
|
|
|
ZSTDDECOMP_FILES := $(ZSTDDIR)/decompress/*.c
|
2017-02-23 23:09:10 -08:00
|
|
|
ZSTD_FILES := $(ZSTDDECOMP_FILES) $(ZSTDCOMMON_FILES) $(ZSTDCOMP_FILES)
|
2016-12-05 19:28:19 -08:00
|
|
|
ZBUFF_FILES := $(ZSTDDIR)/deprecated/*.c
|
2016-08-18 04:18:11 -07:00
|
|
|
ZDICT_FILES := $(ZSTDDIR)/dictBuilder/*.c
|
|
|
|
|
%.o objects files in /tests
Recipe in /tests rebuild everything from source for each target.
zstd is still a "small" project, so it's not prohibitive,
yet, rebuilding same files over and over represents substantial redundant work.
This patch replaces *.c files from /lib by their corresponding *.o files.
They cannot be compiled and stored directly within /lib,
since /tests triggers additional debug capabilities unwelcome in release binary.
So the resulting *.o are stored directly within /tests.
It turns out, it's difficult to find several target using *exactly* the same rules.
Using only the default rules (debug enabled, multi-threading disabled, no legacy)
a surprisingly small amount of targets share their work.
It's because, in many cases there are additional modifications requested :
some targets are 32-bits, some enable multi-threading, some enable legacy support,
some disable asserts, some want different kind of sanitizer, etc.
I created 2 sets of object files : with and without multithreading.
Several targets share their work, saving compilation time when running `make all`.
Also, obviously, when modifying one source file, only this one needs rebuilding.
For targets requiring some different setting, build from source *.c remain the rule.
The new rules have been tested within `-j` parallel compilation, and work fine with it.
2017-12-27 08:49:18 -08:00
|
|
|
ZSTD_F1 := $(wildcard $(ZSTD_FILES))
|
|
|
|
ZSTD_OBJ1 := $(subst $(ZSTDDIR)/common/,zstdm_,$(ZSTD_F1))
|
|
|
|
ZSTD_OBJ2 := $(subst $(ZSTDDIR)/compress/,zstdc_,$(ZSTD_OBJ1))
|
|
|
|
ZSTD_OBJ3 := $(subst $(ZSTDDIR)/decompress/,zstdd_,$(ZSTD_OBJ2))
|
|
|
|
ZSTD_OBJECTS := $(ZSTD_OBJ3:.c=.o)
|
|
|
|
|
|
|
|
ZSTDMT_OBJ1 := $(subst $(ZSTDDIR)/common/,zstdmt_m_,$(ZSTD_F1))
|
|
|
|
ZSTDMT_OBJ2 := $(subst $(ZSTDDIR)/compress/,zstdmt_c_,$(ZSTDMT_OBJ1))
|
|
|
|
ZSTDMT_OBJ3 := $(subst $(ZSTDDIR)/decompress/,zstdmt_d_,$(ZSTDMT_OBJ2))
|
|
|
|
ZSTDMT_OBJECTS := $(ZSTDMT_OBJ3:.c=.o)
|
2016-08-18 04:18:11 -07:00
|
|
|
|
|
|
|
# Define *.exe as extension for Windows systems
|
|
|
|
ifneq (,$(filter Windows%,$(OS)))
|
|
|
|
EXT =.exe
|
2017-02-23 23:09:10 -08:00
|
|
|
MULTITHREAD_CPP = -DZSTD_MULTITHREAD
|
|
|
|
MULTITHREAD_LD =
|
2016-08-18 04:18:11 -07:00
|
|
|
else
|
|
|
|
EXT =
|
2017-02-23 23:09:10 -08:00
|
|
|
MULTITHREAD_CPP = -DZSTD_MULTITHREAD
|
2017-02-24 00:16:05 -08:00
|
|
|
MULTITHREAD_LD = -pthread
|
2016-08-18 04:18:11 -07:00
|
|
|
endif
|
2017-02-23 23:09:10 -08:00
|
|
|
MULTITHREAD = $(MULTITHREAD_CPP) $(MULTITHREAD_LD)
|
2016-08-18 04:18:11 -07:00
|
|
|
|
2016-11-03 07:38:13 -07:00
|
|
|
VOID = /dev/null
|
2017-09-27 15:16:27 -07:00
|
|
|
ZSTREAM_TESTTIME ?= -T90s
|
|
|
|
FUZZERTEST ?= -T200s
|
2017-01-25 02:19:35 -08:00
|
|
|
ZSTDRTTEST = --test-large-data
|
2017-03-09 16:05:10 -08:00
|
|
|
DECODECORPUS_TESTTIME ?= -T30
|
2016-08-18 04:18:11 -07:00
|
|
|
|
%.o objects files in /tests
Recipe in /tests rebuild everything from source for each target.
zstd is still a "small" project, so it's not prohibitive,
yet, rebuilding same files over and over represents substantial redundant work.
This patch replaces *.c files from /lib by their corresponding *.o files.
They cannot be compiled and stored directly within /lib,
since /tests triggers additional debug capabilities unwelcome in release binary.
So the resulting *.o are stored directly within /tests.
It turns out, it's difficult to find several target using *exactly* the same rules.
Using only the default rules (debug enabled, multi-threading disabled, no legacy)
a surprisingly small amount of targets share their work.
It's because, in many cases there are additional modifications requested :
some targets are 32-bits, some enable multi-threading, some enable legacy support,
some disable asserts, some want different kind of sanitizer, etc.
I created 2 sets of object files : with and without multithreading.
Several targets share their work, saving compilation time when running `make all`.
Also, obviously, when modifying one source file, only this one needs rebuilding.
For targets requiring some different setting, build from source *.c remain the rule.
The new rules have been tested within `-j` parallel compilation, and work fine with it.
2017-12-27 08:49:18 -08:00
|
|
|
.PHONY: default all all32 allnothread dll clean test test32 test-all versionsTest
|
2016-08-18 04:53:26 -07:00
|
|
|
|
|
|
|
default: fullbench
|
%.o objects files in /tests
Recipe in /tests rebuild everything from source for each target.
zstd is still a "small" project, so it's not prohibitive,
yet, rebuilding same files over and over represents substantial redundant work.
This patch replaces *.c files from /lib by their corresponding *.o files.
They cannot be compiled and stored directly within /lib,
since /tests triggers additional debug capabilities unwelcome in release binary.
So the resulting *.o are stored directly within /tests.
It turns out, it's difficult to find several target using *exactly* the same rules.
Using only the default rules (debug enabled, multi-threading disabled, no legacy)
a surprisingly small amount of targets share their work.
It's because, in many cases there are additional modifications requested :
some targets are 32-bits, some enable multi-threading, some enable legacy support,
some disable asserts, some want different kind of sanitizer, etc.
I created 2 sets of object files : with and without multithreading.
Several targets share their work, saving compilation time when running `make all`.
Also, obviously, when modifying one source file, only this one needs rebuilding.
For targets requiring some different setting, build from source *.c remain the rule.
The new rules have been tested within `-j` parallel compilation, and work fine with it.
2017-12-27 08:49:18 -08:00
|
|
|
@echo $(ZSTDMT_OBJECTS)
|
2016-08-18 04:18:11 -07:00
|
|
|
|
2018-10-04 17:25:11 -07:00
|
|
|
all: fullbench fuzzer zstreamtest paramgrill datagen decodecorpus roundTripCrash \
|
|
|
|
fullbench-lib
|
2016-08-18 04:18:11 -07:00
|
|
|
|
2017-07-07 16:16:14 -07:00
|
|
|
all32: fullbench32 fuzzer32 zstreamtest32
|
2016-08-18 04:18:11 -07:00
|
|
|
|
2018-01-13 22:00:05 -08:00
|
|
|
allnothread: MULTITHREAD_CPP=
|
|
|
|
allnothread: MULTITHREAD_LD=
|
2017-08-31 15:02:14 -07:00
|
|
|
allnothread: fullbench fuzzer paramgrill datagen decodecorpus
|
2017-03-14 15:59:57 -07:00
|
|
|
|
2017-07-10 14:02:33 -07:00
|
|
|
dll: fuzzer-dll zstreamtest-dll
|
2016-12-17 07:28:12 -08:00
|
|
|
|
2018-06-29 16:52:21 -07:00
|
|
|
PHONY: zstd zstd32 zstd-nolegacy # must be phony, only external makefile knows how to build them, or if they need an update
|
|
|
|
zstd zstd32 zstd-nolegacy:
|
2017-12-13 11:48:30 -08:00
|
|
|
$(MAKE) -C $(PRGDIR) $@ MOREFLAGS+="$(DEBUGFLAGS)"
|
2016-08-18 04:18:11 -07:00
|
|
|
|
2016-11-30 06:20:24 -08:00
|
|
|
gzstd:
|
2018-01-16 11:50:16 -08:00
|
|
|
$(MAKE) -C $(PRGDIR) zstd HAVE_ZLIB=1 MOREFLAGS+="$(DEBUGFLAGS)"
|
2016-11-30 06:20:24 -08:00
|
|
|
|
2018-03-20 18:03:56 -07:00
|
|
|
.PHONY: zstd-dll
|
%.o objects files in /tests
Recipe in /tests rebuild everything from source for each target.
zstd is still a "small" project, so it's not prohibitive,
yet, rebuilding same files over and over represents substantial redundant work.
This patch replaces *.c files from /lib by their corresponding *.o files.
They cannot be compiled and stored directly within /lib,
since /tests triggers additional debug capabilities unwelcome in release binary.
So the resulting *.o are stored directly within /tests.
It turns out, it's difficult to find several target using *exactly* the same rules.
Using only the default rules (debug enabled, multi-threading disabled, no legacy)
a surprisingly small amount of targets share their work.
It's because, in many cases there are additional modifications requested :
some targets are 32-bits, some enable multi-threading, some enable legacy support,
some disable asserts, some want different kind of sanitizer, etc.
I created 2 sets of object files : with and without multithreading.
Several targets share their work, saving compilation time when running `make all`.
Also, obviously, when modifying one source file, only this one needs rebuilding.
For targets requiring some different setting, build from source *.c remain the rule.
The new rules have been tested within `-j` parallel compilation, and work fine with it.
2017-12-27 08:49:18 -08:00
|
|
|
zstd-dll :
|
|
|
|
$(MAKE) -C $(ZSTDDIR) libzstd
|
|
|
|
|
2018-03-20 18:03:56 -07:00
|
|
|
.PHONY: zstd-staticLib
|
%.o objects files in /tests
Recipe in /tests rebuild everything from source for each target.
zstd is still a "small" project, so it's not prohibitive,
yet, rebuilding same files over and over represents substantial redundant work.
This patch replaces *.c files from /lib by their corresponding *.o files.
They cannot be compiled and stored directly within /lib,
since /tests triggers additional debug capabilities unwelcome in release binary.
So the resulting *.o are stored directly within /tests.
It turns out, it's difficult to find several target using *exactly* the same rules.
Using only the default rules (debug enabled, multi-threading disabled, no legacy)
a surprisingly small amount of targets share their work.
It's because, in many cases there are additional modifications requested :
some targets are 32-bits, some enable multi-threading, some enable legacy support,
some disable asserts, some want different kind of sanitizer, etc.
I created 2 sets of object files : with and without multithreading.
Several targets share their work, saving compilation time when running `make all`.
Also, obviously, when modifying one source file, only this one needs rebuilding.
For targets requiring some different setting, build from source *.c remain the rule.
The new rules have been tested within `-j` parallel compilation, and work fine with it.
2017-12-27 08:49:18 -08:00
|
|
|
zstd-staticLib :
|
|
|
|
$(MAKE) -C $(ZSTDDIR) libzstd.a
|
|
|
|
|
|
|
|
zstdm_%.o : $(ZSTDDIR)/common/%.c
|
|
|
|
$(CC) -c $(CPPFLAGS) $(CFLAGS) $< -o $@
|
|
|
|
|
|
|
|
zstdc_%.o : $(ZSTDDIR)/compress/%.c
|
|
|
|
$(CC) -c $(CPPFLAGS) $(CFLAGS) $< -o $@
|
|
|
|
|
|
|
|
zstdd_%.o : $(ZSTDDIR)/decompress/%.c
|
|
|
|
$(CC) -c $(CPPFLAGS) $(CFLAGS) $< -o $@
|
|
|
|
|
2018-01-05 22:13:09 -08:00
|
|
|
zstdmt%.o : CPPFLAGS += $(MULTITHREAD_CPP)
|
%.o objects files in /tests
Recipe in /tests rebuild everything from source for each target.
zstd is still a "small" project, so it's not prohibitive,
yet, rebuilding same files over and over represents substantial redundant work.
This patch replaces *.c files from /lib by their corresponding *.o files.
They cannot be compiled and stored directly within /lib,
since /tests triggers additional debug capabilities unwelcome in release binary.
So the resulting *.o are stored directly within /tests.
It turns out, it's difficult to find several target using *exactly* the same rules.
Using only the default rules (debug enabled, multi-threading disabled, no legacy)
a surprisingly small amount of targets share their work.
It's because, in many cases there are additional modifications requested :
some targets are 32-bits, some enable multi-threading, some enable legacy support,
some disable asserts, some want different kind of sanitizer, etc.
I created 2 sets of object files : with and without multithreading.
Several targets share their work, saving compilation time when running `make all`.
Also, obviously, when modifying one source file, only this one needs rebuilding.
For targets requiring some different setting, build from source *.c remain the rule.
The new rules have been tested within `-j` parallel compilation, and work fine with it.
2017-12-27 08:49:18 -08:00
|
|
|
|
|
|
|
zstdmt_m_%.o : $(ZSTDDIR)/common/%.c
|
|
|
|
$(CC) -c $(CPPFLAGS) $(CFLAGS) $< -o $@
|
|
|
|
|
|
|
|
zstdmt_c_%.o : $(ZSTDDIR)/compress/%.c
|
|
|
|
$(CC) -c $(CPPFLAGS) $(CFLAGS) $< -o $@
|
|
|
|
|
|
|
|
zstdmt_d_%.o : $(ZSTDDIR)/decompress/%.c
|
|
|
|
$(CC) -c $(CPPFLAGS) $(CFLAGS) $< -o $@
|
|
|
|
|
2017-06-29 18:56:24 -07:00
|
|
|
fullbench32: CPPFLAGS += -m32
|
|
|
|
fullbench fullbench32 : CPPFLAGS += $(MULTITHREAD_CPP)
|
|
|
|
fullbench fullbench32 : LDFLAGS += $(MULTITHREAD_LD)
|
2018-08-06 15:08:35 -07:00
|
|
|
fullbench fullbench32 : DEBUGFLAGS = -DNDEBUG # turn off assert() for speed measurements
|
%.o objects files in /tests
Recipe in /tests rebuild everything from source for each target.
zstd is still a "small" project, so it's not prohibitive,
yet, rebuilding same files over and over represents substantial redundant work.
This patch replaces *.c files from /lib by their corresponding *.o files.
They cannot be compiled and stored directly within /lib,
since /tests triggers additional debug capabilities unwelcome in release binary.
So the resulting *.o are stored directly within /tests.
It turns out, it's difficult to find several target using *exactly* the same rules.
Using only the default rules (debug enabled, multi-threading disabled, no legacy)
a surprisingly small amount of targets share their work.
It's because, in many cases there are additional modifications requested :
some targets are 32-bits, some enable multi-threading, some enable legacy support,
some disable asserts, some want different kind of sanitizer, etc.
I created 2 sets of object files : with and without multithreading.
Several targets share their work, saving compilation time when running `make all`.
Also, obviously, when modifying one source file, only this one needs rebuilding.
For targets requiring some different setting, build from source *.c remain the rule.
The new rules have been tested within `-j` parallel compilation, and work fine with it.
2017-12-27 08:49:18 -08:00
|
|
|
fullbench fullbench32 : $(ZSTD_FILES)
|
2019-04-10 12:37:03 -07:00
|
|
|
fullbench fullbench32 : $(PRGDIR)/datagen.c $(PRGDIR)/util.c $(PRGDIR)/timefn.c $(PRGDIR)/benchfn.c fullbench.c
|
2017-06-29 18:56:24 -07:00
|
|
|
$(CC) $(FLAGS) $^ -o $@$(EXT)
|
2016-08-18 04:18:11 -07:00
|
|
|
|
2018-10-04 17:25:11 -07:00
|
|
|
fullbench-lib : CPPFLAGS += -DXXH_NAMESPACE=ZSTD_
|
%.o objects files in /tests
Recipe in /tests rebuild everything from source for each target.
zstd is still a "small" project, so it's not prohibitive,
yet, rebuilding same files over and over represents substantial redundant work.
This patch replaces *.c files from /lib by their corresponding *.o files.
They cannot be compiled and stored directly within /lib,
since /tests triggers additional debug capabilities unwelcome in release binary.
So the resulting *.o are stored directly within /tests.
It turns out, it's difficult to find several target using *exactly* the same rules.
Using only the default rules (debug enabled, multi-threading disabled, no legacy)
a surprisingly small amount of targets share their work.
It's because, in many cases there are additional modifications requested :
some targets are 32-bits, some enable multi-threading, some enable legacy support,
some disable asserts, some want different kind of sanitizer, etc.
I created 2 sets of object files : with and without multithreading.
Several targets share their work, saving compilation time when running `make all`.
Also, obviously, when modifying one source file, only this one needs rebuilding.
For targets requiring some different setting, build from source *.c remain the rule.
The new rules have been tested within `-j` parallel compilation, and work fine with it.
2017-12-27 08:49:18 -08:00
|
|
|
fullbench-lib : zstd-staticLib
|
2019-04-10 12:37:03 -07:00
|
|
|
fullbench-lib : $(PRGDIR)/datagen.c $(PRGDIR)/util.c $(PRGDIR)/timefn.c $(PRGDIR)/benchfn.c fullbench.c
|
%.o objects files in /tests
Recipe in /tests rebuild everything from source for each target.
zstd is still a "small" project, so it's not prohibitive,
yet, rebuilding same files over and over represents substantial redundant work.
This patch replaces *.c files from /lib by their corresponding *.o files.
They cannot be compiled and stored directly within /lib,
since /tests triggers additional debug capabilities unwelcome in release binary.
So the resulting *.o are stored directly within /tests.
It turns out, it's difficult to find several target using *exactly* the same rules.
Using only the default rules (debug enabled, multi-threading disabled, no legacy)
a surprisingly small amount of targets share their work.
It's because, in many cases there are additional modifications requested :
some targets are 32-bits, some enable multi-threading, some enable legacy support,
some disable asserts, some want different kind of sanitizer, etc.
I created 2 sets of object files : with and without multithreading.
Several targets share their work, saving compilation time when running `make all`.
Also, obviously, when modifying one source file, only this one needs rebuilding.
For targets requiring some different setting, build from source *.c remain the rule.
The new rules have been tested within `-j` parallel compilation, and work fine with it.
2017-12-27 08:49:18 -08:00
|
|
|
$(CC) $(FLAGS) $(filter %.c,$^) -o $@$(EXT) $(ZSTDDIR)/libzstd.a
|
2016-11-21 03:51:01 -08:00
|
|
|
|
%.o objects files in /tests
Recipe in /tests rebuild everything from source for each target.
zstd is still a "small" project, so it's not prohibitive,
yet, rebuilding same files over and over represents substantial redundant work.
This patch replaces *.c files from /lib by their corresponding *.o files.
They cannot be compiled and stored directly within /lib,
since /tests triggers additional debug capabilities unwelcome in release binary.
So the resulting *.o are stored directly within /tests.
It turns out, it's difficult to find several target using *exactly* the same rules.
Using only the default rules (debug enabled, multi-threading disabled, no legacy)
a surprisingly small amount of targets share their work.
It's because, in many cases there are additional modifications requested :
some targets are 32-bits, some enable multi-threading, some enable legacy support,
some disable asserts, some want different kind of sanitizer, etc.
I created 2 sets of object files : with and without multithreading.
Several targets share their work, saving compilation time when running `make all`.
Also, obviously, when modifying one source file, only this one needs rebuilding.
For targets requiring some different setting, build from source *.c remain the rule.
The new rules have been tested within `-j` parallel compilation, and work fine with it.
2017-12-27 08:49:18 -08:00
|
|
|
# note : broken : requires unavailable symbols
|
|
|
|
fullbench-dll : zstd-dll
|
|
|
|
fullbench-dll : LDFLAGS+= -L$(ZSTDDIR) -lzstd
|
2019-04-10 12:37:03 -07:00
|
|
|
fullbench-dll: $(PRGDIR)/datagen.c $(PRGDIR)/util.c $(PRGDIR)/benchfn.c $(PRGDIR)/timefn.c fullbench.c
|
%.o objects files in /tests
Recipe in /tests rebuild everything from source for each target.
zstd is still a "small" project, so it's not prohibitive,
yet, rebuilding same files over and over represents substantial redundant work.
This patch replaces *.c files from /lib by their corresponding *.o files.
They cannot be compiled and stored directly within /lib,
since /tests triggers additional debug capabilities unwelcome in release binary.
So the resulting *.o are stored directly within /tests.
It turns out, it's difficult to find several target using *exactly* the same rules.
Using only the default rules (debug enabled, multi-threading disabled, no legacy)
a surprisingly small amount of targets share their work.
It's because, in many cases there are additional modifications requested :
some targets are 32-bits, some enable multi-threading, some enable legacy support,
some disable asserts, some want different kind of sanitizer, etc.
I created 2 sets of object files : with and without multithreading.
Several targets share their work, saving compilation time when running `make all`.
Also, obviously, when modifying one source file, only this one needs rebuilding.
For targets requiring some different setting, build from source *.c remain the rule.
The new rules have been tested within `-j` parallel compilation, and work fine with it.
2017-12-27 08:49:18 -08:00
|
|
|
# $(CC) $(FLAGS) $(filter %.c,$^) -o $@$(EXT) -DZSTD_DLL_IMPORT=1 $(ZSTDDIR)/dll/libzstd.dll
|
|
|
|
$(CC) $(FLAGS) $(filter %.c,$^) -o $@$(EXT)
|
2016-11-21 03:51:01 -08:00
|
|
|
|
%.o objects files in /tests
Recipe in /tests rebuild everything from source for each target.
zstd is still a "small" project, so it's not prohibitive,
yet, rebuilding same files over and over represents substantial redundant work.
This patch replaces *.c files from /lib by their corresponding *.o files.
They cannot be compiled and stored directly within /lib,
since /tests triggers additional debug capabilities unwelcome in release binary.
So the resulting *.o are stored directly within /tests.
It turns out, it's difficult to find several target using *exactly* the same rules.
Using only the default rules (debug enabled, multi-threading disabled, no legacy)
a surprisingly small amount of targets share their work.
It's because, in many cases there are additional modifications requested :
some targets are 32-bits, some enable multi-threading, some enable legacy support,
some disable asserts, some want different kind of sanitizer, etc.
I created 2 sets of object files : with and without multithreading.
Several targets share their work, saving compilation time when running `make all`.
Also, obviously, when modifying one source file, only this one needs rebuilding.
For targets requiring some different setting, build from source *.c remain the rule.
The new rules have been tested within `-j` parallel compilation, and work fine with it.
2017-12-27 08:49:18 -08:00
|
|
|
fuzzer : CPPFLAGS += $(MULTITHREAD_CPP)
|
|
|
|
fuzzer : LDFLAGS += $(MULTITHREAD_LD)
|
2017-07-10 14:02:33 -07:00
|
|
|
fuzzer32: CFLAGS += -m32
|
%.o objects files in /tests
Recipe in /tests rebuild everything from source for each target.
zstd is still a "small" project, so it's not prohibitive,
yet, rebuilding same files over and over represents substantial redundant work.
This patch replaces *.c files from /lib by their corresponding *.o files.
They cannot be compiled and stored directly within /lib,
since /tests triggers additional debug capabilities unwelcome in release binary.
So the resulting *.o are stored directly within /tests.
It turns out, it's difficult to find several target using *exactly* the same rules.
Using only the default rules (debug enabled, multi-threading disabled, no legacy)
a surprisingly small amount of targets share their work.
It's because, in many cases there are additional modifications requested :
some targets are 32-bits, some enable multi-threading, some enable legacy support,
some disable asserts, some want different kind of sanitizer, etc.
I created 2 sets of object files : with and without multithreading.
Several targets share their work, saving compilation time when running `make all`.
Also, obviously, when modifying one source file, only this one needs rebuilding.
For targets requiring some different setting, build from source *.c remain the rule.
The new rules have been tested within `-j` parallel compilation, and work fine with it.
2017-12-27 08:49:18 -08:00
|
|
|
fuzzer : $(ZSTDMT_OBJECTS)
|
|
|
|
fuzzer32: $(ZSTD_FILES)
|
2019-04-10 12:37:03 -07:00
|
|
|
fuzzer fuzzer32 : $(ZDICT_FILES) $(PRGDIR)/util.c $(PRGDIR)/timefn.c $(PRGDIR)/datagen.c fuzzer.c
|
2017-07-10 14:02:33 -07:00
|
|
|
$(CC) $(FLAGS) $^ -o $@$(EXT)
|
2016-12-17 07:28:12 -08:00
|
|
|
|
%.o objects files in /tests
Recipe in /tests rebuild everything from source for each target.
zstd is still a "small" project, so it's not prohibitive,
yet, rebuilding same files over and over represents substantial redundant work.
This patch replaces *.c files from /lib by their corresponding *.o files.
They cannot be compiled and stored directly within /lib,
since /tests triggers additional debug capabilities unwelcome in release binary.
So the resulting *.o are stored directly within /tests.
It turns out, it's difficult to find several target using *exactly* the same rules.
Using only the default rules (debug enabled, multi-threading disabled, no legacy)
a surprisingly small amount of targets share their work.
It's because, in many cases there are additional modifications requested :
some targets are 32-bits, some enable multi-threading, some enable legacy support,
some disable asserts, some want different kind of sanitizer, etc.
I created 2 sets of object files : with and without multithreading.
Several targets share their work, saving compilation time when running `make all`.
Also, obviously, when modifying one source file, only this one needs rebuilding.
For targets requiring some different setting, build from source *.c remain the rule.
The new rules have been tested within `-j` parallel compilation, and work fine with it.
2017-12-27 08:49:18 -08:00
|
|
|
fuzzer-dll : zstd-dll
|
2016-12-17 07:28:12 -08:00
|
|
|
fuzzer-dll : LDFLAGS+= -L$(ZSTDDIR) -lzstd
|
2019-04-10 12:37:03 -07:00
|
|
|
fuzzer-dll : $(ZSTDDIR)/common/xxhash.c $(PRGDIR)/util.c $(PRGDIR)/timefn.c $(PRGDIR)/datagen.c fuzzer.c
|
%.o objects files in /tests
Recipe in /tests rebuild everything from source for each target.
zstd is still a "small" project, so it's not prohibitive,
yet, rebuilding same files over and over represents substantial redundant work.
This patch replaces *.c files from /lib by their corresponding *.o files.
They cannot be compiled and stored directly within /lib,
since /tests triggers additional debug capabilities unwelcome in release binary.
So the resulting *.o are stored directly within /tests.
It turns out, it's difficult to find several target using *exactly* the same rules.
Using only the default rules (debug enabled, multi-threading disabled, no legacy)
a surprisingly small amount of targets share their work.
It's because, in many cases there are additional modifications requested :
some targets are 32-bits, some enable multi-threading, some enable legacy support,
some disable asserts, some want different kind of sanitizer, etc.
I created 2 sets of object files : with and without multithreading.
Several targets share their work, saving compilation time when running `make all`.
Also, obviously, when modifying one source file, only this one needs rebuilding.
For targets requiring some different setting, build from source *.c remain the rule.
The new rules have been tested within `-j` parallel compilation, and work fine with it.
2017-12-27 08:49:18 -08:00
|
|
|
$(CC) $(CPPFLAGS) $(CFLAGS) $(filter %.c,$^) $(LDFLAGS) -o $@$(EXT)
|
2016-08-18 04:18:11 -07:00
|
|
|
|
2016-12-05 19:28:19 -08:00
|
|
|
zbufftest : CPPFLAGS += -I$(ZSTDDIR)/deprecated
|
2016-12-13 07:39:36 -08:00
|
|
|
zbufftest : CFLAGS += -Wno-deprecated-declarations # required to silence deprecation warnings
|
2019-04-10 12:37:03 -07:00
|
|
|
zbufftest : $(ZSTD_OBJECTS) $(ZBUFF_FILES) $(PRGDIR)/util.c $(PRGDIR)/timefn.c $(PRGDIR)/datagen.c zbufftest.c
|
2016-12-13 07:39:36 -08:00
|
|
|
$(CC) $(FLAGS) $^ -o $@$(EXT)
|
2016-08-18 04:18:11 -07:00
|
|
|
|
2016-12-05 19:28:19 -08:00
|
|
|
zbufftest32 : CPPFLAGS += -I$(ZSTDDIR)/deprecated
|
|
|
|
zbufftest32 : CFLAGS += -Wno-deprecated-declarations -m32
|
2019-04-10 12:37:03 -07:00
|
|
|
zbufftest32 : $(ZSTD_FILES) $(ZBUFF_FILES) $(PRGDIR)/util.c $(PRGDIR)/timefn.c $(PRGDIR)/datagen.c zbufftest.c
|
2016-12-05 19:28:19 -08:00
|
|
|
$(CC) $(FLAGS) $^ -o $@$(EXT)
|
2016-08-18 04:18:11 -07:00
|
|
|
|
%.o objects files in /tests
Recipe in /tests rebuild everything from source for each target.
zstd is still a "small" project, so it's not prohibitive,
yet, rebuilding same files over and over represents substantial redundant work.
This patch replaces *.c files from /lib by their corresponding *.o files.
They cannot be compiled and stored directly within /lib,
since /tests triggers additional debug capabilities unwelcome in release binary.
So the resulting *.o are stored directly within /tests.
It turns out, it's difficult to find several target using *exactly* the same rules.
Using only the default rules (debug enabled, multi-threading disabled, no legacy)
a surprisingly small amount of targets share their work.
It's because, in many cases there are additional modifications requested :
some targets are 32-bits, some enable multi-threading, some enable legacy support,
some disable asserts, some want different kind of sanitizer, etc.
I created 2 sets of object files : with and without multithreading.
Several targets share their work, saving compilation time when running `make all`.
Also, obviously, when modifying one source file, only this one needs rebuilding.
For targets requiring some different setting, build from source *.c remain the rule.
The new rules have been tested within `-j` parallel compilation, and work fine with it.
2017-12-27 08:49:18 -08:00
|
|
|
zbufftest-dll : zstd-dll
|
2016-12-17 10:10:10 -08:00
|
|
|
zbufftest-dll : CPPFLAGS += -I$(ZSTDDIR)/deprecated
|
|
|
|
zbufftest-dll : CFLAGS += -Wno-deprecated-declarations # required to silence deprecation warnings
|
|
|
|
zbufftest-dll : LDFLAGS+= -L$(ZSTDDIR) -lzstd
|
2019-04-10 12:37:03 -07:00
|
|
|
zbufftest-dll : $(ZSTDDIR)/common/xxhash.c $(PRGDIR)/util.c $(PRGDIR)/timefn.c $(PRGDIR)/datagen.c zbufftest.c
|
%.o objects files in /tests
Recipe in /tests rebuild everything from source for each target.
zstd is still a "small" project, so it's not prohibitive,
yet, rebuilding same files over and over represents substantial redundant work.
This patch replaces *.c files from /lib by their corresponding *.o files.
They cannot be compiled and stored directly within /lib,
since /tests triggers additional debug capabilities unwelcome in release binary.
So the resulting *.o are stored directly within /tests.
It turns out, it's difficult to find several target using *exactly* the same rules.
Using only the default rules (debug enabled, multi-threading disabled, no legacy)
a surprisingly small amount of targets share their work.
It's because, in many cases there are additional modifications requested :
some targets are 32-bits, some enable multi-threading, some enable legacy support,
some disable asserts, some want different kind of sanitizer, etc.
I created 2 sets of object files : with and without multithreading.
Several targets share their work, saving compilation time when running `make all`.
Also, obviously, when modifying one source file, only this one needs rebuilding.
For targets requiring some different setting, build from source *.c remain the rule.
The new rules have been tested within `-j` parallel compilation, and work fine with it.
2017-12-27 08:49:18 -08:00
|
|
|
$(CC) $(CPPFLAGS) $(CFLAGS) $(filter %.c,$^) $(LDFLAGS) -o $@$(EXT)
|
2016-12-17 10:10:10 -08:00
|
|
|
|
2019-04-10 12:37:03 -07:00
|
|
|
ZSTREAM_LOCAL_FILES := $(PRGDIR)/datagen.c $(PRGDIR)/util.c $(PRGDIR)/timefn.c seqgen.c zstreamtest.c
|
%.o objects files in /tests
Recipe in /tests rebuild everything from source for each target.
zstd is still a "small" project, so it's not prohibitive,
yet, rebuilding same files over and over represents substantial redundant work.
This patch replaces *.c files from /lib by their corresponding *.o files.
They cannot be compiled and stored directly within /lib,
since /tests triggers additional debug capabilities unwelcome in release binary.
So the resulting *.o are stored directly within /tests.
It turns out, it's difficult to find several target using *exactly* the same rules.
Using only the default rules (debug enabled, multi-threading disabled, no legacy)
a surprisingly small amount of targets share their work.
It's because, in many cases there are additional modifications requested :
some targets are 32-bits, some enable multi-threading, some enable legacy support,
some disable asserts, some want different kind of sanitizer, etc.
I created 2 sets of object files : with and without multithreading.
Several targets share their work, saving compilation time when running `make all`.
Also, obviously, when modifying one source file, only this one needs rebuilding.
For targets requiring some different setting, build from source *.c remain the rule.
The new rules have been tested within `-j` parallel compilation, and work fine with it.
2017-12-27 08:49:18 -08:00
|
|
|
ZSTREAM_PROPER_FILES := $(ZDICT_FILES) $(ZSTREAM_LOCAL_FILES)
|
|
|
|
ZSTREAMFILES := $(ZSTD_FILES) $(ZSTREAM_PROPER_FILES)
|
2017-02-23 23:09:10 -08:00
|
|
|
zstreamtest32 : CFLAGS += -m32
|
2017-11-17 12:55:37 -08:00
|
|
|
zstreamtest zstreamtest32 : CPPFLAGS += $(MULTITHREAD_CPP)
|
|
|
|
zstreamtest zstreamtest32 : LDFLAGS += $(MULTITHREAD_LD)
|
%.o objects files in /tests
Recipe in /tests rebuild everything from source for each target.
zstd is still a "small" project, so it's not prohibitive,
yet, rebuilding same files over and over represents substantial redundant work.
This patch replaces *.c files from /lib by their corresponding *.o files.
They cannot be compiled and stored directly within /lib,
since /tests triggers additional debug capabilities unwelcome in release binary.
So the resulting *.o are stored directly within /tests.
It turns out, it's difficult to find several target using *exactly* the same rules.
Using only the default rules (debug enabled, multi-threading disabled, no legacy)
a surprisingly small amount of targets share their work.
It's because, in many cases there are additional modifications requested :
some targets are 32-bits, some enable multi-threading, some enable legacy support,
some disable asserts, some want different kind of sanitizer, etc.
I created 2 sets of object files : with and without multithreading.
Several targets share their work, saving compilation time when running `make all`.
Also, obviously, when modifying one source file, only this one needs rebuilding.
For targets requiring some different setting, build from source *.c remain the rule.
The new rules have been tested within `-j` parallel compilation, and work fine with it.
2017-12-27 08:49:18 -08:00
|
|
|
zstreamtest : $(ZSTDMT_OBJECTS) $(ZSTREAM_PROPER_FILES)
|
|
|
|
zstreamtest32 : $(ZSTREAMFILES)
|
|
|
|
zstreamtest zstreamtest32 :
|
2017-11-17 12:55:37 -08:00
|
|
|
$(CC) $(FLAGS) $^ -o $@$(EXT)
|
2017-02-23 23:09:10 -08:00
|
|
|
|
|
|
|
zstreamtest_asan : CFLAGS += -fsanitize=address
|
|
|
|
zstreamtest_asan : $(ZSTREAMFILES)
|
|
|
|
$(CC) $(FLAGS) $(MULTITHREAD) $^ -o $@$(EXT)
|
2016-08-18 04:18:11 -07:00
|
|
|
|
2017-02-23 23:09:10 -08:00
|
|
|
zstreamtest_tsan : CFLAGS += -fsanitize=thread
|
|
|
|
zstreamtest_tsan : $(ZSTREAMFILES)
|
|
|
|
$(CC) $(FLAGS) $(MULTITHREAD) $^ -o $@$(EXT)
|
2016-08-18 04:18:11 -07:00
|
|
|
|
%.o objects files in /tests
Recipe in /tests rebuild everything from source for each target.
zstd is still a "small" project, so it's not prohibitive,
yet, rebuilding same files over and over represents substantial redundant work.
This patch replaces *.c files from /lib by their corresponding *.o files.
They cannot be compiled and stored directly within /lib,
since /tests triggers additional debug capabilities unwelcome in release binary.
So the resulting *.o are stored directly within /tests.
It turns out, it's difficult to find several target using *exactly* the same rules.
Using only the default rules (debug enabled, multi-threading disabled, no legacy)
a surprisingly small amount of targets share their work.
It's because, in many cases there are additional modifications requested :
some targets are 32-bits, some enable multi-threading, some enable legacy support,
some disable asserts, some want different kind of sanitizer, etc.
I created 2 sets of object files : with and without multithreading.
Several targets share their work, saving compilation time when running `make all`.
Also, obviously, when modifying one source file, only this one needs rebuilding.
For targets requiring some different setting, build from source *.c remain the rule.
The new rules have been tested within `-j` parallel compilation, and work fine with it.
2017-12-27 08:49:18 -08:00
|
|
|
zstreamtest-dll : zstd-dll
|
2016-12-17 07:28:12 -08:00
|
|
|
zstreamtest-dll : LDFLAGS+= -L$(ZSTDDIR) -lzstd
|
%.o objects files in /tests
Recipe in /tests rebuild everything from source for each target.
zstd is still a "small" project, so it's not prohibitive,
yet, rebuilding same files over and over represents substantial redundant work.
This patch replaces *.c files from /lib by their corresponding *.o files.
They cannot be compiled and stored directly within /lib,
since /tests triggers additional debug capabilities unwelcome in release binary.
So the resulting *.o are stored directly within /tests.
It turns out, it's difficult to find several target using *exactly* the same rules.
Using only the default rules (debug enabled, multi-threading disabled, no legacy)
a surprisingly small amount of targets share their work.
It's because, in many cases there are additional modifications requested :
some targets are 32-bits, some enable multi-threading, some enable legacy support,
some disable asserts, some want different kind of sanitizer, etc.
I created 2 sets of object files : with and without multithreading.
Several targets share their work, saving compilation time when running `make all`.
Also, obviously, when modifying one source file, only this one needs rebuilding.
For targets requiring some different setting, build from source *.c remain the rule.
The new rules have been tested within `-j` parallel compilation, and work fine with it.
2017-12-27 08:49:18 -08:00
|
|
|
zstreamtest-dll : $(ZSTDDIR)/common/xxhash.c # xxh symbols not exposed from dll
|
|
|
|
zstreamtest-dll : $(ZSTREAM_LOCAL_FILES)
|
|
|
|
$(CC) $(CPPFLAGS) $(CFLAGS) $(filter %.c,$^) $(LDFLAGS) -o $@$(EXT)
|
2016-12-17 07:28:12 -08:00
|
|
|
|
2018-08-27 17:52:04 -07:00
|
|
|
paramgrill : DEBUGFLAGS = # turn off assert() by default for speed measurements
|
2019-04-10 12:37:03 -07:00
|
|
|
paramgrill : $(ZSTD_FILES) $(PRGDIR)/util.c $(PRGDIR)/timefn.c $(PRGDIR)/benchfn.c $(PRGDIR)/benchzstd.c $(PRGDIR)/datagen.c paramgrill.c
|
%.o objects files in /tests
Recipe in /tests rebuild everything from source for each target.
zstd is still a "small" project, so it's not prohibitive,
yet, rebuilding same files over and over represents substantial redundant work.
This patch replaces *.c files from /lib by their corresponding *.o files.
They cannot be compiled and stored directly within /lib,
since /tests triggers additional debug capabilities unwelcome in release binary.
So the resulting *.o are stored directly within /tests.
It turns out, it's difficult to find several target using *exactly* the same rules.
Using only the default rules (debug enabled, multi-threading disabled, no legacy)
a surprisingly small amount of targets share their work.
It's because, in many cases there are additional modifications requested :
some targets are 32-bits, some enable multi-threading, some enable legacy support,
some disable asserts, some want different kind of sanitizer, etc.
I created 2 sets of object files : with and without multithreading.
Several targets share their work, saving compilation time when running `make all`.
Also, obviously, when modifying one source file, only this one needs rebuilding.
For targets requiring some different setting, build from source *.c remain the rule.
The new rules have been tested within `-j` parallel compilation, and work fine with it.
2017-12-27 08:49:18 -08:00
|
|
|
$(CC) $(FLAGS) $^ -lm -o $@$(EXT)
|
2016-08-18 04:18:11 -07:00
|
|
|
|
2016-08-18 04:53:26 -07:00
|
|
|
datagen : $(PRGDIR)/datagen.c datagencli.c
|
%.o objects files in /tests
Recipe in /tests rebuild everything from source for each target.
zstd is still a "small" project, so it's not prohibitive,
yet, rebuilding same files over and over represents substantial redundant work.
This patch replaces *.c files from /lib by their corresponding *.o files.
They cannot be compiled and stored directly within /lib,
since /tests triggers additional debug capabilities unwelcome in release binary.
So the resulting *.o are stored directly within /tests.
It turns out, it's difficult to find several target using *exactly* the same rules.
Using only the default rules (debug enabled, multi-threading disabled, no legacy)
a surprisingly small amount of targets share their work.
It's because, in many cases there are additional modifications requested :
some targets are 32-bits, some enable multi-threading, some enable legacy support,
some disable asserts, some want different kind of sanitizer, etc.
I created 2 sets of object files : with and without multithreading.
Several targets share their work, saving compilation time when running `make all`.
Also, obviously, when modifying one source file, only this one needs rebuilding.
For targets requiring some different setting, build from source *.c remain the rule.
The new rules have been tested within `-j` parallel compilation, and work fine with it.
2017-12-27 08:49:18 -08:00
|
|
|
$(CC) $(FLAGS) $^ -o $@$(EXT)
|
2016-08-18 04:18:11 -07:00
|
|
|
|
%.o objects files in /tests
Recipe in /tests rebuild everything from source for each target.
zstd is still a "small" project, so it's not prohibitive,
yet, rebuilding same files over and over represents substantial redundant work.
This patch replaces *.c files from /lib by their corresponding *.o files.
They cannot be compiled and stored directly within /lib,
since /tests triggers additional debug capabilities unwelcome in release binary.
So the resulting *.o are stored directly within /tests.
It turns out, it's difficult to find several target using *exactly* the same rules.
Using only the default rules (debug enabled, multi-threading disabled, no legacy)
a surprisingly small amount of targets share their work.
It's because, in many cases there are additional modifications requested :
some targets are 32-bits, some enable multi-threading, some enable legacy support,
some disable asserts, some want different kind of sanitizer, etc.
I created 2 sets of object files : with and without multithreading.
Several targets share their work, saving compilation time when running `make all`.
Also, obviously, when modifying one source file, only this one needs rebuilding.
For targets requiring some different setting, build from source *.c remain the rule.
The new rules have been tested within `-j` parallel compilation, and work fine with it.
2017-12-27 08:49:18 -08:00
|
|
|
roundTripCrash : $(ZSTD_OBJECTS) roundTripCrash.c
|
|
|
|
$(CC) $(FLAGS) $(MULTITHREAD) $^ -o $@$(EXT)
|
2016-05-23 05:23:55 -07:00
|
|
|
|
%.o objects files in /tests
Recipe in /tests rebuild everything from source for each target.
zstd is still a "small" project, so it's not prohibitive,
yet, rebuilding same files over and over represents substantial redundant work.
This patch replaces *.c files from /lib by their corresponding *.o files.
They cannot be compiled and stored directly within /lib,
since /tests triggers additional debug capabilities unwelcome in release binary.
So the resulting *.o are stored directly within /tests.
It turns out, it's difficult to find several target using *exactly* the same rules.
Using only the default rules (debug enabled, multi-threading disabled, no legacy)
a surprisingly small amount of targets share their work.
It's because, in many cases there are additional modifications requested :
some targets are 32-bits, some enable multi-threading, some enable legacy support,
some disable asserts, some want different kind of sanitizer, etc.
I created 2 sets of object files : with and without multithreading.
Several targets share their work, saving compilation time when running `make all`.
Also, obviously, when modifying one source file, only this one needs rebuilding.
For targets requiring some different setting, build from source *.c remain the rule.
The new rules have been tested within `-j` parallel compilation, and work fine with it.
2017-12-27 08:49:18 -08:00
|
|
|
longmatch : $(ZSTD_OBJECTS) longmatch.c
|
|
|
|
$(CC) $(FLAGS) $^ -o $@$(EXT)
|
2016-12-10 19:12:13 -08:00
|
|
|
|
%.o objects files in /tests
Recipe in /tests rebuild everything from source for each target.
zstd is still a "small" project, so it's not prohibitive,
yet, rebuilding same files over and over represents substantial redundant work.
This patch replaces *.c files from /lib by their corresponding *.o files.
They cannot be compiled and stored directly within /lib,
since /tests triggers additional debug capabilities unwelcome in release binary.
So the resulting *.o are stored directly within /tests.
It turns out, it's difficult to find several target using *exactly* the same rules.
Using only the default rules (debug enabled, multi-threading disabled, no legacy)
a surprisingly small amount of targets share their work.
It's because, in many cases there are additional modifications requested :
some targets are 32-bits, some enable multi-threading, some enable legacy support,
some disable asserts, some want different kind of sanitizer, etc.
I created 2 sets of object files : with and without multithreading.
Several targets share their work, saving compilation time when running `make all`.
Also, obviously, when modifying one source file, only this one needs rebuilding.
For targets requiring some different setting, build from source *.c remain the rule.
The new rules have been tested within `-j` parallel compilation, and work fine with it.
2017-12-27 08:49:18 -08:00
|
|
|
invalidDictionaries : $(ZSTD_OBJECTS) invalidDictionaries.c
|
|
|
|
$(CC) $(FLAGS) $^ -o $@$(EXT)
|
2016-12-20 11:13:45 -08:00
|
|
|
|
2018-01-14 14:09:17 -08:00
|
|
|
legacy : CPPFLAGS += -I$(ZSTDDIR)/legacy -DZSTD_LEGACY_SUPPORT=4
|
2017-02-08 13:56:32 -08:00
|
|
|
legacy : $(ZSTD_FILES) $(wildcard $(ZSTDDIR)/legacy/*.c) legacy.c
|
%.o objects files in /tests
Recipe in /tests rebuild everything from source for each target.
zstd is still a "small" project, so it's not prohibitive,
yet, rebuilding same files over and over represents substantial redundant work.
This patch replaces *.c files from /lib by their corresponding *.o files.
They cannot be compiled and stored directly within /lib,
since /tests triggers additional debug capabilities unwelcome in release binary.
So the resulting *.o are stored directly within /tests.
It turns out, it's difficult to find several target using *exactly* the same rules.
Using only the default rules (debug enabled, multi-threading disabled, no legacy)
a surprisingly small amount of targets share their work.
It's because, in many cases there are additional modifications requested :
some targets are 32-bits, some enable multi-threading, some enable legacy support,
some disable asserts, some want different kind of sanitizer, etc.
I created 2 sets of object files : with and without multithreading.
Several targets share their work, saving compilation time when running `make all`.
Also, obviously, when modifying one source file, only this one needs rebuilding.
For targets requiring some different setting, build from source *.c remain the rule.
The new rules have been tested within `-j` parallel compilation, and work fine with it.
2017-12-27 08:49:18 -08:00
|
|
|
$(CC) $(FLAGS) $^ -o $@$(EXT)
|
2017-02-08 13:56:32 -08:00
|
|
|
|
2019-04-10 12:37:03 -07:00
|
|
|
decodecorpus : $(filter-out zstdc_zstd_compress.o, $(ZSTD_OBJECTS)) $(ZDICT_FILES) $(PRGDIR)/util.c $(PRGDIR)/timefn.c decodecorpus.c
|
%.o objects files in /tests
Recipe in /tests rebuild everything from source for each target.
zstd is still a "small" project, so it's not prohibitive,
yet, rebuilding same files over and over represents substantial redundant work.
This patch replaces *.c files from /lib by their corresponding *.o files.
They cannot be compiled and stored directly within /lib,
since /tests triggers additional debug capabilities unwelcome in release binary.
So the resulting *.o are stored directly within /tests.
It turns out, it's difficult to find several target using *exactly* the same rules.
Using only the default rules (debug enabled, multi-threading disabled, no legacy)
a surprisingly small amount of targets share their work.
It's because, in many cases there are additional modifications requested :
some targets are 32-bits, some enable multi-threading, some enable legacy support,
some disable asserts, some want different kind of sanitizer, etc.
I created 2 sets of object files : with and without multithreading.
Several targets share their work, saving compilation time when running `make all`.
Also, obviously, when modifying one source file, only this one needs rebuilding.
For targets requiring some different setting, build from source *.c remain the rule.
The new rules have been tested within `-j` parallel compilation, and work fine with it.
2017-12-27 08:49:18 -08:00
|
|
|
$(CC) $(FLAGS) $^ -o $@$(EXT) -lm
|
2017-02-22 15:59:15 -08:00
|
|
|
|
%.o objects files in /tests
Recipe in /tests rebuild everything from source for each target.
zstd is still a "small" project, so it's not prohibitive,
yet, rebuilding same files over and over represents substantial redundant work.
This patch replaces *.c files from /lib by their corresponding *.o files.
They cannot be compiled and stored directly within /lib,
since /tests triggers additional debug capabilities unwelcome in release binary.
So the resulting *.o are stored directly within /tests.
It turns out, it's difficult to find several target using *exactly* the same rules.
Using only the default rules (debug enabled, multi-threading disabled, no legacy)
a surprisingly small amount of targets share their work.
It's because, in many cases there are additional modifications requested :
some targets are 32-bits, some enable multi-threading, some enable legacy support,
some disable asserts, some want different kind of sanitizer, etc.
I created 2 sets of object files : with and without multithreading.
Several targets share their work, saving compilation time when running `make all`.
Also, obviously, when modifying one source file, only this one needs rebuilding.
For targets requiring some different setting, build from source *.c remain the rule.
The new rules have been tested within `-j` parallel compilation, and work fine with it.
2017-12-27 08:49:18 -08:00
|
|
|
symbols : symbols.c zstd-dll
|
2016-12-16 13:29:23 -08:00
|
|
|
ifneq (,$(filter Windows%,$(OS)))
|
|
|
|
cp $(ZSTDDIR)/dll/libzstd.dll .
|
%.o objects files in /tests
Recipe in /tests rebuild everything from source for each target.
zstd is still a "small" project, so it's not prohibitive,
yet, rebuilding same files over and over represents substantial redundant work.
This patch replaces *.c files from /lib by their corresponding *.o files.
They cannot be compiled and stored directly within /lib,
since /tests triggers additional debug capabilities unwelcome in release binary.
So the resulting *.o are stored directly within /tests.
It turns out, it's difficult to find several target using *exactly* the same rules.
Using only the default rules (debug enabled, multi-threading disabled, no legacy)
a surprisingly small amount of targets share their work.
It's because, in many cases there are additional modifications requested :
some targets are 32-bits, some enable multi-threading, some enable legacy support,
some disable asserts, some want different kind of sanitizer, etc.
I created 2 sets of object files : with and without multithreading.
Several targets share their work, saving compilation time when running `make all`.
Also, obviously, when modifying one source file, only this one needs rebuilding.
For targets requiring some different setting, build from source *.c remain the rule.
The new rules have been tested within `-j` parallel compilation, and work fine with it.
2017-12-27 08:49:18 -08:00
|
|
|
$(CC) $(FLAGS) $< -o $@$(EXT) -DZSTD_DLL_IMPORT=1 libzstd.dll
|
2016-12-16 13:29:23 -08:00
|
|
|
else
|
%.o objects files in /tests
Recipe in /tests rebuild everything from source for each target.
zstd is still a "small" project, so it's not prohibitive,
yet, rebuilding same files over and over represents substantial redundant work.
This patch replaces *.c files from /lib by their corresponding *.o files.
They cannot be compiled and stored directly within /lib,
since /tests triggers additional debug capabilities unwelcome in release binary.
So the resulting *.o are stored directly within /tests.
It turns out, it's difficult to find several target using *exactly* the same rules.
Using only the default rules (debug enabled, multi-threading disabled, no legacy)
a surprisingly small amount of targets share their work.
It's because, in many cases there are additional modifications requested :
some targets are 32-bits, some enable multi-threading, some enable legacy support,
some disable asserts, some want different kind of sanitizer, etc.
I created 2 sets of object files : with and without multithreading.
Several targets share their work, saving compilation time when running `make all`.
Also, obviously, when modifying one source file, only this one needs rebuilding.
For targets requiring some different setting, build from source *.c remain the rule.
The new rules have been tested within `-j` parallel compilation, and work fine with it.
2017-12-27 08:49:18 -08:00
|
|
|
$(CC) $(FLAGS) $< -o $@$(EXT) -Wl,-rpath=$(ZSTDDIR) $(ZSTDDIR)/libzstd.so # broken on Mac
|
2016-12-16 13:29:23 -08:00
|
|
|
endif
|
|
|
|
|
2018-10-12 11:36:02 -07:00
|
|
|
poolTests : $(PRGDIR)/util.c poolTests.c $(ZSTDDIR)/common/pool.c $(ZSTDDIR)/common/threading.c $(ZSTDDIR)/common/zstd_common.c $(ZSTDDIR)/common/error_private.c
|
2017-08-31 15:02:14 -07:00
|
|
|
$(CC) $(FLAGS) $(MULTITHREAD) $^ -o $@$(EXT)
|
2016-12-29 23:41:03 -08:00
|
|
|
|
2018-01-14 17:03:45 -08:00
|
|
|
.PHONY: versionsTest
|
2017-02-22 00:36:42 -08:00
|
|
|
versionsTest: clean
|
2016-08-18 05:04:57 -07:00
|
|
|
$(PYTHON) test-zstd-versions.py
|
|
|
|
|
2018-01-14 17:03:45 -08:00
|
|
|
checkTag: checkTag.c $(ZSTDDIR)/zstd.h
|
|
|
|
$(CC) $(FLAGS) $< -o $@$(EXT)
|
|
|
|
|
2016-05-23 05:23:55 -07:00
|
|
|
clean:
|
2017-02-22 01:31:30 -08:00
|
|
|
$(MAKE) -C $(ZSTDDIR) clean
|
2018-06-29 16:52:21 -07:00
|
|
|
$(MAKE) -C $(PRGDIR) clean
|
2016-08-18 05:04:57 -07:00
|
|
|
@$(RM) -fR $(TESTARTEFACT)
|
|
|
|
@$(RM) -f core *.o tmp* result* *.gcda dictionary *.zst \
|
2016-08-18 04:53:26 -07:00
|
|
|
$(PRGDIR)/zstd$(EXT) $(PRGDIR)/zstd32$(EXT) \
|
2016-08-18 04:18:11 -07:00
|
|
|
fullbench$(EXT) fullbench32$(EXT) \
|
2016-11-21 04:58:58 -08:00
|
|
|
fullbench-lib$(EXT) fullbench-dll$(EXT) \
|
2016-08-18 04:18:11 -07:00
|
|
|
fuzzer$(EXT) fuzzer32$(EXT) zbufftest$(EXT) zbufftest32$(EXT) \
|
2018-06-29 16:52:21 -07:00
|
|
|
fuzzer-dll$(EXT) zstreamtest-dll$(EXT) zbufftest-dll$(EXT) \
|
2016-12-16 13:29:23 -08:00
|
|
|
zstreamtest$(EXT) zstreamtest32$(EXT) \
|
|
|
|
datagen$(EXT) paramgrill$(EXT) roundTripCrash$(EXT) longmatch$(EXT) \
|
2017-07-10 11:32:30 -07:00
|
|
|
symbols$(EXT) invalidDictionaries$(EXT) legacy$(EXT) poolTests$(EXT) \
|
2018-01-14 17:03:45 -08:00
|
|
|
decodecorpus$(EXT) checkTag$(EXT)
|
2016-05-23 05:23:55 -07:00
|
|
|
@echo Cleaning completed
|
2016-08-18 04:18:11 -07:00
|
|
|
|
|
|
|
|
|
|
|
#----------------------------------------------------------------------------------
|
2018-06-09 12:31:17 -07:00
|
|
|
#make valgrindTest is validated only for Linux, macOS, BSD, Hurd and Solaris targets
|
2016-08-18 04:18:11 -07:00
|
|
|
#----------------------------------------------------------------------------------
|
2016-12-22 09:05:07 -08:00
|
|
|
ifneq (,$(filter $(shell uname),Linux Darwin GNU/kFreeBSD GNU OpenBSD FreeBSD NetBSD DragonFly SunOS))
|
2016-08-18 04:18:11 -07:00
|
|
|
HOST_OS = POSIX
|
|
|
|
|
2017-07-01 07:05:11 -07:00
|
|
|
valgrindTest: VALGRIND = valgrind --leak-check=full --show-leak-kinds=all --error-exitcode=1
|
2016-11-16 08:50:54 -08:00
|
|
|
valgrindTest: zstd datagen fuzzer fullbench
|
2016-08-18 04:18:11 -07:00
|
|
|
@echo "\n ---- valgrind tests : memory analyzer ----"
|
|
|
|
$(VALGRIND) ./datagen -g50M > $(VOID)
|
2016-08-18 04:53:26 -07:00
|
|
|
$(VALGRIND) $(PRGDIR)/zstd ; if [ $$? -eq 0 ] ; then echo "zstd without argument should have failed"; false; fi
|
|
|
|
./datagen -g80 | $(VALGRIND) $(PRGDIR)/zstd - -c > $(VOID)
|
2016-09-01 15:46:09 -07:00
|
|
|
./datagen -g16KB | $(VALGRIND) $(PRGDIR)/zstd -vf - -c > $(VOID)
|
2016-08-18 04:53:26 -07:00
|
|
|
./datagen -g2930KB | $(VALGRIND) $(PRGDIR)/zstd -5 -vf - -o tmp
|
2016-09-01 15:46:09 -07:00
|
|
|
$(VALGRIND) $(PRGDIR)/zstd -vdf tmp -c > $(VOID)
|
|
|
|
./datagen -g64MB | $(VALGRIND) $(PRGDIR)/zstd -vf - -c > $(VOID)
|
2016-08-18 04:18:11 -07:00
|
|
|
@rm tmp
|
|
|
|
$(VALGRIND) ./fuzzer -T1mn -t1
|
|
|
|
$(VALGRIND) ./fullbench -i1
|
|
|
|
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
|
|
ifneq (,$(filter MSYS%,$(shell uname)))
|
|
|
|
HOST_OS = MSYS
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
2016-12-22 09:05:07 -08:00
|
|
|
#-----------------------------------------------------------------------------
|
2017-09-27 15:16:27 -07:00
|
|
|
# make tests validated only for below targets
|
2016-12-22 09:05:07 -08:00
|
|
|
#-----------------------------------------------------------------------------
|
2016-08-18 04:18:11 -07:00
|
|
|
ifneq (,$(filter $(HOST_OS),MSYS POSIX))
|
2016-12-22 09:05:07 -08:00
|
|
|
|
|
|
|
DIFF:=diff
|
|
|
|
ifneq (,$(filter $(shell uname),SunOS))
|
|
|
|
DIFF:=gdiff
|
|
|
|
endif
|
|
|
|
|
2018-01-13 21:54:21 -08:00
|
|
|
.PHONY: list
|
|
|
|
list:
|
|
|
|
@$(MAKE) -pRrq -f $(lastword $(MAKEFILE_LIST)) : 2>/dev/null | awk -v RS= -F: '/^# File/,/^# Finished Make data base/ {if ($$1 !~ "^[#.]") {print $$1}}' | sort | egrep -v -e '^[^[:alnum:]]' -e '^$@$$' | xargs
|
|
|
|
|
|
|
|
.PHONY: shortest
|
2017-03-01 17:02:49 -08:00
|
|
|
shortest: ZSTDRTTEST=
|
|
|
|
shortest: test-zstd
|
|
|
|
|
2018-01-13 21:54:21 -08:00
|
|
|
.PHONY: fuzztest
|
2017-03-07 12:08:15 -08:00
|
|
|
fuzztest: test-fuzzer test-zstream test-decodecorpus
|
|
|
|
|
2018-01-13 21:54:21 -08:00
|
|
|
.PHONY: test
|
2017-02-22 15:59:15 -08:00
|
|
|
test: test-zstd test-fullbench test-fuzzer test-zstream test-invalidDictionaries test-legacy test-decodecorpus
|
2017-02-14 10:08:14 -08:00
|
|
|
ifeq ($(QEMU_SYS),)
|
2017-02-08 04:58:04 -08:00
|
|
|
test: test-pool
|
|
|
|
endif
|
2016-08-18 04:18:11 -07:00
|
|
|
|
2016-11-16 08:50:54 -08:00
|
|
|
test32: test-zstd32 test-fullbench32 test-fuzzer32 test-zstream32
|
2016-08-18 04:18:11 -07:00
|
|
|
|
2017-06-23 17:10:41 -07:00
|
|
|
test-all: test test32 valgrindTest test-decodecorpus-cli
|
2016-08-18 04:18:11 -07:00
|
|
|
|
2018-06-29 16:52:21 -07:00
|
|
|
|
2018-11-28 12:39:47 -08:00
|
|
|
.PHONY: test-zstd test-zstd32 test-zstd-nolegacy test-zstdgrep
|
2016-08-18 04:53:26 -07:00
|
|
|
test-zstd: ZSTD = $(PRGDIR)/zstd
|
2018-06-29 16:52:21 -07:00
|
|
|
test-zstd: zstd
|
2016-08-18 04:18:11 -07:00
|
|
|
|
2016-08-18 04:53:26 -07:00
|
|
|
test-zstd32: ZSTD = $(PRGDIR)/zstd32
|
2018-06-29 16:52:21 -07:00
|
|
|
test-zstd32: zstd32
|
2016-08-18 04:18:11 -07:00
|
|
|
|
2017-08-20 10:15:44 -07:00
|
|
|
test-zstd-nolegacy: ZSTD = $(PRGDIR)/zstd-nolegacy
|
2018-06-29 16:52:21 -07:00
|
|
|
test-zstd-nolegacy: zstd-nolegacy
|
|
|
|
|
|
|
|
test-zstd test-zstd32 test-zstd-nolegacy: datagen
|
|
|
|
file $(ZSTD)
|
|
|
|
ZSTD="$(QEMU_SYS) $(ZSTD)" ./playTests.sh $(ZSTDRTTEST)
|
|
|
|
|
2016-08-18 04:18:11 -07:00
|
|
|
|
2016-11-30 06:20:24 -08:00
|
|
|
test-gzstd: gzstd
|
2017-08-31 15:02:14 -07:00
|
|
|
$(PRGDIR)/zstd -f README.md test-zstd-speed.py
|
|
|
|
gzip -f README.md test-zstd-speed.py
|
2016-12-05 09:02:40 -08:00
|
|
|
cat README.md.zst test-zstd-speed.py.gz >zstd_gz.zst
|
|
|
|
cat README.md.gz test-zstd-speed.py.zst >gz_zstd.gz
|
2017-08-31 15:02:14 -07:00
|
|
|
$(PRGDIR)/zstd -df README.md.gz -o README2.md
|
|
|
|
$(PRGDIR)/zstd -df README.md.gz test-zstd-speed.py.gz
|
|
|
|
$(PRGDIR)/zstd -df zstd_gz.zst gz_zstd.gz
|
2016-12-22 09:05:07 -08:00
|
|
|
$(DIFF) -q zstd_gz gz_zstd
|
2016-12-05 09:31:14 -08:00
|
|
|
echo Hello World ZSTD | $(PRGDIR)/zstd -c - >hello.zst
|
|
|
|
echo Hello World GZIP | gzip -c - >hello.gz
|
|
|
|
echo Hello World TEXT >hello.txt
|
|
|
|
cat hello.zst hello.gz hello.txt >hello_zst_gz_txt.gz
|
|
|
|
$(PRGDIR)/zstd -dcf hello.*
|
|
|
|
$(PRGDIR)/zstd -dcf - <hello_zst_gz_txt.gz
|
2017-08-31 15:02:14 -07:00
|
|
|
$(RM) *.gz *.zst README2.md gz_zstd zstd_gz hello.txt
|
2016-11-30 06:20:24 -08:00
|
|
|
|
2018-11-28 12:39:47 -08:00
|
|
|
test-zstdgrep: gzstd
|
2019-01-06 06:22:49 -08:00
|
|
|
-[ -f /tmp/zstdcat ] || ln -s $(PWD)/$(PRGDIR)/zstd /tmp/zstdcat
|
|
|
|
echo a | $(PRGDIR)/zstd | env ZCAT=/tmp/zstdcat $(PRGDIR)/zstdgrep a
|
|
|
|
echo a | $(PRGDIR)/zstd | env ZCAT=/tmp/zstdcat $(PRGDIR)/zstdgrep b && return 1 || return 0
|
|
|
|
-echo 'hello world' > test.txt && $(PRGDIR)/zstd test.txt
|
|
|
|
env ZCAT=/tmp/zstdcat $(PRGDIR)/zstdgrep hello test.txt.zst
|
|
|
|
env ZCAT=/tmp/zstdcat $(PRGDIR)/zstdgrep weird test.txt.zst && return 1 || return 0
|
2018-11-28 12:39:47 -08:00
|
|
|
|
2016-08-18 04:18:11 -07:00
|
|
|
test-fullbench: fullbench datagen
|
2016-11-14 03:57:05 -08:00
|
|
|
$(QEMU_SYS) ./fullbench -i1
|
|
|
|
$(QEMU_SYS) ./fullbench -i1 -P0
|
2016-08-18 04:18:11 -07:00
|
|
|
|
|
|
|
test-fullbench32: fullbench32 datagen
|
2016-11-14 03:57:05 -08:00
|
|
|
$(QEMU_SYS) ./fullbench32 -i1
|
|
|
|
$(QEMU_SYS) ./fullbench32 -i1 -P0
|
2016-08-18 04:18:11 -07:00
|
|
|
|
|
|
|
test-fuzzer: fuzzer
|
2017-12-13 10:08:52 -08:00
|
|
|
$(QEMU_SYS) ./fuzzer -v $(FUZZERTEST) $(FUZZER_FLAGS)
|
2016-08-18 04:18:11 -07:00
|
|
|
|
2018-06-14 07:22:24 -07:00
|
|
|
test-fuzzer-stackmode: MOREFLAGS += -DZSTD_HEAPMODE=0
|
|
|
|
test-fuzzer-stackmode: test-fuzzer
|
|
|
|
|
2016-08-18 04:18:11 -07:00
|
|
|
test-fuzzer32: fuzzer32
|
2017-12-13 10:08:52 -08:00
|
|
|
$(QEMU_SYS) ./fuzzer32 -v $(FUZZERTEST) $(FUZZER_FLAGS)
|
2016-08-18 04:18:11 -07:00
|
|
|
|
|
|
|
test-zbuff: zbufftest
|
2016-12-05 19:28:19 -08:00
|
|
|
$(QEMU_SYS) ./zbufftest $(ZSTREAM_TESTTIME)
|
2016-08-18 04:18:11 -07:00
|
|
|
|
|
|
|
test-zbuff32: zbufftest32
|
2016-12-05 19:28:19 -08:00
|
|
|
$(QEMU_SYS) ./zbufftest32 $(ZSTREAM_TESTTIME)
|
2016-08-18 04:18:11 -07:00
|
|
|
|
|
|
|
test-zstream: zstreamtest
|
2017-12-13 10:08:52 -08:00
|
|
|
$(QEMU_SYS) ./zstreamtest -v $(ZSTREAM_TESTTIME) $(FUZZER_FLAGS)
|
2017-09-28 18:34:38 -07:00
|
|
|
$(QEMU_SYS) ./zstreamtest --mt -t1 $(ZSTREAM_TESTTIME) $(FUZZER_FLAGS)
|
|
|
|
$(QEMU_SYS) ./zstreamtest --newapi -t1 $(ZSTREAM_TESTTIME) $(FUZZER_FLAGS)
|
2016-08-18 04:18:11 -07:00
|
|
|
|
|
|
|
test-zstream32: zstreamtest32
|
2017-03-20 11:32:24 -07:00
|
|
|
$(QEMU_SYS) ./zstreamtest32 $(ZSTREAM_TESTTIME) $(FUZZER_FLAGS)
|
2016-08-18 04:18:11 -07:00
|
|
|
|
2016-12-10 19:12:13 -08:00
|
|
|
test-longmatch: longmatch
|
|
|
|
$(QEMU_SYS) ./longmatch
|
|
|
|
|
2016-12-20 11:13:45 -08:00
|
|
|
test-invalidDictionaries: invalidDictionaries
|
|
|
|
$(QEMU_SYS) ./invalidDictionaries
|
|
|
|
|
2016-12-16 13:29:23 -08:00
|
|
|
test-symbols: symbols
|
|
|
|
$(QEMU_SYS) ./symbols
|
|
|
|
|
2017-02-08 13:56:32 -08:00
|
|
|
test-legacy: legacy
|
|
|
|
$(QEMU_SYS) ./legacy
|
|
|
|
|
2017-02-22 15:59:15 -08:00
|
|
|
test-decodecorpus: decodecorpus
|
|
|
|
$(QEMU_SYS) ./decodecorpus -t $(DECODECORPUS_TESTTIME)
|
|
|
|
|
2017-06-22 13:53:39 -07:00
|
|
|
test-decodecorpus-cli: decodecorpus
|
|
|
|
@echo "\n ---- decodecorpus basic cli tests ----"
|
2017-06-22 14:43:44 -07:00
|
|
|
@mkdir testdir
|
|
|
|
./decodecorpus -n5 -otestdir -ptestdir
|
2017-06-22 15:13:41 -07:00
|
|
|
@cd testdir && \
|
|
|
|
$(ZSTD) -d z000000.zst -o tmp0 && \
|
|
|
|
$(ZSTD) -d z000001.zst -o tmp1 && \
|
|
|
|
$(ZSTD) -d z000002.zst -o tmp2 && \
|
|
|
|
$(ZSTD) -d z000003.zst -o tmp3 && \
|
|
|
|
$(ZSTD) -d z000004.zst -o tmp4 && \
|
|
|
|
diff z000000 tmp0 && \
|
|
|
|
diff z000001 tmp1 && \
|
|
|
|
diff z000002 tmp2 && \
|
|
|
|
diff z000003 tmp3 && \
|
|
|
|
diff z000004 tmp4 && \
|
|
|
|
rm ./* && \
|
|
|
|
cd ..
|
2017-06-22 15:23:59 -07:00
|
|
|
@echo "\n ---- decodecorpus dictionary cli tests ----"
|
2017-06-22 14:43:44 -07:00
|
|
|
./decodecorpus -n5 -otestdir -ptestdir --use-dict=1MB
|
2017-06-22 15:13:41 -07:00
|
|
|
@cd testdir && \
|
|
|
|
$(ZSTD) -d z000000.zst -D dictionary -o tmp0 && \
|
|
|
|
$(ZSTD) -d z000001.zst -D dictionary -o tmp1 && \
|
|
|
|
$(ZSTD) -d z000002.zst -D dictionary -o tmp2 && \
|
|
|
|
$(ZSTD) -d z000003.zst -D dictionary -o tmp3 && \
|
|
|
|
$(ZSTD) -d z000004.zst -D dictionary -o tmp4 && \
|
|
|
|
diff z000000 tmp0 && \
|
|
|
|
diff z000001 tmp1 && \
|
|
|
|
diff z000002 tmp2 && \
|
|
|
|
diff z000003 tmp3 && \
|
|
|
|
diff z000004 tmp4 && \
|
2017-06-22 15:44:01 -07:00
|
|
|
cd ..
|
2017-06-22 14:43:44 -07:00
|
|
|
@rm -rf testdir
|
2017-06-22 13:53:39 -07:00
|
|
|
|
2017-07-10 11:32:30 -07:00
|
|
|
test-pool: poolTests
|
|
|
|
$(QEMU_SYS) ./poolTests
|
2016-12-29 23:41:03 -08:00
|
|
|
|
2017-09-21 17:30:43 -07:00
|
|
|
test-lz4: ZSTD = LD_LIBRARY_PATH=/usr/local/lib $(PRGDIR)/zstd
|
2017-09-28 16:18:15 -07:00
|
|
|
test-lz4: ZSTD_LZ4 = LD_LIBRARY_PATH=/usr/local/lib ./lz4
|
|
|
|
test-lz4: ZSTD_UNLZ4 = LD_LIBRARY_PATH=/usr/local/lib ./unlz4
|
2017-11-28 09:06:48 -08:00
|
|
|
test-lz4: zstd decodecorpus datagen
|
|
|
|
[ -f lz4 ] || ln -s $(PRGDIR)/zstd lz4
|
|
|
|
[ -f unlz4 ] || ln -s $(PRGDIR)/zstd unlz4
|
2017-09-28 16:18:15 -07:00
|
|
|
|
2017-09-21 17:30:43 -07:00
|
|
|
./decodecorpus -ptmp
|
|
|
|
# lz4 -> zstd
|
|
|
|
lz4 < tmp | \
|
|
|
|
$(ZSTD) -d | \
|
|
|
|
cmp - tmp
|
2017-09-28 16:18:15 -07:00
|
|
|
lz4 < tmp | \
|
|
|
|
$(ZSTD_UNLZ4) | \
|
|
|
|
cmp - tmp
|
2017-09-21 17:30:43 -07:00
|
|
|
# zstd -> lz4
|
|
|
|
$(ZSTD) --format=lz4 < tmp | \
|
|
|
|
lz4 -d | \
|
|
|
|
cmp - tmp
|
2017-09-28 16:18:15 -07:00
|
|
|
$(ZSTD_LZ4) < tmp | \
|
|
|
|
lz4 -d | \
|
|
|
|
cmp - tmp
|
2017-09-21 17:30:43 -07:00
|
|
|
# zstd -> zstd
|
|
|
|
$(ZSTD) --format=lz4 < tmp | \
|
|
|
|
$(ZSTD) -d | \
|
|
|
|
cmp - tmp
|
|
|
|
# zstd -> zstd
|
|
|
|
$(ZSTD) < tmp | \
|
|
|
|
$(ZSTD) -d | \
|
|
|
|
cmp - tmp
|
|
|
|
|
2017-11-28 09:06:48 -08:00
|
|
|
./datagen -g384KB | $(ZSTD) --format=lz4 | $(ZSTD) -d > /dev/null
|
|
|
|
|
2017-09-28 16:18:15 -07:00
|
|
|
rm tmp lz4 unlz4
|
2017-09-21 17:30:43 -07:00
|
|
|
|
2016-08-18 04:18:11 -07:00
|
|
|
endif
|