Merge pull request #247 from davidgiven/llgen

Generate HTML versions of the LLgen documentation as well.
This commit is contained in:
David Given 2022-02-05 21:33:06 +01:00 committed by GitHub
commit 4e816eb81f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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