1+ # Override SRC BEFORE including common.am so it points to cloned repo
2+ ifeq ($(DOC_LANG ) ,JA)
3+ SRC = wolfhsm/docs/src-ja
4+ else
5+ SRC = wolfhsm/docs/src
6+ endif
7+
18-include ../common/common.am
29.DEFAULT_GOAL := all
310
@@ -38,14 +45,34 @@ api: wolfhsm-update
3845 $(Q ) cd ..
3946 $(Q ) doxybook2 --input docs/xml --output api/md --config doxybook.cfg
4047
48+ # Override html-setup to ensure wolfhsm repo is cloned first
49+ .PHONY : html-setup
50+ html-setup : wolfhsm-update
51+ $(Q ) git submodule update --init
52+ -cd ../mkdocs-material; patch -p1 < $(PATCH ) --ignore-whitespace -N
53+ $(Q ) cp -a $(SRC ) /* build/html/
54+ $(Q ) cp ../common/* .png build/html/
55+ $(Q ) cp ../common/* .css build/html/
56+ $(Q ) perl -i -pe ' s/ ```/```/g' build/html/* .md
57+ $(Q ) perl -i -pe " s/\#--/\#-/g" build/html/* .md
58+ $(Q ) mv build/html/$(word 1,$(SOURCES ) ) build/html/index.md
59+
60+ # Override pdf-setup to ensure wolfhsm repo is cloned first
61+ .PHONY : pdf-setup
62+ pdf-setup : wolfhsm-update builddir
63+ $(Q ) cp -a $(SRC ) /* build/pdf/
64+ $(Q ) cp ../common/* .png build/pdf/
65+ $(Q ) perl -i -pe " s/chapter[0-9][0-9].md|appendix[0-9][0-9].md//g" build/pdf/* .md
66+ $(Q ) perl -i -pe " s/\#--/\#/g" build/pdf/* .md
67+
4168# Need an index.md, so let's make it chapter01.
4269# Perl regex to fix two things:
4370# 1. Doxybook2 replaces underscores with dashes in anchor tags (which breaks them)
4471# 2. Remove leading slash on links so that mkdocs can parse them
4572# 3. Fix the titles of the header files markdown
4673.PHONY : html-prep
4774html-prep : api
48- $(Q ) cp src /* .png build/html/
75+ $(Q ) cp $( SRC ) /* .png build/html/
4976 $(Q ) cp -a api/md/* 8h* build/html/
5077
5178 $(Q)perl -i -pe "s/\/group_/group_/g" build/html/group* build/html/*8h*
@@ -61,7 +88,7 @@ html-prep: api
6188# 6. Two regexes to handle bad Doxygen that didn't convert and the LaTeX processor thinks is LaTeX commands
6289.PHONY : pdf-prep
6390pdf-prep : api
64- $(Q ) cp src /* .png build/pdf/
91+ $(Q ) cp $( SRC ) /* .png build/pdf/
6592 $(Q ) cp -a api/md/* 8h* build/pdf/
6693
6794 $(Q)perl -i -pe "s/# /## /g" build/pdf/*.md
0 commit comments