Skip to content

Commit

Permalink
tools: bpftool: exit doc Makefile early if rst2man is not available
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
qmonnet authored and borkmann committed Feb 8, 2018
1 parent 0badd33 commit 9242682
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tools/bpf/bpftool/Documentation/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,12 @@ DOC_MAN8 = $(addprefix $(OUTPUT),$(_DOC_MAN8))
man: man8
man8: $(DOC_MAN8)

RST2MAN_DEP := $(shell command -v rst2man 2>/dev/null)

$(OUTPUT)%.8: %.rst
ifndef RST2MAN_DEP
$(error "rst2man not found, but required to generate man pages")
endif
$(QUIET_GEN)rst2man $< > $@

clean:
Expand Down

0 comments on commit 9242682

Please sign in to comment.