-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
29 lines (21 loc) · 1.02 KB
/
Makefile
File metadata and controls
29 lines (21 loc) · 1.02 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
CC := gcc
CFLAGS := -std=c11 -Wall -Wextra -Wpedantic -Iinclude
SANITIZER_FLAGS := -fsanitize=address,undefined -fno-omit-frame-pointer
LIB_SRC := src/advanced_memory_manager.c
DEMO_SRC := mem_manager.c
TEST_SRC := tests/test_memory_manager.c
.PHONY: all demo test clean sanitize benchmark
all: demo test
demo: $(LIB_SRC) $(DEMO_SRC)
$(CC) $(CFLAGS) $(LIB_SRC) $(DEMO_SRC) -o advanced_memory_manager_demo
test: $(LIB_SRC) $(TEST_SRC)
$(CC) $(CFLAGS) $(LIB_SRC) $(TEST_SRC) -o advanced_memory_manager_tests
./advanced_memory_manager_tests
sanitize: $(LIB_SRC) $(TEST_SRC)
$(CC) $(CFLAGS) $(SANITIZER_FLAGS) $(LIB_SRC) $(TEST_SRC) -o advanced_memory_manager_sanitized
./advanced_memory_manager_sanitized
benchmark: $(LIB_SRC) benchmarks/benchmark_allocators.c
$(CC) $(CFLAGS) $(LIB_SRC) benchmarks/benchmark_allocators.c -o advanced_memory_manager_benchmark
./advanced_memory_manager_benchmark
clean:
rm -f advanced_memory_manager_demo advanced_memory_manager_tests advanced_memory_manager_sanitized advanced_memory_manager_benchmark