2023-01-11 11:04:27 +01:00
|
|
|
.ONESHELL:
|
|
|
|
SHELL := bash
|
|
|
|
# https://github.com/JordanMartinez/purescript-cookbook/blob/master/makefile
|
|
|
|
# set -e = bash immediately exits if any command has a non-zero exit status.
|
|
|
|
# set -u = a reference to any shell variable you haven't previously
|
|
|
|
# defined -- with the exceptions of $* and $@ -- is an error, and causes
|
|
|
|
# the program to immediately exit with non-zero code.
|
|
|
|
# set -o pipefail = the first non-zero exit code emitted in one part of a
|
|
|
|
# pipeline (e.g. `cat file.txt | grep 'foo'`) will be used as the exit
|
|
|
|
# code for the entire pipeline. If all exit codes of a pipeline are zero,
|
|
|
|
# the pipeline will emit an exit code of 0.
|
|
|
|
.SHELLFLAGS := -eu -o pipefail -c
|
|
|
|
|
|
|
|
.PHONY: all
|
2023-03-19 19:02:50 +01:00
|
|
|
all: install
|
2023-01-11 11:04:27 +01:00
|
|
|
|
2023-03-19 19:02:50 +01:00
|
|
|
.PHONY: install
|
|
|
|
install:
|
|
|
|
sudo python3 -m pip install --upgrade --force-reinstall .
|
2023-01-11 11:04:27 +01:00
|
|
|
|
|
|
|
.PHONY: test
|
|
|
|
test: venv
|
|
|
|
source venv/bin/activate
|
2023-03-19 19:02:50 +01:00
|
|
|
export PYTHONPATH="${PYTHONPATH}:src"
|
|
|
|
|
2023-03-18 16:45:15 +01:00
|
|
|
python3 src/subprocess_util/test.py
|
2023-01-11 11:04:27 +01:00
|
|
|
|
2023-03-19 19:02:50 +01:00
|
|
|
.PHONY: venv
|
2023-01-11 11:04:27 +01:00
|
|
|
venv:
|
2023-03-19 19:02:50 +01:00
|
|
|
if [ ! -d venv ]; then
|
|
|
|
python3 -m venv venv
|
2023-01-11 11:04:27 +01:00
|
|
|
fi
|
|
|
|
|
|
|
|
.PHONY: clean
|
|
|
|
clean:
|
2023-01-11 19:17:07 +01:00
|
|
|
rm -rf venv .mypy_cache build dist src/__pycache__ src/subprocess_util.egg-info test
|