-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile.linux
More file actions
35 lines (29 loc) · 1.25 KB
/
Copy pathMakefile.linux
File metadata and controls
35 lines (29 loc) · 1.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# Linux build for the mzip unit tests.
#
# mzip_unit_tests.cpp includes zstd via a vendored Windows path
# (zstd_release/zstd-v1.5.6-win64/include/zstd.h), and the PPMd backend lives in
# ppmd/*.c with no gate script that compiles it on Linux -- gate_all.sh and
# gate_ppmd.sh are .dll/.exe lines. This target supplies both so the suite can run
# where the loop runs. It changes no source.
#
# make -f Makefile.linux test
#
# Needs: g++ (C++17), libzstd-dev, liblzma-dev, libbrotli-dev.
CXX ?= g++
CXXFLAGS ?= -O2 -std=c++17 -I. -Izstd_release/zstd-v1.5.6-win64/include
LIBS := -lzstd -llzma -lbrotlienc -lbrotlidec -lbrotlicommon -lpthread
PPMD := ppmd/Ppmd7.c ppmd/Ppmd7Enc.c ppmd/Ppmd7Dec.c
ZSTD_SHIM := zstd_release/zstd-v1.5.6-win64/include/zstd.h
.PHONY: test clean
# The shim satisfies the hardcoded include without touching the source: a symlink
# to the system header, inside a directory .gitignore already excludes.
$(ZSTD_SHIM):
@mkdir -p $(dir $@)
@test -e /usr/include/zstd.h || { echo "libzstd-dev not installed"; exit 1; }
@ln -sf /usr/include/zstd.h $@
mzip_ut: $(ZSTD_SHIM) mzip_unit_tests.cpp mzip.hpp libsais.c $(PPMD)
$(CXX) $(CXXFLAGS) -o $@ mzip_unit_tests.cpp libsais.c $(PPMD) $(LIBS)
test: mzip_ut
./mzip_ut
clean:
rm -f mzip_ut