1BASE=ctwm.1
2
3HTML=${BASE}.html
4
5html: ${HTML}
6man: ${BASE}
7
8all: html man
9
10all_set_version: all
11	sed -i '' -e "s/@ctwm_version_str@/`head -1 ../../VERSION`/" ${HTML} ${BASE}
12
13clean:
14	rm -f ${BASE} ${HTML}
15
16
17# asciidoc vs asciidoctor notes:
18#
19# Note that asciidoctor has a slightly changed dialect, so there may be
20# minor differences in the output.  Also, the manpage generation requires
21# 1.5.3+.  At the moment, we're trying to work with both.  Current trends
22# suggest that at some point asciidoctor will be the de facto
23# asciidoc-world implementation, so we may drop the py-asciidoc at some
24# point.  For the moment, asciidoctor is treated as the standard
25# renderer, with asciidoc being a fallback we try to keep working well.
26
27
28# Generating HTML output by various means
29html-asciidoc: ${BASE}.adoc
30	asciidoc -atoc -anumbered -o ${BASE}.html ${BASE}.adoc
31
32html-asciidoctor: ${BASE}.adoc
33	asciidoctor -atoc -anumbered -o ${BASE}.html ${BASE}.adoc
34
35
36# Manpage output.  x-ref comment above about asciidoctor versions
37man-asciidoc-a2x: ${BASE}.adoc
38	a2x --doctype manpage --format manpage ${BASE}.adoc
39
40man-asciidoc-adoc: ${BASE}.adoc
41	asciidoc -b docbook -d manpage -o ${BASE}.xml ${BASE}.adoc
42	xmlto man ${BASE}.xml
43
44man-asciidoctor: ${BASE}.adoc
45	asciidoctor -b manpage -o ${BASE} ${BASE}.adoc
46
47
48
49# Set which are used by default.  Set to asciidoctor since it's massively
50# faster.
51${HTML}: ${BASE}.adoc
52	@${MAKE} html-asciidoctor
53
54${BASE}: ${BASE}.adoc
55	@${MAKE} man-asciidoctor
56
57