#copyright (c) 2004-2007 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 SVN
ATK_MAJOR_VERSION=1
ATK_MINOR_VERSION=13
ATK_MICRO_VERSION=2
!else
ATK_MAJOR_VERSION=1
ATK_MINOR_VERSION=12
ATK_MICRO_VERSION=4
!endif
ATK_VERSION=$(ATK_MAJOR_VERSION).$(ATK_MINOR_VERSION).$(ATK_MICRO_VERSION)

!ifdef SVN
CAIRO_MAJOR_VERSION=1
CAIRO_MINOR_VERSION=3
CAIRO_MICRO_VERSION=12
!else
CAIRO_MAJOR_VERSION=1
CAIRO_MINOR_VERSION=2
CAIRO_MICRO_VERSION=6
!endif
CAIRO_VERSION=$(CAIRO_MAJOR_VERSION).$(CAIRO_MINOR_VERSION).$(CAIRO_MICRO_VERSION)

!ifdef SVN
GLIB_MAJOR_VERSION=2
GLIB_MINOR_VERSION=13
GLIB_MICRO_VERSION=0
GLIB_BINARY_AGE=1300
!else
GLIB_MAJOR_VERSION=2
GLIB_MINOR_VERSION=12
GLIB_MICRO_VERSION=9
GLIB_BINARY_AGE=1209
!endif
GLIB_VERSION=$(GLIB_MAJOR_VERSION).$(GLIB_MINOR_VERSION).$(GLIB_MICRO_VERSION)

!ifdef SVN
GTK_MAJOR_VERSION=2
GTK_MINOR_VERSION=11
GTK_MICRO_VERSION=0
GTK_BINARY_AGE=1100
!else
GTK_MAJOR_VERSION=2
GTK_MINOR_VERSION=10
GTK_MICRO_VERSION=9
GTK_BINARY_AGE=1009
!endif
GTK_VERSION=$(GTK_MAJOR_VERSION).$(GTK_MINOR_VERSION).$(GTK_MICRO_VERSION)

!ifdef SVN
PANGO_MAJOR_VERSION=1
PANGO_MINOR_VERSION=15
PANGO_MICRO_VERSION=5
PANGO_BINARY_AGE=1505
!else
PANGO_MAJOR_VERSION=1
PANGO_MINOR_VERSION=14
PANGO_MICRO_VERSION=10
!endif
PANGO_VERSION=$(PANGO_MAJOR_VERSION).$(PANGO_MINOR_VERSION).$(PANGO_MICRO_VERSION)

#Folders
!ifdef SVN
ATK=atk
!else
ATK=atk-$(ATK_VERSION)
!endif
CAIRO=cairo-$(CAIRO_VERSION)
EXPAT=expat-2.0.0
FONTCONFIG=fontconfig-2.4.2
FREETYPE=freetype-2.3.1
GETTEXT=gettext-0.16.1
!ifdef SVN
GLIB=glib
GTK=gtk
!else
GLIB=glib-$(GLIB_VERSION)
GTK=gtk-$(GTK_VERSION)
!endif
JPEG=jpeg-6b
LIBICONV=libiconv-1.11
LIBPNG=libpng-1.2.16
!ifdef SVN
PANGO=pango
!else
PANGO=pango-$(PANGO_VERSION)
!endif
TIFF=tiff-3.8.2
ZLIB=zlib-1.2.3

VERSION=$(GTK_VERSION)
RELEASE=0

!ifndef LINK
LINK=link
!endif
!ifndef MT
MT=mt
!endif
!ifndef PERL
PERL=perl
!endif

CLFLAGS=/c /D_MBCS /DNDEBUG /DWIN32 /D_WINDOWS /D_WIN32_WINNT=0x0500 /DWINVER=0x0500 /D_CRT_SECURE_NO_DEPRECATE /Fo$@ /MD /nologo /O2 /w /Zm400
LNFLAGS=/INCREMENTAL:NO /MACHINE:IX86 /NOLOGO /OUT:$@ /RELEASE
RCFLAGS=/c1252 /d_MBCS /dNDEBUG /dWIN32 /d_WINDOWS /d_WIN32_WINNT=0x0500 /dWINVER=0x0500 /fo$@ /l0


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

###############################################################################
# IWM                                                                         #
###############################################################################
iwm: \
	iwm\iwm-forwarding-win32.exe \
	iwm\iwm-makedef-win32.exe \
	iwm\iwm-replace-win32.exe \
	iwm\pango-makealiases-win32.exe \
	iwm\libiconv2.dll \
	iwm\libintl3.dll \
	iwm\libtiff3.dll

# iwm-forwarding-win32
iwm\iwm-forwarding-win32.exe: $*.obj
	$(LINK) $(LNFLAGS) shlwapi.lib $**
	if exist $@.manifest $(MT) -manifest $@.manifest -outputresource:$@;#1

iwm\iwm-forwarding-win32.obj: $*.c
	$(CC) $(CLFLAGS) $**

# iwm-makedef-win32
iwm\iwm-makedef-win32.exe: $*.obj
	$(LINK) $(LNFLAGS) gdi32.lib user32.lib $**
	if exist $@.manifest $(MT) -manifest $@.manifest -outputresource:$@;#1

iwm\iwm-makedef-win32.obj: $*.c
	$(CC) $(CLFLAGS) $**

# iwm-replace-win32
iwm\iwm-replace-win32.exe: $*.obj
	$(LINK) $(LNFLAGS) $**
	if exist $@.manifest $(MT) -manifest $@.manifest -outputresource:$@;#1

iwm\iwm-replace-win32.obj: $*.c
	$(CC) $(CLFLAGS) $**

# pango-makealiases-win32
iwm\pango-makealiases-win32.exe: $*.obj
	$(LINK) $(LNFLAGS) gdi32.lib user32.lib $**
	if exist $@.manifest $(MT) -manifest $@.manifest -outputresource:$@;#1

iwm\pango-makealiases-win32.obj: $*.c
	$(CC) $(CLFLAGS) $**

# libiconv2
iwm\libiconv2.dll: $*.def
	$(LINK) $(LNFLAGS) /DLL /DEF:$*.def /NOENTRY

iwm\libiconv2.def: $(LIBICONV)\lib\iconv.dll
	iwm\iwm-forwarding-win32.exe $** > $@

# libintl3
iwm\libintl3.dll: $*.def
	$(LINK) $(LNFLAGS) /DLL /DEF:$*.def /NOENTRY

iwm\libintl3.def: $(GETTEXT)\gettext-runtime\intl\intl.dll
	iwm\iwm-forwarding-win32.exe $** > $@

# libtiff3
iwm\libtiff3.dll: $*.def
	$(LINK) $(LNFLAGS) /DLL /DEF:$*.def /NOENTRY

iwm\libtiff3.def: $(TIFF)\libtiff\libtiff.dll
	iwm\iwm-forwarding-win32.exe $** > $@

###############################################################################
# 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

$(ATK)\atk\libatk-1.0-0.dll: $(atk_OBJECTS) $(ATK)\atk\atk.res
	$(LINK) $(LNFLAGS) /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 $**
	if exist $@.manifest $(MT) -manifest $@.manifest -outputresource:$@;#2

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

$(ATK)\atk\atk.rc: $@.in
	iwm\iwm-replace-win32.exe @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 < $** > $@

$(atk_OBJECTS): $(ATK)\config.h $(ATK)\atk\atkmarshal.c $(ATK)\atk\atkmarshal.h $(ATK)\atk\atk-enum-types.h
	$(CC) $(CLFLAGS) /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\atkhyperlinkimpl.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

!ifdef SVN
$(ATK)\atk\atk-enum-types.c: $(atk_headers)
	$(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)\atk\atk-enum-types.h: $(atk_headers)
	$(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__ */" \
		$** > $@
!endif

$(ATK)\atk\atkmarshal.c: $*.list
	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 $** --body > $@
	del libglib-2.0-0.dll
	del intl.dll
	del iconv.dll

$(ATK)\atk\atkmarshal.h: $*.list
	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 $** --header > $@
	del libglib-2.0-0.dll
	del intl.dll
	del iconv.dll

###############################################################################
# cairo                                                                       #
###############################################################################
cairo: fontconfig $(CAIRO)\src\libcairo-2.dll

cairo_OBJECTS= \
		$(CAIRO)\src\cairo.obj \
		$(CAIRO)\src\cairo-analysis-surface.obj \
		$(CAIRO)\src\cairo-arc.obj \
		$(CAIRO)\src\cairo-array.obj \
!ifdef SVN
		$(CAIRO)\src\cairo-bentley-ottmann.obj \
!endif
		$(CAIRO)\src\cairo-cache.obj \
!ifdef SVN
		$(CAIRO)\src\cairo-cff-subset.obj \
!endif
		$(CAIRO)\src\cairo-clip.obj \
		$(CAIRO)\src\cairo-color.obj \
		$(CAIRO)\src\cairo-debug.obj \
!ifdef SVN
		$(CAIRO)\src\cairo-deflate-stream.obj \
!endif
		$(CAIRO)\src\cairo-fixed.obj \
		$(CAIRO)\src\cairo-font.obj \
		$(CAIRO)\src\cairo-font-options.obj \
!ifdef SVN
		$(CAIRO)\src\cairo-freelist.obj \
!endif
		$(CAIRO)\src\cairo-ft-font.obj \
		$(CAIRO)\src\cairo-gstate.obj \
		$(CAIRO)\src\cairo-hash.obj \
		$(CAIRO)\src\cairo-hull.obj \
		$(CAIRO)\src\cairo-image-surface.obj \
		$(CAIRO)\src\cairo-matrix.obj \
		$(CAIRO)\src\cairo-meta-surface.obj \
		$(CAIRO)\src\cairo-output-stream.obj \
		$(CAIRO)\src\cairo-paginated-surface.obj \
		$(CAIRO)\src\cairo-path.obj \
		$(CAIRO)\src\cairo-path-bounds.obj \
!ifndef SVN
		$(CAIRO)\src\cairo-path-data.obj \
!endif
		$(CAIRO)\src\cairo-path-fill.obj \
!ifdef SVN
		$(CAIRO)\src\cairo-path-fixed.obj \
!endif
		$(CAIRO)\src\cairo-path-stroke.obj \
		$(CAIRO)\src\cairo-pattern.obj \
		$(CAIRO)\src\cairo-pdf-surface.obj \
		$(CAIRO)\src\cairo-pen.obj \
		$(CAIRO)\src\cairo-png.obj \
		$(CAIRO)\src\cairo-polygon.obj \
		$(CAIRO)\src\cairo-rectangle.obj \
		$(CAIRO)\src\cairo-region.obj \
		$(CAIRO)\src\cairo-scaled-font.obj \
		$(CAIRO)\src\cairo-scaled-font-subsets.obj \
!ifdef SVN
		$(CAIRO)\src\cairo-skiplist.obj \
!endif
		$(CAIRO)\src\cairo-slope.obj \
		$(CAIRO)\src\cairo-spline.obj \
		$(CAIRO)\src\cairo-stroke-style.obj \
		$(CAIRO)\src\cairo-surface.obj \
		$(CAIRO)\src\cairo-surface-fallback.obj \
		$(CAIRO)\src\cairo-traps.obj \
		$(CAIRO)\src\cairo-truetype-subset.obj \
!ifdef SVN
		$(CAIRO)\src\cairo-type1-fallback.obj \
!endif
		$(CAIRO)\src\cairo-type1-subset.obj \
		$(CAIRO)\src\cairo-unicode.obj \
		$(CAIRO)\src\cairo-wideint.obj \
		$(CAIRO)\src\cairo-win32-font.obj \
		$(CAIRO)\src\cairo-win32-surface.obj

libpixman_OBJECTS= \
		$(CAIRO)\pixman\src\fbcompose.obj \
		$(CAIRO)\pixman\src\fbedge.obj \
#		$(CAIRO)\pixman\src\fbmmx.obj \
		$(CAIRO)\pixman\src\fbpict.obj \
		$(CAIRO)\pixman\src\fbtrap.obj \
		$(CAIRO)\pixman\src\icblt.obj \
		$(CAIRO)\pixman\src\icbltone.obj \
		$(CAIRO)\pixman\src\iccolor.obj \
		$(CAIRO)\pixman\src\icformat.obj \
		$(CAIRO)\pixman\src\icimage.obj \
		$(CAIRO)\pixman\src\icpixels.obj \
		$(CAIRO)\pixman\src\icrect.obj \
		$(CAIRO)\pixman\src\icstipple.obj \
		$(CAIRO)\pixman\src\ictransform.obj \
		$(CAIRO)\pixman\src\ictrap.obj \
		$(CAIRO)\pixman\src\ictri.obj \
		$(CAIRO)\pixman\src\icutil.obj \
		$(CAIRO)\pixman\src\pixregion.obj \
		$(CAIRO)\pixman\src\renderedge.obj

$(CAIRO)\src\libcairo-2.dll: $(cairo_OBJECTS) $(libpixman_OBJECTS) $(CAIRO)\src\cairo.def
	$(LINK) $(LNFLAGS) /DLL /DEF:$(CAIRO)\src\cairo.def /IMPLIB:$(CAIRO)\src\cairo.lib $(FONTCONFIG)\src\fontconfig.lib $(FREETYPE)\src\freetype.lib $(LIBPNG)\libpng13.lib $(ZLIB)\zdll.lib gdi32.lib msimg32.lib user32.lib $(cairo_OBJECTS) $(libpixman_OBJECTS)
	if exist $@.manifest $(MT) -manifest $@.manifest -outputresource:$@;#2

$(CAIRO)\src\cairo.def: $(cairo_OBJECTS)
	iwm\iwm-makedef-win32.exe $** > $@
	echo LIBRARY libcairo-2.dll >> $@

$(cairo_OBJECTS): $(CAIRO)\src\cairo-features.h~
	$(CC) $(CLFLAGS) /Dinline=__inline /Dsnprintf=_snprintf /DPACKAGE_BUGREPORT=\"http://bugs.freedesktop.org/enter_bug.cgi?product=cairo\" /DPACKAGE_VERSION=\"$(CAIRO_VERSION)\" /I$(CAIRO)\src /I$(CAIRO)\pixman\src /I$(FONTCONFIG) /I$(FREETYPE)\include /I$(LIBPNG) /I$(ZLIB) /Iiwm\fontconfig $*.c

$(libpixman_OBJECTS):
	$(CC) $(CLFLAGS) /I$(CAIRO)\pixman\src $*.c

$(CAIRO)\src\cairo-features.h~:
	if not exist $@ move /y $(CAIRO)\src\cairo-features.h $@
	echo #ifndef CAIRO_FEATURES_H > $(CAIRO)\src\cairo-features.h
	echo #define CAIRO_FEATURES_H >> $(CAIRO)\src\cairo-features.h
	echo. >> $(CAIRO)\src\cairo-features.h
	echo #ifdef  __cplusplus >> $(CAIRO)\src\cairo-features.h
	echo # define CAIRO_BEGIN_DECLS  extern "C" { >> $(CAIRO)\src\cairo-features.h
	echo # define CAIRO_END_DECLS    } >> $(CAIRO)\src\cairo-features.h
	echo #else >> $(CAIRO)\src\cairo-features.h
	echo # define CAIRO_BEGIN_DECLS >> $(CAIRO)\src\cairo-features.h
	echo # define CAIRO_END_DECLS >> $(CAIRO)\src\cairo-features.h
	echo #endif >> $(CAIRO)\src\cairo-features.h
	echo. >> $(CAIRO)\src\cairo-features.h
	echo #ifndef cairo_public >> $(CAIRO)\src\cairo-features.h
	echo # define cairo_public >> $(CAIRO)\src\cairo-features.h
	echo #endif >> $(CAIRO)\src\cairo-features.h
	echo. >> $(CAIRO)\src\cairo-features.h
	echo #define CAIRO_VERSION_MAJOR $(CAIRO_MAJOR_VERSION) >> $(CAIRO)\src\cairo-features.h
	echo #define CAIRO_VERSION_MINOR $(CAIRO_MINOR_VERSION) >> $(CAIRO)\src\cairo-features.h
	echo #define CAIRO_VERSION_MICRO $(CAIRO_MICRO_VERSION) >> $(CAIRO)\src\cairo-features.h
	echo #define CAIRO_VERSION_STRING "$(CAIRO_VERSION)" >> $(CAIRO)\src\cairo-features.h
	echo. >> $(CAIRO)\src\cairo-features.h
	echo #define CAIRO_HAS_PDF_SURFACE 1 >> $(CAIRO)\src\cairo-features.h
	echo #define CAIRO_HAS_FT_FONT 1 >> $(CAIRO)\src\cairo-features.h
	echo #define CAIRO_HAS_WIN32_SURFACE 1 >> $(CAIRO)\src\cairo-features.h
	echo #define CAIRO_HAS_WIN32_FONT 1 >> $(CAIRO)\src\cairo-features.h
	echo #define CAIRO_HAS_PNG_FUNCTIONS 1 >> $(CAIRO)\src\cairo-features.h
	echo. >> $(CAIRO)\src\cairo-features.h
	echo #endif >> $(CAIRO)\src\cairo-features.h

###############################################################################
# Expat                                                                       #
###############################################################################
expat: $(EXPAT)\lib\libexpat.dll

expat_OBJECTS= \
		$(EXPAT)\lib\xmlparse.obj \
		$(EXPAT)\lib\xmlrole.obj \
		$(EXPAT)\lib\xmltok.obj

$(EXPAT)\lib\libexpat.dll: $(expat_OBJECTS)
	$(LINK) $(LNFLAGS) /DLL /DEF:$(EXPAT)\lib\libexpat.def $**
	if exist $@.manifest $(MT) -manifest $@.manifest -outputresource:$@;#2

$(expat_OBJECTS):
	$(CC) $(CLFLAGS) /DCOMPILED_FROM_DSP /DEXPAT_EXPORTS $*.c

###############################################################################
# fontconfig                                                                  #
###############################################################################
fontconfig: expat freetype $(FONTCONFIG)\src\libfontconfig-1.dll

fontconfig_OBJECTS= \
		$(FONTCONFIG)\src\fcatomic.obj \
		$(FONTCONFIG)\src\fcblanks.obj \
		$(FONTCONFIG)\src\fccache.obj \
		$(FONTCONFIG)\src\fccfg.obj \
		$(FONTCONFIG)\src\fccharset.obj \
		$(FONTCONFIG)\src\fcdbg.obj \
		$(FONTCONFIG)\src\fcdefault.obj \
		$(FONTCONFIG)\src\fcdir.obj \
		$(FONTCONFIG)\src\fcfreetype.obj \
		$(FONTCONFIG)\src\fcfs.obj \
		$(FONTCONFIG)\src\fcinit.obj \
		$(FONTCONFIG)\src\fclang.obj \
		$(FONTCONFIG)\src\fclist.obj \
		$(FONTCONFIG)\src\fcmatch.obj \
		$(FONTCONFIG)\src\fcmatrix.obj \
		$(FONTCONFIG)\src\fcname.obj \
		$(FONTCONFIG)\src\fcpat.obj \
		$(FONTCONFIG)\src\fcserialize.obj \
		$(FONTCONFIG)\src\fcstr.obj \
		$(FONTCONFIG)\src\fcxml.obj \
		$(FONTCONFIG)\src\ftglue.obj

$(FONTCONFIG)\src\libfontconfig-1.dll: $(fontconfig_OBJECTS) $(FONTCONFIG)\src\fontconfig.def iwm\dirent\dirent.obj
	$(LINK) $(LNFLAGS) /DLL /DEF:$(FONTCONFIG)\src\fontconfig.def /IMPLIB:$(FONTCONFIG)\src\fontconfig.lib kernel32.lib $(EXPAT)\lib\libexpat.lib $(FREETYPE)\src\freetype.lib $(fontconfig_OBJECTS) iwm\dirent\dirent.obj
	if exist $@.manifest $(MT) -manifest $@.manifest -outputresource:$@;#2

$(FONTCONFIG)\src\fontconfig.def: $(fontconfig_OBJECTS)
	iwm\iwm-makedef-win32.exe $** > $@
	echo LIBRARY libfontconfig-1.dll >> $@
	echo VERSION 1.4 >> $@

$(fontconfig_OBJECTS): iwm\fontconfig\fcaliastail.h iwm\fontconfig\inttypes.h
	$(CC) $(CLFLAGS) /DDLL_EXPORT /DFC_CACHEDIR=\".\" /DFC_DEFAULT_FONTS=\".\" /DFONTCONFIG_PATH /DHAVE_FT_GET_BDF_PROPERTY /DHAVE_FT_GET_NEXT_CHAR /DHAVE_FT_GET_PS_FONT_INFO /DHAVE_INTTYPES_H /DHAVE_RAND /I$(FONTCONFIG) /I$(FONTCONFIG)\src /I$(EXPAT)\lib /I$(FREETYPE)\include /Iiwm\dirent /Iiwm\fontconfig $*.c

iwm\fontconfig\fcaliastail.h:
	echo. > $@

iwm\fontconfig\inttypes.h:
	echo #ifndef __INTTYPES_H__ > $@
	echo #define __INTTYPES_H__ >> $@
	echo typedef int intptr_t; >> $@
	echo typedef unsigned uintptr_t; >> $@
	echo #endif /* __INTTYPES_H__ */ >> $@

###############################################################################
# FreeType                                                                    #
###############################################################################
freetype: $(FREETYPE)\src\freetype6.dll

freetype_OBJECTS= \
		$(FREETYPE)\src\autofit\afangles.obj \
#		$(FREETYPE)\src\autofit\afcjk.obj \
#		$(FREETYPE)\src\autofit\afdummy.obj \
		$(FREETYPE)\src\autofit\afglobal.obj \
#		$(FREETYPE)\src\autofit\afhints.obj \
#		$(FREETYPE)\src\autofit\aflatin.obj \
##		$(FREETYPE)\src\autofit\afloader.obj \
#		$(FREETYPE)\src\autofit\afmodule.obj \
		$(FREETYPE)\src\autofit\afwarp.obj \
		$(FREETYPE)\src\autofit\autofit.obj \
		$(FREETYPE)\src\base\ftapi.obj \
		$(FREETYPE)\src\base\ftbase.obj \
		$(FREETYPE)\src\base\ftbbox.obj \
		$(FREETYPE)\src\base\ftbdf.obj \
		$(FREETYPE)\src\base\ftbitmap.obj \
#		$(FREETYPE)\src\base\ftcalc.obj \
#		$(FREETYPE)\src\base\ftdbgmem.obj \
		$(FREETYPE)\src\base\ftdebug.obj \
#		$(FREETYPE)\src\base\ftgloadr.obj \
		$(FREETYPE)\src\base\ftglyph.obj \
		$(FREETYPE)\src\base\ftgxval.obj \
		$(FREETYPE)\src\base\ftinit.obj \
#		$(FREETYPE)\src\base\ftmac.obj \
		$(FREETYPE)\src\base\ftmm.obj \
#		$(FREETYPE)\src\base\ftnames.obj \
#		$(FREETYPE)\src\base\ftobjs.obj \
		$(FREETYPE)\src\base\ftotval.obj \
#		$(FREETYPE)\src\base\ftoutln.obj \
		$(FREETYPE)\src\base\ftpfr.obj \
#		$(FREETYPE)\src\base\ftrfork.obj \
#		$(FREETYPE)\src\base\ftstream.obj \
		$(FREETYPE)\src\base\ftstroke.obj \
		$(FREETYPE)\src\base\ftsynth.obj \
		$(FREETYPE)\src\base\ftsystem.obj \
#		$(FREETYPE)\src\base\fttrigon.obj \
		$(FREETYPE)\src\base\fttype1.obj \
#		$(FREETYPE)\src\base\ftutil.obj \
		$(FREETYPE)\src\base\ftwinfnt.obj \
		$(FREETYPE)\src\base\ftxf86.obj \
		$(FREETYPE)\src\bdf\bdf.obj \
#		$(FREETYPE)\src\bdf\bdfdrivr.obj \
		$(FREETYPE)\src\bdf\bdflib.obj \
		$(FREETYPE)\src\cache\ftcache.obj \
#		$(FREETYPE)\src\cache\ftcbasic.obj \
#		$(FREETYPE)\src\cache\ftccache.obj \
#		$(FREETYPE)\src\cache\ftccmap.obj \
#		$(FREETYPE)\src\cache\ftcglyph.obj \
#		$(FREETYPE)\src\cache\ftcimage.obj \
#		$(FREETYPE)\src\cache\ftcmanag.obj \
#		$(FREETYPE)\src\cache\ftcmru.obj \
#		$(FREETYPE)\src\cache\ftcsbits.obj \
		$(FREETYPE)\src\cff\cff.obj \
#		$(FREETYPE)\src\cff\cffcmap.obj \
#		$(FREETYPE)\src\cff\cffdrivr.obj \
		$(FREETYPE)\src\cff\cffgload.obj \
		$(FREETYPE)\src\cff\cffload.obj \
		$(FREETYPE)\src\cff\cffobjs.obj \
		$(FREETYPE)\src\cff\cffparse.obj \
		$(FREETYPE)\src\cid\cidgload.obj \
		$(FREETYPE)\src\cid\cidload.obj \
		$(FREETYPE)\src\cid\cidobjs.obj \
		$(FREETYPE)\src\cid\cidparse.obj \
#		$(FREETYPE)\src\cid\cidriver.obj \
		$(FREETYPE)\src\cid\type1cid.obj \
		$(FREETYPE)\src\gxvalid\gxvalid.obj \
		$(FREETYPE)\src\gxvalid\gxvbsln.obj \
		$(FREETYPE)\src\gxvalid\gxvcommn.obj \
		$(FREETYPE)\src\gxvalid\gxvfeat.obj \
#		$(FREETYPE)\src\gxvalid\gxvfgen.obj \
		$(FREETYPE)\src\gxvalid\gxvjust.obj \
		$(FREETYPE)\src\gxvalid\gxvkern.obj \
		$(FREETYPE)\src\gxvalid\gxvlcar.obj \
#		$(FREETYPE)\src\gxvalid\gxvmod.obj \
		$(FREETYPE)\src\gxvalid\gxvmort.obj \
		$(FREETYPE)\src\gxvalid\gxvmort0.obj \
		$(FREETYPE)\src\gxvalid\gxvmort1.obj \
		$(FREETYPE)\src\gxvalid\gxvmort2.obj \
		$(FREETYPE)\src\gxvalid\gxvmort4.obj \
		$(FREETYPE)\src\gxvalid\gxvmort5.obj \
		$(FREETYPE)\src\gxvalid\gxvmorx.obj \
		$(FREETYPE)\src\gxvalid\gxvmorx0.obj \
		$(FREETYPE)\src\gxvalid\gxvmorx1.obj \
		$(FREETYPE)\src\gxvalid\gxvmorx2.obj \
		$(FREETYPE)\src\gxvalid\gxvmorx4.obj \
		$(FREETYPE)\src\gxvalid\gxvmorx5.obj \
		$(FREETYPE)\src\gxvalid\gxvopbd.obj \
		$(FREETYPE)\src\gxvalid\gxvprop.obj \
		$(FREETYPE)\src\gxvalid\gxvtrak.obj \
#		$(FREETYPE)\src\gzip\adler32.obj \
		$(FREETYPE)\src\gzip\ftgzip.obj \
#		$(FREETYPE)\src\gzip\infblock.obj \
#		$(FREETYPE)\src\gzip\infcodes.obj \
#		$(FREETYPE)\src\gzip\inflate.obj \
#		$(FREETYPE)\src\gzip\inftrees.obj \
#		$(FREETYPE)\src\gzip\infutil.obj \
#		$(FREETYPE)\src\gzip\zutil.obj \
		$(FREETYPE)\src\lzw\ftlzw.obj \
#		$(FREETYPE)\src\lzw\ftzopen.obj \
		$(FREETYPE)\src\otvalid\otvalid.obj \
		$(FREETYPE)\src\otvalid\otvbase.obj \
		$(FREETYPE)\src\otvalid\otvcommn.obj \
		$(FREETYPE)\src\otvalid\otvgdef.obj \
		$(FREETYPE)\src\otvalid\otvgpos.obj \
		$(FREETYPE)\src\otvalid\otvgsub.obj \
		$(FREETYPE)\src\otvalid\otvjstf.obj \
#		$(FREETYPE)\src\otvalid\otvmod.obj \
		$(FREETYPE)\src\pcf\pcf.obj \
#		$(FREETYPE)\src\pcf\pcfdrivr.obj \
		$(FREETYPE)\src\pcf\pcfread.obj \
		$(FREETYPE)\src\pcf\pcfutil.obj \
		$(FREETYPE)\src\pfr\pfr.obj \
#		$(FREETYPE)\src\pfr\pfrcmap.obj \
#		$(FREETYPE)\src\pfr\pfrdrivr.obj \
		$(FREETYPE)\src\pfr\pfrgload.obj \
		$(FREETYPE)\src\pfr\pfrload.obj \
		$(FREETYPE)\src\pfr\pfrobjs.obj \
		$(FREETYPE)\src\pfr\pfrsbit.obj \
		$(FREETYPE)\src\psaux\afmparse.obj \
		$(FREETYPE)\src\psaux\psaux.obj \
#		$(FREETYPE)\src\psaux\psauxmod.obj \
		$(FREETYPE)\src\psaux\psconv.obj \
		$(FREETYPE)\src\psaux\psobjs.obj \
#		$(FREETYPE)\src\psaux\t1cmap.obj \
		$(FREETYPE)\src\psaux\t1decode.obj \
#		$(FREETYPE)\src\pshinter\pshalgo.obj \
		$(FREETYPE)\src\pshinter\pshglob.obj \
		$(FREETYPE)\src\pshinter\pshinter.obj \
#		$(FREETYPE)\src\pshinter\pshmod.obj \
		$(FREETYPE)\src\pshinter\pshrec.obj \
#		$(FREETYPE)\src\psnames\psmodule.obj \
		$(FREETYPE)\src\psnames\psnames.obj \
#		$(FREETYPE)\src\raster\ftraster.obj \
#		$(FREETYPE)\src\raster\ftrend1.obj \
		$(FREETYPE)\src\raster\raster.obj \
#		$(FREETYPE)\src\sfnt\sfdriver.obj \
		$(FREETYPE)\src\sfnt\sfnt.obj \
#		$(FREETYPE)\src\sfnt\sfobjs.obj \
		$(FREETYPE)\src\sfnt\ttbdf.obj \
#		$(FREETYPE)\src\sfnt\ttcmap.obj \
		$(FREETYPE)\src\sfnt\ttkern.obj \
		$(FREETYPE)\src\sfnt\ttload.obj \
		$(FREETYPE)\src\sfnt\ttmtx.obj \
		$(FREETYPE)\src\sfnt\ttpost.obj \
		$(FREETYPE)\src\sfnt\ttsbit.obj \
#		$(FREETYPE)\src\sfnt\ttsbit0.obj \
#		$(FREETYPE)\src\smooth\ftgrays.obj \
#		$(FREETYPE)\src\smooth\ftsmooth.obj \
		$(FREETYPE)\src\smooth\smooth.obj \
#		$(FREETYPE)\src\tools\apinames.obj \
#		$(FREETYPE)\src\tools\test_afm.obj \
#		$(FREETYPE)\src\tools\test_bbox.obj \
#		$(FREETYPE)\src\tools\test_trig.obj \
		$(FREETYPE)\src\truetype\truetype.obj \
#		$(FREETYPE)\src\truetype\ttdriver.obj \
#		$(FREETYPE)\src\truetype\ttgload.obj \
		$(FREETYPE)\src\truetype\ttgxvar.obj \
#		$(FREETYPE)\src\truetype\ttinterp.obj \
#		$(FREETYPE)\src\truetype\ttobjs.obj \
		$(FREETYPE)\src\truetype\ttpload.obj \
		$(FREETYPE)\src\type1\t1afm.obj \
#		$(FREETYPE)\src\type1\t1driver.obj \
		$(FREETYPE)\src\type1\t1gload.obj \
		$(FREETYPE)\src\type1\t1load.obj \
		$(FREETYPE)\src\type1\t1objs.obj \
		$(FREETYPE)\src\type1\t1parse.obj \
		$(FREETYPE)\src\type1\type1.obj \
#		$(FREETYPE)\src\type42\t42drivr.obj \
		$(FREETYPE)\src\type42\t42objs.obj \
		$(FREETYPE)\src\type42\t42parse.obj \
		$(FREETYPE)\src\type42\type42.obj \
		$(FREETYPE)\src\winfonts\winfnt.obj

$(FREETYPE)\src\freetype6.dll: $(freetype_OBJECTS) $(FREETYPE)\src\freetype.def
	$(LINK) $(LNFLAGS) /DLL /DEF:$(FREETYPE)\src\freetype.def /IMPLIB:$(FREETYPE)\src\freetype.lib $(freetype_OBJECTS)
	if exist $@.manifest $(MT) -manifest $@.manifest -outputresource:$@;#2

$(FREETYPE)\src\freetype.def: $(freetype_OBJECTS)
	iwm\iwm-makedef-win32.exe $** > $@

$(freetype_OBJECTS):
	$(CC) $(CLFLAGS) /D_LIB /DFT_FLAT_COMPILE /DFT2_BUILD_LIBRARY /DTT_CONFIG_OPTION_BYTECODE_INTERPRETER /I$(FREETYPE)\include $*.c

###############################################################################
# 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\hash-string.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 \
#MODIFY	$(GETTEXT)\gettext-runtime\intl\dcigettext.obj \
		iwm\gettext\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\lock.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\version.obj \
		$(GETTEXT)\gettext-runtime\intl\osdep.obj \
#		$(GETTEXT)\gettext-runtime\intl\os2compat.obj \
#		$(GETTEXT)\gettext-runtime\intl\intl-exports.obj \
		$(GETTEXT)\gettext-runtime\intl\intl-compat.obj

$(GETTEXT)\gettext-runtime\intl\intl.dll: $(intl_OBJECTS)
	$(LINK) $(LNFLAGS) /DLL $(LIBICONV)\lib\iconv.lib $**
	if exist $@.manifest $(MT) -manifest $@.manifest -outputresource:$@;#2

$(intl_OBJECTS): $(GETTEXT)\gettext-runtime\config.h $(GETTEXT)\gettext-runtime\intl\libgnuintl.h iwm\gettext\configmake.h
	$(CC) $(CLFLAGS) /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\intl /I$(GETTEXT)\gettext-runtime /I$(LIBICONV)\include /Iiwm\gettext $*.c

$(GETTEXT)\gettext-runtime\config.h:
	echo #ifndef __cplusplus > $@
	echo # define inline __inline >> $@
	echo #endif /* not __cplusplus */ >> $@
	echo #define HAVE_ALLOCA 1 >> $@
	echo #define HAVE_GETCWD 1 >> $@
	echo #define SIZE_MAX 4294967295U >> $@
	echo #define USE_WIN32_THREADS 1 >> $@
	echo #define nls_uint32 unsigned int >> $@
	echo #define uintmax_t unsigned long >> $@
	echo #define __libc_lock_define_initialized gl_lock_define_initialized >> $@
	echo #define __libc_lock_define_initialized_recursive gl_recursive_lock_define_initialized >> $@
	echo #define __libc_lock_lock gl_lock_lock >> $@
	echo #define __libc_lock_lock_recursive gl_recursive_lock_lock >> $@
	echo #define __libc_lock_unlock gl_lock_unlock >> $@
	echo #define __libc_lock_unlock_recursive gl_recursive_lock_unlock >> $@

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

iwm\gettext\configmake.h:
	echo #ifndef LIBDIR > $@
	echo # define LIBDIR "." >> $@
	echo #endif /* not LIBDIR */ >> $@
	echo #ifndef PKGDATADIR >> $@
	echo # define PKGDATADIR "." >> $@
	echo #endif /* not PKGDATADIR */ >> $@

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
commonsource_OBJECTS= \
		$(GETTEXT)\gettext-tools\src\message.obj \
		$(GETTEXT)\gettext-tools\src\po-error.obj \
		$(GETTEXT)\gettext-tools\src\po-xerror.obj \
		$(GETTEXT)\gettext-tools\src\read-catalog-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-po.obj \
		$(GETTEXT)\gettext-tools\src\read-properties.obj \
		$(GETTEXT)\gettext-tools\src\read-stringtable.obj \
		$(GETTEXT)\gettext-tools\src\open-catalog.obj \
		$(GETTEXT)\gettext-tools\src\dir-list.obj \
		$(GETTEXT)\gettext-tools\src\str-list.obj
formatsource_OBJECTS= \
#MODIFY	$(GETTEXT)\gettext-tools\src\format.obj \
		iwm\gettext\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\src\format-boost.obj
gettextsrc_OBJECTS= \
		$(commonsource_OBJECTS) \
		$(formatsource_OBJECTS) \
		$(GETTEXT)\gettext-tools\src\read-catalog.obj \
		$(GETTEXT)\gettext-tools\src\write-catalog.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\msgl-check.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-exp.obj \
		$(GETTEXT)\gettext-tools\src\plural-eval.obj \
		$(GETTEXT)\gettext-tools\src\plural-table.obj
gettextlib_OBJECTS= \
		$(GETTEXT)\gettext-tools\gnulib-lib\addext.obj \
		$(GETTEXT)\gettext-tools\gnulib-lib\allocsa.obj \
		$(GETTEXT)\gettext-tools\gnulib-lib\argmatch.obj \
#		$(GETTEXT)\gettext-tools\gnulib-lib\atexit.obj \
		$(GETTEXT)\gettext-tools\gnulib-lib\backupfile.obj \
		$(GETTEXT)\gettext-tools\gnulib-lib\basename.obj \
		$(GETTEXT)\gettext-tools\gnulib-lib\c-ctype.obj \
		$(GETTEXT)\gettext-tools\gnulib-lib\c-strcasecmp.obj \
		$(GETTEXT)\gettext-tools\gnulib-lib\c-strcasestr.obj \
		$(GETTEXT)\gettext-tools\gnulib-lib\c-strncasecmp.obj \
		$(GETTEXT)\gettext-tools\gnulib-lib\c-strstr.obj \
		$(GETTEXT)\gettext-tools\gnulib-lib\canonicalize.obj \
		$(GETTEXT)\gettext-tools\gnulib-lib\classpath.obj \
		$(GETTEXT)\gettext-tools\gnulib-lib\clean-temp.obj \
		$(GETTEXT)\gettext-tools\gnulib-lib\closeout.obj \
		$(GETTEXT)\gettext-tools\gnulib-lib\concatpath.obj \
		$(GETTEXT)\gettext-tools\gnulib-lib\copy-file.obj \
		$(GETTEXT)\gettext-tools\gnulib-lib\csharpcomp.obj \
		$(GETTEXT)\gettext-tools\gnulib-lib\csharpexec.obj \
		$(GETTEXT)\gettext-tools\gnulib-lib\error-progname.obj \
		$(GETTEXT)\gettext-tools\gnulib-lib\error.obj \
		$(GETTEXT)\gettext-tools\gnulib-lib\execute.obj \
		$(GETTEXT)\gettext-tools\gnulib-lib\exitfail.obj \
		$(GETTEXT)\gettext-tools\gnulib-lib\fatal-signal.obj \
		$(GETTEXT)\gettext-tools\gnulib-lib\findprog.obj \
		$(GETTEXT)\gettext-tools\gnulib-lib\fnmatch.obj \
#		$(GETTEXT)\gettext-tools\gnulib-lib\fnmatch_loop.obj \
		$(GETTEXT)\gettext-tools\gnulib-lib\fstrcmp.obj \
		$(GETTEXT)\gettext-tools\gnulib-lib\full-write.obj \
		$(GETTEXT)\gettext-tools\gnulib-lib\fwriteerror.obj \
		$(GETTEXT)\gettext-tools\gnulib-lib\gcd.obj \
		$(GETTEXT)\gettext-tools\gnulib-lib\getdelim.obj \
		$(GETTEXT)\gettext-tools\gnulib-lib\getline.obj \
		$(GETTEXT)\gettext-tools\gnulib-lib\getopt.obj \
		$(GETTEXT)\gettext-tools\gnulib-lib\getopt1.obj \
		$(GETTEXT)\gettext-tools\gnulib-lib\gl_linkedhash_list.obj \
		$(GETTEXT)\gettext-tools\gnulib-lib\gl_list.obj \
		$(GETTEXT)\gettext-tools\gnulib-lib\hash.obj \
		$(GETTEXT)\gettext-tools\gnulib-lib\javacomp.obj \
		$(GETTEXT)\gettext-tools\gnulib-lib\javaexec.obj \
		$(GETTEXT)\gettext-tools\gnulib-lib\javaversion.obj \
		$(GETTEXT)\gettext-tools\gnulib-lib\linebreak.obj \
		$(GETTEXT)\gettext-tools\gnulib-lib\localcharset.obj \
		$(GETTEXT)\gettext-tools\gnulib-lib\lock.obj \
		$(GETTEXT)\gettext-tools\gnulib-lib\mbchar.obj \
		$(GETTEXT)\gettext-tools\gnulib-lib\mbswidth.obj \
		$(GETTEXT)\gettext-tools\gnulib-lib\memchr.obj \
		$(GETTEXT)\gettext-tools\gnulib-lib\memmove.obj \
#		$(GETTEXT)\gettext-tools\gnulib-lib\memset.obj \
		$(GETTEXT)\gettext-tools\gnulib-lib\mkdtemp.obj \
		$(GETTEXT)\gettext-tools\gnulib-lib\obstack.obj \
		$(GETTEXT)\gettext-tools\gnulib-lib\pipe.obj \
		$(GETTEXT)\gettext-tools\gnulib-lib\progname.obj \
		$(GETTEXT)\gettext-tools\gnulib-lib\progreloc.obj \
		$(GETTEXT)\gettext-tools\gnulib-lib\propername.obj \
		$(GETTEXT)\gettext-tools\gnulib-lib\quote.obj \
		$(GETTEXT)\gettext-tools\gnulib-lib\quotearg.obj \
		$(GETTEXT)\gettext-tools\gnulib-lib\readlink.obj \
		$(GETTEXT)\gettext-tools\gnulib-lib\relocatable.obj \
#		$(GETTEXT)\gettext-tools\gnulib-lib\relocwrapper.obj \
		$(GETTEXT)\gettext-tools\gnulib-lib\safe-read.obj \
		$(GETTEXT)\gettext-tools\gnulib-lib\safe-write.obj \
		$(GETTEXT)\gettext-tools\gnulib-lib\setenv.obj \
		$(GETTEXT)\gettext-tools\gnulib-lib\sh-quote.obj \
		$(GETTEXT)\gettext-tools\gnulib-lib\sigprocmask.obj \
		$(GETTEXT)\gettext-tools\gnulib-lib\stpcpy.obj \
		$(GETTEXT)\gettext-tools\gnulib-lib\stpncpy.obj \
#		$(GETTEXT)\gettext-tools\gnulib-lib\strcspn.obj \
		$(GETTEXT)\gettext-tools\gnulib-lib\strdup.obj \
#		$(GETTEXT)\gettext-tools\gnulib-lib\strerror.obj \
		$(GETTEXT)\gettext-tools\gnulib-lib\striconv.obj \
		$(GETTEXT)\gettext-tools\gnulib-lib\strnlen1.obj \
		$(GETTEXT)\gettext-tools\gnulib-lib\strpbrk.obj \
		$(GETTEXT)\gettext-tools\gnulib-lib\strstr.obj \
#		$(GETTEXT)\gettext-tools\gnulib-lib\strtol.obj \
#		$(GETTEXT)\gettext-tools\gnulib-lib\strtoul.obj \
		$(GETTEXT)\gettext-tools\gnulib-lib\tls.obj \
		$(GETTEXT)\gettext-tools\gnulib-lib\tmpdir.obj \
		$(GETTEXT)\gettext-tools\gnulib-lib\unsetenv.obj \
		$(GETTEXT)\gettext-tools\gnulib-lib\vasprintf.obj \
		$(GETTEXT)\gettext-tools\gnulib-lib\wait-process.obj \
		$(GETTEXT)\gettext-tools\gnulib-lib\xallocsa.obj \
		$(GETTEXT)\gettext-tools\gnulib-lib\xasprintf.obj \
		$(GETTEXT)\gettext-tools\gnulib-lib\xerror.obj \
		$(GETTEXT)\gettext-tools\gnulib-lib\xmalloc.obj \
		$(GETTEXT)\gettext-tools\gnulib-lib\xreadlink.obj \
		$(GETTEXT)\gettext-tools\gnulib-lib\xsetenv.obj \
		$(GETTEXT)\gettext-tools\gnulib-lib\xstrdup.obj \
		$(GETTEXT)\gettext-tools\gnulib-lib\xstriconv.obj \
#MODIFY	$(GETTEXT)\gettext-tools\gnulib-lib\xvasprintf.obj \
		iwm\gettext\xvasprintf.obj \

$(GETTEXT)\gettext-tools\src\msgfmt.exe: $(msgfmt_OBJECTS) $(gettextsrc_OBJECTS) $(gettextlib_OBJECTS) $(GETTEXT)\gettext-tools\src\hash-string.obj
	$(LINK) $(LNFLAGS) $(LIBICONV)\lib\iconv.lib $(GETTEXT)\gettext-runtime\intl\intl.lib $**
	if exist $@.manifest $(MT) -manifest $@.manifest -outputresource:$@;#1

$(msgfmt_OBJECTS) $(gettextsrc_OBJECTS): $(GETTEXT)\gettext-tools\config.h $(GETTEXT)\gettext-tools\libintl.h iwm\gettext\alloca.h iwm\gettext\byteswap.h iwm\gettext\getopt.h iwm\gettext\stdbool.h iwm\gettext\unistd.h
	$(CC) $(CLFLAGS) /DBISON_LOCALEDIR=\".\" /DGETTEXTDATADIR=\".\" /DGETTEXTJAR=\".\\gettext.jar\" /DHAVE_CONFIG_H /DLIBDIR=\".\" /DLOCALEDIR=\".\" /DPROJECTSDIR=\".\" /DINSTALLPREFIX=\".\" /DINSTALLDIR=\".\" /I$(GETTEXT)\gettext-tools\src /I$(GETTEXT)\gettext-runtime\intl /I$(GETTEXT)\gettext-tools /I$(GETTEXT)\gettext-tools\gnulib-lib /I$(LIBICONV)\include /Iiwm\gettext $*.c

$(GETTEXT)\gettext-tools\src\hash-string.obj: $(GETTEXT)\gettext-runtime\intl\hash-string.c
	$(CC) $(CLFLAGS) /DBISON_LOCALEDIR=\".\" /DGETTEXTDATADIR=\".\" /DGETTEXTJAR=\".\\gettext.jar\" /DHAVE_CONFIG_H /DLIBDIR=\".\" /DLOCALEDIR=\".\" /DPROJECTSDIR=\".\" /DINSTALLPREFIX=\".\" /DINSTALLDIR=\".\" /I$(GETTEXT)\gettext-tools\src /I$(GETTEXT)\gettext-runtime\intl /I$(GETTEXT)\gettext-tools /I$(GETTEXT)\gettext-tools\gnulib-lib /I$(LIBICONV)\include /Iiwm\gettext $**

$(gettextlib_OBJECTS): $(GETTEXT)\gettext-tools\config.h $(GETTEXT)\gettext-tools\libintl.h iwm\gettext\alloca.h iwm\gettext\configmake.h iwm\gettext\fnmatch.h iwm\gettext\getopt.h iwm\gettext\stdbool.h iwm\gettext\stdint.h iwm\gettext\unistd.h
	$(CC) $(CLFLAGS) /DDEPENDS_ON_LIBICONV=1 /DDEPENDS_ON_LIBINTL=1 /DEXEEXT=\".exe\" /DHAVE_CONFIG_H /DINSTALLDIR=\".\" /DINSTALLPREFIX=\".\" /DLIBDIR=\".\" /DPKGDATADIR=\".\" /I$(GETTEXT)\gettext-tools\gnulib-lib /I$(GETTEXT)\gettext-runtime\intl /I$(GETTEXT)\gettext-tools /I$(LIBICONV)\include /Iiwm\gettext $*.c

$(GETTEXT)\gettext-tools\config.h:
	echo #ifndef __cplusplus > $@
	echo # define inline __inline >> $@
	echo #endif /* not __cplusplus */ >> $@
	echo #define DEFAULT_OUTPUT_ALIGNMENT 1 >> $@
	echo #define DLL_VARIABLE >> $@
	echo #define ENDIANNESS 0 >> $@
	echo #define GNULIB_FWRITEERROR 1 >> $@
	echo #define HAVE_ENVIRON_DECL 1 >> $@
	echo #define HAVE_GETCWD 1 >> $@
	echo #define HAVE_RAISE 1 >> $@
	echo #define HAVE_STDINT_H 1 >> $@
	echo #define HAVE_STRING_H 1 >> $@
	echo #define INVALID_PATH_CHAR "\001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037\042*/:\074\076?\\\174" >> $@
	echo #define PACKAGE "gettext-tools" >> $@
	echo #define PAGE_WIDTH 79 >> $@
	echo #define VERSION "0.16.1" >> $@
	echo #define mode_t int >> $@
	echo #define pid_t int >> $@
	echo #define ssize_t int >> $@

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

iwm\gettext\alloca.h:
	echo #include "alloca_.h" > $@

iwm\gettext\byteswap.h:
	echo #include "byteswap_.h" > $@

iwm\gettext\fnmatch.h:
	echo #include "fnmatch_.h" > $@

iwm\gettext\getopt.h:
	echo #include "getopt_.h" > $@

iwm\gettext\stdbool.h:
	echo #include "stdbool_.h" > $@

iwm\gettext\stdint.h: $(GETTEXT)\gettext-tools\gnulib-lib\stdint_.h
	iwm\iwm-replace-win32.exe @HAVE_STDINT_H@=0 @HAVE_SYS_TYPES_H@=1 @HAVE_INTTYPES_H@=0 @HAVE_SYS_INTTYPES_H@=0 @HAVE_SYS_BITYPES_H@=0 @HAVE_WCHAR_H@=1 @HAVE_LONG_LONG_INT@=0 @HAVE_UNSIGNED_LONG_LONG_INT@=0 @HAVE_LONG_LONG_INT@=0 @HAVE_UNSIGNED_LONG_LONG_INT@=0 @BITSIZEOF_PTRDIFF_T@=32 @PTRDIFF_T_SUFFIX@=L @HAVE_SIGNED_SIG_ATOMIC_T@=1 @BITSIZEOF_SIG_ATOMIC_T@=32 @SIG_ATOMIC_T_SUFFIX@=L @BITSIZEOF_SIZE_T@=32 @SIZE_T_SUFFIX@=UL @HAVE_SIGNED_WCHAR_T@=0 @BITSIZEOF_WCHAR_T@=16 @WCHAR_T_SUFFIX@= @HAVE_SIGNED_WINT_T@=0 @BITSIZEOF_WINT_T@=16 @WINT_T_SUFFIX@= < $** > $@

iwm\gettext\unistd.h:
	echo. > $@

###############################################################################
# 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 SVN
		$(GLIB)\gobject\glib-mkenums \
!endif
		$(GLIB)\gthread\libgthread-2.0-0.dll

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

!ifdef SVN
$(GLIB)\config.h.win32: $@.in
	iwm\iwm-replace-win32.exe @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) < $** > $@
!endif

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

!ifdef SVN
$(GLIB)\glibconfig.h.win32: $@.in
	iwm\iwm-replace-win32.exe @GLIB_MAJOR_VERSION@=$(GLIB_MAJOR_VERSION) @GLIB_MINOR_VERSION@=$(GLIB_MINOR_VERSION) @GLIB_MICRO_VERSION@=$(GLIB_MICRO_VERSION) < $** > $@
!endif

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

# GLib
glib_OBJECTS= \
		$(GLIB)\glib\garray.obj \
		$(GLIB)\glib\gasyncqueue.obj \
		$(GLIB)\glib\gatomic.obj \
		$(GLIB)\glib\gbacktrace.obj \
		$(GLIB)\glib\gbase64.obj \
		$(GLIB)\glib\gbookmarkfile.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\gmappedfile.obj \
		$(GLIB)\glib\gmarkup.obj \
		$(GLIB)\glib\gmem.obj \
		$(GLIB)\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 \
!ifdef SVN
		$(GLIB)\glib\gsequence.obj \
!endif
		$(GLIB)\glib\gshell.obj \
		$(GLIB)\glib\gslice.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 \
		iwm\dirent\dirent.obj \
		iwm\dirent\wdirent.obj

$(GLIB)\glib\libglib-2.0-0.dll: $(glib_OBJECTS) $(GLIB)\glib\glib.res $(GLIB)\glib\glib.def
	$(LINK) $(LNFLAGS) /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 ws2_32.lib wsock32.lib $(glib_OBJECTS) $(GLIB)\glib\glib.res
	if exist $@.manifest $(MT) -manifest $@.manifest -outputresource:$@;#2

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

!ifdef SVN
$(GLIB)\glib\glib.rc: $@.in
	iwm\iwm-replace-win32.exe @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 < $** > $@
!endif

$(GLIB)\glib\glib.def: $(GLIB)\glib\glib.symbols
	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. $** >> $@
	del def.h

$(glib_OBJECTS): $(GLIB)\config.h $(GLIB)\glibconfig.h $(GLIB)\libintl.h $(GLIB)\glib\galias.h $(GLIB)\glib\galiasdef.c
	$(CC) $(CLFLAGS) /DG_LOG_DOMAIN=\"GLib\" /DGLIB_COMPILATION /DHAVE_CONFIG_H /FImsvc_recommended_pragmas.h /I$(GLIB) /I$(GLIB)\glib /I$(GETTEXT) /I$(LIBICONV)\include /Iiwm\dirent $*.c

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

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

# gspawn
$(GLIB)\glib\gspawn-win32-helper.exe: $(GLIB)\glib\gspawn-win32-helper.obj $(GLIB)\glib\glib.res
	$(LINK) $(LNFLAGS) $(GLIB)\glib\glib-2.0.lib user32.lib $**
	if exist $@.manifest $(MT) -manifest $@.manifest -outputresource:$@;#1

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

# GModule
$(GLIB)\gmodule\libgmodule-2.0-0.dll: $(GLIB)\gmodule\gmodule.obj $(GLIB)\gmodule\gmodule.res
	$(LINK) $(LNFLAGS) /DLL /DEF:$(GLIB)\gmodule\gmodule.def /IMPLIB:$(GLIB)\gmodule\gmodule-2.0.lib $(GLIB)\glib\glib-2.0.lib $**
	if exist $@.manifest $(MT) -manifest $@.manifest -outputresource:$@;#2

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

!ifdef SVN
$(GLIB)\gmodule\gmodule.rc: $@.in
	iwm\iwm-replace-win32.exe @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 < $** > $@
!endif

$(GLIB)\gmodule\gmodule.obj: $*.c $(GLIB)\gmodule\gmoduleconf.h
	$(CC) $(CLFLAGS) /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) $(LNFLAGS) /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
	if exist $@.manifest $(MT) -manifest $@.manifest -outputresource:$@;#2

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

!ifdef SVN
$(GLIB)\gobject\gobject.rc: $@.in
	iwm\iwm-replace-win32.exe @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 < $** > $@
!endif

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

$(gobject_OBJECTS): $(GLIB)\gobject\gobjectalias.h $(GLIB)\gobject\gobjectaliasdef.c $(GLIB)\gobject\gmarshal.h $(GLIB)\gobject\gmarshal.c
	$(CC) $(CLFLAGS) /DG_LOG_DOMAIN=\"GLib-GObject\" /DGOBJECT_COMPILATION /FImsvc_recommended_pragmas.h /I$(GLIB) /I$(GLIB)\glib /I$(GLIB)\gobject $*.c

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

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

$(GLIB)\gobject\gmarshal.c: $(GLIB)\gobject\glib-genmarshal.exe $(GLIB)\gobject\gobject.symbols
	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 $(GLIB)\gobject\gobject.symbols
	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__ */ >> $@
!endif

# gmarshal
$(GLIB)\gobject\glib-genmarshal.exe: $*.obj
	$(LINK) $(LNFLAGS) $(GLIB)\glib\glib-2.0.lib $**
	if exist $@.manifest $(MT) -manifest $@.manifest -outputresource:$@;#1

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

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

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

# GThread
$(GLIB)\gthread\libgthread-2.0-0.dll: $(GLIB)\gthread\gthread-impl.obj $(GLIB)\gthread\gthread.res
	$(LINK) $(LNFLAGS) /DLL /DEF:$(GLIB)\gthread\gthread.def /IMPLIB:$(GLIB)\gthread\gthread-2.0.lib $(GLIB)\glib\glib-2.0.lib user32.lib $**
	if exist $@.manifest $(MT) -manifest $@.manifest -outputresource:$@;#2

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

!ifdef SVN
$(GLIB)\gthread\gthread.rc: $@.in
	iwm\iwm-replace-win32.exe @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 < $** > $@
!endif

$(GLIB)\gthread\gthread-impl.obj: $*.c
	$(CC) $(CLFLAGS) /FImsvc_recommended_pragmas.h /I$(GLIB) /I$(GLIB)\glib /I$(GLIB)\gthread $**

###############################################################################
# GTK+                                                                        #
###############################################################################
gtk: atk jpeg libpng pango tiff \
		$(GTK)\gdk-pixbuf\libgdk_pixbuf-2.0-0.dll \
		$(GTK)\gdk-pixbuf\libpixbufloader-ani.dll \
		$(GTK)\gdk-pixbuf\libpixbufloader-bmp.dll \
		$(GTK)\gdk-pixbuf\libpixbufloader-gif.dll \
		$(GTK)\gdk-pixbuf\libpixbufloader-ico.dll \
		$(GTK)\gdk-pixbuf\libpixbufloader-jpeg.dll \
		$(GTK)\gdk-pixbuf\libpixbufloader-pcx.dll \
		$(GTK)\gdk-pixbuf\libpixbufloader-png.dll \
		$(GTK)\gdk-pixbuf\libpixbufloader-pnm.dll \
		$(GTK)\gdk-pixbuf\libpixbufloader-ras.dll \
		$(GTK)\gdk-pixbuf\libpixbufloader-tga.dll \
		$(GTK)\gdk-pixbuf\libpixbufloader-tiff.dll \
		$(GTK)\gdk-pixbuf\libpixbufloader-wbmp.dll \
		$(GTK)\gdk-pixbuf\libpixbufloader-xbm.dll \
		$(GTK)\gdk-pixbuf\libpixbufloader-xpm.dll \
!ifdef SVN
		$(GTK)\gdk-pixbuf\gdk-pixbuf-csource.exe \
!endif
		$(GTK)\gdk-pixbuf\gdk-pixbuf-query-loaders.exe \
		$(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.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 $@.win32 $@
	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 >> $@

!ifdef SVN
$(GTK)\config.h.win32: $@.in
	iwm\iwm-replace-win32.exe @GETTEXT_PACKAGE@=gtk20 < $** > $@
!endif

# GdkPixbuf
gdk_pixbuf_OBJECTS= \
		$(GTK)\gdk-pixbuf\gdk-pixbuf.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-simple-anim.obj \
		$(GTK)\gdk-pixbuf\gdk-pixbuf-util.obj \
		$(GTK)\gdk-pixbuf\gdk-pixdata.obj \
		$(GTK)\gdk-pixbuf\gdk-pixbuf-enum-types.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) $(LNFLAGS) /DLL /DEF:$(GTK)\gdk-pixbuf\gdk_pixbuf.def /IMPLIB:$(GTK)\gdk-pixbuf\gdk_pixbuf-2.0.lib $(GLIB)\glib\glib-2.0.lib $(GLIB)\gmodule\gmodule-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 user32.lib
	if exist $@.manifest $(MT) -manifest $@.manifest -outputresource:$@;#2

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

!ifdef SVN
$(GTK)\gdk-pixbuf\gdk_pixbuf.rc: $@.in
	iwm\iwm-replace-win32.exe @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 < $** > $@
!endif

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

$(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.h $(GTK)\gdk-pixbuf\gdk-pixbuf-features.h $(GTK)\gdk-pixbuf\gdk-pixbuf-marshal.c $(GTK)\gdk-pixbuf\gdk-pixbuf-marshal.h
	$(CC) $(CLFLAGS) \
	/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 /DGTK_PREFIX=\"/target\" /DUSE_GMODULE /FImsvc_recommended_pragmas.h /I$(GTK) /I$(GLIB) /I$(GLIB)\glib /I$(GLIB)\gmodule /I$(JPEG) /I$(LIBPNG) /I$(ZLIB) $*.c

!ifdef SVN
$(GTK)\gdk-pixbuf\gdk-pixbuf-alias.h: $(GTK)\gdk-pixbuf\gdk-pixbuf.symbols
	$(PERL) $(GTK)\gdk-pixbuf\makegdkpixbufalias.pl < $** > $@
!endif

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

!ifdef SVN
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: $(gdk_pixbuf_headers)
	$(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" \
		  $** > $@

$(GTK)\gdk-pixbuf\gdk-pixbuf-enum-types.h: $(gdk_pixbuf_headers)
	$(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__ */" \
		$** ) > $@

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

$(GTK)\gdk-pixbuf\gdk-pixbuf-marshal.c: $(GTK)\gdk-pixbuf\gdk-pixbuf-marshal.list
	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 $** --body > $@
	del libglib-2.0-0.dll
	del intl.dll
	del iconv.dll

$(GTK)\gdk-pixbuf\gdk-pixbuf-marshal.h: $(GTK)\gdk-pixbuf\gdk-pixbuf-marshal.list
	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 $** --header > $@
	del libglib-2.0-0.dll
	del intl.dll
	del iconv.dll
!endif

# libpixbufloader-ani
libpixbufloader_ani_OBJECTS= \
		$(GTK)\gdk-pixbuf\io-ani.obj \
		$(GTK)\gdk-pixbuf\io-ani-animation.obj

$(GTK)\gdk-pixbuf\libpixbufloader-ani.dll: $(libpixbufloader_ani_OBJECTS)
	$(LINK) $(LNFLAGS) /DLL /EXPORT:fill_vtable /EXPORT:fill_info $(GETTEXT)\gettext-runtime\intl\intl.lib $(GLIB)\glib\glib-2.0.lib $(GLIB)\gobject\gobject-2.0.lib $(GTK)\gdk-pixbuf\gdk_pixbuf-2.0.lib $**
	if exist $@.manifest $(MT) -manifest $@.manifest -outputresource:$@;#2

$(libpixbufloader_ani_OBJECTS):
	$(CC) $(CLFLAGS) /DGDK_PIXBUF_ENABLE_BACKEND /DUSE_GMODULE /FImsvc_recommended_pragmas.h /I$(GTK) /I$(GLIB) /I$(GLIB)\glib /I$(GLIB)\gmodule $*.c

# libpixbufloader-bmp
$(GTK)\gdk-pixbuf\libpixbufloader-bmp.dll: $(GTK)\gdk-pixbuf\io-bmp.obj
	$(LINK) $(LNFLAGS) /DLL /EXPORT:fill_vtable /EXPORT:fill_info $(GETTEXT)\gettext-runtime\intl\intl.lib $(GLIB)\glib\glib-2.0.lib $(GLIB)\gobject\gobject-2.0.lib $(GTK)\gdk-pixbuf\gdk_pixbuf-2.0.lib $**
	if exist $@.manifest $(MT) -manifest $@.manifest -outputresource:$@;#2

$(GTK)\gdk-pixbuf\io-bmp.obj:
	$(CC) $(CLFLAGS) /DGDK_PIXBUF_ENABLE_BACKEND /DUSE_GMODULE /FImsvc_recommended_pragmas.h /I$(GTK) /I$(GLIB) /I$(GLIB)\glib /I$(GLIB)\gmodule $*.c

# libpixbufloader-gif
libpixbufloader_gif_OBJECTS= \
		$(GTK)\gdk-pixbuf\io-gif.obj \
		$(GTK)\gdk-pixbuf\io-gif-animation.obj

$(GTK)\gdk-pixbuf\libpixbufloader-gif.dll: $(libpixbufloader_gif_OBJECTS)
	$(LINK) $(LNFLAGS) /DLL /EXPORT:fill_vtable /EXPORT:fill_info $(GETTEXT)\gettext-runtime\intl\intl.lib $(GLIB)\glib\glib-2.0.lib $(GLIB)\gobject\gobject-2.0.lib $(GTK)\gdk-pixbuf\gdk_pixbuf-2.0.lib $**
	if exist $@.manifest $(MT) -manifest $@.manifest -outputresource:$@;#2

$(libpixbufloader_gif_OBJECTS):
	$(CC) $(CLFLAGS) /DGDK_PIXBUF_ENABLE_BACKEND /DUSE_GMODULE /FImsvc_recommended_pragmas.h /I$(GTK) /I$(GLIB) /I$(GLIB)\glib /I$(GLIB)\gmodule $*.c

# libpixbufloader-ico
$(GTK)\gdk-pixbuf\libpixbufloader-ico.dll: $(GTK)\gdk-pixbuf\io-ico.obj
	$(LINK) $(LNFLAGS) /DLL /EXPORT:fill_vtable /EXPORT:fill_info $(GETTEXT)\gettext-runtime\intl\intl.lib $(GLIB)\glib\glib-2.0.lib $(GLIB)\gobject\gobject-2.0.lib $(GTK)\gdk-pixbuf\gdk_pixbuf-2.0.lib $**
	if exist $@.manifest $(MT) -manifest $@.manifest -outputresource:$@;#2

$(GTK)\gdk-pixbuf\io-ico.obj:
	$(CC) $(CLFLAGS) /DGDK_PIXBUF_ENABLE_BACKEND /DUSE_GMODULE /FImsvc_recommended_pragmas.h /I$(GTK) /I$(GLIB) /I$(GLIB)\glib /I$(GLIB)\gmodule $*.c

# libpixbufloader-jpeg
$(GTK)\gdk-pixbuf\libpixbufloader-jpeg.dll: $(GTK)\gdk-pixbuf\io-jpeg.obj
	$(LINK) $(LNFLAGS) /DLL /EXPORT:fill_vtable /EXPORT:fill_info $(GETTEXT)\gettext-runtime\intl\intl.lib $(GLIB)\glib\glib-2.0.lib $(GLIB)\gobject\gobject-2.0.lib $(GTK)\gdk-pixbuf\gdk_pixbuf-2.0.lib $(JPEG)\libjpeg.lib $**
	if exist $@.manifest $(MT) -manifest $@.manifest -outputresource:$@;#2

$(GTK)\gdk-pixbuf\io-jpeg.obj:
	$(CC) $(CLFLAGS) /DGDK_PIXBUF_ENABLE_BACKEND /DUSE_GMODULE /FImsvc_recommended_pragmas.h /I$(GTK) /I$(GLIB) /I$(GLIB)\glib /I$(GLIB)\gmodule /I$(JPEG) $*.c

# libpixbufloader-pcx
$(GTK)\gdk-pixbuf\libpixbufloader-pcx.dll: $(GTK)\gdk-pixbuf\io-pcx.obj
	$(LINK) $(LNFLAGS) /DLL /EXPORT:fill_vtable /EXPORT:fill_info $(GETTEXT)\gettext-runtime\intl\intl.lib $(GLIB)\glib\glib-2.0.lib $(GLIB)\gobject\gobject-2.0.lib $(GTK)\gdk-pixbuf\gdk_pixbuf-2.0.lib $**
	if exist $@.manifest $(MT) -manifest $@.manifest -outputresource:$@;#2

$(GTK)\gdk-pixbuf\io-pcx.obj:
	$(CC) $(CLFLAGS) /DGDK_PIXBUF_ENABLE_BACKEND /DUSE_GMODULE /FImsvc_recommended_pragmas.h /I$(GTK) /I$(GLIB) /I$(GLIB)\glib /I$(GLIB)\gmodule $*.c

# libpixbufloader-png
$(GTK)\gdk-pixbuf\libpixbufloader-png.dll: $(GTK)\gdk-pixbuf\io-png.obj
	$(LINK) $(LNFLAGS) /DLL /EXPORT:fill_vtable /EXPORT:fill_info $(GETTEXT)\gettext-runtime\intl\intl.lib $(GLIB)\glib\glib-2.0.lib $(GLIB)\gobject\gobject-2.0.lib $(GTK)\gdk-pixbuf\gdk_pixbuf-2.0.lib $(LIBPNG)\libpng13.lib $**
	if exist $@.manifest $(MT) -manifest $@.manifest -outputresource:$@;#2

$(GTK)\gdk-pixbuf\io-png.obj:
	$(CC) $(CLFLAGS) /DGDK_PIXBUF_ENABLE_BACKEND /DUSE_GMODULE /FImsvc_recommended_pragmas.h /I$(GTK) /I$(GLIB) /I$(GLIB)\glib /I$(GLIB)\gmodule /I$(LIBPNG) /I$(ZLIB) $*.c

# libpixbufloader-pnm
$(GTK)\gdk-pixbuf\libpixbufloader-pnm.dll: $(GTK)\gdk-pixbuf\io-pnm.obj
	$(LINK) $(LNFLAGS) /DLL /EXPORT:fill_vtable /EXPORT:fill_info $(GETTEXT)\gettext-runtime\intl\intl.lib $(GLIB)\glib\glib-2.0.lib $(GLIB)\gobject\gobject-2.0.lib $(GTK)\gdk-pixbuf\gdk_pixbuf-2.0.lib $**
	if exist $@.manifest $(MT) -manifest $@.manifest -outputresource:$@;#2

$(GTK)\gdk-pixbuf\io-pnm.obj:
	$(CC) $(CLFLAGS) /DGDK_PIXBUF_ENABLE_BACKEND /DUSE_GMODULE /FImsvc_recommended_pragmas.h /I$(GTK) /I$(GLIB) /I$(GLIB)\glib /I$(GLIB)\gmodule $*.c

# libpixbufloader-ras
$(GTK)\gdk-pixbuf\libpixbufloader-ras.dll: $(GTK)\gdk-pixbuf\io-ras.obj
	$(LINK) $(LNFLAGS) /DLL /EXPORT:fill_vtable /EXPORT:fill_info $(GETTEXT)\gettext-runtime\intl\intl.lib $(GLIB)\glib\glib-2.0.lib $(GLIB)\gobject\gobject-2.0.lib $(GTK)\gdk-pixbuf\gdk_pixbuf-2.0.lib $**
	if exist $@.manifest $(MT) -manifest $@.manifest -outputresource:$@;#2

$(GTK)\gdk-pixbuf\io-ras.obj:
	$(CC) $(CLFLAGS) /DGDK_PIXBUF_ENABLE_BACKEND /DUSE_GMODULE /FImsvc_recommended_pragmas.h /I$(GTK) /I$(GLIB) /I$(GLIB)\glib /I$(GLIB)\gmodule $*.c

# libpixbufloader-tga
$(GTK)\gdk-pixbuf\libpixbufloader-tga.dll: $(GTK)\gdk-pixbuf\io-tga.obj
	$(LINK) $(LNFLAGS) /DLL /EXPORT:fill_vtable /EXPORT:fill_info $(GETTEXT)\gettext-runtime\intl\intl.lib $(GLIB)\glib\glib-2.0.lib $(GLIB)\gobject\gobject-2.0.lib $(GTK)\gdk-pixbuf\gdk_pixbuf-2.0.lib $**
	if exist $@.manifest $(MT) -manifest $@.manifest -outputresource:$@;#2

$(GTK)\gdk-pixbuf\io-tga.obj:
	$(CC) $(CLFLAGS) /DGDK_PIXBUF_ENABLE_BACKEND /DUSE_GMODULE /FImsvc_recommended_pragmas.h /I$(GTK) /I$(GLIB) /I$(GLIB)\glib /I$(GLIB)\gmodule $*.c

# libpixbufloader-tiff
$(GTK)\gdk-pixbuf\libpixbufloader-tiff.dll: $(GTK)\gdk-pixbuf\io-tiff.obj
	$(LINK) $(LNFLAGS) /DLL /EXPORT:fill_vtable /EXPORT:fill_info $(GETTEXT)\gettext-runtime\intl\intl.lib $(GLIB)\glib\glib-2.0.lib $(GLIB)\gobject\gobject-2.0.lib $(GTK)\gdk-pixbuf\gdk_pixbuf-2.0.lib $(TIFF)\libtiff\libtiff.lib $**
	if exist $@.manifest $(MT) -manifest $@.manifest -outputresource:$@;#2

$(GTK)\gdk-pixbuf\io-tiff.obj:
	$(CC) $(CLFLAGS) /DGDK_PIXBUF_ENABLE_BACKEND /DUSE_GMODULE /FImsvc_recommended_pragmas.h /I$(GTK) /I$(GLIB) /I$(GLIB)\glib /I$(GLIB)\gmodule /I$(TIFF)\libtiff $*.c

# libpixbufloader-wbmp
$(GTK)\gdk-pixbuf\libpixbufloader-wbmp.dll: $(GTK)\gdk-pixbuf\io-wbmp.obj
	$(LINK) $(LNFLAGS) /DLL /EXPORT:fill_vtable /EXPORT:fill_info $(GETTEXT)\gettext-runtime\intl\intl.lib $(GLIB)\glib\glib-2.0.lib $(GLIB)\gobject\gobject-2.0.lib $(GTK)\gdk-pixbuf\gdk_pixbuf-2.0.lib $**
	if exist $@.manifest $(MT) -manifest $@.manifest -outputresource:$@;#2

$(GTK)\gdk-pixbuf\io-wbmp.obj:
	$(CC) $(CLFLAGS) /DGDK_PIXBUF_ENABLE_BACKEND /DUSE_GMODULE /FImsvc_recommended_pragmas.h /I$(GTK) /I$(GLIB) /I$(GLIB)\glib /I$(GLIB)\gmodule $*.c

# libpixbufloader-xbm
$(GTK)\gdk-pixbuf\libpixbufloader-xbm.dll: $(GTK)\gdk-pixbuf\io-xbm.obj
	$(LINK) $(LNFLAGS) /DLL /EXPORT:fill_vtable /EXPORT:fill_info $(GETTEXT)\gettext-runtime\intl\intl.lib $(GLIB)\glib\glib-2.0.lib $(GLIB)\gobject\gobject-2.0.lib $(GTK)\gdk-pixbuf\gdk_pixbuf-2.0.lib $**
	if exist $@.manifest $(MT) -manifest $@.manifest -outputresource:$@;#2

$(GTK)\gdk-pixbuf\io-xbm.obj:
	$(CC) $(CLFLAGS) /DGDK_PIXBUF_ENABLE_BACKEND /DUSE_GMODULE /FImsvc_recommended_pragmas.h /I$(GTK) /I$(GLIB) /I$(GLIB)\glib /I$(GLIB)\gmodule $*.c

# libpixbufloader-xpm
$(GTK)\gdk-pixbuf\libpixbufloader-xpm.dll: $(GTK)\gdk-pixbuf\io-xpm.obj
	$(LINK) $(LNFLAGS) /DLL /EXPORT:fill_vtable /EXPORT:fill_info $(GETTEXT)\gettext-runtime\intl\intl.lib $(GLIB)\glib\glib-2.0.lib $(GLIB)\gobject\gobject-2.0.lib $(GTK)\gdk-pixbuf\gdk_pixbuf-2.0.lib $**
	if exist $@.manifest $(MT) -manifest $@.manifest -outputresource:$@;#2

$(GTK)\gdk-pixbuf\io-xpm.obj:
	$(CC) $(CLFLAGS) /DGDK_PIXBUF_ENABLE_BACKEND /DUSE_GMODULE /FImsvc_recommended_pragmas.h /I$(GTK) /I$(GLIB) /I$(GLIB)\glib /I$(GLIB)\gmodule $*.c

# gdk-pixbuf-csource
$(GTK)\gdk-pixbuf\gdk-pixbuf-csource.exe: $*.obj $(GTK)\gdk-pixbuf\gdk_pixbuf.res
	$(LINK) $(LNFLAGS) $(GLIB)\glib\glib-2.0.lib $(GLIB)\gobject\gobject-2.0.lib $(GTK)\gdk-pixbuf\gdk_pixbuf-2.0.lib $**
	if exist $@.manifest $(MT) -manifest $@.manifest -outputresource:$@;#1

$(GTK)\gdk-pixbuf\gdk-pixbuf-csource.obj: $*.c $(GTK)\gtk\gtkversion.h
	$(CC) $(CLFLAGS) /FImsvc_recommended_pragmas.h /DUSE_GMODULE /I$(GTK) /I$(GLIB) /I$(GLIB)\glib /I$(GLIB)\gmodule $*.c

$(GTK)\gtk\gtkversion.h: $@.in
	iwm\iwm-replace-win32.exe @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 < $** > $@

# gdk-pixbuf-query-loaders
$(GTK)\gdk-pixbuf\gdk-pixbuf-query-loaders.exe: $(GTK)\gdk-pixbuf\queryloaders.obj $(GTK)\gdk-pixbuf\gdk_pixbuf.res
	$(LINK) $(LNFLAGS) $(GLIB)\glib\glib-2.0.lib $(GLIB)\gmodule\gmodule-2.0.lib $**
	if exist $@.manifest $(MT) -manifest $@.manifest -outputresource:$@;#1

$(GTK)\gdk-pixbuf\queryloaders.obj: $*.c
	$(CC) $(CLFLAGS) /DGDK_PIXBUF_ENABLE_BACKEND /DGTK_PREFIX=\"/target\" /DPIXBUF_LIBDIR=\"/target/lib/gtk-2.0/$(GTK_VERSION)/loaders\" /DUSE_GMODULE /FImsvc_recommended_pragmas.h /I$(GTK) /I$(GLIB) /I$(GLIB)\glib /I$(GLIB)\gmodule $*.c

# GDK
gdk_OBJECTS= \
		$(GTK)\gdk\gdk.obj \
		$(GTK)\gdk\gdkcairo.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 \
		$(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
	$(LINK) $(LNFLAGS) /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 $(PANGO)\pango\pangocairo-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
	if exist $@.manifest $(MT) -manifest $@.manifest -outputresource:$@;#2

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

!ifdef SVN
$(GTK)\gdk\win32\rc\gdk.rc: $@.in
	iwm\iwm-replace-win32.exe @srcdir@=. @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 < $** > $@

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

$(gdk_OBJECTS): $(GTK)\gdk\gdkalias.h $(GTK)\gdk\gdkaliasdef.c $(GTK)\gdk\gdkconfig.h $(GTK)\gdk\gdkenumtypes.h $(GTK)\gdk\gdkmarshalers.h
	$(CC) $(CLFLAGS) /DGDK_ENABLE_BROKEN /DINSIDE_GDK_WIN32 /FImsvc_recommended_pragmas.h /I$(GTK) /I$(GTK)\gdk /I$(GTK)\gdk\win32 /I$(GTK)\gdk-pixbuf /I$(CAIRO)\src /I$(GLIB) /I$(GLIB)\glib /I$(GLIB)\gmodule /I$(PANGO) $*.c

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

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

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

!ifdef SVN
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: $(gdk_headers)
	$(PERL) $(GTK)\gdk\makeenums.pl cfile $** > $@

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

!ifdef SVN
$(GTK)\gdk\gdkmarshalers.h: $(GTK)\gdk\gdkmarshalers.list
	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 $** --header > $@
	del libglib-2.0-0.dll
	del intl.dll
	del iconv.dll
!endif

# 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\gtkassistant.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\gtkcellrendereraccel.obj \
		$(GTK)\gtk\gtkcellrenderercombo.obj \
		$(GTK)\gtk\gtkcellrenderertext.obj \
		$(GTK)\gtk\gtkcellrenderertoggle.obj \
		$(GTK)\gtk\gtkcellrendererpixbuf.obj \
		$(GTK)\gtk\gtkcellrendererprogress.obj \
		$(GTK)\gtk\gtkcellrendererspin.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\gtkfilechoosersettings.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\gtklinkbutton.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\gtkpagesetup.obj \
		$(GTK)\gtk\gtkpaned.obj \
		$(GTK)\gtk\gtkpapersize.obj \
		$(GTK)\gtk\gtkpathbar.obj \
		$(GTK)\gtk\gtkpixmap.obj \
		$(GTK)\gtk\gtkplug.obj \
		$(GTK)\gtk\gtkplug-win32.obj \
		$(GTK)\gtk\gtkpreview.obj \
		$(GTK)\gtk\gtkprint-win32.obj \
		$(GTK)\gtk\gtkprintcontext.obj \
		$(GTK)\gtk\gtkprintoperation.obj \
		$(GTK)\gtk\gtkprintoperation-win32.obj \
		$(GTK)\gtk\gtkprintoperationpreview.obj \
		$(GTK)\gtk\gtkprintsettings.obj \
		$(GTK)\gtk\gtkprintutils.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\gtkrecentchooser.obj \
		$(GTK)\gtk\gtkrecentchooserdefault.obj \
		$(GTK)\gtk\gtkrecentchooserdialog.obj \
		$(GTK)\gtk\gtkrecentchoosermenu.obj \
		$(GTK)\gtk\gtkrecentchooserutils.obj \
		$(GTK)\gtk\gtkrecentchooserwidget.obj \
		$(GTK)\gtk\gtkrecentfilter.obj \
		$(GTK)\gtk\gtkrecentmanager.obj \
		$(GTK)\gtk\gtkruler.obj \
		$(GTK)\gtk\gtkscale.obj \
		$(GTK)\gtk\gtkscrollbar.obj \
		$(GTK)\gtk\gtkscrolledwindow.obj \
!ifndef SVN
		$(GTK)\gtk\gtksequence.obj \
!endif
		$(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\gtksocket-win32.obj \
		$(GTK)\gtk\gtkspinbutton.obj \
		$(GTK)\gtk\gtkstatusicon.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\gtktextbufferrichtext.obj \
		$(GTK)\gtk\gtktextbufferserialize.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 \
!ifdef SVN
		$(GTK)\gtk\gtktooltip.obj \
!endif
		$(GTK)\gtk\gtktooltips.obj \
!ifdef SVN
		$(GTK)\gtk\gtktrayicon-win32.obj \
!endif
		$(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\gtkwin32embed.obj \
		$(GTK)\gtk\gtkwin32embedwidget.obj \
		$(GTK)\gtk\gtkwindow.obj \
		$(GTK)\gtk\gtkwindow-decorate.obj

$(GTK)\gtk\libgtk-win32-2.0-0.dll: $(gtk_OBJECTS) $(GTK)\gtk\gtk-win32.res $(GTK)\gtk\gtk.def
	$(LINK) $(LNFLAGS) /DLL /DEF:$(GTK)\gtk\gtk.def /IMPLIB:$(GTK)\gtk\gtk-win32-2.0.lib $(ATK)\atk\atk-1.0.lib $(CAIRO)\src\cairo.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 advapi32.lib comctl32.lib comdlg32.lib gdi32.lib ole32.lib shell32.lib user32.lib winspool.lib ws2_32.lib $(PANGO)\pango\pango-1.0.lib $(PANGO)\pango\pangocairo-1.0.lib $(gtk_OBJECTS) $(GTK)\gtk\gtk-win32.res
	if exist $@.manifest $(MT) -manifest $@.manifest -outputresource:$@;#2

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

!ifdef SVN
$(GTK)\gtk\gtk-win32.rc: $@.in
	iwm\iwm-replace-win32.exe @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 < $** > $@

$(GTK)\gtk\gtk.def: $(GTK)\gtk\gtk.symbols
	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_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. $** >> $@
	del def.h
!endif

$(gtk_OBJECTS): $(GTK)\gtk\gtkalias.h $(GTK)\gtk\gtkaliasdef.c $(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\gtkbuiltincache.h
!ifdef SVN
	$(CC) $(CLFLAGS) /DG_LOG_DOMAIN=\"Gtk\" /DGTK_BINARY_VERSION=\"$(GTK_VERSION)\" /DGTK_COMPILATION /DGTK_FILE_SYSTEM_ENABLE_UNSUPPORTED /DGTK_HOST=\"win32\" /DGTK_LIBDIR=\"/target/lib\" /DGTK_PRINT_BACKENDS=\"file\" /DGTK_PRINT_PREVIEW_COMMAND=\"\" /DHAVE_CONFIG_H /Dnear=iwmnear /Dsnprintf=_snprintf /FImsvc_recommended_pragmas.h /I$(GTK) /I$(GTK)\gdk /I$(ATK) /I$(CAIRO)\src /I$(GLIB) /I$(GLIB)\glib /I$(GLIB)\gmodule /I$(PANGO) $*.c
!else
	$(CC) $(CLFLAGS) /DG_LOG_DOMAIN=\"Gtk\" /DGTK_BINARY_VERSION=\"$(GTK_VERSION)\" /DGTK_COMPILATION /DGTK_FILE_SYSTEM_ENABLE_UNSUPPORTED /DGTK_HOST=\"win32\" /DGTK_LIBDIR=\"/target/lib\" /DHAVE_CONFIG_H /Dnear=iwmnear /Dsnprintf=_snprintf /FImsvc_recommended_pragmas.h /I$(GTK) /I$(GTK)\gtk /I$(GTK)\gdk /I$(ATK) /I$(CAIRO)\src /I$(GLIB) /I$(GLIB)\glib /I$(GLIB)\gmodule /I$(PANGO) $*.c
!endif

gdk_pixbuf_LOADERS= \
		libpixbufloader-ani.dll \
		libpixbufloader-bmp.dll \
		libpixbufloader-gif.dll \
		libpixbufloader-ico.dll \
		libpixbufloader-jpeg.dll \
		libpixbufloader-pcx.dll \
		libpixbufloader-png.dll \
		libpixbufloader-pnm.dll \
		libpixbufloader-ras.dll \
		libpixbufloader-tga.dll \
		libpixbufloader-tiff.dll \
		libpixbufloader-wbmp.dll \
		libpixbufloader-xbm.dll \
		libpixbufloader-xpm.dll

!ifdef SVN
$(GTK)\gtk\gtkalias.h: $(GTK)\gtk\gtk.symbols
	$(PERL) $(GTK)\gtk\makegtkalias.pl < $** > $@

$(GTK)\gtk\gtkaliasdef.c: $(GTK)\gtk\gtk.symbols
	$(PERL) $(GTK)\gtk\makegtkalias.pl -def < $** > $@

$(GTK)\gtk\gtkmarshal.c: $(GTK)\gtk\gtkmarshal.list
	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 $** --body > $@
	del libglib-2.0-0.dll
	del intl.dll
	del iconv.dll

$(GTK)\gtk\gtkmarshal.h: $(GTK)\gtk\gtkmarshal.list
	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 $** --header >> $@
	del libglib-2.0-0.dll
	del intl.dll
	del iconv.dll
	echo #endif /* GTK_DISABLE_DEPRECATED */ >> $@

$(GTK)\gtk\gtkmarshalers.c: $(GTK)\gtk\gtkmarshalers.list
	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 $** --body > $@
	del libglib-2.0-0.dll
	del intl.dll
	del iconv.dll

$(GTK)\gtk\gtkmarshalers.h: $(GTK)\gtk\gtkmarshalers.list
	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 $** --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\gtkassistant.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\gtkcellrendereraccel.h \
		$(GTK)\gtk\gtkcellrenderercombo.h \
		$(GTK)\gtk\gtkcellrendererpixbuf.h \
		$(GTK)\gtk\gtkcellrendererprogress.h \
		$(GTK)\gtk\gtkcellrendererspin.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\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\gtkfilechooserbutton.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\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\gtklinkbutton.h \
		$(GTK)\gtk\gtklist.h \
		$(GTK)\gtk\gtklistitem.h \
		$(GTK)\gtk\gtkliststore.h \
		$(GTK)\gtk\gtkmain.h \
		$(GTK)\gtk\gtkmenu.h \
		$(GTK)\gtk\gtkmenubar.h \
		$(GTK)\gtk\gtkmenuitem.h \
		$(GTK)\gtk\gtkmenushell.h \
		$(GTK)\gtk\gtkmenutoolbutton.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\gtkpagesetup.h \
		$(GTK)\gtk\gtkpaned.h \
		$(GTK)\gtk\gtkpapersize.h \
		$(GTK)\gtk\gtkpixmap.h \
		$(GTK)\gtk\gtkplug.h \
		$(GTK)\gtk\gtkpreview.h \
		$(GTK)\gtk\gtkprintcontext.h \
		$(GTK)\gtk\gtkprintoperation.h \
		$(GTK)\gtk\gtkprintoperationpreview.h \
		$(GTK)\gtk\gtkprintsettings.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\gtkrecentchooser.h \
		$(GTK)\gtk\gtkrecentchooserdialog.h \
		$(GTK)\gtk\gtkrecentchoosermenu.h \
		$(GTK)\gtk\gtkrecentchooserwidget.h \
		$(GTK)\gtk\gtkrecentfilter.h \
		$(GTK)\gtk\gtkrecentmanager.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\gtksocket.h \
		$(GTK)\gtk\gtkspinbutton.h \
		$(GTK)\gtk\gtkstatusbar.h \
		$(GTK)\gtk\gtkstatusicon.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\gtktextbufferrichtext.h \
		$(GTK)\gtk\gtktextchild.h \
		$(GTK)\gtk\gtktextdisplay.h \
		$(GTK)\gtk\gtktextiter.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: $(gtk_headers)
	$(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)\gtk\gtktypebuiltins.h: $(gtk_headers)
	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)\gtk\gtkbuiltincache.h: $(GTK)\gtk\gtk-update-icon-cache.exe $(GTK)\gtk\stamp-icons
	if exist bin rename bin bin~
	mkdir bin
	copy /y $(LIBICONV)\lib\iconv.dll bin
	copy /y $(GETTEXT)\gettext-runtime\intl\intl.dll bin
	copy /y $(GLIB)\glib\libglib-2.0-0.dll bin
	copy /y $(GLIB)\gmodule\libgmodule-2.0-0.dll bin
	copy /y $(GLIB)\gobject\libgobject-2.0-0.dll bin
	copy /y $(JPEG)\jpeg62.dll bin
	copy /y $(LIBPNG)\libpng13.dll bin
	copy /y $(TIFF)\libtiff\libtiff.dll bin
	copy /y $(ZLIB)\zlib1.dll bin
	copy /y $(GTK)\gdk-pixbuf\libgdk_pixbuf-2.0-0.dll bin
	copy /y $(GTK)\gdk-pixbuf\gdk-pixbuf-query-loaders.exe bin
	copy /y $(GTK)\gtk\gtk-update-icon-cache.exe bin
	if exist lib rename lib lib~
	mkdir lib
	mkdir lib\gtk-2.0
	mkdir lib\gtk-2.0\$(GTK_VERSION)
	mkdir lib\gtk-2.0\$(GTK_VERSION)\loaders
	for %f in ($(gdk_pixbuf_LOADERS)) do copy /y $(GTK)\gdk-pixbuf\%f lib\gtk-2.0\$(GTK_VERSION)\loaders
	if exist etc rename etc etc~
	mkdir etc
	mkdir etc\gtk-2.0
	bin\gdk-pixbuf-query-loaders.exe > etc\gtk-2.0\gdk-pixbuf.loaders
	bin\gtk-update-icon-cache.exe --force --ignore-theme-index --source builtin_icons $(GTK)\gtk\stock-icons > $@
	rmdir /q /s bin
	rmdir /q /s etc
	rmdir /q /s lib
	if exist bin~ rename bin~ bin
	if exist etc~ rename etc~ etc
	if exist lib~ rename lib~ lib

$(GTK)\gtk\gtk-update-icon-cache.exe: $(GTK)\gtk\updateiconcache.obj
	$(LINK) $(LNFLAGS) $(GLIB)\glib\glib-2.0.lib $(GLIB)\gobject\gobject-2.0.lib $(GTK)\gdk-pixbuf\gdk_pixbuf-2.0.lib $(GETTEXT)\gettext-runtime\intl\intl.lib $**
	if exist $@.manifest $(MT) -manifest $@.manifest -outputresource:$@;#1

$(GTK)\gtk\updateiconcache.obj: $*.c
	$(CC) $(CLFLAGS) /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=iwmnear /DPANGO_ENABLE_BACKEND /FImsvc_recommended_pragmas.h /I$(GTK) /I$(GLIB) /I$(GLIB)\glib /I$(GLIB)\gmodule /I$(GLIB)\glib $**

$(GTK)\gtk\stamp-icons:
	for %d in (16 24) do \
	( copy /y $(GTK)\gtk\stock-icons\%d\gtk-go-forward-ltr.png $(GTK)\gtk\stock-icons\%d\gtk-go-back-rtl.png \
	& copy /y $(GTK)\gtk\stock-icons\%d\gtk-go-back-ltr.png $(GTK)\gtk\stock-icons\%d\gtk-go-forward-rtl.png \
	& copy /y $(GTK)\gtk\stock-icons\%d\gtk-goto-last-ltr.png $(GTK)\gtk\stock-icons\%d\gtk-goto-first-rtl.png \
	& copy /y $(GTK)\gtk\stock-icons\%d\gtk-goto-first-ltr.png $(GTK)\gtk\stock-icons\%d\gtk-goto-last-rtl.png \
	& copy /y $(GTK)\gtk\stock-icons\%d\gtk-media-rewind-ltr.png $(GTK)\gtk\stock-icons\%d\gtk-media-forward-rtl.png \
	& copy /y $(GTK)\gtk\stock-icons\%d\gtk-media-previous-ltr.png $(GTK)\gtk\stock-icons\%d\gtk-media-next-rtl.png \
	& copy /y $(GTK)\gtk\stock-icons\%d\gtk-media-next-ltr.png $(GTK)\gtk\stock-icons\%d\gtk-media-previous-rtl.png \
	& copy /y $(GTK)\gtk\stock-icons\%d\gtk-media-forward-ltr.png $(GTK)\gtk\stock-icons\%d\gtk-media-rewind-rtl.png \
	& copy /y $(GTK)\gtk\stock-icons\%d\gtk-floppy.png $(GTK)\gtk\stock-icons\%d\gtk-save.png)
	echo stamp-icons > $@
!endif

# inputim-am-et.dll
$(GTK)\modules\input\inputim-am-et.dll: $(GTK)\modules\input\imam-et.obj
	$(LINK) $(LNFLAGS) /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 $**
	if exist $@.manifest $(MT) -manifest $@.manifest -outputresource:$@;#2

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

# inputim-cedilla.dll
$(GTK)\modules\input\inputim-cedilla.dll: $(GTK)\modules\input\imcedilla.obj
	$(LINK) $(LNFLAGS) /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 $**
	if exist $@.manifest $(MT) -manifest $@.manifest -outputresource:$@;#2

$(GTK)\modules\input\imcedilla.obj: $*.c
	$(CC) $(CLFLAGS) /DG_DISABLE_DEPRECATED /DGDK_PIXBUF_DISABLE_DEPRECATED /DGDK_DISABLE_DEPRECATED /DGTK_DISABLE_DEPRECATED /I$(GTK) /I$(GTK)\gdk /I$(CAIRO)\src /I$(GLIB) /I$(GLIB)\glib /I$(GLIB)\gmodule /I$(PANGO) $**

# inputim-cyrillic-translit.dll
$(GTK)\modules\input\inputim-cyrillic-translit.dll: $(GTK)\modules\input\imcyrillic-translit.obj
	$(LINK) $(LNFLAGS) /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 $**
	if exist $@.manifest $(MT) -manifest $@.manifest -outputresource:$@;#2

$(GTK)\modules\input\imcyrillic-translit.obj: $*.c
	$(CC) $(CLFLAGS) /DG_DISABLE_DEPRECATED /DGDK_PIXBUF_DISABLE_DEPRECATED /DGDK_DISABLE_DEPRECATED /DGTK_DISABLE_DEPRECATED /I$(GTK) /I$(GTK)\gdk /I$(CAIRO)\src /I$(GLIB) /I$(GLIB)\glib /I$(GLIB)\gmodule /I$(PANGO) $**

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

$(GTK)\modules\input\inputim-ime.dll: $(imime_OBJECTS)
	$(LINK) $(LNFLAGS) /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 $**
	if exist $@.manifest $(MT) -manifest $@.manifest -outputresource:$@;#2

$(imime_OBJECTS):
	$(CC) $(CLFLAGS) /I$(ATK) /I$(CAIRO)\src /I$(GLIB) /I$(GLIB)\glib /I$(GLIB)\gmodule /I$(GTK) /I$(GTK)\gdk /I$(PANGO) $*.c

# inputim-inuktitut.dll
$(GTK)\modules\input\inputim-inuktitut.dll: $(GTK)\modules\input\iminuktitut.obj
	$(LINK) $(LNFLAGS) /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 $**
	if exist $@.manifest $(MT) -manifest $@.manifest -outputresource:$@;#2

$(GTK)\modules\input\iminuktitut.obj: $*.c
	$(CC) $(CLFLAGS) /DG_DISABLE_DEPRECATED /DGDK_PIXBUF_DISABLE_DEPRECATED /DGDK_DISABLE_DEPRECATED /DGTK_DISABLE_DEPRECATED /I$(GTK) /I$(GTK)\gdk /I$(CAIRO)\src /I$(GLIB) /I$(GLIB)\glib /I$(GLIB)\gmodule /I$(PANGO) $**

# inputim-ipa.dll
$(GTK)\modules\input\inputim-ipa.dll: $(GTK)\modules\input\imipa.obj
	$(LINK) $(LNFLAGS) /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 $**
	if exist $@.manifest $(MT) -manifest $@.manifest -outputresource:$@;#2

$(GTK)\modules\input\imipa.obj: $*.c
	$(CC) $(CLFLAGS) /DG_DISABLE_DEPRECATED /DGDK_PIXBUF_DISABLE_DEPRECATED /DGDK_DISABLE_DEPRECATED /DGTK_DISABLE_DEPRECATED /I$(GTK) /I$(GTK)\gdk /I$(CAIRO)\src /I$(GLIB) /I$(GLIB)\glib /I$(GLIB)\gmodule /I$(PANGO) $**

# inputim-thai.dll
imthai_OBJECTS= \
		$(GTK)\modules\input\imthai.obj \
		$(GTK)\modules\input\gtkimcontextthai.obj \
		$(GTK)\modules\input\thai-charprop.obj

$(GTK)\modules\input\inputim-thai.dll: $(imthai_OBJECTS)
	$(LINK) $(LNFLAGS) /DLL /EXPORT:im_module_create,@5 /EXPORT:im_module_exit,@1 /EXPORT:im_module_init,@2 /EXPORT:im_module_list,@3 $(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 $**
	if exist $@.manifest $(MT) -manifest $@.manifest -outputresource:$@;#2

$(imthai_OBJECTS):
	$(CC) $(CLFLAGS) /DG_DISABLE_DEPRECATED /DGDK_PIXBUF_DISABLE_DEPRECATED /DGDK_DISABLE_DEPRECATED /DGTK_DISABLE_DEPRECATED /I$(GTK) /I$(GTK)\gdk /I$(CAIRO)\src /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) $(LNFLAGS) /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 $**
	if exist $@.manifest $(MT) -manifest $@.manifest -outputresource:$@;#2

$(GTK)\modules\input\imti-er.obj: $*.c
	$(CC) $(CLFLAGS) /DG_DISABLE_DEPRECATED /DGDK_PIXBUF_DISABLE_DEPRECATED /DGDK_DISABLE_DEPRECATED /DGTK_DISABLE_DEPRECATED /I$(GTK) /I$(GTK)\gdk /I$(CAIRO)\src /I$(GLIB) /I$(GLIB)\glib /I$(GLIB)\gmodule /I$(PANGO) $**

# inputim-ti-et.dll
$(GTK)\modules\input\inputim-ti-et.dll: $(GTK)\modules\input\imti-et.obj
	$(LINK) $(LNFLAGS) /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 $**
	if exist $@.manifest $(MT) -manifest $@.manifest -outputresource:$@;#2

$(GTK)\modules\input\imti-et.obj: $*.c
	$(CC) $(CLFLAGS) /DG_DISABLE_DEPRECATED /DGDK_PIXBUF_DISABLE_DEPRECATED /DGDK_DISABLE_DEPRECATED /DGTK_DISABLE_DEPRECATED /I$(GTK) /I$(GTK)\gdk /I$(CAIRO)\src /I$(GLIB) /I$(GLIB)\glib /I$(GLIB)\gmodule /I$(PANGO) $**

# inputim-viqr.dll
$(GTK)\modules\input\inputim-viqr.dll: $(GTK)\modules\input\imviqr.obj
	$(LINK) $(LNFLAGS) /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 $**
	if exist $@.manifest $(MT) -manifest $@.manifest -outputresource:$@;#2

$(GTK)\modules\input\imviqr.obj: $*.c
	$(CC) $(CLFLAGS) /DG_DISABLE_DEPRECATED /DGDK_PIXBUF_DISABLE_DEPRECATED /DGDK_DISABLE_DEPRECATED /DGTK_DISABLE_DEPRECATED /I$(GTK) /I$(GTK)\gdk /I$(CAIRO)\src /I$(GLIB) /I$(GLIB)\glib /I$(GLIB)\gmodule /I$(PANGO) $**

# gtk-query-immodules-2.0.exe
$(GTK)\gtk\gtk-query-immodules-2.0.exe: $(GTK)\gtk\queryimmodules.obj
	$(LINK) $(LNFLAGS) $(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 $**
	if exist $@.manifest $(MT) -manifest $@.manifest -outputresource:$@;#1

$(GTK)\gtk\queryimmodules.obj: $*.c
	$(CC) $(CLFLAGS) /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=iwmnear /DPANGO_ENABLE_BACKEND /FImsvc_recommended_pragmas.h /I$(GTK) /I$(GTK)\gdk /I$(ATK) /I$(CAIRO)\src /I$(GLIB) /I$(GLIB)\glib /I$(GLIB)\gmodule /I$(PANGO) $**

###############################################################################
# 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) $(LNFLAGS) /DLL kernel32.lib $**
	if exist $@.manifest $(MT) -manifest $@.manifest -outputresource:$@;#2

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

$(LIBICONV)\libcharset\lib\relocatable.obj: $(LIBICONV)\libcharset\config.h
	$(CC) $(CLFLAGS) /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) $(CLFLAGS) /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) $(CLFLAGS) /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)\pnggccrd.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) $(LNFLAGS) /DLL /DEF:$(LIBPNG)\scripts\pngw32.def $(ZLIB)\zdll.lib $**
	if exist $@.manifest $(MT) -manifest $@.manifest -outputresource:$@;#2

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

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

###############################################################################
# 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)\jpeg.def $(jpeg_OBJECTS)
	$(LINK) $(LNFLAGS) /DEF:$(JPEG)\jpeg.def /DLL /IMPLIB:$(JPEG)\libjpeg.lib $(jpeg_OBJECTS)
	if exist $@.manifest $(MT) -manifest $@.manifest -outputresource:$@;#2

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

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

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

###############################################################################
# Pango                                                                       #
###############################################################################
pango: cairo glib \
		$(PANGO)\pango\libpango-1.0-0.dll \
		$(PANGO)\pango\libpangowin32-1.0-0.dll \
		$(PANGO)\pango\libpangocairo-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\module-defs-lang.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 \
!ifdef SVN
		$(PANGO)\pango\pango-gravity.obj \
!endif
		$(PANGO)\pango\pango-item.obj \
		$(PANGO)\pango\pango-layout.obj \
		$(PANGO)\pango\pango-markup.obj \
		$(PANGO)\pango\pango-matrix.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) $(LNFLAGS) /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 $**
	if exist $@.manifest $(MT) -manifest $@.manifest -outputresource:$@;#2

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

!ifdef SVN
$(PANGO)\pango\pango.rc: $@.in
	iwm\iwm-replace-win32.exe @PANGO_VERSION_MAJOR@=$(PANGO_MAJOR_VERSION) @PANGO_VERSION_MINOR@=$(PANGO_MINOR_VERSION) @PANGO_VERSION_MICRO@=$(PANGO_MICRO_VERSION) @PANGO_API_VERSION@=1.0 @PANGO_CURRENT_MINUS_AGE@=0 < $** > $@
!endif

!ifdef SVN
$(pango_OBJECTS): $(PANGO)\pango\pango-features.h $(PANGO)\pango\pango-enum-types.h
	$(CC) $(CLFLAGS) /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-features.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-gravity.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: $(pango_headers)
	$(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)\pango\pango-enum-types.h: $(pango_headers)
	$(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)\pango\pango-features.h:
	echo #ifndef PANGO_FEATURES_H > $@
	echo #define PANGO_FEATURES_H >> $@
	echo. >> $@
	echo #define PANGO_VERSION_MAJOR $(PANGO_MAJOR_VERSION) >> $@
	echo #define PANGO_VERSION_MINOR $(PANGO_MINOR_VERSION) >> $@
	echo #define PANGO_VERSION_MICRO $(PANGO_MICRO_VERSION) >> $@
	echo. >> $@
	echo #define PANGO_VERSION_STRING "$(PANGO_VERSION)" >> $@
	echo. >> $@
	echo #define PANGO_BINARY_AGE $(PANGO_BINARY_AGE) >> $@
	echo. >> $@
	echo #endif >> $@

$(PANGO)\pango\module-defs-lang.c: $(PANGO)\pango\module-defs.h
	echo /* Autogenerated by configure. Do not edit */ > $@
	echo. >> $@
	echo #include "module-defs.h" >> $@
	echo. >> $@
	echo PangoIncludedModule _pango_included_lang_modules[] = { >> $@
	echo  { NULL, NULL, NULL, NULL }, >> $@
	echo }; >> $@

$(PANGO)\pango\module-defs.h:
	echo /* Autogenerated by configure. Do not edit */ > $@
	echo. >> $@
	echo #include "modules.h" >> $@
!else
$(pango_OBJECTS):
	$(CC) $(CLFLAGS) /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
!endif

# 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) $(LNFLAGS) /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 $**
	if exist $@.manifest $(MT) -manifest $@.manifest -outputresource:$@;#2

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

!ifdef SVN
$(PANGO)\pango\pangowin32.rc: $@.in
	iwm\iwm-replace-win32.exe @PANGO_VERSION_MAJOR@=$(PANGO_MAJOR_VERSION) @PANGO_VERSION_MINOR@=$(PANGO_MINOR_VERSION) @PANGO_VERSION_MICRO@=$(PANGO_MICRO_VERSION) @PANGO_API_VERSION@=1.0 @PANGO_CURRENT_MINUS_AGE@=0 < $** > $@
!endif

$(pangowin32_OBJECTS): $(GLIB)\config.h
	$(CC) $(CLFLAGS) /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)\modules\basic\basic-win32.c $(PANGO)\pango\module-defs-win32.c
	$(CC) $(CLFLAGS) /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

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

# pangocairo
pangocairo_OBJECTS= \
		$(PANGO)\pango\pangocairo-font.obj \
		$(PANGO)\pango\pangocairo-fontmap.obj \
		$(PANGO)\pango\pangocairo-render.obj \
		$(PANGO)\pango\pangocairo-win32font.obj \
		$(PANGO)\pango\pangocairo-win32fontmap.obj

$(PANGO)\pango\libpangocairo-1.0-0.dll: $(pangocairo_OBJECTS)
	$(LINK) $(LNFLAGS) /DLL /DEF:$(PANGO)\pango\pangocairo.def /IMPLIB:$(PANGO)\pango\pangocairo-1.0.lib $(CAIRO)\src\cairo.lib $(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 $**
	if exist $@.manifest $(MT) -manifest $@.manifest -outputresource:$@;#2

$(pangocairo_OBJECTS): $(GLIB)\config.h
	$(CC) $(CLFLAGS) /DHAVE_CAIRO_WIN32 /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$(CAIRO)\src /I$(GLIB) /I$(GLIB)\glib $*.c

# pango-basic-win32
$(PANGO)\modules\basic\pango-basic-win32.dll: $(PANGO)\modules\basic\basic-win32.obj
	$(LINK) $(LNFLAGS) /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 $**
	if exist $@.manifest $(MT) -manifest $@.manifest -outputresource:$@;#2

$(PANGO)\modules\basic\basic-win32.obj: $*.c
	$(CC) $(CLFLAGS) /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 $**

# pango-querymodules
$(PANGO)\pango\pango-querymodules.exe: $(PANGO)\pango\querymodules.obj
	$(LINK) $(LNFLAGS) $(GLIB)\glib\glib-2.0.lib $(GLIB)\gmodule\gmodule-2.0.lib $(GLIB)\gobject\gobject-2.0.lib $(PANGO)\pango\pango-1.0.lib $**
	if exist $@.manifest $(MT) -manifest $@.manifest -outputresource:$@;#1

$(PANGO)\pango\querymodules.obj: $*.c
	$(CC) $(CLFLAGS) /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 $**

###############################################################################
# TIFF                                                                        #
###############################################################################
tiff: jpeg zlib $(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_version.obj \
		$(TIFF)\libtiff\tif_warning.obj \
		$(TIFF)\libtiff\tif_win32.obj \
		$(TIFF)\libtiff\tif_write.obj \
		$(TIFF)\libtiff\tif_zip.obj

$(TIFF)\libtiff\libtiff.dll: $(tiff_OBJECTS)
	$(LINK) $(LNFLAGS) /DLL /DEF:$(TIFF)\libtiff\libtiff.def $(JPEG)\libjpeg.lib $(ZLIB)\zdll.lib user32.lib $**
	if exist $@.manifest $(MT) -manifest $@.manifest -outputresource:$@;#2

$(tiff_OBJECTS): $(TIFF)\libtiff\tif_config.h $(TIFF)\libtiff\tiffconf.h
	$(CC) $(CLFLAGS) /DJPEG_SUPPORT /DTIF_PLATFORM_WINDOWED /DUSE_WIN32_FILEIO /I$(JPEG) /I$(ZLIB) $*.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) $(LNFLAGS) /DLL /DEF:$(ZLIB)\win32\zlib.def /IMPLIB:$(ZLIB)\zdll.lib $**
	if exist $@.manifest $(MT) -manifest $@.manifest -outputresource:$@;#2

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

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


###############################################################################
#                                                                             #
# Clean                                                                       #
#                                                                             #
###############################################################################
# ATK
atk_CLEANS= \
		$(ATK)\atk\libatk-1.0-0.dll \
		$(ATK)\atk\libatk-1.0-0.dll.manifest \
		$(ATK)\atk\atk-1.0.exp \
		$(ATK)\atk\atk-1.0.lib \
		$(ATK)\config.h \
!ifdef SVN
		$(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 \
!ifndef SVN
		iwm\atk\atkobject.obj \
!endif
		$(ATK)\atk\*.obj
# cairo
cairo_CLEANS= \
		$(CAIRO)\src\libcairo-2.dll \
		$(CAIRO)\src\libcairo-2.dll.manifest \
		$(CAIRO)\src\cairo.exp \
		$(CAIRO)\src\cairo.lib \
		$(CAIRO)\src\cairo.def \
		$(CAIRO)\src\cairo-features.h \
		$(CAIRO)\src\*.obj \
		$(CAIRO)\pixman\src\*.obj
# Expat
expat_CLEANS= \
		$(EXPAT)\lib\libexpat.dll \
		$(EXPAT)\lib\libexpat.dll.manifest \
		$(EXPAT)\lib\libexpat.exp \
		$(EXPAT)\lib\libexpat.lib \
		$(EXPAT)\lib\*.obj
# fontconfig
fontconfig_CLEANS= \
		$(FONTCONFIG)\src\libfontconfig-1.dll \
		$(FONTCONFIG)\src\libfontconfig-1.dll.manifest \
		$(FONTCONFIG)\src\fontconfig.def \
		$(FONTCONFIG)\src\fontconfig.exp \
		$(FONTCONFIG)\src\fontconfig.lib \
		$(FONTCONFIG)\src\*.obj \
		iwm\dirent\dirent.obj \
		iwm\fontconfig\fcaliastail.h \
		iwm\fontconfig\inttypes.h
# FreeType
freetype_CLEANS= \
		$(FREETYPE)\src\freetype6.dll \
		$(FREETYPE)\src\freetype6.dll.manifest \
		$(FREETYPE)\src\freetype.def \
		$(FREETYPE)\src\freetype.exp \
		$(FREETYPE)\src\freetype.lib \
		$(FREETYPE)\src\autofit\*.obj \
		$(FREETYPE)\src\base\*.obj \
		$(FREETYPE)\src\bdf\*.obj \
		$(FREETYPE)\src\cache\*.obj \
		$(FREETYPE)\src\cff\*.obj \
		$(FREETYPE)\src\cid\*.obj \
		$(FREETYPE)\src\gxvalid\*.obj \
		$(FREETYPE)\src\gzip\*.obj \
		$(FREETYPE)\src\lzw\*.obj \
		$(FREETYPE)\src\otvalid\*.obj \
		$(FREETYPE)\src\pcf\*.obj \
		$(FREETYPE)\src\pfr\*.obj \
		$(FREETYPE)\src\psaux\*.obj \
		$(FREETYPE)\src\pshinter\*.obj \
		$(FREETYPE)\src\psnames\*.obj \
		$(FREETYPE)\src\raster\*.obj \
		$(FREETYPE)\src\sfnt\*.obj \
		$(FREETYPE)\src\smooth\*.obj \
		$(FREETYPE)\src\truetype\*.obj \
		$(FREETYPE)\src\type1\*.obj \
		$(FREETYPE)\src\type42\*.obj \
		$(FREETYPE)\src\winfonts\*.obj
# gettext
gettext_CLEANS= \
		$(GETTEXT)\gettext-runtime\intl\intl.dll \
		$(GETTEXT)\gettext-runtime\intl\intl.dll.manifest \
		$(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\windows\intl.res \
		$(GETTEXT)\gettext-runtime\config.h \
		$(GETTEXT)\gettext-tools\src\msgfmt.exe \
		$(GETTEXT)\gettext-tools\src\msgfmt.exe.manifest \
		$(GETTEXT)\gettext-tools\gnulib-lib\*.obj \
		$(GETTEXT)\gettext-tools\src\*.obj \
		$(GETTEXT)\gettext-tools\config.h \
		$(GETTEXT)\gettext-tools\libintl.h \
		iwm\gettext\alloca.h \
		iwm\gettext\byteswap.h \
		iwm\gettext\configmake.h \
		iwm\gettext\fnmatch.h \
		iwm\gettext\getopt.h \
		iwm\gettext\stdbool.h \
		iwm\gettext\stdint.h \
		iwm\gettext\unistd.h \
		iwm\gettext\*.obj
# GLib
glib_CLEANS= \
		$(GLIB)\config.h \
!ifdef SVN
		$(GLIB)\config.h.win32 \
!endif
		$(GLIB)\glibconfig.h \
!ifdef SVN
		$(GLIB)\glibconfig.h.win32 \
!endif
		$(GLIB)\libintl.h \
		$(GLIB)\glib\libglib-2.0-0.dll \
		$(GLIB)\glib\libglib-2.0-0.dll.manifest \
		$(GLIB)\glib\glib-2.0.exp \
		$(GLIB)\glib\glib-2.0.lib \
		$(GLIB)\glib\gspawn-win32-helper.exe \
		$(GLIB)\glib\gspawn-win32-helper.exe.manifest \
		$(GLIB)\glib\gnulib\*.obj \
		$(GLIB)\glib\libcharset\localcharset.obj \
!ifdef SVN
		$(GLIB)\glib\galias.h \
		$(GLIB)\glib\galiasdef.c \
!endif
		$(GLIB)\glib\glib.def \
!ifdef SVN
		$(GLIB)\glib\glib.rc \
!endif
		$(GLIB)\glib\glib.res \
		$(GLIB)\glib\*.obj \
		$(GLIB)\gmodule\libgmodule-2.0-0.dll \
		$(GLIB)\gmodule\libgmodule-2.0-0.dll.manifest \
		$(GLIB)\gmodule\gmodule-2.0.exp \
		$(GLIB)\gmodule\gmodule-2.0.lib \
		$(GLIB)\gmodule\gmodule.obj \
!ifdef SVN
		$(GLIB)\gmodule\gmodule.rc \
!endif
		$(GLIB)\gmodule\gmodule.res \
		$(GLIB)\gmodule\gmoduleconf.h \
		$(GLIB)\gobject\libgobject-2.0-0.dll \
		$(GLIB)\gobject\libgobject-2.0-0.dll.manifest \
		$(GLIB)\gobject\gobject-2.0.exp \
		$(GLIB)\gobject\gobject-2.0.lib \
		$(GLIB)\gobject\glib-genmarshal.exe \
		$(GLIB)\gobject\glib-genmarshal.exe.manifest \
!ifdef SVN
		$(GLIB)\gobject\glib-mkenums \
		$(GLIB)\gobject\gmarshal.c \
		$(GLIB)\gobject\gmarshal.h \
!endif
		$(GLIB)\gobject\gobject.def \
!ifdef SVN
		$(GLIB)\gobject\gobject.rc \
!endif
		$(GLIB)\gobject\gobject.res \
!ifdef SVN
		$(GLIB)\gobject\gobjectalias.h \
		$(GLIB)\gobject\gobjectaliasdef.c \
!endif
		$(GLIB)\gobject\*.obj \
		$(GLIB)\gthread\libgthread-2.0-0.dll \
		$(GLIB)\gthread\libgthread-2.0-0.dll.manifest \
		$(GLIB)\gthread\gthread-2.0.exp \
		$(GLIB)\gthread\gthread-2.0.lib \
!ifdef SVN
		$(GLIB)\gthread\gthread.rc \
!endif
		$(GLIB)\gthread\gthread.res \
		$(GLIB)\gthread\gthread-impl.obj \
		iwm\dirent\dirent.obj \
		iwm\dirent\wdirent.obj
# GTK+
gdk_pixbuf_CLEANS= \
		$(GTK)\config.h \
!ifdef SVN
		$(GTK)\config.h.win32 \
!endif
		$(GTK)\gdk-pixbuf\libgdk_pixbuf-2.0-0.dll \
		$(GTK)\gdk-pixbuf\libgdk_pixbuf-2.0-0.dll.manifest \
		$(GTK)\gdk-pixbuf\gdk_pixbuf-2.0.exp \
		$(GTK)\gdk-pixbuf\gdk_pixbuf-2.0.lib \
		$(GTK)\gdk-pixbuf\gdk-pixbuf-query-loaders.exe \
		$(GTK)\gdk-pixbuf\gdk-pixbuf-query-loaders.exe.manifest \
!ifdef SVN
		$(GTK)\gdk-pixbuf\gdk-pixbuf-csource.exe \
		$(GTK)\gdk-pixbuf\gdk-pixbuf-csource.exe.manifest \
!endif
		$(GTK)\gdk-pixbuf\pixops\*.obj \
!ifdef SVN
		$(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 SVN
		$(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
gdk_pixbuf_loader_0_CLEANS= \
		$(GTK)\gdk-pixbuf\libpixbufloader-ani.dll \
		$(GTK)\gdk-pixbuf\libpixbufloader-ani.dll.manifest \
		$(GTK)\gdk-pixbuf\libpixbufloader-ani.exp \
		$(GTK)\gdk-pixbuf\libpixbufloader-ani.lib \
		$(GTK)\gdk-pixbuf\libpixbufloader-bmp.dll \
		$(GTK)\gdk-pixbuf\libpixbufloader-bmp.dll.manifest \
		$(GTK)\gdk-pixbuf\libpixbufloader-bmp.exp \
		$(GTK)\gdk-pixbuf\libpixbufloader-bmp.lib \
		$(GTK)\gdk-pixbuf\libpixbufloader-gif.dll \
		$(GTK)\gdk-pixbuf\libpixbufloader-gif.dll.manifest \
		$(GTK)\gdk-pixbuf\libpixbufloader-gif.exp \
		$(GTK)\gdk-pixbuf\libpixbufloader-gif.lib \
		$(GTK)\gdk-pixbuf\libpixbufloader-ico.dll \
		$(GTK)\gdk-pixbuf\libpixbufloader-ico.dll.manifest \
		$(GTK)\gdk-pixbuf\libpixbufloader-ico.exp \
		$(GTK)\gdk-pixbuf\libpixbufloader-ico.lib \
		$(GTK)\gdk-pixbuf\libpixbufloader-jpeg.dll \
		$(GTK)\gdk-pixbuf\libpixbufloader-jpeg.dll.manifest \
		$(GTK)\gdk-pixbuf\libpixbufloader-jpeg.exp \
		$(GTK)\gdk-pixbuf\libpixbufloader-jpeg.lib \
		$(GTK)\gdk-pixbuf\libpixbufloader-pcx.dll \
		$(GTK)\gdk-pixbuf\libpixbufloader-pcx.dll.manifest \
		$(GTK)\gdk-pixbuf\libpixbufloader-pcx.exp \
		$(GTK)\gdk-pixbuf\libpixbufloader-pcx.lib \
		$(GTK)\gdk-pixbuf\libpixbufloader-png.dll \
		$(GTK)\gdk-pixbuf\libpixbufloader-png.dll.manifest \
		$(GTK)\gdk-pixbuf\libpixbufloader-png.exp \
		$(GTK)\gdk-pixbuf\libpixbufloader-png.lib
gdk_pixbuf_loader_1_CLEANS= \
		$(GTK)\gdk-pixbuf\libpixbufloader-pnm.dll \
		$(GTK)\gdk-pixbuf\libpixbufloader-pnm.dll.manifest \
		$(GTK)\gdk-pixbuf\libpixbufloader-pnm.exp \
		$(GTK)\gdk-pixbuf\libpixbufloader-pnm.lib \
		$(GTK)\gdk-pixbuf\libpixbufloader-ras.dll \
		$(GTK)\gdk-pixbuf\libpixbufloader-ras.dll.manifest \
		$(GTK)\gdk-pixbuf\libpixbufloader-ras.exp \
		$(GTK)\gdk-pixbuf\libpixbufloader-ras.lib \
		$(GTK)\gdk-pixbuf\libpixbufloader-tga.dll \
		$(GTK)\gdk-pixbuf\libpixbufloader-tga.dll.manifest \
		$(GTK)\gdk-pixbuf\libpixbufloader-tga.exp \
		$(GTK)\gdk-pixbuf\libpixbufloader-tga.lib \
		$(GTK)\gdk-pixbuf\libpixbufloader-tiff.dll \
		$(GTK)\gdk-pixbuf\libpixbufloader-tiff.dll.manifest \
		$(GTK)\gdk-pixbuf\libpixbufloader-tiff.exp \
		$(GTK)\gdk-pixbuf\libpixbufloader-tiff.lib \
		$(GTK)\gdk-pixbuf\libpixbufloader-wbmp.dll \
		$(GTK)\gdk-pixbuf\libpixbufloader-wbmp.dll.manifest \
		$(GTK)\gdk-pixbuf\libpixbufloader-wbmp.exp \
		$(GTK)\gdk-pixbuf\libpixbufloader-wbmp.lib \
		$(GTK)\gdk-pixbuf\libpixbufloader-xbm.dll \
		$(GTK)\gdk-pixbuf\libpixbufloader-xbm.dll.manifest \
		$(GTK)\gdk-pixbuf\libpixbufloader-xbm.exp \
		$(GTK)\gdk-pixbuf\libpixbufloader-xbm.lib \
		$(GTK)\gdk-pixbuf\libpixbufloader-xpm.dll \
		$(GTK)\gdk-pixbuf\libpixbufloader-xpm.dll.manifest \
		$(GTK)\gdk-pixbuf\libpixbufloader-xpm.exp \
		$(GTK)\gdk-pixbuf\libpixbufloader-xpm.lib
gdk_CLEANS= \
		$(GTK)\gdk\libgdk-win32-2.0-0.dll \
		$(GTK)\gdk\libgdk-win32-2.0-0.dll.manifest \
		$(GTK)\gdk\gdk-win32-2.0.exp \
		$(GTK)\gdk\gdk-win32-2.0.lib \
!ifdef SVN
		$(GTK)\gdk\win32\rc\gdk.rc \
!endif
		$(GTK)\gdk\win32\rc\gdk.res \
		$(GTK)\gdk\win32\*.obj \
!ifdef SVN
		$(GTK)\gdk\gdk.def \
		$(GTK)\gdk\gdkalias.h \
		$(GTK)\gdk\gdkaliasdef.c \
!endif
		$(GTK)\gdk\gdkconfig.h \
!ifdef SVN
		$(GTK)\gdk\gdkenumtypes.c \
		$(GTK)\gdk\gdkenumtypes.h \
		$(GTK)\gdk\gdkmarshalers.h \
!endif
		$(GTK)\gdk\*.obj
gtk_CLEANS= \
		$(GTK)\gtk\libgtk-win32-2.0-0.dll \
		$(GTK)\gtk\libgtk-win32-2.0-0.dll.manifest \
		$(GTK)\gtk\gtk-win32-2.0.exp \
		$(GTK)\gtk\gtk-win32-2.0.lib \
!ifdef SVN
		$(GTK)\gtk\gtk-update-icon-cache.exe \
		$(GTK)\gtk\gtk-update-icon-cache.exe.manifest \
		$(GTK)\gtk\gtk.def \
		$(GTK)\gtk\gtkalias.h \
		$(GTK)\gtk\gtkaliasdef.c \
		$(GTK)\gtk\gtkbuiltincache.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 \
		$(GTK)\gtk\stamp-icons \
!endif
		$(GTK)\gtk\*.obj
gtk_stock_icons_CLEANS= \
		gtk-go-back-rtl.png \
		gtk-go-forward-rtl.png \
		gtk-goto-first-rtl.png \
		gtk-goto-last-rtl.png \
		gtk-media-forward-rtl.png \
		gtk-media-next-rtl.png \
		gtk-media-previous-rtl.png \
		gtk-media-rewind-rtl.png \
		gtk-save.png
gtk_modules_CLEANS= \
		$(GTK)\modules\input\inputim-am-et.dll \
		$(GTK)\modules\input\inputim-am-et.dll.manifest \
		$(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.dll.manifest \
		$(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.dll.manifest \
		$(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.dll.manifest \
		$(GTK)\modules\input\inputim-ime.exp \
		$(GTK)\modules\input\inputim-ime.lib \
		$(GTK)\modules\input\inputim-inuktitut.dll \
		$(GTK)\modules\input\inputim-inuktitut.dll.manifest \
		$(GTK)\modules\input\inputim-inuktitut.exp \
		$(GTK)\modules\input\inputim-inuktitut.lib \
		$(GTK)\modules\input\inputim-ipa.dll \
		$(GTK)\modules\input\inputim-ipa.dll.manifest \
		$(GTK)\modules\input\inputim-ipa.exp \
		$(GTK)\modules\input\inputim-ipa.lib \
		$(GTK)\modules\input\inputim-thai.dll \
		$(GTK)\modules\input\inputim-thai.dll.manifest \
		$(GTK)\modules\input\inputim-thai.exp \
		$(GTK)\modules\input\inputim-thai.lib \
		$(GTK)\modules\input\inputim-ti-er.dll \
		$(GTK)\modules\input\inputim-ti-er.dll.manifest \
		$(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.dll.manifest \
		$(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.dll.manifest \
		$(GTK)\modules\input\inputim-viqr.exp \
		$(GTK)\modules\input\inputim-viqr.lib \
		$(GTK)\modules\input\*.obj
gtk_query_CLEANS= \
		$(GTK)\gtk\gtk-query-immodules-2.0.exe \
		$(GTK)\gtk\gtk-query-immodules-2.0.exe.manifest
# JPEG
jpeg_CLEANS= \
		$(JPEG)\jpeg62.dll \
		$(JPEG)\jpeg62.dll.manifest \
		$(JPEG)\libjpeg.exp \
		$(JPEG)\libjpeg.lib \
		$(JPEG)\jpeg.def \
		$(JPEG)\jconfig.h \
		$(JPEG)\*.obj
# libiconv
libiconv_CLEANS= \
		$(LIBICONV)\lib\iconv.dll \
		$(LIBICONV)\lib\iconv.dll.manifest \
		$(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)\lib\*.obj
# libpng
libpng_CLEANS= \
		$(LIBPNG)\libpng13.dll \
		$(LIBPNG)\libpng13.dll.manifest \
		$(LIBPNG)\libpng13.exp \
		$(LIBPNG)\libpng13.lib \
		$(LIBPNG)\scripts\pngw32.res \
		$(LIBPNG)\*.obj \
		iwm\libpng\*.obj
# Pango
pango_CLEANS= \
		$(PANGO)\pango\libpango-1.0-0.dll \
		$(PANGO)\pango\libpango-1.0-0.dll.manifest \
		$(PANGO)\pango\pango-1.0.exp \
		$(PANGO)\pango\pango-1.0.lib \
		$(PANGO)\pango\pango.res \
!ifdef SVN
		$(PANGO)\pango\pango-features.h \
		$(PANGO)\pango\pango.rc \
!endif
		$(PANGO)\pango\mini-fribidi\*.obj \
		$(PANGO)\pango\opentype\*.obj \
		$(PANGO)\pango\*.obj \
		$(PANGO)\pango\libpangowin32-1.0-0.dll \
		$(PANGO)\pango\libpangowin32-1.0-0.dll.manifest \
		$(PANGO)\pango\pangowin32-1.0.exp \
		$(PANGO)\pango\pangowin32-1.0.lib \
		$(PANGO)\pango\pangowin32.res \
!ifdef SVN
		$(PANGO)\pango\pangowin32.rc \
		$(PANGO)\pango\module-defs.h \
		$(PANGO)\pango\module-defs-lang.c \
		$(PANGO)\pango\module-defs-win32.c \
		$(PANGO)\pango\pango-enum-types.c \
		$(PANGO)\pango\pango-enum-types.h \
!endif
		$(PANGO)\pango\pango-querymodules.exe \
		$(PANGO)\pango\pango-querymodules.exe.manifest
pango_modules_CLEANS= \
		$(PANGO)\modules\basic\pango-basic-win32.dll \
		$(PANGO)\modules\basic\pango-basic-win32.dll.manifest \
		$(PANGO)\modules\basic\pango-basic-win32.exp \
		$(PANGO)\modules\basic\pango-basic-win32.lib \
		$(PANGO)\modules\basic\basic-win32.obj
# TIFF
tiff_CLEANS= \
		$(TIFF)\libtiff\libtiff.dll \
		$(TIFF)\libtiff\libtiff.dll.manifest \
		$(TIFF)\libtiff\libtiff.exp \
		$(TIFF)\libtiff\libtiff.lib \
		$(TIFF)\libtiff\tif_config.h \
		$(TIFF)\libtiff\tiffconf.h \
		$(TIFF)\libtiff\*.obj
# zlib
zlib_CLEANS= \
		$(ZLIB)\zlib1.dll \
		$(ZLIB)\zlib1.dll.manifest \
		$(ZLIB)\zdll.exp \
		$(ZLIB)\zdll.lib \
		$(ZLIB)\zlib1.res \
		$(ZLIB)\*.obj
# iwm
iwm_CLEANS= \
		iwm\iwm-forwarding-win32.exe \
		iwm\iwm-forwarding-win32.exe.manifest \
		iwm\iwm-forwarding-win32.obj \
		iwm\iwm-makedef-win32.exe \
		iwm\iwm-makedef-win32.exe.manifest \
		iwm\iwm-makedef-win32.obj \
		iwm\iwm-replace-win32.exe \
		iwm\iwm-replace-win32.exe.manifest \
		iwm\iwm-replace-win32.obj \
		iwm\pango-makealiases-win32.exe \
		iwm\pango-makealiases-win32.exe.manifest \
		iwm\pango-makealiases-win32.obj \
		iwm\libiconv2.dll \
		iwm\libiconv2.def \
		iwm\libiconv2.exp \
		iwm\libiconv2.lib \
		iwm\libintl3.dll \
		iwm\libintl3.def \
		iwm\libintl3.exp \
		iwm\libintl3.lib \
		iwm\libtiff3.dll \
		iwm\libtiff3.def \
		iwm\libtiff3.exp \
		iwm\libtiff3.lib

clean: atk_clean cairo_clean expat_clean fontconfig_clean freetype_clean gettext_clean glib_clean gtk_clean jpeg_clean libiconv_clean libpng_clean pango_clean tiff_clean zlib_clean iwm_clean

!ifdef SVN
cvs_clean: atk_clean cairo_clean glib_clean gtk_clean pango_clean iwm_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
	if exist $(CAIRO)\src\cairo-features.h~ move /y $(CAIRO)\src\cairo-features.h~ $(CAIRO)\src\cairo-features.h

expat_clean:
	for %f in ($(expat_CLEANS)) do if exist %f del /q %f

fontconfig_clean:
	for %f in ($(fontconfig_CLEANS)) do if exist %f del /q %f

freetype_clean:
	for %f in ($(freetype_CLEANS)) do if exist %f del /q %f

gettext_clean:
	for %f in ($(gettext_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 ($(gdk_pixbuf_CLEANS)) do if exist %f del /q %f
	for %f in ($(gdk_pixbuf_loader_0_CLEANS)) do if exist %f del /q %f
	for %f in ($(gdk_pixbuf_loader_1_CLEANS)) do if exist %f del /q %f
	for %f in ($(gdk_CLEANS)) do if exist %f del /q %f
	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
	for %f in ($(gtk_query_CLEANS)) do if exist %f del /q %f
!ifdef SVN
	for %d in (16 24) do for %f in ($(gtk_stock_icons_CLEANS)) do if exist $(GTK)\gtk\stock-icons\%d\%f del /q $(GTK)\gtk\stock-icons\%d\%f
!endif

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

iwm_clean:
	for %f in ($(iwm_CLEANS)) do if exist %f del /q %f


###############################################################################
#                                                                             #
# Install & Uninstall                                                         #
#                                                                             #
###############################################################################
atk_HEADERS= \
		atk.h \
		atkobject.h \
		atkaction.h \
		atkcomponent.h \
		atkdocument.h \
		atkeditabletext.h \
		atkgobjectaccessible.h \
		atkhyperlink.h \
		atkhyperlinkimpl.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
freetype_0_HEADERS= \
		freetype.h \
		ftbbox.h \
		ftbdf.h \
		ftbitmap.h \
		ftcache.h \
		ftchapters.h \
		fterrdef.h \
		fterrors.h \
		ftglyph.h \
		ftgxval.h \
		ftgzip.h \
		ftimage.h \
		ftincrem.h \
		ftlist.h \
		ftlzw.h \
		ftmac.h \
		ftmm.h \
		ftmodapi.h \
		ftmoderr.h \
		ftotval.h \
		ftoutln.h \
		ftpfr.h \
		ftrender.h \
		ftsizes.h \
		ftsnames.h \
		ftstroke.h \
		ftsynth.h \
		ftsystem.h \
		fttrigon.h \
		fttypes.h \
		ftwinfnt.h \
		ftxf86.h \
		t1tables.h \
		ttnameid.h \
		tttables.h \
		tttags.h \
		ttunpat.h
freetype_1_HEADERS= \
		ftconfig.h \
		ftheader.h \
		ftmodule.h \
		ftoption.h \
		ftstdlib.h
freetype_2_HEADERS= \
		autohint.h \
		ftcalc.h \
		ftdebug.h \
		ftdriver.h \
		ftgloadr.h \
		ftmemory.h \
		ftobjs.h \
		ftrfork.h \
		ftserv.h \
		ftstream.h \
		fttrace.h \
		ftvalid.h \
		internal.h \
		pcftypes.h \
		psaux.h \
		pshints.h \
		sfnt.h \
		t1types.h \
		tttypes.h
glib_HEADERS= \
		galloca.h \
		garray.h \
		gasyncqueue.h \
		gatomic.h \
		gbacktrace.h \
		gbase64.h	\
		gbookmarkfile.h \
		gcache.h \
		gcompletion.h \
		gconvert.h \
		gdataset.h \
		gdate.h \
		gdir.h \
		gerror.h \
		gfileutils.h \
		ghash.h \
		ghook.h \
		gi18n.h \
		gi18n-lib.h \
		giochannel.h \
		gkeyfile.h \
		glist.h \
		gmacros.h \
		gmain.h \
		gmappedfile.h \
		gmarkup.h \
		gmem.h \
		gmessages.h \
		gnode.h \
		goption.h \
		gpattern.h \
		gprimes.h \
		gprintf.h \
		gqsort.h \
		gquark.h \
		gqueue.h \
		grand.h \
		grel.h \
		gscanner.h \
!ifdef SVN
		gsequence.h	\
!endif
		gshell.h \
		gslice.h \
		gslist.h \
		gspawn.h \
		gstdio.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-marshal.h \
		gdk-pixbuf-simple-anim.h \
		gdk-pixbuf-transform.h \
		gdk-pixdata.h
gdk_HEADERS= \
		gdk.h \
		gdkcairo.h \
		gdkcolor.h \
		gdkcursor.h \
		gdkdisplay.h \
		gdkdisplaymanager.h \
		gdkdnd.h \
		gdkdrawable.h \
		gdkenumtypes.h \
		gdkevents.h \
		gdkfont.h \
		gdkgc.h \
		gdki18n.h \
		gdkimage.h \
		gdkinput.h \
		gdkkeys.h \
		gdkkeysyms.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 \
		gtkassistant.h \
		gtkbbox.h \
		gtkbin.h \
		gtkbindings.h \
		gtkbox.h \
		gtkbutton.h \
		gtkcalendar.h \
		gtkcelleditable.h \
		gtkcelllayout.h \
		gtkcellrenderer.h \
		gtkcellrendereraccel.h \
		gtkcellrenderercombo.h \
		gtkcellrendererpixbuf.h \
		gtkcellrendererprogress.h \
		gtkcellrendererspin.h \
		gtkcellrenderertext.h \
		gtkcellrenderertoggle.h \
		gtkcellview.h \
		gtkcheckbutton.h \
		gtkcheckmenuitem.h \
		gtkclipboard.h \
		gtkclist.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 \
		gtkfilesystem.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 \
		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 \
		gtklinkbutton.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
gtk_1_HEADERS= \
		gtknotebook.h \
		gtkobject.h \
		gtkoldeditable.h \
		gtkoptionmenu.h \
		gtkpagesetup.h \
		gtkpaned.h \
		gtkpapersize.h \
		gtkpixmap.h \
		gtkplug.h \
		gtkpreview.h \
		gtkprintcontext.h \
		gtkprintoperation.h \
		gtkprintoperationpreview.h \
		gtkprintsettings.h \
		gtkprivate.h \
		gtkprogress.h \
		gtkprogressbar.h \
		gtkradioaction.h \
		gtkradiobutton.h \
		gtkradiomenuitem.h \
		gtkradiotoolbutton.h \
		gtkrange.h \
		gtkrc.h \
		gtkrecentchooser.h \
		gtkrecentchooserdialog.h \
		gtkrecentchoosermenu.h \
		gtkrecentchooserwidget.h \
		gtkrecentfilter.h \
		gtkrecentmanager.h \
		gtkruler.h \
		gtkscale.h \
		gtkscrollbar.h \
		gtkscrolledwindow.h \
		gtkselection.h \
		gtkseparator.h \
		gtkseparatormenuitem.h \
		gtkseparatortoolitem.h \
		gtksettings.h \
		gtksignal.h \
		gtksizegroup.h \
		gtksocket.h \
		gtkspinbutton.h \
		gtkstatusbar.h \
		gtkstatusicon.h \
		gtkstock.h \
		gtkstyle.h \
		gtktable.h \
		gtktearoffmenuitem.h \
		gtktext.h \
		gtktextbuffer.h \
		gtktextbufferrichtext.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 \
!ifdef SVN
		pango-features.h \
!endif
		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 \
		pangocairo.h \
		pangofc-font.h \
		pangofc-fontmap.h \
		pangox.h \
		pangowin32.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.dll \
		inputim-ti-er.dll \
		inputim-ti-et.dll \
		inputim-viqr.dll
PO=		af am ang ar as az az_IR be bg bn bn_IN br bs ca cs cy da de dz el \
		en_CA en_GB eo es et eu fa fi fr ga gl gu he hi hr hu hy ia id is it \
		ja ka kn ko ku 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 te th tl tk tr tt \
		ug uk ur uz uz@Latn vi wa xh yi zh_CN zh_HK 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\$(CAIRO) mkdir $(PREFIX)\doc\$(CAIRO)
	if not exist $(PREFIX)\doc\$(CAIRO)\pixman mkdir $(PREFIX)\doc\$(CAIRO)\pixman
	if not exist $(PREFIX)\doc\$(EXPAT) mkdir $(PREFIX)\doc\$(EXPAT)
	if not exist $(PREFIX)\doc\$(FONTCONFIG) mkdir $(PREFIX)\doc\$(FONTCONFIG)
	if not exist $(PREFIX)\doc\$(FREETYPE) mkdir $(PREFIX)\doc\$(FREETYPE)
	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\$(LIBICONV) mkdir $(PREFIX)\doc\$(LIBICONV)
	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 $(CAIRO)\COPYING $(PREFIX)\doc\$(CAIRO)
	copy /y $(CAIRO)\COPYING-LGPL-2.1 $(PREFIX)\doc\$(CAIRO)
	copy /y $(CAIRO)\COPYING-MPL-1.1 $(PREFIX)\doc\$(CAIRO)
	copy /y $(CAIRO)\pixman\COPYING $(PREFIX)\doc\$(CAIRO)\pixman
	copy /y $(EXPAT)\COPYING $(PREFIX)\doc\$(EXPAT)
	copy /y $(FONTCONFIG)\COPYING $(PREFIX)\doc\$(FONTCONFIG)
	copy /y $(FREETYPE)\docs\LICENSE.TXT $(PREFIX)\doc\$(FREETYPE)
	copy /y $(FREETYPE)\docs\FTL.TXT $(PREFIX)\doc\$(FREETYPE)
	copy /y $(FREETYPE)\docs\GPL.TXT $(PREFIX)\doc\$(FREETYPE)
	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 $(LIBICONV)\COPYING.LIB $(PREFIX)\doc\$(LIBICONV)
	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
# cairo
	copy /y $(CAIRO)\src\libcairo-2.dll $(PREFIX)\bin
	copy /y $(CAIRO)\src\cairo.lib $(PREFIX)\lib
	copy /y $(CAIRO)\src\cairo.h $(PREFIX)\include
	copy /y $(CAIRO)\src\cairo-features.h $(PREFIX)\include
# Expat
	copy /y $(EXPAT)\lib\libexpat.dll $(PREFIX)\bin
	copy /y $(EXPAT)\lib\libexpat.lib $(PREFIX)\lib
	copy /y $(EXPAT)\lib\expat.h $(PREFIX)\include
# fontconfig
	copy /y $(FONTCONFIG)\src\libfontconfig-1.dll $(PREFIX)\bin
	copy /y $(FONTCONFIG)\src\fontconfig.lib $(PREFIX)\lib
	if not exist $(PREFIX)\include\fontconfig mkdir $(PREFIX)\include\fontconfig
	copy /y $(FONTCONFIG)\fontconfig\fcfreetype.h $(PREFIX)\include\fontconfig
	copy /y $(FONTCONFIG)\fontconfig\fcprivate.h $(PREFIX)\include\fontconfig
	copy /y $(FONTCONFIG)\fontconfig\fontconfig.h $(PREFIX)\include\fontconfig
# FreeType
	copy /y $(FREETYPE)\src\freetype6.dll $(PREFIX)\bin
	copy /y $(FREETYPE)\src\freetype.lib $(PREFIX)\lib
	if not exist $(PREFIX)\include\freetype mkdir $(PREFIX)\include\freetype
	if not exist $(PREFIX)\include\freetype\config mkdir $(PREFIX)\include\freetype\config
	if not exist $(PREFIX)\include\freetype\internal mkdir $(PREFIX)\include\freetype\internal
	copy /y $(FREETYPE)\include\ft2build.h $(PREFIX)\include
	for %f in ($(freetype_0_HEADERS)) do copy /y $(FREETYPE)\include\freetype\%f $(PREFIX)\include\freetype
	for %f in ($(freetype_1_HEADERS)) do copy /y $(FREETYPE)\include\freetype\config\%f $(PREFIX)\include\freetype\config
	for %f in ($(freetype_2_HEADERS)) do copy /y $(FREETYPE)\include\freetype\internal\%f $(PREFIX)\include\freetype\internal
# 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
# 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)\gdk-pixbuf\gdk-pixbuf-query-loaders.exe $(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)\loaders mkdir $(PREFIX)\lib\gtk-2.0\$(GTK_VERSION)\loaders
	if not exist $(PREFIX)\lib\gtk-2.0\$(GTK_VERSION)\immodules mkdir $(PREFIX)\lib\gtk-2.0\$(GTK_VERSION)\immodules
	for %f in ($(gdk_pixbuf_LOADERS)) do copy /y $(GTK)\gdk-pixbuf\%f $(PREFIX)\lib\gtk-2.0\$(GTK_VERSION)\loaders
	for %f in ($(gtk_MODULES)) do copy /y $(GTK)\modules\input\%f $(PREFIX)\lib\gtk-2.0\$(GTK_VERSION)\immodules
# JPEG
	copy /y $(JPEG)\jpeg62.dll $(PREFIX)\bin
	copy /y $(JPEG)\libjpeg.lib $(PREFIX)\lib
	copy /y $(JPEG)\jconfig.h $(PREFIX)\include
	copy /y $(JPEG)\jerror.h $(PREFIX)\include
	copy /y $(JPEG)\jmorecfg.h $(PREFIX)\include
	copy /y $(JPEG)\jpeglib.h $(PREFIX)\include
# libiconv
	copy /y $(LIBICONV)\lib\iconv.dll $(PREFIX)\bin
	copy /y $(LIBICONV)\lib\iconv.lib $(PREFIX)\lib
	copy /y $(LIBICONV)\include\iconv.h $(PREFIX)\include
# libpng
	copy /y $(LIBPNG)\libpng13.dll $(PREFIX)\bin
	copy /y $(LIBPNG)\libpng13.lib $(PREFIX)\lib
	copy /y $(LIBPNG)\png.h $(PREFIX)\include
	copy /y $(LIBPNG)\pngconf.h $(PREFIX)\include
# 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\libpangocairo-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
	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
	copy /y $(TIFF)\libtiff\libtiff.lib $(PREFIX)\lib
	copy /y $(TIFF)\libtiff\tiff.h $(PREFIX)\include
	copy /y $(TIFF)\libtiff\tiffconf.h $(PREFIX)\include
	copy /y $(TIFF)\libtiff\tiffio.h $(PREFIX)\include
	copy /y $(TIFF)\libtiff\tiffvers.h $(PREFIX)\include
# zlib
	copy /y $(ZLIB)\zlib1.dll $(PREFIX)\bin
	copy /y $(ZLIB)\zdll.lib $(PREFIX)\lib
	copy /y $(ZLIB)\zlib.h $(PREFIX)\include
	copy /y $(ZLIB)\zconf.h $(PREFIX)\include
# iwm
	copy /y iwm\pango-makealiases-win32.exe $(PREFIX)\bin
	copy /y iwm\libiconv2.dll $(PREFIX)\bin
	copy /y iwm\libintl3.dll $(PREFIX)\bin
	copy /y iwm\libtiff3.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 SVN
	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 if exist $(ATK)\po\%f.gmo copy /y $(ATK)\po\%f.gmo $(PREFIX)\lib\locale\%f\LC_MESSAGES\atk10.mo
	for %f in ($(PO)) do if exist $(GLIB)\po\%f.gmo copy /y $(GLIB)\po\%f.gmo $(PREFIX)\lib\locale\%f\LC_MESSAGES\glib20.mo
	for %f in ($(PO)) do if exist $(GTK)\po\%f.gmo 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
	iwm\pango-makealiases-win32.exe > $(PREFIX)\etc\pango\pango.aliases
	$(PREFIX)\bin\gdk-pixbuf-query-loaders.exe > $(PREFIX)\etc\gtk-2.0\gdk-pixbuf.loaders
	$(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
# cairo
	if exist $(PREFIX)\bin\libcairo-2.dll del /q $(PREFIX)\bin\libcairo-2.dll
	if exist $(PREFIX)\lib\cairo.lib del /q $(PREFIX)\lib\cairo.lib
	if exist $(PREFIX)\include\cairo.h del /q $(PREFIX)\include\cairo.h
	if exist $(PREFIX)\include\cairo-features.h del /q $(PREFIX)\include\cairo-features.h
# Expat
	if exist $(PREFIX)\bin\libexpat.dll del /q $(PREFIX)\bin\libexpat.dll
	if exist $(PREFIX)\lib\libexpat.lib del /q $(PREFIX)\lib\libexpat.lib
	if exist $(PREFIX)\include\expat.h del /q $(PREFIX)\include\expat.h
# fontconfig
	if exist $(PREFIX)\bin\libfontconfig-1.dll del /q $(PREFIX)\bin\libfontconfig-1.dll
	if exist $(PREFIX)\lib\fontconfig.lib del /q $(PREFIX)\lib\fontconfig.lib
	if exist $(PREFIX)\include\fontconfig\fcfreetype.h del /q $(PREFIX)\include\fontconfig\fcfreetype.h
	if exist $(PREFIX)\include\fontconfig\fcprivate.h del /q $(PREFIX)\include\fontconfig\fcprivate.h
	if exist $(PREFIX)\include\fontconfig\fontconfig.h del /q $(PREFIX)\include\fontconfig\fontconfig.h
# FreeType
	if exist $(PREFIX)\bin\freetype6.dll del /q $(PREFIX)\bin\freetype6.dll
	if exist $(PREFIX)\lib\freetype.lib del /q $(PREFIX)\lib\freetype.lib
	if exist $(PREFIX)\include\ft2build.h del /q $(PREFIX)\include\ft2build.h
	for %f in ($(freetype_0_HEADERS)) do if exist $(PREFIX)\include\freetype\%f del /q $(PREFIX)\include\freetype\%f
	for %f in ($(freetype_1_HEADERS)) do if exist $(PREFIX)\include\freetype\config\%f del /q $(PREFIX)\include\freetype\config\%f
	for %f in ($(freetype_2_HEADERS)) do if exist $(PREFIX)\include\freetype\internal\%f del /q $(PREFIX)\include\freetype\internal\%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
# 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\gdk-pixbuf-query-loaders.exe del /q $(PREFIX)\bin\gdk-pixbuf-query-loaders.exe
	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 ($(gdk_pixbuf_LOADERS)) do if exist $(PREFIX)\lib\gtk-2.0\$(GTK_VERSION)\loaders\%f del /q $(PREFIX)\lib\gtk-2.0\$(GTK_VERSION)\loaders\%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
# JPEG
	if exist $(PREFIX)\bin\jpeg62.dll del /q $(PREFIX)\bin\jpeg62.dll
	if exist $(PREFIX)\lib\libjpeg.lib del /q $(PREFIX)\lib\libjpeg.lib
	if exist $(PREFIX)\include\jconfig.h del /q $(PREFIX)\include\jconfig.h
	if exist $(PREFIX)\include\jerror.h del /q $(PREFIX)\include\jerror.h
	if exist $(PREFIX)\include\jmorecfg.h del /q $(PREFIX)\include\jmorecfg.h
	if exist $(PREFIX)\include\jpeglib.h del /q $(PREFIX)\include\jpeglib.h
# libiconv
	if exist $(PREFIX)\bin\iconv.dll del /q $(PREFIX)\bin\iconv.dll
	if exist $(PREFIX)\lib\iconv.lib del /q $(PREFIX)\lib\iconv.lib
	if exist $(PREFIX)\include\iconv.h del /q $(PREFIX)\include\iconv.h
# libpng
	if exist $(PREFIX)\bin\libpng13.dll del /q $(PREFIX)\bin\libpng13.dll
	if exist $(PREFIX)\lib\libpng13.lib del /q $(PREFIX)\lib\libpng13.lib
	if exist $(PREFIX)\include\png.h del /q $(PREFIX)\include\png.h
	if exist $(PREFIX)\include\pngconf.h del /q $(PREFIX)\include\pngconf.h
# 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\libpangocairo-1.0-0.dll del /q $(PREFIX)\bin\libpangocairo-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)\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
	if exist $(PREFIX)\lib\libtiff.lib del /q $(PREFIX)\lib\libtiff.lib
	if exist $(PREFIX)\include\tiff.h del /q $(PREFIX)\include\tiff.h
	if exist $(PREFIX)\include\tiffconf.h del /q $(PREFIX)\include\tiffconf.h
	if exist $(PREFIX)\include\tiffio.h del /q $(PREFIX)\include\tiffio.h
	if exist $(PREFIX)\include\tiffvers.h del /q $(PREFIX)\include\tiffvers.h
# zlib
	if exist $(PREFIX)\bin\zlib1.dll del /q $(PREFIX)\bin\zlib1.dll
	if exist $(PREFIX)\lib\zdll.lib del /q $(PREFIX)\lib\zdll.lib
	if exist $(PREFIX)\include\zlib.h del /q $(PREFIX)\include\zlib.h
	if exist $(PREFIX)\include\zconf.h del /q $(PREFIX)\include\zconf.h
# iwm
	if exist $(PREFIX)\bin\pango-makealiases-win32.exe del /q $(PREFIX)\bin\pango-makealiases-win32.exe
	if exist $(PREFIX)\bin\libiconv2.dll del /q $(PREFIX)\bin\libiconv2.dll
	if exist $(PREFIX)\bin\libintl3.dll del /q $(PREFIX)\bin\libintl3.dll
	if exist $(PREFIX)\bin\libtiff3.dll del /q $(PREFIX)\bin\libtiff3.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\gdk-pixbuf.loaders del /q $(PREFIX)\etc\gtk-2.0\gdk-pixbuf.loaders
	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\$(CAIRO)\COPYING del /q $(PREFIX)\doc\$(CAIRO)\COPYING
	if exist $(PREFIX)\doc\$(CAIRO)\COPYING-LGPL-2.1 del /q $(PREFIX)\doc\$(CAIRO)\COPYING-LGPL-2.1
	if exist $(PREFIX)\doc\$(CAIRO)\COPYING-MPL-1.1 del /q $(PREFIX)\doc\$(CAIRO)\COPYING-MPL-1.1
	if exist $(PREFIX)\doc\$(CAIRO)\pixman\COPYING del /q $(PREFIX)\doc\$(CAIRO)\pixman\COPYING
	if exist $(PREFIX)\doc\$(EXPAT)\COPYING del /q $(PREFIX)\doc\$(EXPAT)\COPYING
	if exist $(PREFIX)\doc\$(FONTCONFIG)\COPYING del /q $(PREFIX)\doc\$(FONTCONFIG)\COPYING
	if exist $(PREFIX)\doc\$(FREETYPE)\LICENSE.TXT del /q $(PREFIX)\doc\$(FREETYPE)\LICENSE.TXT
	if exist $(PREFIX)\doc\$(FREETYPE)\FTL.TXT del /q $(PREFIX)\doc\$(FREETYPE)\FTL.TXT
	if exist $(PREFIX)\doc\$(FREETYPE)\GPL.TXT del /q $(PREFIX)\doc\$(FREETYPE)\GPL.TXT
	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\$(LIBICONV)\COPYING.LIB del /q $(PREFIX)\doc\$(LIBICONV)\COPYING.LIB
	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\$(CAIRO)\pixman
	-rmdir $(PREFIX)\doc\$(CAIRO)
	-rmdir $(PREFIX)\doc\$(EXPAT)
	-rmdir $(PREFIX)\doc\$(FONTCONFIG)
	-rmdir $(PREFIX)\doc\$(FREETYPE)
	-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\$(LIBICONV)
	-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)\loaders
	-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\fontconfig
	-rmdir $(PREFIX)\include\freetype\config
	-rmdir $(PREFIX)\include\freetype\internal
	-rmdir $(PREFIX)\include\freetype
	-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)


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

gtk-$(VERSION).$(RELEASE)-bin.zip: all
# Folders
	mkdir $*
	mkdir $*\bin
	mkdir $*\lib
# Documents
	mkdir $*\doc
	mkdir $*\doc\$(ATK)
	mkdir $*\doc\$(CAIRO)
	mkdir $*\doc\$(CAIRO)\pixman
	mkdir $*\doc\$(EXPAT)
	mkdir $*\doc\$(FONTCONFIG)
	mkdir $*\doc\$(FREETYPE)
	mkdir $*\doc\$(GETTEXT)
	mkdir $*\doc\$(GETTEXT)\gettext-runtime
	mkdir $*\doc\$(GETTEXT)\gettext-runtime\intl
	mkdir $*\doc\$(GLIB)
	mkdir $*\doc\$(GTK)
	mkdir $*\doc\$(JPEG)
	mkdir $*\doc\$(LIBICONV)
	mkdir $*\doc\$(LIBPNG)
	mkdir $*\doc\$(PANGO)
	mkdir $*\doc\$(TIFF)
	mkdir $*\doc\$(ZLIB)
	copy /y $(ATK)\COPYING $*\doc\$(ATK)
	copy /y $(CAIRO)\COPYING $*\doc\$(CAIRO)
	copy /y $(CAIRO)\COPYING-LGPL-2.1 $*\doc\$(CAIRO)
	copy /y $(CAIRO)\COPYING-MPL-1.1 $*\doc\$(CAIRO)
	copy /y $(CAIRO)\pixman\COPYING $*\doc\$(CAIRO)\pixman
	copy /y $(EXPAT)\COPYING $*\doc\$(EXPAT)
	copy /y $(FONTCONFIG)\COPYING $*\doc\$(FONTCONFIG)
	copy /y $(FREETYPE)\docs\LICENSE.TXT $*\doc\$(FREETYPE)
	copy /y $(FREETYPE)\docs\FTL.TXT $*\doc\$(FREETYPE)
	copy /y $(FREETYPE)\docs\GPL.TXT $*\doc\$(FREETYPE)
	copy /y $(GETTEXT)\COPYING $*\doc\$(GETTEXT)
	copy /y $(GETTEXT)\gettext-runtime\intl\COPYING.LIB-2.1 $*\doc\$(GETTEXT)\gettext-runtime\intl
	copy /y $(GLIB)\COPYING $*\doc\$(GLIB)
	copy /y $(GTK)\COPYING $*\doc\$(GTK)
	copy /y $(JPEG)\README $*\doc\$(JPEG)
	copy /y $(LIBICONV)\COPYING.LIB $*\doc\$(LIBICONV)
	copy /y $(LIBPNG)\LICENSE $*\doc\$(LIBPNG)
	copy /y $(PANGO)\COPYING $*\doc\$(PANGO)
	copy /y $(TIFF)\COPYRIGHT $*\doc\$(TIFF)
	copy /y $(ZLIB)\README $*\doc\$(ZLIB)
	copy /y README $*
# ATK
	copy /y $(ATK)\atk\libatk-1.0-0.dll $*\bin
# cairo
	copy /y $(CAIRO)\src\libcairo-2.dll $*\bin
# Expat
	copy /y $(EXPAT)\lib\libexpat.dll $*\bin
# fontconfig
	copy /y $(FONTCONFIG)\src\libfontconfig-1.dll $*\bin
# FreeType
	copy /y $(FREETYPE)\src\freetype6.dll $*\bin
# gettext
	copy /y $(GETTEXT)\gettext-runtime\intl\intl.dll $*\bin
# GLib
	copy /y $(GLIB)\glib\libglib-2.0-0.dll $*\bin
	copy /y $(GLIB)\glib\gspawn-win32-helper.exe $*\bin
	copy /y $(GLIB)\gmodule\libgmodule-2.0-0.dll $*\bin
	copy /y $(GLIB)\gobject\libgobject-2.0-0.dll $*\bin
	copy /y $(GLIB)\gobject\glib-genmarshal.exe $*\bin
	copy /y $(GLIB)\gthread\libgthread-2.0-0.dll $*\bin
# GTK+
	copy /y $(GTK)\gdk-pixbuf\libgdk_pixbuf-2.0-0.dll $*\bin
	copy /y $(GTK)\gdk\libgdk-win32-2.0-0.dll $*\bin
	copy /y $(GTK)\gtk\libgtk-win32-2.0-0.dll $*\bin
	copy /y $(GTK)\gdk-pixbuf\gdk-pixbuf-query-loaders.exe $*\bin
	copy /y $(GTK)\gtk\gtk-query-immodules-2.0.exe $*\bin
	mkdir $*\lib\gtk-2.0
	mkdir $*\lib\gtk-2.0\$(GTK_VERSION)
	mkdir $*\lib\gtk-2.0\$(GTK_VERSION)\loaders
	mkdir $*\lib\gtk-2.0\$(GTK_VERSION)\immodules
	for %f in ($(gdk_pixbuf_LOADERS)) do copy /y $(GTK)\gdk-pixbuf\%f $*\lib\gtk-2.0\$(GTK_VERSION)\loaders
	for %f in ($(gtk_MODULES)) do copy /y $(GTK)\modules\input\%f $*\lib\gtk-2.0\$(GTK_VERSION)\immodules
# JPEG
	copy /y $(JPEG)\jpeg62.dll $*\bin
# libiconv
	copy /y $(LIBICONV)\lib\iconv.dll $*\bin
# libpng
	copy /y $(LIBPNG)\libpng13.dll $*\bin
# Pango
	copy /y $(PANGO)\pango\libpango-1.0-0.dll $*\bin
	copy /y $(PANGO)\pango\libpangowin32-1.0-0.dll $*\bin
	copy /y $(PANGO)\pango\libpangocairo-1.0-0.dll $*\bin
	copy /y $(PANGO)\pango\pango-querymodules.exe $*\bin
	mkdir $*\lib\pango
	mkdir $*\lib\pango\$(PANGO_VERSION)
	mkdir $*\lib\pango\$(PANGO_VERSION)\modules
	copy /y $(PANGO)\modules\basic\pango-basic-win32.dll $*\lib\pango\$(PANGO_VERSION)\modules
# TIFF
	copy /y $(TIFF)\libtiff\libtiff.dll $*\bin
# zlib
	copy /y $(ZLIB)\zlib1.dll $*\bin
# iwm
	copy /y iwm\pango-makealiases-win32.exe $*\bin
	copy /y iwm\libiconv2.dll $*\bin
	copy /y iwm\libintl3.dll $*\bin
	copy /y iwm\libtiff3.dll $*\bin
# PO
	mkdir $*\lib\locale
	for %d in ($(PO)) do mkdir $*\lib\locale\%d
	for %d in ($(PO)) do mkdir $*\lib\locale\%d\LC_MESSAGES
!ifdef SVN
	for %f in ($(PO)) do if exist $(ATK)\po\%f.po $(GETTEXT)\gettext-tools\src\msgfmt.exe $(ATK)\po\%f.po -o $*\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 $*\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 $*\lib\locale\%f\LC_MESSAGES\gtk20.mo
!else
	for %f in ($(PO)) do if exist $(ATK)\po\%f.gmo copy /y $(ATK)\po\%f.gmo $*\lib\locale\%f\LC_MESSAGES\atk10.mo
	for %f in ($(PO)) do if exist $(GLIB)\po\%f.gmo copy /y $(GLIB)\po\%f.gmo $*\lib\locale\%f\LC_MESSAGES\glib20.mo
	for %f in ($(PO)) do if exist $(GTK)\po\%f.gmo copy /y $(GTK)\po\%f.gmo $*\lib\locale\%f\LC_MESSAGES\gtk20.mo
!endif
# Config
	mkdir $*\etc
	mkdir $*\etc\gtk-2.0
	mkdir $*\etc\pango
	iwm\iwm-replace-win32.exe @GTK_VERSION@=$(GTK_VERSION) < iwm\config\gdk-pixbuf.loaders > $*\etc\gtk-2.0\gdk-pixbuf.loaders
	iwm\iwm-replace-win32.exe @GTK_VERSION@=$(GTK_VERSION) < iwm\config\gtk.immodules > $*\etc\gtk-2.0\gtk.immodules
	iwm\iwm-replace-win32.exe @PANGO_VERSION@=$(PANGO_VERSION) < iwm\config\pango.modules > $*\etc\pango\pango.modules
	copy /y iwm\config\pango.aliases $*\etc\pango
	zip -9 -r $@ $*
	rmdir /q /s $*

gtk-$(VERSION).$(RELEASE)-dev.zip: all
# Folders
	mkdir $*
	mkdir $*\bin
	mkdir $*\lib
	mkdir $*\include
# Documents
	mkdir $*\doc
	mkdir $*\doc\$(ATK)
	mkdir $*\doc\$(CAIRO)
	mkdir $*\doc\$(CAIRO)\pixman
	mkdir $*\doc\$(EXPAT)
	mkdir $*\doc\$(FONTCONFIG)
	mkdir $*\doc\$(FREETYPE)
	mkdir $*\doc\$(GETTEXT)
	mkdir $*\doc\$(GETTEXT)\gettext-runtime
	mkdir $*\doc\$(GETTEXT)\gettext-runtime\intl
	mkdir $*\doc\$(GLIB)
	mkdir $*\doc\$(GTK)
	mkdir $*\doc\$(JPEG)
	mkdir $*\doc\$(LIBICONV)
	mkdir $*\doc\$(LIBPNG)
	mkdir $*\doc\$(PANGO)
	mkdir $*\doc\$(TIFF)
	mkdir $*\doc\$(ZLIB)
	copy /y $(ATK)\COPYING $*\doc\$(ATK)
	copy /y $(CAIRO)\COPYING $*\doc\$(CAIRO)
	copy /y $(CAIRO)\COPYING-LGPL-2.1 $*\doc\$(CAIRO)
	copy /y $(CAIRO)\COPYING-MPL-1.1 $*\doc\$(CAIRO)
	copy /y $(CAIRO)\pixman\COPYING $*\doc\$(CAIRO)\pixman
	copy /y $(EXPAT)\COPYING $*\doc\$(EXPAT)
	copy /y $(FONTCONFIG)\COPYING $*\doc\$(FONTCONFIG)
	copy /y $(FREETYPE)\docs\LICENSE.TXT $*\doc\$(FREETYPE)
	copy /y $(FREETYPE)\docs\FTL.TXT $*\doc\$(FREETYPE)
	copy /y $(FREETYPE)\docs\GPL.TXT $*\doc\$(FREETYPE)
	copy /y $(GETTEXT)\COPYING $*\doc\$(GETTEXT)
	copy /y $(GETTEXT)\gettext-runtime\intl\COPYING.LIB-2.1 $*\doc\$(GETTEXT)\gettext-runtime\intl
	copy /y $(GLIB)\COPYING $*\doc\$(GLIB)
	copy /y $(GTK)\COPYING $*\doc\$(GTK)
	copy /y $(JPEG)\README $*\doc\$(JPEG)
	copy /y $(LIBICONV)\COPYING.LIB $*\doc\$(LIBICONV)
	copy /y $(LIBPNG)\LICENSE $*\doc\$(LIBPNG)
	copy /y $(PANGO)\COPYING $*\doc\$(PANGO)
	copy /y $(TIFF)\COPYRIGHT $*\doc\$(TIFF)
	copy /y $(ZLIB)\README $*\doc\$(ZLIB)
	if not exist $*\README copy /y README $*
# ATK
	copy /y $(ATK)\atk\atk-1.0.lib $*\lib
	mkdir $*\include\atk
	for %f in ($(atk_HEADERS)) do copy /y $(ATK)\atk\%f $*\include\atk
# cairo
	copy /y $(CAIRO)\src\cairo.lib $*\lib
	copy /y $(CAIRO)\src\cairo.h $*\include
	copy /y $(CAIRO)\src\cairo-features.h $*\include
# Expat
	copy /y $(EXPAT)\lib\libexpat.lib $*\lib
	copy /y $(EXPAT)\lib\expat.h $*\include
# fontconfig
	copy /y $(FONTCONFIG)\src\fontconfig.lib $*\lib
	mkdir $*\include\fontconfig
	copy /y $(FONTCONFIG)\fontconfig\fcfreetype.h $*\include\fontconfig
	copy /y $(FONTCONFIG)\fontconfig\fcprivate.h $*\include\fontconfig
	copy /y $(FONTCONFIG)\fontconfig\fontconfig.h $*\include\fontconfig
# FreeType
	copy /y $(FREETYPE)\src\freetype.lib $*\lib
	if not exist $*\include\freetype mkdir $*\include\freetype
	if not exist $*\include\freetype\config mkdir $*\include\freetype\config
	if not exist $*\include\freetype\internal mkdir $*\include\freetype\internal
	copy /y $(FREETYPE)\include\ft2build.h $*\include
	for %f in ($(freetype_0_HEADERS)) do copy /y $(FREETYPE)\include\freetype\%f $*\include\freetype
	for %f in ($(freetype_1_HEADERS)) do copy /y $(FREETYPE)\include\freetype\config\%f $*\include\freetype\config
	for %f in ($(freetype_2_HEADERS)) do copy /y $(FREETYPE)\include\freetype\internal\%f $*\include\freetype\internal
# GLib
	copy /y $(GLIB)\glib\glib-2.0.lib $*\lib
	copy /y $(GLIB)\gmodule\gmodule-2.0.lib $*\lib
	copy /y $(GLIB)\gobject\gobject-2.0.lib $*\lib
	copy /y $(GLIB)\gthread\gthread-2.0.lib $*\lib
	copy /y $(GLIB)\glibconfig.h $*\include
	copy /y $(GLIB)\glib\glib.h $*\include
	copy /y $(GLIB)\gmodule\gmodule.h $*\include
	copy /y $(GLIB)\glib\glib-object.h $*\include
	mkdir $*\include\glib
	for %f in ($(glib_HEADERS)) do copy /y $(GLIB)\glib\%f $*\include\glib
	mkdir $*\include\gobject
	for %f in ($(gobject_HEADERS)) do copy /y $(GLIB)\gobject\%f $*\include\gobject
# GTK+
	copy /y $(GTK)\gdk-pixbuf\gdk_pixbuf-2.0.lib $*\lib
	copy /y $(GTK)\gdk\gdk-win32-2.0.lib $*\lib
	copy /y $(GTK)\gtk\gtk-win32-2.0.lib $*\lib
	copy /y $(GTK)\gdk\gdkconfig.h $*\include
	mkdir $*\include\gdk-pixbuf
	for %f in ($(gdk_pixbuf_HEADERS)) do copy /y $(GTK)\gdk-pixbuf\%f $*\include\gdk-pixbuf
	mkdir $*\include\gdk
	copy /y $(GTK)\gdk\win32\gdkwin32.h $*\include\gdk
	for %f in ($(gdk_HEADERS)) do copy /y $(GTK)\gdk\%f $*\include\gdk
	mkdir $*\include\gtk
	for %f in ($(gtk_0_HEADERS)) do copy /y $(GTK)\gtk\%f $*\include\gtk
	for %f in ($(gtk_1_HEADERS)) do copy /y $(GTK)\gtk\%f $*\include\gtk
# gettext
	copy /y $(GETTEXT)\gettext-tools\src\msgfmt.exe $*\bin
	copy /y $(GETTEXT)\gettext-runtime\intl\intl.lib $*\lib
	copy /y $(GETTEXT)\gettext-runtime\intl\libgnuintl.h $*\include\libintl.h
# JPEG
	copy /y $(JPEG)\libjpeg.lib $*\lib
	copy /y $(JPEG)\jconfig.h $*\include
	copy /y $(JPEG)\jerror.h $*\include
	copy /y $(JPEG)\jmorecfg.h $*\include
	copy /y $(JPEG)\jpeglib.h $*\include
# libiconv
	copy /y $(LIBICONV)\lib\iconv.lib $*\lib
	copy /y $(LIBICONV)\include\iconv.h $*\include
# libpng
	copy /y $(LIBPNG)\libpng13.lib $*\lib
	copy /y $(LIBPNG)\png.h $*\include
	copy /y $(LIBPNG)\pngconf.h $*\include
# Pango
	copy /y $(PANGO)\pango\pango-1.0.lib $*\lib
	mkdir $*\include\pango
	for %f in ($(pango_HEADERS)) do copy /y $(PANGO)\pango\%f $*\include\pango
# TIFF
	copy /y $(TIFF)\libtiff\libtiff.lib $*\lib
	copy /y $(TIFF)\libtiff\tiff.h $*\include
	copy /y $(TIFF)\libtiff\tiffconf.h $*\include
	copy /y $(TIFF)\libtiff\tiffio.h $*\include
	copy /y $(TIFF)\libtiff\tiffvers.h $*\include
# zlib
	copy /y $(ZLIB)\zdll.lib $*\lib
	copy /y $(ZLIB)\zlib.h $*\include
	copy /y $(ZLIB)\zconf.h $*\include
	zip -9 -r $@ $*
	rmdir /q /s $*

gtk-$(VERSION).$(RELEASE)-src.zip:
	mkdir $*
	mkdir $*\iwm
	mkdir $*\iwm\config
	mkdir $*\iwm\dirent
	mkdir $*\iwm\fontconfig
	mkdir $*\iwm\gettext
	copy /y atk-$(ATK_VERSION).tar.gz $*
	copy /y cairo-$(CAIRO_VERSION).tar.gz $*
	copy /y expat-2.0.0.tar.gz $*
	copy /y fontconfig-2.4.2.tar.gz $*
	copy /y freetype-2.3.1.tar.gz $*
	copy /y gettext-0.16.1.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.11.tar.gz $*
	copy /y libpng-1.2.16.tar.gz $*
	copy /y pango-$(PANGO_VERSION).tar.gz $*
	copy /y tiff-3.8.2.tar.gz $*
	copy /y zlib-1.2.3.tar.gz $*
	copy /y autogen.bat $*
	copy /y Makefile $*
	copy /y README $*
	copy /y iwm\iwm-forwarding-win32.c $*\iwm
	copy /y iwm\iwm-makedef-win32.c $*\iwm
	copy /y iwm\iwm-replace-win32.c $*\iwm
	copy /y iwm\pango-makealiases-win32.c $*\iwm
	copy /y iwm\config\gdk-pixbuf.loaders $*\iwm\config
	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\dirent\dirent.c $*\iwm\dirent
	copy /y iwm\dirent\dirent.h $*\iwm\dirent
	copy /y iwm\dirent\tdirent.c $*\iwm\dirent
	copy /y iwm\dirent\wdirent.c $*\iwm\dirent
	copy /y iwm\fontconfig\unistd.h $*\iwm\fontconfig
	copy /y iwm\gettext\libgnuintl.h.msvc-shared $*\iwm\gettext
	copy /y iwm\gettext\dcigettext.c $*\iwm\gettext
	copy /y iwm\gettext\format.c $*\iwm\gettext
	copy /y iwm\gettext\xvasprintf.c $*\iwm\gettext
	zip -9 -r $@ $*
	rmdir /q /s $*
