Skip to content

Commit 9242682

Browse files
qmonnetborkmann
authored andcommitted
tools: bpftool: exit doc Makefile early if rst2man is not available
If rst2man is not available on the system, running `make doc` from the bpftool directory fails with an error message. However, it creates empty manual pages (.8 files in this case). A subsequent call to `make doc-install` would then succeed and install those empty man pages on the system. To prevent this, raise a Makefile error and exit immediately if rst2man is not available before generating the pages from the rst documentation. Fixes: ff69c21 ("tools: bpftool: add documentation") Reported-by: Jason van Aaardt <[email protected]> Signed-off-by: Quentin Monnet <[email protected]> Reviewed-by: Jakub Kicinski <[email protected]> Signed-off-by: Daniel Borkmann <[email protected]>
1 parent 0badd33 commit 9242682

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

tools/bpf/bpftool/Documentation/Makefile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,12 @@ DOC_MAN8 = $(addprefix $(OUTPUT),$(_DOC_MAN8))
2323
man: man8
2424
man8: $(DOC_MAN8)
2525

26+
RST2MAN_DEP := $(shell command -v rst2man 2>/dev/null)
27+
2628
$(OUTPUT)%.8: %.rst
29+
ifndef RST2MAN_DEP
30+
$(error "rst2man not found, but required to generate man pages")
31+
endif
2732
$(QUIET_GEN)rst2man $< > $@
2833

2934
clean:

0 commit comments

Comments
 (0)