-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
63 lines (57 loc) · 1.39 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
GITBINARY := git
PINGURL := google.com
LIBRARYREPO := simulator_libraries
# SDL2 Directories
SDL2_INCLUDE := -I/usr/include/SDL2
SDL2_LIBS := -L/usr/lib -lSDL2
ifeq ($(OS),Windows_NT)
SHELL := CMD
SDL2_INCLUDE := -IC:/path/to/SDL2/include
SDL2_LIBS := -LC:/path/to/SDL2/lib -lSDL2main -lSDL2
endif
all: update
ifeq ($(OS),Windows_NT)
@cd $(LIBRARYREPO) && mingw32-make SDL2_INCLUDE="$(SDL2_INCLUDE)" SDL2_LIBS="$(SDL2_LIBS)"
else
@cd $(LIBRARYREPO) && make SDL2_INCLUDE="$(SDL2_INCLUDE)" SDL2_LIBS="$(SDL2_LIBS)"
endif
update:
ifeq ($(OS),Windows_NT)
@ping -n 1 -w 1000 $(PINGURL) > NUL & \
if errorlevel 1 \
( \
( echo Warning: No internet connection! ) \
) \
else \
( \
( if exist "$(LIBRARYREPO)" \
( \
cd $(LIBRARYREPO) && \
cd .. \
) \
else \
( \
$(GITBINARY) config --global http.sslVerify false && \
$(GITBINARY) clone https://code.osu.edu/fehelectronics/proteus_software/$(LIBRARYREPO).git \
) \
) \
)
else
@ping -c 1 -W 1000 $(PINGURL) > /dev/null ; \
if [ "$$?" -ne 0 ]; then \
echo Warning: No internet connection!; \
else \
if [ -d "$(LIBRARYREPO)" ]; then \
cd $(LIBRARYREPO) ; \
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