Linux 5.1.15
[linux/fpc-iii.git] / tools / bpf / bpftool / Documentation / Makefile
blobf7663a3e60c91605d10eb301d044def46bdaa6e7
1 include ../../../scripts/Makefile.include
2 include ../../../scripts/utilities.mak
4 INSTALL ?= install
5 RM ?= rm -f
6 RMDIR ?= rmdir --ignore-fail-on-non-empty
8 ifeq ($(V),1)
9 Q =
10 else
11 Q = @
12 endif
14 prefix ?= /usr/local
15 mandir ?= $(prefix)/man
16 man8dir = $(mandir)/man8
18 # Load targets for building eBPF helpers man page.
19 include ../../Makefile.helpers
21 MAN8_RST = $(filter-out $(HELPERS_RST),$(wildcard *.rst))
23 _DOC_MAN8 = $(patsubst %.rst,%.8,$(MAN8_RST))
24 DOC_MAN8 = $(addprefix $(OUTPUT),$(_DOC_MAN8))
26 man: man8 helpers
27 man8: $(DOC_MAN8)
29 RST2MAN_DEP := $(shell command -v rst2man 2>/dev/null)
31 $(OUTPUT)%.8: %.rst
32 ifndef RST2MAN_DEP
33 $(error "rst2man not found, but required to generate man pages")
34 endif
35 $(QUIET_GEN)rst2man $< > $@
37 clean: helpers-clean
38 $(call QUIET_CLEAN, Documentation)
39 $(Q)$(RM) $(DOC_MAN8)
41 install: man helpers-install
42 $(call QUIET_INSTALL, Documentation-man)
43 $(Q)$(INSTALL) -d -m 755 $(DESTDIR)$(man8dir)
44 $(Q)$(INSTALL) -m 644 $(DOC_MAN8) $(DESTDIR)$(man8dir)
46 uninstall: helpers-uninstall
47 $(call QUIET_UNINST, Documentation-man)
48 $(Q)$(RM) $(addprefix $(DESTDIR)$(man8dir)/,$(_DOC_MAN8))
49 $(Q)$(RMDIR) $(DESTDIR)$(man8dir)
51 .PHONY: man man8 clean install uninstall
52 .DEFAULT_GOAL := man