Blob Blame History Raw
--- makefile.in.orig	2021-10-27 05:04:52.000000000 -0600
+++ makefile.in	2021-10-28 08:09:54.761020764 -0600
@@ -9,6 +9,7 @@
 
 CXX=@CXX@
 CXXFLAGS=@CXXFLAGS@
+LDFLAGS=@LDFLAGS@
 
 LIBS=@LIBS@
 
@@ -26,7 +27,7 @@ COMPILE=$(CXX) $(CXXFLAGS) -I$(DIR)
 
 #--------------------------------------------------------------------------#
 
-all: libcadical.a cadical mobical
+all: libcadical.so cadical mobical
 
 #--------------------------------------------------------------------------#
 
@@ -40,11 +41,17 @@ all: libcadical.a cadical mobical
 # Application binaries (the stand alone solver 'cadical' and the model based
 # tester 'mobical') and the library are the main build targets.
 
-cadical: cadical.o libcadical.a makefile
-	$(COMPILE) -o $@ $< -L. -lcadical $(LIBS)
+cadical: cadical.o libcadical.so makefile
+	$(COMPILE) -o $@ $< $(LDFLAGS) -L. -lcadical $(LIBS)
 
-mobical: mobical.o libcadical.a makefile $(LIBS)
-	$(COMPILE) -o $@ $< -L. -lcadical
+mobical: mobical.o libcadical.so makefile $(LIBS)
+	$(COMPILE) -o $@ $< $(LDFLAGS) -L. -lcadical
+
+libcadical.so: $(OBJ) makefile
+	rm -f $@
+	$(COMPILE) -shared -Wl,-h,libcadical.so.0 -o libcadical.so.0.0.0 $(LDFLAGS) $(OBJ)
+	ln -s libcadical.so.0.0.0 libcadical.so.0
+	ln -s libcadical.so.0 $@
 
 libcadical.a: $(OBJ) makefile
 	ar rc $@ $(OBJ)
--- test/api/run.sh.orig	2021-10-27 05:04:52.000000000 -0600
+++ test/api/run.sh	2021-10-28 08:08:49.614034462 -0600
@@ -28,8 +28,8 @@ die "needs to be called from a top-level
 [ -f "$CADICALBUILD/makefile" ] || \
   die "can not find '$CADICALBUILD/makefile' (run 'configure' first)"
 
-[ -f "$CADICALBUILD/libcadical.a" ] || \
-  die "can not find '$CADICALBUILD/libcadical.a' (run 'make' first)"
+[ -f "$CADICALBUILD/libcadical.so" ] || \
+  die "can not find '$CADICALBUILD/libcadical.so' (run 'make' first)"
 
 cecho -n "$HILITE"
 cecho "---------------------------------------------------------"