2
1

0001-build-static-lib.patch 1.1 KB

123456789101112131415161718192021222324252627282930313233
  1. From 43a6b4c7b3a63b1cd7f1ed2772a1147be892560f Mon Sep 17 00:00:00 2001
  2. From: Marcus Hoffmann <marcus.hoffmann@othermo.de>
  3. Date: Wed, 9 Apr 2025 16:03:59 +0200
  4. Subject: [PATCH] Makefile: add a rule to build a static library
  5. Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
  6. [Fabrice: update for 2.43]
  7. Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
  8. [Marcus: update for 2.48]
  9. Signed-off-by: Marcus Hoffmann <marcus.hoffmann@othermo.de>
  10. ---
  11. Makefile | 5 +++++
  12. 1 file changed, 5 insertions(+)
  13. diff --git a/Makefile b/Makefile
  14. index 4f22d17..5cf9b26 100644
  15. --- a/Makefile
  16. +++ b/Makefile
  17. @@ -16,6 +16,11 @@ all: train predict
  18. lib: linear.o newton.o blas/blas.a
  19. $(CXX) $(SHARED_LIB_FLAG) linear.o newton.o blas/blas.a -o liblinear.so.$(SHVER)
  20. +# Keeping blas/blas.a as a pre-requisite, to ensure all .o files are built
  21. +static-lib: linear.o newton.o blas/blas.a
  22. + $(AR) rcv liblinear.a linear.o newton.o blas/*.o
  23. + $(RANLIB) liblinear.a
  24. +
  25. train: newton.o linear.o train.c blas/blas.a
  26. $(CXX) $(CFLAGS) -o train train.c newton.o linear.o $(LIBS)
  27. --
  28. 2.43.0