diff options
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 30 |
1 files changed, 23 insertions, 7 deletions
diff --git a/Makefile b/Makefile index 3dbb76a..2b45044 100644 --- a/Makefile +++ b/Makefile @@ -1,19 +1,35 @@ -CFLAGS=-std=gnu11 -Wall -Wextra -Wpedantic -Og -g -D_DEFAULT_SOURCE \ - -fsanitize=undefined -fsanitize=address -LDFLAGS=-fsanitize=undefined -fsanitize=address +CFLAGS+=-std=c11 -Wall -Wextra -Wpedantic +CFLAGS+=-D_DEFAULT_SOURCE ALL=bench -all: $(ALL) +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 -clean: - $(RM) $(ALL) *.o +bench.o: bench.c arena.h cached.h pool.h -.PHONY: all check clean format +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 |