From 6aeaa171dc1ca43392f53cbd02097f76e1b1c5a0 Mon Sep 17 00:00:00 2001 From: David Moc Date: Sun, 31 May 2026 03:47:04 +0200 Subject: Hardened API, tetris, MD-View --- Makefile | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 1b15d60..8fa967e 100644 --- a/Makefile +++ b/Makefile @@ -3,16 +3,16 @@ CC = clang STATIC_LIB = include/libccdjit.a SHARED_LIB = include/libccdjit.so -SRC = src/main.c src/app.c src/render.c src/font.c src/util.c src/buffers.c src/ecex.c src/config.c src/eval.c +SRC = src/main.c src/app.c src/completion.c src/path.c src/media.c src/render.c src/font.c src/util.c src/buffers.c src/ecex.c src/config.c src/eval.c BIN = bin/ecex PKG_CFLAGS = $(shell pkg-config --cflags glfw3) PKG_LIBS = $(shell pkg-config --libs glfw3) -CFLAGS = -std=c11 -Wall -Wextra -pedantic -Iinclude $(PKG_CFLAGS) +CFLAGS ?= -std=c11 -Wall -Wextra -pedantic -Iinclude $(PKG_CFLAGS) LDLIBS = $(PKG_LIBS) -lGL -lm -.PHONY: all static shared clean run +.PHONY: all static shared clean run check sanitize debug release all: static @@ -27,5 +27,20 @@ shared: $(SRC) $(SHARED_LIB) run: static LD_LIBRARY_PATH=include ./$(BIN) +debug: CFLAGS += -O0 -g3 -DDEBUG +debug: static + +release: CFLAGS += -O2 -DNDEBUG +release: static + +sanitize: CFLAGS += -O1 -g -fsanitize=address,undefined -fno-omit-frame-pointer +sanitize: LDLIBS += -fsanitize=address,undefined +sanitize: static + +check: + @mkdir -p bin + $(CC) -std=c11 -Wall -Wextra -pedantic -Iinclude tests/test_core.c src/buffers.c src/completion.c src/path.c src/util.c -o bin/ecex-tests + ./bin/ecex-tests + clean: - rm -f $(BIN) + rm -f $(BIN) bin/ecex-tests -- cgit v1.2.3