]> git.sesse.net Git - bcachefs-tools-debian/blobdiff - Makefile
Switched documentation from asciidoc to rst, added doc autogeneration code for options
[bcachefs-tools-debian] / Makefile
index 23cb6c0712095e97367f2280949c7db0ef75c40f..1fbe4c49c1ea66dc7b13fba7c1c0f7ef7c92b464 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -73,7 +73,7 @@ else
 endif
 
 .PHONY: all
-all: bcachefs
+all: bcachefs bcachefs.5
 
 .PHONY: tests
 tests: tests/test_helper
@@ -89,6 +89,13 @@ TAGS:
 tags:
        ctags -R .
 
+DOCSRC := gen.h bcachefs.5.rst
+DOCGENERATED := bcachefs.5 doc/autogen/gen.csv
+DOCDEPS := $(addprefix ./doc/autogen/,$(DOCSRC))
+bcachefs.5: $(DOCDEPS)  libbcachefs/opts.h
+       CC=$(CC) doc/autogen/gen.sh
+       rst2man doc/autogen/bcachefs.5.rst bcachefs.5
+
 SRCS=$(shell find . -type f -iname '*.c')
 DEPS=$(SRCS:.c=.d)
 -include $(DEPS)
@@ -118,9 +125,6 @@ endif
 # Rebuild the 'version' command any time the version string changes
 cmd_version.o : .version
 
-doc/bcachefs.5: doc/bcachefs.5.txt
-       a2x -f manpage doc/bcachefs.5.txt
-
 .PHONY: install
 install: INITRAMFS_HOOK=$(INITRAMFS_DIR)/hooks/bcachefs
 install: INITRAMFS_SCRIPT=$(INITRAMFS_DIR)/scripts/local-premount/bcachefs
@@ -137,7 +141,7 @@ install: bcachefs
 
 .PHONY: clean
 clean:
-       $(RM) bcachefs mount.bcachefs libbcachefs_mount.a tests/test_helper .version $(OBJS) $(DEPS)
+       $(RM) bcachefs mount.bcachefs libbcachefs_mount.a tests/test_helper .version $(OBJS) $(DEPS) $(DOCGENERATED)
        $(RM) -rf mount/target
 
 .PHONY: deb