mirror of
https://codeberg.org/privacy1st/MastodonTootFollower
synced 2024-12-22 23:06:05 +01:00
41 lines
1.2 KiB
Makefile
41 lines
1.2 KiB
Makefile
|
.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
|
||
|
all: prod
|
||
|
|
||
|
.PHONY: prod
|
||
|
prod: requirements.txt
|
||
|
source venv/bin/activate
|
||
|
export PYTHONPATH="${PYTHONPATH}:src"
|
||
|
python3 src/mastodon_toot_follower/server/waitress_server.py
|
||
|
|
||
|
.PHONY: dev
|
||
|
dev: requirements.txt
|
||
|
source venv/bin/activate
|
||
|
export PYTHONPATH="${PYTHONPATH}:src"
|
||
|
python3 src/mastodon_toot_follower/server/flask_server.py
|
||
|
|
||
|
|
||
|
.PHONY: requirements.txt
|
||
|
requirements.txt:
|
||
|
if ! [ -d venv ]; then
|
||
|
python3 -m venv venv
|
||
|
source venv/bin/activate
|
||
|
python3 -m pip install -r requirements.txt
|
||
|
fi
|
||
|
|
||
|
.PHONY: clean
|
||
|
clean:
|
||
|
rm -rf venv
|