-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
36 lines (27 loc) · 849 Bytes
/
Makefile
File metadata and controls
36 lines (27 loc) · 849 Bytes
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
CC = gcc
CFLAGS = -Wall -O2 -g -fsanitize=address -fsanitize=undefined -fno-omit-frame-pointer
TARGET = data_table
LIST_IDENTITY = list_identity
TEST_TARGET = test_bytes
SOURCES = data_table.c arena.c bytes.c cip.c
HEADERS = arena.h bytes.h cip.h
OBJECTS = $(SOURCES:.c=.o)
TEST_OBJECTS = test_bytes.o arena.o bytes.o
LIST_IDENTITY_OBJECTS = list_identity.o arena.o bytes.o cip.o
.PHONY: all clean test
all: $(TARGET) $(LIST_IDENTITY)
$(TARGET): $(OBJECTS)
$(CC) $(CFLAGS) -o $@ $^
$(LIST_IDENTITY): $(LIST_IDENTITY_OBJECTS)
$(CC) $(CFLAGS) -o $@ $^
%.o: %.c $(HEADERS)
$(CC) $(CFLAGS) -c $<
$(TEST_TARGET): $(TEST_OBJECTS)
$(CC) $(CFLAGS) -o $@ $^
test: $(TEST_TARGET)
./$(TEST_TARGET)
clean:
rm -f $(OBJECTS) $(TEST_OBJECTS) $(LIST_IDENTITY_OBJECTS) $(TARGET) $(TEST_TARGET) $(LIST_IDENTITY)
.PHONY: run
run: $(TARGET)
./$(TARGET)