Compile library and tests separately

This commit is contained in:
iliailia
2022-01-19 16:49:29 +01:00
parent 3e273714b8
commit 305a6cc87d
4 changed files with 14 additions and 9 deletions

1
.gitignore vendored
View File

@ -30,6 +30,7 @@
*.exe
*.out
*.app
test
# IDE
*.code-workspace

6
FINAL.h Normal file
View File

@ -0,0 +1,6 @@
#include "params.h"
#include "sampler.h"
#include "keygen.h"
#include "fft.h"
#include "ntruhe.h"
#include "lwehe.h"

View File

@ -7,8 +7,11 @@ all: clean test
clean:
$(RM) test test.o lwehe.o ntruhe.o fft.o sampler.o keygen.o
test: include/params.h ntruhe.o lwehe.o keygen.o fft.o sampler.o
$(CCX) $(CCXFLAGS) -o test test.cpp ntruhe.o lwehe.o keygen.o fft.o sampler.o $(DEPS)
test: FINAL.h libfinal.a
$(CCX) $(CCXFLAGS) -o test test.cpp libfinal.a $(DEPS)
libfinal.a: include/params.h ntruhe.o lwehe.o keygen.o fft.o sampler.o
$(AR) -q libfinal.a ntruhe.o lwehe.o keygen.o fft.o sampler.o
ntruhe.o: include/ntruhe.h keygen.o sampler.o lwehe.o src/ntruhe.cpp
$(CCX) $(CCXFLAGS) -c src/ntruhe.cpp

View File

@ -1,12 +1,5 @@
#include <iostream>
#include <cassert>
#include "params.h"
#include "sampler.h"
#include "keygen.h"
#include "fft.h"
#include "ntruhe.h"
#include "lwehe.h"
#include <time.h>
#include <cstdint>
#include <stdexcept>
@ -15,6 +8,8 @@
#include <NTL/ZZX.h>
#include "FINAL.h"
using namespace std;
using namespace NTL;