This repository has been archived by the owner on Jul 2, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
makefile
85 lines (72 loc) · 2.12 KB
/
makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
OSFLAG :=
HOST_ROBORIO := lvuser@roboRIO-4635-frc.
COMMAND := ./gradlew
UPLOAD_SETTINGS := scp -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null ./settings*.ini $(HOST_ROBORIO):/home/lvuser/.
RETRIEVE_SETTINGS:= scp -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null $(HOST_ROBORIO):/home/lvuser/settings*.ini .
UPLOAD_PATHS := scp -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null ./paths/*.path $(HOST_ROBORIO):/home/lvuser/paths/
RETRIEVE_PATHS := scp -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null $(HOST_ROBORIO):/home/lvuser/paths/*.path paths/
CLEAN_PATHS := ssh $(HOST_ROBORIO) rm -f /home/lvuser/paths/*.path
RETRIEVE_LOGS := scp -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null $(HOST_ROBORIO):/home/lvuser/logs/*.csv logs/
CLEAN_LOGS_RIO := ssh $(HOST_ROBORIO) rm -f /home/lvuser/logs/*.csv
ifeq ($(OS),Windows_NT)
OSFLAG = -D WIN32
COMMAND = .\gradlew.bat
ifeq ($(PROCESSOR_ARCHITECTURE),AMD64)
OSFLAG = AMD64
endif
ifeq ($(PROCESSOR_ARCHITECTURE),x86)
OSFLAG = IA32
endif
else
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Linux)
OSFLAG = LINUX
endif
ifeq ($(UNAME_S),Darwin)
OSFLAG = OSX
endif
UNAME_P := $(shell uname -p)
ifeq ($(UNAME_P),x86_64)
OSFLAG = AMD64
endif
ifneq ($(filter %86,$(UNAME_P)),)
OSFLAG = IA32
endif
ifneq ($(filter arm%,$(UNAME_P)),)
OSFLAG = ARM
endif
endif
all:
@echo Building source code...
@$(COMMAND) build
build_deploy: all
@echo Building and deploying to robot...
@$(UPLOAD_SETTINGS)
@$(UPLOAD_PATHS)
@$(COMMAND) build deploy --offline
clean:
@echo Cleaning build folder...
@$(COMMAND) clean
deploy:
@echo Deploying to robot...
@$(UPLOAD_SETTINGS)
@$(UPLOAD_PATHS)
@$(COMMAND) deploy --offline
put_settings:
@echo Updating settings.ini on robot...
@$(UPLOAD_SETTINGS)
get_settings:
@echo Retrieving settings.ini from robot...
@$(RETRIEVE_SETTINGS)
get_logs:
@echo Retrieving logs from robot...
@$(RETRIEVE_LOGS)
clean_logs:
@echo Deleting logs on robot...
@$(CLEAN_LOGS_RIO)
put_paths:
@echo Updating paths on robot...
@$(UPLOAD_PATHS)
get_paths:
@echo Retrieving paths from robot...
@$(RETRIEVE_PATHS)