# Copyright (c) 1998, Regents of the University of California
#
# IDENTIFICATION
-# $PostgreSQL: pgsql/src/Makefile.shlib,v 1.73 2003/11/29 19:51:39 pgsql Exp $
+# $PostgreSQL: pgsql/src/Makefile.shlib,v 1.74 2003/12/01 22:23:06 momjian Exp $
#
#-------------------------------------------------------------------------
shlib := $(NAME)$(DLSUFFIX)
endif
+ifeq ($(PORTNAME), win32)
+ shlib := lib$(NAME)$(DLSUFFIX)
+endif
+
ifeq ($(PORTNAME), beos)
shlib := lib$(NAME)$(DLSUFFIX)
LINK.shared = $(LD) -nostart
all-shared-lib: $(shlib)
ifneq ($(PORTNAME), cygwin)
+ifneq ($(PORTNAME), win32)
ifndef LORDER
MK_NO_LORDER := true
endif
$(RANLIB) $@
+endif # not win32
endif # not cygwin
ifeq ($(enable_shared), yes)
ifneq ($(PORTNAME), beos)
ifneq ($(PORTNAME), cygwin)
+ifneq ($(PORTNAME), win32)
ifneq ($(PORTNAME), aix)
# Normal case
endif # PORTNAME == aix
+else # PORTNAME == win32
+
+# win32 case
+$(shlib) lib$(NAME).a: $(OBJS)
+ $(DLLTOOL) --export-all --output-def $(NAME).def $(OBJS)
+ $(DLLWRAP) -o $(shlib) --dllname $(shlib) --def $(NAME).def $(OBJS) $(SHLIB_LINK)
+ $(DLLTOOL) --dllname $(shlib) --def $(NAME).def --output-lib lib$(NAME).a
+
+endif # PORTNAME == win32
+
else # PORTNAME == cygwin
# Cygwin case
install-lib-shared: $(shlib)
$(INSTALL_SHLIB) $< $(DESTDIR)$(libdir)/$(shlib)
ifneq ($(PORTNAME), cygwin)
+ifneq ($(PORTNAME), win32)
ifneq ($(shlib), lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION))
cd $(DESTDIR)$(libdir) && \
rm -f lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION) && \
$(LN_S) $(shlib) lib$(NAME)$(DLSUFFIX)
endif
+endif # not win32
endif # not cygwin
endif # enable_shared
ifeq ($(PORTNAME), cygwin)
rm -f $(NAME).dll $(NAME).def
endif
+
+ifeq ($(PORTNAME), win32)
+ rm -f $(NAME).dll $(NAME).def
+endif