summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile31
1 files changed, 17 insertions, 14 deletions
diff --git a/Makefile b/Makefile
index a1935b2..4efdf6e 100644
--- a/Makefile
+++ b/Makefile
@@ -1,28 +1,31 @@
+MAKEFLAGS += -j4
+MEX_ASSURE="cc docker"
+
+include makext.mk
+
LLAMA_DIR = llama.cpp
-LLAMA_BUILD_DIR = $(LLAMA_DIR)/build
CFLAGS = -Wall -Wextra -O3 -I$(LLAMA_DIR)/include -I$(LLAMA_DIR)/ggml/include
-LDFLAGS = -L$(LLAMA_BUILD_DIR)/src -L$(LLAMA_BUILD_DIR)/ggml/src \
+LDFLAGS = -L$(LLAMA_DIR)/build/src -L$(LLAMA_DIR)/build/ggml/src \
-lpthread -lm -ldl -lstdc++ -g \
-lllama -lggml -lggml-cpu -lggml-base
+help: .help
-# -Wl,-rpath,$(shell pwd)/$(LLAMA_BUILD_DIR)/bin \
-
-prompt: prompt.c
+prompt: prompt.c models.h # Build prompt binary for testing
$(CC) $(CFLAGS) prompt.c -o prompt $(LDFLAGS)
-llama:
- mkdir llama.cpp/build && \
- cd llama.cpp/build && \
+llamacpp: .assure # Build llama.cpp libraries
+ mkdir $(LLAMA_DIR)/build && \
+ cd $(LLAMA_DIR)/build && \
cmake ../ -DBUILD_SHARED_LIBS=OFF && \
make -j8
-clean:
- -rm -f prompt
- cd llama.cpp/build && make clean
- -rm -Rf llama.cpp/build
-
-docker:
+docker: .assure # Runs prompt in Docker container
docker build -t promptd .
docker run -it promptd bash
+
+clean: # Cleans up all the build artefacts
+ -rm -f prompt
+ cd $(LLAMA_DIR)/build && make clean
+ -rm -Rf $(LLAMA_DIR)/build