summary refs log tree commit diff
diff options
context:
space:
mode:
authordozens2025-04-16 10:39:21 -0600
committerMatt Arnold2025-04-16 13:32:07 -0400
commita6f279191c52a2627c2809503e0b697defc1e5d9 (patch)
tree7da1ae8307dc63be7f3abae3d15ac3b92dfd34f1
parent50d4a8634f134c0d5276f7ed65d06fa9ddbf03a7 (diff)
Add makefile
automate building and serving with make
-rw-r--r--Makefile23
-rw-r--r--README.md42
2 files changed, 30 insertions, 35 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..4d42076
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,23 @@
+VENV=venv
+PYTHON=$(VENV)/bin/python
+PIP=$(VENV)/bin/pip
+
+.PHONY: run
+run: $(VENV)/bin/activate app.py
+	$(PYTHON) app.py
+
+.PHONY: install
+install: $(VENV)/bin/activate
+
+$(VENV)/bin/activate: requirements.txt
+	python3 -m venv $(VENV)
+	$(PIP) install -r $^
+
+.PHONY: migrate
+migrate: migrate.py
+	$(PYTHON) $^ install
+
+.PHONY: clean
+clean:
+	rm -rf __pycache__
+	rm -rf $(VENV)
diff --git a/README.md b/README.md
index a093aa3..b1349d0 100644
--- a/README.md
+++ b/README.md
@@ -8,48 +8,20 @@ It needs everything, posting, and reply works! So it can be hacked on further ðŸ
 
 # Full install instructions
 
-## step 1
-If you've never done python before.. Python projects live inside little boxes call virtual envs. To set one up for this project. Do
+On first run:
 
-```shell
-python -m venv venv
-```
-That will set up a virtual env in the customary place. To use it
-## step 2
-```shell 
-source ./venv/bin/activate
-```
-## step 3
-Then you install the  dependencies like so
-```shell
-pip install -r requirements.txt
-```
-## step 4
-Next run migrate install, and follow all the prompts
-```shell 
-./migrate.py install
-```
-## step 5
-Finally boot app.py
-
-```shell
-./app.py
-```
-It will setup a listener on port 5052
+- `make install`
+- `make migrate`
+- `make run`
 
+On subsequent runs:
 
-## step 6 
-
-When done playing exit the app server by pressing ctrl-c then run 
-```shell
-deactivate 
-```
+- `make run`
 
 # stuff to do on a git pull
 
 ```shell
 ./migrate.py upgrade-schema
-pip install -r requirements.txt
 ```
 
 
@@ -60,4 +32,4 @@ The app server will invalidate your cookies on every  make a change, and reload.
 I will fix this eventually. 
 
 
-Thus endith the instructions
\ No newline at end of file
+Thus endith the instructions