forked from aiv01/aiv_c_tetris
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
44 lines (35 loc) · 836 Bytes
/
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
CC = clang
CPPCHECK = cppcheck
CFLAGS = -Iinclude -Wall -O3
LDFLAGS = -lSDL2
BINARY = tetris
BINARY_TESTS = tetris_tests
OBJ = src/
ifeq ($(OS),Windows_NT)
BINARY:=$(BINARY).exe
BINARY_TESTS:=$(BINARY_TESTS).exe
endif
tetris: main.o tetris.o gfx.o sfx.o
$(CC) -o $(BINARY) $(LDFLAGS) $^
./$(BINARY)
main.o: src/main.c
$(CC) -c -o $@ $(CFLAGS) $^
$(CPPCHECK) $^
tetris.o: src/tetris.c include/tetris.h
$(CC) -c -o $@ $(CFLAGS) $<
$(CPPCHECK) $^
gfx.o: src/gfx.c include/tetris.h
$(CC) -c -o $@ $(CFLAGS) $<
$(CPPCHECK) $^
sfx.o: src/sfx.c include/tetris.h
$(CC) -c -o $@ $(CFLAGS) $<
$(CPPCHECK) $^
tests.o: src/tests.c
$(CC) -c -o $@ $(CFLAGS) $^
$(CPPCHECK) $^
test: tests.o tetris.o
$(CC) -o $(BINARY_TESTS) $(LDFLAGS) $^
./$(BINARY_TESTS)
rm -f *.o tetris tetris_tests
clean:
rm -f *.o tetris tetris_tests