build: improve make man
This improves `make man` in the following ways:
* The recently added `osbuild-manifest.5` man-page is now generated
as well.
* The target now honors `SRCDIR` and `BUILDDIR` variables.
* Any newly added man-page is now automatically picked up and
generated as well.
* The output directory structure now mirrors the input directory
structure.
This commit is contained in:
parent
d5b990bac0
commit
bc88508487
1 changed files with 9 additions and 2 deletions
11
Makefile
11
Makefile
|
|
@ -17,6 +17,8 @@
|
|||
BUILDDIR ?= .
|
||||
SRCDIR ?= .
|
||||
|
||||
RST2MAN ?= rst2man
|
||||
|
||||
#
|
||||
# Automatic Variables
|
||||
#
|
||||
|
|
@ -88,9 +90,14 @@ $(BUILDDIR)/%/:
|
|||
# deployments to our website, as well as package manager scripts.
|
||||
#
|
||||
|
||||
MANPAGES_RST = $(wildcard $(SRCDIR)/docs/*.[0123456789].rst)
|
||||
MANPAGES_TROFF = $(patsubst $(SRCDIR)/%.rst,$(BUILDDIR)/%,$(MANPAGES_RST))
|
||||
|
||||
$(MANPAGES_TROFF): $(BUILDDIR)/docs/%: $(SRCDIR)/docs/%.rst | $(BUILDDIR)/docs/
|
||||
$(RST2MAN) "$<" "$@"
|
||||
|
||||
.PHONY: man
|
||||
man:
|
||||
rst2man docs/osbuild.1.rst osbuild.1
|
||||
man: $(MANPAGES_TROFF)
|
||||
|
||||
#
|
||||
# Building packages
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue