summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorEvan Lucas <evanlucas@me.com>2020-08-05 21:26:13 -0500
committerEvan Lucas <evanlucas@me.com>2020-08-25 10:51:19 -0500
commit4b6036a07b9767ecdb9b04f1effb5170c3f7dd4e (patch)
tree4eb7e286c8ea5de9be7120911ffd1bc85e2e9d3b /Makefile
parentad2c22df61be67db5764e7e72d02d8351663bcee (diff)
downloadnode-new-4b6036a07b9767ecdb9b04f1effb5170c3f7dd4e.tar.gz
build,deps: add gen-openssl target
This adds a new make target to generate platform dependent files for openssl on non-linux machines. The scripts we currently have in place require linux. This adds a Dockerfile that installs the necessary dependencies to be able to generate these files. Previously, it was necessary to run `make -C deps/openssl/config` on a linux machine. Now, as long as docker is installed and in your `PATH`, it is possible to run `make gen-openssl`. PR-URL: https://github.com/nodejs/node/pull/34642 Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile16
1 files changed, 16 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index 97134eee65..5120d517de 100644
--- a/Makefile
+++ b/Makefile
@@ -1406,3 +1406,19 @@ endif
lint-clean:
$(RM) tools/.*lintstamp
$(RM) .eslintcache
+
+HAS_DOCKER ?= $(shell which docker > /dev/null 2>&1; [ $$? -eq 0 ] && echo 1 || echo 0)
+
+ifeq ($(HAS_DOCKER), 1)
+DOCKER_COMMAND ?= docker run -it -v $(PWD):/node
+IS_IN_WORKTREE = $(shell grep '^gitdir: ' $(PWD)/.git 2>/dev/null)
+GIT_WORKTREE_COMMON = $(shell git rev-parse --git-common-dir)
+DOCKER_COMMAND += $(if $(IS_IN_WORKTREE), -v $(GIT_WORKTREE_COMMON):$(GIT_WORKTREE_COMMON))
+gen-openssl: ## Generate platform dependent openssl files (requires docker)
+ docker build -t node-openssl-builder deps/openssl/config/
+ $(DOCKER_COMMAND) node-openssl-builder make -C deps/openssl/config
+else
+gen-openssl:
+ @echo "No docker command, cannot continue"
+ @exit 1
+endif