From 6d97b5504ac862850dcb9087db9dc2cda1dd90d3 Mon Sep 17 00:00:00 2001 From: David Pursehouse Date: Tue, 19 Feb 2013 18:05:29 +0900 Subject: [PATCH] Add asciidoc checks in the documentation makefile Exit with error if the asciidoc executable is not available or has version lower than 8.6.3 Change-Id: I953a65304d850dddd83f4c18e0254290ead8cf0f --- Documentation/Makefile | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Documentation/Makefile b/Documentation/Makefile index 4c64dfec55..59de209ab3 100644 --- a/Documentation/Makefile +++ b/Documentation/Makefile @@ -14,6 +14,7 @@ ASCIIDOC ?= asciidoc ASCIIDOC_EXTRA ?= +ASCIIDOC_VER ?= 8.6.3 SVN ?= svn PUB_ROOT ?= https://gerrit-documentation.googlecode.com/svn/Documentation @@ -23,6 +24,16 @@ clean: rm -f *.html rm -rf $(LOCAL_ROOT) +ASCIIDOC_EXE := $(shell which $(ASCIIDOC)) +ifeq ($(wildcard $(ASCIIDOC_EXE)),) + $(error $(ASCIIDOC) must be available) +else + ASCIIDOC_OK := $(shell expr `asciidoc --version | cut -f2 -d' '` \>= $(ASCIIDOC_VER)) + ifeq ($(ASCIIDOC_OK),0) + $(error $(ASCIIDOC) version $(ASCIIDOC_VER) or higher is required) + endif +endif + ifeq ($(origin VERSION), undefined) VERSION := $(shell ./GEN-DOC-VERSION 2>/dev/null) endif