2017-08-11 21:35:13 +00:00
|
|
|
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 ?= -O3
|
|
|
|
CFLAGS += -Wall -Wextra -Wcast-qual -Wcast-align -Wshadow \
|
2019-09-06 23:51:16 +00:00
|
|
|
-Wstrict-aliasing=1 -Wswitch-enum \
|
|
|
|
-Wredundant-decls -Wstrict-prototypes -Wundef \
|
2017-08-11 21:35:13 +00:00
|
|
|
-Wvla -Wformat=2 -Winit-self -Wfloat-equal -Wwrite-strings \
|
2019-09-06 23:51:16 +00:00
|
|
|
-std=c99
|
2017-08-11 21:35:13 +00:00
|
|
|
CFLAGS += $(DEBUGFLAGS)
|
|
|
|
CFLAGS += $(MOREFLAGS)
|
|
|
|
FLAGS = $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) $(MULTITHREAD_LDFLAGS)
|
|
|
|
|
|
|
|
harness: $(HARNESS_FILES)
|
|
|
|
$(CC) $(FLAGS) $^ -o $@
|
|
|
|
|
|
|
|
clean:
|
|
|
|
@$(RM) -f harness
|
2017-08-11 21:42:15 +00:00
|
|
|
@$(RM) -rf harness.dSYM
|
|
|
|
|
|
|
|
test: harness
|
|
|
|
@zstd README.md -o tmp.zst
|
|
|
|
@./harness tmp.zst tmp
|
|
|
|
@diff -s tmp README.md
|
|
|
|
@$(RM) -f tmp*
|
2019-09-06 21:30:13 +00:00
|
|
|
# present files for training multiple times, 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
|
2017-08-12 00:53:37 +00:00
|
|
|
@zstd -D dictionary README.md -o tmp.zst
|
|
|
|
@./harness tmp.zst tmp dictionary
|
|
|
|
@diff -s tmp README.md
|
|
|
|
@$(RM) -f tmp* dictionary
|
2017-08-11 21:42:15 +00:00
|
|
|
@make clean
|