2016-07-10 12:23:30 +00:00
|
|
|
# ##########################################################################
|
|
|
|
# ZSTD educational examples - Makefile
|
|
|
|
# Copyright (C) Yann Collet 2016
|
|
|
|
#
|
|
|
|
# GPL v2 License
|
|
|
|
#
|
|
|
|
# This program is free software; you can redistribute it and/or modify
|
|
|
|
# it under the terms of the GNU General Public License as published by
|
|
|
|
# the Free Software Foundation; either version 2 of the License, or
|
|
|
|
# (at your option) any later version.
|
|
|
|
#
|
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU General Public License for more details.
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU General Public License along
|
|
|
|
# with this program; if not, write to the Free Software Foundation, Inc.,
|
|
|
|
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
|
|
#
|
|
|
|
# You can contact the author at :
|
|
|
|
# - zstd homepage : http://www.zstd.net/
|
|
|
|
# ##########################################################################
|
|
|
|
|
|
|
|
# This Makefile presumes libzstd is installed, using `sudo make install`
|
|
|
|
|
|
|
|
LDFLAGS+= -lzstd
|
|
|
|
|
|
|
|
.PHONY: default all clean test
|
|
|
|
|
|
|
|
default: all
|
|
|
|
|
2016-07-15 16:52:37 +00:00
|
|
|
all: simple_compression simple_decompression \
|
2016-08-12 16:42:25 +00:00
|
|
|
dictionary_compression dictionary_decompression \
|
2016-08-12 16:56:27 +00:00
|
|
|
streaming_compression streaming_decompression
|
2016-07-10 12:23:30 +00:00
|
|
|
|
|
|
|
simple_compression : simple_compression.c
|
|
|
|
$(CC) $(CPPFLAGS) $(CFLAGS) $^ $(LDFLAGS) -o $@
|
|
|
|
|
|
|
|
simple_decompression : simple_decompression.c
|
|
|
|
$(CC) $(CPPFLAGS) $(CFLAGS) $^ $(LDFLAGS) -o $@
|
|
|
|
|
2016-07-15 16:52:37 +00:00
|
|
|
dictionary_compression : dictionary_compression.c
|
|
|
|
$(CC) $(CPPFLAGS) $(CFLAGS) $^ $(LDFLAGS) -o $@
|
|
|
|
|
2016-07-10 12:23:30 +00:00
|
|
|
dictionary_decompression : dictionary_decompression.c
|
|
|
|
$(CC) $(CPPFLAGS) $(CFLAGS) $^ $(LDFLAGS) -o $@
|
|
|
|
|
2016-08-12 16:42:25 +00:00
|
|
|
streaming_compression : streaming_compression.c
|
|
|
|
$(CC) $(CPPFLAGS) $(CFLAGS) $^ $(LDFLAGS) -o $@
|
|
|
|
|
2016-08-12 16:56:27 +00:00
|
|
|
streaming_decompression : streaming_decompression.c
|
|
|
|
$(CC) $(CPPFLAGS) $(CFLAGS) $^ $(LDFLAGS) -o $@
|
|
|
|
|
2016-07-10 12:23:30 +00:00
|
|
|
clean:
|
|
|
|
@rm -f core *.o tmp* result* *.zst \
|
2016-07-15 16:52:37 +00:00
|
|
|
simple_compression simple_decompression \
|
2016-09-08 17:29:04 +00:00
|
|
|
dictionary_compression dictionary_decompression \
|
|
|
|
streaming_compression streaming_decompression
|
2016-07-10 12:23:30 +00:00
|
|
|
@echo Cleaning completed
|
|
|
|
|
|
|
|
test: all
|
|
|
|
cp README.md tmp
|
2016-09-09 17:33:56 +00:00
|
|
|
cp Makefile tmp2
|
2016-08-12 16:42:25 +00:00
|
|
|
@echo starting simple compression
|
2016-07-10 12:23:30 +00:00
|
|
|
./simple_compression tmp
|
|
|
|
./simple_decompression tmp.zst
|
2016-09-08 17:29:04 +00:00
|
|
|
./streaming_decompression tmp.zst > /dev/null
|
2016-08-12 16:42:25 +00:00
|
|
|
@echo starting streaming compression
|
|
|
|
./streaming_compression tmp
|
2016-09-08 17:39:00 +00:00
|
|
|
./streaming_decompression tmp.zst > /dev/null
|
2016-08-12 16:42:25 +00:00
|
|
|
@echo starting dictionary compression
|
2016-09-09 17:33:56 +00:00
|
|
|
./dictionary_compression tmp2 tmp README.md
|
|
|
|
./dictionary_decompression tmp2.zst tmp.zst README.md
|
2016-07-10 12:23:30 +00:00
|
|
|
@echo tests completed
|