forked from ucb-bar/chisel2-deprecated
-
Notifications
You must be signed in to change notification settings - Fork 0
/
man.mk
19 lines (14 loc) · 639 Bytes
/
man.mk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# make fragment to build man pages.
LATEX2MAN := latex2man
MAN_PAGES := chisel.man
# Set the current release info
# RELEASE_TAGTEXT is something like: v2.2.18 125 g3501d7f
# i.e., the output of git describe with dashes replaced by spaces
RELEASE_TAGTEXT=$(subst -, ,$(shell git describe --tags release))
RELEASE_TAG=$(firstword $(RELEASE_TAGTEXT))
RELEASE_DATETEXT=$(shell git log -1 --format="%ai" $(RELEASE_TAG))
RELEASE_DATE=$(firstword $(RELEASE_DATETEXT))
all: $(MAN_PAGES)
%.man: %.mtt
sed -e "s/@VERSION@/$(RELEASE_TAG)/" -e "s/@DATE@/$(RELEASE_DATE)/" $(notdir $<) > $(basename $@).ttex ;\
latex2man $(basename $@).ttex $@