-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
42 lines (33 loc) · 1.6 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
CC := g++-10
CXXFLAGS=-std=c++20 -Wall -Wextra -pedantic -g3
DEBUGFLAGS=-std=c++20 -Wall -Wextra -pedantic -g3
TUNE=-std=c++20 -O2 -march=native -mssse3 -mfpmath=sse -fexcess-precision=fast -pipe
CXXFLAGS:=$(TUNE)
INC= -I ./include/
SRCROOT:= ./src
SRCDIRS := $(shell find $(SRCROOT) -type d)
SRCS:=$(foreach dir, $(SRCDIRS), $(wildcard $(dir)/*.cpp))
OBJS:=$(SRCS:.cpp=.o)
OBJSDIR:=./obj
TESTOBJS:=$(filter-out ./src/main.o,$(OBJS))
.PHONY: all
all : test
.cpp.o:
-mkdir -p $(OBJSDIR)
$(CC) $(CXXFLAGS) -c $< $(INC) -o $(addprefix $(OBJSDIR)/,$(notdir $(<:.cpp=.o)))
test_tlwe : $(TESTOBJS) ./test/test_tlwe.o
$(CC) $(CXXFLAGS) -o test_tlwe.out $(addprefix $(OBJSDIR)/,$(notdir $^))
test_trlwe : $(TESTOBJS) ./test/test_trlwe.o
$(CC) $(CXXFLAGS) -o test_trlwe.out $(addprefix $(OBJSDIR)/,$(notdir $^))
test_trgsw : $(TESTOBJS) ./test/test_trgsw.o
$(CC) $(CXXFLAGS) -o test_trgsw.out $(addprefix $(OBJSDIR)/,$(notdir $^))
test_gatebootstrapping : $(TESTOBJS) ./test/test_gatebootstrapping.o
$(CC) $(CXXFLAGS) -o test_gatebootstrapping.out $(addprefix $(OBJSDIR)/,$(notdir $^))
test_identitykeyswitching : $(TESTOBJS) ./test/test_identitykeyswitching.o
$(CC) $(CXXFLAGS) -o test_identitykeyswitching.out $(addprefix $(OBJSDIR)/,$(notdir $^))
test_hom_nand : $(TESTOBJS) ./test/test_homo_nand.o
$(CC) $(CXXFLAGS) -o test_hom_nand.out $(addprefix $(OBJSDIR)/,$(notdir $^))
test_fft : $(TESTOBJS) ./test/test_fft.o
$(CC) $(CXXFLAGS) -o test_fft.out $(addprefix $(OBJSDIR)/,$(notdir $^))
.PHONY: test
test : test_tlwe test_trlwe test_trgsw test_gatebootstrapping test_identitykeyswitching test_hom_nand test_fft