summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAli Nehzat <ali.nehzat@thanks.dev>2024-02-02 02:18:53 +1100
committerGitHub <noreply@github.com>2024-02-01 17:18:53 +0200
commitd71ac90985854b0905e1abba778e407e17f9f887 (patch)
tree22b6870b0f72eda9f09f0cc733b7e338538431ef
parentce32060198b7e2d6a13a9b8e1e1369e3c295ae2a (diff)
make : generate .a library for static linking (#5205)
-rw-r--r--Makefile5
1 files changed, 4 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 781f0bf8..bf9e085d 100644
--- a/Makefile
+++ b/Makefile
@@ -586,8 +586,11 @@ train.o: common/train.cpp common/train.h
libllama.so: llama.o ggml.o $(OBJS)
$(CXX) $(CXXFLAGS) -shared -fPIC -o $@ $^ $(LDFLAGS)
+libllama.a: llama.o ggml.o $(OBJS) $(COMMON_DEPS)
+ ar rcs libllama.a llama.o ggml.o $(OBJS) $(COMMON_DEPS)
+
clean:
- rm -vrf *.o tests/*.o *.so *.dll benchmark-matmult common/build-info.cpp *.dot $(COV_TARGETS) $(BUILD_TARGETS) $(TEST_TARGETS)
+ rm -vrf *.o tests/*.o *.so *.a *.dll benchmark-matmult common/build-info.cpp *.dot $(COV_TARGETS) $(BUILD_TARGETS) $(TEST_TARGETS)
#
# Examples