aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Makefile19
-rw-r--r--docs/conf.py17
-rw-r--r--docs/sds.rst8
3 files changed, 42 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index ef08973..2582aa9 100644
--- a/Makefile
+++ b/Makefile
@@ -3,12 +3,27 @@ CC = clang
SOURCES = src/twbctf.c src/sds.c
HEADERS = src/twbctf.h src/sds.h
+MANPAGES = docs/sds.3
+
+all: sds-test $(MANPAGES)
-all: sds-test
sds-test: $(SOURCES) $(HEADERS) src/test.c
+ @echo "==> Building sds-test"
$(CC) $(CFLAGS) -o $@ $(SOURCES)
- @echo ">>> Type ./sds-test to run the sds.c unit tests."
+
+docs/%.3: docs/%.rst
+ @echo "==> Building manpages"
+ sphinx-build -b man -E docs/ docs/
+
+
+test: sds-test
+ ./sds-test
+
clean:
rm -f sds-test
+ rm docs/*.3
+
+
+.PHONY: all test
diff --git a/docs/conf.py b/docs/conf.py
new file mode 100644
index 0000000..8d79a11
--- /dev/null
+++ b/docs/conf.py
@@ -0,0 +1,17 @@
+#!/usr/bin/env python3
+# -*- coding: utf-8 -*-
+
+project = 'SDS'
+master_doc = 'sds'
+source_suffix = '.rst'
+
+show_authors = False
+today_fmt = '%d %b %Y'
+
+# One entry per manual page. List of tuples
+# (source start file, name, description, authors, manual section).
+man_pages = [
+ ('sds', 'sds', 'Simple Dynamic String library for C', [], 3),
+ ('sdsnew', 'sdsnew', 'Create a new SDS string', [], 3),
+ ('sdsfree', 'sdsfree', 'Free an SDS string', [], 3),
+]
diff --git a/docs/sds.rst b/docs/sds.rst
new file mode 100644
index 0000000..7dd17d0
--- /dev/null
+++ b/docs/sds.rst
@@ -0,0 +1,8 @@
+:orphan:
+
+sds
+===
+
+Functions
+---------
+