-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
43 lines (35 loc) · 992 Bytes
/
Makefile
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
33
34
35
36
37
38
39
40
41
42
43
SHELL := /bin/bash
MAKEFLAGS += --no-print-directory
.DEFAULT_GOAL := all
PRJ_ROOT := $(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
ENTRYPOINT := main.py
define banner
@echo -e "************************************************************\n"
@echo -e "\tPySleuth : $(1)\n"
@echo -e "************************************************************\n"
endef
all: run clean
.PHONY: run
.SILENT: run
run:
$(call banner, "🚀 Run")
source ${PRJ_ROOT}/venv/bin/activate && \
python ${ENTRYPOINT}
.PHONY: clean
.SILENT: clean
clean:
$(call banner, "🧹 Clean")
py3clean ${PRJ_ROOT}
.PHONY: update
.SILENT: update
update:
$(call banner, "Update")
source ${PRJ_ROOT}/venv/bin/activate && \
pip freeze -l > ${PRJ_ROOT}/requirements.txt
git add ${PRJ_ROOT}/requirements.txt
git commit -m "[update] requirements.txt"
.PHONY: format
.SILENT: format
format:
$(call banner, "✨ Format - AutoPEP8")
find pysleuth -type f -name "*.py" | xargs autopep8 --in-place