-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmakefile
52 lines (32 loc) · 916 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
45
46
47
48
49
50
51
52
CC = gcc
CFLAGS = -ggdb -Wall -I/usr/include
LIBS = -lSDL2 -lm
LIBDIR = /usr/local/lib
TARGET = ck8
MAIN = ck8
OPCODES = opcodes
CPU = cpu
DISPLAY = display
SDL = sdl
TIMER = timer
ALL_OBJECTS = $(MAIN).o $(OPCODES).o $(CPU).o $(DISPLAY).o $(SDL).o $(TIMER).o
all: $(TARGET)
$(TARGET): $(ALL_OBJECTS)
$(CC) $(CFLAGS) -o $(TARGET) $(ALL_OBJECTS) -L $(LIBDIR) $(LIBS)
$(MAIN).o: $(MAIN).c $(OPCODES).h $(CPU).h $(TIMER).h $(SDL).h
$(CC) $(CFLAGS) -c $(MAIN).c
$(OPCODES).o: $(OPCODES).c $(OPCODES).h $(CPU).h
$(CC) $(CFLAGS) -c $(OPCODES).c
$(CPU).o: $(CPU).c $(CPU).h $(DISPLAY).h
$(CC) $(CFLAGS) -c $(CPU).c
$(DISPLAY).o: $(DISPLAY).c $(DISPLAY).h
$(CC) $(CFLAGS) -c $(DISPLAY).c
$(SDL).o: $(SDL).c $(SDL).h
$(CC) $(CFLAGS) -c $(SDL).c
$(TIMER).o: $(TIMER).c $(TIMER).h
$(CC) $(CFLAGS) -c $(TIMER).c
test:
$(MAKE) -C tests
clean:
$(RM) $(TARGET) $(ALL_OBJECTS)
$(MAKE) clean -C tests