aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorToover <toover@toover.me>2017-04-15 19:33:34 +0200
committerAlexis Metaireau <alexis@notmyidea.org>2017-04-15 19:33:34 +0200
commit41ede04a599fa2f436a8139dd76df36b7cb0ddf0 (patch)
tree128847adec3c5c0db0cb930ebcf5b9e1be1fb393 /Makefile
parent4ea5158a7085261c3366eab8ce225b895a54c3ad (diff)
downloadihatemoney-mirror-41ede04a599fa2f436a8139dd76df36b7cb0ddf0.zip
ihatemoney-mirror-41ede04a599fa2f436a8139dd76df36b7cb0ddf0.tar.gz
ihatemoney-mirror-41ede04a599fa2f436a8139dd76df36b7cb0ddf0.tar.bz2
Fix makefile: Python lookup and virtualenv setup (#201)
* Fix Python lookup in the Makefile * Improve the Makefile To make sure calling for "make serve" works straight away, the dependencies are automatically prepared. A "make clean" has been added, to test this feature.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile11
1 files changed, 7 insertions, 4 deletions
diff --git a/Makefile b/Makefile
index 1ac7e19..eb18e03 100644
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,6 @@
VIRTUALENV = virtualenv --python=python3
SPHINX_BUILDDIR = docs/_build
-VENV := $(shell echo $${VIRTUAL_ENV-.venv})
+VENV := $(shell realpath $${VIRTUAL_ENV-.venv})
PYTHON = $(VENV)/bin/python3
DEV_STAMP = $(VENV)/.dev_env_installed.stamp
DOC_STAMP = $(VENV)/.doc_env_installed.stamp
@@ -8,7 +8,7 @@ INSTALL_STAMP = $(VENV)/.install.stamp
TEMPDIR := $(shell mktemp -d)
all: install
-install: $(INSTALL_STAMP)
+install: virtualenv $(INSTALL_STAMP)
$(INSTALL_STAMP):
$(VENV)/bin/pip install -U pip
$(VENV)/bin/pip install -r requirements.txt
@@ -23,8 +23,8 @@ $(DEV_STAMP): $(PYTHON) dev-requirements.txt
$(VENV)/bin/pip install -Ur dev-requirements.txt
touch $(DEV_STAMP)
-serve: $(INSTALL_STAMP)
- cd budget; ../$(PYTHON) run.py
+serve: install
+ cd budget; $(PYTHON) run.py
test: $(DEV_STAMP)
$(VENV)/bin/tox
@@ -37,3 +37,6 @@ build-requirements:
$(TEMPDIR)/bin/pip install -U pip
$(TEMPDIR)/bin/pip install -Ue "."
$(TEMPDIR)/bin/pip freeze | grep -v -- '-e' > requirements.txt
+
+clean:
+ rm -rf .venv