From 1da020092c159e01e9f0cfb9112d2f77a2a171ca Mon Sep 17 00:00:00 2001 From: Holger Dengler Date: Thu, 19 Apr 2018 16:31:34 +0200 Subject: 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 --- Makefile | 17 +++++++++++++++-- 1 file 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 -- cgit v1.2.3