|
20 | 20 | sources := $(wildcard *.cc)
|
21 | 21 | objects := $(addprefix ., $(sources:.cc=$(suffix).o))
|
22 | 22 | deps := $(addprefix ., $(sources:.cc=$(suffix).d))
|
23 |
| -docs := ../doc/manpages/commands \ |
24 |
| - ../doc/manpages/execeval \ |
25 |
| - ../doc/manpages/expansions \ |
26 |
| - ../doc/manpages/faces \ |
27 |
| - ../doc/manpages/highlighters \ |
28 |
| - ../doc/manpages/hooks \ |
29 |
| - ../doc/manpages/options \ |
30 |
| - ../doc/manpages/registers \ |
31 |
| - ../doc/manpages/shortcuts |
32 |
| -mandocs := $(addsuffix .gz,$(docs)) |
| 23 | +docs := $(wildcard ../doc/manpages/*.asciidoc) |
| 24 | +mandocs := $(docs:.asciidoc=.gz) |
33 | 25 |
|
34 | 26 | PREFIX ?= /usr/local
|
35 | 27 | DESTDIR ?= # root dir
|
@@ -86,15 +78,12 @@ kak : $(objects)
|
86 | 78 | # Generate the editor's documentation pages
|
87 | 79 | # Since `a2x` won't generate man pages if some sections are missing (which we don't need),
|
88 | 80 | # we generate the pages, patch them and then compress them
|
89 |
| -$(mandocs): $(docs) |
90 |
| - @for f in $^; do \ |
91 |
| - pagename="$${f##*/}"; pagename="$${pagename%.*}"; \ |
92 |
| - $(A2X) -f manpage "$$f"; \ |
93 |
| - sed -i -r -e "s,^\.TH .+,.TH KAKOUNE 1 \"\" \"\" \"$${pagename^^}\"," \ |
94 |
| - -e "/^\.SH \"NAME\"/,+1d" "$${f}.1"; \ |
95 |
| - gzip -f "$${f}.1"; \ |
96 |
| - mv "$${f}.1.gz" "$${f/.1/}.gz"; \ |
97 |
| - done |
| 81 | +../doc/manpages/%.gz: ../doc/manpages/%.asciidoc |
| 82 | + $(A2X) -f manpage $< |
| 83 | + sed -i -r -e "s,^\.TH .+,.TH KAKOUNE 1 \"\" \"\" \"$(basename $(notdir $<))\"," \ |
| 84 | + -e "/^\.SH \"NAME\"/,+1d" $(@:.gz=.1) |
| 85 | + gzip -f $(@:.gz=.1) |
| 86 | + mv $(@:.gz=.1.gz) $@ |
98 | 87 |
|
99 | 88 | test:
|
100 | 89 | cd ../test && ./run
|
|
0 commit comments