From 62dddd08fd5a73f7ffdfbe754d5688c9c5277bd3 Mon Sep 17 00:00:00 2001 From: "Christoph M. Wintersteiger" Date: Fri, 14 Dec 2018 13:07:50 +0000 Subject: [PATCH] Add new 3rdparty build scripts --- 3rdparty/CMakeLists.txt | 6 ++++++ 3rdparty/Makefile.inc | 1 + 3rdparty/everest/CMakeLists.txt | 9 +++++++++ 3rdparty/everest/Makefile.inc | 7 +++++++ CMakeLists.txt | 1 + library/CMakeLists.txt | 10 +--------- library/Makefile | 12 +++--------- 7 files changed, 28 insertions(+), 18 deletions(-) create mode 100755 3rdparty/CMakeLists.txt create mode 100755 3rdparty/Makefile.inc create mode 100755 3rdparty/everest/CMakeLists.txt create mode 100755 3rdparty/everest/Makefile.inc diff --git a/3rdparty/CMakeLists.txt b/3rdparty/CMakeLists.txt new file mode 100755 index 000000000..df28699f1 --- /dev/null +++ b/3rdparty/CMakeLists.txt @@ -0,0 +1,6 @@ +add_subdirectory(everest) + +set(src_thirdparty + ${src_everest} + PARENT_SCOPE +) diff --git a/3rdparty/Makefile.inc b/3rdparty/Makefile.inc new file mode 100755 index 000000000..757bd5f1b --- /dev/null +++ b/3rdparty/Makefile.inc @@ -0,0 +1 @@ +include ../3rdparty/everest/Makefile.inc \ No newline at end of file diff --git a/3rdparty/everest/CMakeLists.txt b/3rdparty/everest/CMakeLists.txt new file mode 100755 index 000000000..25f50cae9 --- /dev/null +++ b/3rdparty/everest/CMakeLists.txt @@ -0,0 +1,9 @@ +include_directories(include include/everest include/everest/kremlib) + +set(src_everest + ${CMAKE_CURRENT_SOURCE_DIR}/library/everest.c + ${CMAKE_CURRENT_SOURCE_DIR}/library/Hacl_Curve25519.c + ${CMAKE_CURRENT_SOURCE_DIR}/library/x25519.c + ${CMAKE_CURRENT_SOURCE_DIR}/library/kremlib/FStar_UInt64_FStar_UInt32_FStar_UInt16_FStar_UInt8.c + PARENT_SCOPE +) \ No newline at end of file diff --git a/3rdparty/everest/Makefile.inc b/3rdparty/everest/Makefile.inc new file mode 100755 index 000000000..bbdba56a3 --- /dev/null +++ b/3rdparty/everest/Makefile.inc @@ -0,0 +1,7 @@ +THIRDPARTY_INCLUDES+=-I../3rdparty/everest/include -I../3rdparty/everest/include/everest -I../3rdparty/everest/include/everest/kremlib + +THIRDPARTY_OBJECTS+= \ + ../3rdparty/everest/library/everest.o \ + ../3rdparty/everest/library/Hacl_Curve25519.o \ + ../3rdparty/everest/library/x25519.o \ + ../3rdparty/everest/library/kremlib/FStar_UInt64_FStar_UInt32_FStar_UInt16_FStar_UInt8.o \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt index f756d4331..044ddc281 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -179,6 +179,7 @@ endif() include_directories(include/ 3rdparty/everest/include/ 3rdparty/everest/include/everest/ 3rdparty/everest/include/everest/kremlin/ 3rdparty/everest/include/everest/kremlib/) include_directories(library/) +add_subdirectory(3rdparty) add_subdirectory(library) add_subdirectory(include) diff --git a/library/CMakeLists.txt b/library/CMakeLists.txt index 009fb3e74..a6eb1ed06 100644 --- a/library/CMakeLists.txt +++ b/library/CMakeLists.txt @@ -74,6 +74,7 @@ set(src_crypto threading.c timing.c xtea.c + ${src_thirdparty} ) # For files generated by the parent project (Mbed TLS) when building Mbed @@ -94,15 +95,6 @@ set(src_crypto ) endif() -set(src_everest - ../3rdparty/everest/library/everest.c - ../3rdparty/everest/library/Hacl_Curve25519.c - ../3rdparty/everest/library/x25519.c - ../3rdparty/everest/library/kremlib/fstar_uint128.c - ../3rdparty/everest/library/kremlib/FStar_UInt64_FStar_UInt32_FStar_UInt16_FStar_UInt8.c -) - -set(src_crypto ${src_crypto} ${src_everest}) if(CMAKE_COMPILER_IS_GNUCC) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wmissing-declarations -Wmissing-prototypes") endif(CMAKE_COMPILER_IS_GNUCC) diff --git a/library/Makefile b/library/Makefile index ee9ca389b..31c9208b9 100644 --- a/library/Makefile +++ b/library/Makefile @@ -19,9 +19,6 @@ endif # To compile on Plan9: # CFLAGS += -D_BSD_EXTENSION -# Include directories for Everest code -LOCAL_CFLAGS+=-I../3rdparty/everest/include -I../3rdparty/everest/include/everest -I../3rdparty/everest/include/everest/kremlib - # if were running on Windows build for Windows ifdef WINDOWS WINDOWS_BUILD=1 @@ -104,11 +101,9 @@ OBJS_CRYPTO += version.o OBJS_CRYPTO += version_features.o endif -OBJS_CRYPTO+= \ - ../3rdparty/everest/library/everest.o \ - ../3rdparty/everest/library/Hacl_Curve25519.o \ - ../3rdparty/everest/library/x25519.o \ - ../3rdparty/everest/library/kremlib/FStar_UInt64_FStar_UInt32_FStar_UInt16_FStar_UInt8.o +include ../3rdparty/Makefile.inc +LOCAL_CFLAGS+=$(THIRDPARTY_INCLUDES) +OBJS_CRYPTO+=$(THIRDPARTY_OBJECTS) .SILENT: @@ -163,4 +158,3 @@ else if exist libmbed* del /Q /F libmbed* if exist $(OBJS_CRYPTO) del /Q /F $(OBJS_CRYPTO) endif -