--- makefile	1996-01-17 10:37:51.000000000 +0100
+++ makefile	2005-11-05 16:17:24.000000000 +0100
@@ -25,8 +25,8 @@
 #
 # set the destination directories for the library and include files
 #
-LIBDEST		= $(HOME)/lib$(ARCH_EXT)
-INCDEST		= $(HOME)/include
+LIBDEST		= $(DESTDIR)$(prefix)/lib
+INCDEST		= $(DESTDIR)$(prefix)/include
 
 #
 # the following text was created automaticaly. You should change it carefully.
@@ -35,8 +35,10 @@
 SHELL		= /bin/sh
 
 LIBNAME		= laspack
+VERSION		= 1.12.3
 
 LIBRARY		= lib$(LIBNAME).a
+DYLIB		= lib$(LIBNAME).$(VERSION).dylib
 
 HDRS		= copyrght.h \
 		eigenval.h \
@@ -111,7 +113,7 @@
 
 LPFLAGS		= 
 
-all:		$(LIBRARY)
+all:		$(LIBRARY) $(DYLIB)
 
 clean:;		@rm -rf $(OBJS) core
 
@@ -147,7 +149,7 @@
 
 index:;		@ctags -wx $(HDRS) $(SRCS)
 
-install:	$(LIBRARY)
+install:	$(LIBRARY) $(DYLIB)
 		@echo Installing $(LIBRARY) in $(LIBDEST)
 		@if [ $(LIBDEST) != . ]; then rm -f $(LIBDEST)/$(LIBRARY); fi
 		@if [ $(LIBDEST) != . ]; then $(INSTALL) -f $(LIBRARY) $(LIBDEST); fi
@@ -160,6 +162,8 @@
 		@chmod 755 $(INCDEST)/$(LIBNAME)
 		@cp *.h $(INCDEST)/$(LIBNAME)
 		@chmod 644 $(INCDEST)/$(LIBNAME)/*
+		$(INSTALL) $(DYLIB) $(LIBDEST)
+		cd $(LIBDEST) && ln -s $(DYLIB) lib$(LIBNAME).dylib
 
 install-local:	$(LIBRARY)
 		@echo Installing $(LIBRARY) in $(LIBLOCAL)
@@ -206,6 +210,9 @@
 		@ar $(ARFLAGS) $(LIBRARY) $(OBJS)
 		@ranlib $(LIBRARY)
 
+$(DYLIB): $(OBJS) $(MAKEFILE)
+		$(CC) -fno-common -dynamiclib $(OBJS) -o $@ -install_name $(LIBLOCAL)/$@
+
 $(LIBDEST)/$(LIBRARY):  $(HDRS) $(EXTHDRS) $(SRCS) $(LIBS) 
 		@$(MAKE) -f $(MAKEFILE) install
 
