This repository has been archived by the owner on Feb 11, 2021. It is now read-only.
/
Makefile
48 lines (32 loc) · 1.32 KB
1
2
3
CFLAGS := -W -Wall -Wextra -g -I. `sdl-config --cflags`
4
LDFLAGS := `sdl-config --libs`
5
6
# If it doesn't pick up defaults
7
8
#CFLAGS := -I. -D_GNU_SOURCE=1 -D_REENTRANT -I/usr/local/include/SDL
#LDFLAGS := -lm -ldl -lesd -lpthread
9
10
11
12
13
14
SRC := testsdl.c \
rwops/rwops.c \
platform/platform.c \
surface/surface.c \
render/render.c
15
COMMON_SRC := SDL_at.c common/common.c
16
17
COMMON_INCLUDE := SDL_at.h
18
TESTS_ALL := testsdl rwops/rwops platform/platform surface/surface render/render
19
20
21
.PHONY: all clean test
22
23
24
all: $(TESTS_ALL)
25
26
test: all
27
@./rwops/rwops
28
@./platform/platform
29
@./surface/surface
30
@./render/render
31
32
testsdl: $(SRC) $(COMMON_SRC)
33
34
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(SRC) $(COMMON_SRC)
35
rwops/rwops: rwops/rwops.c $(COMMON_INCLUDE) $(COMMON_SRC)
36
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ rwops/rwops.c $(COMMON_SRC) -DTEST_STANDALONE
37
38
platform/platform: platform/platform.c $(COMMON_INCLUDE) $(COMMON_SRC)
39
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ platform/platform.c $(COMMON_SRC) -DTEST_STANDALONE
40
41
surface/surface: surface/surface.c $(COMMON_INCLUDE) $(COMMON_SRC)
42
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ surface/surface.c $(COMMON_SRC) -DTEST_STANDALONE
43
44
render/render: render/render.c $(COMMON_INCLUDE) $(COMMON_SRC)
45
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ render/render.c $(COMMON_SRC) -DTEST_STANDALONE
46
47
48
clean:
$(RM) $(TESTS_ALL)