diff options
author | Aaron LI <aaronly.me@outlook.com> | 2016-09-30 22:28:49 +0800 |
---|---|---|
committer | Aaron LI <aaronly.me@outlook.com> | 2016-09-30 22:28:49 +0800 |
commit | 8d39fca1cdbb2ee6d5ec10f190b17aeb1995bccf (patch) | |
tree | da7b41b3a237cf45ae22075067bb7804dbf32d2a /Makefile | |
parent | 0b7cc2a9622d977b86c4cfc88b3e7888511d9848 (diff) | |
download | fg21sim-8d39fca1cdbb2ee6d5ec10f190b17aeb1995bccf.tar.bz2 |
Rewrite the Makefile to add virtualenv support.
Thanks: http://blog.bottlepy.org/2012/07/16/virtualenv-and-makefiles.html
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 30 |
1 files changed, 23 insertions, 7 deletions
@@ -1,10 +1,26 @@ # Makefile for "fg21sim" -# -# 2016-09-20 -# -init: - pip3 install --user -r requirements.txt +default: + @echo "+-------------------------------------------------------------+" + @echo "| Make Utility for fg21sim |" + @echo "+-------------------------------------------------------------+" + @echo "Available targets:" + @echo " + venv" + @echo " create virtualenv 'venv' and install the dependencies" + @echo " + test" + @echo " run the test cases" -test: - nosetests tests +# 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 + +# Install this package to the virtualenv +devbuild: venv + ./venv/bin/python3 setup.py install + +# Run the test cases +test: devbuild + ./venv/bin/python3 tests/runtests.py |