From fcb865786b524917aa9d3df8745aca66716794bf Mon Sep 17 00:00:00 2001
From: Mate Soos <soos.mate@gmail.com>
Date: Sun, 2 Jun 2024 21:50:06 -0400
Subject: [PATCH] Also add a dynamic library

---
Liliana Marie Prikler <liliana.prikler@gmail.com>:
  Added -L.
  Squashed fix for cadical and mobical.

 makefile.in | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/makefile.in b/makefile.in
index 5e1c1b3a..de3fe975 100644
--- a/makefile.in
+++ b/makefile.in
@@ -38,7 +38,7 @@ COMPILE=$(CXX) $(CXXFLAGS) -I$(DIR) -I../src
 
 #--------------------------------------------------------------------------#
 
-all: libcadical.a cadical mobical
+all: libcadical.so libcadical.a cadical mobical
 
 #--------------------------------------------------------------------------#
 
@@ -53,14 +53,17 @@ all: libcadical.a cadical mobical
 # tester 'mobical') and the library are the main build targets.
 
 cadical: cadical.o libcadical.a makefile
-	$(COMPILE) -o $@ $< -L. -lcadical $(LIBS)
+	$(COMPILE) -static -o $@ $< -L. -lcadical $(LIBS)
 
 mobical: mobical.o libcadical.a makefile $(LIBS)
-	$(COMPILE) -o $@ $< -L. -lcadical
+	$(COMPILE) -static -o $@ $< -L. -lcadical
 
 libcadical.a: $(OBJ_SOLVER) $(OBJ_CONTRIB) makefile
 	ar rc $@ $(OBJ_SOLVER) $(OBJ_CONTRIB)
 
+libcadical.so: $(OBJ_SOLVER) $(OBJ_CONTRIB) $(LIBS) makefile
+	$(COMPILE) -shared -o $@ $(OBJ_SOLVER) $(OBJ_CONTRIB) $(LIBS)
+
 #--------------------------------------------------------------------------#
 
 # Note that 'build.hpp' is generated and resides in the build directory.
