Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
65 lines (60 loc) · 1.36 KB
/
Copy pathMakefile
File metadata and controls
65 lines (60 loc) · 1.36 KB
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
GITBINARY := git
PINGURL := google.com
LIBRARYREPO := simulator_libraries
ifeq ($(OS),Windows_NT)
SHELL := CMD
endif
all: update
ifeq ($(OS),Windows_NT)
@cd $(LIBRARYREPO) && mingw32-make
else
@cd $(LIBRARYREPO) && make
endif
update:
ifeq ($(OS),Windows_NT)
# check for internet connection
# if there's internet, check to see if Libraries folder exists
# if it does, remove it before cloning the repo
@ping -n 1 -w 1000 $(PINGURL) > NUL & \
if errorlevel 1 \
( \
( echo Warning: No internet connection! ) \
) \
else \
( \
( if exist "$(LIBRARYREPO)" \
( \
cd $(LIBRARYREPO) && \
$(GITBINARY) stash && \
$(GITBINARY) pull && \
cd .. \
) \
else \
( \
$(GITBINARY) config --global http.sslVerify false && \
$(GITBINARY) clone https://code.osu.edu/fehelectronics/proteus_software/$(LIBRARYREPO).git \
) \
) \
)
else
# Mac/Linux
@ping -c 1 -W 1000 $(PINGURL) > /dev/null ; \
if [ "$$?" -ne 0 ]; then \
echo Warning: No internet connection!; \
else \
if [ -d "$(LIBRARYREPO)" ]; then \
cd $(LIBRARYREPO) ; \
$(GITBINARY) stash ; \
$(GITBINARY) pull ; \
cd .. ; \
else \
$(GITBINARY) clone https://code.osu.edu/fehelectronics/proteus_software/$(LIBRARYREPO).git ; \
fi \
fi \
endif
clean:
ifeq ($(OS),Windows_NT)
@cd $(LIBRARYREPO) && mingw32-make clean
else
@cd $(LIBRARYREPO) && make clean
endif