blob: 2b45044d09200e01bc4112574390f0fdcd739b34 (
plain) (
blame)
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
|
CFLAGS+=-std=c11 -Wall -Wextra -Wpedantic
CFLAGS+=-D_DEFAULT_SOURCE
ALL=bench
dev: CFLAGS+=-Og -g3
dev: CFLAGS+=-fsanitize=undefined -fsanitize=address
dev: LDFLAGS+=-fsanitize=undefined -fsanitize=address
dev: $(ALL)
prod: CFLAGS+=-O2 -s
prod: LDFLAGS+=-s
prod: $(ALL)
musl: CC=musl-gcc
musl: CFLAGS+=-Os -s
musl: LDFLAGS+=-static -s
musl: $(ALL)
bench: bench.o arena.o cached.o pool.o
bench.o: bench.c arena.h cached.h pool.h
arena.o: arena.c arena.h
cached.o: cached.c cached.h
pool.o: pool.c pool.h
clean:
$(RM) $(ALL) *.o
check:
cppcheck --enable=all --std=c11 *.[ch]
format:
clang-format -i *.[ch]
.PHONY: dev prod musl check clean format
|