## Makefile for building the GIMP DLLs and LIBs with Microsoft C.
## Use: nmake -f makefile.msc

TOP = ..\..
PRJ_TOP = ..
!include $(TOP)\glib\build\win32\make.msc

!INCLUDE $(PRJ_TOP)\gimpdefs.msc
PKG_VER = $(GIMP_VER)

################################################################

# Nothing much configurable below

INCLUDES = -I.. $(GDK_PIXBUF_CFLAGS)
# DEFINES = -DG_LOG_DOMAIN=\"LibGimpThump\"
DEPCFLAGS = \
	-FImsvc_recommended_pragmas.h \
	$(GLIB_CFLAGS)

DEPLIBS = $(GLIB_LIBS) $(GDK_PIXBUF_LIBS) $(INTL_LIBS) \
	..\libgimpbase\gimpbase-$(GIMP_VER).lib \
	..\libgimpmath\gimpmath-$(GIMP_VER).lib

all : \
	..\config.h \
	gimpthumb-$(GIMP_VER).dll

..\config.h : ..\config.h.win32
	copy ..\config.h.win32 ..\config.h

install : all
	$(INSTALL) gimpcolor-$(GIMP_VER).dll $(BIN)

OBJECTS = \
	gimpthumb-enums.obj \
	gimpthumb-error.obj \
	gimpthumb-utils.obj \
	gimpthumbnail.obj \

!IFNDEF PERL
PERL = perl
!ENDIF

gimpthumb-enums.c: gimpthumb-enums.h
	$(PERL) ..\tools\gimp-mkenums \
	--fhead "#include \"config.h\"\n#include <glib-object.h>\n#include \"gimpthumb-enums.h\"" \
	--fprod "\n/* enumerations from \"@filename@\" */" \
	--vhead "\nstatic const GEnumValue @enum_name@_enum_values[] =\n{" \
	--vprod "  { @VALUENAME@, @valuedesc@, \"@valuenick@\" }," \
	--vtail "  { 0, NULL, NULL }\n};\n\nGType\n@enum_name@_get_type (void)\n{\n  static GType enum_type = 0;\n\n  if (!enum_type)\n    enum_type = g_enum_register_static (\"@EnumName@\", @enum_name@_enum_values);\n\n  return enum_type;\n}\n" \
	gimpthumb-enums.h > $@
gimpthumb-$(GIMP_VER).dll : $(OBJECTS) gimpthumb.def
	$(CC) $(CFLAGS) -LD -Fegimpthumb-$(GIMP_VER).dll $(OBJECTS) $(DEPLIBS) $(LDFLAGS) user32.lib /def:gimpthumb.def

