-
Notifications
You must be signed in to change notification settings - Fork 8
/
Makefile
77 lines (53 loc) · 1.37 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
CC= gcc
CXX= g++
LD= gcc
CFLAGS= -O3 -funroll-loops -mavx2 -mpclmul -std=gnu99 -Wextra -Wall
CXXFLAGS= -O3 -mavx2 -mpclmul -fno-exceptions -fno-rtti -nostdinc++ -Wextra -Wall
INCPATH= -I/usr/local/include -I/opt/local/include -I/usr/include #-I../../nist-mq-submission/gf2-dev/
LDFLAGS=
LIBPATH= -L/usr/local/lib -L/opt/local/lib -L/usr/lib #-L../gf2-dev/
LIBS= #-lm -lcrypto -lgf2x
OBJ= bc.o bitpolymul.o encode.o butterfly_net.o gf2128_cantor_iso.o btfy.o trunc_btfy_tab.o gf264_cantor_iso.o trunc_btfy_tab_64.o
EXE= bitpolymul-test #bc-test
CSRC= $(wildcard *.cpp)
ifdef DEBUG
CFLAGS+= -D_DEBUG_
CXXFLAGS+= -D_DEBUG_
endif
ifdef NO_SSE
CFLAGS += -D_NO_SSE_
CXXFLAGS += -D_NO_SSE_
endif
ifdef K
CFLAGS += -DK=$(K)
CXXFLAGS += -DK=$(K)
endif
ifdef AVX2
CFLAGS += -mavx2 -D_USE_AVX2_
CXXFLAGS += -mavx2 -D_USE_AVX2_
endif
ifdef AVX
CFLAGS += -mavx -D_USE_AVX_
CXXFLAGS += -mavx -D_USE_AVX_
endif
ifdef GPROF
CFLAGS += -pg
CXXFLAGS += -pg
LDFLAGS += -pg
endif
.PHONY: all tests tables clean
all: $(OBJ) $(EXE)
%-test: $(OBJ) %-test.o
$(LD) $(LDFLAGS) $(LIBPATH) -o $@ $^ $(LIBS)
%-benchmark: $(OBJ) %-benchmark.o
$(LD) $(LDFLAGS) $(LIBPATH) -o $@ $^ $(LIBS)
%.o: %.c
$(CC) $(CFLAGS) $(INCPATH) -c $<
%.o: %.cpp
$(CXX) $(CXXFLAGS) $(INCPATH) -c $<
tests:
cd tests; make
tables:
cd supplement; make
clean:
rm *.o *-test *-benchmark