-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathmakefile
executable file
·80 lines (45 loc) · 1.57 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
CXX=g++
CC=gcc
#Here snippet should be your program
all: snippet bench_blight sub_sampler
#bench_blight is only here for benchmark purpose and can be removed
#Your compilation flags
CFLAGS_CUSTOM= -O9000 -std=c++11
#Other compilation flags
CFLAGS_LZ4+= -w -Wall -std=gnu99 -DUSE_THREADS -fstrict-aliasing -Iext $(DEFS)
CFLAGS_BLIGHT+= -DNDEBUG -Ofast -flto -march=native -mtune=native -g -std=c++11 -pipe -lz -fopenmp -msse4 -Ilz4
#Needed object files
LZ4O=lz4/lz4frame.o lz4/lz4.o lz4/xxhash.o lz4/lz4hc.o
BLO=blight.o utils.o
sub_sampler: sub_sampler.o $(BLO)
$(CXX) -o $@ $^ $(CFLAGS_BLIGHT)
sub_sampler.o: SubSampler.cpp
$(CXX) -o $@ -c $< $(CFLAGS_BLIGHT)
#Here you should compile be your program using Blight instead of snippet
snippet: snippet.o $(BLO) $(LZ4O)
$(CXX) -o $@ $^ $(CFLAGS_BLIGHT)
snippet.o: snippet.cpp
$(CXX) -o $@ -c $< $(CFLAGS_CUSTOM)
#Benchmark compilation
bench_blight: bench_blight.o blight.o utils.o $(LZ4O)
$(CXX) -o $@ $^ $(CFLAGS_BLIGHT)
bench_blight.o: bench_blight.cpp $(INC)
$(CXX) -o $@ -c $< $(CFLAGS_BLIGHT)
#Blight object files (BLO)
utils.o: utils.cpp $(INC)
$(CXX) -o $@ -c $< $(CFLAGS_BLIGHT)
blight.o: blight.cpp $(INC)
$(CXX) -o $@ -c $< $(CFLAGS_BLIGHT)
#Lz4 object files (LZ4O)
lz4/lz4frame.o: lz4/lz4frame.c $(INC)
$(CC) -o $@ -c $< $(CFLAGS_LZ4)
lz4/lz4.o: lz4/lz4.c $(INC)
$(CC) -o $@ -c $< $(CFLAGS_LZ4)
lz4/lz4hc.o: lz4/lz4hc.c $(INC)
$(CC) -o $@ -c $< $(CFLAGS_LZ4)
lz4/xxhash.o: lz4/xxhash.c $(INC)
$(CC) -o $@ -c $< $(CFLAGS_LZ4)
clean:
rm -rf *.o
rm -rf snippet bench_blight
rebuild: clean all