-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
82 lines (74 loc) · 1.86 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
TARGET = Proteus
GITBINARY := git
FEHURL := google.com
FIRMWAREREPO := fehproteusfirmware
ifeq ($(OS),Windows_NT)
SHELL := CMD
endif
all:
ifeq ($(OS),Windows_NT)
# check for internet connection
# if there's internet, check to see if FEHproteusfirmware folder exists
# if it does, remove it before cloning the repo
@ping -n 1 -w 1000 $(FEHURL) > NUL & \
if errorlevel 1 \
( \
( echo "Warning: No internet connection!" ) \
) \
else \
( \
( if exist "$(FIRMWAREREPO)" \
( \
cd $(FIRMWAREREPO) && \
$(GITBINARY) stash && \
$(GITBINARY) pull && \
cd .. \
) \
else \
( \
$(GITBINARY) config --global http.sslVerify false && \
$(GITBINARY) clone https://code.osu.edu/fehelectronics/proteus_software/$(FIRMWAREREPO).git \
) \
) \
)
else
# Mac/Linux
@ping -c 1 -W 1000 $(FEHURL) > NUL ; \
if [ "$$?" -ne 0 ]; then \
echo "Warning: No internet connection!"; \
else \
if [ -d "$(FIRMWAREREPO)" ]; then \
cd $(FIRMWAREREPO) ; \
$(GITBINARY) stash ; \
$(GITBINARY) pull ; \
cd .. ; \
else \
$(GITBINARY) clone https://code.osu.edu/fehelectronics/proteus_software/$(FIRMWAREREPO).git ; \
fi \
fi \
endif
ifeq ($(OS),Windows_NT)
@cd $(FIRMWAREREPO) && mingw32-make all TARGET=$(TARGET)
@cd $(FIRMWAREREPO) && mingw32-make deploy TARGET=$(TARGET)
else
@cd $(FIRMWAREREPO) && make all TARGET=$(TARGET)
@cd $(FIRMWAREREPO) && make deploy TARGET=$(TARGET)
endif
deploy:
ifeq ($(OS),Windows_NT)
@cd $(FIRMWAREREPO) && mingw32-make deploy TARGET=$(TARGET)
else
@cd $(FIRMWAREREPO) && make deploy TARGET=$(TARGET)
endif
clean:
ifeq ($(OS),Windows_NT)
@cd $(FIRMWAREREPO) && mingw32-make clean TARGET=$(TARGET)
else
@cd $(FIRMWAREREPO) && make clean TARGET=$(TARGET)
endif
run:
ifeq ($(OS),Windows_NT)
@cd $(FIRMWAREREPO) && mingw32-make run TARGET=$(TARGET)
else
@cd $(FIRMWAREREPO) && make run TARGET=$(TARGET)
endif