diff options
author | Aaron LI <aaronly.me@outlook.com> | 2016-10-03 22:56:49 +0800 |
---|---|---|
committer | Aaron LI <aaronly.me@outlook.com> | 2016-10-03 22:56:49 +0800 |
commit | 3c6e976827fe382661c2d3682caa597e695bef5c (patch) | |
tree | 847494c227a1fa276222cddc977ab23f0ef6cf09 | |
parent | 38475662119dacc1260c209f67f0cc87ee9f4da8 (diff) | |
download | fg21sim-3c6e976827fe382661c2d3682caa597e695bef5c.tar.bz2 |
Makefile: Add variable "VENV" to control virtualenv
* The variable "VENV" (default: "venv") defines the virtualenv name and
can be override by the environment.
* Add "devbuild" target to menu.
* Remove the "--user" argument to fix the pip install problem.
-rw-r--r-- | Makefile | 26 |
1 files changed, 18 insertions, 8 deletions
@@ -1,4 +1,12 @@ +# Copyright (c) 2016 Weitian LI <liweitianux@live.com> +# MIT license +# # Makefile for "fg21sim" +# + +# The name (also the directory) of the virtualenv +VENV ?= "venv" + default: @echo "+-------------------------------------------------------------+" @@ -6,21 +14,23 @@ default: @echo "+-------------------------------------------------------------+" @echo "Available targets:" @echo " + venv" - @echo " create virtualenv 'venv' and install the dependencies" + @echo " create virtualenv '${VENV}' and install the dependencies" + @echo " + devbuild" + @echo " (build and) install the package to the virtualenv" @echo " + test" @echo " run the test cases" # Create virtualenv and install/update the dependencies -venv: venv/bin/activate -venv/bin/activate: requirements.txt - test -d "venv" || virtualenv -p python3 venv - ./venv/bin/pip3 install --user -r requirements.txt - touch venv/bin/activate +venv: ${VENV}/bin/activate +${VENV}/bin/activate: requirements.txt + test -d "${VENV}" || virtualenv --python=python3 ${VENV} + ./${VENV}/bin/pip3 install -r requirements.txt + touch ${VENV}/bin/activate # Install this package to the virtualenv devbuild: venv - ./venv/bin/python3 setup.py install + ./${VENV}/bin/python3 setup.py install # Run the test cases test: devbuild - ./venv/bin/python3 tests/runtests.py + ./${VENV}/bin/python3 tests/runtests.py |