2015-01-17 12:21:16 -05:00
|
|
|
REMOTEIP=10.20.59.2
|
|
|
|
CC=arm-frc-linux-gnueabi-g++
|
|
|
|
CFLAGS=-std=c++11 -O0 -g3 -Wall -c -fmessage-length=0
|
|
|
|
LDFLAGS=-Wl,-rpath,/opt/GenICam_v2_3/bin/Linux_armv7-a
|
2015-04-11 16:24:48 -04:00
|
|
|
rwildcard=$(foreach d,$(wildcard $1*),$(call rwildcard,$d/,$2) $(filter $(subst *,%,$2),$d))
|
|
|
|
SOURCES=$(call rwildcard,./,*.cpp)
|
2015-01-17 12:21:16 -05:00
|
|
|
OBJECTS=$(SOURCES:.cpp=.o)
|
2015-01-25 10:13:53 -05:00
|
|
|
WPILIB=/var/frc/wpilib
|
2015-01-17 12:21:16 -05:00
|
|
|
EXEC=bin/FRCUserProgram
|
2015-03-07 14:23:02 -05:00
|
|
|
CLEANSER=rm -f
|
2015-03-17 16:33:25 -04:00
|
|
|
READER=$(shell which pv||which cat)
|
2015-01-17 12:21:16 -05:00
|
|
|
|
|
|
|
all : $(OBJECTS)
|
2015-02-12 12:56:09 -05:00
|
|
|
if [ ! -d bin ];then mkdir bin; fi
|
2015-01-17 12:21:16 -05:00
|
|
|
$(CC) -L$(WPILIB)/lib $(LDFLAGS) -o $(EXEC) $(OBJECTS) -lwpi
|
|
|
|
|
|
|
|
%.o : %.cpp
|
|
|
|
$(CC) $(CFLAGS) -I$(WPILIB)/include $^ -o $@
|
|
|
|
|
|
|
|
clean:
|
|
|
|
$(CLEANSER) $(OBJECTS) bin/FRCUserProgram
|
|
|
|
|
2015-02-19 15:16:09 -05:00
|
|
|
deploy:
|
2015-04-06 20:36:59 -04:00
|
|
|
@$(READER) bin/FRCUserProgram | ssh admin@$(REMOTEIP) '(rm /home/lvuser/FRCUserProgram)</dev/null;cat>/home/lvuser/FRCUserProgram;chmod a+x /home/lvuser/FRCUserProgram'
|
|
|
|
|
|
|
|
run:
|
2015-03-26 10:31:51 -04:00
|
|
|
@$(READER) bin/FRCUserProgram | ssh admin@$(REMOTEIP) '(rm /home/lvuser/FRCUserProgram)</dev/null;cat > /home/lvuser/FRCUserProgram;chmod a+x /home/lvuser/FRCUserProgram && /usr/local/frc/bin/frcKillRobot.sh -r -t'
|
2015-01-29 14:53:11 -05:00
|
|
|
|
2015-02-19 15:16:09 -05:00
|
|
|
debug:
|
2015-04-06 20:36:59 -04:00
|
|
|
@$(READER) bin/FRCUserProgram | ssh admin@$(REMOTEIP) '(rm /home/lvuser/FRCUserProgram)</dev/null;cat > /home/lvuser/FRCUserProgram;chmod a+x /home/lvuser/FRCUserProgram;(/home/lvuser/run.sh||/home/admin/run.sh)'
|
2015-01-17 12:21:16 -05:00
|
|
|
|
|
|
|
putkey:
|
|
|
|
@test -d ~/.ssh||mkdir ~/.ssh;test -f ~/.ssh/id_rsa||ssh-keygen -t rsa -f ~/.ssh/id_rsa -b 4096 -q -N '';cat ~/.ssh/id_rsa.pub|ssh -v admin@$(REMOTEIP) 'cat >> /tmp/key;mkdir -p ~/.ssh;cat /tmp/key >> ~/.ssh/authorized_keys;rm /tmp/key'
|