Commit 57a30781 authored by Nelso Jost's avatar Nelso Jost

NEW: Makefile install and uninstall command

parent 8481a54b
......@@ -9,8 +9,26 @@ help:
@ echo ""
@ echo "COMMANDS:"
@ echo ""
@ echo " full -- setup & bu & deploy-logger"
@ echo " install -- Install required tools, build and upload firmware, and"
@ echo " deploy logger daemon (background process)"
@ echo ""
@ echo " uninstall -- Remove daemon process (if present) and clean this folder"
@ echo ""
@ echo " tail-log -- Exibits and follow last modified execution log file"
@ echo " tail-data -- Exibits and follow last modified datalog file"
@ echo ""
@ echo " plot-data col=<C> -- Uses Gnuplot to plot last modified datalog file"
@ echo ""
@ echo " help -- Shows the full help"
help-full:
@ echo "USAGE: make <command>"
@ echo ""
@ echo "COMMANDS:"
@ echo ""
@ echo " install -- setup & bu & deploy-logger"
@ echo " uninstall -- undeploy-logger & clean-venv & clean-ino"
@ echo ""
@ echo " apt-install -- Uses Debian's apt to install required system tools"
@ echo " venv -- Creates a Python local virtual environment at ${VENV}"
@ echo " setup -- apt-install & venv"
......@@ -39,6 +57,10 @@ help:
@ echo " clean-all -- Performs all the above cleans"
@ echo ""
install: setup bu deploy-logger
uninstall: undeploy-logger clean-venv clean-ino
apt-install:
sudo apt-get install python python3 python3-pip supervisor python-pip
sudo pip${PYVER} install virtualenv
......@@ -72,8 +94,7 @@ build:
upload:
$(eval MODEL := $(shell ${VENV}/bin/python -c "from logger.app import Meteorologger; print(Meteorologger().CFG['ARDUINO']['BOARD_MODEL'])"))
$(eval PORT := $(shell ${VENV}/bin/python -c "from logger.app import Meteorologger; print(Meteorologger().CFG['ARDUINO']['SERIAL_PORTS'][0])"))
cd ${INODIR}/ && ino upload -m $(MODEL) -p $(PORT)
cd ${INODIR}/ && ino upload -m $(MODEL)
serial:
${VENV}/bin/ipython -i logger/init_serial.py
......@@ -127,5 +148,3 @@ clean-ino:
clean-all: clean-data clean-logs clean-ino clean-venv
cd logger && sudo py3clean app
full: setup bu deploy-logger
......@@ -49,8 +49,8 @@ def deploy_supervisor():
f.write(str(pid) + '\n')
print("\nPID: {} (saved at '{}')".format(pid, PID_FILENAME))
print('\n[{} process is running]'.format(PROCESS_NAME))
print('\nYou can manage it with supervisorctl tool.')
print('\n[{} process is running in the background]'
.format(PROCESS_NAME))
except:
print("\nSomething went wrong and the daemon process was NOT created.")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment