Makefile 866 B

12345678910111213141516171819202122232425262728293031
  1. .PHONY: help virtual-environment update-venv
  2. .DEFAULT_GOAL := help
  3. define PRINT_HELP_PYSCRIPT
  4. import re, sys
  5. for line in sys.stdin:
  6. match = re.match(r'^([a-zA-Z_-]+):.*?## (.*)$$', line)
  7. if match:
  8. target, help = match.groups()
  9. print("%-20s %s" % (target, help))
  10. endef
  11. export PRINT_HELP_PYSCRIPT
  12. help:
  13. @python -c "$$PRINT_HELP_PYSCRIPT" < $(MAKEFILE_LIST)
  14. virtual-environment: venv ## setup a virtual environment for development
  15. venv: requirements.txt ## setup a virtual environment for development
  16. [ -d venv ] || python3 -m venv venv
  17. venv/bin/python -m pip install -r requirements.txt
  18. touch venv
  19. update-venv: ## update the development virtual environment
  20. [ -d venv ] || python3 -m venv venv
  21. venv/bin/python -m pip install --upgrade -r requirements.txt
  22. touch venv
  23. download: venv download.py ## download all the data
  24. venv/bin/python download.py