1
0
mirror of https://github.com/Tha14/toxic.git synced 2025-06-20 05:06:35 +02:00

Generate man pages from asciidoc

Working directly with g/roff is a pain.
Also changed the formatting of toxic.conf.5 a bit.

Signed-off-by: Loui Chang <louipc.ist@gmail.com>
This commit is contained in:
Loui Chang
2014-08-21 04:29:15 -04:00
parent c8b22d7e8a
commit 97d4c97c52
5 changed files with 290 additions and 7 deletions

View File

@ -4,12 +4,15 @@ VERSION = $(TOXIC_VERSION)_r$(REV)
BASE_DIR = $(shell cd .. && pwd -P)
CFG_DIR = $(BASE_DIR)/cfg
DOC_DIR = $(BASE_DIR)/doc
SRC_DIR = $(BASE_DIR)/src
PREFIX = /usr/local
BINDIR = $(PREFIX)/bin
DATADIR = $(PREFIX)/share/toxic
MANDIR = $(PREFIX)/share/man
MANFILES = toxic.1 toxic.conf.5
LIBS = libtoxcore ncursesw libconfig
CFLAGS = -std=gnu99 -pthread -Wall -g
@ -53,7 +56,7 @@ endif
-include $(CFG_DIR)/checks/check_features.mk
# Targets
all: toxic
all: toxic doc
toxic: $(OBJ)
@echo " LD $@"
@ -64,8 +67,18 @@ toxic: $(OBJ)
@$(CC) $(CFLAGS) -o $*.o -c $(SRC_DIR)/$*.c
@$(CC) -MM $(CFLAGS) $(SRC_DIR)/$*.c > $*.d
doc: $(MANFILES)
%: $(DOC_DIR)/%.asc
@echo " Generating man page $@"
@a2x -f manpage -a revdate=$(shell git log -1 --date=short --format="%ad" $<) \
-a manmanual="toxic manual" -a mansource=toxic \
-a manversion=$(VERSION) -a datadir=$(DATADIR) $<
@mv $(DOC_DIR)/$@ .
clean:
rm -rf *.d *.o toxic
rm -rf $(MANFILES)
-include $(OBJ:.o=.d)