sidh: updates for Makefile
This commit is contained in:
parent
61bc4c1a09
commit
ed36ba540a
@ -8,6 +8,7 @@ BUILD_DIR ?= $(PRJ_DIR)/_dev/GOROOT
|
|||||||
# Compiler
|
# Compiler
|
||||||
GO ?= go
|
GO ?= go
|
||||||
DOCKER ?= docker
|
DOCKER ?= docker
|
||||||
|
GIT ?= git
|
||||||
|
|
||||||
# Build environment
|
# Build environment
|
||||||
OS ?= $(shell $(GO) env GOHOSTOS)
|
OS ?= $(shell $(GO) env GOHOSTOS)
|
||||||
@ -18,6 +19,7 @@ GOROOT_ENV := $(shell $(GO) env GOROOT)
|
|||||||
GOROOT_LOCAL = $(BUILD_DIR)/$(OS_ARCH)
|
GOROOT_LOCAL = $(BUILD_DIR)/$(OS_ARCH)
|
||||||
# Flag indicates wheter invoke "go install -race std". Supported only on amd64 with CGO enabled
|
# Flag indicates wheter invoke "go install -race std". Supported only on amd64 with CGO enabled
|
||||||
INSTALL_RACE:= $(words $(filter $(ARCH)_$(shell go env CGO_ENABLED), amd64_1))
|
INSTALL_RACE:= $(words $(filter $(ARCH)_$(shell go env CGO_ENABLED), amd64_1))
|
||||||
|
TMP_DIR := $(shell mktemp -d)
|
||||||
|
|
||||||
# Test targets used for compatibility testing
|
# Test targets used for compatibility testing
|
||||||
TARGET_TEST_COMPAT=boring picotls tstclnt
|
TARGET_TEST_COMPAT=boring picotls tstclnt
|
||||||
@ -26,6 +28,11 @@ TARGET_TEST_COMPAT=boring picotls tstclnt
|
|||||||
BORINGSSL_REVISION=d451453067cd665a5c38830fbbaac9e599234a5e
|
BORINGSSL_REVISION=d451453067cd665a5c38830fbbaac9e599234a5e
|
||||||
BOGO_DOCKER_TRIS_LOCATION=/go/src/github.com/cloudflare/tls-tris
|
BOGO_DOCKER_TRIS_LOCATION=/go/src/github.com/cloudflare/tls-tris
|
||||||
|
|
||||||
|
# SIDH repository (TODO: change path)
|
||||||
|
SIDH_REPO ?= https://github.com/cloudflare/sidh.git
|
||||||
|
# NOBS repo (SIKE depends on SHA3)
|
||||||
|
NOBS_REPO ?= https://github.com/henrydcase/nobscrypto.git
|
||||||
|
|
||||||
###############
|
###############
|
||||||
#
|
#
|
||||||
# Build targets
|
# Build targets
|
||||||
@ -48,11 +55,22 @@ $(BUILD_DIR)/$(OS_ARCH)/.ok_$(VER_OS_ARCH): clean
|
|||||||
# Apply additional patches
|
# Apply additional patches
|
||||||
for p in $(wildcard $(DEV_DIR)/patches/*); do patch -d "$(GOROOT_LOCAL)" -p1 < "$$p"; done
|
for p in $(wildcard $(DEV_DIR)/patches/*); do patch -d "$(GOROOT_LOCAL)" -p1 < "$$p"; done
|
||||||
|
|
||||||
|
# Vendor NOBS library
|
||||||
|
$(GIT) clone $(NOBS_REPO) $(TMP_DIR)/nobs
|
||||||
|
cd $(TMP_DIR)/nobs; make vendor-sidh-for-tls
|
||||||
|
cp -rf $(TMP_DIR)/nobs/tls_vendor/* $(GOROOT_LOCAL)/src/vendor/
|
||||||
|
|
||||||
|
# Vendor SIDH library
|
||||||
|
$(GIT) clone $(SIDH_REPO) $(TMP_DIR)/sidh
|
||||||
|
cd $(TMP_DIR)/sidh; make vendor
|
||||||
|
cp -rf $(TMP_DIR)/sidh/build/vendor/* $(GOROOT_LOCAL)/src/vendor/
|
||||||
|
|
||||||
# Create go package
|
# Create go package
|
||||||
GOARCH=$(ARCH) GOROOT="$(GOROOT_LOCAL)" $(GO) install -v std
|
GOARCH=$(ARCH) GOROOT="$(GOROOT_LOCAL)" $(GO) install -v std
|
||||||
ifeq ($(INSTALL_RACE),1)
|
ifeq ($(INSTALL_RACE),1)
|
||||||
GOARCH=$(ARCH) GOROOT="$(GOROOT_LOCAL)" $(GO) install -race -v std
|
GOARCH=$(ARCH) GOROOT="$(GOROOT_LOCAL)" $(GO) install -race -v std
|
||||||
endif
|
endif
|
||||||
|
rm -rf $(TMP_DIR)
|
||||||
@touch "$@"
|
@touch "$@"
|
||||||
|
|
||||||
build-test-%: $(BUILD_DIR)/$(OS_ARCH)/.ok_$(VER_OS_ARCH)
|
build-test-%: $(BUILD_DIR)/$(OS_ARCH)/.ok_$(VER_OS_ARCH)
|
||||||
|
Loading…
Reference in New Issue
Block a user