PRJ_TOP=..\..
TOP = ..\..\..
!INCLUDE $(PRJ_TOP)\dia-make.msc

!IFNDEF PYTHON_VERSION
PYTHON_VERSION=23
!ENDIF
!IFNDEF PYTHON
PYTHON = $(TOP)\..\python$(PYTHON_VERSION)
!ENDIF

EXTRALIBS = $(PYTHON)\libs\python$(PYTHON_VERSION).lib user32.lib

# we don't depend on Gtk at runtime, but some dia headers
# need it at compile time
CFLAGS = -FImsvc_recommended_pragmas.h \
	-DHAVE_CONFIG_H -I..\.. -I..\..\lib \
	-I$(PYTHON)\include $(GLIB_CFLAGS) $(GTK2_CFLAGS) $(INTL_CFLAGS) \
	$(LIBXML2_CFLAGS)

EXTRALIBS = $(EXTRALIBS) $(LIBXML2_LIBS) $(INTL_LIBS) $(PANGO_LIBS) \
	..\..\lib\libdia.lib ..\..\app\dia-app.lib

OBJECTS = \
	diamodule.obj \
	pydia-color.obj \
	pydia-cpoint.obj \
	pydia-diagram.obj \
	pydia-diagramdata.obj \
	pydia-display.obj \
	pydia-error.obj \
	pydia-export.obj \
	pydia-font.obj \
	pydia-geometry.obj \
	pydia-handle.obj \
	pydia-image.obj \
	pydia-layer.obj \
	pydia-menuitem.obj \
	pydia-object.obj \
	pydia-paperinfo.obj \
	pydia-properties.obj \
	pydia-property.obj \
	pydia-render.obj \
	pydia-sheet.obj \
	pydia-text.obj \

OBJECTS2 = \
	python.obj \
	pydia-error.obj \

all : \
	dia.pyd \
	dia-python.dll

dia.pyd : $(OBJECTS) pydia.def
	$(CC) $(CFLAGS) -LD -Fe$@ $(OBJECTS) $(LDFLAGS) $(EXTRALIBS) $(GLIB_LIBS) /def:pydia.def

dia-python.dll : $(OBJECTS2)
	$(CC) $(CFLAGS) -LD -Fe$@ $(OBJECTS2) $(LDFLAGS) $(EXTRALIBS) $(GLIB_LIBS) dia.lib /def:..\objects.def
