-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
32 lines (26 loc) · 940 Bytes
/
Makefile
File metadata and controls
32 lines (26 loc) · 940 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# see also https://stackoverflow.com/a/18137056
export PYTHONPATH:=$(shell pwd)..:$(PYTHONPATH)
# Print help
HELP_FUN = \
%help; while(<>){push@{$$help{$$2//'options'}},[$$1,$$3] \
if/^([\w-_]+)\s*:.*\#\#(?:@(\w+))?\s(.*)$$/}; \
print"$$_:\n", map" $$_->[0]".(" "x(20-length($$_->[0])))."$$_->[1]\n",\
@{$$help{$$_}},"\n" for keys %help; \
# parse additional args for commands
args := $(wordlist 2, 100, $(MAKECMDGOALS))
ifndef args
MESSAGE = "No such command (or you pass two or many targets to ). List of possible commands: make help"
else
MESSAGE = "Done"
endif
# Commands
help: ##@Help Show this help
@echo -e "Usage: make [target] ...\n"
@perl -e '$(HELP_FUN)' $(MAKEFILE_LIST)
fmt: ##@Code Check code and format code, with ruff settings --fix
poetry run python3 -m ruff format
poetry run python3 -m ruff check --fix
clean: ##@Code Clean directory from garbage files
rm -fr *.egg-info dist
%::
echo $(MESSAGE)