]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - sys/contrib/zstd/doc/educational_decoder/Makefile
MFV r353628:
[FreeBSD/FreeBSD.git] / sys / contrib / zstd / doc / educational_decoder / Makefile
1 HARNESS_FILES=*.c
2
3 MULTITHREAD_LDFLAGS = -pthread
4 DEBUGFLAGS= -g -DZSTD_DEBUG=1
5 CPPFLAGS += -I$(ZSTDDIR) -I$(ZSTDDIR)/common -I$(ZSTDDIR)/compress \
6             -I$(ZSTDDIR)/dictBuilder -I$(ZSTDDIR)/deprecated -I$(PRGDIR)
7 CFLAGS   ?= -O3
8 CFLAGS   += -Wall -Wextra -Wcast-qual -Wcast-align -Wshadow                 \
9             -Wstrict-aliasing=1 -Wswitch-enum -Wdeclaration-after-statement \
10             -Wstrict-prototypes -Wundef                                     \
11             -Wvla -Wformat=2 -Winit-self -Wfloat-equal -Wwrite-strings      \
12             -Wredundant-decls
13 CFLAGS   += $(DEBUGFLAGS)
14 CFLAGS   += $(MOREFLAGS)
15 FLAGS     = $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) $(MULTITHREAD_LDFLAGS)
16
17 harness: $(HARNESS_FILES)
18         $(CC) $(FLAGS) $^ -o $@
19
20 clean:
21         @$(RM) -f harness
22         @$(RM) -rf harness.dSYM
23
24 test: harness
25         @zstd README.md -o tmp.zst
26         @./harness tmp.zst tmp
27         @diff -s tmp README.md
28         @$(RM) -f tmp*
29         @zstd --train harness.c zstd_decompress.c zstd_decompress.h README.md
30         @zstd -D dictionary README.md -o tmp.zst
31         @./harness tmp.zst tmp dictionary
32         @diff -s tmp README.md
33         @$(RM) -f tmp* dictionary
34         @make clean