File: Makefile

package info (click to toggle)
lz4 1.10.0-6
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,496 kB
  • sloc: ansic: 19,102; makefile: 1,060; python: 812; sh: 486; cpp: 173
file content (95 lines) | stat: -rw-r--r-- 3,150 bytes parent folder | download | duplicates (2)
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
# ##########################################################################
# LZ4 examples - Makefile
# Copyright (C) Yann Collet 2011-2020
#
# 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 :
#  - LZ4 source repository : https://github.com/lz4/lz4
#  - LZ4 forum froup : https://groups.google.com/forum/#!forum/lz4c
# ##########################################################################
# This makefile compile and test
# example programs, using (mostly) LZ4 streaming library,
# kindly provided by Takayuki Matsuoka
# ##########################################################################

LIBDIR    := ../lib

CPPFLAGS  += -I$(LIBDIR)
USERCFLAGS:= $(CFLAGS)
WFLAGS     = -std=gnu99 -Wall -Wextra -Wundef -Wshadow -Wcast-align -Wstrict-prototypes -Wc++-compat
CFLAGS     = $(WFLAGS) -O2 $(USERCFLAGS)

TESTFILE   = Makefile
SLIBLZ4   := $(LIBDIR)/liblz4.a
LZ4DIR     = ../programs
LZ4        = $(LZ4DIR)/lz4

default: all

$(SLIBLZ4): $(LIBDIR)/lz4.c $(LIBDIR)/lz4hc.c $(LIBDIR)/lz4frame.c $(LIBDIR)/lz4.h $(LIBDIR)/lz4hc.h $(LIBDIR)/lz4frame.h $(LIBDIR)/lz4frame_static.h
	$(MAKE) -j -C $(LIBDIR) liblz4.a

ALL = print_version \
	  simple_buffer \
	  frameCompress \
	  fileCompress \
      blockStreaming_doubleBuffer \
	  blockStreaming_ringBuffer \
	  streamingHC_ringBuffer \
      blockStreaming_lineByLine \
	  dictionaryRandomAccess \
	  bench_functions

.PHONY: all
all: $(ALL)

$(ALL): $(SLIBLZ4)

.PHONY:$(LZ4)
$(LZ4) :
	$(MAKE) -j -C $(LZ4DIR) lz4

.PHONY: test
test : all $(LZ4)
	@echo "\n=== Print Version ==="
	./print_version$(EXT)
	@echo "\n=== Simple compression example ==="
	./simple_buffer$(EXT)
	@echo "\n=== Double-buffer ==="
	./blockStreaming_doubleBuffer$(EXT) $(TESTFILE)
	@echo "\n=== Ring Buffer ==="
	./blockStreaming_ringBuffer$(EXT)   $(TESTFILE)
	@echo "\n=== Ring Buffer + LZ4 HC ==="
	./streamingHC_ringBuffer$(EXT) $(TESTFILE)
	@echo "\n=== Compress line by line ==="
	./blockStreaming_lineByLine$(EXT) $(TESTFILE)
	@echo "\n=== Dictionary Random Access ==="
	./dictionaryRandomAccess$(EXT) $(TESTFILE) $(TESTFILE) 1100 1400
	@echo "\n=== Frame compression ==="
	./frameCompress$(EXT) $(TESTFILE)
	$(LZ4) -vt $(TESTFILE).lz4
	@echo "\n=== file compression ==="
	./fileCompress$(EXT) $(TESTFILE)
	$(LZ4) -vt $(TESTFILE).lz4
	@echo "\n=== Q&D benchmark ==="
	./bench_functions$(EXT) 10000

.PHONY: clean
clean:
	@$(RM) core *.o *.dec *-0 *-9 *-8192 *.lz4s *.lz4 $(ALL)
	@echo Cleaning completed