--- Makefile.orig	Tue Oct 13 18:11:42 1998
+++ Makefile	Sun Apr 29 23:24:10 2001
@@ -6,7 +6,7 @@
 VERSION		= $(VERMAJ).$(VERMIN).$(VERPAT)
 
 # Define SHARED as 1 for Linux shared ELF library
-#SHARED		= 1
+SHARED		= 1
 
 ifeq ($(SHARED),1)
 LIBTARGET	= lib$(DIST).so.$(VERSION)
@@ -20,19 +20,19 @@
 LIBHEAD		= $(DIST).h
 TARGETS		= $(LIBTARGET)
 
-INSTBASEDIR	= /usr/local
+INSTBASEDIR	= ${PREFIX}
 INSTLIBDIR	= $(INSTBASEDIR)/lib
 INSTINCDIR	= $(INSTBASEDIR)/include
-INSTALL		= install -m 644
-INSTALLPROG	= install -m 755
-MKDIRP		= install -d -m 755
+INSTALL		= ${BSD_INSTALL_DATA}
+INSTALLPROG	= ${BSD_INSTALL_PROGRAM}
+MKDIRP		= mkdir -p
 
-CC		= gcc
-OPTIM		= -O2
+#CC		= gcc
+OPTIM		= $(CFLAGS)
 
 INCDIR		= -I.
 
-CCOPT		= -s -Wall $(OPTIM) $(INCDIR)
+CCOPT		= $(INCDIR) $(CFLAGS)
 
 # Object files to store in the library
 LIBOBJS		= vars.o streams.o progname.o \
@@ -43,7 +43,7 @@
 
 $(LIBTARGET): $(LIBOBJS)
 ifeq ($(SHARED),1)
-	$(CC) -shared -Wl,-soname,$(LIBTARGETSOMAJ) -o $(LIBTARGET) $(LIBOBJS)
+	$(CC) -shared -Wl,-soname,$(LIBTARGETSOMAJ) -o $(LIBTARGETSOMAJ) $(LIBOBJS)
 else
 	ar rcs $(LIBTARGET) $(LIBOBJS)
 endif
@@ -56,12 +56,10 @@
 
 install: $(LIBTARGET)
 	$(MKDIRP) $(INSTLIBDIR) $(INSTINCDIR)
-	$(INSTALL) $(LIBTARGET) $(INSTLIBDIR)
+	$(INSTALL) $(LIBTARGETSOMAJ) $(INSTLIBDIR)
 	$(INSTALL) $(LIBHEAD) $(INSTINCDIR)
 ifeq ($(SHARED),1)
-	ln -sf $(LIBTARGET) $(INSTLIBDIR)/$(LIBTARGETSOMAJ)
 	ln -sf $(LIBTARGETSOMAJ) $(INSTLIBDIR)/$(LIBTARGETSO)
-	echo "If you use GNU/Linux, remember to run ldconfig"
 endif
 
 clean:
