Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Upgrade Makefile, it can build single html now#643

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
josix merged 5 commits intopython:3.12fromgriiid:feature/upgrade-makefile
Apr 13, 2024
Merged
Changes fromall commits
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
33 changes: 33 additions & 0 deletionsMakefile
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -53,6 +53,35 @@ 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
@$(eval target=$(filter-out $@,$(MAKECMDGOALS)))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

👍👍

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Somebody say this might be harmful since the variable is global, maybe I should use some special prefix on the variable name?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

yeah, how about naming this with underscore prefix

@if [ -z $(target) ]; then \
echo "\x1B[1;31m""Please provide a file argument.""\x1B[m"; \
exit 1; \
fi
@if [ "$(suffix $(target))" != ".po" ]; then \
echo "\x1B[1;31m""Incorrect file extension. Only '.po' files are allowed.""\x1B[m"; \
exit 1; \
fi
@if [[ ! -f "$(target)" ]] ; then \
echo "\x1B[1;31m""ERROR: $(target) not exist.""\x1B[m"; \
exit 1; \
fi
@mkdir -p $(LC_MESSAGES)
@$(eval dir=`echo $(target) | 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 ./$(target) $(LC_MESSAGES)/$(target)"; \
ln -f ./$(target) $(LC_MESSAGES)/$(target); \
fi
# 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='$(basename $(target)).rst' html

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

Expand DownExpand Up@@ -133,3 +162,7 @@ rm_cpython: ## Remove cloned cpython repo
.PHONY: lint
lint: $(VENV)/bin/sphinx-lint ## Run sphinx-lint
$(VENV)/bin/sphinx-lint --enable default-role

# This allows us to accept extra arguments (by doing nothing when we get a job that doesn't match, rather than throwing an error)
%:
@:
Loading

[8]ページ先頭

©2009-2025 Movatter.jp