--- Makefile.orig 2023-07-02 10:15:42.000000000 -0400 +++ Makefile 2023-08-25 00:00:00.000000000 -0700 @@ -15,7 +15,6 @@ MKDIR = mkdir -p INSTALL_PROGRAM = $(INSTALL) -m 0755 INSTALL_DATA = $(INSTALL) -m 0644 -SO_SUFFIX = so API_VERSION = $(shell grep -m 1 '^.define LIBJODYCODE_VER ' libjodycode.h | sed 's/[^"]*"//;s/\..*//') # Make Configuration @@ -30,9 +29,13 @@ CROSS_DETECT = $(shell true | $(CC) -dM -E - | grep -m 1 __x86_64 || echo "cross") ifeq ($(UNAME_S), Darwin) - LINK_OPTIONS += -Wl,-install_name,$(PROGRAM_NAME).$(SO_SUFFIX).$(API_VERSION) -else - LINK_OPTIONS += -Wl,-soname,$(PROGRAM_NAME).$(SO_SUFFIX).$(API_VERSION) + SO_SUFFIX = + DYLIB_SUFFIX = .dylib + LINK_OPTIONS += -Wl,-install_name,$(LIB_DIR)/$(PROGRAM_NAME)$(SO_SUFFIX).$(API_VERSION)$(DYLIB_SUFFIX) -compatibility_version $(API_VERSION) -current_version $(VERSION) +else + SO_SUFFIX = .so + DYLIB_SUFFIX = + LINK_OPTIONS += -Wl,-soname,$(PROGRAM_NAME)$(SO_SUFFIX).$(API_VERSION)$(DYLIB_SUFFIX) endif # Don't use unsupported compiler options on gcc 3/4 (Mac OS X 10.5.8 Xcode) @@ -49,7 +52,8 @@ ifeq ($(OS), Windows_NT) ifndef NO_WINDOWS ON_WINDOWS=1 - SO_SUFFIX=dll + SO_SUFFIX=.dll + DYLIB_SUFFIX= endif endif @@ -124,9 +128,9 @@ -@test "$(CROSS_DETECT)" = "cross" && echo "NOTICE: SIMD disabled: !x86_64 or a cross-compiler detected (CC = $(CC))" || true sharedlib: $(OBJS) $(SIMD_OBJS) - $(CC) -shared -o $(PROGRAM_NAME).$(SO_SUFFIX).$(VERSION) $(OBJS) $(SIMD_OBJS) $(LDFLAGS) $(CFLAGS) $(CFLAGS_EXTRA) - $(LN) $(PROGRAM_NAME).$(SO_SUFFIX).$(VERSION) $(PROGRAM_NAME).$(SO_SUFFIX).$(VERSION_MAJOR) - $(LN) $(PROGRAM_NAME).$(SO_SUFFIX).$(VERSION_MAJOR) $(PROGRAM_NAME).$(SO_SUFFIX) + $(CC) -shared -o $(PROGRAM_NAME)$(SO_SUFFIX).$(VERSION)$(DYLIB_SUFFIX) $(OBJS) $(SIMD_OBJS) $(LDFLAGS) $(CFLAGS) $(CFLAGS_EXTRA) + $(LN) $(PROGRAM_NAME)$(SO_SUFFIX).$(VERSION)$(DYLIB_SUFFIX) $(PROGRAM_NAME)$(SO_SUFFIX).$(VERSION_MAJOR)$(DYLIB_SUFFIX) + $(LN) $(PROGRAM_NAME)$(SO_SUFFIX).$(VERSION_MAJOR)$(DYLIB_SUFFIX) $(PROGRAM_NAME)$(SO_SUFFIX)$(DYLIB_SUFFIX) staticlib: $(OBJS) $(SIMD_OBJS) $(AR) rcs libjodycode.a $(OBJS) $(SIMD_OBJS) @@ -170,9 +174,9 @@ test -e $(DESTDIR)$(MAN7_DIR) || $(MKDIR) $(DESTDIR)$(MAN7_DIR) installfiles: - $(INSTALL_PROGRAM) $(PROGRAM_NAME).$(SO_SUFFIX).$(VERSION) $(DESTDIR)$(LIB_DIR)/$(PROGRAM_NAME).$(SO_SUFFIX).$(VERSION) - $(LN) $(PROGRAM_NAME).$(SO_SUFFIX).$(VERSION) $(DESTDIR)$(LIB_DIR)/$(PROGRAM_NAME).$(SO_SUFFIX).$(VERSION_MAJOR) - $(LN) $(PROGRAM_NAME).$(SO_SUFFIX).$(VERSION_MAJOR) $(DESTDIR)$(LIB_DIR)/$(PROGRAM_NAME).$(SO_SUFFIX) + $(INSTALL_PROGRAM) $(PROGRAM_NAME)$(SO_SUFFIX).$(VERSION)$(DYLIB_SUFFIX) $(DESTDIR)$(LIB_DIR)/$(PROGRAM_NAME)$(SO_SUFFIX).$(VERSION)$(DYLIB_SUFFIX) + $(LN) $(PROGRAM_NAME)$(SO_SUFFIX).$(VERSION)$(DYLIB_SUFFIX) $(DESTDIR)$(LIB_DIR)/$(PROGRAM_NAME)$(SO_SUFFIX).$(VERSION_MAJOR)$(DYLIB_SUFFIX) + $(LN) $(PROGRAM_NAME)$(SO_SUFFIX).$(VERSION_MAJOR)$(DYLIB_SUFFIX) $(DESTDIR)$(LIB_DIR)/$(PROGRAM_NAME)$(SO_SUFFIX)$(DYLIB_SUFFIX) $(INSTALL_DATA) $(PROGRAM_NAME).a $(DESTDIR)$(LIB_DIR)/$(PROGRAM_NAME).a $(INSTALL_DATA) $(PROGRAM_NAME).h $(DESTDIR)$(INC_DIR)/$(PROGRAM_NAME).h $(INSTALL_DATA) $(PROGRAM_NAME).7 $(DESTDIR)$(MAN7_DIR)/$(PROGRAM_NAME).7 @@ -185,9 +189,9 @@ -test -e $(DESTDIR)$(MAN7_DIR) && $(RMDIR) $(DESTDIR)$(MAN7_DIR) uninstallfiles: - $(RM) $(DESTDIR)$(LIB_DIR)/$(PROGRAM_NAME).$(SO_SUFFIX).$(VERSION) - $(RM) $(DESTDIR)$(LIB_DIR)/$(PROGRAM_NAME).$(SO_SUFFIX).$(VERSION_MAJOR) - $(RM) $(DESTDIR)$(LIB_DIR)/$(PROGRAM_NAME).$(SO_SUFFIX) + $(RM) $(DESTDIR)$(LIB_DIR)/$(PROGRAM_NAME)$(SO_SUFFIX).$(VERSION)$(DYLIB_SUFFIX) + $(RM) $(DESTDIR)$(LIB_DIR)/$(PROGRAM_NAME)$(SO_SUFFIX).$(VERSION_MAJOR)$(DYLIB_SUFFIX) + $(RM) $(DESTDIR)$(LIB_DIR)/$(PROGRAM_NAME)$(SO_SUFFIX)$(DYLIB_SUFFIX) $(RM) $(DESTDIR)$(LIB_DIR)/$(PROGRAM_NAME).a $(RM) $(DESTDIR)$(INC_DIR)/$(PROGRAM_NAME).h $(RM) $(DESTDIR)$(MAN7_DIR)/$(PROGRAM_NAME).7 @@ -198,14 +202,14 @@ ./test.sh stripped: sharedlib staticlib - strip --strip-unneeded libjodycode.$(SO_SUFFIX) + strip --strip-unneeded libjodycode$(SO_SUFFIX)$(DYLIB_SUFFIX) strip --strip-debug libjodycode.a objsclean: $(RM) $(OBJS) $(SIMD_OBJS) vercheck.o clean: objsclean - $(RM) $(PROGRAM_NAME).$(SO_SUFFIX) $(PROGRAM_NAME).$(SO_SUFFIX).$(VERSION_MAJOR) $(PROGRAM_NAME).$(SO_SUFFIX).$(VERSION) + $(RM) $(PROGRAM_NAME)$(SO_SUFFIX)$(DYLIB_SUFFIX) $(PROGRAM_NAME)$(SO_SUFFIX).$(VERSION_MAJOR)$(DYLIB_SUFFIX) $(PROGRAM_NAME)$(SO_SUFFIX).$(VERSION)$(DYLIB_SUFFIX) $(RM) apiver vercheck *.a *~ helper_code/*~ libjodycode.so.* libjodycode.dll.* .*.un~ *.gcno *.gcda *.gcov distclean: objsclean clean