--- Makefile.in	2005-10-04 14:59:49.000000000 +0200
+++ Makefile.in	2007-12-05 17:16:21.000000000 +0100
@@ -5,6 +5,7 @@
 LIBDIR		= @libdir@
 MANDIR		= @mandir@
 INCLUDEDIR	= @includedir@
+VERSION		= 1.5.2
 
 @SET_MAKE@
 
@@ -25,6 +26,9 @@
 UNEXECUTABLE	= $(BINDIR)/$(UNNAMEEXE)
 LIBNAME		= lib$(NAME).a
 LIBRARY		= $(LIBDIR)/$(LIBNAME)
+DYLIBSHORT	= lib$(NAME).dylib
+DYLIBNAME	= lib$(NAME).0.dylib
+DYLIBLONGNAME	= lib$(NAME).$(VERSION).dylib
 MAN1DIR		= $(MANDIR)/man1
 MAN3DIR		= $(MANDIR)/man3
 OBJECTS		= arith.o file.o compress.o gen.o uncompface.o
@@ -43,7 +47,7 @@
 LDFLAGS		= @LDFLAGS@
 LIBS		= @LIBS@
 
-all:		$(NAMEEXE) $(UNNAMEEXE)
+all:		$(NAMEEXE) $(UNNAMEEXE) $(DYLIBLONGNAME)
 
 $(NAMEEXE) :	cmain.o compface.o $(LIBNAME)
 		$(CC) $(LDFLAGS) -o $@ cmain.o compface.o $(LIBNAME)
@@ -55,6 +59,9 @@
 		ar rc $(LIBNAME) $(OBJECTS)
 		-$(RANLIB) $(LIBNAME)
 
+$(DYLIBLONGNAME) :	$(OBJECTS)
+		$(CC) -dynamiclib $(CFLAGS) $(LDFLAGS) -install_name $(LIBDIR)/$(DYLIBNAME) -current_version $(VERSION) -compatibility_version $(VERSION) -o $(DYLIBLONGNAME) $(OBJECTS)
+
 lint :
 		lint -abchx $(SOURCES)
 
@@ -74,19 +81,22 @@
 		$(RM) -rf `cat .fname` .fname
 
 install: 	$(NAMEEXE) $(UNNAMEEXE) $(LIBNAME)
-		$(INSTALL_PROGRAM) -d $(BINDIR) $(LIBDIR) $(MAN1DIR) $(MAN3DIR) $(INCLUDEDIR)
-		$(INSTALL_PROGRAM) $(srcdir)/$(NAMEEXE) $(EXECUTABLE) 
-		-chmod 0755 $(EXECUTABLE)
-		-strip $(EXECUTABLE)
-		$(INSTALL_PROGRAM) $(srcdir)/$(UNNAMEEXE) $(UNEXECUTABLE)
-		-chmod 0755 $(UNEXECUTABLE)
-		-strip $(UNEXECUTABLE)
-		$(INSTALL_DATA) $(srcdir)/$(NAME).1 $(MAN1DIR)/$(NAME).1
-		cd $(MAN1DIR) && $(RM) ./$(UNNAME).1 && $(LN_S) $(NAME).1 $(UNNAME).1
-		$(INSTALL_DATA) $(srcdir)/$(NAME).3 $(MAN3DIR)/$(NAME).3
-		cd $(MAN3DIR) && $(RM) ./$(UNNAME).3 && $(LN_S) $(NAME).3 $(UNNAME).3
-		for hdr in $(INSTALLHEADERS); do $(INSTALL_DATA) $(srcdir)/$${hdr} $(INCLUDEDIR)/$${hdr}; done
-		$(INSTALL_DATA) $(srcdir)/$(LIBNAME) $(LIBRARY)
+		$(INSTALL_PROGRAM) -d $(DESTDIR)$(BINDIR) $(DESTDIR)$(LIBDIR) $(DESTDIR)$(MAN1DIR) $(DESTDIR)$(MAN3DIR) $(DESTDIR)$(INCLUDEDIR)
+		$(INSTALL_PROGRAM) $(srcdir)/$(NAMEEXE) $(DESTDIR)$(EXECUTABLE) 
+		-chmod 0755 $(DESTDIR)$(EXECUTABLE)
+		-strip $(DESTDIR)$(EXECUTABLE)
+		$(INSTALL_PROGRAM) $(srcdir)/$(UNNAMEEXE) $(DESTDIR)$(UNEXECUTABLE)
+		-chmod 0755 $(DESTDIR)$(UNEXECUTABLE)
+		-strip $(DESTDIR)$(UNEXECUTABLE)
+		$(INSTALL_DATA) $(srcdir)/$(NAME).1 $(DESTDIR)$(MAN1DIR)/$(NAME).1
+		cd $(DESTDIR)$(MAN1DIR) && $(RM) ./$(UNNAME).1 && $(LN_S) $(NAME).1 $(UNNAME).1
+		$(INSTALL_DATA) $(srcdir)/$(NAME).3 $(DESTDIR)$(MAN3DIR)/$(NAME).3
+		cd $(DESTDIR)$(MAN3DIR) && $(RM) ./$(UNNAME).3 && $(LN_S) $(NAME).3 $(UNNAME).3
+		for hdr in $(INSTALLHEADERS); do $(INSTALL_DATA) $(srcdir)/$${hdr} $(DESTDIR)$(INCLUDEDIR)/$${hdr}; done
+		$(INSTALL_DATA) $(srcdir)/$(LIBNAME) $(DESTDIR)$(LIBRARY)
+		-$(RANLIB) $(DESTDIR)$(LIBRARY)
+		$(INSTALL_DATA) $(srcdir)/$(DYLIBLONGNAME) $(DESTDIR)$(LIBDIR)
+		cd $(DESTDIR)$(LIBDIR) && $(LN_S) $(DYLIBLONGNAME) $(DYLIBNAME) && $(LN_S) $(DYLIBLONGNAME) $(DYLIBSHORT)
 
 shar :
 		shar.script $(OTHERS) $(HDRS) $(SOURCES) > $(NAME).sh
