From c6ffc7a4b59d4a8ae3e8838332f6e31ecf163852 Mon Sep 17 00:00:00 2001 From: Daniel Bevenius Date: Thu, 2 Nov 2017 12:03:36 +0100 Subject: [PATCH] build: add a OFFLINE var to Makefile We have a build environment that restricts our internet connection and currently building fails due to the lint-md target needs to be able to install npm modules. This commit suggests adding a OFFLINE variable to the Makefile which can be used like in the following examples: $ env OFFLINE=true make -j8 test $ make -j8 test OFFLINE=true --- Makefile | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Makefile b/Makefile index bc337ab96d90ce..2a216943dac33c 100644 --- a/Makefile +++ b/Makefile @@ -14,6 +14,7 @@ COVTESTS ?= test-cov GTEST_FILTER ?= "*" GNUMAKEFLAGS += --no-print-directory GCOV ?= gcov +OFFLINE ?= false ifdef JOBS PARALLEL_ARGS = -j $(JOBS) @@ -976,17 +977,21 @@ lint-md-clean: $(RM) -r tools/remark-preset-lint-node/node_modules lint-md-build: +ifeq ($(OFFLINE),false) @if [ ! -d tools/remark-cli/node_modules ]; then \ echo "Markdown linter: installing remark-cli into tools/"; \ cd tools/remark-cli && ../../$(NODE) ../../$(NPM) install; fi @if [ ! -d tools/remark-preset-lint-node/node_modules ]; then \ echo "Markdown linter: installing remark-preset-lint-node into tools/"; \ cd tools/remark-preset-lint-node && ../../$(NODE) ../../$(NPM) install; fi +endif lint-md: lint-md-build +ifeq ($(OFFLINE),false) @echo "Running Markdown linter..." $(NODE) tools/remark-cli/cli.js -q -f \ ./*.md doc src lib benchmark tools/doc/ tools/icu/ +endif LINT_JS_TARGETS = benchmark doc lib test tools LINT_JS_CMD = tools/eslint/bin/eslint.js --cache \