Browse code

core: Makefiles - catch unavailbility of docbook2man tool

- print an info message instead of ending up in execution error of
Makefile rule trying to generate man pages from xml files
- DOCBOOK var renamed to DOCBOOKMAN to be more suggestive for its
purpose
- related to GH #1624

Daniel-Constantin Mierla authored on 31/08/2018 10:43:44
Showing 3 changed files
... ...
@@ -278,16 +278,17 @@ endif
278 278
 
279 279
 #man page build rules
280 280
 ifneq (,$(wildcard $(MOD_NAME).xml))
281
-
281
+ifneq ($(DOCBOOKMAN),)
282 282
 $(MOD_NAME).7: $(MOD_NAME).xml
283
-	$(DOCBOOK) -s ../../../doc/stylesheets/serdoc2man.xsl $<
283
+	$(DOCBOOKMAN) -s ../../../doc/stylesheets/serdoc2man.xsl $<
284 284
 
285 285
 man: $(MOD_NAME).7
286
-
287 286
 else
288
-
289 287
 man:
290
-
288
+	@echo "info - no docbook to man tool to convert $(MOD_NAME).xml"
289
+endif
290
+else
291
+man:
291 292
 endif
292 293
 
293 294
 
... ...
@@ -43,8 +43,8 @@ sh_err_fail=
43 43
 try_err=$(1) ; if [ $$? != 0 ]; then echo ERROR: $(1) failed ; fi
44 44
 endif
45 45
 
46
-DOCBOOK = $(shell which docbook2x-man 2>/dev/null)
47
-ifeq ($(DOCBOOK),)
48
-	DOCBOOK = $(shell which db2x_docbook2man 2>/dev/null)
46
+DOCBOOKMAN = $(shell which docbook2x-man 2>/dev/null)
47
+ifeq ($(DOCBOOKMAN),)
48
+	DOCBOOKMAN = $(shell which db2x_docbook2man 2>/dev/null)
49 49
 endif
50 50
 
... ...
@@ -117,16 +117,17 @@ endif
117 117
 
118 118
 #man page build rules
119 119
 ifneq (,$(wildcard $(UTIL_NAME).xml))
120
-
120
+ifneq ($(DOCBOOKMAN),)
121 121
 $(UTIL_NAME).7: $(UTIL_NAME).xml
122
-	$(DOCBOOK) -s ../../doc/stylesheets/serdoc2man.xsl $<
122
+	$(DOCBOOKMAN) -s ../../doc/stylesheets/serdoc2man.xsl $<
123 123
 
124 124
 man: $(UTIL_NAME).7
125
-
126 125
 else
127
-
128 126
 man:
129
-
127
+	@echo "info - no docbook to man tool to convert $(UTIL_NAME).xml"
128
+endif
129
+else
130
+man:
130 131
 endif
131 132
 
132 133
 $(man_prefix)/$(man_dir)/man8: