-
Notifications
You must be signed in to change notification settings - Fork 0
/
makefile
51 lines (44 loc) · 1.17 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
CC := clang
cflags := -Wall -Wno-missing-braces -std=c99
ldflags :=
files := $(wildcard src/*.c)
output :=
makedir :=
listdir :=
extra :=
extraRelease :=
ifeq ($(OS),Windows_NT)
cfags += -Iext/includes
ldflags += -L$(WINLIBPATH) -Lext/win64 -lSDL2main -lSDL2 -lShell32
output := build/win64/redlight.exe
listdir := dir /b build\win64
extra := -Wl,-subsystem:console
extraRelease := -Wl,-subsystem:windows
else
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Linux)
cflags += -lm `sdl2-config --cflags` -Iext/includes
ldflags += `sdl2-config --libs`
output := build/linux/redlight
makedir := mkdir -p build/linux
listdir := ls -l build/linux
endif
# ifeq ($(UNAME_S),Darwin)
# #do nothing right now
# endif
endif
#-static
#-Wl,-subsystem:console
debug: $(output)
$(makedir)
clang -g -O0 -fno-omit-frame-pointer -fsanitize=address -DDebug=1 $(cflags) -o $(output) $(ldflags) $(extra) $(files)
$(info ------files------)
$(listdir)
release: $(output)
$(makedir)
clang -O3 -DDebug=0 $(cflags) -o $(output) $(ldflags) -static $(extra) $(files)
$(info ------files------)
$(listdir)
$(output):
$(info ------building------)
#for release -Xlinker /subsystem:console