# $Header: /local/home/ssinger/cvs2svn/cvs2svn-2.3.0/slony-cvsd/slony1-engine/makefiles/Makefile.win32,v 1.9 2008-04-11 15:44:22 cbbrowne Exp $

# Use replacement include files for those missing on Win32
override CPPFLAGS+=-I${pgincludeserverdir}/port/win32
override LDFLAGS:=-lpgport $(LDFLAGS)

DLLTOOL= dlltool
DLLWRAP= dllwrap
DLLINIT = -L${pglibdir} -lpostgres

AROPT = crs
DLSUFFIX = .dll
CFLAGS_SL =

%.dll: $(SO_OBJS)
	$(DLLTOOL) --export-all --output-def $*.def $^
	$(DLLWRAP) -o $@ --def $*.def $^ $(DLLINIT) $(SHLIB_LINK)
	rm -f $*.def

# Make sure all: is the default target
all:

ifeq ($(SLFILESHLIB),1)
PGFTYPE=VFT_DLL
else
PGFTYPE=VFT_APP
endif

WIN32RES = win32ver.o
win32ver.rc: $(slony_top_builddir)/src/slon/port/win32ver.rc.in
	sed -e 's;FILEDESC;$(SLFILEDESC);' -e 's;VFT_APP;$(PGFTYPE);' -e 's;SLVERSION;SLONY_I_VERSION_STRING_DEC ,'`date '+%y%j' | sed 's/^0*//'`';' $(slony_top_builddir)/src/slon/port/win32ver.rc.in > win32ver.rc
win32ver.o: win32ver.rc
	windres -i win32ver.rc -o win32ver.o --include-dir=$(slony_top_builddir)
	rm -f win32ver.rc

sqlmansect = 7
