]>
Commit | Line | Data |
---|---|---|
ff69c21a JK |
1 | include ../../../scripts/Makefile.include |
2 | include ../../../scripts/utilities.mak | |
3 | ||
4 | INSTALL ?= install | |
5 | RM ?= rm -f | |
6 | ||
7 | # Make the path relative to DESTDIR, not prefix | |
8 | ifndef DESTDIR | |
507e590d | 9 | prefix ?= /usr/local |
ff69c21a JK |
10 | endif |
11 | mandir ?= $(prefix)/share/man | |
12 | man8dir = $(mandir)/man8 | |
13 | ||
14 | MAN8_RST = $(wildcard *.rst) | |
15 | ||
16 | _DOC_MAN8 = $(patsubst %.rst,%.8,$(MAN8_RST)) | |
17 | DOC_MAN8 = $(addprefix $(OUTPUT),$(_DOC_MAN8)) | |
18 | ||
19 | man: man8 | |
20 | man8: $(DOC_MAN8) | |
21 | ||
22 | $(OUTPUT)%.8: %.rst | |
23 | rst2man $< > $@ | |
24 | ||
25 | clean: | |
26 | $(call QUIET_CLEAN, Documentation) $(RM) $(DOC_MAN8) | |
27 | ||
28 | install: man | |
29 | $(call QUIET_INSTALL, Documentation-man) \ | |
30 | $(INSTALL) -d -m 755 $(DESTDIR)$(man8dir); \ | |
31 | $(INSTALL) -m 644 $(DOC_MAN8) $(DESTDIR)$(man8dir); | |
32 | ||
33 | .PHONY: man man8 clean install | |
34 | .DEFAULT_GOAL := man |