-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathMakefile
260 lines (177 loc) · 7.29 KB
/
Makefile
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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
# Change your compiler settings here
#CCPP = g++
#CC = gcc
#OPTFLAGS = -O3 -fomit-frame-pointer -funroll-loops
CCPP = clang++
CC = clang
OPTFLAGS = -O4
CFLAGS = -Wall -fstrict-aliasing
CPFLAGS = $(CFLAGS)
# List of object files
decode_objects = EndianNeutral.o Enforcer.o Filters.o GCIFReader.o
decode_objects += HuffmanDecoder.o ImageRGBAReader.o EntropyDecoder.o
decode_objects += ImageMaskReader.o ImageReader.o MappedFile.o lz4.o
decode_objects += ImagePaletteReader.o MonoReader.o SmallPaletteReader.o
decode_objects += ChaosMetric.o LZReader.o
gcif_objects = gcif.o lodepng.o Log.o Mutex.o Clock.o Thread.o
gcif_objects += lz4hc.o HuffmanEncoder.o PaletteOptimizer.o
gcif_objects += SystemInfo.o ImageWriter.o SmallPaletteWriter.o
gcif_objects += ImageMaskWriter.o MonoWriter.o EntropyEncoder.o
gcif_objects += ImageRGBAWriter.o FilterScorer.o SuffixArray3.o
gcif_objects += LZMatchFinder.o ImagePaletteWriter.o
gcif_objects += GCIFWriter.o EntropyEstimator.o WaitableFlag.o
gcif_objects += divsufsort.o sssort.o trsort.o
gcif_objects += $(decode_objects)
#gcif_objects += ImageLPReader.o ImageLPWriter.o
#gcif_objects += ImageLZReader.o ImageLZWriter.o
# List of source files
DECODE_SRCS = decoder/EndianNeutral.cpp decoder/Enforcer.cpp
DECODE_SRCS += decoder/Filters.cpp decoder/GCIFReader.cpp
DECODE_SRCS += decoder/HuffmanDecoder.cpp
DECODE_SRCS += decoder/ImageRGBAReader.cpp
DECODE_SRCS += decoder/ImagePaletteReader.cpp
DECODE_SRCS += decoder/ImageMaskReader.cpp
DECODE_SRCS += decoder/ImageReader.cpp
DECODE_SRCS += decoder/MappedFile.cpp
DECODE_SRCS += decoder/lz4.c decoder/SmallPaletteReader.cpp
DECODE_SRCS += decoder/MonoReader.cpp decoder/ChaosMetric.cpp
DECODE_SRCS += decoder/EntropyDecoder.cpp decoder/LZReader.cpp
SRCS = ./gcif.cpp encoder/lodepng.cpp encoder/Log.cpp encoder/Mutex.cpp
SRCS += encoder/Clock.cpp encoder/Thread.cpp
SRCS += encoder/lz4hc.c encoder/MonoWriter.cpp
SRCS += encoder/HuffmanEncoder.cpp encoder/EntropyEncoder.cpp
SRCS += encoder/SystemInfo.cpp encoder/ImageWriter.cpp
SRCS += encoder/ImageMaskWriter.cpp
SRCS += encoder/ImageRGBAWriter.cpp
SRCS += encoder/FilterScorer.cpp encoder/SmallPaletteWriter.cpp
SRCS += encoder/LZMatchFinder.cpp encoder/SuffixArray3.cpp
SRCS += encoder/GCIFWriter.cpp encoder/PaletteOptimizer.cpp
SRCS += encoder/ImagePaletteWriter.cpp
SRCS += encoder/EntropyEstimator.cpp encoder/WaitableFlag.cpp
SRCS += encoder/MonoWriter.cpp
SRCS += encoder/libdivsufsort/divsufsort.c
SRCS += encoder/libdivsufsort/sssort.c
SRCS += encoder/libdivsufsort/trsort.c
SRCS += $(DECODE_SRCS)
#SRCS += ImageLPReader.cpp ImageLPWriter.cpp
#SRCS += ImageLZReader.cpp ImageLZWriter.cpp
# Release target (default)
release : CFLAGS += $(OPTFLAGS) -DCAT_COMPILE_MMAP
release : gcif
# Debug target
debug : CFLAGS += -g -O0 -DDEBUG -DCAT_COMPILE_MMAP
debug : gcif
# decomp executable
release-decomp : CFLAGS += $(OPTFLAGS) -DCAT_COMPILE_MMAP
release-decomp : decomp
# decompe executable
decomp : $(decode_objects) decomp.o
$(CCPP) -o decomp $(decode_objects) decomp.o
# gcif executable
gcif : $(gcif_objects)
$(CCPP) -o gcif $(gcif_objects)
# Application files
gcif.o : ./gcif.cpp
$(CCPP) $(CPFLAGS) -c ./gcif.cpp
lodepng.o : encoder/lodepng.cpp
$(CCPP) $(CPFLAGS) -c encoder/lodepng.cpp
lz4.o : decoder/lz4.c
$(CC) $(CCFLAGS) -c decoder/lz4.c
lz4hc.o : encoder/lz4hc.c
$(CC) $(CCFLAGS) -c encoder/lz4hc.c
Log.o : encoder/Log.cpp
$(CCPP) $(CPFLAGS) -c encoder/Log.cpp
Mutex.o : encoder/Mutex.cpp
$(CCPP) $(CPFLAGS) -c encoder/Mutex.cpp
Clock.o : encoder/Clock.cpp
$(CCPP) $(CPFLAGS) -c encoder/Clock.cpp
Thread.o : encoder/Thread.cpp
$(CCPP) $(CPFLAGS) -c encoder/Thread.cpp
MappedFile.o : decoder/MappedFile.cpp
$(CCPP) $(CPFLAGS) -c decoder/MappedFile.cpp
SystemInfo.o : encoder/SystemInfo.cpp
$(CCPP) $(CPFLAGS) -c encoder/SystemInfo.cpp
EndianNeutral.o : decoder/EndianNeutral.cpp
$(CCPP) $(CPFLAGS) -c decoder/EndianNeutral.cpp
HuffmanDecoder.o : decoder/HuffmanDecoder.cpp
$(CCPP) $(CPFLAGS) -c decoder/HuffmanDecoder.cpp
HuffmanEncoder.o : encoder/HuffmanEncoder.cpp
$(CCPP) $(CPFLAGS) -c encoder/HuffmanEncoder.cpp
ImageReader.o : decoder/ImageReader.cpp
$(CCPP) $(CPFLAGS) -c decoder/ImageReader.cpp
ImageWriter.o : encoder/ImageWriter.cpp
$(CCPP) $(CPFLAGS) -c encoder/ImageWriter.cpp
ImageMaskReader.o : decoder/ImageMaskReader.cpp
$(CCPP) $(CPFLAGS) -c decoder/ImageMaskReader.cpp
ImageMaskWriter.o : encoder/ImageMaskWriter.cpp
$(CCPP) $(CPFLAGS) -c encoder/ImageMaskWriter.cpp
FilterScorer.o : encoder/FilterScorer.cpp
$(CCPP) $(CPFLAGS) -c encoder/FilterScorer.cpp
Filters.o : decoder/Filters.cpp
$(CCPP) $(CPFLAGS) -c decoder/Filters.cpp
#ImageLZWriter.o : encoder/ImageLZWriter.cpp
# $(CCPP) $(CPFLAGS) -c encoder/ImageLZWriter.cpp
#ImageLZReader.o : decoder/ImageLZReader.cpp
# $(CCPP) $(CPFLAGS) -c decoder/ImageLZReader.cpp
ImagePaletteWriter.o : encoder/ImagePaletteWriter.cpp
$(CCPP) $(CPFLAGS) -c encoder/ImagePaletteWriter.cpp
ImagePaletteReader.o : decoder/ImagePaletteReader.cpp
$(CCPP) $(CPFLAGS) -c decoder/ImagePaletteReader.cpp
ImageRGBAWriter.o : encoder/ImageRGBAWriter.cpp
$(CCPP) $(CPFLAGS) -c encoder/ImageRGBAWriter.cpp
ImageRGBAReader.o : decoder/ImageRGBAReader.cpp
$(CCPP) $(CPFLAGS) -c decoder/ImageRGBAReader.cpp
GCIFReader.o : decoder/GCIFReader.cpp
$(CCPP) $(CPFLAGS) -c decoder/GCIFReader.cpp
GCIFWriter.o : encoder/GCIFWriter.cpp
$(CCPP) $(CPFLAGS) -c encoder/GCIFWriter.cpp
EntropyEstimator.o : encoder/EntropyEstimator.cpp
$(CCPP) $(CPFLAGS) -c encoder/EntropyEstimator.cpp
WaitableFlag.o : encoder/WaitableFlag.cpp
$(CCPP) $(CPFLAGS) -c encoder/WaitableFlag.cpp
Enforcer.o : decoder/Enforcer.cpp
$(CCPP) $(CPFLAGS) -c decoder/Enforcer.cpp
MonoReader.o : decoder/MonoReader.cpp
$(CCPP) $(CPFLAGS) -c decoder/MonoReader.cpp
MonoWriter.o : encoder/MonoWriter.cpp
$(CCPP) $(CPFLAGS) -c encoder/MonoWriter.cpp
PaletteOptimizer.o : encoder/PaletteOptimizer.cpp
$(CCPP) $(CPFLAGS) -c encoder/PaletteOptimizer.cpp
SmallPaletteWriter.o : encoder/SmallPaletteWriter.cpp
$(CCPP) $(CPFLAGS) -c encoder/SmallPaletteWriter.cpp
SmallPaletteReader.o : decoder/SmallPaletteReader.cpp
$(CCPP) $(CPFLAGS) -c decoder/SmallPaletteReader.cpp
#ImageLPWriter.o : ImageLPWriter.cpp
# $(CCPP) $(CPFLAGS) -c ImageLPWriter.cpp
#ImageLPReader.o : ImageLPReader.cpp
# $(CCPP) $(CPFLAGS) -c ImageLPReader.cpp
LZMatchFinder.o : encoder/LZMatchFinder.cpp
$(CCPP) $(CPFLAGS) -c encoder/LZMatchFinder.cpp
EntropyEncoder.o : encoder/EntropyEncoder.cpp
$(CCPP) $(CPFLAGS) -c encoder/EntropyEncoder.cpp
EntropyDecoder.o : decoder/EntropyDecoder.cpp
$(CCPP) $(CPFLAGS) -c decoder/EntropyDecoder.cpp
ChaosMetric.o : decoder/ChaosMetric.cpp
$(CCPP) $(CPFLAGS) -c decoder/ChaosMetric.cpp
SuffixArray3.o : encoder/SuffixArray3.cpp
$(CCPP) $(CPFLAGS) -c encoder/SuffixArray3.cpp
divsufsort.o : encoder/libdivsufsort/divsufsort.c
$(CC) $(CFLAGS) -c encoder/libdivsufsort/divsufsort.c
sssort.o : encoder/libdivsufsort/sssort.c
$(CC) $(CFLAGS) -c encoder/libdivsufsort/sssort.c
trsort.o : encoder/libdivsufsort/trsort.c
$(CC) $(CFLAGS) -c encoder/libdivsufsort/trsort.c
decomp.o : decomp.cpp
$(CCPP) $(CPFLAGS) -c decomp.cpp
LZReader.o : decoder/LZReader.cpp
$(CCPP) $(CPFLAGS) -c decoder/LZReader.cpp
# Depend target
depend: .depend
.depend: $(SRCS)
rm -f ./.depend
$(CCPP) $(CPPFLAGS) -MM $^ > ./.depend;
include .depend
# Clean target
.PHONY : clean
clean :
-rm gcif $(gcif_objects)