head	1.1;
branch	1.1.1;
access;
symbols
	netbsd-11-0-RC4:1.1.1.1
	zstd-1-5-7:1.1.1.2
	netbsd-11-0-RC3:1.1.1.1
	netbsd-11-0-RC2:1.1.1.1
	netbsd-11-0-RC1:1.1.1.1
	perseant-exfatfs-base-20250801:1.1.1.1
	netbsd-11:1.1.1.1.0.2
	netbsd-11-base:1.1.1.1
	zstd-1-5-6:1.1.1.1
	META:1.1.1;
locks; strict;
comment	@# @;


1.1
date	2024.10.27.22.44.10;	author christos;	state Exp;
branches
	1.1.1.1;
next	;
commitid	IUZDrqSXcnIYVlvF;

1.1.1.1
date	2024.10.27.22.44.10;	author christos;	state Exp;
branches;
next	1.1.1.2;
commitid	IUZDrqSXcnIYVlvF;

1.1.1.2
date	2026.05.01.14.27.21;	author christos;	state Exp;
branches;
next	;
commitid	LjoDikzDsAzrt7EG;


desc
@@


1.1
log
@Initial revision
@
text
@# ################################################################
# Copyright (c) Meta Platforms, Inc. and affiliates.
# All rights reserved.
#
# 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).
# You may select, at your option, one of the above-listed licenses.
# ################################################################

ZSTD ?= zstd   # note: requires zstd installation on local system

UNAME?= $(shell uname)
ifeq ($(UNAME), SunOS)
DIFF ?= gdiff
else
DIFF ?= diff
endif

HARNESS_FILES=*.c

MULTITHREAD_LDFLAGS = -pthread
DEBUGFLAGS= -g -DZSTD_DEBUG=1
CPPFLAGS += -I$(ZSTDDIR) -I$(ZSTDDIR)/common -I$(ZSTDDIR)/compress \
            -I$(ZSTDDIR)/dictBuilder -I$(ZSTDDIR)/deprecated -I$(PRGDIR)
CFLAGS   ?= -O2
CFLAGS   += -Wall -Wextra -Wcast-qual -Wcast-align -Wshadow                 \
            -Wstrict-aliasing=1 -Wswitch-enum                               \
            -Wredundant-decls -Wstrict-prototypes -Wundef                   \
            -Wvla -Wformat=2 -Winit-self -Wfloat-equal -Wwrite-strings      \
            -std=c99
CFLAGS   += $(DEBUGFLAGS)
CFLAGS   += $(MOREFLAGS)
FLAGS     = $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) $(MULTITHREAD_LDFLAGS)

harness: $(HARNESS_FILES)
	$(CC) $(FLAGS) $^ -o $@@

clean:
	@@$(RM) harness *.o
	@@$(RM) -rf harness.dSYM  # MacOS specific

test: harness
	#
	# Testing single-file decompression with educational decoder
	#
	@@$(ZSTD) -f README.md -o tmp.zst
	@@./harness tmp.zst tmp
	@@$(DIFF) -s tmp README.md
	@@$(RM) tmp*
	#
	# Testing dictionary decompression with education decoder
	#
	# note : files are presented multiple for training, to reach minimum threshold
	@@$(ZSTD) --train harness.c zstd_decompress.c zstd_decompress.h README.md \
                  harness.c zstd_decompress.c zstd_decompress.h README.md \
                  harness.c zstd_decompress.c zstd_decompress.h README.md \
                  -o dictionary
	@@$(ZSTD) -f README.md -D dictionary -o tmp.zst
	@@./harness tmp.zst tmp dictionary
	@@$(DIFF) -s tmp README.md
	@@$(RM) tmp* dictionary
@


1.1.1.1
log
@Import zstd-1.5.6 from:
    https://github.com/facebook/zstd/releases/download/v1.5.6/zstd-1.5.6.tar.gz
@
text
@@


1.1.1.2
log
@Import zstd-1.5.7 (previous was 1.5.6)

V1.5.7 (Feb 2025)
fix: compression bug in 32-bit mode associated with long-lasting sessions
api: new method `ZSTD_compressSequencesAndLiterals()` (#4217, #4232)
api: `ZSTD_getFrameHeader()` works on skippable frames (#4228)
perf: substantial compression speed improvements (up to +30%) on small data, by @@TocarIP (#4144) and @@cyan4973 (#4165)
perf: improved compression speed (~+5%) for dictionary compression at low levels (#4170)
perf: much faster speed for `--patch-from` at high compression levels (#4276)
perf: higher `--patch-from` compression ratios, notably at high levels (#4288)
perf: better speed for binaries on Windows (@@pps83) and when compiled with Visual Studio (@@MessyHack)
perf: slight compression ratio improvement thanks to better block boundaries (#4136, #4176, #4178)
perf: slight compression ratio improvement for `dfast`, aka levels 3 and 4 (#4171)
perf: runtime bmi2 detection enabled on x86 32-bit mode (#4251)
cli: multi-threading as default CLI setting, by @@daniellerozenblit
cli: new `--max` command (#4290)
build: improve `msbuild` version autodetection, support VS2022, by @@ManuelBlanc
build: fix `meson` build by @@artem and @@Victor-C-Zhang, and on Windows by @@bgilbert
build: compatibility with Apple Framework, by @@Treata11
build: improve icc/icx compatibility, by @@josepho0918 and @@luau-project
build: improve compatibility with Android NDK, by Adenilson Cavalcanti
portability: linux kernel branch, with improved support for Sequence producers (@@embg, @@gcabiddu, @@cyan4973)
portability: improved qnx compatibility, suggested by @@rainbowball
portability: improved install script for FreeBSD, by @@sunpoet
portability: fixed test suite compatibility with gnu hurd, by @@diegonc
doc: clarify specification, by @@elasota
misc: improved tests/decodecorpus validation tool (#4102), by antmicro
@
text
@d13 1
a13 1
UNAME?= $(shell sh -c 'MSYSTEM="MSYS" uname') 
@

