Cosmetic fix
[radcan.git] / GNUmakefile
blobd1f80e4913396494d1f0c62cdf58106575247626
1 # Just a quick makefile to help keeping the whole thing coherent and
2 # up to date (documentation, internal versionning).
4 # It needs:
6 # - GNU Make (obviously!)
7 # - GNU sed
8 # - Git and Cogito for tagging
9 # - POSIX compliant date util (tested on GNU coreutils)
10 # - help2man, to regenerate the man page
11 # - asciidoc and htmltidy, to refresh the html doc
12 # - links, to generate the text-only README
14 DOC=radcan.1 README index.html
15 DATE=$(shell env LC_ALL=fr_FR date +'%A, le %d %B %Y')
16 VER=$(shell cg tag-ls | sed '$$!d;s/\([0-9\.]*\).*/\1/')
17 OLD=$(shell cat .version 2> /dev/null)
19 all: tag $(DOC)
21 radcan.1: radcan radcan.py radcan.inc
22 help2man --include radcan.inc --no-info ./$< > $@
24 README: index.html
25 links -html-numbered-links 1 -dump $< > $@
27 index.html: readme.txt
28 asciidoc -a revision="$(VER)" -a localdate="$(DATE)" \
29 --unsafe \
30 -a stylesdir=/etc/asciidoc/stylesheets \
31 -f asciidoc.conf -o $@ $<
32 -tidy --input-encoding utf8 --output-encoding ascii \
33 -m -i $@
35 .PHONY: clean tag
37 clean:
38 -rm -f *.pyc *~
39 -rm -f $(DOC)
41 # Versionning support: call with `make VER=xxx' to force upgrade.
43 .version:
44 @touch .version
46 setup.py radcan.py index.html: .version
48 tag: .version
49 ifneq ($(VER),$(OLD))
50 sed -i "s/^\(__version__ = \).*/\1 '$(VER)'/" radcan.py
51 sed -i "s/\(version=\).*/\1'$(VER)',/" setup.py
52 @echo $(VER) > .version
53 endif