]> git.proxmox.com Git - ceph.git/blob - ceph/src/zstd/contrib/adaptive-compression/Makefile
bump version to 15.2.11-pve1
[ceph.git] / ceph / src / zstd / contrib / adaptive-compression / Makefile
1
2 ZSTDDIR = ../../lib
3 PRGDIR = ../../programs
4 ZSTDCOMMON_FILES := $(ZSTDDIR)/common/*.c
5 ZSTDCOMP_FILES := $(ZSTDDIR)/compress/*.c
6 ZSTDDECOMP_FILES := $(ZSTDDIR)/decompress/*.c
7 ZSTD_FILES := $(ZSTDDECOMP_FILES) $(ZSTDCOMMON_FILES) $(ZSTDCOMP_FILES)
8
9 MULTITHREAD_LDFLAGS = -pthread
10 DEBUGFLAGS= -g -DZSTD_DEBUG=1
11 CPPFLAGS += -I$(ZSTDDIR) -I$(ZSTDDIR)/common -I$(ZSTDDIR)/compress \
12 -I$(ZSTDDIR)/dictBuilder -I$(ZSTDDIR)/deprecated -I$(PRGDIR)
13 CFLAGS ?= -O3
14 CFLAGS += -Wall -Wextra -Wcast-qual -Wcast-align -Wshadow \
15 -Wstrict-aliasing=1 -Wswitch-enum -Wdeclaration-after-statement \
16 -Wstrict-prototypes -Wundef \
17 -Wvla -Wformat=2 -Winit-self -Wfloat-equal -Wwrite-strings \
18 -Wredundant-decls
19 CFLAGS += $(DEBUGFLAGS)
20 CFLAGS += $(MOREFLAGS)
21 FLAGS = $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) $(MULTITHREAD_LDFLAGS)
22
23 all: adapt datagen
24
25 adapt: $(ZSTD_FILES) $(PRGDIR)/util.c $(PRGDIR)/timefn.c adapt.c
26 $(CC) $(FLAGS) $^ -o $@
27
28 adapt-debug: $(ZSTD_FILES) $(PRGDIR)/util.c $(PRGDIR)/timefn.c adapt.c
29 $(CC) $(FLAGS) -DDEBUG_MODE=2 $^ -o adapt
30
31 datagen : $(PRGDIR)/datagen.c datagencli.c
32 $(CC) $(FLAGS) $^ -o $@
33
34 test-adapt-correctness: datagen adapt
35 @./test-correctness.sh
36 @echo "test correctness complete"
37
38 test-adapt-performance: datagen adapt
39 @./test-performance.sh
40 @echo "test performance complete"
41
42 clean:
43 @$(RM) -f adapt datagen
44 @$(RM) -rf *.dSYM
45 @$(RM) -f tmp*
46 @$(RM) -f tests/*.zst
47 @$(RM) -f tests/tmp*
48 @echo "finished cleaning"
49
50 #-----------------------------------------------------------------------------
51 # make install is validated only for Linux, macOS, BSD, Hurd and Solaris targets
52 #-----------------------------------------------------------------------------
53 ifneq (,$(filter $(shell uname),Linux Darwin GNU/kFreeBSD GNU OpenBSD FreeBSD NetBSD DragonFly SunOS))
54
55 ifneq (,$(filter $(shell uname),SunOS))
56 INSTALL ?= ginstall
57 else
58 INSTALL ?= install
59 endif
60
61 PREFIX ?= /usr/local
62 DESTDIR ?=
63 BINDIR ?= $(PREFIX)/bin
64
65 INSTALL_PROGRAM ?= $(INSTALL) -m 755
66
67 install: adapt
68 @echo Installing binaries
69 @$(INSTALL) -d -m 755 $(DESTDIR)$(BINDIR)/
70 @$(INSTALL_PROGRAM) adapt $(DESTDIR)$(BINDIR)/zstd-adaptive
71 @echo zstd-adaptive installation completed
72
73 uninstall:
74 @$(RM) $(DESTDIR)$(BINDIR)/zstd-adaptive
75 @echo zstd-adaptive programs successfully uninstalled
76 endif