diff options
| author | David Moc <personal@cdatgoose.org> | 2026-05-31 03:47:04 +0200 |
|---|---|---|
| committer | David Moc <personal@cdatgoose.org> | 2026-05-31 03:47:04 +0200 |
| commit | 6aeaa171dc1ca43392f53cbd02097f76e1b1c5a0 (patch) | |
| tree | b16f559f5a701123ebe7b15ecebb9325263b4a3c /Makefile | |
| parent | e930cc6bdc7f62befac063d7d9d016ffb0a64f1a (diff) | |
Hardened API, tetris, MD-View
Diffstat (limited to 'Makefile')
| -rw-r--r-- | Makefile | 23 |
1 files changed, 19 insertions, 4 deletions
@@ -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 |
