summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorJoyee Cheung <joyeec9h3@gmail.com>2018-11-06 10:55:09 +0800
committerRich Trott <rtrott@gmail.com>2018-11-07 20:51:17 -0800
commitdc3bc8928f9d7c22fe9b909fa3cc49e8c85ec860 (patch)
tree60b238408adb5b4cb99ea2a85d706c4147613168 /Makefile
parentf895b5a58ec930d3ca49ebf34959a598c7669d77 (diff)
downloadandroid-node-v8-dc3bc8928f9d7c22fe9b909fa3cc49e8c85ec860.tar.gz
android-node-v8-dc3bc8928f9d7c22fe9b909fa3cc49e8c85ec860.tar.bz2
android-node-v8-dc3bc8928f9d7c22fe9b909fa3cc49e8c85ec860.zip
build: only try to find node when it's needed by the target
Right now `node -p process.versions.openssl` always gets run in the Makefile even when it's not needed by the target (e.g. `make clean`, `make test-only`). This patch makes it a run time call instead of part of the global expansion. PR-URL: https://github.com/nodejs/node/pull/24115 Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile28
1 files changed, 14 insertions, 14 deletions
diff --git a/Makefile b/Makefile
index 8250aa16a7..cc6fcd888f 100644
--- a/Makefile
+++ b/Makefile
@@ -332,16 +332,16 @@ ifeq ($(OSTYPE),aix)
DOCBUILDSTAMP_PREREQS := $(DOCBUILDSTAMP_PREREQS) out/$(BUILDTYPE)/node.exp
endif
-node_use_openssl = $(shell $(call available-node,"-p" \
- "process.versions.openssl != undefined"))
+node_use_openssl = $(call available-node,"-p" \
+ "process.versions.openssl != undefined")
test/addons/.docbuildstamp: $(DOCBUILDSTAMP_PREREQS) tools/doc/node_modules
-ifeq ($(node_use_openssl),true)
- $(RM) -r test/addons/??_*/
- [ -x $(NODE) ] && $(NODE) $< || node $<
- touch $@
-else
- @echo "Skipping .docbuildstamp (no crypto)"
-endif
+ @if [ "$(shell $(node_use_openssl))" != "true" ]; then \
+ echo "Skipping .docbuildstamp (no crypto)"; \
+ else \
+ $(RM) -r test/addons/??_*/; \
+ [ -x $(NODE) ] && $(NODE) $< || node $< ; \
+ touch $@; \
+ fi
ADDONS_BINDING_GYPS := \
$(filter-out test/addons/??_*/binding.gyp, \
@@ -609,11 +609,11 @@ apidocs_json = $(addprefix out/,$(apidoc_sources:.md=.json))
apiassets = $(subst api_assets,api/assets,$(addprefix out/,$(wildcard doc/api_assets/*)))
tools/doc/node_modules: tools/doc/package.json
-ifeq ($(node_use_openssl),true)
- cd tools/doc && $(call available-node,$(run-npm-ci))
-else
- @echo "Skipping tools/doc/node_modules (no crypto)"
-endif
+ @if [ "$(shell $(node_use_openssl))" != "true" ]; then \
+ echo "Skipping tools/doc/node_modules (no crypto)"; \
+ else \
+ cd tools/doc && $(call available-node,$(run-npm-ci)) \
+ fi
.PHONY: doc-only
doc-only: tools/doc/node_modules \