1- DICTIONARIES : = codespell_lib/data/dictionary*.txt codespell_lib/tests/data/*.wordlist
1+ DICTIONARIES = codespell_lib/data/dictionary*.txt codespell_lib/tests/data/*.wordlist
22
33PHONY := all check check-dictionaries sort-dictionaries trim-dictionaries check-dist pytest pypi ruff clean
44
5- all : check-dictionaries codespell.1
5+ GENERATED := codespell_lib/data/dictionary_en_to_en-OX_AUTOGENERATED.txt
66
7- check : check-dictionaries check-dist pytest ruff
7+ all : $(GENERATED ) check-dictionaries codespell.1
8+
9+ check : $(GENERATED ) check-dictionaries check-dist pytest ruff
10+
11+ $(GENERATED ) : codespell_lib/data/dictionary_en-GB_to_en-US.txt ./tools/gen_OX.sh
12+ ./tools/gen_OX.sh codespell_lib/data/dictionary_en-GB_to_en-US.txt > codespell_lib/data/dictionary_en_to_en-OX_AUTOGENERATED.txt
813
914codespell.1 : codespell.1.include Makefile
1015 PYTHONPATH=. help2man codespell --include codespell.1.include --no-info --output codespell.1
1116 sed -i ' /\.SS \"Usage/,+2d' codespell.1
1217
13- check-dictionaries :
18+ check-dictionaries : sort-dictionaries
1419 @for dictionary in ${DICTIONARIES} ; do \
1520 if grep -E -n " ^\s*$$ |\s$$ |^\s" $$ dictionary; then \
1621 echo " Dictionary $$ dictionary contains leading/trailing whitespace and/or blank lines. Trim with 'make trim-dictionaries'" ; \
@@ -24,10 +29,10 @@ check-dictionaries:
2429 exit 1; \
2530 fi
2631
27- sort-dictionaries :
32+ sort-dictionaries : $( GENERATED )
2833 pre-commit run --all-files file-contents-sorter
2934
30- trim-dictionaries :
35+ trim-dictionaries : $( GENERATED )
3136 @for dictionary in ${DICTIONARIES} ; do \
3237 sed -E -i.bak -e ' s/^[[:space:]]+//; s/[[:space:]]+$$//; /^$$/d' $$ dictionary && rm $$ dictionary.bak; \
3338 done
@@ -41,7 +46,7 @@ check-dist:
4146ruff :
4247 pre-commit run --all-files ruff-check
4348
44- pytest :
49+ pytest : sort-dictionaries
4550 @if command -v pytest > /dev/null; then \
4651 pytest codespell_lib; \
4752 else \
0 commit comments