--- Makefile.pre.in	2005-03-29 01:23:01.000000000 +0200
+++ Makefile.pre.in	2006-01-29 12:55:03.000000000 +0100
@@ -56,7 +56,7 @@
 OPT=		@OPT@
 BASECFLAGS=	@BASECFLAGS@
 CFLAGS=		$(BASECFLAGS) $(OPT)
-CPPFLAGS=	-I. -I$(srcdir)/Include
+CPPFLAGS=	@CPPFLAGS@ -I. -I$(srcdir)/Include
 LDFLAGS=	@LDFLAGS@
 LDLAST=		@LDLAST@
 SGI_ABI=	@SGI_ABI@
@@ -305,7 +305,7 @@
 # Rules
 
 # Default target
-all:		$(BUILDPYTHON) oldsharedmods sharedmods
+all:		$(BUILDPYTHON) oldsharedmods sharedmods libpython$(VERSION).dylib
 
 # Build the interpreter
 $(BUILDPYTHON):	Modules/$(MAINOBJ) $(LIBRARY) $(LDLIBRARY)
@@ -360,6 +360,10 @@
 libpython$(VERSION).sl: $(LIBRARY_OBJS)
 	$(LDSHARED) -o $@ $(LIBRARY_OBJS) $(LIBC) $(LIBM)
 
+libpython$(VERSION).dylib: $(LIBRARY_OBJS)
+	$(LINKCC) -dynamiclib -install_name $(LIBDIR)/$@ -current_version $(VERSION) -compatibility_version $(VERSION) -o $@ -flat_namespace -undefined suppress $(LIBRARY_OBJS) $(SHLIBS) $(LIBC) $(LIBM)
+
+
 # This rule is here for OPENSTEP/Rhapsody/MacOSX. It builds a temporary
 # minimal framework (not including the Lib directory and such) in the current
 # directory.
@@ -625,7 +629,12 @@
 				(cd $(DESTDIR)$(LIBDIR); $(LN) -sf $(INSTSONAME) libpython$(VERSION)$(SO)); \
 			fi \
 		fi; \
-	else	true; \
+	else \
+		if test -f libpython$(VERSION).dylib; then \
+			$(INSTALL_SHARED) libpython$(VERSION).dylib $(DESTDIR)$(LIBDIR)/libpython$(VERSION).dylib; \
+		else \
+			true; \
+		fi \
 	fi
 
 # Install the manual page
