summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorSadeep Madurange <sadeep@asciimx.com>2026-08-15 09:06:23 +0800
committerSadeep Madurange <sadeep@asciimx.com>2026-08-15 11:20:47 +0800
commit052a27dc3605d4a81ff3424da781ed176cba4c6d (patch)
tree160b65b164dc19f7391f6f3f82dac3a0a41afb96 /Makefile
parent511ddc6ef674fd5383fb035e1db8595724b2d3c6 (diff)
downloadlex-052a27dc3605d4a81ff3424da781ed176cba4c6d.tar.gz
Add daemon mode.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile9
1 files changed, 6 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index 38babd7..93ac6f7 100644
--- a/Makefile
+++ b/Makefile
@@ -2,7 +2,7 @@ CC = cc
CXX = c++
CFLAGS = -march=native -O2 -std=c11 -Wall -Wextra
CXXFLAGS = -march=native -O2 -O2 -Wall -Wextra
-INCLUDES = -Ideps/include
+INCLUDES = -I. -Ideps/include
LLAMA_TAG = b10107
LLAMA_URL = https://github.com/ggml-org/llama.cpp/archive/refs/tags/$(LLAMA_TAG).tar.gz
@@ -18,8 +18,8 @@ STATIC_LIBS = deps/lib/libllama.a \
SYS_LIBS = -static -pthread -lm -lc++ -lc++abi
TARGET = lex
-SRC = main.c
-OBJS = main.o
+SRC = llm.c main.c
+OBJS = $(SRC:.c=.o)
.PHONY: all clean distclean
@@ -40,6 +40,9 @@ $(TARGET): deps/lib/libllama.a $(OBJS)
.c.o:
$(CC) $(CFLAGS) $(INCLUDES) -c $< -o $@
+# Rebuild objects if the shared header changes
+$(OBJS): llm.h
+
# Download llama source and build statically
deps/lib/libllama.a deps/lib/libggml.a deps/lib/libggml-cpu.a:
@mkdir -p deps/lib deps/include