3
3
# Here is what you can do:
4
4
#
5
5
# - make all # Automatically build an html local version
6
- # - make build # To build a single .po file
6
+ # - make build<po-file> # To build a single .po file
7
7
# - make todo # To list remaining tasks
8
8
# - make merge # To merge pot from upstream
9
9
# - make fuzzy # To find fuzzy strings
@@ -37,7 +37,7 @@ print('\n'.join(output))
37
37
endef
38
38
export PRINT_HELP_PYSCRIPT # End of python section
39
39
40
- CPYTHON_CLONE := ../cpython/
40
+ CPYTHON_CLONE := ../cpython
41
41
SPHINX_CONF :=$(CPYTHON_CLONE ) /Doc/conf.py
42
42
LANGUAGE := zh_TW
43
43
LC_MESSAGES :=$(CPYTHON_CLONE ) /Doc/locales/$(LANGUAGE ) /LC_MESSAGES
@@ -55,7 +55,7 @@ all: $(VENV)/bin/sphinx-build $(VENV)/bin/blurb clone ## Automatically build an
55
55
. $(VENV ) /bin/activate; $(MAKE ) -C$(CPYTHON_CLONE ) /Doc/ SPHINXOPTS=' -j$(JOBS) -D locale_dirs=locales -D language=$(LANGUAGE) -D gettext_compact=0' $(MODE )
56
56
57
57
.PHONY : build
58
- build :$(VENV ) /bin/sphinx-build$(VENV ) /bin/blurb clone# # Automatically build an html local version
58
+ build :$(VENV ) /bin/sphinx-build$(VENV ) /bin/blurb clone# # Automatically build an html local version for a single file
59
59
@$(eval target=$(filter-out $@ ,$(MAKECMDGOALS ) ) )
60
60
@if [-z $( target) ]; then \
61
61
echo " \x1B[1;31m" " Please provide a file argument." " \x1B[m" ; \
@@ -69,19 +69,14 @@ build: $(VENV)/bin/sphinx-build $(VENV)/bin/blurb clone ## Automatically build a
69
69
echo " \x1B[1;31m" " ERROR:$( target) not exist." " \x1B[m" ; \
70
70
exit 1; \
71
71
fi
72
- @mkdir -p $( LC_MESSAGES )
72
+
73
73
@$(eval dir=`echo $(target) | xargs -n1 dirname`)# # Get dir
74
- # If the build target is in under directory
75
- # We should make direcotry in $(LC_MESSAGES).
76
- @if [ $(dir) != "." ]; then \
77
- echo "mkdir -p $(LC_MESSAGES)/$(dir)"; \
78
- mkdir -p $(LC_MESSAGES)/$(dir); \
79
- fi
74
+ @mkdir -p $(LC_MESSAGES)/$(dir)
80
75
@ln -f ./$(target) $(LC_MESSAGES)/$(target)
81
- # Build
82
- @echo "----"
76
+
83
77
@. $(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
78
79
+
85
80
help :
86
81
@python3 -c" $$ PRINT_HELP_PYSCRIPT" < $(MAKEFILE_LIST )
87
82