1 include ../../../scripts/Makefile.include
2 include ../../../scripts/utilities.mak
6 RMDIR ?= rmdir --ignore-fail-on-non-empty
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))
29 RST2MAN_DEP := $(shell command -v rst2man 2>/dev/null)
33 $(error "rst2man not found, but required to generate man pages")
35 $(QUIET_GEN)rst2man $< > $@
38 $(call QUIET_CLEAN, Documentation)
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