-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
56 lines (46 loc) · 1.19 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
#CC := gcc
CC := clang
TARGET := a.out
SRCS := \
debug.c \
gl_helpers.c \
draw_frame.c \
intro.c \
scene.c \
hud.c \
ui.c \
game.c \
level_design.c \
formation.c \
world.c \
player.c \
enemy.c \
main.c
OBJS := ${SRCS:.c=.o}
DEPS := ${SRCS:.c=.dep}
#CFLAGS := -Werror -Wall -std=gnu99 -pedantic-errors -Wall `sdl-config --cflags`
CFLAGS := -Werror -Wall -std=gnu99 -pedantic-errors -Wall `sdl-config --cflags` -fsanitize=address -g -O3
#DEBUG := -g3 -O0
DEBUG := -ggdb3 -O0
LDFLAGS := -g -fsanitize=address
LIBS := -lSDL -lGL -lGLU -lSDL_ttf -lm -DGL_GLEXT_PROTOTYPES \
`sdl-config --libs` \
`pkg-config SDL_ttf --libs` \
`pkg-config SDL_image --libs` \
-lSDL_mixer
#-lX11 -lXi -lXmu
.PHONY: all release debug clean help
all: release
release: ${TARGET}
debug: CFLAGS := ${CFLAGS} ${DEBUG}
debug: ${TARGET}
${TARGET}: ${OBJS}
${CC} ${LDFLAGS} -o $@ $^ ${LIBS}
${OBJS}: %.o: %.c %.dep
${CC} ${CFLAGS} -o $@ -c $<
${DEPS}: %.dep: %.c Makefile
${CC} ${CFLAGS} -MM $< > $@
clean:
rm -f *.o *.dep ${TARGET}
help:
echo "e.g.: make LIBS=-lm -lusb ... oder gleich eintragen"