summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
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