summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorHolger Dengler <dengler@linutronix.de>2018-04-19 16:31:34 +0200
committerJohn Ogness <john.ogness@linutronix.de>2018-04-19 22:20:01 +0200
commit1da020092c159e01e9f0cfb9112d2f77a2a171ca (patch)
tree5971147d02faecf13f2fe61999077f16da4799f6 /Makefile
parentb9c47deaa48d17be573f036ce4c53d829ccf58dd (diff)
build: check for required tools
Check the required tools, before starting the build process. Missing tools will terminate the build process. Signed-off-by: Holger Dengler <dengler@linutronix.de>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile17
1 files changed, 15 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index e1a8ecf..f3537c8 100644
--- a/Makefile
+++ b/Makefile
@@ -35,7 +35,8 @@ DEPLOYPRINTOUT := $(DEPLOY)/$(PRINTOUT_FOLDER)
DEFCONF_FOLDER := $(CURDIR)/configs
BUILD_COMMAND := latexmk
-BUILD_ARGS := -f -halt-on-error -xelatex -bibtex -pdf
+BUILD_SUBCMD := xelatex
+BUILD_ARGS := -f -halt-on-error -$(BUILD_SUBCMD) -bibtex -pdf
ifeq ($(BUILD_VERBOSE),0)
BUILD_ARGS += --interaction=batchmode -silent
else
@@ -71,7 +72,7 @@ PHONY += all
all: build
PHONY += build
-build:
+build: check
ifdef CONFIG_BUILD_HANDOUTS
$(Q)mkdir -p $(DEPLOYHANDOUT)
$(Q)$(foreach dir,$(PATHS),$(MODMK) -C $(dir) buildhandouts;)
@@ -94,6 +95,18 @@ $(KMCONFIG):
$(KCONFIG):
cd kconfig-frontends/ && ./configure && make
+CHECK_COMMAND = $(shell command -v $(BUILD_COMMAND) 2> /dev/null)
+CHECK_SUBCMD = $(shell command -v $(BUILD_SUBCMD) 2> /dev/null)
+
+PHONY += check
+check: ;
+ifeq ($(CHECK_COMMAND),)
+ $(error install required tool: $(BUILD_COMMAND))
+endif
+ifeq ($(CHECK_SUBCMD),)
+ $(error install required tool: $(BUILD_SUBCMD))
+endif
+
PHONY += menuconfig
menuconfig: $(KMCONFIG)
$(Q)$(KMCONFIG) Kconfig