Skip to content

Commit 43e2dd6

Browse files
committed
Updated to makefile for new wolfHSM/docs dir
1 parent f8866d6 commit 43e2dd6

File tree

1 file changed

+29
-2
lines changed

1 file changed

+29
-2
lines changed

wolfHSM/Makefile

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
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
4774
html-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
6390
pdf-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

Comments
 (0)