summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorSadeep Madurange <sadeep@asciimx.com>2026-08-18 18:22:17 +0800
committerSadeep Madurange <sadeep@asciimx.com>2026-08-18 18:22:17 +0800
commit2ab3377227359c46b835899de91d9526cf7d2044 (patch)
tree114dd3077d4fdcd02e53f17e761964065a97e630 /Makefile
parent82680bc3350807c532d0aeb714cb5360da9293f0 (diff)
downloadlex-2ab3377227359c46b835899de91d9526cf7d2044.tar.gz
Change name lexd, add make install.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile15
1 files changed, 14 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index c6f9cb4..4dec12f 100644
--- a/Makefile
+++ b/Makefile
@@ -4,6 +4,12 @@ CFLAGS = -march=native -O2 -std=c11 -Wall -Wextra
CXXFLAGS = -march=native -O2 -O2 -Wall -Wextra
INCLUDES = -I. -Ideps/include
+# Standard tools and target directory
+BINDIR = /usr/local/bin
+INSTALL = install
+INSTALL_PROGRAM = $(INSTALL) -m 755
+MKDIR_P = mkdir -p
+
LLAMA_TAG = b10107
LLAMA_URL = https://github.com/ggml-org/llama.cpp/archive/refs/tags/$(LLAMA_TAG).tar.gz
LLAMA_TAR = deps/llama-$(LLAMA_TAG).tar.gz
@@ -17,7 +23,7 @@ STATIC_LIBS = deps/lib/libllama.a \
# System flags required for static linking llama on OpenBSD
SYS_LIBS = -static -pthread -lm -lc++ -lc++abi
-TARGET = lex
+TARGET = lexd
SRC = llm.c main.c
OBJS = $(SRC:.c=.o)
@@ -79,6 +85,13 @@ deps/lib/libllama.a deps/lib/libggml.a deps/lib/libggml-cpu.a:
@echo "===> Cleaning up build directory..."
rm -rf $(LLAMA_SRC_DIR)
+install: $(TARGET)
+ $(MKDIR_P) $(DESTDIR)$(BINDIR)
+ $(INSTALL_PROGRAM) $(TARGET) $(DESTDIR)$(BINDIR)/$(TARGET)
+
+uninstall:
+ rm -f $(DESTDIR)$(BINDIR)/$(TARGET)
+
clean:
rm -f $(TARGET) $(OBJS)