@@ -57,6 +57,7 @@ substitute = @sed \
5757 $(1 ) > $(2 ) \
5858 && echo "Substituted from '$(1 ) ' to '$(2 ) '."
5959
60+ .PHONY : all
6061all : install
6162
6263# $< - %.in file, $@ desired file %
@@ -66,15 +67,19 @@ all: install
6667% .py : % .tmp.py
6768 $(call substitute,$< ,$@ )
6869
70+ .PHONY : substitute-sources
6971substitute-sources : $(SOURCE_SUB_FILES )
7072 @echo " Substituted information about the utility in the source files."
7173
74+ .PHONY : substitute-debian
7275substitute-debian : $(DEBIAN_SUB_FILES )
7376 @echo " Substituted information about the utility in the debian files."
7477
78+ .PHONY : substitute-docker
7579substitute-docker : $(DOCKER_SUB_FILES )
7680 @echo " Substituted information about the utility in the docker files."
7781
82+ .PHONY : install
7883install : substitute-sources man translate-compile
7984 python3 -m pip install --root=$(DESTDIR ) / .
8085
@@ -104,6 +109,7 @@ install: substitute-sources man translate-compile
104109
105110 install -D -m 0644 man/$(UTIL_NAME).1 $(DESTDIR)/usr/share/man/man1/$(UTIL_NAME).1
106111
112+ .PHONY : man
107113man : substitute-sources
108114 mkdir -p man
109115 if [ ! -f man/$( UTIL_NAME) .1 ]; then \
@@ -115,6 +121,7 @@ man: substitute-sources
115121 --output man/$(UTIL_NAME ) .1; \
116122 fi
117123
124+ .PHONY : package
118125package : substitute-debian
119126 find $(DEBIAN_PACKAGES_PATH ) /$(UTIL_NAME ) * > /dev/null 2>&1 || ( \
120127 dpkg-buildpackage -jauto -b \
@@ -127,22 +134,27 @@ package: substitute-debian
127134 chown --recursive ${USER_UID} :${USER_GID} $(DEBIAN_PACKAGES_PATH ) \
128135 )
129136
137+ .PHONY : test
130138test : substitute-sources
131139 pytest test/unit test/misc --cov=src/ --cov-report xml --cov-report term
132140 make clean-cache
133141
142+ .PHONY : autotest
134143autotest :
135144 pytest test/auto
136145 make clean-cache
137146
147+ .PHONY : pre-commit
138148pre-commit :
139149 python3 -m pre_commit run --all-files
140150
151+ .PHONY : clean-cache
141152clean-cache :
142153 find . -maxdepth 1 -type d | grep -E " pytest_cache" | (xargs rm -r 2> /dev/null || exit 0)
143154 find " src/$( UTIL_NAME) /" -type f -name ' *.c' -exec rm --force ' {}' +
144155 rm --recursive --force $(shell find -type d -iname "__pycache__")
145156
157+ .PHONY : clean
146158clean : clean-cache
147159 rm --force --recursive man/
148160 rm --force --recursive build/
@@ -156,6 +168,7 @@ clean: clean-cache
156168 rm --force ${DEBIAN_PATH} /$(UTIL_NAME ) -util.substvars
157169 rm --force --recursive src/$(UTIL_NAME ) .egg-info
158170
171+ .PHONY : clean-all
159172clean-all : clean
160173 rm --force src/$(UTIL_NAME ) /consts.py
161174
@@ -165,18 +178,23 @@ clean-all: clean
165178 rm --force ${DEBIAN_PATH}/preinst
166179 rm --force ${DEBIAN_PATH}/copyright
167180
181+ .PHONY : uninstall
168182uninstall :
169183 rm --force $(DESTDIR ) /usr/share/man/man1/$(UTIL_NAME ) .1
170184 rm --force --recursive $(DESTDIR ) /$(LIB_PATH )
171185 pip3 uninstall $(UTIL_NAME ) -y
172186
187+ .PHONY : reinstall
173188reinstall : uninstall install
174189
190+ .PHONY : todo-list
175191todo-list : clean-all
176192 @grep --color=auto -r -n ' TODO' ./* --exclude=Makefile --exclude-dir=docs
177193
194+ .PHONY : help
178195help : general-help docker-help translate-help
179196
197+ .PHONY : general-help
180198general-help :
181199 @echo " Usage:"
182200 @echo " make [targets] [arguments]"
@@ -205,7 +223,6 @@ general-help:
205223
206224
207225.EXPORT_ALL_VARIABLES :
208- .PHONY : all test man
209226
210227include docker/docker.mk
211228include locales/i18n.mk
0 commit comments