From 877520a9fa9020bfbcb10512b6b771f4491d3b9e Mon Sep 17 00:00:00 2001 From: Trevor Elliott Date: Mon, 10 Jun 2013 11:19:47 -0700 Subject: Move more commands to Config.mk --- Config.mk.sample | 5 +++-- doc/build.mk | 8 +++----- mk/util.mk | 4 +++- src/batchtools/build.mk | 9 ++++----- src/js/tests/build.mk | 6 +++--- 5 files changed, 16 insertions(+), 16 deletions(-) diff --git a/Config.mk.sample b/Config.mk.sample index 1a8b7f7..8685ab9 100644 --- a/Config.mk.sample +++ b/Config.mk.sample @@ -1,4 +1,5 @@ -PHANTOM_EXE ?= $(shell which phantomjs 2>/dev/null) - +phantomjs-cmd ?= $(call find-cmd,phantomjs) +maven-cmd ?= $(call find-cmd,mvn) +pandoc-cmd ?= $(call find-cmd,pandoc) addon-sdk-version ?= 1.14 diff --git a/doc/build.mk b/doc/build.mk index f628a6c..79efa14 100644 --- a/doc/build.mk +++ b/doc/build.mk @@ -6,14 +6,12 @@ jsdoc-dir := $(build-dir)/jsdoc manual-dir := $(build-dir)/manual manual-src := $(path)/manual_src -pandoc := $(shell which pandoc 2>/dev/null) - # HTML Generation ############################################################## # Use pandoc to generate HTML quiet_cmd_pandoc = PANDOC $(call drop-prefix,$@) - cmd_pandoc = $(pandoc) $< -o $@ -s --highlight-style=kate \ + cmd_pandoc = $(pandoc-cmd) $< -o $@ -s --highlight-style=kate \ --template=$(manual-src)/template.html manual-deps := $(patsubst $(manual-src)/%.md,$(manual-dir)/%.html,\ @@ -25,10 +23,10 @@ $(manual-deps): $(manual-dir)/%.html: $(manual-src)/%.md | $(manual-dir) # HTML Manual ################################################################## -ifneq "$(pandoc)" "" +ifneq "$(pandoc-cmd)" "" doc: web-manual else -$(warning pandoc not found, not building the manual) +$(call strict-warning,pandoc not found, not building the manual) endif .PHONY: web-manual diff --git a/mk/util.mk b/mk/util.mk index 7449b04..c37c8034 100644 --- a/mk/util.mk +++ b/mk/util.mk @@ -14,6 +14,7 @@ cmd = @$(echo-cmd) $(cmd_$1) label = $(if $(Q),$(Q)echo ' $1';) +find-cmd = $(shell which $1 2$(redir)) drop-prefix = $(patsubst $(topdir)/%,%,$1) @@ -29,7 +30,8 @@ quiet_cmd_cp = CP $(call drop-prefix,$@) ifeq "$(strict)" "1" -strict-error = $(error $1) +strict-error = $(error $1) +strict-warning = $(warning $1) endif diff --git a/src/batchtools/build.mk b/src/batchtools/build.mk index 8649476..e238ddf 100644 --- a/src/batchtools/build.mk +++ b/src/batchtools/build.mk @@ -1,9 +1,8 @@ -mvn-exe := $(shell which mvn 2>/dev/null) batchtools-dir := $(path) -ifeq "$(mvn-exe)" "" -$(call strict-error,"No maven found, unable to run batchtools tests") +ifeq "$(maven-exe)" "" +$(call strict-error,"No maven found: unable to run batchtools tests") else test: test-batchtools @@ -11,9 +10,9 @@ test: test-batchtools .PHONY: test-batchtools test-batchtools: $(topdir)/profiles/chrome $(topdir)/profiles/firefox $(call label,BATCHTEST)(cd $(batchtools-dir) \ - && xvfb-run -a $(mvn-cmd) test) + && xvfb-run -a $(maven-cmd) test) clean:: - (cd $(batchtools-dir) && $(mvn-exe) clean) + (cd $(batchtools-dir) && $(maven-exe) clean) endif diff --git a/src/js/tests/build.mk b/src/js/tests/build.mk index 041e207..3ab79c0 100644 --- a/src/js/tests/build.mk +++ b/src/js/tests/build.mk @@ -7,13 +7,13 @@ clean:: # Jasmine Specs ############################################################### -ifeq "$(PHANTOM_EXE)" "" -$(call strict-error,"phantomjs not found, unable to run javascript tests") +ifeq "$(phantomjs-cmd)" "" +$(call strict-error,"phantomjs not found: unable to run javascript tests") else test: test-js test-js: - cd $(topdir)/src/js && $(PHANTOM_EXE) \ + cd $(topdir)/src/js && $(phantomjs-cmd) \ lib/phantomjs_jasmine/phantomjs_jasminexml_runner.js \ tests/PhantomJSJasmineRunner.html tests/reports/ -- cgit v1.2.3