diff options
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 |
