Merge tag 'xtensa-20180225' of git://github.com/jcmvbkbc/linux-xtensa
[cris-mirror.git] / tools / bpf / bpftool / Documentation / Makefile
bloba9d47c1558bb104ad9c3b0ba913bec64ff32fc72
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 MAN8_RST = $(wildcard *.rst)
20 _DOC_MAN8 = $(patsubst %.rst,%.8,$(MAN8_RST))
21 DOC_MAN8 = $(addprefix $(OUTPUT),$(_DOC_MAN8))
23 man: man8
24 man8: $(DOC_MAN8)
26 RST2MAN_DEP := $(shell command -v rst2man 2>/dev/null)
28 $(OUTPUT)%.8: %.rst
29 ifndef RST2MAN_DEP
30 $(error "rst2man not found, but required to generate man pages")
31 endif
32 $(QUIET_GEN)rst2man $< > $@
34 clean:
35 $(call QUIET_CLEAN, Documentation)
36 $(Q)$(RM) $(DOC_MAN8)
38 install: man
39 $(call QUIET_INSTALL, Documentation-man)
40 $(Q)$(INSTALL) -d -m 755 $(DESTDIR)$(man8dir)
41 $(Q)$(INSTALL) -m 644 $(DOC_MAN8) $(DESTDIR)$(man8dir)
43 uninstall:
44 $(call QUIET_UNINST, Documentation-man)
45 $(Q)$(RM) $(addprefix $(DESTDIR)$(man8dir)/,$(_DOC_MAN8))
46 $(Q)$(RMDIR) $(DESTDIR)$(man8dir)
48 .PHONY: man man8 clean install uninstall
49 .DEFAULT_GOAL := man