2017-07-03 21:11:55 +00:00
|
|
|
|
|
|
|
ZSTDDIR = ../../lib
|
2017-07-07 22:42:20 +00:00
|
|
|
PRGDIR = ../../programs
|
2017-07-03 21:11:55 +00:00
|
|
|
ZSTDCOMMON_FILES := $(ZSTDDIR)/common/*.c
|
|
|
|
ZSTDCOMP_FILES := $(ZSTDDIR)/compress/*.c
|
|
|
|
ZSTDDECOMP_FILES := $(ZSTDDIR)/decompress/*.c
|
|
|
|
ZSTD_FILES := $(ZSTDDECOMP_FILES) $(ZSTDCOMMON_FILES) $(ZSTDCOMP_FILES)
|
|
|
|
|
2017-07-29 00:27:36 +00:00
|
|
|
MULTITHREAD_LDFLAGS = -pthread
|
2017-07-03 21:11:55 +00:00
|
|
|
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 \
|
|
|
|
-Wstrict-aliasing=1 -Wswitch-enum -Wdeclaration-after-statement \
|
|
|
|
-Wstrict-prototypes -Wundef -Wformat-security \
|
|
|
|
-Wvla -Wformat=2 -Winit-self -Wfloat-equal -Wwrite-strings \
|
|
|
|
-Wredundant-decls
|
|
|
|
CFLAGS += $(DEBUGFLAGS)
|
|
|
|
CFLAGS += $(MOREFLAGS)
|
2017-07-29 00:27:36 +00:00
|
|
|
FLAGS = $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) $(MULTITHREAD_LDFLAGS)
|
2017-07-03 21:11:55 +00:00
|
|
|
|
2017-07-13 20:50:23 +00:00
|
|
|
all: adapt datagen
|
2017-07-03 21:18:46 +00:00
|
|
|
|
2017-07-10 18:05:37 +00:00
|
|
|
adapt: $(ZSTD_FILES) adapt.c
|
2017-07-03 21:11:55 +00:00
|
|
|
$(CC) $(FLAGS) $^ -o $@
|
|
|
|
|
2017-07-25 21:08:39 +00:00
|
|
|
adapt-debug: $(ZSTD_FILES) adapt.c
|
|
|
|
$(CC) $(FLAGS) -DDEBUG_MODE=2 $^ -o adapt
|
|
|
|
|
2017-07-13 20:50:23 +00:00
|
|
|
datagen : $(PRGDIR)/datagen.c datagencli.c
|
2017-07-31 16:47:09 +00:00
|
|
|
$(CC) $(FLAGS) $^ -o $@
|
2017-07-13 20:50:23 +00:00
|
|
|
|
|
|
|
test-adapt-correctness: datagen adapt
|
|
|
|
@./test-correctness.sh
|
|
|
|
@echo "test correctness complete"
|
|
|
|
|
|
|
|
test-adapt-performance: datagen adapt
|
|
|
|
@./test-performance.sh
|
|
|
|
@echo "test performance complete"
|
|
|
|
|
2017-07-03 21:11:55 +00:00
|
|
|
clean:
|
2017-07-13 20:50:23 +00:00
|
|
|
@$(RM) -f adapt datagen
|
2017-07-03 21:18:46 +00:00
|
|
|
@$(RM) -rf *.dSYM
|
2017-07-03 21:11:55 +00:00
|
|
|
@$(RM) -f tmp*
|
2017-07-05 21:36:09 +00:00
|
|
|
@$(RM) -f tests/*.zst
|
|
|
|
@$(RM) -f tests/tmp*
|
2017-07-04 00:28:59 +00:00
|
|
|
@echo "finished cleaning"
|
2017-07-31 18:04:17 +00:00
|
|
|
|
|
|
|
#-----------------------------------------------------------------------------
|
|
|
|
# make install is validated only for Linux, OSX, BSD, Hurd and Solaris targets
|
|
|
|
#-----------------------------------------------------------------------------
|
|
|
|
ifneq (,$(filter $(shell uname),Linux Darwin GNU/kFreeBSD GNU OpenBSD FreeBSD NetBSD DragonFly SunOS))
|
|
|
|
|
|
|
|
ifneq (,$(filter $(shell uname),SunOS))
|
|
|
|
INSTALL ?= ginstall
|
|
|
|
else
|
|
|
|
INSTALL ?= install
|
|
|
|
endif
|
|
|
|
|
|
|
|
PREFIX ?= /usr/local
|
|
|
|
DESTDIR ?=
|
|
|
|
BINDIR ?= $(PREFIX)/bin
|
|
|
|
|
|
|
|
INSTALL_PROGRAM ?= $(INSTALL) -m 755
|
|
|
|
|
|
|
|
install: adapt
|
|
|
|
@echo Installing binaries
|
|
|
|
@$(INSTALL) -d -m 755 $(DESTDIR)$(BINDIR)/
|
|
|
|
@$(INSTALL_PROGRAM) adapt $(DESTDIR)$(BINDIR)/zstd-adaptive
|
|
|
|
@echo zstd-adaptive installation completed
|
|
|
|
|
|
|
|
uninstall:
|
|
|
|
@$(RM) $(DESTDIR)$(BINDIR)/zstd-adaptive
|
|
|
|
@echo zstd-adaptive programs successfully uninstalled
|
|
|
|
endif
|