-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
46 lines (30 loc) · 1.07 KB
/
Copy pathMakefile
File metadata and controls
46 lines (30 loc) · 1.07 KB
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
CC = gcc
CFLAGS = -Iinclude -Wall -Wextra # -fsanitize=address
COMMON_SRCS = src/codeSeg.c src/cpu.c src/parser.c src/memHandler.c src/tableGen.c src/Pcolors.c
COMMON_OBJS = $(COMMON_SRCS:.c=.o)
all: run test_tableGen test_memHandler test_parser test_adressage
run: main.o $(COMMON_OBJS)
$(CC) $(CFLAGS) -o $@ $^
test_tableGen: test_tableGen.o $(COMMON_OBJS)
$(CC) $(CFLAGS) -o $@ $^
test_memHandler: test_memHandler.o $(COMMON_OBJS)
$(CC) $(CFLAGS) -o $@ $^
test_parser: test_parser.o $(COMMON_OBJS)
$(CC) $(CFLAGS) -o $@ $^
test_adressage: test_adressage.o $(COMMON_OBJS)
$(CC) $(CFLAGS) -o $@ $^
%.o: src/%.c %.h
$(CC) $(CFLAGS) -c $< -o $@
main.o: src/main.c
$(CC) $(CFLAGS) -c $< -o $@
test_tableGen.o: tests/test_tableGen.c
$(CC) $(CFLAGS) -c $< -o $@
test_memHandler.o: tests/test_memHandler.c
$(CC) $(CFLAGS) -c $< -o $@
test_parser.o: tests/test_parser.c
$(CC) $(CFLAGS) -c $< -o $@
test_adressage.o: tests/test_adressage.c
$(CC) $(CFLAGS) -c $< -o $@
clean:
rm -f *.o src/*.o run test_tableGen test_memHandler test_parser test_adressage
.PHONY: all clean