doc: Replace recursive Makefile with inclusion

Always rebuild the documentation directory. The speed benefit is not
worth the added complexity.
This commit is contained in:
Nicolas Boulenguez 2022-09-01 23:29:53 +02:00 committed by Adrian-Ken Rueegsegger
parent 59885a1268
commit 7660bd3e11
3 changed files with 23 additions and 29 deletions

View File

@ -77,7 +77,6 @@ clean:
@rm -rf $(OBJECTDIR)
@rm -rf $(LIBDIR)
@rm -rf $(COVDIR)
$(MAKE) -C doc clean
dist:
@echo "Creating release tarball $(TARBALL) ... "
@ -125,7 +124,6 @@ prof:
--callgrind-out-file=$(OBJECTDIR)/callgrind.out.%p $(OBJECTDIR)/profiler
callgrind_annotate $(OBJECTDIR)/callgrind.* > $(OBJECTDIR)/profile.txt
doc:
$(MAKE) -C doc
.PHONY: cov
.PHONY: cov doc
include doc/doc.mk

View File

@ -1,25 +0,0 @@
DESTDIR ?= html
all: $(DESTDIR)/index.html
$(DESTDIR)/alog-arch.svg: arch/alog-arch.svg
scour -i $< -o $@ \
--enable-comment-stripping \
--enable-id-stripping \
--enable-viewboxing \
--indent=none \
--shorten-ids
$(DESTDIR)/index.html: $(DESTDIR)/fonts
$(DESTDIR)/index.html: $(DESTDIR)/alog-arch.svg
$(DESTDIR)/index.html: index ../README css/styles.css | $(DESTDIR)
asciidoctor $< -o $@
$(DESTDIR)/fonts: fonts | $(DESTDIR)
cp -R $< $@
$(DESTDIR):
mkdir -p $@
clean:
rm -rf $(DESTDIR)

21
doc/doc.mk Normal file
View File

@ -0,0 +1,21 @@
# Makefile snippet intended for inclusion by ../Makefile.
build-doc:
rm -fr doc/html
mkdir doc/html
scour -i doc/arch/alog-arch.svg \
-o doc/html/alog-arch.svg \
--enable-comment-stripping \
--enable-id-stripping \
--enable-viewboxing \
--indent=none \
--shorten-ids
cp -a --reflink=auto doc/fonts doc/html
asciidoctor doc/index -o doc/html/index.html
clean: clean-doc
clean-doc:
rm -fr doc/html