Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade Makefile, it can build single html now #643

Merged
merged 5 commits into from
Apr 13, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,26 @@ all: $(VENV)/bin/sphinx-build $(VENV)/bin/blurb clone ## Automatically build an
for file in *.po */*.po; do ln -f $$file $(LC_MESSAGES)/$$file; done
. $(VENV)/bin/activate; $(MAKE) -C $(CPYTHON_CLONE)/Doc/ SPHINXOPTS='-j$(JOBS) -D locale_dirs=locales -D language=$(LANGUAGE) -D gettext_compact=0' $(MODE)

.PHONY: build
build/%: $(VENV)/bin/sphinx-build $(VENV)/bin/blurb clone ## Automatically build an html local version
@if [ ! -f "$*.po" ] ; then \
echo "\x1B[1;31m""ERROR: $*.po not exist""\x1B[m"; exit 1; \
exit 1; \
mattwang44 marked this conversation as resolved.
Show resolved Hide resolved
fi
@mkdir -p $(LC_MESSAGES)
@$(eval dir=`echo $* | xargs -n1 dirname`) ## Get dir
# If the build target is in under directory
# We should make direcotry in $(LC_MESSAGES) and link the file.
@if [ $(dir) != "." ]; then \
echo "mkdir -p $(LC_MESSAGES)/$(dir)"; \
mkdir -p $(LC_MESSAGES)/$(dir); \
echo "ln -f ./$*.po $(LC_MESSAGES)/$*.po"; \
ln -f ./$*.po $(LC_MESSAGES)/$*.po; \
fi
mattwang44 marked this conversation as resolved.
Show resolved Hide resolved
# Build
@echo "----"
@. $(VENV)/bin/activate; $(MAKE) -C $(CPYTHON_CLONE)/Doc/ SPHINXOPTS='-j$(JOBS) -D language=$(LANGUAGE) -D locale_dirs=locales -D gettext_compact=0' SOURCES='$*.rst' html

help:
@python3 -c "$$PRINT_HELP_PYSCRIPT" < $(MAKEFILE_LIST)

Expand Down