#copyright (c) 2004-2005 Kazuki IWAMOTO http://www.maid.org/ iwm@maid.org
#
#Permission is hereby granted, free of charge, to any person obtaining
#a copy of this software and associated documentation files (the
#"Software"), to deal in the Software without restriction, including
#without limitation the rights to use, copy, modify, merge, publish,
#distribute, sublicense, and/or sell copies of the Software, and to
#permit persons to whom the Software is furnished to do so, subject to
#the following conditions:
#
#The above copyright notice and this permission notice shall be included
#in all copies or substantial portions of the Software.
#
#THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
#EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
#MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
#IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
#CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
#TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
#SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

!ifndef PREFIX
PREFIX=.
!endif

!ifdef CVS
ATK_MAJOR_VERSION=1
ATK_MINOR_VERSION=10
ATK_MICRO_VERSION=0
!else
ATK_MAJOR_VERSION=1
ATK_MINOR_VERSION=6
ATK_MICRO_VERSION=1
!endif
ATK_VERSION=$(ATK_MAJOR_VERSION).$(ATK_MINOR_VERSION).$(ATK_MICRO_VERSION)

!ifdef CVS
GLIB_MAJOR_VERSION=2
GLIB_MINOR_VERSION=7
GLIB_MICRO_VERSION=0
GLIB_BINARY_AGE=700
!else
GLIB_MAJOR_VERSION=2
GLIB_MINOR_VERSION=6
GLIB_MICRO_VERSION=4
GLIB_BINARY_AGE=604
!endif
GLIB_VERSION=$(GLIB_MAJOR_VERSION).$(GLIB_MINOR_VERSION).$(GLIB_MICRO_VERSION)

!ifdef CVS
GTK_MAJOR_VERSION=2
GTK_MINOR_VERSION=7
GTK_MICRO_VERSION=0
GTK_BINARY_AGE=700
!else
GTK_MAJOR_VERSION=2
GTK_MINOR_VERSION=6
GTK_MICRO_VERSION=7
GTK_BINARY_AGE=607
!endif
GTK_VERSION=$(GTK_MAJOR_VERSION).$(GTK_MINOR_VERSION).$(GTK_MICRO_VERSION)

!ifdef CVS
PANGO_MAJOR_VERSION=1
PANGO_MINOR_VERSION=9
PANGO_MICRO_VERSION=0
!else
PANGO_MAJOR_VERSION=1
PANGO_MINOR_VERSION=8
PANGO_MICRO_VERSION=1
!endif
PANGO_VERSION=$(PANGO_MAJOR_VERSION).$(PANGO_MINOR_VERSION).$(PANGO_MICRO_VERSION)

#Folders
!ifdef CVS
ATK=atk
CAIRO=cairo
!else
ATK=atk-$(ATK_VERSION)
CAIRO=cairo-0.4.0
!endif
GETTEXT=gettext-0.14.3
!ifdef CVS
GLIB=glib
GTK=gtk
!else
GLIB=glib-$(GLIB_VERSION)
GTK=gtk-$(GTK_VERSION)
!endif
JPEG=jpeg-6b
LIBICONV=libiconv-1.9.2
!ifdef CVS
LIBPIXMAN=libpixman
!else
LIBPIXMAN=libpixman-0.1.4
!endif
LIBPNG=libpng-1.2.8
!ifdef CVS
PANGO=pango
!else
PANGO=pango-$(PANGO_VERSION)
!endif
TIFF=tiff-3.7.2
ZLIB=zlib-1.2.2

VERSION=$(GTK_VERSION)
RELEASE=0

LINK=link
PERL=perl

CFLAGS=/c /DWIN32 /DNDEBUG /D_WIN32_WINDOWS=0x0410 /D_WINDOWS /D_MBCS /DWINVER=0x0400 /Fo$@ /Fp$*.pch /MD /nologo /O2 /QI0f /QIfdiv /w /YX /Zm400
LFLAGS=/INCREMENTAL:NO /MACHINE:IX86 /NOLOGO /OUT:$@ /RELEASE
RFLAGS=/DWIN32 /DNDEBUG /D_WIN32_WINDOWS=0x0410 /D_WINDOWS /D_MBCS /DWINVER=0x0400 /Fo$@


###############################################################################
#                                                                             #
# all                                                                         #
#                                                                             #
###############################################################################
all: gtk

###############################################################################
# ATK                                                                         #
###############################################################################
atk: glib $(ATK)\atk\libatk-1.0-0.dll

atk_OBJECTS= \
		$(ATK)\atk\atkaction.obj \
		$(ATK)\atk\atkcomponent.obj \
		$(ATK)\atk\atkdocument.obj \
		$(ATK)\atk\atkeditabletext.obj \
		$(ATK)\atk\atkgobjectaccessible.obj \
		$(ATK)\atk\atkhyperlink.obj \
		$(ATK)\atk\atkhypertext.obj \
		$(ATK)\atk\atkimage.obj \
		$(ATK)\atk\atknoopobject.obj \
		$(ATK)\atk\atknoopobjectfactory.obj \
		$(ATK)\atk\atkobject.obj \
		$(ATK)\atk\atkobjectfactory.obj \
		$(ATK)\atk\atkregistry.obj \
		$(ATK)\atk\atkrelation.obj \
		$(ATK)\atk\atkrelationset.obj \
		$(ATK)\atk\atkselection.obj \
		$(ATK)\atk\atkstate.obj \
		$(ATK)\atk\atkstateset.obj \
		$(ATK)\atk\atkstreamablecontent.obj \
		$(ATK)\atk\atktable.obj \
		$(ATK)\atk\atktext.obj \
		$(ATK)\atk\atkutil.obj \
		$(ATK)\atk\atkvalue.obj \
		$(ATK)\atk\atk-enum-types.obj

!ifdef CVS
$(ATK)\atk\libatk-1.0-0.dll: $(atk_OBJECTS) $(ATK)\atk\atk.res
!else
$(ATK)\atk\libatk-1.0-0.dll: $(atk_OBJECTS)
!endif
	$(LINK) $(LFLAGS) /DLL /DEF:$(ATK)\atk\atk.def /IMPLIB:$(ATK)\atk\atk-1.0.lib $(GETTEXT)\gettext-runtime\intl\intl.lib $(GLIB)\glib\glib-2.0.lib $(GLIB)\gobject\gobject-2.0.lib $**

$(ATK)\atk\atk.res: $*.rc
	$(RC) $(RFLAGS) /DBUILDNUMBER=0 $**

$(ATK)\atk\atk.rc:
	$(PERL) replace.pl @ATK_MAJOR_VERSION@=$(ATK_MAJOR_VERSION) @ATK_MINOR_VERSION@=$(ATK_MINOR_VERSION) @ATK_MICRO_VERSION@=$(ATK_MICRO_VERSION) @ATK_VERSION@=$(ATK_VERSION) @LT_CURRENT_MINUS_AGE@=0 < $@.in > $@

$(atk_OBJECTS): $(ATK)\config.h $(ATK)\atk\atkmarshal.c $(ATK)\atk\atkmarshal.h $(ATK)\atk\atk-enum-types.c $(ATK)\atk\atk-enum-types.h
	$(CC) $(CFLAGS) /DHAVE_CONFIG_H /I$(ATK) /I$(ATK)\atk /I$(GLIB) /I$(GLIB)\glib $*.c

$(ATK)\config.h:
	echo /* config.h.  Generated by configure.  */ > $@
	echo /* config.h.in.  Generated from configure.in by autoheader.  */ >> $@
	echo. >> $@
	echo /* always defined to indicate that i18n is enabled */ >> $@
	echo #define ENABLE_NLS 1 >> $@
	echo. >> $@
	echo /* Define the gettext package to be used */ >> $@
	echo #define GETTEXT_PACKAGE "atk10" >> $@
	echo. >> $@
	echo /* Define to 1 if you have the `bind_textdomain_codeset' function. */ >> $@
	echo #define HAVE_BIND_TEXTDOMAIN_CODESET 1 >> $@
	echo. >> $@
	echo /* Define to 1 if you have the `dcgettext' function. */ >> $@
	echo #define HAVE_DCGETTEXT 1 >> $@
	echo. >> $@
	echo /* Define to 1 if you have the dlfcn.h header file. */ >> $@
	echo #undef HAVE_DLFCN_H >> $@
	echo. >> $@
	echo /* Define if the GNU gettext() function is already present or preinstalled. */ >> $@
	echo #define HAVE_GETTEXT 1 >> $@
	echo. >> $@
	echo /* Define to 1 if you have the inttypes.h header file. */ >> $@
	echo #undef HAVE_INTTYPES_H >> $@
	echo. >> $@
	echo /* Define if your locale.h file defines LC_MESSAGES. */ >> $@
	echo #undef HAVE_LC_MESSAGES >> $@
	echo. >> $@
	echo /* Define to 1 if you have the locale.h header file. */ >> $@
	echo #define HAVE_LOCALE_H 1 >> $@
	echo. >> $@
	echo /* Define to 1 if you have the memory.h header file. */ >> $@
	echo #define HAVE_MEMORY_H 1 >> $@
	echo. >> $@
	echo /* Define to 1 if you have the stdint.h header file. */ >> $@
	echo #undef HAVE_STDINT_H >> $@
	echo. >> $@
	echo /* Define to 1 if you have the stdlib.h header file. */ >> $@
	echo #define HAVE_STDLIB_H 1 >> $@
	echo. >> $@
	echo /* Define to 1 if you have the strings.h header file. */ >> $@
	echo #undef HAVE_STRINGS_H >> $@
	echo. >> $@
	echo /* Define to 1 if you have the string.h header file. */ >> $@
	echo #define HAVE_STRING_H 1 >> $@
	echo. >> $@
	echo /* Define to 1 if you have the sys/stat.h header file. */ >> $@
	echo #define HAVE_SYS_STAT_H 1 >> $@
	echo. >> $@
	echo /* Define to 1 if you have the sys/types.h header file. */ >> $@
	echo #define HAVE_SYS_TYPES_H 1 >> $@
	echo. >> $@
	echo /* Define to 1 if you have the unistd.h header file. */ >> $@
	echo #undef HAVE_UNISTD_H >> $@
	echo. >> $@
	echo /* Name of package */ >> $@
	echo #define PACKAGE "atk" >> $@
	echo. >> $@
	echo /* Define to the address where bug reports for this package should be sent. */ >> $@
	echo #define PACKAGE_BUGREPORT "http://bugzilla.gnome.org/enter_bug.cgi?product=atk" >> $@
	echo. >> $@
	echo /* Define to the full name of this package. */ >> $@
	echo #define PACKAGE_NAME "atk" >> $@
	echo. >> $@
	echo /* Define to the full name and version of this package. */ >> $@
	echo #define PACKAGE_STRING "atk $(ATK_VERSION)" >> $@
	echo. >> $@
	echo /* Define to the one symbol short name of this package. */ >> $@
	echo #define PACKAGE_TARNAME "atk" >> $@
	echo. >> $@
	echo /* Define to the version of this package. */ >> $@
	echo #define PACKAGE_VERSION "$(ATK_VERSION)" >> $@
	echo. >> $@
	echo /* Define to 1 if you have the ANSI C header files. */ >> $@
	echo #define STDC_HEADERS 1 >> $@
	echo. >> $@
	echo /* Version number of package */ >> $@
	echo #define VERSION "$(ATK_VERSION)" >> $@
	echo. >> $@
	echo /* Define the location where the catalogs will be installed */ >> $@
	echo #define atklocaledir "NONE/lib/locale" >> $@

atk_headers= \
		$(ATK)\atk\atk.h \
		$(ATK)\atk\atkaction.h \
		$(ATK)\atk\atkcomponent.h \
		$(ATK)\atk\atkdocument.h \
		$(ATK)\atk\atkeditabletext.h \
		$(ATK)\atk\atkgobjectaccessible.h \
		$(ATK)\atk\atkhyperlink.h \
		$(ATK)\atk\atkhypertext.h \
		$(ATK)\atk\atknoopobject.h \
		$(ATK)\atk\atknoopobjectfactory.h \
		$(ATK)\atk\atkobject.h \
		$(ATK)\atk\atkobjectfactory.h \
		$(ATK)\atk\atkimage.h \
		$(ATK)\atk\atkregistry.h \
		$(ATK)\atk\atkrelation.h \
		$(ATK)\atk\atkrelationset.h \
		$(ATK)\atk\atkrelationtype.h \
		$(ATK)\atk\atkselection.h \
		$(ATK)\atk\atkstate.h \
		$(ATK)\atk\atkstateset.h \
		$(ATK)\atk\atkstreamablecontent.h \
		$(ATK)\atk\atktable.h \
		$(ATK)\atk\atktext.h \
		$(ATK)\atk\atkutil.h \
		$(ATK)\atk\atkvalue.h

$(ATK)\atk\atk-enum-types.c:
	$(PERL) $(GLIB)\gobject\glib-mkenums \
		--fhead "#include <atk.h>" \
		--fprod "\n/* enumerations from \"@filename@\" */" \
		--vhead "GType\n@enum_name@_get_type (void)\n{\n  static GType etype = 0;\n  if (etype == 0) {\n    static const G@Type@Value values[] = {"     \
		--vprod "      { @VALUENAME@, \"@VALUENAME@\", \"@valuenick@\" }," \
		--vtail "      { 0, NULL, NULL }\n    };\n    etype = g_@type@_register_static (\"@EnumName@\", values);\n  }\n  return etype;\n}\n" \
		$(atk_headers) > $@

$(ATK)\atk\atk-enum-types.h:
	$(PERL) $(GLIB)\gobject\glib-mkenums \
		--fhead "#ifndef __ATK_ENUM_TYPES_H__\n#define __ATK_ENUM_TYPES_H__\n" \
		--fprod "/* enumerations from \"@filename@\" */\n" \
		--vhead "GType @enum_name@_get_type (void);\n#define ATK_TYPE_@ENUMSHORT@ (@enum_name@_get_type())\n"         \
		--ftail "#endif /* __ATK_ENUM_TYPES_H__ */" \
		$(atk_headers) > $@

$(ATK)\atk\atkmarshal.c:
	copy /y $(LIBICONV)\lib\iconv.dll .
	copy /y $(GETTEXT)\gettext-runtime\intl\intl.dll .
	copy /y $(GLIB)\glib\libglib-2.0-0.dll .
	$(GLIB)\gobject\glib-genmarshal.exe --prefix=atk_marshal $*.list --body > $@
	del libglib-2.0-0.dll
	del intl.dll
	del iconv.dll

$(ATK)\atk\atkmarshal.h:
	copy /y $(LIBICONV)\lib\iconv.dll .
	copy /y $(GETTEXT)\gettext-runtime\intl\intl.dll .
	copy /y $(GLIB)\glib\libglib-2.0-0.dll .
	$(GLIB)\gobject\glib-genmarshal.exe --prefix=atk_marshal $*.list --header > $@
	del libglib-2.0-0.dll
	del intl.dll
	del iconv.dll

###############################################################################
# cairo                                                                       #
###############################################################################
cairo: $(CAIRO)\src\$(CAIRO).dll

cairo_OBJECTS= \
!ifdef CVS
		$(CAIRO)\src\cairo.obj \
		$(CAIRO)\src\cairo-array.obj \
		$(CAIRO)\src\cairo-cache.obj \
		$(CAIRO)\src\cairo-color.obj \
		$(CAIRO)\src\cairo-fixed.obj \
		$(CAIRO)\src\cairo-font.obj \
		$(CAIRO)\src\cairo-gstate.obj \
		$(CAIRO)\src\cairo-hull.obj \
		$(CAIRO)\src\cairo-image-surface.obj \
		$(CAIRO)\src\cairo-matrix.obj \
		$(CAIRO)\src\cairo-path.obj \
		$(CAIRO)\src\cairo-path-bounds.obj \
		$(CAIRO)\src\cairo-path-data.obj \
		$(CAIRO)\src\cairo-path-fill.obj \
		$(CAIRO)\src\cairo-path-stroke.obj \
		$(CAIRO)\src\cairo-pen.obj \
		$(CAIRO)\src\cairo-png.obj \
		$(CAIRO)\src\cairo-polygon.obj \
		$(CAIRO)\src\cairo-slope.obj \
		$(CAIRO)\src\cairo-spline.obj \
		$(CAIRO)\src\cairo-surface.obj \
		$(CAIRO)\src\cairo-traps.obj \
		$(CAIRO)\src\cairo-pattern.obj \
		$(CAIRO)\src\cairo-unicode.obj \
		$(CAIRO)\src\cairo-output-stream.obj \
		$(CAIRO)\src\cairo-wideint.obj \
		$(CAIRO)\src\cairo-win32-font.obj \
		$(CAIRO)\src\cairo-win32-surface.obj
!else
		$(CAIRO)\src\cairo.obj \
		$(CAIRO)\src\cairo_array.obj \
		$(CAIRO)\src\cairo_cache.obj \
		$(CAIRO)\src\cairo_color.obj \
		$(CAIRO)\src\cairo_fixed.obj \
		$(CAIRO)\src\cairo_font.obj \
		$(CAIRO)\src\cairo_gstate.obj \
		$(CAIRO)\src\cairo_hull.obj \
		$(CAIRO)\src\cairo_image_surface.obj \
		$(CAIRO)\src\cairo_matrix.obj \
		$(CAIRO)\src\cairo_path.obj \
		$(CAIRO)\src\cairo_path_bounds.obj \
		$(CAIRO)\src\cairo_path_fill.obj \
		$(CAIRO)\src\cairo_path_stroke.obj \
		$(CAIRO)\src\cairo_pattern.obj \
		$(CAIRO)\src\cairo_pen.obj \
		$(CAIRO)\src\cairo_png_surface.obj \
		$(CAIRO)\src\cairo_polygon.obj \
		$(CAIRO)\src\cairo_slope.obj \
		$(CAIRO)\src\cairo_spline.obj \
		$(CAIRO)\src\cairo_surface.obj \
		$(CAIRO)\src\cairo_traps.obj \
		$(CAIRO)\src\cairo_unicode.obj \
		$(CAIRO)\src\cairo_wideint.obj \
		$(CAIRO)\src\cairo_win32_font.obj \
		$(CAIRO)\src\cairo_win32_surface.obj
!endif
libpixman_OBJECTS= \
		$(LIBPIXMAN)\src\fbedge.obj \
		$(LIBPIXMAN)\src\fbtrap.obj \
		$(LIBPIXMAN)\src\ic.obj \
		$(LIBPIXMAN)\src\icblt.obj \
		$(LIBPIXMAN)\src\icbltone.obj \
		$(LIBPIXMAN)\src\iccolor.obj \
		$(LIBPIXMAN)\src\iccompose.obj \
		$(LIBPIXMAN)\src\icformat.obj \
		$(LIBPIXMAN)\src\icimage.obj \
		$(LIBPIXMAN)\src\icpixels.obj \
		$(LIBPIXMAN)\src\icrect.obj \
		$(LIBPIXMAN)\src\icstipple.obj \
		$(LIBPIXMAN)\src\ictransform.obj \
		$(LIBPIXMAN)\src\ictrap.obj \
		$(LIBPIXMAN)\src\ictri.obj \
		$(LIBPIXMAN)\src\icutil.obj \
		$(LIBPIXMAN)\src\pixregion.obj \
		$(LIBPIXMAN)\src\renderedge.obj

$(CAIRO)\src\$(CAIRO).dll: $(cairo_OBJECTS) $(libpixman_OBJECTS) $(CAIRO)\src\cairo.def
	$(LINK) $(LFLAGS) /DLL /DEF:$(CAIRO)\src\cairo.def $(LIBPNG)\libpng13.lib gdi32.lib msimg32.lib user32.lib $(cairo_OBJECTS) $(libpixman_OBJECTS)

$(CAIRO)\src\cairo.def: $(cairo_OBJECTS)
	echo EXPORTS > $@
	$(PERL) mkdef.pl $(cairo_OBJECTS) >> $@

!ifdef CVS
$(cairo_OBJECTS): $(CAIRO)\src\cairo-features.h
	$(CC) $(CFLAGS) /DM_PI=3.14159265358979323846 /Dvsnprintf=_vsnprintf /I$(CAIRO)\src /I$(LIBPIXMAN)\src /I$(LIBPNG) /I$(ZLIB) /Iiwm\include $*.c
!else
$(cairo_OBJECTS):
	$(CC) $(CFLAGS) /DCAIRO_HAS_PNG_SURFACE /DCAIRO_HAS_WIN32_FONT /DCAIRO_HAS_WIN32_SURFACE /DM_PI=3.14159265358979323846 /I$(CAIRO)\src /I$(LIBPIXMAN)\src /I$(LIBPNG) /I$(ZLIB) /Iiwm\include $*.c
!endif

$(libpixman_OBJECTS):
	$(CC) $(CFLAGS) /I$(LIBPIXMAN)\src /Iiwm\include $*.c

$(CAIRO)\src\cairo-features.h:
	$(PERL) replace.pl \
	@ATSUI_FONT_FEATURE@=CAIRO_HAS_NO_ATSUI_FONT \
	@FT_FONT_FEATURE@=CAIRO_HAS_NO_FT_FONT \
	@GLITZ_SURFACE_FEATURE@=CAIRO_HAS_NO_GLITZ_SURFACE \
	@PDF_SURFACE_FEATURE@=CAIRO_HAS_NO_PDF_SURFACE \
	@PNG_FUNCTIONS_FEATURE@=CAIRO_HAS_PNG_SURFACE \
	@PS_SURFACE_FEATURE@=CAIRO_HAS_NO_PS_SURFACE \
	@QUARTZ_SURFACE_FEATURE@=CAIRO_HAS_NO_QUARTZ_SURFACE \
	@SANITY_CHECKING_FEATURE@=CAIRO_DO_SANITY_CHECKING \
	@XCB_SURFACE_FEATURE@=CAIRO_HAS_NO_XCB_SURFACE \
	@XLIB_SURFACE_FEATURE@=CAIRO_HAS_NO_XLIB_SURFACE \
	@WIN32_FONT_FEATURE@=CAIRO_HAS_WIN32_FONT \
	@WIN32_SURFACE_FEATURE@=CAIRO_HAS_WIN32_SURFACE < $@.in > $@

###############################################################################
# gettext                                                                     #
###############################################################################
gettext: libiconv \
		$(GETTEXT)\gettext-runtime\intl\intl.dll \
		$(GETTEXT)\gettext-tools\src\msgfmt.exe

intl_OBJECTS= \
		$(GETTEXT)\gettext-runtime\intl\bindtextdom.obj \
		$(GETTEXT)\gettext-runtime\intl\dcgettext.obj \
		$(GETTEXT)\gettext-runtime\intl\dgettext.obj \
		$(GETTEXT)\gettext-runtime\intl\gettext.obj \
		$(GETTEXT)\gettext-runtime\intl\finddomain.obj \
		$(GETTEXT)\gettext-runtime\intl\loadmsgcat.obj \
		$(GETTEXT)\gettext-runtime\intl\localealias.obj \
		$(GETTEXT)\gettext-runtime\intl\textdomain.obj \
		$(GETTEXT)\gettext-runtime\intl\l10nflist.obj \
		$(GETTEXT)\gettext-runtime\intl\explodename.obj \
		$(GETTEXT)\gettext-runtime\intl\dcigettext.obj \
		$(GETTEXT)\gettext-runtime\intl\dcngettext.obj \
		$(GETTEXT)\gettext-runtime\intl\dngettext.obj \
		$(GETTEXT)\gettext-runtime\intl\ngettext.obj \
		$(GETTEXT)\gettext-runtime\intl\plural.obj \
		$(GETTEXT)\gettext-runtime\intl\plural-exp.obj \
		$(GETTEXT)\gettext-runtime\intl\localcharset.obj \
		$(GETTEXT)\gettext-runtime\intl\relocatable.obj \
		$(GETTEXT)\gettext-runtime\intl\langprefs.obj \
		$(GETTEXT)\gettext-runtime\intl\localename.obj \
		$(GETTEXT)\gettext-runtime\intl\log.obj \
		$(GETTEXT)\gettext-runtime\intl\printf.obj \
		$(GETTEXT)\gettext-runtime\intl\osdep.obj \
		$(GETTEXT)\gettext-runtime\intl\intl-compat.obj

$(GETTEXT)\gettext-runtime\intl\intl.dll: $(intl_OBJECTS) $(GETTEXT)\gettext-runtime\windows\intl.res
	$(LINK) $(LFLAGS) /DLL $(LIBICONV)\lib\iconv.lib $**

$(GETTEXT)\gettext-runtime\windows\intl.res:

$(intl_OBJECTS): $(GETTEXT)\gettext-runtime\config.h $(GETTEXT)\gettext-runtime\intl\libgnuintl.h
	$(CC) $(CFLAGS) /DBUILDING_DLL /DBUILDING_LIBINTL /DDEPENDS_ON_LIBICONV=1 /DENABLE_RELOCATABLE=1 /DHAVE_CONFIG_H /DIN_LIBINTL /DIN_LIBRARY /DINSTALLDIR=\".\" /DLOCALE_ALIAS_PATH=\".\" /DLOCALEDIR=\".\" /DNO_XMALLOC /Drelocate=libintl_relocate /Dset_relocation_prefix=libintl_set_relocation_prefix /I$(GETTEXT)\gettext-runtime /I$(LIBICONV)\include $*.c

$(GETTEXT)\gettext-runtime\config.h: $@.msvc
	copy /y $** $@

$(GETTEXT)\gettext-runtime\intl\libgnuintl.h: $@.msvc-shared
	copy /y $** $@

msgfmt_OBJECTS= \
		$(GETTEXT)\gettext-tools\src\msgfmt.obj \
		$(GETTEXT)\gettext-tools\src\write-mo.obj \
		$(GETTEXT)\gettext-tools\src\write-java.obj \
		$(GETTEXT)\gettext-tools\src\write-csharp.obj \
		$(GETTEXT)\gettext-tools\src\write-resources.obj \
		$(GETTEXT)\gettext-tools\src\write-tcl.obj \
		$(GETTEXT)\gettext-tools\src\write-qt.obj \
		$(GETTEXT)\gettext-tools\src\plural-eval.obj \
#gettextsrc_OBJECTS= \
		$(GETTEXT)\gettext-tools\src\message.obj \
		$(GETTEXT)\gettext-tools\src\po-error.obj \
		$(GETTEXT)\gettext-tools\src\read-po-abstract.obj \
		$(GETTEXT)\gettext-tools\src\po-lex.obj \
		$(GETTEXT)\gettext-tools\src\po-gram-gen.obj \
		$(GETTEXT)\gettext-tools\src\po-charset.obj \
		$(GETTEXT)\gettext-tools\src\read-properties.obj \
		$(GETTEXT)\gettext-tools\src\read-stringtable.obj \
		$(GETTEXT)\gettext-tools\src\open-po.obj \
		$(GETTEXT)\gettext-tools\src\dir-list.obj \
		$(GETTEXT)\gettext-tools\src\str-list.obj \
		$(GETTEXT)\gettext-tools\src\read-po.obj \
		$(GETTEXT)\gettext-tools\src\write-properties.obj \
		$(GETTEXT)\gettext-tools\src\write-stringtable.obj \
		$(GETTEXT)\gettext-tools\src\write-po.obj \
		$(GETTEXT)\gettext-tools\src\msgl-ascii.obj \
		$(GETTEXT)\gettext-tools\src\msgl-iconv.obj \
		$(GETTEXT)\gettext-tools\src\msgl-equal.obj \
		$(GETTEXT)\gettext-tools\src\msgl-cat.obj \
		$(GETTEXT)\gettext-tools\src\msgl-english.obj \
		$(GETTEXT)\gettext-tools\src\file-list.obj \
		$(GETTEXT)\gettext-tools\src\msgl-charset.obj \
		$(GETTEXT)\gettext-tools\src\po-time.obj \
		$(GETTEXT)\gettext-tools\src\plural.obj \
		$(GETTEXT)\gettext-tools\src\plural-table.obj \
#		$(GETTEXT)\gettext-tools\src\format.obj \
		$(GETTEXT)\gettext-tools\src\format-c.obj \
		$(GETTEXT)\gettext-tools\src\format-sh.obj \
		$(GETTEXT)\gettext-tools\src\format-python.obj \
		$(GETTEXT)\gettext-tools\src\format-lisp.obj \
		$(GETTEXT)\gettext-tools\src\format-elisp.obj \
		$(GETTEXT)\gettext-tools\src\format-librep.obj \
		$(GETTEXT)\gettext-tools\src\format-scheme.obj \
		$(GETTEXT)\gettext-tools\src\format-java.obj \
		$(GETTEXT)\gettext-tools\src\format-csharp.obj \
		$(GETTEXT)\gettext-tools\src\format-awk.obj \
		$(GETTEXT)\gettext-tools\src\format-pascal.obj \
		$(GETTEXT)\gettext-tools\src\format-ycp.obj \
		$(GETTEXT)\gettext-tools\src\format-tcl.obj \
		$(GETTEXT)\gettext-tools\src\format-perl.obj \
		$(GETTEXT)\gettext-tools\src\format-perl-brace.obj \
		$(GETTEXT)\gettext-tools\src\format-php.obj \
		$(GETTEXT)\gettext-tools\src\format-gcc-internal.obj \
		$(GETTEXT)\gettext-tools\src\format-qt.obj \
		$(GETTEXT)\gettext-tools\lib\allocsa.obj \
		$(GETTEXT)\gettext-tools\lib\argmatch.obj \
		$(GETTEXT)\gettext-tools\lib\backupfile.obj \
		$(GETTEXT)\gettext-tools\lib\addext.obj \
		$(GETTEXT)\gettext-tools\lib\basename.obj \
		$(GETTEXT)\gettext-tools\lib\c-ctype.obj \
		$(GETTEXT)\gettext-tools\lib\c-strcasecmp.obj \
		$(GETTEXT)\gettext-tools\lib\c-strncasecmp.obj \
		$(GETTEXT)\gettext-tools\lib\classpath.obj \
		$(GETTEXT)\gettext-tools\lib\closeout.obj \
		$(GETTEXT)\gettext-tools\lib\copy-file.obj \
		$(GETTEXT)\gettext-tools\lib\csharpcomp.obj \
		$(GETTEXT)\gettext-tools\lib\csharpexec.obj \
		$(GETTEXT)\gettext-tools\lib\error-progname.obj \
		$(GETTEXT)\gettext-tools\lib\execute.obj \
		$(GETTEXT)\gettext-tools\lib\exitfail.obj \
		$(GETTEXT)\gettext-tools\lib\fatal-signal.obj \
		$(GETTEXT)\gettext-tools\lib\findprog.obj \
		$(GETTEXT)\gettext-tools\lib\fstrcmp.obj \
		$(GETTEXT)\gettext-tools\lib\full-write.obj \
		$(GETTEXT)\gettext-tools\lib\fwriteerror.obj \
		$(GETTEXT)\gettext-tools\lib\gcd.obj \
		$(GETTEXT)\gettext-tools\lib\hash.obj \
		$(GETTEXT)\gettext-tools\lib\javacomp.obj \
		$(GETTEXT)\gettext-tools\lib\javaexec.obj \
		$(GETTEXT)\gettext-tools\lib\linebreak.obj \
		$(GETTEXT)\gettext-tools\lib\mbswidth.obj \
		$(GETTEXT)\gettext-tools\lib\obstack.obj \
		$(GETTEXT)\gettext-tools\lib\concatpath.obj \
		$(GETTEXT)\gettext-tools\lib\pipe.obj \
		$(GETTEXT)\gettext-tools\lib\progname.obj \
		$(GETTEXT)\gettext-tools\lib\progreloc.obj \
		$(GETTEXT)\gettext-tools\lib\quote.obj \
		$(GETTEXT)\gettext-tools\lib\quotearg.obj \
		$(GETTEXT)\gettext-tools\lib\safe-read.obj \
		$(GETTEXT)\gettext-tools\lib\safe-write.obj \
		$(GETTEXT)\gettext-tools\lib\sh-quote.obj \
		$(GETTEXT)\gettext-tools\lib\tmpdir.obj \
		$(GETTEXT)\gettext-tools\lib\wait-process.obj \
		$(GETTEXT)\gettext-tools\lib\xmalloc.obj \
		$(GETTEXT)\gettext-tools\lib\xstrdup.obj \
		$(GETTEXT)\gettext-tools\lib\xallocsa.obj \
		$(GETTEXT)\gettext-tools\lib\xerror.obj \
		$(GETTEXT)\gettext-tools\lib\xsetenv.obj \
		$(GETTEXT)\gettext-tools\lib\error.obj \
		$(GETTEXT)\gettext-tools\lib\fnmatch.obj \
		$(GETTEXT)\gettext-tools\lib\getline.obj \
		$(GETTEXT)\gettext-tools\lib\getndelim2.obj \
		$(GETTEXT)\gettext-tools\lib\getopt.obj \
		$(GETTEXT)\gettext-tools\lib\getopt1.obj \
		$(GETTEXT)\gettext-tools\lib\mkdtemp.obj \
		$(GETTEXT)\gettext-tools\lib\relocatable.obj \
		$(GETTEXT)\gettext-tools\lib\setenv.obj \
		$(GETTEXT)\gettext-tools\lib\unsetenv.obj \
		$(GETTEXT)\gettext-tools\lib\stpcpy.obj \
		$(GETTEXT)\gettext-tools\lib\stpncpy.obj \
		$(GETTEXT)\gettext-tools\lib\strcasecmp.obj \
		$(GETTEXT)\gettext-tools\lib\strncasecmp.obj \
		$(GETTEXT)\gettext-tools\lib\vasprintf.obj

$(GETTEXT)\gettext-tools\src\msgfmt.exe: $(msgfmt_OBJECTS) $(GETTEXT)\gettext-tools\src\format.obj
	$(LINK) $(LFLAGS) $(GETTEXT)\gettext-runtime\intl\intl.lib $(LIBICONV)\lib\iconv.lib $**

$(msgfmt_OBJECTS): $(GETTEXT)\gettext-tools\config.h $(GETTEXT)\gettext-tools\libintl.h
	$(CC) $(CFLAGS) /DDEPENDS_ON_LIBINTL=1 /DDEPENDS_ON_LIBICONV=1 /DEXEEXT=\".exe\" /DHAVE_CONFIG_H /DLOCALEDIR=\".\" /DLOCALE_ALIAS_PATH=\".\" /DGETTEXTJAR=\".\\gettext.jar\" /DLIBDIR=\".\" /DGETTEXTDATADIR=\".\" /DPROJECTSDIR=\".\" /DINSTALLPREFIX=\".\" /DINSTALLDIR=\".\" /I$(GETTEXT)\gettext-runtime\intl /I$(GETTEXT)\gettext-tools /I$(GETTEXT)\gettext-tools\lib /I$(GETTEXT)\gettext-tools\windows /I$(LIBICONV)\include $*.c

$(GETTEXT)\gettext-tools\src\format.obj: $(GETTEXT)\gettext-tools\config.h $(GETTEXT)\gettext-tools\libintl.h
	$(CC) $(CFLAGS) /TP /DDEPENDS_ON_LIBINTL=1 /DDEPENDS_ON_LIBICONV=1 /DEXEEXT=\".exe\" /DHAVE_CONFIG_H /DLOCALEDIR=\".\" /DLOCALE_ALIAS_PATH=\".\" /DGETTEXTJAR=\".\\gettext.jar\" /DLIBDIR=\".\" /DGETTEXTDATADIR=\".\" /DPROJECTSDIR=\".\" /DINSTALLPREFIX=\".\" /DINSTALLDIR=\".\" /I$(GETTEXT)\gettext-tools /I$(GETTEXT)\gettext-tools\lib /I$(GETTEXT)\gettext-tools\windows /I$(GETTEXT)\gettext-runtime\intl /I$(LIBICONV)\include $*.c

$(GETTEXT)\gettext-tools\config.h: $@.msvc
	copy /y $** $@

$(GETTEXT)\gettext-tools\libintl.h: $(GETTEXT)\gettext-runtime\intl\libgnuintl.h
	copy /y $** $@

###############################################################################
# GLib                                                                        #
###############################################################################
glib: gettext \
		$(GLIB)\glib\libglib-2.0-0.dll \
		$(GLIB)\glib\gspawn-win32-helper.exe \
		$(GLIB)\gmodule\libgmodule-2.0-0.dll \
		$(GLIB)\gobject\libgobject-2.0-0.dll \
		$(GLIB)\gobject\glib-genmarshal.exe \
!ifdef CVS
		$(GLIB)\gobject\glib-mkenums \
!endif
		$(GLIB)\gthread\libgthread-2.0-0.dll

$(GLIB)\config.h: $@.win32
	copy /y $** $@

$(GLIB)\config.h.win32:
	$(PERL) replace.pl @GETTEXT_PACKAGE@=glib20 @GLIB_MAJOR_VERSION@=$(GLIB_MAJOR_VERSION) @GLIB_MINOR_VERSION@=$(GLIB_MINOR_VERSION) @GLIB_MICRO_VERSION@=$(GLIB_MICRO_VERSION) @GLIB_INTERFACE_AGE@=0 @GLIB_BINARY_AGE@=$(GLIB_BINARY_AGE) < $@.in > $@

$(GLIB)\glibconfig.h: $@.win32
	copy /y $** $@

$(GLIB)\glibconfig.h.win32:
	$(PERL) replace.pl @GLIB_MAJOR_VERSION@=$(GLIB_MAJOR_VERSION) @GLIB_MINOR_VERSION@=$(GLIB_MINOR_VERSION) @GLIB_MICRO_VERSION@=$(GLIB_MICRO_VERSION) < $@.in > $@

$(GLIB)\libintl.h: $(GETTEXT)\gettext-runtime\intl\libgnuintl.h
	copy /y $** $@

# GLib
glib_OBJECTS= \
		$(GLIB)\glib\garray.obj \
		$(GLIB)\glib\gasyncqueue.obj \
#MODIFY	$(GLIB)\glib\gatomic.obj \
		$(GLIB)\glib\gbacktrace.obj \
		$(GLIB)\glib\gcache.obj \
		$(GLIB)\glib\gcompletion.obj \
		$(GLIB)\glib\gconvert.obj \
		$(GLIB)\glib\gdataset.obj \
		$(GLIB)\glib\gdate.obj \
		$(GLIB)\glib\gdir.obj \
		$(GLIB)\glib\gerror.obj \
		$(GLIB)\glib\gfileutils.obj \
		$(GLIB)\glib\ghash.obj \
		$(GLIB)\glib\ghook.obj \
		$(GLIB)\glib\giochannel.obj \
		$(GLIB)\glib\giowin32.obj \
		$(GLIB)\glib\gkeyfile.obj \
		$(GLIB)\glib\glist.obj \
		$(GLIB)\glib\gmain.obj \
		$(GLIB)\glib\gmarkup.obj \
		$(GLIB)\glib\gmem.obj \
#MODIFY	$(GLIB)\glib\gmessages.obj \
		iwm\glib\gmessages.obj \
		$(GLIB)\glib\gnode.obj \
		$(GLIB)\glib\goption.obj \
		$(GLIB)\glib\gprimes.obj \
		$(GLIB)\glib\gqsort.obj \
		$(GLIB)\glib\gqueue.obj \
		$(GLIB)\glib\gpattern.obj \
		$(GLIB)\glib\gprintf.obj \
		$(GLIB)\glib\grand.obj \
		$(GLIB)\glib\grel.obj \
		$(GLIB)\glib\gscanner.obj \
		$(GLIB)\glib\gshell.obj \
		$(GLIB)\glib\gslist.obj \
		$(GLIB)\glib\gspawn-win32.obj \
		$(GLIB)\glib\gstdio.obj \
		$(GLIB)\glib\gstrfuncs.obj \
		$(GLIB)\glib\gstring.obj \
		$(GLIB)\glib\gthread.obj \
		$(GLIB)\glib\gthreadpool.obj \
		$(GLIB)\glib\gtimer.obj \
		$(GLIB)\glib\gtree.obj \
		$(GLIB)\glib\gunibreak.obj \
		$(GLIB)\glib\gunicollate.obj \
		$(GLIB)\glib\gunidecomp.obj \
		$(GLIB)\glib\guniprop.obj \
		$(GLIB)\glib\gutf8.obj \
		$(GLIB)\glib\gutils.obj \
		$(GLIB)\glib\gwin32.obj \
		$(GLIB)\glib\gnulib\asnprintf.obj \
		$(GLIB)\glib\gnulib\printf.obj \
		$(GLIB)\glib\gnulib\printf-args.obj \
		$(GLIB)\glib\gnulib\printf-parse.obj \
		$(GLIB)\glib\gnulib\vasnprintf.obj \
		$(GLIB)\glib\libcharset\localcharset.obj \
		$(GLIB)\build\win32\dirent\wdirent.obj \
		$(GLIB)\build\win32\dirent\dirent.obj

$(GLIB)\glib\libglib-2.0-0.dll: $(glib_OBJECTS) $(GLIB)\glib\glib.res $(GLIB)\glib\glib.def $(GLIB)\glib\gatomic.obj
	$(LINK) $(LFLAGS) /DLL /DEF:$(GLIB)\glib\glib.def /IMPLIB:$(GLIB)\glib\glib-2.0.lib $(LIBICONV)\lib\iconv.lib $(GETTEXT)\gettext-runtime\intl\intl.lib advapi32.lib ole32.lib shell32.lib user32.lib wsock32.lib $(glib_OBJECTS) $(GLIB)\glib\glib.res $(GLIB)\glib\gatomic.obj

$(GLIB)\glib\glib.res: $*.rc
	$(RC) $(RFLAGS) /DBUILDNUMBER=0 $**

$(GLIB)\glib\glib.rc:
	$(PERL) replace.pl @GLIB_MAJOR_VERSION@=$(GLIB_MAJOR_VERSION) @GLIB_MINOR_VERSION@=$(GLIB_MINOR_VERSION) @GLIB_MICRO_VERSION@=$(GLIB_MICRO_VERSION) @GLIB_VERSION@=$(GLIB_VERSION) @LT_CURRENT_MINUS_AGE@=0 < $@.in > $@

$(GLIB)\glib\glib.def:
	echo EXPORTS > $@
	echo #ifndef G_GNUC_CONST > def.h
	echo #define G_GNUC_CONST >> def.h
	echo #endif >> def.h
	echo #ifndef G_GNUC_MALLOC >> def.h
	echo #define G_GNUC_MALLOC >> def.h
	echo #endif >> def.h
	echo #ifndef G_GNUC_NORETURN >> def.h
	echo #define G_GNUC_NORETURN >> def.h
	echo #endif >> def.h
	echo #ifndef G_GNUC_NULL_TERMINATED >> def.h
	echo #define G_GNUC_NULL_TERMINATED >> def.h
	echo #endif >> def.h
	echo #ifndef G_GNUC_PRINTF >> def.h
	echo #define G_GNUC_PRINTF(format_idx,arg_idx) >> def.h
	echo #endif >> def.h
	$(CC) /EP /DG_OS_WIN32 /DALL_FILES /DINCLUDE_INTERNAL_SYMBOLS /DINCLUDE_VARIABLES /FIdef.h /I. $(GLIB)\glib\glib.symbols >> $@
	del def.h

!ifdef CVS
$(glib_OBJECTS): $(GLIB)\config.h $(GLIB)\glibconfig.h $(GLIB)\libintl.h $(GLIB)\glib\galias.h $(GLIB)\glib\galiasdef.c
!else
$(glib_OBJECTS): $(GLIB)\config.h $(GLIB)\glibconfig.h $(GLIB)\libintl.h $(GLIB)\glib\galias.h
!endif
	$(CC) $(CFLAGS) /DG_LOG_DOMAIN=\"GLib\" /DGLIB_COMPILATION /DHAVE_CONFIG_H /FImsvc_recommended_pragmas.h /I$(GLIB) /I$(GLIB)\glib /I$(GLIB)\build\win32\dirent /I$(GETTEXT) /I$(LIBICONV)\include $*.c

$(GLIB)\glib\gatomic.obj:
	echo $(CC) $(CFLAGS) /DG_LOG_DOMAIN=\"GLib\" /DGLIB_COMPILATION /DHAVE_CONFIG_H /FImsvc_recommended_pragmas.h /I$(GLIB) /I$(GLIB)\glib /I$(GLIB)\build\win32\dirent /I$(GETTEXT) /I$(LIBICONV)\include $*.c > gatomic.bat
	echo if errorlevel 1 $(CC) $(CFLAGS) /DG_LOG_DOMAIN=\"GLib\" /DGLIB_COMPILATION /DHAVE_CONFIG_H /FImsvc_recommended_pragmas.h /I$(GLIB) /I$(GLIB)\glib /I$(GLIB)\build\win32\dirent /I$(GETTEXT) /I$(LIBICONV)\include iwm\glib\gatomic.c >> gatomic.bat
	gatomic.bat
	del gatomic.bat

$(GLIB)\glib\galias.h:
	$(PERL) $(GLIB)\glib\makegalias.pl < $(GLIB)\glib\glib.symbols > $@

$(GLIB)\glib\galiasdef.c:
	$(PERL) $(GLIB)\glib\makegalias.pl -def < $(GLIB)\glib\glib.symbols > $@

# gspawn
$(GLIB)\glib\gspawn-win32-helper.exe: $(GLIB)\glib\gspawn-win32-helper.obj $(GLIB)\glib\glib.res
	$(LINK) $(LFLAGS) $(GLIB)\glib\glib-2.0.lib user32.lib $**

$(GLIB)\glib\gspawn-win32-helper.obj:
	$(CC) $(CFLAGS) /DG_LOG_DOMAIN=\"gspawn-win32-helper\" /DGLIB_COMPILATION /DHAVE_CONFIG_H /FImsvc_recommended_pragmas.h /I$(GLIB) $*.c

# GModule
$(GLIB)\gmodule\libgmodule-2.0-0.dll: $(GLIB)\gmodule\gmodule.obj $(GLIB)\gmodule\gmodule.res
	$(LINK) $(LFLAGS) /DLL /DEF:$(GLIB)\gmodule\gmodule.def /IMPLIB:$(GLIB)\gmodule\gmodule-2.0.lib $(GLIB)\glib\glib-2.0.lib $**

$(GLIB)\gmodule\gmodule.res: $*.rc
	$(RC) $(RFLAGS) /DBUILDNUMBER=0 $**

$(GLIB)\gmodule\gmodule.rc:
	$(PERL) replace.pl @GLIB_MAJOR_VERSION@=$(GLIB_MAJOR_VERSION) @GLIB_MINOR_VERSION@=$(GLIB_MINOR_VERSION) @GLIB_MICRO_VERSION@=$(GLIB_MICRO_VERSION) @GLIB_VERSION@=$(GLIB_VERSION) @LT_CURRENT_MINUS_AGE@=0 < $@.in > $@

$(GLIB)\gmodule\gmodule.obj: $(GLIB)\gmodule\gmoduleconf.h
	$(CC) $(CFLAGS) /DG_LOG_DOMAIN=\"GModule\" /DHAVE_CONFIG_H /FImsvc_recommended_pragmas.h /I$(GLIB) /I$(GLIB)\glib /I$(GLIB)\gmodule $*.c

$(GLIB)\gmodule\gmoduleconf.h: $@.win32
	copy /y $** $@

# GObject
gobject_OBJECTS= \
		$(GLIB)\gobject\gboxed.obj \
		$(GLIB)\gobject\gclosure.obj \
		$(GLIB)\gobject\genums.obj \
		$(GLIB)\gobject\gobject.obj \
		$(GLIB)\gobject\gparam.obj \
		$(GLIB)\gobject\gparamspecs.obj \
		$(GLIB)\gobject\gsignal.obj \
		$(GLIB)\gobject\gsourceclosure.obj \
		$(GLIB)\gobject\gtype.obj \
		$(GLIB)\gobject\gtypemodule.obj \
		$(GLIB)\gobject\gtypeplugin.obj \
		$(GLIB)\gobject\gvalue.obj \
		$(GLIB)\gobject\gvaluearray.obj \
		$(GLIB)\gobject\gvaluetypes.obj \
		$(GLIB)\gobject\gvaluetransform.obj

$(GLIB)\gobject\libgobject-2.0-0.dll: $(gobject_OBJECTS) $(GLIB)\gobject\gobject.res $(GLIB)\gobject\gobject.def
	$(LINK) $(LFLAGS) /DLL /DEF:$(GLIB)\gobject\gobject.def /IMPLIB:$(GLIB)\gobject\gobject-2.0.lib $(GLIB)\glib\glib-2.0.lib $(gobject_OBJECTS) $(GLIB)\gobject\gobject.res

$(GLIB)\gobject\gobject.res:
	$(RC) $(RFLAGS) /DBUILDNUMBER=0 $*.rc

$(GLIB)\gobject\gobject.rc:
	$(PERL) replace.pl @GLIB_MAJOR_VERSION@=$(GLIB_MAJOR_VERSION) @GLIB_MINOR_VERSION@=$(GLIB_MINOR_VERSION) @GLIB_MICRO_VERSION@=$(GLIB_MICRO_VERSION) @GLIB_VERSION@=$(GLIB_VERSION) @LT_CURRENT_MINUS_AGE@=0 < $@.in > $@

$(GLIB)\gobject\gobject.def:
	echo EXPORTS > $@
	$(CC) /EP /DALL_FILES /DG_GNUC_CONST= /DG_GNUC_NULL_TERMINATED= /DINCLUDE_INTERNAL_SYMBOLS /DINCLUDE_VARIABLES /DPRIVATE= $(GLIB)\gobject\gobject.symbols >> $@

!ifdef CVS
$(gobject_OBJECTS): $(GLIB)\gobject\gobjectalias.h $(GLIB)\gobject\gmarshal.h $(GLIB)\gobject\gmarshal.c $(GLIB)\gobject\gobjectaliasdef.c
!else
$(gobject_OBJECTS): $(GLIB)\gobject\gobjectalias.h $(GLIB)\gobject\gmarshal.h $(GLIB)\gobject\gmarshal.c
!endif
	$(CC) $(CFLAGS) /DG_LOG_DOMAIN=\"GLib-GObject\" /DGOBJECT_COMPILATION /DHAVE_CONFIG_H /FImsvc_recommended_pragmas.h /I$(GLIB) /I$(GLIB)\glib /I$(GLIB)\gobject $*.c

$(GLIB)\gobject\gobjectalias.h:
	$(PERL) $(GLIB)\gobject\makegobjectalias.pl < $(GLIB)\gobject\gobject.symbols > $@

$(GLIB)\gobject\gobjectaliasdef.c:
	$(PERL) $(GLIB)\gobject\makegobjectalias.pl -def < $(GLIB)\gobject\gobject.symbols > $@

$(GLIB)\gobject\gmarshal.c: $(GLIB)\gobject\glib-genmarshal.exe
	copy /y $(LIBICONV)\lib\iconv.dll .
	copy /y $(GETTEXT)\gettext-runtime\intl\intl.dll .
	copy /y $(GLIB)\glib\libglib-2.0-0.dll .
	$(GLIB)\gobject\glib-genmarshal.exe --nostdinc --prefix=g_cclosure_marshal $(GLIB)\gobject\gmarshal.list --body > $@
	del libglib-2.0-0.dll
	del intl.dll
	del iconv.dll

$(GLIB)\gobject\gmarshal.h: $(GLIB)\gobject\glib-genmarshal.exe
	echo #ifndef __G_MARSHAL_H__ > $@
	echo #define __G_MARSHAL_H__ >> $@
	copy /y $(LIBICONV)\lib\iconv.dll .
	copy /y $(GETTEXT)\gettext-runtime\intl\intl.dll .
	copy /y $(GLIB)\glib\libglib-2.0-0.dll .
	$(GLIB)\gobject\glib-genmarshal.exe --nostdinc --prefix=g_cclosure_marshal $(GLIB)\gobject\gmarshal.list --header >> $@
	del libglib-2.0-0.dll
	del intl.dll
	del iconv.dll
	echo #endif /* __G_MARSHAL_H__ */ >> $@

# gmarshal
$(GLIB)\gobject\glib-genmarshal.exe: $(GLIB)\gobject\glib-genmarshal.obj
	$(LINK) $(LFLAGS) $(GLIB)\glib\glib-2.0.lib $**

$(GLIB)\gobject\glib-genmarshal.obj: $(GLIB)\gobject\gmarshal.strings
	$(CC) $(CFLAGS) /DG_LOG_DOMAIN=\"GLib-Genmarshal\" /DHAVE_CONFIG_H /FImsvc_recommended_pragmas.h /I$(GLIB) /I$(GLIB)\glib $*.c

$(GLIB)\gobject\gmarshal.strings:
	copy /y $(GLIB)\gobject\gmarshal.list .
	$(PERL) $(GLIB)\gobject\marshal-genstrings.pl > $@
	del gmarshal.list

# glib-mkenums
$(GLIB)\gobject\glib-mkenums:
	$(PERL) replace.pl @PERL_PATH@=/usr/bin/perl @GLIB_VERSION@=$(GLIB_VERSION) < $@.in > $@

# GThread
$(GLIB)\gthread\libgthread-2.0-0.dll: $(GLIB)\gthread\gthread-impl.obj $(GLIB)\gthread\gthread.res
	$(LINK) $(LFLAGS) /DLL /DEF:$(GLIB)\gthread\gthread.def /IMPLIB:$(GLIB)\gthread\gthread-2.0.lib $(GLIB)\glib\glib-2.0.lib $**

$(GLIB)\gthread\gthread.res: $*.rc
	$(RC) $(RFLAGS) /DBUILDNUMBER=0 $**

$(GLIB)\gthread\gthread.rc:
	$(PERL) replace.pl @GLIB_MAJOR_VERSION@=$(GLIB_MAJOR_VERSION) @GLIB_MINOR_VERSION@=$(GLIB_MINOR_VERSION) @GLIB_MICRO_VERSION@=$(GLIB_MICRO_VERSION) @GLIB_VERSION@=$(GLIB_VERSION) @LT_CURRENT_MINUS_AGE@=0 < $@.in > $@

$(GLIB)\gthread\gthread-impl.obj:
	$(CC) $(CFLAGS) /DG_LOG_DOMAIN=\"GThread\" /DHAVE_CONFIG_H /FImsvc_recommended_pragmas.h /I$(GLIB) /I$(GLIB)\glib /I$(GLIB)\gthread $*.c

###############################################################################
# GTK+                                                                        #
###############################################################################
!ifdef CVS
gtk: atk cairo jpeg libpng pango tiff \
!else
gtk: atk jpeg libpng pango tiff \
!endif
		$(GTK)\gdk-pixbuf\libgdk_pixbuf-2.0-0.dll \
!ifdef CVS
		$(GTK)\gdk-pixbuf\gdk-pixbuf-csource.exe \
!endif
		$(GTK)\gdk\libgdk-win32-2.0-0.dll \
		$(GTK)\gtk\libgtk-win32-2.0-0.dll \
		$(GTK)\modules\input\inputim-am-et.dll \
		$(GTK)\modules\input\inputim-cedilla.dll \
		$(GTK)\modules\input\inputim-cyrillic-translit.dll \
		$(GTK)\modules\input\inputim-ime.dll \
		$(GTK)\modules\input\inputim-inuktitut.dll \
		$(GTK)\modules\input\inputim-ipa.dll \
		$(GTK)\modules\input\inputim-thai-broken.dll \
		$(GTK)\modules\input\inputim-ti-er.dll \
		$(GTK)\modules\input\inputim-ti-et.dll \
		$(GTK)\modules\input\inputim-viqr.dll \
		$(GTK)\gtk\gtk-query-immodules-2.0.exe

$(GTK)\config.h: $@.win32
	copy /y $** $@
	echo /* Enable CODESET */ >> $@
	echo #ifndef HAVE_BIND_TEXTDOMAIN_CODESET >> $@
	echo #define HAVE_BIND_TEXTDOMAIN_CODESET 1 >> $@
	echo #endif >> $@
	echo /* Disable WinTab */ >> $@
	echo #ifdef HAVE_WINTAB >> $@
	echo #undef HAVE_WINTAB >> $@
	echo #endif >> $@

$(GTK)\config.h.win32:
	$(PERL) replace.pl @GETTEXT_PACKAGE@=gtk20 < $@.in > $@

# GdkPixbuf
gdk_pixbuf_OBJECTS= \
		$(GTK)\gdk-pixbuf\gdk-pixbuf-enum-types.obj \
		$(GTK)\gdk-pixbuf\gdk-pixbuf-animation.obj \
		$(GTK)\gdk-pixbuf\gdk-pixbuf-data.obj \
		$(GTK)\gdk-pixbuf\gdk-pixbuf-io.obj \
		$(GTK)\gdk-pixbuf\gdk-pixbuf-loader.obj \
		$(GTK)\gdk-pixbuf\gdk-pixbuf-scale.obj \
		$(GTK)\gdk-pixbuf\gdk-pixbuf-util.obj \
		$(GTK)\gdk-pixbuf\gdk-pixbuf.obj \
		$(GTK)\gdk-pixbuf\gdk-pixdata.obj \
		$(GTK)\gdk-pixbuf\io-bmp.obj \
		$(GTK)\gdk-pixbuf\io-wbmp.obj \
		$(GTK)\gdk-pixbuf\io-gif.obj \
		$(GTK)\gdk-pixbuf\io-gif-animation.obj \
		$(GTK)\gdk-pixbuf\io-ico.obj \
		$(GTK)\gdk-pixbuf\io-png.obj \
		$(GTK)\gdk-pixbuf\io-pnm.obj \
		$(GTK)\gdk-pixbuf\io-ras.obj \
		$(GTK)\gdk-pixbuf\io-xpm.obj \
		$(GTK)\gdk-pixbuf\io-jpeg.obj \
		$(GTK)\gdk-pixbuf\pixops\pixops.obj

$(GTK)\gdk-pixbuf\libgdk_pixbuf-2.0-0.dll: $(gdk_pixbuf_OBJECTS) $(GTK)\gdk-pixbuf\gdk_pixbuf.res $(GTK)\gdk-pixbuf\gdk_pixbuf.def
	$(LINK) $(LFLAGS) /DLL /DEF:$(GTK)\gdk-pixbuf\gdk_pixbuf.def /IMPLIB:$(GTK)\gdk-pixbuf\gdk_pixbuf-2.0.lib $(GLIB)\glib\glib-2.0.lib $(GLIB)\gobject\gobject-2.0.lib $(GETTEXT)\gettext-runtime\intl\intl.lib $(JPEG)\libjpeg.lib $(LIBPNG)\libpng13.lib $(gdk_pixbuf_OBJECTS) $(GTK)\gdk-pixbuf\gdk_pixbuf.res

$(GTK)\gdk-pixbuf\gdk_pixbuf.res: $*.rc
	$(RC) $(RFLAGS) /DBUILDNUMBER=0 $**

$(GTK)\gdk-pixbuf\gdk_pixbuf.rc:
	$(PERL) replace.pl @GTK_MAJOR_VERSION@=$(GTK_MAJOR_VERSION) @GTK_MINOR_VERSION@=$(GTK_MINOR_VERSION) @GTK_MICRO_VERSION@=$(GTK_MICRO_VERSION) @GTK_VERSION@=$(GTK_VERSION) @GTK_API_VERSION@=2.0 @LT_CURRENT_MINUS_AGE@=0 < $@.in > $@

$(GTK)\gdk-pixbuf\gdk_pixbuf.def:
	echo EXPORTS > $@
	$(CC) /EP /DALL_FILES /DG_GNUC_CONST= /DG_GNUC_NULL_TERMINATED= /DG_OS_WIN32 /DINCLUDE_VARIABLES $(GTK)\gdk-pixbuf\gdk-pixbuf.symbols >> $@

$(gdk_pixbuf_OBJECTS): $(GTK)\config.h $(GTK)\gdk-pixbuf\gdk-pixbuf-alias.h $(GTK)\gdk-pixbuf\gdk-pixbuf-aliasdef.c $(GTK)\gdk-pixbuf\gdk-pixbuf-enum-types.c $(GTK)\gdk-pixbuf\gdk-pixbuf-enum-types.h $(GTK)\gdk-pixbuf\gdk-pixbuf-features.h $(GTK)\gdk-pixbuf\gdk-pixbuf-marshal.c $(GTK)\gdk-pixbuf\gdk-pixbuf-marshal.h
	$(CC) $(CFLAGS) \
	/D_gdk_pixbuf_marshal_VOID__INT_INT=gdk_pixbuf_marshal_VOID__INT_INT \
	/D_gdk_pixbuf_marshal_VOID__VOID=gdk_pixbuf_marshal_VOID__VOID \
	/D_gdk_pixbuf_marshal_VOID__INT_INT_INT_INT=gdk_pixbuf_marshal_VOID__INT_INT_INT_INT \
	/DGDK_PIXBUF_ENABLE_BACKEND /DHAVE_CONFIG_H /DINCLUDE_png /DINCLUDE_bmp /DINCLUDE_gif /DINCLUDE_ico /DINCLUDE_jpeg /DINCLUDE_xpm /DINCLUDE_wbmp /DINCLUDE_pnm /DINCLUDE_ras /UUSE_GMODULE /FImsvc_recommended_pragmas.h /I$(GTK) /I$(GTK)\gdk-pixbuf /I$(GLIB) /I$(GLIB)\glib /I$(GLIB)\gmodule /I$(JPEG) /I$(LIBPNG) /I$(ZLIB) $*.c

$(GTK)\gdk-pixbuf\gdk-pixbuf-alias.h:
	$(PERL) $(GTK)\gdk-pixbuf\makegdkpixbufalias.pl < $(GTK)\gdk-pixbuf\gdk-pixbuf.symbols > $@

$(GTK)\gdk-pixbuf\gdk-pixbuf-aliasdef.c:
	$(PERL) $(GTK)\gdk-pixbuf\makegdkpixbufalias.pl -def < $(GTK)\gdk-pixbuf\gdk-pixbuf.symbols > $@

gdk_pixbuf_headers= \
		$(GTK)\gdk-pixbuf\gdk-pixbuf.h \
		$(GTK)\gdk-pixbuf\gdk-pixbuf-core.h \
		$(GTK)\gdk-pixbuf\gdk-pixbuf-loader.h \
		$(GTK)\gdk-pixbuf\gdk-pixbuf-transform.h

$(GTK)\gdk-pixbuf\gdk-pixbuf-enum-types.c:
	$(PERL) $(GLIB)\gobject\glib-mkenums \
		--fhead "#include <gdk-pixbuf/gdk-pixbuf.h>" \
		--fprod "\n/* enumerations from \"@filename@\" */" \
		--vhead "GType\n@enum_name@_get_type (void)\n{\n  static GType etype = 0;\n  if (etype == 0) {\n    static const G@Type@Value values[] = {"       \
		--vprod "      { @VALUENAME@, \"@VALUENAME@\", \"@valuenick@\" }," \
		--vtail "      { 0, NULL, NULL }\n    };\n    etype = g_@type@_register_static (\"@EnumName@\", values);\n  }\n  return etype;\n}\n" \
		  $(gdk_pixbuf_headers) > $@

$(GTK)\gdk-pixbuf\gdk-pixbuf-enum-types.h:
	$(PERL) $(GLIB)\gobject\glib-mkenums \
		--fhead "#ifndef __GDK_PIXBUF__ENUM_TYPES_H__\n#define __GDK_PIXBUF_ENUM_TYPES_H__\n" \
		--fprod "/* enumerations from \"@filename@\" */\n" \
		--vhead "GType @enum_name@_get_type (void);\n#define GDK_TYPE_@ENUMSHORT@ (@enum_name@_get_type())\n"         \
		--ftail "#endif /* __GDK_PIXBUF_ENUM_TYPES_H__ */" \
		$(gdk_pixbuf_headers) ) > $@

$(GTK)\gdk-pixbuf\gdk-pixbuf-features.h:
	$(PERL) replace.pl @GDK_PIXBUF_MAJOR@=$(GTK_MAJOR_VERSION) @GDK_PIXBUF_MINOR@=$(GTK_MINOR_VERSION) @GDK_PIXBUF_MICRO@=$(GTK_MICRO_VERSION) @GDK_PIXBUF_VERSION@=$(GTK_VERSION) < $@.in > $@

$(GTK)\gdk-pixbuf\gdk-pixbuf-marshal.c:
	copy /y $(LIBICONV)\lib\iconv.dll .
	copy /y $(GETTEXT)\gettext-runtime\intl\intl.dll .
	copy /y $(GLIB)\glib\libglib-2.0-0.dll .
	$(GLIB)\gobject\glib-genmarshal.exe --prefix=gdk_pixbuf_marshal $(GTK)\gdk-pixbuf\gdk-pixbuf-marshal.list --body > $@
	del libglib-2.0-0.dll
	del intl.dll
	del iconv.dll

$(GTK)\gdk-pixbuf\gdk-pixbuf-marshal.h:
	copy /y $(LIBICONV)\lib\iconv.dll .
	copy /y $(GETTEXT)\gettext-runtime\intl\intl.dll .
	copy /y $(GLIB)\glib\libglib-2.0-0.dll .
	$(GLIB)\gobject\glib-genmarshal.exe --prefix=gdk_pixbuf_marshal $(GTK)\gdk-pixbuf\gdk-pixbuf-marshal.list --header > $@
	del libglib-2.0-0.dll
	del intl.dll
	del iconv.dll

# gdk-pixbuf-csource
$(GTK)\gdk-pixbuf\gdk-pixbuf-csource.exe: $*.obj $(GTK)\gdk-pixbuf\gdk_pixbuf.res
	$(LINK) $(LFLAGS) $(GLIB)\glib\glib-2.0.lib $(GLIB)\gobject\gobject-2.0.lib $(GTK)\gdk-pixbuf\gdk_pixbuf-2.0.lib $**

$(GTK)\gdk-pixbuf\gdk-pixbuf-csource.obj: $*.c $(GTK)\gtk\gtkversion.h
	$(CC) $(CFLAGS) /DGDK_PIXBUF_ENABLE_BACKEND /DHAVE_CONFIG_H /DINCLUDE_png /DINCLUDE_bmp /DINCLUDE_gif /DINCLUDE_ico /DINCLUDE_jpeg /DINCLUDE_xpm /DINCLUDE_wbmp /DINCLUDE_pnm /DINCLUDE_ras /UUSE_GMODULE /FImsvc_recommended_pragmas.h /I$(GTK) /I$(GTK)\gdk-pixbuf /I$(GLIB) /I$(GLIB)\glib /I$(GLIB)\gmodule $*.c

$(GTK)\gtk\gtkversion.h:
	$(PERL) replace.pl @GTK_MAJOR_VERSION@=$(GTK_MAJOR_VERSION) @GTK_MINOR_VERSION@=$(GTK_MINOR_VERSION) @GTK_MICRO_VERSION@=$(GTK_MICRO_VERSION) @GTK_BINARY_AGE@=$(GTK_BINARY_AGE) @GTK_INTERFACE_AGE@=0 < $@.in > $@

# GDK
gdk_OBJECTS= \
		$(GTK)\gdk\gdk.obj \
		$(GTK)\gdk\gdkcolor.obj \
		$(GTK)\gdk\gdkcursor.obj \
		$(GTK)\gdk\gdkdisplay.obj \
		$(GTK)\gdk\gdkdisplaymanager.obj \
		$(GTK)\gdk\gdkdnd.obj \
		$(GTK)\gdk\gdkdraw.obj \
		$(GTK)\gdk\gdkenumtypes.obj \
		$(GTK)\gdk\gdkevents.obj \
		$(GTK)\gdk\gdkfont.obj \
		$(GTK)\gdk\gdkgc.obj \
		$(GTK)\gdk\gdkglobals.obj \
		$(GTK)\gdk\gdkimage.obj \
		$(GTK)\gdk\gdkkeynames.obj \
		$(GTK)\gdk\gdkkeys.obj \
		$(GTK)\gdk\gdkkeyuni.obj \
		$(GTK)\gdk\gdkpango.obj \
		$(GTK)\gdk\gdkpixbuf-drawable.obj \
		$(GTK)\gdk\gdkpixbuf-render.obj \
		$(GTK)\gdk\gdkpixmap.obj \
		$(GTK)\gdk\gdkpolyreg-generic.obj \
		$(GTK)\gdk\gdkrectangle.obj \
		$(GTK)\gdk\gdkregion-generic.obj \
		$(GTK)\gdk\gdkrgb.obj \
		$(GTK)\gdk\gdkscreen.obj \
		$(GTK)\gdk\gdkselection.obj \
		$(GTK)\gdk\gdkvisual.obj \
		$(GTK)\gdk\gdkwindow.obj \
		$(GTK)\gdk\win32\gdkcolor-win32.obj \
		$(GTK)\gdk\win32\gdkcursor-win32.obj \
		$(GTK)\gdk\win32\gdkdnd-win32.obj \
		$(GTK)\gdk\win32\gdkdisplay-win32.obj \
		$(GTK)\gdk\win32\gdkdrawable-win32.obj \
		$(GTK)\gdk\win32\gdkevents-win32.obj \
		$(GTK)\gdk\win32\gdkfont-win32.obj \
		$(GTK)\gdk\win32\gdkgc-win32.obj \
		$(GTK)\gdk\win32\gdkgeometry-win32.obj \
		$(GTK)\gdk\win32\gdkglobals-win32.obj \
		$(GTK)\gdk\win32\gdkim-win32.obj \
		$(GTK)\gdk\win32\gdkimage-win32.obj \
		$(GTK)\gdk\win32\gdkinput.obj \
		$(GTK)\gdk\win32\gdkinput-win32.obj \
		$(GTK)\gdk\win32\gdkkeys-win32.obj \
		$(GTK)\gdk\win32\gdkmain-win32.obj \
!ifndef CVS
		$(GTK)\gdk\win32\gdkpango-win32.obj \
!endif
		$(GTK)\gdk\win32\gdkpixmap-win32.obj \
		$(GTK)\gdk\win32\gdkproperty-win32.obj \
#		$(GTK)\gdk\win32\gdkregion-win32.obj \
		$(GTK)\gdk\win32\gdkscreen-win32.obj \
		$(GTK)\gdk\win32\gdkselection-win32.obj \
		$(GTK)\gdk\win32\gdkspawn-win32.obj \
		$(GTK)\gdk\win32\gdkvisual-win32.obj \
		$(GTK)\gdk\win32\gdkwin32id.obj \
		$(GTK)\gdk\win32\gdkwindow-win32.obj

$(GTK)\gdk\libgdk-win32-2.0-0.dll: $(gdk_OBJECTS) $(GTK)\gdk\win32\rc\gdk.res $(GTK)\gdk\gdk.def
!ifdef CVS
	$(LINK) $(LFLAGS) /DLL /DEF:$(GTK)\gdk\gdk.def /IMPLIB:$(GTK)\gdk\gdk-win32-2.0.lib $(CAIRO)\src\$(CAIRO).lib $(GLIB)\glib\glib-2.0.lib $(GLIB)\gobject\gobject-2.0.lib $(GTK)\gdk-pixbuf\gdk_pixbuf-2.0.lib $(PANGO)\pango\pango-1.0.lib $(PANGO)\pango\pangowin32-1.0.lib $(GETTEXT)\gettext-runtime\intl\intl.lib gdi32.lib imm32.lib ole32.lib shell32.lib user32.lib $(gdk_OBJECTS) $(GTK)\gdk\win32\rc\gdk.res
!else
	$(LINK) $(LFLAGS) /DLL /DEF:$(GTK)\gdk\gdk.def /IMPLIB:$(GTK)\gdk\gdk-win32-2.0.lib $(GLIB)\glib\glib-2.0.lib $(GLIB)\gobject\gobject-2.0.lib $(GTK)\gdk-pixbuf\gdk_pixbuf-2.0.lib $(PANGO)\pango\pango-1.0.lib $(PANGO)\pango\pangowin32-1.0.lib $(GETTEXT)\gettext-runtime\intl\intl.lib gdi32.lib imm32.lib ole32.lib shell32.lib user32.lib $(gdk_OBJECTS) $(GTK)\gdk\win32\rc\gdk.res
!endif

$(GTK)\gdk\win32\rc\gdk.res: $*.rc
	$(RC) $(RFLAGS) /DBUILDNUMBER=0 $**

$(GTK)\gdk\win32\rc\gdk.rc:
	$(PERL) replace.pl @GTK_MAJOR_VERSION@=$(GTK_MAJOR_VERSION) @GTK_MINOR_VERSION@=$(GTK_MINOR_VERSION) @GTK_MICRO_VERSION@=$(GTK_MICRO_VERSION) @GTK_VERSION@=$(GTK_VERSION) @GTK_API_VERSION@=2.0 @LT_CURRENT_MINUS_AGE@=0 < $@.in > $@

$(GTK)\gdk\gdk.def:
	echo EXPORTS > $@
	$(CC) /EP /DALL_FILES /DG_GNUC_CONST= /DGDK_WINDOWING_WIN32 /DINCLUDE_VARIABLES $(GTK)\gdk\gdk.symbols >> $@

$(gdk_OBJECTS): $(GTK)\gdk\gdkalias.h $(GTK)\gdk\gdkaliasdef.c $(GTK)\gdk\gdkconfig.h $(GTK)\gdk\gdkenumtypes.c $(GTK)\gdk\gdkenumtypes.h $(GTK)\gdk\gdkmarshalers.c $(GTK)\gdk\gdkmarshalers.h
!ifdef CVS
	$(CC) $(CFLAGS) /DG_LOG_DOMAIN=\"Gdk\" /DGDK_ENABLE_BROKEN /DGDK_VERSION=\"2.0\" /DHAVE_CONFIG_H /DINSIDE_GDK_WIN32 /FImsvc_recommended_pragmas.h /I$(GTK) /I$(GTK)\gdk /I$(GTK)\gdk\win32 /I$(GTK)\gdk-pixbuf /I$(GLIB) /I$(GLIB)\glib /I$(GLIB)\gmodule /I$(PANGO) /I$(CAIRO)\src /I$(LIBPIXMAN)\src /Iiwm\include $*.c
!else
	$(CC) $(CFLAGS) /DG_LOG_DOMAIN=\"Gdk\" /DGDK_ENABLE_BROKEN /DGDK_VERSION=\"2.0\" /DHAVE_CONFIG_H /DINSIDE_GDK_WIN32 /FImsvc_recommended_pragmas.h /I$(GTK) /I$(GTK)\gdk /I$(GTK)\gdk\win32 /I$(GTK)\gdk-pixbuf /I$(GLIB) /I$(GLIB)\glib /I$(GLIB)\gmodule /I$(PANGO) $*.c
!endif

$(GTK)\gdk\gdkalias.h:
	$(PERL) $(GTK)\gdk\makegdkalias.pl < $(GTK)\gdk\gdk.symbols > $@

$(GTK)\gdk\gdkaliasdef.c:
	$(PERL) $(GTK)\gdk\makegdkalias.pl -def < $(GTK)\gdk\gdk.symbols > $@

$(GTK)\gdk\gdkconfig.h: $@.win32
	copy /y $** $@

gdk_headers= \
		$(GTK)\gdk\gdk.h \
		$(GTK)\gdk\gdkcolor.h \
		$(GTK)\gdk\gdkcursor.h \
		$(GTK)\gdk\gdkdnd.h \
		$(GTK)\gdk\gdkdrawable.h \
		$(GTK)\gdk\gdkevents.h \
		$(GTK)\gdk\gdkfont.h \
		$(GTK)\gdk\gdkgc.h \
		$(GTK)\gdk\gdkkeysyms.h \
		$(GTK)\gdk\gdki18n.h \
		$(GTK)\gdk\gdkimage.h \
		$(GTK)\gdk\gdkinput.h \
		$(GTK)\gdk\gdkkeys.h \
		$(GTK)\gdk\gdkpango.h \
		$(GTK)\gdk\gdkpixbuf.h \
		$(GTK)\gdk\gdkpixmap.h \
		$(GTK)\gdk\gdkproperty.h \
		$(GTK)\gdk\gdkregion.h \
		$(GTK)\gdk\gdkrgb.h \
		$(GTK)\gdk\gdkselection.h \
		$(GTK)\gdk\gdktypes.h \
		$(GTK)\gdk\gdkvisual.h \
		$(GTK)\gdk\gdkwindow.h

$(GTK)\gdk\gdkenumtypes.c:
	$(PERL) $(GTK)\gdk\makeenums.pl cfile $(gdk_headers) > $@

$(GTK)\gdk\gdkenumtypes.h:
	$(PERL) $(GTK)\gdk\makeenums.pl include $(gdk_headers) > $@

$(GTK)\gdk\gdkmarshalers.c:
	copy /y $(LIBICONV)\lib\iconv.dll .
	copy /y $(GETTEXT)\gettext-runtime\intl\intl.dll .
	copy /y $(GLIB)\glib\libglib-2.0-0.dll .
	$(GLIB)\gobject\glib-genmarshal.exe --prefix=gdk_marshal $(GTK)\gdk\gdkmarshalers.list --body > $@
	del libglib-2.0-0.dll
	del intl.dll
	del iconv.dll

$(GTK)\gdk\gdkmarshalers.h:
	copy /y $(LIBICONV)\lib\iconv.dll .
	copy /y $(GETTEXT)\gettext-runtime\intl\intl.dll .
	copy /y $(GLIB)\glib\libglib-2.0-0.dll .
	$(GLIB)\gobject\glib-genmarshal.exe --prefix=gdk_marshal $(GTK)\gdk\gdkmarshalers.list --header > $@
	del libglib-2.0-0.dll
	del intl.dll
	del iconv.dll

# GTK+
gtk_OBJECTS= \
		$(GTK)\gtk\fnmatch.obj \
		$(GTK)\gtk\gtkaboutdialog.obj \
		$(GTK)\gtk\gtkaccelgroup.obj \
		$(GTK)\gtk\gtkaccellabel.obj \
		$(GTK)\gtk\gtkaccelmap.obj \
		$(GTK)\gtk\gtkaccessible.obj \
		$(GTK)\gtk\gtkaction.obj \
		$(GTK)\gtk\gtkactiongroup.obj \
		$(GTK)\gtk\gtkadjustment.obj \
		$(GTK)\gtk\gtkalignment.obj \
		$(GTK)\gtk\gtkarrow.obj \
		$(GTK)\gtk\gtkaspectframe.obj \
		$(GTK)\gtk\gtkbin.obj \
		$(GTK)\gtk\gtkbindings.obj \
		$(GTK)\gtk\gtkbbox.obj \
		$(GTK)\gtk\gtkbox.obj \
		$(GTK)\gtk\gtkbutton.obj \
		$(GTK)\gtk\gtkcalendar.obj \
		$(GTK)\gtk\gtkcelleditable.obj \
		$(GTK)\gtk\gtkcelllayout.obj \
		$(GTK)\gtk\gtkcellrenderer.obj \
		$(GTK)\gtk\gtkcellrenderercombo.obj \
		$(GTK)\gtk\gtkcellrenderertext.obj \
		$(GTK)\gtk\gtkcellrenderertoggle.obj \
		$(GTK)\gtk\gtkcellrendererpixbuf.obj \
		$(GTK)\gtk\gtkcellrendererprogress.obj \
		$(GTK)\gtk\gtkcellview.obj \
		$(GTK)\gtk\gtkcheckbutton.obj \
		$(GTK)\gtk\gtkcheckmenuitem.obj \
		$(GTK)\gtk\gtkclipboard.obj \
		$(GTK)\gtk\gtkclist.obj \
		$(GTK)\gtk\gtkcolorbutton.obj \
		$(GTK)\gtk\gtkcolorsel.obj \
		$(GTK)\gtk\gtkcolorseldialog.obj \
		$(GTK)\gtk\gtkcombo.obj \
		$(GTK)\gtk\gtkcombobox.obj \
		$(GTK)\gtk\gtkcomboboxentry.obj \
		$(GTK)\gtk\gtkcontainer.obj \
		$(GTK)\gtk\gtkctree.obj \
		$(GTK)\gtk\gtkcurve.obj \
		$(GTK)\gtk\gtkdialog.obj \
		$(GTK)\gtk\gtkdnd.obj \
		$(GTK)\gtk\gtkdrawingarea.obj \
		$(GTK)\gtk\gtkeditable.obj \
		$(GTK)\gtk\gtkentry.obj \
		$(GTK)\gtk\gtkentrycompletion.obj \
		$(GTK)\gtk\gtkeventbox.obj \
		$(GTK)\gtk\gtkexpander.obj \
		$(GTK)\gtk\gtkfilechooser.obj \
		$(GTK)\gtk\gtkfilechooserbutton.obj \
		$(GTK)\gtk\gtkfilechooserdefault.obj \
		$(GTK)\gtk\gtkfilechooserdialog.obj \
		$(GTK)\gtk\gtkfilechooserembed.obj \
		$(GTK)\gtk\gtkfilechooserentry.obj \
		$(GTK)\gtk\gtkfilechooserutils.obj \
		$(GTK)\gtk\gtkfilechooserwidget.obj \
		$(GTK)\gtk\gtkfilefilter.obj \
		$(GTK)\gtk\gtkfilesel.obj \
		$(GTK)\gtk\gtkfilesystem.obj \
		$(GTK)\gtk\gtkfilesystemmodel.obj \
		$(GTK)\gtk\gtkfilesystemwin32.obj \
		$(GTK)\gtk\gtkfixed.obj \
		$(GTK)\gtk\gtkfontsel.obj \
		$(GTK)\gtk\gtkfontbutton.obj \
		$(GTK)\gtk\gtkframe.obj \
		$(GTK)\gtk\gtkgamma.obj \
		$(GTK)\gtk\gtkgc.obj \
		$(GTK)\gtk\gtkhandlebox.obj \
		$(GTK)\gtk\gtkhbbox.obj \
		$(GTK)\gtk\gtkhbox.obj \
		$(GTK)\gtk\gtkhpaned.obj \
		$(GTK)\gtk\gtkhruler.obj \
		$(GTK)\gtk\gtkhscale.obj \
		$(GTK)\gtk\gtkhscrollbar.obj \
		$(GTK)\gtk\gtkhseparator.obj \
		$(GTK)\gtk\gtkhsv.obj \
		$(GTK)\gtk\gtkiconcache.obj \
		$(GTK)\gtk\gtkiconfactory.obj \
		$(GTK)\gtk\gtkicontheme.obj \
		$(GTK)\gtk\gtkiconview.obj \
		$(GTK)\gtk\gtkimage.obj \
		$(GTK)\gtk\gtkimagemenuitem.obj \
		$(GTK)\gtk\gtkimcontext.obj \
		$(GTK)\gtk\gtkimcontextsimple.obj \
		$(GTK)\gtk\gtkimmodule.obj \
		$(GTK)\gtk\gtkimmulticontext.obj \
		$(GTK)\gtk\gtkinputdialog.obj \
		$(GTK)\gtk\gtkinvisible.obj \
		$(GTK)\gtk\gtkitem.obj \
		$(GTK)\gtk\gtkitemfactory.obj \
		$(GTK)\gtk\gtkkeyhash.obj \
		$(GTK)\gtk\gtklabel.obj \
		$(GTK)\gtk\gtklayout.obj \
		$(GTK)\gtk\gtklist.obj \
		$(GTK)\gtk\gtklistitem.obj \
		$(GTK)\gtk\gtkliststore.obj \
		$(GTK)\gtk\gtkmain.obj \
		$(GTK)\gtk\gtkmarshalers.obj \
		$(GTK)\gtk\gtkmarshal.obj \
		$(GTK)\gtk\gtkmenu.obj \
		$(GTK)\gtk\gtkmenubar.obj \
		$(GTK)\gtk\gtkmenuitem.obj \
		$(GTK)\gtk\gtkmenushell.obj \
		$(GTK)\gtk\gtkmenutoolbutton.obj \
		$(GTK)\gtk\gtkmessagedialog.obj \
		$(GTK)\gtk\gtkmisc.obj \
		$(GTK)\gtk\gtkmnemonichash.obj \
		$(GTK)\gtk\gtkmodules.obj \
		$(GTK)\gtk\gtknotebook.obj \
		$(GTK)\gtk\gtkobject.obj \
		$(GTK)\gtk\gtkoldeditable.obj \
		$(GTK)\gtk\gtkoptionmenu.obj \
		$(GTK)\gtk\gtkpaned.obj \
		$(GTK)\gtk\gtkpathbar.obj \
		$(GTK)\gtk\gtkpixmap.obj \
#		$(GTK)\gtk\gtkplug.obj \
		$(GTK)\gtk\gtkpreview.obj \
		$(GTK)\gtk\gtkprogress.obj \
		$(GTK)\gtk\gtkprogressbar.obj \
		$(GTK)\gtk\gtkradioaction.obj \
		$(GTK)\gtk\gtkradiobutton.obj \
		$(GTK)\gtk\gtkradiotoolbutton.obj \
		$(GTK)\gtk\gtkradiomenuitem.obj \
		$(GTK)\gtk\gtkrange.obj \
		$(GTK)\gtk\gtkrbtree.obj \
		$(GTK)\gtk\gtkrc.obj \
		$(GTK)\gtk\gtkruler.obj \
		$(GTK)\gtk\gtkscale.obj \
		$(GTK)\gtk\gtkscrollbar.obj \
		$(GTK)\gtk\gtkscrolledwindow.obj \
		$(GTK)\gtk\gtksequence.obj \
		$(GTK)\gtk\gtkselection.obj \
		$(GTK)\gtk\gtkseparator.obj \
		$(GTK)\gtk\gtkseparatormenuitem.obj \
		$(GTK)\gtk\gtkseparatortoolitem.obj \
		$(GTK)\gtk\gtksettings.obj \
		$(GTK)\gtk\gtksignal.obj \
		$(GTK)\gtk\gtksizegroup.obj \
#		$(GTK)\gtk\gtksocket.obj \
		$(GTK)\gtk\gtkspinbutton.obj \
		$(GTK)\gtk\gtkstyle.obj \
		$(GTK)\gtk\gtkstatusbar.obj \
		$(GTK)\gtk\gtkstock.obj \
		$(GTK)\gtk\gtktable.obj \
		$(GTK)\gtk\gtktearoffmenuitem.obj \
		$(GTK)\gtk\gtktext.obj \
		$(GTK)\gtk\gtktextbtree.obj \
		$(GTK)\gtk\gtktextbuffer.obj \
		$(GTK)\gtk\gtktextchild.obj \
		$(GTK)\gtk\gtktextdisplay.obj \
		$(GTK)\gtk\gtktextiter.obj \
		$(GTK)\gtk\gtktextlayout.obj \
		$(GTK)\gtk\gtktextmark.obj \
		$(GTK)\gtk\gtktextsegment.obj \
		$(GTK)\gtk\gtktexttag.obj \
		$(GTK)\gtk\gtktexttagtable.obj \
		$(GTK)\gtk\gtktexttypes.obj \
		$(GTK)\gtk\gtktextutil.obj \
		$(GTK)\gtk\gtktextview.obj \
		$(GTK)\gtk\gtkthemes.obj \
		$(GTK)\gtk\gtktipsquery.obj \
		$(GTK)\gtk\gtktoggleaction.obj \
		$(GTK)\gtk\gtktogglebutton.obj \
		$(GTK)\gtk\gtktoggletoolbutton.obj \
		$(GTK)\gtk\gtktoolbar.obj \
		$(GTK)\gtk\gtktoolbutton.obj \
		$(GTK)\gtk\gtktoolitem.obj \
		$(GTK)\gtk\gtktooltips.obj \
		$(GTK)\gtk\gtktree.obj \
		$(GTK)\gtk\gtktreedatalist.obj \
		$(GTK)\gtk\gtktreednd.obj \
		$(GTK)\gtk\gtktreeitem.obj \
		$(GTK)\gtk\gtktreemodel.obj \
		$(GTK)\gtk\gtktreemodelfilter.obj \
		$(GTK)\gtk\gtktreemodelsort.obj \
		$(GTK)\gtk\gtktreeselection.obj \
		$(GTK)\gtk\gtktreesortable.obj \
		$(GTK)\gtk\gtktreestore.obj \
		$(GTK)\gtk\gtktreeview.obj \
		$(GTK)\gtk\gtktreeviewcolumn.obj \
		$(GTK)\gtk\gtktypeutils.obj \
		$(GTK)\gtk\gtktypebuiltins.obj \
		$(GTK)\gtk\gtkuimanager.obj \
		$(GTK)\gtk\gtkvbbox.obj \
		$(GTK)\gtk\gtkvbox.obj \
		$(GTK)\gtk\gtkviewport.obj \
		$(GTK)\gtk\gtkvpaned.obj \
		$(GTK)\gtk\gtkvruler.obj \
		$(GTK)\gtk\gtkvscale.obj \
		$(GTK)\gtk\gtkvscrollbar.obj \
		$(GTK)\gtk\gtkvseparator.obj \
		$(GTK)\gtk\gtkwidget.obj \
		$(GTK)\gtk\gtkwindow.obj \
		$(GTK)\gtk\gtkwindow-decorate.obj

xdgmime_OBJECTS= \
		$(GTK)\gtk\xdgmime\xdgmime.obj \
		$(GTK)\gtk\xdgmime\xdgmimealias.obj \
		$(GTK)\gtk\xdgmime\xdgmimeglob.obj \
		$(GTK)\gtk\xdgmime\xdgmimeint.obj \
		$(GTK)\gtk\xdgmime\xdgmimemagic.obj \
		$(GTK)\gtk\xdgmime\xdgmimeparent.obj \

$(GTK)\gtk\libgtk-win32-2.0-0.dll: $(gtk_OBJECTS) $(GTK)\gtk\gtk-win32.res $(GTK)\gtk\gtk.def
	$(LINK) $(LFLAGS) /DLL /DEF:$(GTK)\gtk\gtk.def /IMPLIB:$(GTK)\gtk\gtk-win32-2.0.lib $(ATK)\atk\atk-1.0.lib $(GLIB)\glib\glib-2.0.lib $(GLIB)\gmodule\gmodule-2.0.lib $(GLIB)\gobject\gobject-2.0.lib $(GTK)\gdk-pixbuf\gdk_pixbuf-2.0.lib $(GTK)\gdk\gdk-win32-2.0.lib $(GETTEXT)\gettext-runtime\intl\intl.lib gdi32.lib ole32.lib shell32.lib user32.lib ws2_32.lib $(PANGO)\pango\pango-1.0.lib $(gtk_OBJECTS) $(GTK)\gtk\gtk-win32.res

$(GTK)\gtk\gtk-win32.res: $*.rc
	$(RC) $(RFLAGS) /DBUILDNUMBER=0 $**

$(GTK)\gtk\gtk-win32.rc:
	$(PERL) replace.pl @GTK_MAJOR_VERSION@=$(GTK_MAJOR_VERSION) @GTK_MINOR_VERSION@=$(GTK_MINOR_VERSION) @GTK_MICRO_VERSION@=$(GTK_MICRO_VERSION) @GTK_VERSION@=$(GTK_VERSION) @GTK_API_VERSION@=2.0 @LT_CURRENT_MINUS_AGE@=0 < $@.in > $@

$(GTK)\gtk\gtk.def:
	echo EXPORTS > $@
	echo #ifndef G_GNUC_CONST > def.h
	echo #define G_GNUC_CONST >> def.h
	echo #endif >> def.h
	echo #ifndef G_GNUC_NULL_TERMINATED >> def.h
	echo #define G_GNUC_NULL_TERMINATED >> def.h
	echo #endif >> def.h
	echo #ifndef G_GNUC_PRINTF >> def.h
	echo #define G_GNUC_PRINTF(format_idx,arg_idx) >> def.h
	echo #endif >> def.h
	$(CC) /EP /DALL_FILES /DG_OS_WIN32 /DINCLUDE_VARIABLES /FIdef.h /I. $(GTK)\gtk\gtk.symbols >> $@
	del def.h

$(gtk_OBJECTS): $(GTK)\gtk\gtkalias.h $(GTK)\gtk\gtkmarshal.c $(GTK)\gtk\gtkmarshal.h $(GTK)\gtk\gtkmarshalers.c $(GTK)\gtk\gtkmarshalers.h $(GTK)\gtk\gtktypebuiltins.c $(GTK)\gtk\gtktypebuiltins.h $(GTK)\gtk\stock-icons\gtkstockpixbufs.h
	$(CC) $(CFLAGS) /DG_LOG_DOMAIN=\"Gtk\" /DGTK_BINARY_VERSION=\"$(GTK_VERSION)\" /DGTK_DISABLE_COMPAT_H /DGTK_FILE_SYSTEM_ENABLE_UNSUPPORTED /DGTK_HOST=\"win32\" /DGTK_LIBDIR=\"/target/lib\" /DGTK_VERSION=\"2.0\" /Dnear=xxnear /DPANGO_ENABLE_BACKEND /FImsvc_recommended_pragmas.h /I$(GTK) /I$(GTK)\gdk /I$(ATK) /I$(GLIB) /I$(GLIB)\glib /I$(GLIB)\gmodule /I$(PANGO) $*.c

$(xdgmime_OBJECTS):
	$(CC) $(CFLAGS) /DXDG_PREFIX=_gtk_xdg /I$(GTK) /I$(GTK)\gdk /I$(GTK)\gtk /I$(ATK) /I$(GLIB) /I$(GLIB)\glib /I$(GLIB)\gmodule /I$(PANGO) $*.c

$(GTK)\gtk\gtkalias.h:
	$(CC) /EP /DG_OS_WIN32 /DGTK_WINDOWING_WIN32 /DINCLUDE_INTERNAL_SYMBOLS $(GTK)\gtk\gtk.symbols | $(PERL) $(GTK)\gtk\makegtkalias.pl > $@

$(GTK)\gtk\gtkmarshal.c:
	copy /y $(LIBICONV)\lib\iconv.dll .
	copy /y $(GETTEXT)\gettext-runtime\intl\intl.dll .
	copy /y $(GLIB)\glib\libglib-2.0-0.dll .
	$(GLIB)\gobject\glib-genmarshal.exe --prefix=gtk_marshal $(GTK)\gtk\gtkmarshal.list --body > $@
	del libglib-2.0-0.dll
	del intl.dll
	del iconv.dll

$(GTK)\gtk\gtkmarshal.h:
	echo #ifndef GTK_DISABLE_DEPRECATED > $@
	copy /y $(LIBICONV)\lib\iconv.dll .
	copy /y $(GETTEXT)\gettext-runtime\intl\intl.dll .
	copy /y $(GLIB)\glib\libglib-2.0-0.dll .
	$(GLIB)\gobject\glib-genmarshal.exe --prefix=gtk_marshal $(GTK)\gtk\gtkmarshal.list --header >> $@
	del libglib-2.0-0.dll
	del intl.dll
	del iconv.dll
	echo #endif /* GTK_DISABLE_DEPRECATED */ >> $@

$(GTK)\gtk\gtkmarshalers.c:
	copy /y $(LIBICONV)\lib\iconv.dll .
	copy /y $(GETTEXT)\gettext-runtime\intl\intl.dll .
	copy /y $(GLIB)\glib\libglib-2.0-0.dll .
	$(GLIB)\gobject\glib-genmarshal.exe --prefix=_gtk_marshal $(GTK)\gtk\gtkmarshalers.list --body > $@
	del libglib-2.0-0.dll
	del intl.dll
	del iconv.dll

$(GTK)\gtk\gtkmarshalers.h:
	copy /y $(LIBICONV)\lib\iconv.dll .
	copy /y $(GETTEXT)\gettext-runtime\intl\intl.dll .
	copy /y $(GLIB)\glib\libglib-2.0-0.dll .
	$(GLIB)\gobject\glib-genmarshal.exe --prefix=_gtk_marshal $(GTK)\gtk\gtkmarshalers.list --header > $@
	del libglib-2.0-0.dll
	del intl.dll
	del iconv.dll

gtk_headers= \
		$(GTK)\gtk\gtk.h \
		$(GTK)\gtk\gtkaboutdialog.h \
		$(GTK)\gtk\gtkaccelgroup.h \
		$(GTK)\gtk\gtkaccellabel.h \
		$(GTK)\gtk\gtkaccelmap.h \
		$(GTK)\gtk\gtkaccessible.h \
		$(GTK)\gtk\gtkaction.h \
		$(GTK)\gtk\gtkactiongroup.h \
		$(GTK)\gtk\gtkadjustment.h \
		$(GTK)\gtk\gtkalignment.h \
		$(GTK)\gtk\gtkarrow.h \
		$(GTK)\gtk\gtkaspectframe.h \
		$(GTK)\gtk\gtkbbox.h \
		$(GTK)\gtk\gtkbin.h \
		$(GTK)\gtk\gtkbindings.h \
		$(GTK)\gtk\gtkbox.h \
		$(GTK)\gtk\gtkbutton.h \
		$(GTK)\gtk\gtkcalendar.h \
		$(GTK)\gtk\gtkcelleditable.h \
		$(GTK)\gtk\gtkcelllayout.h \
		$(GTK)\gtk\gtkcellrenderer.h \
		$(GTK)\gtk\gtkcellrendererpixbuf.h \
		$(GTK)\gtk\gtkcellrenderertext.h \
		$(GTK)\gtk\gtkcellrenderertoggle.h \
		$(GTK)\gtk\gtkcellview.h \
		$(GTK)\gtk\gtkcheckbutton.h \
		$(GTK)\gtk\gtkcheckmenuitem.h \
		$(GTK)\gtk\gtkclipboard.h \
		$(GTK)\gtk\gtkclist.h \
		$(GTK)\gtk\gtkclipboard.h \
		$(GTK)\gtk\gtkcolorbutton.h \
		$(GTK)\gtk\gtkcolorsel.h \
		$(GTK)\gtk\gtkcolorseldialog.h \
		$(GTK)\gtk\gtkcombo.h \
		$(GTK)\gtk\gtkcombobox.h \
		$(GTK)\gtk\gtkcomboboxentry.h \
		$(GTK)\gtk\gtkcontainer.h \
		$(GTK)\gtk\gtkctree.h \
		$(GTK)\gtk\gtkcurve.h \
		$(GTK)\gtk\gtkdebug.h \
		$(GTK)\gtk\gtkdialog.h \
		$(GTK)\gtk\gtkdnd.h \
		$(GTK)\gtk\gtkdrawingarea.h \
		$(GTK)\gtk\gtkeditable.h \
		$(GTK)\gtk\gtkentry.h \
		$(GTK)\gtk\gtkentrycompletion.h \
		$(GTK)\gtk\gtkenums.h \
		$(GTK)\gtk\gtkeventbox.h \
		$(GTK)\gtk\gtkexpander.h \
		$(GTK)\gtk\gtkfilechooser.h \
		$(GTK)\gtk\gtkfilechooserdialog.h \
		$(GTK)\gtk\gtkfilechooserwidget.h \
		$(GTK)\gtk\gtkfilefilter.h \
		$(GTK)\gtk\gtkfilesel.h \
		$(GTK)\gtk\gtkfixed.h \
		$(GTK)\gtk\gtkfontbutton.h \
		$(GTK)\gtk\gtkfontsel.h \
		$(GTK)\gtk\gtkframe.h \
		$(GTK)\gtk\gtkgamma.h \
		$(GTK)\gtk\gtkgc.h \
		$(GTK)\gtk\gtkhandlebox.h \
		$(GTK)\gtk\gtkhbbox.h \
		$(GTK)\gtk\gtkhbox.h \
		$(GTK)\gtk\gtkhpaned.h \
		$(GTK)\gtk\gtkhruler.h \
		$(GTK)\gtk\gtkhscale.h \
		$(GTK)\gtk\gtkhscrollbar.h \
		$(GTK)\gtk\gtkhseparator.h \
		$(GTK)\gtk\gtkhsv.h \
		$(GTK)\gtk\gtkiconfactory.h \
		$(GTK)\gtk\gtkicontheme.h \
		$(GTK)\gtk\gtkiconview.h \
		$(GTK)\gtk\gtkimage.h \
		$(GTK)\gtk\gtkimagemenuitem.h \
		$(GTK)\gtk\gtkimcontext.h \
		$(GTK)\gtk\gtkimcontextsimple.h \
		$(GTK)\gtk\gtkimmodule.h \
		$(GTK)\gtk\gtkimmulticontext.h \
		$(GTK)\gtk\gtkinputdialog.h \
		$(GTK)\gtk\gtkinvisible.h \
		$(GTK)\gtk\gtkitem.h \
		$(GTK)\gtk\gtkitemfactory.h \
		$(GTK)\gtk\gtklabel.h \
		$(GTK)\gtk\gtklayout.h \
		$(GTK)\gtk\gtklist.h \
		$(GTK)\gtk\gtklistitem.h \
		$(GTK)\gtk\gtkliststore.h \
		$(GTK)\gtk\gtkmain.h \
		$(GTK)\gtk\gtkmarshal.h \
		$(GTK)\gtk\gtkmenu.h \
		$(GTK)\gtk\gtkmenubar.h \
		$(GTK)\gtk\gtkmenuitem.h \
		$(GTK)\gtk\gtkmenushell.h \
		$(GTK)\gtk\gtkmessagedialog.h \
		$(GTK)\gtk\gtkmisc.h \
		$(GTK)\gtk\gtkmodules.h \
		$(GTK)\gtk\gtknotebook.h \
		$(GTK)\gtk\gtkobject.h \
		$(GTK)\gtk\gtkoldeditable.h \
		$(GTK)\gtk\gtkoptionmenu.h \
		$(GTK)\gtk\gtkpaned.h \
		$(GTK)\gtk\gtkpixmap.h \
		$(GTK)\gtk\gtkplug.h \
		$(GTK)\gtk\gtkpreview.h \
		$(GTK)\gtk\gtkprivate.h \
		$(GTK)\gtk\gtkprogress.h \
		$(GTK)\gtk\gtkprogressbar.h \
		$(GTK)\gtk\gtkradioaction.h \
		$(GTK)\gtk\gtkradiobutton.h \
		$(GTK)\gtk\gtkradiomenuitem.h \
		$(GTK)\gtk\gtkradiotoolbutton.h \
		$(GTK)\gtk\gtkrange.h \
		$(GTK)\gtk\gtkrc.h \
		$(GTK)\gtk\gtkruler.h \
		$(GTK)\gtk\gtkscale.h \
		$(GTK)\gtk\gtkscrollbar.h \
		$(GTK)\gtk\gtkscrolledwindow.h \
		$(GTK)\gtk\gtkselection.h \
		$(GTK)\gtk\gtkseparator.h \
		$(GTK)\gtk\gtkseparatormenuitem.h \
		$(GTK)\gtk\gtkseparatortoolitem.h \
		$(GTK)\gtk\gtksettings.h \
		$(GTK)\gtk\gtksignal.h \
		$(GTK)\gtk\gtksizegroup.h \
		$(GTK)\gtk\gtksignal.h \
		$(GTK)\gtk\gtksocket.h \
		$(GTK)\gtk\gtkspinbutton.h \
		$(GTK)\gtk\gtkstatusbar.h \
		$(GTK)\gtk\gtkstock.h \
		$(GTK)\gtk\gtkstyle.h \
		$(GTK)\gtk\gtktable.h \
		$(GTK)\gtk\gtktearoffmenuitem.h \
		$(GTK)\gtk\gtktext.h \
		$(GTK)\gtk\gtktextbuffer.h \
		$(GTK)\gtk\gtktextchild.h \
		$(GTK)\gtk\gtktextdisplay.h \
		$(GTK)\gtk\gtktextiter.h \
		$(GTK)\gtk\gtktextlayout.h \
		$(GTK)\gtk\gtktextmark.h \
		$(GTK)\gtk\gtktexttag.h \
		$(GTK)\gtk\gtktexttagtable.h \
		$(GTK)\gtk\gtktextview.h \
		$(GTK)\gtk\gtktipsquery.h \
		$(GTK)\gtk\gtktoggleaction.h \
		$(GTK)\gtk\gtktogglebutton.h \
		$(GTK)\gtk\gtktoggletoolbutton.h \
		$(GTK)\gtk\gtktoolbar.h \
		$(GTK)\gtk\gtktoolbutton.h \
		$(GTK)\gtk\gtktoolitem.h \
		$(GTK)\gtk\gtktooltips.h \
		$(GTK)\gtk\gtktree.h \
		$(GTK)\gtk\gtktreednd.h \
		$(GTK)\gtk\gtktreeitem.h \
		$(GTK)\gtk\gtktreemodel.h \
		$(GTK)\gtk\gtktreemodelfilter.h \
		$(GTK)\gtk\gtktreemodelsort.h \
		$(GTK)\gtk\gtktreeselection.h \
		$(GTK)\gtk\gtktreesortable.h \
		$(GTK)\gtk\gtktreestore.h \
		$(GTK)\gtk\gtktreeview.h \
		$(GTK)\gtk\gtktreeviewcolumn.h \
		$(GTK)\gtk\gtktypeutils.h \
		$(GTK)\gtk\gtkuimanager.h \
		$(GTK)\gtk\gtkvbbox.h \
		$(GTK)\gtk\gtkvbox.h \
		$(GTK)\gtk\gtkviewport.h \
		$(GTK)\gtk\gtkvpaned.h \
		$(GTK)\gtk\gtkvruler.h \
		$(GTK)\gtk\gtkvscale.h \
		$(GTK)\gtk\gtkvscrollbar.h \
		$(GTK)\gtk\gtkvseparator.h \
		$(GTK)\gtk\gtkwidget.h \
		$(GTK)\gtk\gtkwindow.h

$(GTK)\gtk\gtktypebuiltins.c:
	$(PERL) $(GLIB)\gobject\glib-mkenums \
		--fhead "#define GTK_ENABLE_BROKEN\n#include \"gtk.h\"\n#include \"gtkprivate.h\"" \
		--fprod "\n/* enumerations from \"@filename@\" */" \
		--vhead "GType\n@enum_name@_get_type (void)\n{\n  static GType etype = 0;\n  if (etype == 0) {\n    static const G@Type@Value values[] = {" \
		--vprod "      { @VALUENAME@, \"@VALUENAME@\", \"@valuenick@\" }," \
		--vtail "      { 0, NULL, NULL }\n    };\n    etype = g_@type@_register_static (\"@EnumName@\", values);\n  }\n  return etype;\n}\n" \
		$(gtk_headers) > $@

$(GTK)\gtk\gtktypebuiltins.h:
	echo #ifndef __GTK_TYPE_BUILTINS_H__ > $@
	echo #define __GTK_TYPE_BUILTINS_H__ >> $@
	echo #include "glib-object.h" >> $@
	echo G_BEGIN_DECLS >> $@
	$(PERL) $(GLIB)\gobject\glib-mkenums \
		--fprod "/* enumerations from \"@filename@\" */\n" \
		--vhead "GType @enum_name@_get_type (void);\n#define GTK_TYPE_@ENUMSHORT@ (@enum_name@_get_type())\n" \
		--ftail "G_END_DECLS\n\n#endif /* __GTK_TYPE_BUILTINS_H__ */" \
		$(gtk_headers) >> $@

VARIABLES= \
		stock_about_16 $(GTK)\gtk\stock-icons\stock_about_16.png \
		stock_about_24 $(GTK)\gtk\stock-icons\stock_about_24.png \
		stock_add_16 $(GTK)\gtk\stock-icons\stock_add_16.png \
		stock_add_24 $(GTK)\gtk\stock-icons\stock_add_24.png \
		stock_align_center_16 $(GTK)\gtk\stock-icons\stock_align_center_16.png \
		stock_align_center_24 $(GTK)\gtk\stock-icons\stock_align_center_24.png \
		stock_align_justify_16 $(GTK)\gtk\stock-icons\stock_align_justify_16.png \
		stock_align_justify_24 $(GTK)\gtk\stock-icons\stock_align_justify_24.png \
		stock_align_left_16 $(GTK)\gtk\stock-icons\stock_align_left_16.png \
		stock_align_left_24 $(GTK)\gtk\stock-icons\stock_align_left_24.png \
		stock_align_right_16 $(GTK)\gtk\stock-icons\stock_align_right_16.png \
		stock_align_right_24 $(GTK)\gtk\stock-icons\stock_align_right_24.png \
		stock_apply_20 $(GTK)\gtk\stock-icons\stock_apply_20.png \
		stock_bottom_16 $(GTK)\gtk\stock-icons\stock_bottom_16.png \
		stock_bottom_24 $(GTK)\gtk\stock-icons\stock_bottom_24.png \
		stock_missing_image_16 $(GTK)\gtk\stock-icons\stock_broken_image_16.png \
		stock_missing_image_24 $(GTK)\gtk\stock-icons\stock_broken_image_24.png \
		stock_cancel_20 $(GTK)\gtk\stock-icons\stock_cancel_20.png \
		stock_cdrom_16 $(GTK)\gtk\stock-icons\stock_cdrom_16.png \
		stock_cdrom_24 $(GTK)\gtk\stock-icons\stock_cdrom_24.png \
		stock_clear_24 $(GTK)\gtk\stock-icons\stock_clear_24.png \
		stock_close_20 $(GTK)\gtk\stock-icons\stock_close_20.png \
		stock_close_24 $(GTK)\gtk\stock-icons\stock_close_24.png \
		stock_color_picker_25 $(GTK)\gtk\stock-icons\stock_color_picker_25.png \
		stock_colorselector_24 $(GTK)\gtk\stock-icons\stock_colorselector_24.png \
		stock_connect_16 $(GTK)\gtk\stock-icons\stock_connect_16.png \
		stock_connect_24 $(GTK)\gtk\stock-icons\stock_connect_24.png \
		stock_convert_16 $(GTK)\gtk\stock-icons\stock_convert_16.png \
		stock_convert_24 $(GTK)\gtk\stock-icons\stock_convert_24.png \
		stock_copy_16 $(GTK)\gtk\stock-icons\stock_copy_16.png \
		stock_copy_24 $(GTK)\gtk\stock-icons\stock_copy_24.png \
		stock_cut_16 $(GTK)\gtk\stock-icons\stock_cut_16.png \
		stock_cut_24 $(GTK)\gtk\stock-icons\stock_cut_24.png \
		stock_dialog_authentication_48 $(GTK)\gtk\stock-icons\stock_dialog_authentication_48.png \
		stock_dialog_error_48 $(GTK)\gtk\stock-icons\stock_dialog_error_48.png \
		stock_dialog_info_48 $(GTK)\gtk\stock-icons\stock_dialog_info_48.png \
		stock_dialog_question_48 $(GTK)\gtk\stock-icons\stock_dialog_question_48.png \
		stock_dialog_warning_48 $(GTK)\gtk\stock-icons\stock_dialog_warning_48.png \
		stock_directory_16 $(GTK)\gtk\stock-icons\stock_directory_16.png \
		stock_directory_24 $(GTK)\gtk\stock-icons\stock_directory_24.png \
		stock_disconnect_16 $(GTK)\gtk\stock-icons\stock_disconnect_16.png \
		stock_disconnect_24 $(GTK)\gtk\stock-icons\stock_disconnect_24.png \
		stock_dnd_32 $(GTK)\gtk\stock-icons\stock_dnd_32.png \
		stock_dnd_multiple_32 $(GTK)\gtk\stock-icons\stock_dnd_multiple_32.png \
		stock_down_arrow_16 $(GTK)\gtk\stock-icons\stock_down_arrow_16.png \
		stock_down_arrow_24 $(GTK)\gtk\stock-icons\stock_down_arrow_24.png \
		stock_edit_16 $(GTK)\gtk\stock-icons\stock_edit_16.png \
		stock_edit_24 $(GTK)\gtk\stock-icons\stock_edit_24.png \
		stock_exec_16 $(GTK)\gtk\stock-icons\stock_exec_16.png \
		stock_exec_24 $(GTK)\gtk\stock-icons\stock_exec_24.png \
		stock_exit_16 $(GTK)\gtk\stock-icons\stock_exit_16.png \
		stock_exit_24 $(GTK)\gtk\stock-icons\stock_exit_24.png \
		stock_file_16 $(GTK)\gtk\stock-icons\stock_file_16.png \
		stock_file_24 $(GTK)\gtk\stock-icons\stock_file_24.png \
		stock_first_16 $(GTK)\gtk\stock-icons\stock_first_16.png \
		stock_first_24 $(GTK)\gtk\stock-icons\stock_first_24.png \
		stock_font_16 $(GTK)\gtk\stock-icons\stock_font_16.png \
		stock_font_24 $(GTK)\gtk\stock-icons\stock_font_24.png \
		stock_harddisk_16 $(GTK)\gtk\stock-icons\stock_harddisk_16.png \
		stock_harddisk_24 $(GTK)\gtk\stock-icons\stock_harddisk_24.png \
		stock_help_16 $(GTK)\gtk\stock-icons\stock_help_16.png \
		stock_help_24 $(GTK)\gtk\stock-icons\stock_help_24.png \
		stock_home_16 $(GTK)\gtk\stock-icons\stock_home_16.png \
		stock_home_24 $(GTK)\gtk\stock-icons\stock_home_24.png \
		stock_index_24 $(GTK)\gtk\stock-icons\stock_index_24.png \
		stock_insert_image_16 $(GTK)\gtk\stock-icons\stock_insert_image_16.png \
		stock_insert_image_24 $(GTK)\gtk\stock-icons\stock_insert_image_24.png \
		stock_insert_object_16 $(GTK)\gtk\stock-icons\stock_insert_object_16.png \
		stock_insert_object_24 $(GTK)\gtk\stock-icons\stock_insert_object_24.png \
		stock_jump_to_16 $(GTK)\gtk\stock-icons\stock_jump_to_16.png \
		stock_jump_to_24 $(GTK)\gtk\stock-icons\stock_jump_to_24.png \
		stock_jump_to_rtl_16 $(GTK)\gtk\stock-icons\stock_jump_to_rtl_16.png \
		stock_jump_to_rtl_24 $(GTK)\gtk\stock-icons\stock_jump_to_rtl_24.png \
		stock_last_16 $(GTK)\gtk\stock-icons\stock_last_16.png \
		stock_last_24 $(GTK)\gtk\stock-icons\stock_last_24.png \
		stock_left_arrow_16 $(GTK)\gtk\stock-icons\stock_left_arrow_16.png \
		stock_left_arrow_24 $(GTK)\gtk\stock-icons\stock_left_arrow_24.png \
		stock_media_forward_16 $(GTK)\gtk\stock-icons\stock_media_forward_16.png \
		stock_media_forward_24 $(GTK)\gtk\stock-icons\stock_media_forward_24.png \
		stock_media_next_16 $(GTK)\gtk\stock-icons\stock_media_next_16.png \
		stock_media_next_24 $(GTK)\gtk\stock-icons\stock_media_next_24.png \
		stock_media_pause_16 $(GTK)\gtk\stock-icons\stock_media_pause_16.png \
		stock_media_pause_24 $(GTK)\gtk\stock-icons\stock_media_pause_24.png \
		stock_media_play_16 $(GTK)\gtk\stock-icons\stock_media_play_16.png \
		stock_media_play_24 $(GTK)\gtk\stock-icons\stock_media_play_24.png \
		stock_media_play_rtl_16 $(GTK)\gtk\stock-icons\stock_media_play_rtl_16.png \
		stock_media_play_rtl_24 $(GTK)\gtk\stock-icons\stock_media_play_rtl_24.png \
		stock_media_previous_16 $(GTK)\gtk\stock-icons\stock_media_previous_16.png \
		stock_media_previous_24 $(GTK)\gtk\stock-icons\stock_media_previous_24.png \
		stock_media_record_16 $(GTK)\gtk\stock-icons\stock_media_record_16.png \
		stock_media_record_24 $(GTK)\gtk\stock-icons\stock_media_record_24.png \
		stock_media_rewind_16 $(GTK)\gtk\stock-icons\stock_media_rewind_16.png \
		stock_media_rewind_24 $(GTK)\gtk\stock-icons\stock_media_rewind_24.png \
		stock_media_stop_16 $(GTK)\gtk\stock-icons\stock_media_stop_16.png \
		stock_media_stop_24 $(GTK)\gtk\stock-icons\stock_media_stop_24.png \
		stock_network_16 $(GTK)\gtk\stock-icons\stock_network_16.png \
		stock_network_24 $(GTK)\gtk\stock-icons\stock_network_24.png \
		stock_new_16 $(GTK)\gtk\stock-icons\stock_new_16.png \
		stock_new_24 $(GTK)\gtk\stock-icons\stock_new_24.png \
		stock_no_20 $(GTK)\gtk\stock-icons\stock_no_20.png \
		stock_ok_20 $(GTK)\gtk\stock-icons\stock_ok_20.png \
		stock_open_16 $(GTK)\gtk\stock-icons\stock_open_16.png \
		stock_open_24 $(GTK)\gtk\stock-icons\stock_open_24.png \
		stock_paste_16 $(GTK)\gtk\stock-icons\stock_paste_16.png \
		stock_paste_24 $(GTK)\gtk\stock-icons\stock_paste_24.png \
		stock_preferences_16 $(GTK)\gtk\stock-icons\stock_preferences_16.png \
		stock_preferences_24 $(GTK)\gtk\stock-icons\stock_preferences_24.png \
		stock_print_16 $(GTK)\gtk\stock-icons\stock_print_16.png \
		stock_print_24 $(GTK)\gtk\stock-icons\stock_print_24.png \
		stock_print_preview_16 $(GTK)\gtk\stock-icons\stock_print_preview_16.png \
		stock_print_preview_24 $(GTK)\gtk\stock-icons\stock_print_preview_24.png \
		stock_properties_16 $(GTK)\gtk\stock-icons\stock_properties_16.png \
		stock_properties_24 $(GTK)\gtk\stock-icons\stock_properties_24.png \
		stock_redo_16 $(GTK)\gtk\stock-icons\stock_redo_16.png \
		stock_redo_24 $(GTK)\gtk\stock-icons\stock_redo_24.png \
		stock_redo_rtl_16 $(GTK)\gtk\stock-icons\stock_redo_rtl_16.png \
		stock_redo_rtl_24 $(GTK)\gtk\stock-icons\stock_redo_rtl_24.png \
		stock_refresh_16 $(GTK)\gtk\stock-icons\stock_refresh_16.png \
		stock_refresh_24 $(GTK)\gtk\stock-icons\stock_refresh_24.png \
		stock_remove_16 $(GTK)\gtk\stock-icons\stock_remove_16.png \
		stock_remove_24 $(GTK)\gtk\stock-icons\stock_remove_24.png \
		stock_revert_16 $(GTK)\gtk\stock-icons\stock_revert_16.png \
		stock_revert_24 $(GTK)\gtk\stock-icons\stock_revert_24.png \
		stock_revert_rtl_16 $(GTK)\gtk\stock-icons\stock_revert_rtl_16.png \
		stock_revert_rtl_24 $(GTK)\gtk\stock-icons\stock_revert_rtl_24.png \
		stock_right_arrow_16 $(GTK)\gtk\stock-icons\stock_right_arrow_16.png \
		stock_right_arrow_24 $(GTK)\gtk\stock-icons\stock_right_arrow_24.png \
		stock_save_16 $(GTK)\gtk\stock-icons\stock_save_16.png \
		stock_save_24 $(GTK)\gtk\stock-icons\stock_save_24.png \
		stock_save_as_16 $(GTK)\gtk\stock-icons\stock_save_as_16.png \
		stock_save_as_24 $(GTK)\gtk\stock-icons\stock_save_as_24.png \
		stock_search_16 $(GTK)\gtk\stock-icons\stock_search_16.png \
		stock_search_24 $(GTK)\gtk\stock-icons\stock_search_24.png \
		stock_search_replace_16 $(GTK)\gtk\stock-icons\stock_search_replace_16.png \
		stock_search_replace_24 $(GTK)\gtk\stock-icons\stock_search_replace_24.png \
		stock_sort_ascending_16 $(GTK)\gtk\stock-icons\stock_sort_ascending_16.png \
		stock_sort_ascending_24 $(GTK)\gtk\stock-icons\stock_sort_ascending_24.png \
		stock_sort_descending_16 $(GTK)\gtk\stock-icons\stock_sort_descending_16.png \
		stock_sort_descending_24 $(GTK)\gtk\stock-icons\stock_sort_descending_24.png \
		stock_spellcheck_16 $(GTK)\gtk\stock-icons\stock_spellcheck_16.png \
		stock_spellcheck_24 $(GTK)\gtk\stock-icons\stock_spellcheck_24.png \
		stock_stop_16 $(GTK)\gtk\stock-icons\stock_stop_16.png \
		stock_stop_24 $(GTK)\gtk\stock-icons\stock_stop_24.png \
		stock_text_bold_16 $(GTK)\gtk\stock-icons\stock_text_bold_16.png \
		stock_text_bold_24 $(GTK)\gtk\stock-icons\stock_text_bold_24.png \
		stock_text_indent_16 $(GTK)\gtk\stock-icons\stock_text_indent_16.png \
		stock_text_indent_24 $(GTK)\gtk\stock-icons\stock_text_indent_24.png \
		stock_text_italic_16 $(GTK)\gtk\stock-icons\stock_text_italic_16.png \
		stock_text_italic_24 $(GTK)\gtk\stock-icons\stock_text_italic_24.png \
		stock_text_strikethrough_16 $(GTK)\gtk\stock-icons\stock_text_strikethrough_16.png \
		stock_text_strikethrough_24 $(GTK)\gtk\stock-icons\stock_text_strikethrough_24.png \
		stock_text_underline_16 $(GTK)\gtk\stock-icons\stock_text_underline_16.png \
		stock_text_underline_24 $(GTK)\gtk\stock-icons\stock_text_underline_24.png \
		stock_text_unindent_16 $(GTK)\gtk\stock-icons\stock_text_unindent_16.png \
		stock_text_unindent_24 $(GTK)\gtk\stock-icons\stock_text_unindent_24.png \
		stock_top_16 $(GTK)\gtk\stock-icons\stock_top_16.png \
		stock_top_24 $(GTK)\gtk\stock-icons\stock_top_24.png \
		stock_trash_16 $(GTK)\gtk\stock-icons\stock_trash_16.png \
		stock_trash_24 $(GTK)\gtk\stock-icons\stock_trash_24.png \
		stock_undelete_16 $(GTK)\gtk\stock-icons\stock_undelete_16.png \
		stock_undelete_24 $(GTK)\gtk\stock-icons\stock_undelete_24.png \
		stock_undelete_rtl_16 $(GTK)\gtk\stock-icons\stock_undelete_rtl_16.png \
		stock_undelete_rtl_24 $(GTK)\gtk\stock-icons\stock_undelete_rtl_24.png \
		stock_undo_16 $(GTK)\gtk\stock-icons\stock_undo_16.png \
		stock_undo_24 $(GTK)\gtk\stock-icons\stock_undo_24.png \
		stock_undo_rtl_16 $(GTK)\gtk\stock-icons\stock_undo_rtl_16.png \
		stock_undo_rtl_24 $(GTK)\gtk\stock-icons\stock_undo_rtl_24.png \
		stock_up_arrow_16 $(GTK)\gtk\stock-icons\stock_up_arrow_16.png \
		stock_up_arrow_24 $(GTK)\gtk\stock-icons\stock_up_arrow_24.png \
		stock_wizard_24 $(GTK)\gtk\stock-icons\stock_wizard_24.png \
		stock_yes_20 $(GTK)\gtk\stock-icons\stock_yes_20.png \
		stock_zoom_1_24 $(GTK)\gtk\stock-icons\stock_zoom_1_24.png \
		stock_zoom_fit_24 $(GTK)\gtk\stock-icons\stock_zoom_fit_24.png \
		stock_zoom_in_24 $(GTK)\gtk\stock-icons\stock_zoom_in_24.png \
		stock_zoom_out_24 $(GTK)\gtk\stock-icons\stock_zoom_out_24.png

$(GTK)\gtk\stock-icons\gtkstockpixbufs.h:
	copy /y $(LIBICONV)\lib\iconv.dll .
	copy /y $(GETTEXT)\gettext-runtime\intl\intl.dll .
	copy /y $(GLIB)\glib\libglib-2.0-0.dll .
	copy /y $(GLIB)\gobject\libgobject-2.0-0.dll .
	copy /y $(LIBPNG)\libpng13.dll .
	$(GTK)\gdk-pixbuf\gdk-pixbuf-csource.exe --rle --build-list $(VARIABLES) > $@
	del libpng13.dll
	del libgobject-2.0-0.dll
	del libglib-2.0-0.dll
	del intl.dll
	del iconv.dll

# inputim-am-et.dll
$(GTK)\modules\input\inputim-am-et.dll: $(GTK)\modules\input\imam-et.obj
	$(LINK) $(LFLAGS) /DLL /EXPORT:im_module_create,@5 /EXPORT:im_module_exit,@1 /EXPORT:im_module_init,@2 /EXPORT:im_module_list,@3 $(GLIB)\gobject\gobject-2.0.lib $(GTK)\gtk\gtk-win32-2.0.lib $**

$(GTK)\modules\input\imam-et.obj:
	$(CC) $(CFLAGS) /DG_DISABLE_DEPRECATED /DGDK_PIXBUF_DISABLE_DEPRECATED /DGDK_DISABLE_DEPRECATED /DGTK_DISABLE_DEPRECATED /DGTK_LOCALEDIR=\"\" /I$(GTK) /I$(GTK)\gdk /I$(GLIB) /I$(GLIB)\glib /I$(GLIB)\gmodule /I$(PANGO) $*.c

# inputim-cedilla.dll
$(GTK)\modules\input\inputim-cedilla.dll: $(GTK)\modules\input\imcedilla.obj
	$(LINK) $(LFLAGS) /DLL /EXPORT:im_module_create,@5 /EXPORT:im_module_exit,@1 /EXPORT:im_module_init,@2 /EXPORT:im_module_list,@3 $(GLIB)\gobject\gobject-2.0.lib $(GTK)\gtk\gtk-win32-2.0.lib $**

$(GTK)\modules\input\imcedilla.obj:
	$(CC) $(CFLAGS) /DG_DISABLE_DEPRECATED /DGDK_PIXBUF_DISABLE_DEPRECATED /DGDK_DISABLE_DEPRECATED /DGTK_DISABLE_DEPRECATED /DGTK_LOCALEDIR=\"\" /I$(GTK) /I$(GTK)\gdk /I$(GLIB) /I$(GLIB)\glib /I$(GLIB)\gmodule /I$(PANGO) $*.c

# inputim-cyrillic-translit.dll
$(GTK)\modules\input\inputim-cyrillic-translit.dll: $(GTK)\modules\input\imcyrillic-translit.obj
	$(LINK) $(LFLAGS) /DLL /EXPORT:im_module_create,@5 /EXPORT:im_module_exit,@1 /EXPORT:im_module_init,@2 /EXPORT:im_module_list,@3 $(GLIB)\gobject\gobject-2.0.lib $(GTK)\gtk\gtk-win32-2.0.lib $**

$(GTK)\modules\input\imcyrillic-translit.obj:
	$(CC) $(CFLAGS) /DG_DISABLE_DEPRECATED /DGDK_PIXBUF_DISABLE_DEPRECATED /DGDK_DISABLE_DEPRECATED /DGTK_DISABLE_DEPRECATED /DGTK_LOCALEDIR=\"\" /I$(GTK) /I$(GTK)\gdk /I$(GLIB) /I$(GLIB)\glib /I$(GLIB)\gmodule /I$(PANGO) $*.c

# inputim-ime.dll
imime_OBJECTS= \
		$(GTK)\modules\input\gtkimcontextime.obj \
		$(GTK)\modules\input\imime.obj

$(GTK)\modules\input\inputim-ime.dll: $(imime_OBJECTS)
	$(LINK) $(LFLAGS) /DLL /EXPORT:im_module_create,@5 /EXPORT:im_module_exit,@1 /EXPORT:im_module_init,@2 /EXPORT:im_module_list,@3 imm32.lib user32.lib $(GLIB)\glib\glib-2.0.lib $(GLIB)\gobject\gobject-2.0.lib $(GTK)\gdk\gdk-win32-2.0.lib $(GTK)\gtk\gtk-win32-2.0.lib $(PANGO)\pango\pango-1.0.lib $(PANGO)\pango\pangowin32-1.0.lib $**

$(imime_OBJECTS): $(GTK)\gdk\gdkwin32.h
	$(CC) $(CFLAGS) /I$(ATK) /I$(GLIB) /I$(GLIB)\glib /I$(GLIB)\gmodule /I$(GTK) /I$(GTK)\gdk /I$(PANGO) $*.c

$(GTK)\gdk\gdkwin32.h: $(GTK)\gdk\win32\gdkwin32.h
	copy /y $** $@

# inputim-inuktitut.dll
$(GTK)\modules\input\inputim-inuktitut.dll: $(GTK)\modules\input\iminuktitut.obj
	$(LINK) $(LFLAGS) /DLL /EXPORT:im_module_create,@5 /EXPORT:im_module_exit,@1 /EXPORT:im_module_init,@2 /EXPORT:im_module_list,@3 $(GLIB)\gobject\gobject-2.0.lib $(GTK)\gtk\gtk-win32-2.0.lib $**

$(GTK)\modules\input\iminuktitut.obj:
	$(CC) $(CFLAGS) /DG_DISABLE_DEPRECATED /DGDK_PIXBUF_DISABLE_DEPRECATED /DGDK_DISABLE_DEPRECATED /DGTK_DISABLE_DEPRECATED /DGTK_LOCALEDIR=\"\" /I$(GTK) /I$(GTK)\gdk /I$(GLIB) /I$(GLIB)\glib /I$(GLIB)\gmodule /I$(PANGO) $*.c

# inputim-ipa.dll
$(GTK)\modules\input\inputim-ipa.dll: $(GTK)\modules\input\imipa.obj
	$(LINK) $(LFLAGS) /DLL /EXPORT:im_module_create,@5 /EXPORT:im_module_exit,@1 /EXPORT:im_module_init,@2 /EXPORT:im_module_list,@3 $(GLIB)\gobject\gobject-2.0.lib $(GTK)\gtk\gtk-win32-2.0.lib $**

$(GTK)\modules\input\imipa.obj:
	$(CC) $(CFLAGS) /DG_DISABLE_DEPRECATED /DGDK_PIXBUF_DISABLE_DEPRECATED /DGDK_DISABLE_DEPRECATED /DGTK_DISABLE_DEPRECATED /DGTK_LOCALEDIR=\"\" /I$(GTK) /I$(GTK)\gdk /I$(GLIB) /I$(GLIB)\glib /I$(GLIB)\gmodule /I$(PANGO) $*.c

# inputim-thai-broken.dll
$(GTK)\modules\input\inputim-thai-broken.dll: $(GTK)\modules\input\imthai-broken.obj
	$(LINK) $(LFLAGS) /DLL /EXPORT:im_module_create,@5 /EXPORT:im_module_exit,@1 /EXPORT:im_module_init,@2 /EXPORT:im_module_list,@3 $(GLIB)\gobject\gobject-2.0.lib $(GTK)\gtk\gtk-win32-2.0.lib $**

$(GTK)\modules\input\imthai-broken.obj:
	$(CC) $(CFLAGS) /DG_DISABLE_DEPRECATED /DGDK_PIXBUF_DISABLE_DEPRECATED /DGDK_DISABLE_DEPRECATED /DGTK_DISABLE_DEPRECATED /DGTK_LOCALEDIR=\"\" /I$(GTK) /I$(GTK)\gdk /I$(GLIB) /I$(GLIB)\glib /I$(GLIB)\gmodule /I$(PANGO) $*.c

# inputim-ti-er.dll
$(GTK)\modules\input\inputim-ti-er.dll: $(GTK)\modules\input\imti-er.obj
	$(LINK) $(LFLAGS) /DLL /EXPORT:im_module_create,@5 /EXPORT:im_module_exit,@1 /EXPORT:im_module_init,@2 /EXPORT:im_module_list,@3 $(GLIB)\gobject\gobject-2.0.lib $(GTK)\gtk\gtk-win32-2.0.lib $**

$(GTK)\modules\input\imti-er.obj:
	$(CC) $(CFLAGS) /DG_DISABLE_DEPRECATED /DGDK_PIXBUF_DISABLE_DEPRECATED /DGDK_DISABLE_DEPRECATED /DGTK_DISABLE_DEPRECATED /DGTK_LOCALEDIR=\"\" /I$(GTK) /I$(GTK)\gdk /I$(GLIB) /I$(GLIB)\glib /I$(GLIB)\gmodule /I$(PANGO) $*.c

# inputim-ti-et.dll
$(GTK)\modules\input\inputim-ti-et.dll: $(GTK)\modules\input\imti-et.obj
	$(LINK) $(LFLAGS) /DLL /EXPORT:im_module_create,@5 /EXPORT:im_module_exit,@1 /EXPORT:im_module_init,@2 /EXPORT:im_module_list,@3 $(GLIB)\gobject\gobject-2.0.lib $(GTK)\gtk\gtk-win32-2.0.lib $**

$(GTK)\modules\input\imti-et.obj:
	$(CC) $(CFLAGS) /DG_DISABLE_DEPRECATED /DGDK_PIXBUF_DISABLE_DEPRECATED /DGDK_DISABLE_DEPRECATED /DGTK_DISABLE_DEPRECATED /DGTK_LOCALEDIR=\"\" /I$(GTK) /I$(GTK)\gdk /I$(GLIB) /I$(GLIB)\glib /I$(GLIB)\gmodule /I$(PANGO) $*.c

# inputim-viqr.dll
$(GTK)\modules\input\inputim-viqr.dll: $(GTK)\modules\input\imviqr.obj
	$(LINK) $(LFLAGS) /DLL /EXPORT:im_module_create,@5 /EXPORT:im_module_exit,@1 /EXPORT:im_module_init,@2 /EXPORT:im_module_list,@3 $(GLIB)\gobject\gobject-2.0.lib $(GTK)\gtk\gtk-win32-2.0.lib $**

$(GTK)\modules\input\imviqr.obj:
	$(CC) $(CFLAGS) /DG_DISABLE_DEPRECATED /DGDK_PIXBUF_DISABLE_DEPRECATED /DGDK_DISABLE_DEPRECATED /DGTK_DISABLE_DEPRECATED /DGTK_LOCALEDIR=\"\" /I$(GTK) /I$(GTK)\gdk /I$(GLIB) /I$(GLIB)\glib /I$(GLIB)\gmodule /I$(PANGO) $*.c

# gtk-query-immodules-2.0.exe
$(GTK)\gtk\gtk-query-immodules-2.0.exe: $(GTK)\gtk\queryimmodules.obj
	$(LINK) $(LFLAGS) $(GLIB)\glib\glib-2.0.lib $(GLIB)\gmodule\gmodule-2.0.lib $(GTK)\gtk\gtk-win32-2.0.lib $(PANGO)\pango\pango-1.0.lib $**

$(GTK)\gtk\queryimmodules.obj:
	$(CC) $(CFLAGS) /DG_LOG_DOMAIN=\"Gtk\" /DGTK_BINARY_VERSION=\"$(GTK_VERSION)\" /DGTK_DISABLE_COMPAT_H /DGTK_FILE_SYSTEM_ENABLE_UNSUPPORTED /DGTK_HOST=\"win32\" /DGTK_VERSION=\"2.0\" /Dnear=xxnear /DPANGO_ENABLE_BACKEND /FImsvc_recommended_pragmas.h /I$(GTK) /I$(GTK)\gdk /I$(ATK) /I$(GLIB) /I$(GLIB)\glib /I$(GLIB)\gmodule /I$(PANGO) $*.c

###############################################################################
# libiconv                                                                    #
###############################################################################
libiconv: $(LIBICONV)\lib\iconv.dll

$(LIBICONV)\lib\iconv.dll: $(LIBICONV)\libcharset\lib\localcharset.obj $(LIBICONV)\libcharset\lib\relocatable.obj $(LIBICONV)\lib\iconv.obj $(LIBICONV)\lib\relocatable.obj $(LIBICONV)\windows\iconv.res
	$(LINK) $(LFLAGS) /DLL kernel32.lib $**

$(LIBICONV)\libcharset\lib\localcharset.obj: $(LIBICONV)\libcharset\include\localcharset.h $(LIBICONV)\libcharset\config.h
	$(CC) $(CFLAGS) /DBUILDING_LIBCHARSET /DHAVE_CONFIG_H /I$(LIBICONV)\libcharset /I$(LIBICONV)\libcharset\include $*.c

$(LIBICONV)\libcharset\lib\relocatable.obj: $(LIBICONV)\libcharset\config.h
	$(CC) $(CFLAGS) /DBUILDING_LIBCHARSET /DHAVE_CONFIG_H /I$(LIBICONV)\libcharset $*.c

$(LIBICONV)\lib\iconv.obj: $(LIBICONV)\include\iconv.h $(LIBICONV)\lib\config.h $(LIBICONV)\libcharset\include\localcharset.h
	$(CC) $(CFLAGS) /DBUILDING_DLL /DBUILDING_LIBICONV /DENABLE_RELOCATABLE=1 /DHAVE_CONFIG_H /DIN_LIBRARY /DINSTALLDIR=\".\" /DNO_XMALLOC /Drelocate=libiconv_relocate /Dset_relocation_prefix=libiconv_set_relocation_prefix /I$(LIBICONV)\include /I$(LIBICONV)\libcharset\include $*.c

$(LIBICONV)\lib\relocatable.obj: $(LIBICONV)\lib\config.h
	$(CC) $(CFLAGS) /DBUILDING_DLL /DBUILDING_LIBICONV /DENABLE_RELOCATABLE=1 /DHAVE_CONFIG_H /DIN_LIBRARY /DINSTALLDIR=\".\" /DNO_XMALLOC /Drelocate=libiconv_relocate /Dset_relocation_prefix=libiconv_set_relocation_prefix /I$(LIBICONV)\include /I$(LIBICONV)\libcharset\include $*.c

$(LIBICONV)\include\iconv.h: $@.msvc-shared
	copy /y $** $@

$(LIBICONV)\libcharset\include\localcharset.h: $@.msvc-shared
	copy /y $** $@

$(LIBICONV)\libcharset\config.h: $@.msvc
	copy /y $** $@

$(LIBICONV)\lib\config.h: $@.msvc
	copy /y $** $@

$(LIBICONV)\windows\iconv.res: $*.rc

###############################################################################
# libpng                                                                      #
###############################################################################
libpng: zlib $(LIBPNG)\libpng13.dll

libpng_OBJECTS= \
		$(LIBPNG)\png.obj \
		$(LIBPNG)\pngerror.obj \
		$(LIBPNG)\pngget.obj \
		$(LIBPNG)\pngmem.obj \
		$(LIBPNG)\pngpread.obj \
		$(LIBPNG)\pngread.obj \
		$(LIBPNG)\pngrio.obj \
		$(LIBPNG)\pngrtran.obj \
		$(LIBPNG)\pngrutil.obj \
		$(LIBPNG)\pngset.obj \
		$(LIBPNG)\pngtrans.obj \
		$(LIBPNG)\pngvcrd.obj \
		$(LIBPNG)\pngwio.obj \
		$(LIBPNG)\pngwrite.obj \
		$(LIBPNG)\pngwtran.obj \
		$(LIBPNG)\pngwutil.obj \

$(LIBPNG)\libpng13.dll: $(libpng_OBJECTS) $(LIBPNG)\scripts\pngw32.res
	$(LINK) $(LFLAGS) /DLL /DEF:$(LIBPNG)\scripts\pngw32.def $(ZLIB)\zdll.lib $**

$(libpng_OBJECTS):
	$(CC) $(CFLAGS) /D_USRDLL /DPNG_BUILD_DLL /I$(LIBPNG) /I$(ZLIB) $*.c

$(LIBPNG)\scripts\pngw32.res:
	$(RC) $(RFLAGS) /i$(LIBPNG) $*.rc

###############################################################################
# JPEG                                                                        #
###############################################################################
jpeg: $(JPEG)\jpeg62.dll

jpeg_OBJECTS= \
		$(JPEG)\jcomapi.obj \
		$(JPEG)\jutils.obj \
		$(JPEG)\jerror.obj \
		$(JPEG)\jmemmgr.obj \
		$(JPEG)\jmemnobs.obj \
		$(JPEG)\jcapimin.obj \
		$(JPEG)\jcapistd.obj \
		$(JPEG)\jctrans.obj \
		$(JPEG)\jcparam.obj \
		$(JPEG)\jdatadst.obj \
		$(JPEG)\jcinit.obj \
		$(JPEG)\jcmaster.obj \
		$(JPEG)\jcmarker.obj \
		$(JPEG)\jcmainct.obj \
		$(JPEG)\jcprepct.obj \
		$(JPEG)\jccoefct.obj \
		$(JPEG)\jccolor.obj \
		$(JPEG)\jcsample.obj \
		$(JPEG)\jchuff.obj \
		$(JPEG)\jcphuff.obj \
		$(JPEG)\jcdctmgr.obj \
		$(JPEG)\jfdctfst.obj \
		$(JPEG)\jfdctflt.obj \
		$(JPEG)\jfdctint.obj \
		$(JPEG)\jdapimin.obj \
		$(JPEG)\jdapistd.obj \
		$(JPEG)\jdtrans.obj \
		$(JPEG)\jdatasrc.obj \
		$(JPEG)\jdmaster.obj \
		$(JPEG)\jdinput.obj \
		$(JPEG)\jdmarker.obj \
		$(JPEG)\jdhuff.obj \
		$(JPEG)\jdphuff.obj \
		$(JPEG)\jdmainct.obj \
		$(JPEG)\jdcoefct.obj \
		$(JPEG)\jdpostct.obj \
		$(JPEG)\jddctmgr.obj \
		$(JPEG)\jidctfst.obj \
		$(JPEG)\jidctflt.obj \
		$(JPEG)\jidctint.obj \
		$(JPEG)\jidctred.obj \
		$(JPEG)\jdsample.obj \
		$(JPEG)\jdcolor.obj \
		$(JPEG)\jquant1.obj \
		$(JPEG)\jquant2.obj \
		$(JPEG)\jdmerge.obj

$(JPEG)\jpeg62.dll: $(jpeg_OBJECTS)
	$(LINK) $(LFLAGS) \
	/EXPORT:jzero_far,@1 \
	/EXPORT:jcopy_sample_rows,@2 \
	/EXPORT:jdiv_round_up,@3 \
	/EXPORT:jinit_1pass_quantizer,@4 \
	/EXPORT:jinit_2pass_quantizer,@5 \
	/EXPORT:jinit_c_coef_controller,@6 \
	/EXPORT:jinit_c_main_controller,@7 \
	/EXPORT:jinit_c_master_control,@8 \
	/EXPORT:jinit_c_prep_controller,@9 \
	/EXPORT:jinit_color_converter,@10 \
	/EXPORT:jinit_color_deconverter,@11 \
	/EXPORT:jinit_compress_master,@12 \
	/EXPORT:jinit_d_coef_controller,@13 \
	/EXPORT:jinit_d_main_controller,@14 \
	/EXPORT:jinit_d_post_controller,@15 \
	/EXPORT:jinit_downsampler,@16 \
	/EXPORT:jinit_forward_dct,@17 \
	/EXPORT:jinit_huff_decoder,@18 \
	/EXPORT:jinit_huff_encoder,@19 \
	/EXPORT:jinit_input_controller,@20 \
	/EXPORT:jinit_inverse_dct,@21 \
	/EXPORT:jinit_marker_reader,@22 \
	/EXPORT:jinit_marker_writer,@23 \
	/EXPORT:jinit_master_decompress,@24 \
	/EXPORT:jinit_memory_mgr,@25 \
	/EXPORT:jinit_merged_upsampler,@26 \
	/EXPORT:jinit_phuff_decoder,@27 \
	/EXPORT:jinit_phuff_encoder,@28 \
	/EXPORT:jinit_upsampler,@29 \
	/EXPORT:jpeg_CreateCompress,@30 \
	/EXPORT:jpeg_CreateDecompress,@31 \
	/EXPORT:jpeg_abort,@32 \
	/EXPORT:jpeg_abort_compress,@33 \
	/EXPORT:jpeg_abort_decompress,@34 \
	/EXPORT:jpeg_add_quant_table,@35 \
	/EXPORT:jpeg_alloc_huff_table,@36 \
	/EXPORT:jpeg_alloc_quant_table,@37 \
	/EXPORT:jpeg_calc_output_dimensions,@38 \
	/EXPORT:jpeg_consume_input,@39 \
	/EXPORT:jpeg_copy_critical_parameters,@40 \
	/EXPORT:jpeg_default_colorspace,@41 \
	/EXPORT:jpeg_destroy,@42 \
	/EXPORT:jpeg_destroy_compress,@43 \
	/EXPORT:jpeg_destroy_decompress,@44 \
	/EXPORT:jpeg_fdct_float,@45 \
	/EXPORT:jpeg_fdct_ifast,@46 \
	/EXPORT:jpeg_fdct_islow,@47 \
	/EXPORT:jpeg_fill_bit_buffer,@48 \
	/EXPORT:jpeg_finish_compress,@49 \
	/EXPORT:jpeg_finish_decompress,@50 \
	/EXPORT:jpeg_finish_output,@51 \
	/EXPORT:jpeg_free_large,@52 \
	/EXPORT:jpeg_free_small,@53 \
	/EXPORT:jpeg_gen_optimal_table,@54 \
	/EXPORT:jpeg_get_large,@55 \
	/EXPORT:jpeg_get_small,@56 \
	/EXPORT:jpeg_has_multiple_scans,@57 \
	/EXPORT:jpeg_huff_decode,@58 \
	/EXPORT:jpeg_idct_1x1,@59 \
	/EXPORT:jpeg_idct_2x2,@60 \
	/EXPORT:jpeg_idct_4x4,@61 \
	/EXPORT:jpeg_idct_float,@62 \
	/EXPORT:jpeg_idct_ifast,@63 \
	/EXPORT:jpeg_idct_islow,@64 \
	/EXPORT:jpeg_input_complete,@65 \
	/EXPORT:jpeg_make_c_derived_tbl,@66 \
	/EXPORT:jpeg_make_d_derived_tbl,@67 \
	/EXPORT:jpeg_mem_available,@68 \
	/EXPORT:jpeg_mem_init,@69 \
	/EXPORT:jpeg_mem_term,@70 \
	/EXPORT:jpeg_natural_order,@71 \
	/EXPORT:jpeg_new_colormap,@72 \
	/EXPORT:jpeg_open_backing_store,@73 \
	/EXPORT:jpeg_quality_scaling,@74 \
	/EXPORT:jpeg_read_coefficients,@75 \
	/EXPORT:jpeg_read_header,@76 \
	/EXPORT:jpeg_read_raw_data,@77 \
	/EXPORT:jpeg_read_scanlines,@78 \
	/EXPORT:jpeg_resync_to_restart,@79 \
	/EXPORT:jpeg_save_markers,@80 \
	/EXPORT:jpeg_set_colorspace,@81 \
	/EXPORT:jpeg_set_defaults,@82 \
	/EXPORT:jpeg_set_linear_quality,@83 \
	/EXPORT:jpeg_set_marker_processor,@84 \
	/EXPORT:jpeg_set_quality,@85 \
	/EXPORT:jpeg_simple_progression,@86 \
	/EXPORT:jpeg_start_compress,@87 \
	/EXPORT:jpeg_start_decompress,@88 \
	/EXPORT:jpeg_start_output,@89 \
	/EXPORT:jpeg_std_error,@90 \
	/EXPORT:jpeg_std_message_table,@91 \
	/EXPORT:jpeg_stdio_dest,@92 \
	/EXPORT:jpeg_stdio_src,@93 \
	/EXPORT:jpeg_suppress_tables,@94 \
	/EXPORT:jpeg_write_coefficients,@95 \
	/EXPORT:jpeg_write_m_byte,@96 \
	/EXPORT:jpeg_write_m_header,@97 \
	/EXPORT:jpeg_write_marker,@98 \
	/EXPORT:jpeg_write_raw_data,@99 \
	/EXPORT:jpeg_write_scanlines,@100 \
	/EXPORT:jpeg_write_tables,@101 \
	/EXPORT:jround_up,@102 \
	/EXPORT:jcopy_block_row,@103 \
	/DLL /IMPLIB:$(JPEG)\libjpeg.lib $**

$(jpeg_OBJECTS): $(JPEG)\jconfig.h
	$(CC) $(CFLAGS) /I$(JPEG) $*.c

$(JPEG)\jconfig.h: $*.vc
	copy /y $** $@

###############################################################################
# Pango                                                                       #
###############################################################################
pango: glib \
		$(PANGO)\pango\libpango-1.0-0.dll \
		$(PANGO)\pango\libpangowin32-1.0-0.dll \
		$(PANGO)\modules\basic\pango-basic-win32.dll \
		$(PANGO)\pango\pango-querymodules.exe

# pango
pango_OBJECTS= \
		$(PANGO)\pango\pango-enum-types.obj \
		$(PANGO)\pango\break.obj \
		$(PANGO)\pango\ellipsize.obj \
		$(PANGO)\pango\fonts.obj \
		$(PANGO)\pango\glyphstring.obj \
		$(PANGO)\pango\mapping.obj \
		$(PANGO)\pango\modules.obj \
		$(PANGO)\pango\pango-attributes.obj \
		$(PANGO)\pango\pango-engine.obj \
		$(PANGO)\pango\pango-color.obj \
		$(PANGO)\pango\pango-context.obj \
		$(PANGO)\pango\pango-coverage.obj \
		$(PANGO)\pango\pango-fontset.obj \
		$(PANGO)\pango\pango-fontmap.obj \
		$(PANGO)\pango\pango-glyph-item.obj \
		$(PANGO)\pango\pango-item.obj \
		$(PANGO)\pango\pango-markup.obj \
		$(PANGO)\pango\pango-layout.obj \
		$(PANGO)\pango\pango-renderer.obj \
		$(PANGO)\pango\pango-script.obj \
		$(PANGO)\pango\pango-tabs.obj \
		$(PANGO)\pango\pango-utils.obj \
		$(PANGO)\pango\reorder-items.obj \
		$(PANGO)\pango\shape.obj \
		$(PANGO)\pango\mini-fribidi\fribidi.obj \
		$(PANGO)\pango\mini-fribidi\fribidi_char_type.obj \
		$(PANGO)\pango\mini-fribidi\fribidi_types.obj

$(PANGO)\pango\libpango-1.0-0.dll: $(pango_OBJECTS) $(PANGO)\pango\pango.res
	$(LINK) $(LFLAGS) /DLL /DEF:$(PANGO)\pango\pango.def /IMPLIB:$(PANGO)\pango\pango-1.0.lib $(GLIB)\glib\glib-2.0.lib $(GLIB)\gmodule\gmodule-2.0.lib $(GLIB)\gobject\gobject-2.0.lib $**

$(PANGO)\pango\pango.res: $*.rc
	$(RC) $(RFLAGS) /DBUILDNUMBER=0 $**

$(PANGO)\pango\pango.rc:
	$(PERL) replace.pl @PANGO_MAJOR_VERSION@=$(PANGO_MAJOR_VERSION) @PANGO_MINOR_VERSION@=$(PANGO_MINOR_VERSION) @PANGO_MICRO_VERSION@=$(PANGO_MICRO_VERSION) @PANGO_API_VERSION@=1.0 @LT_CURRENT_MINUS_AGE@=0 < $@.in > $@

$(pango_OBJECTS): $(PANGO)\pango\pango-enum-types.c $(PANGO)\pango\pango-enum-types.h
	$(CC) $(CFLAGS) /DLIBDIR=\"/target/lib\" /DMODULE_VERSION=\"$(PANGO_VERSION)\" /DPACKAGE=\"Pango\" /DPANGO_ENABLE_BACKEND /DPANGO_ENABLE_ENGINE /DSYSCONFDIR=\".\" /DVERSION=\"1.0\" /FImsvc_recommended_pragmas.h /I$(PANGO) /I$(PANGO)\pango /I$(GLIB) /I$(GLIB)\glib /I$(GLIB)\gmodule $*.c

pango_headers= \
		$(PANGO)\pango\pango.h \
		$(PANGO)\pango\pango-attributes.h \
		$(PANGO)\pango\pango-break.h \
		$(PANGO)\pango\pango-context.h \
		$(PANGO)\pango\pango-coverage.h \
		$(PANGO)\pango\pango-engine.h \
		$(PANGO)\pango\pango-font.h \
		$(PANGO)\pango\pango-fontmap.h \
		$(PANGO)\pango\pango-fontset.h \
		$(PANGO)\pango\pango-glyph.h \
		$(PANGO)\pango\pango-glyph-item.h \
		$(PANGO)\pango\pango-item.h \
		$(PANGO)\pango\pango-layout.h \
		$(PANGO)\pango\pango-modules.h \
		$(PANGO)\pango\pango-renderer.h \
		$(PANGO)\pango\pango-script.h \
		$(PANGO)\pango\pango-tabs.h \
		$(PANGO)\pango\pango-types.h \
		$(PANGO)\pango\pango-utils.h \
		$(PANGO)\pango\pangofc-font.h \
		$(PANGO)\pango\pangofc-fontmap.h

$(PANGO)\pango\pango-enum-types.c:
	$(PERL) $(GLIB)\gobject\glib-mkenums  \
		--fhead "#include <pango.h>" \
		--fprod "\n/* enumerations from \"@filename@\" */" \
		--vhead "GType\n@enum_name@_get_type (void)\n{\n  static GType etype = 0;\n  if (etype == 0) {\n    static const G@Type@Value values[] = {" 	\
		--vprod "      { @VALUENAME@, \"@VALUENAME@\", \"@valuenick@\" }," \
		--vtail "      { 0, NULL, NULL }\n    };\n    etype = g_@type@_register_static (\"@EnumName@\", values);\n  }\n  return etype;\n}\n" \
		$(pango_headers) > $@

$(PANGO)\pango\pango-enum-types.h:
	$(PERL) $(GLIB)\gobject\glib-mkenums  \
		--fhead "#ifndef __PANGO_ENUM_TYPES_H__\n#define __PANGO_ENUM_TYPES_H__\n\n#include <glib-object.h>\n\nG_BEGIN_DECLS\n" \
		--fprod "/* enumerations from \"@filename@\" */\n" \
		--vhead "GType @enum_name@_get_type (void);\n#define PANGO_TYPE_@ENUMSHORT@ (@enum_name@_get_type())\n" 	\
		--ftail "G_END_DECLS\n#endif /* __PANGO_ENUM_TYPES_H__ */" \
		$(pango_headers) > $@

# pangowin32
pangowin32_OBJECTS= \
		$(PANGO)\pango\module-defs-win32.obj \
		$(PANGO)\pango\pangowin32.obj \
		$(PANGO)\pango\pangowin32-fontcache.obj \
		$(PANGO)\pango\pangowin32-fontmap.obj

$(PANGO)\pango\libpangowin32-1.0-0.dll: $(pangowin32_OBJECTS) $(PANGO)\pango\basic-win32.obj $(PANGO)\pango\pangowin32.res
	$(LINK) $(LFLAGS) /DLL /DEF:$(PANGO)\pango\pangowin32.def /IMPLIB:$(PANGO)\pango\pangowin32-1.0.lib $(GLIB)\glib\glib-2.0.lib $(GLIB)\gobject\gobject-2.0.lib $(PANGO)\pango\pango-1.0.lib gdi32.lib user32.lib $**

$(PANGO)\pango\pangowin32.res: $*.rc
	$(RC) $(RFLAGS) /DBUILDNUMBER=0 $**

$(PANGO)\pango\pangowin32.rc:
	$(PERL) replace.pl @PANGO_MAJOR_VERSION@=$(PANGO_MAJOR_VERSION) @PANGO_MINOR_VERSION@=$(PANGO_MINOR_VERSION) @PANGO_MICRO_VERSION@=$(PANGO_MICRO_VERSION) @PANGO_API_VERSION@=1.0 @LT_CURRENT_MINUS_AGE@=0 < $@.in > $@

$(pangowin32_OBJECTS): $(GLIB)\config.h $(PANGO)\pango\module-defs-win32.c
	$(CC) $(CFLAGS) /DLIBDIR=\"/target/lib\" /DMODULE_VERSION=\"$(PANGO_VERSION)\" /DPACKAGE=\"Pango\" /DPANGO_ENABLE_BACKEND /DPANGO_ENABLE_ENGINE /DPANGO_MODULE_PREFIX=_pango_basic_win32 /DSYSCONFDIR=\".\" /DVERSION=\"1.0\" /FImsvc_recommended_pragmas.h /I$(PANGO) /I$(GLIB) /I$(GLIB)\glib $*.c

$(PANGO)\pango\basic-win32.obj: $(PANGO)\pango\module-defs-win32.c
	$(CC) $(CFLAGS) /DHAVE_USP10_H /DLIBDIR=\"/target/lib\" /DMODULE_VERSION=\"$(PANGO_VERSION)\" /DPACKAGE=\"Pango\" /DPANGO_ENABLE_BACKEND /DPANGO_ENABLE_ENGINE /DPANGO_MODULE_PREFIX=_pango_basic_win32 /DSYSCONFDIR=\".\" /DVERSION=\"1.0\" /FImsvc_recommended_pragmas.h /I$(PANGO) /I$(PANGO)\pango /I$(GLIB) /I$(GLIB)\glib $(PANGO)\modules\basic\basic-win32.c

$(PANGO)\pango\module-defs-win32.c: $@.win32
	copy /y $** $@

# pango-basic-win32
$(PANGO)\modules\basic\pango-basic-win32.dll: $(PANGO)\modules\basic\basic-win32.obj
	$(LINK) $(LFLAGS) /DLL /DEF:$(PANGO)\modules\module.def $(GLIB)\glib\glib-2.0.lib $(GLIB)\gobject\gobject-2.0.lib $(PANGO)\pango\pango-1.0.lib $(PANGO)\pango\pangowin32-1.0.lib gdi32.lib $**

$(PANGO)\modules\basic\basic-win32.obj:
	$(CC) $(CFLAGS) /DHAVE_USP10_H /DLIBDIR=\"/target/lib\" /DMODULE_VERSION=\"$(PANGO_VERSION)\" /DPACKAGE=\"Pango\" /DPANGO_ENABLE_BACKEND /DPANGO_ENABLE_ENGINE /DSYSCONFDIR=\".\" /DVERSION=\"1.0\" /FImsvc_recommended_pragmas.h /I$(PANGO) /I$(PANGO)\pango /I$(GLIB) /I$(GLIB)\glib $*.c

# pango-querymodules
$(PANGO)\pango\pango-querymodules.exe: $(PANGO)\pango\querymodules.obj
	$(LINK) $(LFLAGS) $(GLIB)\glib\glib-2.0.lib $(GLIB)\gmodule\gmodule-2.0.lib $(GLIB)\gobject\gobject-2.0.lib $(PANGO)\pango\pango-1.0.lib $**

$(PANGO)\pango\querymodules.obj:
	$(CC) $(CFLAGS) /DMODULE_VERSION=\"$(PANGO_VERSION)\" /DPACKAGE=\"Pango\" /DPANGO_ENABLE_BACKEND /DPANGO_ENABLE_ENGINE /DSYSCONFDIR=\".\" /DVERSION=\"1.0\" /FImsvc_recommended_pragmas.h /I$(PANGO) /I$(GLIB) /I$(GLIB)\glib /I$(GLIB)\gmodule $(PANGO)\pango\querymodules.c

###############################################################################
# TIFF                                                                        #
###############################################################################
tiff: jpeg $(TIFF)\libtiff\libtiff.dll

tiff_OBJECTS= \
		$(TIFF)\libtiff\tif_aux.obj \
		$(TIFF)\libtiff\tif_close.obj \
		$(TIFF)\libtiff\tif_codec.obj \
		$(TIFF)\libtiff\tif_color.obj \
		$(TIFF)\libtiff\tif_compress.obj \
		$(TIFF)\libtiff\tif_dir.obj \
		$(TIFF)\libtiff\tif_dirinfo.obj \
		$(TIFF)\libtiff\tif_dirread.obj \
		$(TIFF)\libtiff\tif_dirwrite.obj \
		$(TIFF)\libtiff\tif_dumpmode.obj \
		$(TIFF)\libtiff\tif_error.obj \
		$(TIFF)\libtiff\tif_extension.obj \
		$(TIFF)\libtiff\tif_fax3.obj \
		$(TIFF)\libtiff\tif_fax3sm.obj \
		$(TIFF)\libtiff\tif_getimage.obj \
		$(TIFF)\libtiff\tif_jpeg.obj \
		$(TIFF)\libtiff\tif_ojpeg.obj \
		$(TIFF)\libtiff\tif_flush.obj \
		$(TIFF)\libtiff\tif_luv.obj \
		$(TIFF)\libtiff\tif_lzw.obj \
		$(TIFF)\libtiff\tif_next.obj \
		$(TIFF)\libtiff\tif_open.obj \
		$(TIFF)\libtiff\tif_packbits.obj \
		$(TIFF)\libtiff\tif_pixarlog.obj \
		$(TIFF)\libtiff\tif_predict.obj \
		$(TIFF)\libtiff\tif_print.obj \
		$(TIFF)\libtiff\tif_read.obj \
		$(TIFF)\libtiff\tif_swab.obj \
		$(TIFF)\libtiff\tif_strip.obj \
		$(TIFF)\libtiff\tif_thunder.obj \
		$(TIFF)\libtiff\tif_tile.obj \
		$(TIFF)\libtiff\tif_win32.obj \
		$(TIFF)\libtiff\tif_version.obj \
		$(TIFF)\libtiff\tif_warning.obj \
		$(TIFF)\libtiff\tif_write.obj \
		$(TIFF)\libtiff\tif_zip.obj

$(TIFF)\libtiff\libtiff.dll: $(tiff_OBJECTS)
	$(LINK) $(LFLAGS) /DLL /DEF:$(TIFF)\libtiff\libtiff.def $(JPEG)\libjpeg.lib user32.lib $**

$(tiff_OBJECTS): $(TIFF)\libtiff\tif_config.h $(TIFF)\libtiff\tiffconf.h
	$(CC) $(CFLAGS) /DJPEG_SUPPORT /DTIF_PLATFORM_WINDOWED /I$(JPEG) $*.c

$(TIFF)\libtiff\tif_config.h: $@.vc
	copy /y $** $@

$(TIFF)\libtiff\tiffconf.h: $@.vc
	copy /y $** $@

###############################################################################
# zlib                                                                        #
###############################################################################
zlib: $(ZLIB)\zlib1.dll

zlib_OBJECTS= \
		$(ZLIB)\adler32.obj \
		$(ZLIB)\compress.obj \
		$(ZLIB)\crc32.obj \
		$(ZLIB)\deflate.obj \
		$(ZLIB)\gzio.obj \
		$(ZLIB)\infback.obj \
		$(ZLIB)\inffast.obj \
		$(ZLIB)\inflate.obj \
		$(ZLIB)\inftrees.obj \
		$(ZLIB)\trees.obj \
		$(ZLIB)\uncompr.obj \
		$(ZLIB)\zutil.obj

$(ZLIB)\zlib1.dll: $(zlib_OBJECTS) $(ZLIB)\zlib1.res
	$(LINK) $(LFLAGS) /DLL /DEF:$(ZLIB)\win32\zlib.def /IMPLIB:$(ZLIB)\zdll.lib $**

$(ZLIB)\zlib1.res: $(ZLIB)\win32/zlib1.rc
	$(RC) $(RFLAGS) $**

$(zlib_OBJECTS):
	$(CC) $(CFLAGS) $*.c


###############################################################################
#                                                                             #
# Install & Uninstall                                                         #
#                                                                             #
###############################################################################
atk_HEADERS= \
		atk.h \
		atkobject.h \
		atkaction.h \
		atkcomponent.h \
		atkdocument.h \
		atkeditabletext.h \
		atkgobjectaccessible.h \
		atkhyperlink.h \
		atkhypertext.h \
		atkimage.h \
		atknoopobject.h \
		atknoopobjectfactory.h \
		atkobjectfactory.h \
		atkregistry.h \
		atkrelation.h \
		atkrelationset.h \
		atkrelationtype.h \
		atkselection.h \
		atkstate.h \
		atkstateset.h \
		atkstreamablecontent.h \
		atktable.h \
		atktext.h \
		atkutil.h \
		atkvalue.h
glib_HEADERS= \
		galloca.h \
		garray.h \
		gasyncqueue.h \
		gatomic.h \
		gbacktrace.h \
		gcache.h \
		gcompletion.h \
		gconvert.h \
		gdataset.h \
		gdate.h \
		gdir.h \
		gerror.h \
		gfileutils.h \
		ghash.h \
		ghook.h \
		giochannel.h \
		gkeyfile.h \
		glist.h \
		gmacros.h \
		gmain.h \
		gmarkup.h \
		gmem.h \
		gmessages.h \
		gnode.h \
		goption.h \
		gpattern.h \
		gprimes.h \
		gqsort.h \
		gquark.h \
		gqueue.h \
		grand.h \
		grel.h \
		gscanner.h \
		gshell.h \
		gslist.h \
		gspawn.h \
		gstrfuncs.h \
		gstring.h \
		gthread.h \
		gthreadpool.h \
		gtimer.h \
		gtree.h \
		gtypes.h \
		gunicode.h \
		gutils.h \
		gwin32.h
gobject_HEADERS= \
		gboxed.h \
		gclosure.h \
		genums.h \
		gmarshal.h \
		gobject.h \
		gparam.h \
		gparamspecs.h \
		gsignal.h \
		gsourceclosure.h \
		gtype.h \
		gtypemodule.h \
		gtypeplugin.h \
		gvalue.h \
		gvaluearray.h \
		gvaluecollector.h \
		gvaluetypes.h
gdk_pixbuf_HEADERS= \
		gdk-pixbuf.h \
		gdk-pixbuf-animation.h \
		gdk-pixbuf-core.h \
		gdk-pixbuf-enum-types.h \
		gdk-pixbuf-features.h \
		gdk-pixbuf-io.h \
		gdk-pixbuf-loader.h \
		gdk-pixbuf-transform.h
gdk_HEADERS= \
		gdk.h \
		gdkcolor.h \
		gdkcursor.h \
		gdkdisplay.h \
		gdkdisplaymanager.h \
		gdkdnd.h \
		gdkdrawable.h \
		gdkenumtypes.h \
		gdkevents.h \
		gdkfont.h \
		gdkgc.h \
		gdkkeysyms.h \
		gdki18n.h \
		gdkimage.h \
		gdkinput.h \
		gdkkeys.h \
		gdkpango.h \
		gdkpixbuf.h \
		gdkpixmap.h \
		gdkprivate.h \
		gdkproperty.h \
		gdkregion.h \
		gdkrgb.h \
		gdkscreen.h \
		gdkselection.h \
		gdkspawn.h \
		gdktypes.h \
		gdkvisual.h \
		gdkwindow.h
gtk_0_HEADERS= \
		gtk.h \
		gtkaboutdialog.h \
		gtkaccelgroup.h \
		gtkaccellabel.h \
		gtkaccelmap.h \
		gtkaccessible.h \
		gtkaction.h \
		gtkactiongroup.h \
		gtkadjustment.h \
		gtkalignment.h \
		gtkarrow.h \
		gtkaspectframe.h \
		gtkbbox.h \
		gtkbin.h \
		gtkbindings.h \
		gtkbox.h \
		gtkbutton.h \
		gtkcalendar.h \
		gtkcelleditable.h \
		gtkcelllayout.h \
		gtkcellrenderer.h \
		gtkcellrenderercombo.h \
		gtkcellrendererpixbuf.h \
		gtkcellrendererprogress.h \
		gtkcellrenderertext.h \
		gtkcellrenderertoggle.h \
		gtkcellview.h \
		gtkcheckbutton.h \
		gtkcheckmenuitem.h \
		gtkclipboard.h \
		gtkclist.h \
		gtkclipboard.h \
		gtkcolorbutton.h \
		gtkcolorsel.h \
		gtkcolorseldialog.h \
		gtkcombo.h \
		gtkcombobox.h \
		gtkcomboboxentry.h \
		gtkcontainer.h \
		gtkctree.h \
		gtkcurve.h \
		gtkdebug.h \
		gtkdialog.h \
		gtkdnd.h \
		gtkdrawingarea.h \
		gtkeditable.h \
		gtkentry.h \
		gtkentrycompletion.h \
		gtkenums.h \
		gtkeventbox.h \
		gtkexpander.h \
		gtkfilechooser.h \
		gtkfilechooserbutton.h \
		gtkfilechooserdialog.h \
		gtkfilechooserwidget.h \
		gtkfilefilter.h \
		gtkfilesel.h \
		gtkfixed.h \
		gtkfontbutton.h \
		gtkfontsel.h \
		gtkframe.h \
		gtkgamma.h \
		gtkgc.h	 \
		gtkhandlebox.h \
		gtkhbbox.h \
		gtkhbox.h \
		gtkhpaned.h \
		gtkhruler.h \
		gtkhscale.h \
		gtkhscrollbar.h \
		gtkhseparator.h \
		gtkhsv.h
gtk_1_HEADERS= \
		gtkiconfactory.h \
		gtkicontheme.h \
		gtkiconview.h \
		gtkimage.h \
		gtkimagemenuitem.h \
		gtkimcontext.h \
		gtkimcontextsimple.h \
		gtkimmodule.h \
		gtkimmulticontext.h \
		gtkinputdialog.h \
		gtkinvisible.h \
		gtkitem.h \
		gtkitemfactory.h \
		gtklabel.h \
		gtklayout.h \
		gtklist.h \
		gtklistitem.h \
		gtkliststore.h \
		gtkmain.h \
		gtkmarshal.h \
		gtkmenu.h \
		gtkmenubar.h \
		gtkmenuitem.h \
		gtkmenushell.h \
		gtkmenutoolbutton.h \
		gtkmessagedialog.h \
		gtkmisc.h \
		gtkmodules.h \
		gtknotebook.h \
		gtkobject.h \
		gtkoldeditable.h \
		gtkoptionmenu.h \
		gtkpaned.h \
		gtkpixmap.h \
		gtkplug.h \
		gtkpreview.h \
		gtkprivate.h \
		gtkprogress.h \
		gtkprogressbar.h \
		gtkradioaction.h \
		gtkradiobutton.h \
		gtkradiomenuitem.h \
		gtkradiotoolbutton.h \
		gtkrange.h \
		gtkrc.h \
		gtkruler.h \
		gtkscale.h \
		gtkscrollbar.h \
		gtkscrolledwindow.h \
		gtkselection.h \
		gtkseparator.h \
		gtkseparatormenuitem.h \
		gtkseparatortoolitem.h \
		gtksettings.h \
		gtksignal.h \
		gtksizegroup.h \
		gtksignal.h \
		gtksocket.h \
		gtkspinbutton.h \
		gtkstatusbar.h \
		gtkstock.h \
		gtkstyle.h \
		gtktable.h \
		gtktearoffmenuitem.h \
		gtktext.h \
		gtktextbuffer.h \
		gtktextchild.h \
		gtktextdisplay.h \
		gtktextiter.h \
		gtktextlayout.h \
		gtktextmark.h \
		gtktexttag.h \
		gtktexttagtable.h \
		gtktextview.h \
		gtktipsquery.h \
		gtktoggleaction.h \
		gtktogglebutton.h \
		gtktoggletoolbutton.h \
		gtktoolbar.h \
		gtktoolbutton.h \
		gtktoolitem.h \
		gtktooltips.h \
		gtktree.h \
		gtktreednd.h \
		gtktreeitem.h \
		gtktreemodel.h \
		gtktreemodelfilter.h \
		gtktreemodelsort.h \
		gtktreeselection.h \
		gtktreesortable.h \
		gtktreestore.h \
		gtktreeview.h \
		gtktreeviewcolumn.h \
		gtktypebuiltins.h \
		gtktypeutils.h \
		gtkuimanager.h \
		gtkvbbox.h \
		gtkvbox.h \
		gtkversion.h \
		gtkviewport.h \
		gtkvpaned.h \
		gtkvruler.h \
		gtkvscale.h \
		gtkvscrollbar.h \
		gtkvseparator.h \
		gtkwidget.h \
		gtkwindow.h
pango_HEADERS= \
		pango.h \
		pango-attributes.h \
		pango-break.h \
		pango-context.h \
		pango-coverage.h \
		pango-engine.h \
		pango-enum-types.h \
		pango-font.h \
		pango-fontmap.h \
		pango-fontset.h \
		pango-glyph.h \
		pango-glyph-item.h \
		pango-item.h \
		pango-layout.h \
		pango-modules.h \
		pango-renderer.h \
		pango-script.h \
		pango-tabs.h \
		pango-types.h \
		pango-utils.h \
		pangowin32.h \
		pangox.h
gtk_MODULES= \
		inputim-am-et.dll \
		inputim-cedilla.dll \
		inputim-cyrillic-translit.dll \
		inputim-ime.dll \
		inputim-inuktitut.dll \
		inputim-ipa.dll \
		inputim-thai-broken.dll \
		inputim-ti-er.dll \
		inputim-ti-et.dll \
		inputim-viqr.dll
PO=		af am ang ar as az az_IR be bg bn br bs ca cs cy da de el en_CA en_GB \
		eo es et eu fa fi fr ga gl gu he hi hr hu ia id is it ja kn ko li lt \
		lv mi mk ml mn mr ms nb ne nl nn no nso or pa pl pt pt_BR ro ru rw sk \
		sl sq sr sr@ije sr@Latn sv ta th tk tl tr uk uz uz@Latn vi wa xh yi \
		zh_CN zh_TW

###############################################################################
# Install                                                                     #
###############################################################################
install: all
# Folders
	if not exist $(PREFIX) mkdir $(PREFIX)
	if not exist $(PREFIX)\bin mkdir $(PREFIX)\bin
	if not exist $(PREFIX)\lib mkdir $(PREFIX)\lib
	if not exist $(PREFIX)\include mkdir $(PREFIX)\include
# Documents
	if not exist $(PREFIX)\doc mkdir $(PREFIX)\doc
	if not exist $(PREFIX)\doc\$(ATK) mkdir $(PREFIX)\doc\$(ATK)
	if not exist $(PREFIX)\doc\$(GETTEXT) mkdir $(PREFIX)\doc\$(GETTEXT)
	if not exist $(PREFIX)\doc\$(GETTEXT)\gettext-runtime mkdir $(PREFIX)\doc\$(GETTEXT)\gettext-runtime
	if not exist $(PREFIX)\doc\$(GETTEXT)\gettext-runtime\intl mkdir $(PREFIX)\doc\$(GETTEXT)\gettext-runtime\intl
	if not exist $(PREFIX)\doc\$(GLIB) mkdir $(PREFIX)\doc\$(GLIB)
	if not exist $(PREFIX)\doc\$(GTK) mkdir $(PREFIX)\doc\$(GTK)
	if not exist $(PREFIX)\doc\$(JPEG) mkdir $(PREFIX)\doc\$(JPEG)
	if not exist $(PREFIX)\doc\$(LIBPNG) mkdir $(PREFIX)\doc\$(LIBPNG)
	if not exist $(PREFIX)\doc\$(PANGO) mkdir $(PREFIX)\doc\$(PANGO)
	if not exist $(PREFIX)\doc\$(TIFF) mkdir $(PREFIX)\doc\$(TIFF)
	if not exist $(PREFIX)\doc\$(ZLIB) mkdir $(PREFIX)\doc\$(ZLIB)
	copy /y $(ATK)\COPYING $(PREFIX)\doc\$(ATK)
	copy /y $(GETTEXT)\COPYING $(PREFIX)\doc\$(GETTEXT)
	copy /y $(GETTEXT)\gettext-runtime\intl\COPYING.LIB-2.1 $(PREFIX)\doc\$(GETTEXT)\gettext-runtime\intl
	copy /y $(GLIB)\COPYING $(PREFIX)\doc\$(GLIB)
	copy /y $(GTK)\COPYING $(PREFIX)\doc\$(GTK)
	copy /y $(JPEG)\README $(PREFIX)\doc\$(JPEG)
	copy /y $(LIBPNG)\LICENSE $(PREFIX)\doc\$(LIBPNG)
	copy /y $(PANGO)\COPYING $(PREFIX)\doc\$(PANGO)
	copy /y $(TIFF)\COPYRIGHT $(PREFIX)\doc\$(TIFF)
	copy /y $(ZLIB)\README $(PREFIX)\doc\$(ZLIB)
	if not exist $(PREFIX)\README copy /y README $(PREFIX)
# ATK
	copy /y $(ATK)\atk\libatk-1.0-0.dll $(PREFIX)\bin
	copy /y $(ATK)\atk\atk-1.0.lib $(PREFIX)\lib
	if not exist $(PREFIX)\include\atk mkdir $(PREFIX)\include\atk
	for %f in ($(atk_HEADERS)) do copy /y $(ATK)\atk\%f $(PREFIX)\include\atk
# GLib
	copy /y $(GLIB)\glib\libglib-2.0-0.dll $(PREFIX)\bin
	copy /y $(GLIB)\glib\gspawn-win32-helper.exe $(PREFIX)\bin
	copy /y $(GLIB)\gmodule\libgmodule-2.0-0.dll $(PREFIX)\bin
	copy /y $(GLIB)\gobject\libgobject-2.0-0.dll $(PREFIX)\bin
	copy /y $(GLIB)\gobject\glib-genmarshal.exe $(PREFIX)\bin
	copy /y $(GLIB)\gthread\libgthread-2.0-0.dll $(PREFIX)\bin
	copy /y $(GLIB)\glib\glib-2.0.lib $(PREFIX)\lib
	copy /y $(GLIB)\gmodule\gmodule-2.0.lib $(PREFIX)\lib
	copy /y $(GLIB)\gobject\gobject-2.0.lib $(PREFIX)\lib
	copy /y $(GLIB)\gthread\gthread-2.0.lib $(PREFIX)\lib
	copy /y $(GLIB)\glibconfig.h $(PREFIX)\include
	copy /y $(GLIB)\glib\glib.h $(PREFIX)\include
	copy /y $(GLIB)\gmodule\gmodule.h $(PREFIX)\include
	copy /y $(GLIB)\glib\glib-object.h $(PREFIX)\include
	if not exist $(PREFIX)\include\glib mkdir $(PREFIX)\include\glib
	for %f in ($(glib_HEADERS)) do copy /y $(GLIB)\glib\%f $(PREFIX)\include\glib
	if not exist $(PREFIX)\include\gobject mkdir $(PREFIX)\include\gobject
	for %f in ($(gobject_HEADERS)) do copy /y $(GLIB)\gobject\%f $(PREFIX)\include\gobject
# GTK+
	copy /y $(GTK)\gdk-pixbuf\libgdk_pixbuf-2.0-0.dll $(PREFIX)\bin
	copy /y $(GTK)\gdk\libgdk-win32-2.0-0.dll $(PREFIX)\bin
	copy /y $(GTK)\gtk\libgtk-win32-2.0-0.dll $(PREFIX)\bin
	copy /y $(GTK)\gtk\gtk-query-immodules-2.0.exe $(PREFIX)\bin
	copy /y $(GTK)\gdk-pixbuf\gdk_pixbuf-2.0.lib $(PREFIX)\lib
	copy /y $(GTK)\gdk\gdk-win32-2.0.lib $(PREFIX)\lib
	copy /y $(GTK)\gtk\gtk-win32-2.0.lib $(PREFIX)\lib
	copy /y $(GTK)\gdk\gdkconfig.h $(PREFIX)\include
	if not exist $(PREFIX)\include\gdk-pixbuf mkdir $(PREFIX)\include\gdk-pixbuf
	for %f in ($(gdk_pixbuf_HEADERS)) do copy /y $(GTK)\gdk-pixbuf\%f $(PREFIX)\include\gdk-pixbuf
	if not exist $(PREFIX)\include\gdk mkdir $(PREFIX)\include\gdk
	copy /y $(GTK)\gdk\win32\gdkwin32.h $(PREFIX)\include\gdk
	for %f in ($(gdk_HEADERS)) do copy /y $(GTK)\gdk\%f $(PREFIX)\include\gdk
	if not exist $(PREFIX)\include\gtk mkdir $(PREFIX)\include\gtk
	for %f in ($(gtk_0_HEADERS)) do copy /y $(GTK)\gtk\%f $(PREFIX)\include\gtk
	for %f in ($(gtk_1_HEADERS)) do copy /y $(GTK)\gtk\%f $(PREFIX)\include\gtk
	if not exist $(PREFIX)\lib\gtk-2.0 mkdir $(PREFIX)\lib\gtk-2.0
	if not exist $(PREFIX)\lib\gtk-2.0\$(GTK_VERSION) mkdir $(PREFIX)\lib\gtk-2.0\$(GTK_VERSION)
	if not exist $(PREFIX)\lib\gtk-2.0\$(GTK_VERSION)\immodules mkdir $(PREFIX)\lib\gtk-2.0\$(GTK_VERSION)\immodules
	for %f in ($(gtk_MODULES)) do copy /y $(GTK)\modules\input\%f $(PREFIX)\lib\gtk-2.0\$(GTK_VERSION)\immodules
# gettext
	copy /y $(GETTEXT)\gettext-tools\src\msgfmt.exe $(PREFIX)\bin
	copy /y $(GETTEXT)\gettext-runtime\intl\intl.dll $(PREFIX)\bin
	copy /y $(GETTEXT)\gettext-runtime\intl\intl.lib $(PREFIX)\lib
	copy /y $(GETTEXT)\gettext-runtime\intl\libgnuintl.h $(PREFIX)\include\libintl.h
# JPEG
	copy /y $(JPEG)\jpeg62.dll $(PREFIX)\bin
# libiconv
	copy /y $(LIBICONV)\lib\iconv.dll $(PREFIX)\bin
# libpng
	copy /y $(LIBPNG)\libpng13.dll $(PREFIX)\bin
# Pango
	copy /y $(PANGO)\pango\libpango-1.0-0.dll $(PREFIX)\bin
	copy /y $(PANGO)\pango\libpangowin32-1.0-0.dll $(PREFIX)\bin
	copy /y $(PANGO)\pango\pango-querymodules.exe $(PREFIX)\bin
	copy /y $(PANGO)\pango\pango-1.0.lib $(PREFIX)\lib
	copy /y $(PANGO)\pango\pangowin32-1.0.lib $(PREFIX)\lib
	if not exist $(PREFIX)\include\pango mkdir $(PREFIX)\include\pango
	for %f in ($(pango_HEADERS)) do copy /y $(PANGO)\pango\%f $(PREFIX)\include\pango
	if not exist $(PREFIX)\lib\pango mkdir $(PREFIX)\lib\pango
	if not exist $(PREFIX)\lib\pango\$(PANGO_VERSION) mkdir $(PREFIX)\lib\pango\$(PANGO_VERSION)
	if not exist $(PREFIX)\lib\pango\$(PANGO_VERSION)\modules mkdir $(PREFIX)\lib\pango\$(PANGO_VERSION)\modules
	copy /y $(PANGO)\modules\basic\pango-basic-win32.dll $(PREFIX)\lib\pango\$(PANGO_VERSION)\modules
# TIFF
	copy /y $(TIFF)\libtiff\libtiff.dll $(PREFIX)\bin
# Zlib
	copy /y $(ZLIB)\zlib1.dll $(PREFIX)\bin
# PO
	if not exist $(PREFIX)\lib\locale mkdir $(PREFIX)\lib\locale
	for %d in ($(PO)) do if not exist $(PREFIX)\lib\locale\%d mkdir $(PREFIX)\lib\locale\%d
	for %d in ($(PO)) do if not exist $(PREFIX)\lib\locale\%d\LC_MESSAGES mkdir $(PREFIX)\lib\locale\%d\LC_MESSAGES
!ifdef CVS
	for %f in ($(PO)) do if exist $(ATK)\po\%f.po $(GETTEXT)\gettext-tools\src\msgfmt.exe $(ATK)\po\%f.po -o $(PREFIX)\lib\locale\%f\LC_MESSAGES\atk10.mo
	for %f in ($(PO)) do if exist $(GLIB)\po\%f.po $(GETTEXT)\gettext-tools\src\msgfmt.exe $(GLIB)\po\%f.po -o $(PREFIX)\lib\locale\%f\LC_MESSAGES\glib20.mo
	for %f in ($(PO)) do if exist $(GTK)\po\%f.po $(GETTEXT)\gettext-tools\src\msgfmt.exe $(GTK)\po\%f.po -o $(PREFIX)\lib\locale\%f\LC_MESSAGES\gtk20.mo
!else
	for %f in ($(PO)) do copy /y $(ATK)\po\%f.gmo $(PREFIX)\lib\locale\%f\LC_MESSAGES\atk10.mo
	for %f in ($(PO)) do copy /y $(GLIB)\po\%f.gmo $(PREFIX)\lib\locale\%f\LC_MESSAGES\glib20.mo
	for %f in ($(PO)) do copy /y $(GTK)\po\%f.gmo $(PREFIX)\lib\locale\%f\LC_MESSAGES\gtk20.mo
!endif
# Config
	if not exist $(PREFIX)\etc mkdir $(PREFIX)\etc
	if not exist $(PREFIX)\etc\gtk-2.0 mkdir $(PREFIX)\etc\gtk-2.0
	if not exist $(PREFIX)\etc\pango mkdir $(PREFIX)\etc\pango
	copy /y iwm\config\pango.aliases $(PREFIX)\etc\pango
	$(PREFIX)\bin\gtk-query-immodules-2.0.exe > $(PREFIX)\etc\gtk-2.0\gtk.immodules
	$(PREFIX)\bin\pango-querymodules.exe $(PREFIX)\lib\pango\$(PANGO_VERSION)\modules\pango-basic-win32.dll > $(PREFIX)\etc\pango\pango.modules

###############################################################################
# Uninstall                                                                   #
###############################################################################
uninstall:
# ATK
	if exist $(PREFIX)\bin\libatk-1.0-0.dll del /q $(PREFIX)\bin\libatk-1.0-0.dll
	if exist $(PREFIX)\lib\atk-1.0.lib del /q $(PREFIX)\lib\atk-1.0.lib
	for %f in ($(atk_HEADERS)) do if exist $(PREFIX)\include\atk\%f del /q $(PREFIX)\include\atk\%f
# GLib
	if exist $(PREFIX)\bin\libglib-2.0-0.dll del /q $(PREFIX)\bin\libglib-2.0-0.dll
	if exist $(PREFIX)\bin\libgmodule-2.0-0.dll del /q $(PREFIX)\bin\libgmodule-2.0-0.dll
	if exist $(PREFIX)\bin\gspawn-win32-helper.exe del /q $(PREFIX)\bin\gspawn-win32-helper.exe
	if exist $(PREFIX)\bin\libgobject-2.0-0.dll del /q $(PREFIX)\bin\libgobject-2.0-0.dll
	if exist $(PREFIX)\bin\glib-genmarshal.exe del /q $(PREFIX)\bin\glib-genmarshal.exe
	if exist $(PREFIX)\bin\libgthread-2.0-0.dll del /q $(PREFIX)\bin\libgthread-2.0-0.dll
	if exist $(PREFIX)\lib\glib-2.0.lib del /q $(PREFIX)\lib\glib-2.0.lib
	if exist $(PREFIX)\lib\gmodule-2.0.lib del /q $(PREFIX)\lib\gmodule-2.0.lib
	if exist $(PREFIX)\lib\gobject-2.0.lib del /q $(PREFIX)\lib\gobject-2.0.lib
	if exist $(PREFIX)\lib\gthread-2.0.lib del /q $(PREFIX)\lib\gthread-2.0.lib
	if exist $(PREFIX)\include\glib.h del /q $(PREFIX)\include\glib.h
	if exist $(PREFIX)\include\glibconfig.h del /q $(PREFIX)\include\glibconfig.h
	if exist $(PREFIX)\include\gmodule.h del /q $(PREFIX)\include\gmodule.h
	if exist $(PREFIX)\include\glib-object.h del /q $(PREFIX)\include\glib-object.h
	for %f in ($(glib_HEADERS)) do if exist $(PREFIX)\include\glib\%f del /q $(PREFIX)\include\glib\%f
	for %f in ($(gobject_HEADERS)) do if exist $(PREFIX)\include\gobject\%f del /q $(PREFIX)\include\gobject\%f
# GTK+
	if exist $(PREFIX)\bin\libgdk_pixbuf-2.0-0.dll del /q $(PREFIX)\bin\libgdk_pixbuf-2.0-0.dll
	if exist $(PREFIX)\bin\libgdk-win32-2.0-0.dll del /q $(PREFIX)\bin\libgdk-win32-2.0-0.dll
	if exist $(PREFIX)\bin\libgtk-win32-2.0-0.dll del /q $(PREFIX)\bin\libgtk-win32-2.0-0.dll
	if exist $(PREFIX)\bin\gtk-query-immodules-2.0.exe del /q $(PREFIX)\bin\gtk-query-immodules-2.0.exe
	if exist $(PREFIX)\lib\gdk_pixbuf-2.0.lib del /q $(PREFIX)\lib\gdk_pixbuf-2.0.lib
	if exist $(PREFIX)\lib\gdk-win32-2.0.lib del /q $(PREFIX)\lib\gdk-win32-2.0.lib
	if exist $(PREFIX)\lib\gtk-win32-2.0.lib del /q $(PREFIX)\lib\gtk-win32-2.0.lib
	if exist $(PREFIX)\include\gdkconfig.h del /q $(PREFIX)\include\gdkconfig.h
	if exist $(PREFIX)\include\gdk\gdkwin32.h del /q $(PREFIX)\include\gdk\gdkwin32.h
	for %f in ($(gdk_pixbuf_HEADERS)) do if exist $(PREFIX)\include\gdk-pixbuf\%f del /q $(PREFIX)\include\gdk-pixbuf\%f
	for %f in ($(gdk_HEADERS)) do if exist $(PREFIX)\include\gdk\%f del /q $(PREFIX)\include\gdk\%f
	for %f in ($(gtk_0_HEADERS)) do if exist $(PREFIX)\include\gtk\%f del /q $(PREFIX)\include\gtk\%f
	for %f in ($(gtk_1_HEADERS)) do if exist $(PREFIX)\include\gtk\%f del /q $(PREFIX)\include\gtk\%f
	for %f in ($(gtk_MODULES)) do if exist $(PREFIX)\lib\gtk-2.0\$(GTK_VERSION)\immodules\%f del /q $(PREFIX)\lib\gtk-2.0\$(GTK_VERSION)\immodules\%f
# gettext
	if exist $(PREFIX)\bin\msgfmt.exe del /q $(PREFIX)\bin\msgfmt.exe
	if exist $(PREFIX)\bin\intl.dll del /q $(PREFIX)\bin\intl.dll
	if exist $(PREFIX)\lib\intl.lib del /q $(PREFIX)\lib\intl.lib
	if exist $(PREFIX)\include\libintl.h del /q $(PREFIX)\include\libintl.h
# JPEG
	if exist $(PREFIX)\bin\jpeg62.dll del /q $(PREFIX)\bin\jpeg62.dll
# libiconv
	if exist $(PREFIX)\bin\iconv.dll del /q $(PREFIX)\bin\iconv.dll
# libpng
	if exist $(PREFIX)\bin\libpng13.dll del /q $(PREFIX)\bin\libpng13.dll
# Pango
	if exist $(PREFIX)\bin\libpango-1.0-0.dll del /q $(PREFIX)\bin\libpango-1.0-0.dll
	if exist $(PREFIX)\bin\libpangowin32-1.0-0.dll del /q $(PREFIX)\bin\libpangowin32-1.0-0.dll
	if exist $(PREFIX)\bin\pango-querymodules.exe del /q $(PREFIX)\bin\pango-querymodules.exe
	if exist $(PREFIX)\lib\pango-1.0.lib del /q $(PREFIX)\lib\pango-1.0.lib
	if exist $(PREFIX)\lib\pangowin32-1.0.lib del /q $(PREFIX)\lib\pangowin32-1.0.lib
	if exist $(PREFIX)\include\pango.h del /q $(PREFIX)\include\pango.h
	for %f in ($(pango_HEADERS)) do if exist $(PREFIX)\include\pango\%f del /q $(PREFIX)\include\pango\%f
	if exist $(PREFIX)\lib\pango\$(PANGO_VERSION)\modules\pango-basic-win32.dll del /q $(PREFIX)\lib\pango\$(PANGO_VERSION)\modules\pango-basic-win32.dll
# TIFF
	if exist $(PREFIX)\bin\libtiff.dll del /q $(PREFIX)\bin\libtiff.dll
# Zlib
	if exist $(PREFIX)\bin\zlib1.dll del /q $(PREFIX)\bin\zlib1.dll
# PO
	for %d in ($(PO)) do for %f in (atk10.mo glib20.mo gtk20.mo) do if exist $(PREFIX)\lib\locale\%d\LC_MESSAGES\%f del /q $(PREFIX)\lib\locale\%d\LC_MESSAGES\%f
	for %d in ($(PO)) do if exist $(PREFIX)\lib\locale\%d\LC_MESSAGES rmdir /q $(PREFIX)\lib\locale\%d\LC_MESSAGES
	for %d in ($(PO)) do if exist $(PREFIX)\lib\locale\%d rmdir /q $(PREFIX)\lib\locale\%d
# Config
	if exist $(PREFIX)\etc\gtk-2.0\gtk.immodules del /q $(PREFIX)\etc\gtk-2.0\gtk.immodules
	if exist $(PREFIX)\etc\pango\pango.aliases del /q $(PREFIX)\etc\pango\pango.aliases
	if exist $(PREFIX)\etc\pango\pango.modules del /q $(PREFIX)\etc\pango\pango.modules
# Documents
	if exist $(PREFIX)\doc\$(ATK)\COPYING del /q $(PREFIX)\doc\$(ATK)\COPYING
	if exist $(PREFIX)\doc\$(GETTEXT)\COPYING del /q $(PREFIX)\doc\$(GETTEXT)\COPYING
	if exist $(PREFIX)\doc\$(GETTEXT)\gettext-runtime\intl\COPYING.LIB-2.1 del /q $(PREFIX)\doc\$(GETTEXT)\gettext-runtime\intl\COPYING.LIB-2.1
	if exist $(PREFIX)\doc\$(GLIB)\COPYING del /q $(PREFIX)\doc\$(GLIB)\COPYING
	if exist $(PREFIX)\doc\$(GTK)\COPYING del /q $(PREFIX)\doc\$(GTK)\COPYING
	if exist $(PREFIX)\doc\$(JPEG)\README del /q $(PREFIX)\doc\$(JPEG)\README
	if exist $(PREFIX)\doc\$(LIBPNG)\LICENSE del /q $(PREFIX)\doc\$(LIBPNG)\LICENSE
	if exist $(PREFIX)\doc\$(PANGO)\COPYING del /q $(PREFIX)\doc\$(PANGO)\COPYING
	if exist $(PREFIX)\doc\$(TIFF)\COPYRIGHT del /q $(PREFIX)\doc\$(TIFF)\COPYRIGHT
	if exist $(PREFIX)\doc\$(ZLIB)\README del /q $(PREFIX)\doc\$(ZLIB)\README
	if not "$(PREFIX)"=="." if exist $(PREFIX)\README del /q $(PREFIX)\README
	-rmdir $(PREFIX)\doc\$(ATK)
	-rmdir $(PREFIX)\doc\$(GETTEXT)\gettext-runtime\intl
	-rmdir $(PREFIX)\doc\$(GETTEXT)\gettext-runtime
	-rmdir $(PREFIX)\doc\$(GETTEXT)
	-rmdir $(PREFIX)\doc\$(GLIB)
	-rmdir $(PREFIX)\doc\$(GTK)
	-rmdir $(PREFIX)\doc\$(JPEG)
	-rmdir $(PREFIX)\doc\$(LIBPNG)
	-rmdir $(PREFIX)\doc\$(PANGO)
	-rmdir $(PREFIX)\doc\$(TIFF)
	-rmdir $(PREFIX)\doc\$(ZLIB)
	-rmdir $(PREFIX)\doc
# Folders
	-rmdir $(PREFIX)\bin
	-rmdir $(PREFIX)\etc\gtk-2.0
	-rmdir $(PREFIX)\etc\pango
	-rmdir $(PREFIX)\etc
	-rmdir $(PREFIX)\lib\gtk-2.0\$(GTK_VERSION)\immodules
	-rmdir $(PREFIX)\lib\gtk-2.0\$(GTK_VERSION)
	-rmdir $(PREFIX)\lib\gtk-2.0
	-rmdir $(PREFIX)\lib\locale
	-rmdir $(PREFIX)\lib\pango\$(PANGO_VERSION)\modules
	-rmdir $(PREFIX)\lib\pango\$(PANGO_VERSION)
	-rmdir $(PREFIX)\lib\pango
	-rmdir $(PREFIX)\lib
	-rmdir $(PREFIX)\include\atk
	-rmdir $(PREFIX)\include\gdk
	-rmdir $(PREFIX)\include\gdk-pixbuf
	-rmdir $(PREFIX)\include\glib
	-rmdir $(PREFIX)\include\gobject
	-rmdir $(PREFIX)\include\gtk
	-rmdir $(PREFIX)\include\pango
	-rmdir $(PREFIX)\include
	-rmdir $(PREFIX)


###############################################################################
#                                                                             #
# Clean                                                                       #
#                                                                             #
###############################################################################
# ATK
atk_CLEANS= \
		$(ATK)\atk\libatk-1.0-0.dll \
		$(ATK)\atk\atk-1.0.exp \
		$(ATK)\atk\atk-1.0.lib \
		$(ATK)\config.h \
!ifdef CVS
		$(ATK)\atk\atk.rc \
		$(ATK)\atk\atk.res \
		$(ATK)\atk\atk-enum-types.c \
		$(ATK)\atk\atk-enum-types.h \
!endif
		$(ATK)\atk\atkmarshal.c \
		$(ATK)\atk\atkmarshal.h \
		$(ATK)\atk\*.obj \
		$(ATK)\atk\*.pch
# cairo
cairo_CLEANS= \
		$(CAIRO)\src\$(CAIRO).dll \
		$(CAIRO)\src\$(CAIRO).exp \
		$(CAIRO)\src\$(CAIRO).imp \
		$(CAIRO)\src\cairo.def \
!ifdef CVS
		$(CAIRO)\src\cairo-features.h \
!endif
		$(CAIRO)\src\*.obj \
		$(CAIRO)\src\*.pch \
		$(LIBPIXMAN)\src\*.obj \
		$(LIBPIXMAN)\src\*.pch
# GLib
glib_CLEANS= \
		$(GLIB)\config.h \
!ifdef CVS
		$(GLIB)\config.h.win32 \
!endif
		$(GLIB)\glibconfig.h \
!ifdef CVS
		$(GLIB)\glibconfig.h.win32 \
!endif
		$(GLIB)\libintl.h \
		$(GLIB)\build\win32\dirent\*.obj \
		$(GLIB)\build\win32\dirent\*.pch \
		$(GLIB)\glib\libglib-2.0-0.dll \
		$(GLIB)\glib\glib-2.0.exp \
		$(GLIB)\glib\glib-2.0.lib \
		$(GLIB)\glib\gspawn-win32-helper.exe \
		$(GLIB)\glib\gnulib\*.obj \
		$(GLIB)\glib\gnulib\*.pch \
		$(GLIB)\glib\libcharset\localcharset.obj \
		$(GLIB)\glib\libcharset\localcharset.pch \
!ifdef CVS
		$(GLIB)\glib\galias.h \
		$(GLIB)\glib\galiasdef.c \
		$(GLIB)\glib\glib.def \
		$(GLIB)\glib\glib.rc \
!endif
		$(GLIB)\glib\glib.res \
		$(GLIB)\glib\*.obj \
		$(GLIB)\glib\*.pch \
		$(GLIB)\gmodule\libgmodule-2.0-0.dll \
		$(GLIB)\gmodule\gmodule-2.0.exp \
		$(GLIB)\gmodule\gmodule-2.0.lib \
		$(GLIB)\gmodule\gmodule.obj \
		$(GLIB)\gmodule\gmodule.pch \
!ifdef CVS
		$(GLIB)\gmodule\gmodule.rc \
!endif
		$(GLIB)\gmodule\gmodule.res \
		$(GLIB)\gmodule\gmoduleconf.h \
		$(GLIB)\gobject\libgobject-2.0-0.dll \
		$(GLIB)\gobject\gobject-2.0.exp \
		$(GLIB)\gobject\gobject-2.0.lib \
		$(GLIB)\gobject\glib-genmarshal.exe \
!ifdef CVS
		$(GLIB)\gobject\glib-mkenums \
		$(GLIB)\gobject\gmarshal.c \
		$(GLIB)\gobject\gmarshal.h \
		$(GLIB)\gobject\gobject.def \
		$(GLIB)\gobject\gobject.rc \
!endif
		$(GLIB)\gobject\gobject.res \
!ifdef CVS
		$(GLIB)\gobject\gobjectalias.h \
		$(GLIB)\gobject\gobjectaliasdef.c \
!endif
		$(GLIB)\gobject\*.obj \
		$(GLIB)\gobject\*.pch \
		$(GLIB)\gthread\libgthread-2.0-0.dll \
		$(GLIB)\gthread\gthread-2.0.exp \
		$(GLIB)\gthread\gthread-2.0.lib \
!ifdef CVS
		$(GLIB)\gthread\gthread.rc \
!endif
		$(GLIB)\gthread\gthread.res \
		$(GLIB)\gthread\gthread-impl.obj \
		$(GLIB)\gthread\gthread-impl.pch \
		iwm\glib\gmessages.obj \
		iwm\glib\gmessages.pch
# GTK+
gtk_CLEANS= \
		$(GTK)\config.h \
!ifdef CVS
		$(GTK)\config.h.win32 \
!endif
		$(GTK)\gdk-pixbuf\libgdk_pixbuf-2.0-0.dll \
		$(GTK)\gdk-pixbuf\gdk_pixbuf-2.0.exp \
		$(GTK)\gdk-pixbuf\gdk_pixbuf-2.0.lib \
!ifdef CVS
		$(GTK)\gdk-pixbuf\gdk-pixbuf-csource.exe \
!endif
		$(GTK)\gdk-pixbuf\pixops\*.obj \
		$(GTK)\gdk-pixbuf\pixops\*.pch \
!ifdef CVS
		$(GTK)\gdk-pixbuf\gdk_pixbuf.def \
		$(GTK)\gdk-pixbuf\gdk_pixbuf.rc \
!endif
		$(GTK)\gdk-pixbuf\gdk_pixbuf.res \
		$(GTK)\gdk-pixbuf\gdk-pixbuf-aliasdef.c \
!ifdef CVS
		$(GTK)\gdk-pixbuf\gdk-pixbuf-alias.h \
		$(GTK)\gdk-pixbuf\gdk-pixbuf-enum-types.c \
		$(GTK)\gdk-pixbuf\gdk-pixbuf-enum-types.h \
		$(GTK)\gdk-pixbuf\gdk-pixbuf-features.h \
		$(GTK)\gdk-pixbuf\gdk-pixbuf-marshal.c \
		$(GTK)\gdk-pixbuf\gdk-pixbuf-marshal.h \
!endif
		$(GTK)\gdk-pixbuf\*.obj \
		$(GTK)\gdk-pixbuf\*.pch \
		$(GTK)\gdk\libgdk-win32-2.0-0.dll \
		$(GTK)\gdk\gdk-win32-2.0.exp \
		$(GTK)\gdk\gdk-win32-2.0.lib \
!ifdef CVS
		$(GTK)\gdk\win32\rc\gdk.rc \
!endif
		$(GTK)\gdk\win32\rc\gdk.res \
		$(GTK)\gdk\win32\*.obj \
		$(GTK)\gdk\win32\*.pch \
		$(GTK)\gdk\gdkaliasdef.c \
!ifdef CVS
		$(GTK)\gdk\gdk.def \
		$(GTK)\gdk\gdkalias.h \
		$(GTK)\gdk\gdkconfig.h \
		$(GTK)\gdk\gdkenumtypes.c \
		$(GTK)\gdk\gdkenumtypes.h \
		$(GTK)\gdk\gdkmarshalers.c \
		$(GTK)\gdk\gdkmarshalers.h \
		$(GTK)\gdk\gdkwin32.h \
!endif
		$(GTK)\gdk\*.obj \
		$(GTK)\gdk\*.pch \
		$(GTK)\gtk\libgtk-win32-2.0-0.dll \
		$(GTK)\gtk\gtk-win32-2.0.exp \
		$(GTK)\gtk\gtk-win32-2.0.lib \
!ifdef CVS
		$(GTK)\gtk\stock-icons\gtkstockpixbufs.h \
		$(GTK)\gtk\gtk.def \
		$(GTK)\gtk\gtkalias.h \
		$(GTK)\gtk\gtkmarshal.c \
		$(GTK)\gtk\gtkmarshal.h \
		$(GTK)\gtk\gtkmarshalers.c \
		$(GTK)\gtk\gtkmarshalers.h \
		$(GTK)\gtk\gtktypebuiltins.c \
		$(GTK)\gtk\gtktypebuiltins.h \
		$(GTK)\gtk\gtkversion.h \
!endif
		$(GTK)\gtk\*.obj \
		$(GTK)\gtk\*.pch
gtk_modules_CLEANS= \
		$(GTK)\modules\input\inputim-am-et.dll \
		$(GTK)\modules\input\inputim-am-et.exp \
		$(GTK)\modules\input\inputim-am-et.lib \
		$(GTK)\modules\input\inputim-cedilla.dll \
		$(GTK)\modules\input\inputim-cedilla.exp \
		$(GTK)\modules\input\inputim-cedilla.lib \
		$(GTK)\modules\input\inputim-cyrillic-translit.dll \
		$(GTK)\modules\input\inputim-cyrillic-translit.exp \
		$(GTK)\modules\input\inputim-cyrillic-translit.lib \
		$(GTK)\modules\input\inputim-ime.dll \
		$(GTK)\modules\input\inputim-ime.exp \
		$(GTK)\modules\input\inputim-ime.lib \
		$(GTK)\modules\input\inputim-inuktitut.dll \
		$(GTK)\modules\input\inputim-inuktitut.exp \
		$(GTK)\modules\input\inputim-inuktitut.lib \
		$(GTK)\modules\input\inputim-ipa.dll \
		$(GTK)\modules\input\inputim-ipa.exp \
		$(GTK)\modules\input\inputim-ipa.lib \
		$(GTK)\modules\input\inputim-thai-broken.dll \
		$(GTK)\modules\input\inputim-thai-broken.exp \
		$(GTK)\modules\input\inputim-thai-broken.lib \
		$(GTK)\modules\input\inputim-ti-er.dll \
		$(GTK)\modules\input\inputim-ti-er.exp \
		$(GTK)\modules\input\inputim-ti-er.lib \
		$(GTK)\modules\input\inputim-ti-et.dll \
		$(GTK)\modules\input\inputim-ti-et.exp \
		$(GTK)\modules\input\inputim-ti-et.lib \
		$(GTK)\modules\input\inputim-viqr.dll \
		$(GTK)\modules\input\inputim-viqr.exp \
		$(GTK)\modules\input\inputim-viqr.lib \
		$(GTK)\modules\input\*.obj \
		$(GTK)\modules\input\*.pch \
		$(GTK)\gtk\gtk-query-immodules-2.0.exe
# gettext
gettext_CLEANS= \
		$(GETTEXT)\gettext-runtime\intl\intl.dll \
		$(GETTEXT)\gettext-runtime\intl\intl.exp \
		$(GETTEXT)\gettext-runtime\intl\intl.lib \
		$(GETTEXT)\gettext-runtime\intl\libgnuintl.h \
		$(GETTEXT)\gettext-runtime\intl\*.obj \
		$(GETTEXT)\gettext-runtime\intl\*.pch \
		$(GETTEXT)\gettext-runtime\windows\intl.res \
		$(GETTEXT)\gettext-runtime\config.h \
		$(GETTEXT)\gettext-tools\src\msgfmt.exe \
		$(GETTEXT)\gettext-tools\lib\*.obj \
		$(GETTEXT)\gettext-tools\lib\*.pch \
		$(GETTEXT)\gettext-tools\src\*.obj \
		$(GETTEXT)\gettext-tools\src\*.pch \
		$(GETTEXT)\gettext-tools\config.h \
		$(GETTEXT)\gettext-tools\libintl.h
# JPEG
jpeg_CLEANS= \
		$(JPEG)\jpeg62.dll \
		$(JPEG)\libjpeg.exp \
		$(JPEG)\libjpeg.lib \
		$(JPEG)\jconfig.h \
		$(JPEG)\*.obj \
		$(JPEG)\*.pch
# libiconv
libiconv_CLEANS= \
		$(LIBICONV)\lib\iconv.dll \
		$(LIBICONV)\lib\iconv.exp \
		$(LIBICONV)\lib\iconv.lib \
		$(LIBICONV)\libcharset\include\localcharset.h \
		$(LIBICONV)\libcharset\config.h \
		$(LIBICONV)\windows\iconv.res \
		$(LIBICONV)\libcharset\lib\*.obj \
		$(LIBICONV)\libcharset\lib\*.pch \
		$(LIBICONV)\lib\*.obj \
		$(LIBICONV)\lib\*.pch
# libpng
libpng_CLEANS= \
		$(LIBPNG)\libpng13.dll \
		$(LIBPNG)\libpng13.exp \
		$(LIBPNG)\libpng13.lib \
		$(LIBPNG)\projects\msvc\png.res \
		$(LIBPNG)\*.obj \
		$(LIBPNG)\*.pch
# Pango
pango_CLEANS= \
		$(PANGO)\pango\libpango-1.0-0.dll \
		$(PANGO)\pango\pango-1.0.exp \
		$(PANGO)\pango\pango-1.0.lib \
		$(PANGO)\pango\pango.res \
!ifdef CVS
		$(PANGO)\pango\pangowin32.rc \
!endif
		$(PANGO)\pango\mini-fribidi\*.obj \
		$(PANGO)\pango\mini-fribidi\*.pch \
		$(PANGO)\pango\opentype\*.obj \
		$(PANGO)\pango\opentype\*.pch \
		$(PANGO)\pango\*.obj \
		$(PANGO)\pango\*.pch \
		$(PANGO)\pango\libpangowin32-1.0-0.dll \
		$(PANGO)\pango\pangowin32-1.0.exp \
		$(PANGO)\pango\pangowin32-1.0.lib \
		$(PANGO)\pango\pangowin32.res \
		$(PANGO)\pango\module-defs-win32.c \
!ifdef CVS
		$(PANGO)\pango\pango-enum-types.c \
		$(PANGO)\pango\pango-enum-types.h \
!endif
		$(PANGO)\pango\pango-querymodules.exe
pango_modules_CLEANS= \
		$(PANGO)\modules\basic\pango-basic-win32.dll \
		$(PANGO)\modules\basic\pango-basic-win32.exp \
		$(PANGO)\modules\basic\pango-basic-win32.lib \
		$(PANGO)\modules\basic\basic-win32.obj \
		$(PANGO)\modules\basic\basic-win32.pch
# TIFF
tiff_CLEANS= \
		$(TIFF)\libtiff\libtiff.dll \
		$(TIFF)\libtiff\libtiff.exp \
		$(TIFF)\libtiff\libtiff.lib \
		$(TIFF)\libtiff\tif_config.h \
		$(TIFF)\libtiff\tiffconf.h \
		$(TIFF)\libtiff\*.obj \
		$(TIFF)\libtiff\*.pch
# zlib
zlib_CLEANS= \
		$(ZLIB)\zlib1.dll \
		$(ZLIB)\zdll.exp \
		$(ZLIB)\zdll.lib \
		$(ZLIB)\zlib1.res \
		$(ZLIB)\*.obj \
		$(ZLIB)\*.pch

!ifdef CVS
clean: atk_clean cairo_clean glib_clean gtk_clean gettext_clean jpeg_clean libiconv_clean libpng_clean pango_clean tiff_clean zlib_clean
!else
clean: atk_clean glib_clean gtk_clean gettext_clean jpeg_clean libiconv_clean libpng_clean pango_clean tiff_clean zlib_clean
!endif

atk_clean:
	for %f in ($(atk_CLEANS)) do if exist %f del /q %f

cairo_clean:
	for %f in ($(cairo_CLEANS)) do if exist %f del /q %f

glib_clean:
	for %f in ($(glib_CLEANS)) do if exist %f del /q %f

gtk_clean:
	for %f in ($(gtk_CLEANS)) do if exist %f del /q %f
	for %f in ($(gtk_modules_CLEANS)) do if exist %f del /q %f

gettext_clean:
	for %f in ($(gettext_CLEANS)) do if exist %f del /q %f

jpeg_clean:
	for %f in ($(jpeg_CLEANS)) do if exist %f del /q %f

libiconv_clean:
	for %f in ($(libiconv_CLEANS)) do if exist %f del /q %f

libpng_clean:
	for %f in ($(libpng_CLEANS)) do if exist %f del /q %f

pango_clean:
	for %f in ($(pango_CLEANS)) do if exist %f del /q %f
	for %f in ($(pango_modules_CLEANS)) do if exist %f del /q %f

tiff_clean:
	for %f in ($(tiff_CLEANS)) do if exist %f del /q %f

zlib_clean:
	for %f in ($(zlib_CLEANS)) do if exist %f del /q %f


###############################################################################
#                                                                             #
# Distribute                                                                  #
#                                                                             #
###############################################################################
dist: all \
		gtk-$(VERSION).$(RELEASE)-bin.zip \
		gtk-$(VERSION).$(RELEASE)-dev.zip \
		gtk-$(VERSION).$(RELEASE)-src.zip

gtk-$(VERSION).$(RELEASE)-bin.zip:
	nmake install PREFIX=$*
	copy /y iwm\config\gtk.immodules $*\etc\gtk-2.0
	copy /y iwm\config\pango.modules $*\etc\pango
	del /q $*\bin\msgfmt.exe
	del /q $*\lib\*.lib
	rmdir /q /s $*\include
	zip -9 -r $@ $*
	rmdir /q /s $*

gtk-$(VERSION).$(RELEASE)-dev.zip:
	nmake install PREFIX=$*
	rmdir /q /s $*\lib\gtk-2.0
	rmdir /q /s $*\lib\locale
	rmdir /q /s $*\lib\pango
	rmdir /q /s $*\etc
	zip -9 $@ $*\bin\msgfmt.exe
	zip -9 -r $@ $*\doc
	zip -9 -r $@ $*\include
	zip -9 -r $@ $*\lib
	rmdir /q /s $*

gtk-$(VERSION).$(RELEASE)-src.zip:
	mkdir $*
	mkdir $*\iwm
	mkdir $*\iwm\config
	mkdir $*\iwm\glib
	mkdir $*\iwm\include
	copy /y atk-$(ATK_VERSION).tar.gz $*
!ifdef CVS
	copy /y cairo-0.4.0.tar.gz $*
!endif
	copy /y gettext-0.14.3.tar.gz $*
	copy /y glib-$(GLIB_VERSION).tar.gz $*
	copy /y "gtk+-$(GTK_VERSION).tar.gz" $*
	copy /y jpegsrc.v6b.tar.gz $*
	copy /y libiconv-1.9.2.tar.gz $*
!ifdef CVS
	copy /y libpixman-0.1.4.tar.gz $*
!endif
	copy /y libpng-1.2.8.tar.gz $*
	copy /y pango-$(PANGO_VERSION).tar.gz $*
	copy /y tiff-3.7.2.tar.gz $*
	copy /y zlib-1.2.2.tar.gz $*
	copy /y autogen.bat $*
	copy /y makefile $*
	copy /y mkdef.pl $*
	copy /y README $*
	copy /y replace.pl $*
	copy /y iwm\config\gtk.immodules $*\iwm\config
	copy /y iwm\config\pango.aliases $*\iwm\config
	copy /y iwm\config\pango.modules $*\iwm\config
	copy /y iwm\glib\gatomic.c $*\iwm\glib
	copy /y iwm\glib\gmessages.c $*\iwm\glib
	copy /y iwm\include\stdint.h $*\iwm\include
	zip -9 -r $@ $*
	rmdir /q /s $*
