blob: 5e3f0e17fd88981c396b40ccca310abc8770115f [file] [log] [blame]
Yann Collet677ed262016-07-10 14:23:30 +02001# ##########################################################################
2# ZSTD educational examples - Makefile
3# Copyright (C) Yann Collet 2016
4#
5# GPL v2 License
6#
7# This program is free software; you can redistribute it and/or modify
8# it under the terms of the GNU General Public License as published by
9# the Free Software Foundation; either version 2 of the License, or
10# (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU General Public License for more details.
16#
17# You should have received a copy of the GNU General Public License along
18# with this program; if not, write to the Free Software Foundation, Inc.,
19# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20#
21# You can contact the author at :
22# - zstd homepage : http://www.zstd.net/
23# ##########################################################################
24
25# This Makefile presumes libzstd is installed, using `sudo make install`
26
27LDFLAGS+= -lzstd
28
29.PHONY: default all clean test
30
31default: all
32
Yann Colletcadd7cd2016-07-15 18:52:37 +020033all: simple_compression simple_decompression \
34 dictionary_compression dictionary_decompression
Yann Collet677ed262016-07-10 14:23:30 +020035
36simple_compression : simple_compression.c
37 $(CC) $(CPPFLAGS) $(CFLAGS) $^ $(LDFLAGS) -o $@
38
39simple_decompression : simple_decompression.c
40 $(CC) $(CPPFLAGS) $(CFLAGS) $^ $(LDFLAGS) -o $@
41
Yann Colletcadd7cd2016-07-15 18:52:37 +020042dictionary_compression : dictionary_compression.c
43 $(CC) $(CPPFLAGS) $(CFLAGS) $^ $(LDFLAGS) -o $@
44
Yann Collet677ed262016-07-10 14:23:30 +020045dictionary_decompression : dictionary_decompression.c
46 $(CC) $(CPPFLAGS) $(CFLAGS) $^ $(LDFLAGS) -o $@
47
48clean:
49 @rm -f core *.o tmp* result* *.zst \
Yann Colletcadd7cd2016-07-15 18:52:37 +020050 simple_compression simple_decompression \
51 dictionary_compression dictionary_decompression
Yann Collet677ed262016-07-10 14:23:30 +020052 @echo Cleaning completed
53
54test: all
55 cp README.md tmp
56 ./simple_compression tmp
57 @echo starting simple_decompression
58 ./simple_decompression tmp.zst
59 @echo tests completed