-
Notifications
You must be signed in to change notification settings - Fork 3
/
sdl.mak
66 lines (53 loc) · 1.04 KB
/
sdl.mak
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
ifndef SDLCONFIG
SDL1CONFIG=sdl-config
ifneq ($(shell a=`which $(SDL1CONFIG) 2>&1`;echo $$?),0)
SDL1CONFIG=
endif
SDL2CONFIG=sdl2-config
ifneq ($(shell a=`which $(SDL2CONFIG) 2>&1`;echo $$?),0)
SDL2CONFIG=
endif
ifdef SDL2CONFIG
SDLCONFIG=$(SDL2CONFIG)
else
ifdef SDL1CONFIG
SDLCONFIG=$(SDL1CONFIG)
endif
endif
ifndef SDLCONFIG
SDLCONFIG=NO_SDL_INSTALLED
SDL_CHECK:
@echo "No SDL installed.\nTry : $$ sudo apt-get install libsdl2-dev";false
else
SDL_CHECK:
@echo "Using detected SDLCONFIG=$(SDLCONFIG)"
endif
else
SDL_CHECK:
@echo "Using forced SDLCONFIG=$(SDLCONFIG)"
endif
ifdef SDLCONFIG
SDL_FLAGS+=$(shell $(SDLCONFIG) --cflags)
endif
OP_SYS=$(shell uname -o)
ifeq ($(OP_SYS),Msys)
WINDOWS=1
endif
ifdef WINDOWS
SDL_STATIC=1
endif
SDL_VER=$(shell $(SDLCONFIG) --version | cut -f 1 -d ".")
ifeq ($(SDL_VER),1)
USE_SDL1=1
else
USE_SDL1=
endif
ifdef SDL_STATIC
SDL_LIBS+=$(shell $(SDLCONFIG) --static-libs) -static
else
SDL_LIBS+=$(shell $(SDLCONFIG) --libs)
endif
ifdef WINDOWS
# this one to get text console output
SDL_LIBS+=-mno-windows
endif