1include ../../../scripts/Makefile.include 2include ../../../scripts/utilities.mak 3 4INSTALL ?= install 5RM ?= rm -f 6RMDIR ?= rmdir --ignore-fail-on-non-empty 7 8ifeq ($(V),1) 9 Q = 10else 11 Q = @ 12endif 13 14prefix ?= /usr/local 15mandir ?= $(prefix)/man 16man8dir = $(mandir)/man8 17 18MAN8_RST = $(wildcard *.rst) 19 20_DOC_MAN8 = $(patsubst %.rst,%.8,$(MAN8_RST)) 21DOC_MAN8 = $(addprefix $(OUTPUT),$(_DOC_MAN8)) 22 23man: man8 24man8: $(DOC_MAN8) 25 26$(OUTPUT)%.8: %.rst 27 $(QUIET_GEN)rst2man $< > $@ 28 29clean: 30 $(call QUIET_CLEAN, Documentation) 31 $(Q)$(RM) $(DOC_MAN8) 32 33install: man 34 $(call QUIET_INSTALL, Documentation-man) 35 $(Q)$(INSTALL) -d -m 755 $(DESTDIR)$(man8dir) 36 $(Q)$(INSTALL) -m 644 $(DOC_MAN8) $(DESTDIR)$(man8dir) 37 38uninstall: 39 $(call QUIET_UNINST, Documentation-man) 40 $(Q)$(RM) $(addprefix $(DESTDIR)$(man8dir)/,$(_DOC_MAN8)) 41 $(Q)$(RMDIR) $(DESTDIR)$(man8dir) 42 43.PHONY: man man8 clean install uninstall 44.DEFAULT_GOAL := man 45