Generate HTML versions of the documentation as well.

This commit is contained in:
David Given 2022-02-05 20:50:49 +01:00
parent 00cb4144f2
commit f7de764a86

View file

@ -29,6 +29,7 @@ DOCS = \
OBJS = $(patsubst %.c, $(OBJDIR)/%.o, $(SRCS)) OBJS = $(patsubst %.c, $(OBJDIR)/%.o, $(SRCS))
DEPS = $(patsubst %.c, $(OBJDIR)/%.d, $(SRCS)) DEPS = $(patsubst %.c, $(OBJDIR)/%.d, $(SRCS))
PDFS = $(patsubst doc/%.n, $(OBJDIR)/%.pdf, $(DOCS)) PDFS = $(patsubst doc/%.n, $(OBJDIR)/%.pdf, $(DOCS))
HTMLS = $(patsubst doc/%.n, $(OBJDIR)/%/index.html, $(DOCS))
all: LLgen doc all: LLgen doc
@ -41,14 +42,18 @@ $(OBJDIR)/%.o: %.c
$(OBJDIR)/%.pdf: doc/%.n doc/LLgen.refs $(OBJDIR)/%.pdf: doc/%.n doc/LLgen.refs
@mkdir -p $(dir $@) @mkdir -p $(dir $@)
groff -R -G -e -g -p -ms -Tpdf $< > $@ refer $< | groff -G -e -g -p -ms -Tpdf $< > $@
doc:: $(PDFS) $(OBJDIR)/%/index.html: doc/%.n doc/LLgen.refs
@mkdir -p $(dir $@)
refer $< | (cd $(dir $@) && groff -I$(PWD) -G -e -g -p -ms -Thtml) > $@
doc:: $(PDFS) $(HTMLS)
clean: clean:
rm -rf $(OBJDIR) rm -rf $(OBJDIR)
install: LLgen doc/LLgen.1 $(PDFS) $(wildcard lib/*) install: LLgen doc/LLgen.1 $(PDFS) $(HTMLS) $(wildcard lib/*)
install -D -s LLgen -t $(PREFIX)/bin install -D -s LLgen -t $(PREFIX)/bin
install -D doc/LLgen.1 -t $(PREFIX)/man/man1 install -D doc/LLgen.1 -t $(PREFIX)/man/man1
install -D $(OBJDIR)/LLgen.pdf -t $(PREFIX)/doc/LLgen install -D $(OBJDIR)/LLgen.pdf -t $(PREFIX)/doc/LLgen