treewide: remove redundant IS_ERR() before error code check
[linux/fpc-iii.git] / tools / bpf / bpftool / Documentation / Makefile
blob815ac9804aee921b1b3a0104c36fd91346f242f3
1 # SPDX-License-Identifier: GPL-2.0-only
2 include ../../../scripts/Makefile.include
3 include ../../../scripts/utilities.mak
5 INSTALL ?= install
6 RM ?= rm -f
7 RMDIR ?= rmdir --ignore-fail-on-non-empty
9 ifeq ($(V),1)
10 Q =
11 else
12 Q = @
13 endif
15 prefix ?= /usr/local
16 mandir ?= $(prefix)/man
17 man8dir = $(mandir)/man8
19 # Load targets for building eBPF helpers man page.
20 include ../../Makefile.helpers
22 MAN8_RST = $(filter-out $(HELPERS_RST),$(wildcard *.rst))
24 _DOC_MAN8 = $(patsubst %.rst,%.8,$(MAN8_RST))
25 DOC_MAN8 = $(addprefix $(OUTPUT),$(_DOC_MAN8))
27 man: man8 helpers
28 man8: $(DOC_MAN8)
30 RST2MAN_DEP := $(shell command -v rst2man 2>/dev/null)
32 $(OUTPUT)%.8: %.rst
33 ifndef RST2MAN_DEP
34 $(error "rst2man not found, but required to generate man pages")
35 endif
36 $(QUIET_GEN)rst2man $< > $@
38 clean: helpers-clean
39 $(call QUIET_CLEAN, Documentation)
40 $(Q)$(RM) $(DOC_MAN8)
42 install: man helpers-install
43 $(call QUIET_INSTALL, Documentation-man)
44 $(Q)$(INSTALL) -d -m 755 $(DESTDIR)$(man8dir)
45 $(Q)$(INSTALL) -m 644 $(DOC_MAN8) $(DESTDIR)$(man8dir)
47 uninstall: helpers-uninstall
48 $(call QUIET_UNINST, Documentation-man)
49 $(Q)$(RM) $(addprefix $(DESTDIR)$(man8dir)/,$(_DOC_MAN8))
50 $(Q)$(RMDIR) $(DESTDIR)$(man8dir)
52 .PHONY: man man8 clean install uninstall
53 .DEFAULT_GOAL := man