summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrett Holman <bholman.devel@gmail.com>2021-10-11 22:23:51 -0600
committerKent Overstreet <kent.overstreet@gmail.com>2021-10-12 00:37:02 -0400
commit08420d2481ffe711b91a943c5b475116a4eef278 (patch)
tree15bf3487bef4297820cdd6773de6115cc0b0933d
parent60a6b2882ebdfca8930b6c7f130f12feb1938520 (diff)
Fix errors related to rst2man warning message:
- Warning message doesn't print and causes build to exit. - .SHELLSTATUS doesn't work on some versions of Make. Signed-off-by: Brett Holman <bholman.devel@gmail.com>
-rw-r--r--Makefile18
1 files changed, 8 insertions, 10 deletions
diff --git a/Makefile b/Makefile
index 5917a4c2..9ee1ff00 100644
--- a/Makefile
+++ b/Makefile
@@ -61,22 +61,16 @@ else
INITRAMFS_DIR=/etc/initramfs-tools
endif
-var := $(shell rst2man -V 2>/dev/null)
-ifeq ($(.SHELLSTATUS),0)
+STATUS:=$(shell rst2man -V 2>/dev/null; echo $$?)
+ifeq ($(STATUS),0)
RST2MAN=rst2man
endif
-var := $(shell rst2man.py -V 2>/dev/null)
-ifeq ($(.SHELLSTATUS),0)
+STATUS:=$(shell rst2man.py -V 2>/dev/null; echo $$?)
+ifeq ($(STATUS),0)
RST2MAN=rst2man.py
endif
-undefine var
-
-ifeq (,$(RST2MAN))
- @echo "WARNING: no RST2MAN found!"
-endif
-
.PHONY: all
all: bcachefs bcachefs.5
@@ -98,9 +92,13 @@ DOCSRC := opts_macro.h bcachefs.5.rst.tmpl
DOCGENERATED := bcachefs.5 doc/bcachefs.5.rst
DOCDEPS := $(addprefix ./doc/,$(DOCSRC))
bcachefs.5: $(DOCDEPS) libbcachefs/opts.h
+ifneq (,$(RST2MAN))
$(CC) doc/opts_macro.h -I libbcachefs -I include -E 2>/dev/null \
| doc/macro2rst.py
$(RST2MAN) doc/bcachefs.5.rst bcachefs.5
+else
+ @echo "WARNING: no rst2man found! Man page not generated."
+endif
SRCS=$(shell find . -type f -iname '*.c')
DEPS=$(SRCS:.c=.d)