From 2ab3377227359c46b835899de91d9526cf7d2044 Mon Sep 17 00:00:00 2001 From: Sadeep Madurange Date: Tue, 18 Aug 2026 18:22:17 +0800 Subject: Change name lexd, add make install. --- Makefile | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'Makefile') 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) -- cgit v1.2.3