Yann Collet | 677ed26 | 2016-07-10 14:23:30 +0200 | [diff] [blame^] | 1 | # ########################################################################## |
| 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 | |
| 27 | LDFLAGS+= -lzstd |
| 28 | |
| 29 | .PHONY: default all clean test |
| 30 | |
| 31 | default: all |
| 32 | |
| 33 | all: simple_compression simple_decompression dictionary_decompression |
| 34 | |
| 35 | simple_compression : simple_compression.c |
| 36 | $(CC) $(CPPFLAGS) $(CFLAGS) $^ $(LDFLAGS) -o $@ |
| 37 | |
| 38 | simple_decompression : simple_decompression.c |
| 39 | $(CC) $(CPPFLAGS) $(CFLAGS) $^ $(LDFLAGS) -o $@ |
| 40 | |
| 41 | dictionary_decompression : dictionary_decompression.c |
| 42 | $(CC) $(CPPFLAGS) $(CFLAGS) $^ $(LDFLAGS) -o $@ |
| 43 | |
| 44 | clean: |
| 45 | @rm -f core *.o tmp* result* *.zst \ |
| 46 | simple_compression simple_decompression dictionary_decompression |
| 47 | @echo Cleaning completed |
| 48 | |
| 49 | test: all |
| 50 | cp README.md tmp |
| 51 | ./simple_compression tmp |
| 52 | @echo starting simple_decompression |
| 53 | ./simple_decompression tmp.zst |
| 54 | @echo tests completed |