forked from randombit/fecpp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
42 lines (28 loc) · 992 Bytes
/
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
CC=g++
WARNINGS= -Wall -Wextra
OPTFLAGS=-O2 -march=native
DEBUGFLAGS=-g
CFLAGS=$(OPTFLAGS) $(DEBUGFLAGS) $(WARNINGS)
PROGS = benchmark zfec test_recovery gen_test_vec
all: fecpp.so $(PROGS)
libfecpp.a: fecpp.o
ar crs $@ $<
fecpp.o: fecpp.cpp fecpp.h
$(CC) $(CFLAGS) -I. -c $< -o $@
test/%.o: test/%.cpp fecpp.h
$(CC) $(CFLAGS) -I. -c $< -o $@
zfec: test/zfec.o libfecpp.a
$(CC) $(CFLAGS) $< -L. -lfecpp -o $@
benchmark: test/benchmark.o libfecpp.a
$(CC) $(CFLAGS) $< -L. -lfecpp -o $@
test_fec: test/test_fec.o libfecpp.a
$(CC) $(CFLAGS) $< -L. -lfecpp -o $@
test_recovery: test/test_recovery.o libfecpp.a
$(CC) $(CFLAGS) $< -L. -lfecpp -o $@
gen_test_vec: test/gen_test_vec.o libfecpp.a
$(CC) $(CFLAGS) $< -L. -lfecpp -o $@
fecpp.so: fecpp.cpp fecpp_python.cpp fecpp.h
$(CC) -shared -fPIC $(CFLAGS) `pkg-config --cflags python` fecpp.cpp fecpp_python.cpp `pkg-config --libs python` -lboost_python -o fecpp.so
clean:
rm -f fecpp.so *.a *.o test/*.o
rm -f $(PROGS)