backup-tool/Makefile

36 lines
694 B
Makefile
Raw Normal View History

2021-01-15 14:14:13 +01:00
# =====CONFIG=====
# Devop environment runs in 3.8
PYTHON=python3.8
# =====RECIPES=====
.venv/bin/activate: requirements.txt requirements-dev.txt
'$(PYTHON)' -m venv .venv
.venv/bin/pip install -r requirements.txt -r requirements-dev.txt
venv: .venv/bin/activate
2021-01-15 14:14:13 +01:00
.PHONY: venv
format: venv
@ .venv/bin/black app/*.py app/**/*.py
.PHONY: format
clean:
rm -rf .venv
rm backup_tool
.PHONY: clean
backup_tool:
@ cd app && \
zip -r ../app.zip * \
-x "__pycache__/*" "**/__pycache__/*" ".vim/*" "**/.vim/*"
@ echo "#!/usr/bin/env python3" | cat - app.zip > backup_tool
@ chmod a+x backup_tool
@ rm app.zip
app: backup_tool
.PHONY: app
install: app
cp backup_tool /usr/local/bin