diff options
author | Evan Lucas <evanlucas@me.com> | 2020-08-05 21:26:13 -0500 |
---|---|---|
committer | Evan Lucas <evanlucas@me.com> | 2020-08-25 10:51:19 -0500 |
commit | 4b6036a07b9767ecdb9b04f1effb5170c3f7dd4e (patch) | |
tree | 4eb7e286c8ea5de9be7120911ffd1bc85e2e9d3b /Makefile | |
parent | ad2c22df61be67db5764e7e72d02d8351663bcee (diff) | |
download | node-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-- | Makefile | 16 |
1 files changed, 16 insertions, 0 deletions
@@ -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 |