--- Makefile.sharedlibrary.orig	2022-02-19 03:07:19.000000000 +0545
+++ Makefile.sharedlibrary	2022-08-01 04:44:12.000000000 +0545
@@ -38,8 +38,8 @@
 endif
 ifeq ($(DETECTED_OS),Darwin)
     LD_SONAME_ARG=-install_name
-    SO_SONAME_SUFFIX=$(SONAME_VERSION).so
-    SO_REALNAME_SUFFIX=$(REAL_VERSION).so
+    SO_SONAME_SUFFIX=$(SONAME_VERSION).dylib
+    SO_REALNAME_SUFFIX=$(REAL_VERSION).dylib
 else
     LD_SONAME_ARG=-soname
     SO_SONAME_SUFFIX=so.$(SONAME_VERSION)
@@ -70,11 +70,11 @@
 # to $INSTALL_PREFIX/include on installation.
 
 libduktape.$(SO_REALNAME_SUFFIX):
-	$(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -shared -fPIC -Wall -Wextra -Os -Wl,$(LD_SONAME_ARG),libduktape.$(SO_SONAME_SUFFIX) \
+	$(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -shared -fPIC -Wall -Wextra -Os -Wl,$(LD_SONAME_ARG),$(LD_SONAME_PREFIX)libduktape.$(SO_SONAME_SUFFIX) \
 		-o $@ $(DUKTAPE_SRCDIR)/duktape.c
 
 libduktaped.$(SO_REALNAME_SUFFIX):
-	$(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -shared -fPIC -g -Wall -Wextra -Os -Wl,$(LD_SONAME_ARG),libduktaped.$(SO_SONAME_SUFFIX) \
+	$(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -shared -fPIC -g -Wall -Wextra -Os -Wl,$(LD_SONAME_ARG),$(LD_SONAME_PREFIX)libduktaped.$(SO_SONAME_SUFFIX) \
 		-o $@ $(DUKTAPE_SRCDIR)/duktape.c
 
 duktape.pc:
