11-include ../common/common.am
22
3- # Override SRC AFTER including common.am so it points to cloned repo
3+ # Override SRC to point to cloned wolfHSM repo's docs directory.
4+ # Use new location (wolfhsm/docs/src) if it exists, otherwise fallback to local
5+ # src/ for backwards compatibility during transition period.
46ifeq ($(DOC_LANG ) ,JA)
5- SRC = wolfhsm/docs/src-ja
7+ SRC_NEW = wolfhsm/docs/src-ja
8+ SRC_OLD = src-ja
69else
7- SRC = wolfhsm/docs/src
10+ SRC_NEW = wolfhsm/docs/src
11+ SRC_OLD = src
812endif
13+ SRC = $(shell if [ -d "$(SRC_NEW ) " ]; then echo "$(SRC_NEW ) "; else echo "$(SRC_OLD ) "; fi)
14+
915.DEFAULT_GOAL := all
1016
1117all : pdf html
@@ -36,7 +42,11 @@ wolfhsm:
3642
3743.PHONY : wolfhsm-update
3844wolfhsm-update : wolfhsm
39- -$(Q ) cd wolfhsm && git pull --ff-only
45+ $(Q ) if [ -L wolfhsm ]; then \
46+ echo " Skipping git pull for symlink (local testing)" ; \
47+ else \
48+ cd wolfhsm && git pull --ff-only; \
49+ fi
4050
4151.PHONY : api
4252api : wolfhsm-update
@@ -45,6 +55,11 @@ api: wolfhsm-update
4555 $(Q ) cd ..
4656 $(Q ) doxybook2 --input docs/xml --output api/md --config doxybook.cfg
4757
58+ # NOTE: html-setup and pdf-setup are overridden from common/common.am to inject
59+ # the wolfhsm-update dependency. If common.am changes these targets, the changes
60+ # will need to be manually synchronized here. This duplication is intentional to
61+ # ensure the wolfHSM repo is cloned before attempting to copy docs from it.
62+
4863# Override html-setup to ensure wolfhsm repo is cloned first
4964.PHONY : html-setup
5065html-setup : wolfhsm-update
@@ -72,7 +87,6 @@ pdf-setup: wolfhsm-update builddir
7287# 3. Fix the titles of the header files markdown
7388.PHONY : html-prep
7489html-prep : api
75- $(Q ) cp $(SRC ) /* .png build/html/
7690 $(Q ) cp -a api/md/* 8h* build/html/
7791
7892 $(Q)perl -i -pe "s/\/group_/group_/g" build/html/group* build/html/*8h*
@@ -88,7 +102,6 @@ html-prep: api
88102# 6. Two regexes to handle bad Doxygen that didn't convert and the LaTeX processor thinks is LaTeX commands
89103.PHONY : pdf-prep
90104pdf-prep : api
91- $(Q ) cp $(SRC ) /* .png build/pdf/
92105 $(Q ) cp -a api/md/* 8h* build/pdf/
93106
94107 $(Q)perl -i -pe "s/# /## /g" build/pdf/*.md
0 commit comments