@@ -53,6 +53,35 @@ all: $(VENV)/bin/sphinx-build $(VENV)/bin/blurb clone ## Automatically build an
53
53
for file in * .po * /* .po; do ln -f $$ file $( LC_MESSAGES) /$$ file; done
54
54
. $(VENV ) /bin/activate; $(MAKE ) -C $(CPYTHON_CLONE ) /Doc/ SPHINXOPTS=' -j$(JOBS) -D locale_dirs=locales -D language=$(LANGUAGE) -D gettext_compact=0' $(MODE )
55
55
56
+ .PHONY : build
57
+ build : $(VENV ) /bin/sphinx-build $(VENV ) /bin/blurb clone # # Automatically build an html local version
58
+ @$(eval target=$(filter-out $@ ,$(MAKECMDGOALS ) ) )
59
+ @if [ -z $( target) ]; then \
60
+ echo " \x1B[1;31m" " Please provide a file argument." " \x1B[m" ; \
61
+ exit 1; \
62
+ fi
63
+ @if [ " $( suffix $( target) ) " != " .po" ]; then \
64
+ echo " \x1B[1;31m" " Incorrect file extension. Only '.po' files are allowed." " \x1B[m" ; \
65
+ exit 1; \
66
+ fi
67
+ @if [[ ! -f " $( target) " ]] ; then \
68
+ echo " \x1B[1;31m" " ERROR: $( target) not exist." " \x1B[m" ; \
69
+ exit 1; \
70
+ fi
71
+ @mkdir -p $(LC_MESSAGES )
72
+ @$(eval dir=`echo $(target ) | xargs -n1 dirname`) # # Get dir
73
+ # If the build target is in under directory
74
+ # We should make direcotry in $(LC_MESSAGES) and link the file.
75
+ @if [ $(dir) != "." ]; then \
76
+ echo "mkdir -p $(LC_MESSAGES)/$(dir)"; \
77
+ mkdir -p $(LC_MESSAGES)/$(dir); \
78
+ echo "ln -f ./$(target) $(LC_MESSAGES)/$(target)"; \
79
+ ln -f ./$(target) $(LC_MESSAGES)/$(target); \
80
+ fi
81
+ # Build
82
+ @echo "----"
83
+ @. $(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
84
+
56
85
help :
57
86
@python3 -c " $$ PRINT_HELP_PYSCRIPT" < $(MAKEFILE_LIST )
58
87
@@ -133,3 +162,7 @@ rm_cpython: ## Remove cloned cpython repo
133
162
.PHONY : lint
134
163
lint : $(VENV ) /bin/sphinx-lint # # Run sphinx-lint
135
164
$(VENV ) /bin/sphinx-lint --enable default-role
165
+
166
+ # This allows us to accept extra arguments (by doing nothing when we get a job that doesn't match, rather than throwing an error)
167
+ % :
168
+ @:
0 commit comments