Files
ke/Makefile

41 lines
858 B
Makefile
Raw Permalink Normal View History

2025-11-23 00:19:25 -08:00
TARGET := ke
2025-11-24 13:57:10 -08:00
KE_VERSION := devel
DEST := $(HOME)/.local/bin/$(TARGET)
2025-11-23 00:19:25 -08:00
CFLAGS := -Wall -Wextra -pedantic -Wshadow -Werror -std=c99 -g
2025-11-24 22:59:09 -08:00
CFLAGS += -Wno-unused-result
2025-11-23 00:19:25 -08:00
CFLAGS += -D_DEFAULT_SOURCE -D_XOPEN_SOURCE
2025-11-24 22:59:09 -08:00
CFLAGS += -fsanitize=address -fno-omit-frame-pointer
2025-11-23 00:19:25 -08:00
LDFLAGS := -fsanitize=address
2025-11-23 19:15:19 -08:00
all: $(TARGET) test.txt
2025-11-23 00:19:25 -08:00
2025-11-28 02:27:19 -08:00
SRCS := main.c abuf.c term.c buffer.c editor.c core.c
HDRS := abuf.h term.h buffer.h editor.h core.h
2025-11-28 00:24:53 -08:00
$(TARGET): $(SRCS)
$(CC) $(CFLAGS) -o $(TARGET) $(SRCS) $(LDFLAGS)
2025-11-23 11:48:46 -08:00
2025-11-24 13:57:10 -08:00
.PHONY: install
#install: $(TARGET)
install:
cp $(TARGET) $(DEST)
2025-11-23 11:48:46 -08:00
clean:
2025-11-23 19:15:19 -08:00
rm -f $(TARGET)
2025-11-24 19:17:06 -08:00
rm -f asan.log*
2025-11-23 19:15:19 -08:00
.PHONY: test.txt
test.txt:
2025-11-24 13:57:10 -08:00
cp test.txt.bak $@
.PHONY: gdb
gdb:
@test -f $(TARGET).pid || (echo "error: $(TARGET).pid not found" >&2; exit 1)
@gdb -p $$(cat $(TARGET).pid | tr -d ' \t\n\r') ./$(TARGET)
2025-11-28 02:27:19 -08:00
.PHONY: cloc
cloc:
cloc $(SRCS) $(HDRS)