-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
45 lines (33 loc) · 1.67 KB
/
Makefile
File metadata and controls
45 lines (33 loc) · 1.67 KB
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
# Vendored OpenSSL for consumers: deps/openssl-1.0.2u/ (committed: headers + PIC *.a for plugins).
# Full rebuild + copy into vendored: ./scripts/refresh-vendored-openssl.sh — see INSTALL.md.
#
# Prerequisites for OpenSSL build: gcc, make, perl, curl/wget, sha256sum (or shasum).
OPENSSL_BUILD_DIR := deps/openssl-1.0.2u-src
VENDORED_OPENSSL := deps/openssl-1.0.2u
NPROC := $(shell nproc 2>/dev/null || sysctl -n hw.ncpu 2>/dev/null || echo 4)
.PHONY: all deps-openssl openssl-src clean-openssl-src configure-openssl-src test-go build-go check-vendor-openssl refresh-vendored-openssl
# Fail if vendored deps are missing or not tracked (run before git tag).
check-vendor-openssl:
chmod +x scripts/check-vendored-openssl.sh
./scripts/check-vendored-openssl.sh
# Rebuild PIC OpenSSL and copy into deps/openssl-1.0.2u/ (maintainer).
refresh-vendored-openssl:
chmod +x scripts/refresh-vendored-openssl.sh
./scripts/refresh-vendored-openssl.sh
all: build-go
# Download, verify, extract to deps/openssl-1.0.2u-src/, configure, and build (does not touch vendored deps/openssl-1.0.2u/).
deps-openssl:
chmod +x scripts/bootstrap-openssl.sh
./scripts/bootstrap-openssl.sh
# Incremental compile in the full source tree after deps-openssl.
openssl-src:
@test -f $(OPENSSL_BUILD_DIR)/Makefile || { echo "Run first: make deps-openssl"; exit 1; }
$(MAKE) -C $(OPENSSL_BUILD_DIR) -j$(NPROC)
clean-openssl-src:
@test -d $(OPENSSL_BUILD_DIR) && $(MAKE) -C $(OPENSSL_BUILD_DIR) clean || true
configure-openssl-src:
cd $(OPENSSL_BUILD_DIR) && ./config enable-ssl2 no-shared -Wa,--noexecstack
build-go:
CGO_ENABLED=1 go build -o /dev/null ./legacytls/...
test-go:
CGO_ENABLED=1 go test ./legacytls/...