--- Makefile.in	2003-12-14 17:35:03.000000000 -0800
+++ Makefile.in	2005-08-12 11:49:13.000000000 -0700
@@ -95,9 +95,9 @@
 TAGFILES = \
 	$(SRC) $(HDR) $(TAGHDR)
 
-CLEANFILES = $(OBJ) libpcap.a $(GENSRC) $(GENHDR) lex.yy.c
+CLEANFILES = $(OBJ) libpcap.a libpcap.$(DYEXT) $(GENSRC) $(GENHDR) lex.yy.c
 
-all: libpcap.a
+all: libpcap.a shared
 
 libpcap.a: $(OBJ)
 	@rm -f $@
@@ -116,11 +116,11 @@
 
 # the following rule succeeds, but the result is untested.
 libpcap.dylib: $(OBJ)
-	rm -f libpcap*.dylib
-	$(CC) -dynamiclib -undefined error -o libpcap.`cat VERSION`.dylib $(OBJ) \
-		-install_name $(libdir)/libpcap.0.dylib -compatibility_version `cat VERSION` \
-		-current_version `cat VERSION`
-
+	rm -f $@
+	$(CC) -dynamiclib -o libpcap.`cat VERSION`.dylib \
+		-install_name $(libdir)/libpcap.0.dylib \
+		-compatibility_version 1.0.0 -current_version `cat VERSION` \
+		$(OBJ) $(LIBS)
 
 scanner.c: $(srcdir)/scanner.l
 	@rm -f $@
@@ -170,7 +170,7 @@
 bpf_filter.o: bpf_filter.c
 	$(CC) $(CFLAGS) -c bpf_filter.c
 
-install: libpcap.a 
+install: libpcap.a install-shared
 	[ -d $(DESTDIR)$(libdir) ] || \
 	    (mkdir -p $(DESTDIR)$(libdir); chmod 755 $(DESTDIR)$(libdir))
 	$(INSTALL_DATA) libpcap.a $(DESTDIR)$(libdir)/libpcap.a
