Skip to content

Commit

Permalink
build: add a OFFLINE var to Makefile
Browse files Browse the repository at this point in the history
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
  • Loading branch information
danbev committed Nov 3, 2017
1 parent 5c475a7 commit c6ffc7a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ COVTESTS ?= test-cov
GTEST_FILTER ?= "*"
GNUMAKEFLAGS += --no-print-directory
GCOV ?= gcov
OFFLINE ?= false

ifdef JOBS
PARALLEL_ARGS = -j $(JOBS)
Expand Down Expand Up @@ -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 \
Expand Down

0 comments on commit c6ffc7a

Please sign in to comment.