-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmakefile
42 lines (32 loc) · 912 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
# Variables Definition
version = gcc -std=gnu99
flags = -g -Wall -Wextra
clean = rm -rf *.o gameoflife keyboardTester
# Main compilation
gameoflife : main.o thread.o keyboard.o gfx.o display.o worker.o
$(version) $^ -o gameoflife -lrt -lpthread -lSDL2
main.o : main.c
$(version) -c $^ $(flags)
# Keyboard Tester
keyboardTester : keyboardTester.o keyboard.o gfx.o
$(version) $^ $(flags) -o keyboardTester -lSDL2 -lpthread
keyboardTester.o : keyboardTester.c
$(version) -c $^ $(flags)
# Thread compilation
thread.o : thread.c thread.h
$(version) -c $< $(flags)
# Gfx compilation
gfx.o : gfx.c gfx.h
$(version) -c $< $(flags)
# Keyboard compilation
keyboard.o : keyboard.c keyboard.h
$(version) -c $< $(flags)
# Display compilation
display.o : display.c display.h
$(version) -c $< $(flags)
# Worker compilation
worker.o : worker.c worker.h
$(version) -c $< $(flags)
# Clean part
clean:
$(clean)