From 234753f0509a1c3b69b4d50ce9019849a9d4c77b Mon Sep 17 00:00:00 2001 From: Adam Goldsmith Date: Sat, 5 Mar 2016 01:25:21 -0500 Subject: [PATCH] Remove old files, add some to .gitignore, move Makefile --- Makefile | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..4584c5a --- /dev/null +++ b/Makefile @@ -0,0 +1,32 @@ +LIBS=wpi +override CFLAGS +=-l$(LIBS) -std=c++14 +TEAM=1786 +SSH_OPTIONS=-q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no +SSH_SSHPASS=$(shell command -v sshpass >/dev/null 2>&1 && echo -n "sshpass -p ''") + +all: deploy + +build: FRCUserProgram + +FRCUserProgram: robot.cpp + @echo "Building FRCUserProgram" + arm-frc-linux-gnueabi-g++ robot.cpp -o FRCUserProgram $(CFLAGS) + +clean: + rm FRCUserProgram + +deploy: build + @echo "Copying FRCUserProgram" + @ssh $(SSH_OPTIONS) lvuser@10.17.86.20 'rm -f /home/lvuser/FRCUserProgram' + @scp $(SSH_OPTIONS) -o "LogLevel QUIET" FRCUserProgram lvuser@10.17.86.20:/home/lvuser/FRCUserProgram + @echo "Restarting FRCUserProgram" + @$(SSH_SSHPASS) ssh $(SSH_OPTIONS) admin@10.17.86.20 '. /etc/profile.d/natinst-path.sh; /usr/local/frc/bin/frcKillRobot.sh -t -r' + +restart: FRCUserProgram + @echo "Restarting FRCUserProgram" + @$(SSH_SSHPASS) ssh $(SSH_OPTIONS) admin@10.17.86.20 '. /etc/profile.d/natinst-path.sh; /usr/local/frc/bin/frcKillRobot.sh -t -r' + +stop: + @echo "Restarting FRCUserProgram" + @$(SSH_SSHPASS) ssh $(SSH_OPTIONS) admin@10.17.86.20 '. /etc/profile.d/natinst-path.sh; /usr/local/frc/bin/frcKillRobot.sh -t'y +