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

!ifndef PREFIX
PREFIX=.
!endif

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

!ifdef CVS
CAIRO_MAJOR_VERSION=1
CAIRO_MINOR_VERSION=1
CAIRO_MICRO_VERSION=1
!else
CAIRO_MAJOR_VERSION=1
CAIRO_MINOR_VERSION=0
CAIRO_MICRO_VERSION=2
!endif
CAIRO_VERSION=$(CAIRO_MAJOR_VERSION).$(CAIRO_MINOR_VERSION).$(CAIRO_MICRO_VERSION)

!ifdef CVS
GLIB_MAJOR_VERSION=2
GLIB_MINOR_VERSION=9
GLIB_MICRO_VERSION=7
GLIB_BINARY_AGE=907
!else
GLIB_MAJOR_VERSION=2
GLIB_MINOR_VERSION=8
GLIB_MICRO_VERSION=6
GLIB_BINARY_AGE=806
!endif
GLIB_VERSION=$(GLIB_MAJOR_VERSION).$(GLIB_MINOR_VERSION).$(GLIB_MICRO_VERSION)

!ifdef CVS
GTK_MAJOR_VERSION=2
GTK_MINOR_VERSION=9
GTK_MICRO_VERSION=0
GTK_BINARY_AGE=900
!else
GTK_MAJOR_VERSION=2
GTK_MINOR_VERSION=8
GTK_MICRO_VERSION=12
GTK_BINARY_AGE=812
!endif
GTK_VERSION=$(GTK_MAJOR_VERSION).$(GTK_MINOR_VERSION).$(GTK_MICRO_VERSION)

!ifdef CVS
PANGO_MAJOR_VERSION=1
PANGO_MINOR_VERSION=11
PANGO_MICRO_VERSION=5
!else
PANGO_MAJOR_VERSION=1
PANGO_MINOR_VERSION=10
PANGO_MICRO_VERSION=3
!endif
PANGO_VERSION=$(PANGO_MAJOR_VERSION).$(PANGO_MINOR_VERSION).$(PANGO_MICRO_VERSION)

#Folders
!ifdef CVS
ATK=atk
CAIRO=cairo
!else
ATK=atk-$(ATK_VERSION)
CAIRO=cairo-$(CAIRO_VERSION)
!endif
GETTEXT=gettext-0.14.5
!ifdef CVS
GLIB=glib
GTK=gtk
!else
GLIB=glib-$(GLIB_VERSION)
GTK=gtk-$(GTK_VERSION)
!endif
JPEG=jpeg-6b
LIBICONV=libiconv-1.10
LIBPNG=libpng-1.2.8
!ifdef CVS
PANGO=pango
!else
PANGO=pango-$(PANGO_VERSION)
!endif
TIFF=tiff-3.8.0
ZLIB=zlib-1.2.3

VERSION=$(GTK_VERSION)
RELEASE=0

LINK=link
PERL=perl

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

cairo_OBJECTS= \
		$(CAIRO)\src\cairo.obj \
		$(CAIRO)\src\cairo-arc.obj \
		$(CAIRO)\src\cairo-array.obj \
		$(CAIRO)\src\cairo-cache.obj \
		$(CAIRO)\src\cairo-clip.obj \
		$(CAIRO)\src\cairo-color.obj \
		$(CAIRO)\src\cairo-debug.obj \
		$(CAIRO)\src\cairo-fixed.obj \
		$(CAIRO)\src\cairo-font.obj \
		$(CAIRO)\src\cairo-font-options.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-path.obj \
		$(CAIRO)\src\cairo-path-bounds.obj \
		$(CAIRO)\src\cairo-path-data.obj \
		$(CAIRO)\src\cairo-path-fill.obj \
		$(CAIRO)\src\cairo-path-stroke.obj \
		$(CAIRO)\src\cairo-pattern.obj \
		$(CAIRO)\src\cairo-pen.obj \
		$(CAIRO)\src\cairo-png.obj \
		$(CAIRO)\src\cairo-polygon.obj \
		$(CAIRO)\src\cairo-region.obj \
!ifdef CVS
		$(CAIRO)\src\cairo-scaled-font.obj \
!endif
		$(CAIRO)\src\cairo-slope.obj \
		$(CAIRO)\src\cairo-spline.obj \
!ifdef CVS
		$(CAIRO)\src\cairo-stroke-style.obj \
!endif
		$(CAIRO)\src\cairo-surface.obj \
!ifdef CVS
		$(CAIRO)\src\cairo-surface-fallback.obj \
!endif
		$(CAIRO)\src\cairo-traps.obj \
		$(CAIRO)\src\cairo-unicode.obj \
		$(CAIRO)\src\cairo-wideint.obj \
		$(CAIRO)\src\cairo-win32-font.obj \
		$(CAIRO)\src\cairo-win32-surface.obj
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

!ifdef CVS
$(CAIRO)\src\libcairo-2.dll: $(cairo_OBJECTS) $(libpixman_OBJECTS) $(CAIRO)\src\cairo.def
!else
$(CAIRO)\src\libcairo-2.dll: $(cairo_OBJECTS) $(libpixman_OBJECTS)
!endif
	$(LINK) $(LFLAGS) /DLL /DEF:$(CAIRO)\src\cairo.def /IMPLIB:$(CAIRO)\src\cairo.lib $(LIBPNG)\libpng13.lib gdi32.lib msimg32.lib user32.lib $(cairo_OBJECTS) $(libpixman_OBJECTS)

$(CAIRO)\src\cairo.def: $(cairo_OBJECTS)
	echo EXPORTS > $@
	echo cairo_append_path >> $@
	echo cairo_arc >> $@
	echo cairo_arc_negative >> $@
	echo cairo_clip >> $@
	echo cairo_clip_preserve >> $@
	echo cairo_close_path >> $@
	echo cairo_copy_page >> $@
	echo cairo_copy_path >> $@
	echo cairo_copy_path_flat >> $@
	echo cairo_create >> $@
	echo cairo_curve_to >> $@
	echo cairo_debug_reset_static_data >> $@
	echo cairo_destroy >> $@
	echo cairo_device_to_user >> $@
	echo cairo_device_to_user_distance >> $@
	echo cairo_fill >> $@
	echo cairo_fill_extents >> $@
	echo cairo_fill_preserve >> $@
	echo cairo_font_extents >> $@
	echo cairo_font_face_destroy >> $@
	echo cairo_font_face_get_user_data >> $@
	echo cairo_font_face_reference >> $@
	echo cairo_font_face_set_user_data >> $@
	echo cairo_font_face_status >> $@
	echo cairo_font_options_copy >> $@
	echo cairo_font_options_create >> $@
	echo cairo_font_options_destroy >> $@
	echo cairo_font_options_equal >> $@
	echo cairo_font_options_get_antialias >> $@
	echo cairo_font_options_get_hint_metrics >> $@
	echo cairo_font_options_get_hint_style >> $@
	echo cairo_font_options_get_subpixel_order >> $@
	echo cairo_font_options_hash >> $@
	echo cairo_font_options_merge >> $@
	echo cairo_font_options_set_antialias >> $@
	echo cairo_font_options_set_hint_metrics >> $@
	echo cairo_font_options_set_hint_style >> $@
	echo cairo_font_options_set_subpixel_order >> $@
	echo cairo_font_options_status >> $@
	echo cairo_get_antialias >> $@
	echo cairo_get_current_point >> $@
	echo cairo_get_fill_rule >> $@
	echo cairo_get_font_face >> $@
	echo cairo_get_font_matrix >> $@
	echo cairo_get_font_options >> $@
	echo cairo_get_line_cap >> $@
	echo cairo_get_line_join >> $@
	echo cairo_get_line_width >> $@
	echo cairo_get_matrix >> $@
	echo cairo_get_miter_limit >> $@
	echo cairo_get_operator >> $@
	echo cairo_get_source >> $@
	echo cairo_get_target >> $@
	echo cairo_get_tolerance >> $@
	echo cairo_glyph_extents >> $@
	echo cairo_glyph_path >> $@
	echo cairo_identity_matrix >> $@
	echo cairo_image_surface_create >> $@
	echo cairo_image_surface_create_for_data >> $@
	echo cairo_image_surface_create_from_png >> $@
	echo cairo_image_surface_create_from_png_stream >> $@
	echo cairo_image_surface_get_height >> $@
	echo cairo_image_surface_get_width >> $@
	echo cairo_in_fill >> $@
	echo cairo_in_stroke >> $@
	echo cairo_line_to >> $@
	echo cairo_mask >> $@
	echo cairo_mask_surface >> $@
	echo cairo_matrix_init >> $@
	echo cairo_matrix_init_identity >> $@
	echo cairo_matrix_init_rotate >> $@
	echo cairo_matrix_init_scale >> $@
	echo cairo_matrix_init_translate >> $@
	echo cairo_matrix_invert >> $@
	echo cairo_matrix_multiply >> $@
	echo cairo_matrix_rotate >> $@
	echo cairo_matrix_scale >> $@
	echo cairo_matrix_transform_distance >> $@
	echo cairo_matrix_transform_point >> $@
	echo cairo_matrix_translate >> $@
	echo cairo_move_to >> $@
	echo cairo_new_path >> $@
	echo cairo_paint >> $@
	echo cairo_paint_with_alpha >> $@
	echo cairo_path_destroy >> $@
	echo cairo_pattern_add_color_stop_rgb >> $@
	echo cairo_pattern_add_color_stop_rgba >> $@
	echo cairo_pattern_create_for_surface >> $@
	echo cairo_pattern_create_linear >> $@
	echo cairo_pattern_create_radial >> $@
	echo cairo_pattern_create_rgb >> $@
	echo cairo_pattern_create_rgba >> $@
	echo cairo_pattern_destroy >> $@
	echo cairo_pattern_get_extend >> $@
	echo cairo_pattern_get_filter >> $@
	echo cairo_pattern_get_matrix >> $@
	echo cairo_pattern_reference >> $@
	echo cairo_pattern_set_extend >> $@
	echo cairo_pattern_set_filter >> $@
	echo cairo_pattern_set_matrix >> $@
	echo cairo_pattern_status >> $@
	echo cairo_rectangle >> $@
	echo cairo_reference >> $@
	echo cairo_rel_curve_to >> $@
	echo cairo_rel_line_to >> $@
	echo cairo_rel_move_to >> $@
	echo cairo_reset_clip >> $@
	echo cairo_restore >> $@
	echo cairo_rotate >> $@
	echo cairo_save >> $@
	echo cairo_scale >> $@
	echo cairo_scaled_font_create >> $@
	echo cairo_scaled_font_destroy >> $@
	echo cairo_scaled_font_extents >> $@
	echo cairo_scaled_font_glyph_extents >> $@
	echo cairo_scaled_font_reference >> $@
	echo cairo_scaled_font_status >> $@
	echo cairo_select_font_face >> $@
	echo cairo_set_antialias >> $@
	echo cairo_set_dash >> $@
	echo cairo_set_fill_rule >> $@
	echo cairo_set_font_face >> $@
	echo cairo_set_font_matrix >> $@
	echo cairo_set_font_options >> $@
	echo cairo_set_font_size >> $@
	echo cairo_set_line_cap >> $@
	echo cairo_set_line_join >> $@
	echo cairo_set_line_width >> $@
	echo cairo_set_matrix >> $@
	echo cairo_set_miter_limit >> $@
	echo cairo_set_operator >> $@
	echo cairo_set_source >> $@
	echo cairo_set_source_rgb >> $@
	echo cairo_set_source_rgba >> $@
	echo cairo_set_source_surface >> $@
	echo cairo_set_tolerance >> $@
	echo cairo_show_glyphs >> $@
	echo cairo_show_page >> $@
	echo cairo_show_text >> $@
	echo cairo_status >> $@
	echo cairo_status_to_string >> $@
	echo cairo_stroke >> $@
	echo cairo_stroke_extents >> $@
	echo cairo_stroke_preserve >> $@
	echo cairo_surface_create_similar >> $@
	echo cairo_surface_destroy >> $@
	echo cairo_surface_finish >> $@
	echo cairo_surface_flush >> $@
	echo cairo_surface_get_font_options >> $@
	echo cairo_surface_get_user_data >> $@
	echo cairo_surface_mark_dirty >> $@
	echo cairo_surface_mark_dirty_rectangle >> $@
	echo cairo_surface_reference >> $@
	echo cairo_surface_set_device_offset >> $@
	echo cairo_surface_set_user_data >> $@
	echo cairo_surface_status >> $@
	echo cairo_surface_write_to_png >> $@
	echo cairo_surface_write_to_png_stream >> $@
	echo cairo_text_extents >> $@
	echo cairo_text_path >> $@
	echo cairo_transform >> $@
	echo cairo_translate >> $@
	echo cairo_user_to_device >> $@
	echo cairo_user_to_device_distance >> $@
	echo cairo_version >> $@
	echo cairo_version_string >> $@
	echo cairo_win32_font_face_create_for_logfontw >> $@
	echo cairo_win32_scaled_font_done_font >> $@
	echo cairo_win32_scaled_font_get_metrics_factor >> $@
	echo cairo_win32_scaled_font_select_font >> $@
	echo cairo_win32_surface_create >> $@
	echo LIBRARY libcairo-2.dll >> $@

!ifdef CVS
$(cairo_OBJECTS): $(CAIRO)\src\cairo-features.h
	$(CC) $(CFLAGS) /DM_PI=3.14159265358979323846 /Dsnprintf=_snprintf /Dvsnprintf=_vsnprintf /I$(CAIRO)\src /I$(CAIRO)\pixman\src /I$(LIBPNG) /I$(ZLIB) $*.c
!else
$(cairo_OBJECTS): $(CAIRO)\src\cairo-features.h~
	$(CC) $(CFLAGS) /DM_PI=3.14159265358979323846 /Dsnprintf=_snprintf /Dvsnprintf=_vsnprintf /FIcairo-mutex.h /I$(CAIRO)\src /I$(CAIRO)\pixman\src /I$(LIBPNG) /I$(ZLIB) /Iiwm\cairo $*.c
!endif

$(libpixman_OBJECTS):
!ifdef CVS
	$(CC) $(CFLAGS) /DM_PI=3.14159265358979323846 /I$(CAIRO)\pixman\src /Iiwm\include $*.c
!else
	$(CC) $(CFLAGS) /I$(CAIRO)\pixman\src /Iiwm\include $*.c
!endif

!ifdef CVS
$(CAIRO)\src\cairo-features.h:
!else
$(CAIRO)\src\cairo-features.h~:
	if not exist $@ move /y $(CAIRO)\src\cairo-features.h $@
!endif
	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
!ifdef CVS
	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
!endif
	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_NO_ATSUI_FONT 1 >> $(CAIRO)\src\cairo-features.h
	echo #define CAIRO_HAS_NO_FT_FONT 1 >> $(CAIRO)\src\cairo-features.h
	echo #define CAIRO_HAS_NO_GLITZ_SURFACE 1 >> $(CAIRO)\src\cairo-features.h
	echo #define CAIRO_HAS_NO_PDF_SURFACE 1 >> $(CAIRO)\src\cairo-features.h
	echo #define CAIRO_HAS_PNG_SURFACE 1 >> $(CAIRO)\src\cairo-features.h
	echo #define CAIRO_HAS_NO_PS_SURFACE 1 >> $(CAIRO)\src\cairo-features.h
	echo #define CAIRO_HAS_NO_QUARTZ_SURFACE 1 >> $(CAIRO)\src\cairo-features.h
	echo #define CAIRO_DO_SANITY_CHECKING 1 >> $(CAIRO)\src\cairo-features.h
	echo #define CAIRO_HAS_NO_XCB_SURFACE 1 >> $(CAIRO)\src\cairo-features.h
	echo #define CAIRO_HAS_NO_XLIB_SURFACE 1 >> $(CAIRO)\src\cairo-features.h
	echo #define CAIRO_HAS_WIN32_FONT 1 >> $(CAIRO)\src\cairo-features.h
	echo #define CAIRO_HAS_WIN32_SURFACE 1 >> $(CAIRO)\src\cairo-features.h
	echo. >> $(CAIRO)\src\cairo-features.h
	echo #endif >> $(CAIRO)\src\cairo-features.h

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

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

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

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

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

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

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

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

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

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

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

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

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

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

!ifdef CVS
$(GLIB)\config.h: $@.win32
!else
$(GLIB)\config.h:
!endif
	copy /y $@.win32 $@

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

!ifdef CVS
$(GLIB)\glibconfig.h: $@.win32
!else
$(GLIB)\glibconfig.h:
!endif
	copy /y $@.win32 $@

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

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

# GLib
glib_OBJECTS= \
		$(GLIB)\glib\garray.obj \
		$(GLIB)\glib\gasyncqueue.obj \
#MODIFY	$(GLIB)\glib\gatomic.obj \
		$(GLIB)\glib\gbacktrace.obj \
		$(GLIB)\glib\gcache.obj \
		$(GLIB)\glib\gcompletion.obj \
		$(GLIB)\glib\gconvert.obj \
		$(GLIB)\glib\gdataset.obj \
		$(GLIB)\glib\gdate.obj \
		$(GLIB)\glib\gdir.obj \
		$(GLIB)\glib\gerror.obj \
		$(GLIB)\glib\gfileutils.obj \
		$(GLIB)\glib\ghash.obj \
		$(GLIB)\glib\ghook.obj \
		$(GLIB)\glib\giochannel.obj \
		$(GLIB)\glib\giowin32.obj \
		$(GLIB)\glib\gkeyfile.obj \
		$(GLIB)\glib\glist.obj \
		$(GLIB)\glib\gmain.obj \
		$(GLIB)\glib\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 \
		$(GLIB)\glib\gshell.obj \
!ifdef CVS
		$(GLIB)\glib\gslice.obj \
!endif
		$(GLIB)\glib\gslist.obj \
		$(GLIB)\glib\gspawn-win32.obj \
		$(GLIB)\glib\gstdio.obj \
		$(GLIB)\glib\gstrfuncs.obj \
		$(GLIB)\glib\gstring.obj \
		$(GLIB)\glib\gthread.obj \
		$(GLIB)\glib\gthreadpool.obj \
		$(GLIB)\glib\gtimer.obj \
		$(GLIB)\glib\gtree.obj \
		$(GLIB)\glib\gunibreak.obj \
		$(GLIB)\glib\gunicollate.obj \
		$(GLIB)\glib\gunidecomp.obj \
		$(GLIB)\glib\guniprop.obj \
		$(GLIB)\glib\gutf8.obj \
		$(GLIB)\glib\gutils.obj \
		$(GLIB)\glib\gwin32.obj \
		$(GLIB)\glib\gnulib\asnprintf.obj \
		$(GLIB)\glib\gnulib\printf.obj \
		$(GLIB)\glib\gnulib\printf-args.obj \
		$(GLIB)\glib\gnulib\printf-parse.obj \
		$(GLIB)\glib\gnulib\vasnprintf.obj \
		$(GLIB)\glib\libcharset\localcharset.obj \
		$(GLIB)\build\win32\dirent\wdirent.obj \
		$(GLIB)\build\win32\dirent\dirent.obj

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

!ifdef CVS
$(GLIB)\glib\glib.res: $*.rc
!else
$(GLIB)\glib\glib.res:
!endif
	$(RC) $(RFLAGS) /DBUILDNUMBER=0 $**

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

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

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

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

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

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

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

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

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

!ifdef CVS
$(GLIB)\gmodule\gmodule.res: $*.rc
!else
$(GLIB)\gmodule\gmodule.res:
!endif
	$(RC) $(RFLAGS) /DBUILDNUMBER=0 $**

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

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

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

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

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

!ifdef CVS
$(GLIB)\gobject\gobject.res: $*.rc
!else
$(GLIB)\gobject\gobject.res:
!endif
	$(RC) $(RFLAGS) /DBUILDNUMBER=0 $*.rc

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

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

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

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

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

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

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

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

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

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

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

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

!ifdef CVS
$(GLIB)\gthread\gthread.res: $*.rc
!else
$(GLIB)\gthread\gthread.res:
!endif
	$(RC) $(RFLAGS) /DBUILDNUMBER=0 $*.rc

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

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

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

!ifdef CVS
$(GTK)\config.h: $@.win32
!else
$(GTK)\config.h:
!endif
	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 >> $@

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

# GDK
gdk_OBJECTS= \
		$(GTK)\gdk\gdk.obj \
		$(GTK)\gdk\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

!ifdef CVS
$(GTK)\gdk\libgdk-win32-2.0-0.dll: $(gdk_OBJECTS) $(GTK)\gdk\win32\rc\gdk.res $(GTK)\gdk\gdk.def
!else
$(GTK)\gdk\libgdk-win32-2.0-0.dll: $(gdk_OBJECTS) $(GTK)\gdk\win32\rc\gdk.res
!endif
	$(LINK) $(LFLAGS) /DLL /DEF:$(GTK)\gdk\gdk.def /IMPLIB:$(GTK)\gdk\gdk-win32-2.0.lib $(CAIRO)\src\cairo.lib $(GLIB)\glib\glib-2.0.lib $(GLIB)\gobject\gobject-2.0.lib $(GTK)\gdk-pixbuf\gdk_pixbuf-2.0.lib $(PANGO)\pango\pango-1.0.lib $(PANGO)\pango\pangowin32-1.0.lib $(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

!ifdef CVS
$(GTK)\gdk\win32\rc\gdk.res: $*.rc
!else
$(GTK)\gdk\win32\rc\gdk.res:
!endif
	$(RC) $(RFLAGS) /DBUILDNUMBER=0 $*.rc

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

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

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

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

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

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

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

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

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

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

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

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

!ifdef CVS
$(GTK)\gtk\libgtk-win32-2.0-0.dll: $(gtk_OBJECTS) $(GTK)\gtk\gtk-win32.res $(GTK)\gtk\gtk.def
	$(LINK) $(LFLAGS) /DLL /DEF:$(GTK)\gtk\gtk.def /IMPLIB:$(GTK)\gtk\gtk-win32-2.0.lib $(ATK)\atk\atk-1.0.lib $(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 gdi32.lib ole32.lib shell32.lib user32.lib ws2_32.lib $(PANGO)\pango\pango-1.0.lib $(PANGO)\pango\pangocairo-1.0.lib $(gtk_OBJECTS) $(GTK)\gtk\gtk-win32.res
!else
$(GTK)\gtk\libgtk-win32-2.0-0.dll: $(gtk_OBJECTS) $(GTK)\gtk\gtk-win32.res
	$(LINK) $(LFLAGS) /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 gdi32.lib ole32.lib shell32.lib user32.lib ws2_32.lib $(PANGO)\pango\pango-1.0.lib $(PANGO)\pango\pangocairo-1.0.lib $**
!endif

!ifdef CVS
$(GTK)\gtk\gtk-win32.res: $*.rc
!else
$(GTK)\gtk\gtk-win32.res:
!endif
	$(RC) $(RFLAGS) /DBUILDNUMBER=0 $*.rc

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

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

!ifdef CVS
$(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
	$(CC) $(CFLAGS) /DG_LOG_DOMAIN=\"Gtk\" /DGTK_BINARY_VERSION=\"$(GTK_VERSION)\" /DGTK_DISABLE_COMPAT_H /DGTK_FILE_SYSTEM_ENABLE_UNSUPPORTED /DGTK_HOST=\"win32\" /DGTK_LIBDIR=\"/target/lib\" /DGTK_VERSION=\"2.0\" /DHAVE_CONFIG_H /DM_PI=3.14159265358979323846 /Dnear=xxnear /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) $*.c
!else
$(gtk_OBJECTS):
	$(CC) $(CFLAGS) /DG_LOG_DOMAIN=\"Gtk\" /DGTK_BINARY_VERSION=\"$(GTK_VERSION)\" /DGTK_DISABLE_COMPAT_H /DGTK_FILE_SYSTEM_ENABLE_UNSUPPORTED /DGTK_HOST=\"win32\" /DGTK_LIBDIR=\"/target/lib\" /DGTK_VERSION=\"2.0\" /DHAVE_CONFIG_H /DM_PI=3.14159265358979323846 /Dnear=xxnear /DPANGO_ENABLE_BACKEND /FImsvc_recommended_pragmas.h /I$(GTK)\gtk /I$(GTK) /I$(GTK)\gdk /I$(ATK) /I$(CAIRO)\src /I$(GLIB) /I$(GLIB)\glib /I$(GLIB)\gmodule /I$(PANGO) $*.c
!endif

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

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

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

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

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

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

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

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

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

$(GTK)\gtk\gtkbuiltincache.h: $(GTK)\gtk\gtk-update-icon-cache.exe $(GTK)\gtk\stamp-icons
	$(GTK)\gtk\gtk-update-icon-cache.exe --force --ignore-theme-index --source builtin_icons $(GTK)\gtk\stock-icons > $@

$(GTK)\gtk\gtk-update-icon-cache.exe: $(GTK)\gtk\updateiconcache.obj
	$(LINK) $(LFLAGS) $(GLIB)\glib\glib-2.0.lib $(GLIB)\gobject\gobject-2.0.lib $(GTK)\gdk-pixbuf\gdk_pixbuf-2.0.lib $**

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

$(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 > $@

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

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

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

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

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

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

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

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

$(imime_OBJECTS):
	$(CC) $(CFLAGS) /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) $(LFLAGS) /DLL /EXPORT:im_module_create,@5 /EXPORT:im_module_exit,@1 /EXPORT:im_module_init,@2 /EXPORT:im_module_list,@3 $(GLIB)\gobject\gobject-2.0.lib $(GTK)\gtk\gtk-win32-2.0.lib $**

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

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

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

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

$(GTK)\modules\input\imthai-broken.obj:
	$(CC) $(CFLAGS) /DG_DISABLE_DEPRECATED /DGDK_PIXBUF_DISABLE_DEPRECATED /DGDK_DISABLE_DEPRECATED /DGTK_DISABLE_DEPRECATED /DGTK_LOCALEDIR=\"\" /I$(GTK) /I$(GTK)\gdk /I$(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) $(LFLAGS) /DLL /EXPORT:im_module_create,@5 /EXPORT:im_module_exit,@1 /EXPORT:im_module_init,@2 /EXPORT:im_module_list,@3 $(GLIB)\gobject\gobject-2.0.lib $(GTK)\gtk\gtk-win32-2.0.lib $**

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

$(JPEG)\jpeg62.dll: $(JPEG)\jpeg.def $(jpeg_OBJECTS)
	$(LINK) $(LFLAGS) /DEF:$(JPEG)\jpeg.def /DLL /IMPLIB:$(JPEG)\libjpeg.lib $(jpeg_OBJECTS)

$(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) $(CFLAGS) /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 \
		iwm\pango-makealiases-win32.exe

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

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

!ifdef CVS
$(PANGO)\pango\pango.res: $*.rc
!else
$(PANGO)\pango\pango.res:
!endif
	$(RC) $(RFLAGS) /DBUILDNUMBER=0 $*.rc

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

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

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

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

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

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

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

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

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

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

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

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

# 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) $(LFLAGS) /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 $**

$(pangocairo_OBJECTS): $(GLIB)\config.h
	$(CC) $(CFLAGS) /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) $(LFLAGS) /DLL /DEF:$(PANGO)\modules\module.def $(GLIB)\glib\glib-2.0.lib $(GLIB)\gobject\gobject-2.0.lib $(PANGO)\pango\pango-1.0.lib $(PANGO)\pango\pangowin32-1.0.lib gdi32.lib $**

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

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

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

# pango-makealiases-win32
iwm\pango-makealiases-win32.exe: $*.obj
	$(LINK) $(LFLAGS) gdi32.lib user32.lib $**

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

###############################################################################
# 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) $(LFLAGS) /DLL /DEF:$(TIFF)\libtiff\libtiff.def $(JPEG)\libjpeg.lib $(ZLIB)\zdll.lib user32.lib $**

$(tiff_OBJECTS): $(TIFF)\libtiff\tif_config.h $(TIFF)\libtiff\tiffconf.h
	$(CC) $(CFLAGS) /DJPEG_SUPPORT /DTIF_PLATFORM_WINDOWED /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) $(LFLAGS) /DLL /DEF:$(ZLIB)\win32\zlib.def /IMPLIB:$(ZLIB)\zdll.lib $**

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

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


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

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

!ifdef CVS
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
!ifndef CVS
	move /y $(CAIRO)\src\cairo-features.h~ $(CAIRO)\src\cairo-features.h
!endif

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

gtk_clean:
	for %f in ($(gtk_CLEANS)) do if exist %f del /q %f
	for %f in ($(gtk_modules_CLEANS)) do if exist %f del /q %f
!ifdef CVS
	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

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

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

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

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

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

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

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

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 \
		atkhypertext.h \
		atkimage.h \
		atknoopobject.h \
		atknoopobjectfactory.h \
		atkobjectfactory.h \
		atkregistry.h \
		atkrelation.h \
		atkrelationset.h \
		atkrelationtype.h \
		atkselection.h \
		atkstate.h \
		atkstateset.h \
		atkstreamablecontent.h \
		atktable.h \
		atktext.h \
		atkutil.h \
		atkvalue.h
glib_HEADERS= \
		galloca.h \
		garray.h \
		gasyncqueue.h \
		gatomic.h \
		gbacktrace.h \
		gcache.h \
		gcompletion.h \
		gconvert.h \
		gdataset.h \
		gdate.h \
		gdir.h \
		gerror.h \
		gfileutils.h \
		ghash.h \
		ghook.h \
		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 \
		gshell.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 \
!ifdef CVS
		gtkassistant.h \
!endif
		gtkbbox.h \
		gtkbin.h \
		gtkbindings.h \
		gtkbox.h \
		gtkbutton.h \
		gtkcalendar.h \
		gtkcelleditable.h \
		gtkcelllayout.h \
		gtkcellrenderer.h \
		gtkcellrenderercombo.h \
		gtkcellrendererpixbuf.h \
		gtkcellrendererprogress.h \
		gtkcellrenderertext.h \
		gtkcellrenderertoggle.h \
		gtkcellview.h \
		gtkcheckbutton.h \
		gtkcheckmenuitem.h \
		gtkclipboard.h \
		gtkclist.h \
		gtkclipboard.h \
		gtkcolorbutton.h \
		gtkcolorsel.h \
		gtkcolorseldialog.h \
		gtkcombo.h \
		gtkcombobox.h \
		gtkcomboboxentry.h \
		gtkcontainer.h \
		gtkctree.h \
		gtkcurve.h \
		gtkdebug.h \
		gtkdialog.h \
		gtkdnd.h \
		gtkdrawingarea.h \
		gtkeditable.h \
		gtkentry.h \
		gtkentrycompletion.h \
		gtkenums.h \
		gtkeventbox.h \
		gtkexpander.h \
		gtkfilechooser.h \
		gtkfilechooserbutton.h \
		gtkfilechooserdialog.h \
		gtkfilechooserwidget.h \
		gtkfilefilter.h \
		gtkfilesel.h \
		gtkfixed.h \
		gtkfontbutton.h \
		gtkfontsel.h \
		gtkframe.h \
		gtkgamma.h \
		gtkgc.h \
		gtkhandlebox.h \
		gtkhbbox.h \
		gtkhbox.h \
		gtkhpaned.h \
		gtkhruler.h \
		gtkhscale.h \
		gtkhscrollbar.h \
		gtkhseparator.h \
		gtkiconfactory.h \
		gtkicontheme.h \
		gtkiconview.h \
		gtkimage.h \
		gtkimagemenuitem.h \
		gtkimcontext.h \
		gtkimcontextsimple.h \
		gtkimmodule.h \
		gtkimmulticontext.h \
		gtkinputdialog.h \
		gtkinvisible.h \
		gtkitem.h \
		gtkitemfactory.h \
		gtklabel.h \
		gtklayout.h \
		gtklist.h \
		gtklistitem.h \
		gtkliststore.h \
		gtkmain.h \
		gtkmarshal.h \
		gtkmenu.h \
		gtkmenubar.h \
		gtkmenuitem.h \
		gtkmenushell.h \
		gtkmenutoolbutton.h \
		gtkmessagedialog.h \
		gtkmisc.h \
		gtkmodules.h
gtk_1_HEADERS= \
		gtknotebook.h \
		gtkobject.h \
		gtkoldeditable.h \
		gtkoptionmenu.h \
		gtkpaned.h \
		gtkpixmap.h \
		gtkplug.h \
		gtkpreview.h \
		gtkprivate.h \
		gtkprogress.h \
		gtkprogressbar.h \
		gtkradioaction.h \
		gtkradiobutton.h \
		gtkradiomenuitem.h \
		gtkradiotoolbutton.h \
		gtkrange.h \
		gtkrc.h \
		gtkruler.h \
		gtkscale.h \
		gtkscrollbar.h \
		gtkscrolledwindow.h \
		gtkselection.h \
		gtkseparator.h \
		gtkseparatormenuitem.h \
		gtkseparatortoolitem.h \
		gtksettings.h \
		gtksignal.h \
		gtksizegroup.h \
		gtksocket.h \
		gtkspinbutton.h \
		gtkstatusbar.h \
		gtkstock.h \
		gtkstyle.h \
		gtktable.h \
		gtktearoffmenuitem.h \
		gtktext.h \
		gtktextbuffer.h \
		gtktextchild.h \
		gtktextdisplay.h \
		gtktextiter.h \
		gtktextmark.h \
		gtktexttag.h \
		gtktexttagtable.h \
		gtktextview.h \
		gtktipsquery.h \
		gtktoggleaction.h \
		gtktogglebutton.h \
		gtktoggletoolbutton.h \
		gtktoolbar.h \
		gtktoolbutton.h \
		gtktoolitem.h \
		gtktooltips.h \
		gtktree.h \
		gtktreednd.h \
		gtktreeitem.h \
		gtktreemodel.h \
		gtktreemodelfilter.h \
		gtktreemodelsort.h \
		gtktreeselection.h \
		gtktreesortable.h \
		gtktreestore.h \
		gtktreeview.h \
		gtktreeviewcolumn.h \
		gtktypebuiltins.h \
		gtktypeutils.h \
		gtkuimanager.h \
		gtkvbbox.h \
		gtkvbox.h \
		gtkversion.h \
		gtkviewport.h \
		gtkvpaned.h \
		gtkvruler.h \
		gtkvscale.h \
		gtkvscrollbar.h \
		gtkvseparator.h \
		gtkwidget.h \
		gtkwindow.h
pango_HEADERS= \
		pango.h \
		pango-attributes.h \
		pango-break.h \
		pango-context.h \
		pango-coverage.h \
		pango-engine.h \
		pango-enum-types.h \
		pango-font.h \
		pango-fontmap.h \
		pango-fontset.h \
		pango-glyph.h \
		pango-glyph-item.h \
		pango-item.h \
		pango-layout.h \
		pango-modules.h \
		pango-renderer.h \
		pango-script.h \
		pango-tabs.h \
		pango-types.h \
		pango-utils.h \
		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-broken.dll \
		inputim-ti-er.dll \
		inputim-ti-et.dll \
		inputim-viqr.dll
PO=		af am ang ar as az az_IR be bg bn br bs ca cs cy da de el en_CA en_GB \
		eo es et eu fa fi fr ga gl gu he hi hr hu hy ia id is it ja 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 tk tl tr tt ug uk 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) mkdir $(PREFIX)\doc\$(CAIRO)\pixman
	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 $(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.h $(PREFIX)\include
	copy /y $(CAIRO)\src\cairo-features.h $(PREFIX)\include
# GLib
	copy /y $(GLIB)\glib\libglib-2.0-0.dll $(PREFIX)\bin
	copy /y $(GLIB)\glib\gspawn-win32-helper.exe $(PREFIX)\bin
	copy /y $(GLIB)\gmodule\libgmodule-2.0-0.dll $(PREFIX)\bin
	copy /y $(GLIB)\gobject\libgobject-2.0-0.dll $(PREFIX)\bin
	copy /y $(GLIB)\gobject\glib-genmarshal.exe $(PREFIX)\bin
	copy /y $(GLIB)\gthread\libgthread-2.0-0.dll $(PREFIX)\bin
	copy /y $(GLIB)\glib\glib-2.0.lib $(PREFIX)\lib
	copy /y $(GLIB)\gmodule\gmodule-2.0.lib $(PREFIX)\lib
	copy /y $(GLIB)\gobject\gobject-2.0.lib $(PREFIX)\lib
	copy /y $(GLIB)\gthread\gthread-2.0.lib $(PREFIX)\lib
	copy /y $(GLIB)\glibconfig.h $(PREFIX)\include
	copy /y $(GLIB)\glib\glib.h $(PREFIX)\include
	copy /y $(GLIB)\gmodule\gmodule.h $(PREFIX)\include
	copy /y $(GLIB)\glib\glib-object.h $(PREFIX)\include
	if not exist $(PREFIX)\include\glib mkdir $(PREFIX)\include\glib
	for %f in ($(glib_HEADERS)) do copy /y $(GLIB)\glib\%f $(PREFIX)\include\glib
	if not exist $(PREFIX)\include\gobject mkdir $(PREFIX)\include\gobject
	for %f in ($(gobject_HEADERS)) do copy /y $(GLIB)\gobject\%f $(PREFIX)\include\gobject
# GTK+
	copy /y $(GTK)\gdk-pixbuf\libgdk_pixbuf-2.0-0.dll $(PREFIX)\bin
	copy /y $(GTK)\gdk\libgdk-win32-2.0-0.dll $(PREFIX)\bin
	copy /y $(GTK)\gtk\libgtk-win32-2.0-0.dll $(PREFIX)\bin
	copy /y $(GTK)\gtk\gtk-query-immodules-2.0.exe $(PREFIX)\bin
	copy /y $(GTK)\gdk-pixbuf\gdk_pixbuf-2.0.lib $(PREFIX)\lib
	copy /y $(GTK)\gdk\gdk-win32-2.0.lib $(PREFIX)\lib
	copy /y $(GTK)\gtk\gtk-win32-2.0.lib $(PREFIX)\lib
	copy /y $(GTK)\gdk\gdkconfig.h $(PREFIX)\include
	if not exist $(PREFIX)\include\gdk-pixbuf mkdir $(PREFIX)\include\gdk-pixbuf
	for %f in ($(gdk_pixbuf_HEADERS)) do copy /y $(GTK)\gdk-pixbuf\%f $(PREFIX)\include\gdk-pixbuf
	if not exist $(PREFIX)\include\gdk mkdir $(PREFIX)\include\gdk
	copy /y $(GTK)\gdk\win32\gdkwin32.h $(PREFIX)\include\gdk
	for %f in ($(gdk_HEADERS)) do copy /y $(GTK)\gdk\%f $(PREFIX)\include\gdk
	if not exist $(PREFIX)\include\gtk mkdir $(PREFIX)\include\gtk
	for %f in ($(gtk_0_HEADERS)) do copy /y $(GTK)\gtk\%f $(PREFIX)\include\gtk
	for %f in ($(gtk_1_HEADERS)) do copy /y $(GTK)\gtk\%f $(PREFIX)\include\gtk
	if not exist $(PREFIX)\lib\gtk-2.0 mkdir $(PREFIX)\lib\gtk-2.0
	if not exist $(PREFIX)\lib\gtk-2.0\$(GTK_VERSION) mkdir $(PREFIX)\lib\gtk-2.0\$(GTK_VERSION)
	if not exist $(PREFIX)\lib\gtk-2.0\$(GTK_VERSION)\immodules mkdir $(PREFIX)\lib\gtk-2.0\$(GTK_VERSION)\immodules
	for %f in ($(gtk_MODULES)) do copy /y $(GTK)\modules\input\%f $(PREFIX)\lib\gtk-2.0\$(GTK_VERSION)\immodules
# gettext
	copy /y $(GETTEXT)\gettext-tools\src\msgfmt.exe $(PREFIX)\bin
	copy /y $(GETTEXT)\gettext-runtime\intl\intl.dll $(PREFIX)\bin
	copy /y $(GETTEXT)\gettext-runtime\intl\intl.lib $(PREFIX)\lib
	copy /y $(GETTEXT)\gettext-runtime\intl\libgnuintl.h $(PREFIX)\include\libintl.h
# JPEG
	copy /y $(JPEG)\jpeg62.dll $(PREFIX)\bin
# libiconv
	copy /y $(LIBICONV)\lib\iconv.dll $(PREFIX)\bin
# libpng
	copy /y $(LIBPNG)\libpng13.dll $(PREFIX)\bin
# Pango
	copy /y $(PANGO)\pango\libpango-1.0-0.dll $(PREFIX)\bin
	copy /y $(PANGO)\pango\libpangowin32-1.0-0.dll $(PREFIX)\bin
	copy /y $(PANGO)\pango\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
# Zlib
	copy /y $(ZLIB)\zlib1.dll $(PREFIX)\bin
# iwm
	copy /y iwm\pango-makealiases-win32.exe $(PREFIX)\bin
# PO
	if not exist $(PREFIX)\lib\locale mkdir $(PREFIX)\lib\locale
	for %d in ($(PO)) do if not exist $(PREFIX)\lib\locale\%d mkdir $(PREFIX)\lib\locale\%d
	for %d in ($(PO)) do if not exist $(PREFIX)\lib\locale\%d\LC_MESSAGES mkdir $(PREFIX)\lib\locale\%d\LC_MESSAGES
!ifdef CVS
	for %f in ($(PO)) do if exist $(ATK)\po\%f.po $(GETTEXT)\gettext-tools\src\msgfmt.exe $(ATK)\po\%f.po -o $(PREFIX)\lib\locale\%f\LC_MESSAGES\atk10.mo
	for %f in ($(PO)) do if exist $(GLIB)\po\%f.po $(GETTEXT)\gettext-tools\src\msgfmt.exe $(GLIB)\po\%f.po -o $(PREFIX)\lib\locale\%f\LC_MESSAGES\glib20.mo
	for %f in ($(PO)) do if exist $(GTK)\po\%f.po $(GETTEXT)\gettext-tools\src\msgfmt.exe $(GTK)\po\%f.po -o $(PREFIX)\lib\locale\%f\LC_MESSAGES\gtk20.mo
!else
	for %f in ($(PO)) do 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\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)\include\cairo.h del /q $(PREFIX)\include\cairo.h
	if exist $(PREFIX)\include\cairo-features.h del /q $(PREFIX)\include\cairo-features.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\gtk-query-immodules-2.0.exe del /q $(PREFIX)\bin\gtk-query-immodules-2.0.exe
	if exist $(PREFIX)\lib\gdk_pixbuf-2.0.lib del /q $(PREFIX)\lib\gdk_pixbuf-2.0.lib
	if exist $(PREFIX)\lib\gdk-win32-2.0.lib del /q $(PREFIX)\lib\gdk-win32-2.0.lib
	if exist $(PREFIX)\lib\gtk-win32-2.0.lib del /q $(PREFIX)\lib\gtk-win32-2.0.lib
	if exist $(PREFIX)\include\gdkconfig.h del /q $(PREFIX)\include\gdkconfig.h
	if exist $(PREFIX)\include\gdk\gdkwin32.h del /q $(PREFIX)\include\gdk\gdkwin32.h
	for %f in ($(gdk_pixbuf_HEADERS)) do if exist $(PREFIX)\include\gdk-pixbuf\%f del /q $(PREFIX)\include\gdk-pixbuf\%f
	for %f in ($(gdk_HEADERS)) do if exist $(PREFIX)\include\gdk\%f del /q $(PREFIX)\include\gdk\%f
	for %f in ($(gtk_0_HEADERS)) do if exist $(PREFIX)\include\gtk\%f del /q $(PREFIX)\include\gtk\%f
	for %f in ($(gtk_1_HEADERS)) do if exist $(PREFIX)\include\gtk\%f del /q $(PREFIX)\include\gtk\%f
	for %f in ($(gtk_MODULES)) do if exist $(PREFIX)\lib\gtk-2.0\$(GTK_VERSION)\immodules\%f del /q $(PREFIX)\lib\gtk-2.0\$(GTK_VERSION)\immodules\%f
# gettext
	if exist $(PREFIX)\bin\msgfmt.exe del /q $(PREFIX)\bin\msgfmt.exe
	if exist $(PREFIX)\bin\intl.dll del /q $(PREFIX)\bin\intl.dll
	if exist $(PREFIX)\lib\intl.lib del /q $(PREFIX)\lib\intl.lib
	if exist $(PREFIX)\include\libintl.h del /q $(PREFIX)\include\libintl.h
# JPEG
	if exist $(PREFIX)\bin\jpeg62.dll del /q $(PREFIX)\bin\jpeg62.dll
# libiconv
	if exist $(PREFIX)\bin\iconv.dll del /q $(PREFIX)\bin\iconv.dll
# libpng
	if exist $(PREFIX)\bin\libpng13.dll del /q $(PREFIX)\bin\libpng13.dll
# Pango
	if exist $(PREFIX)\bin\libpango-1.0-0.dll del /q $(PREFIX)\bin\libpango-1.0-0.dll
	if exist $(PREFIX)\bin\libpangowin32-1.0-0.dll del /q $(PREFIX)\bin\libpangowin32-1.0-0.dll
	if exist $(PREFIX)\bin\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
# Zlib
	if exist $(PREFIX)\bin\zlib1.dll del /q $(PREFIX)\bin\zlib1.dll
# iwm
	if exist $(PREFIX)\bin\pango-makealiases-win32.exe del /q $(PREFIX)\bin\pango-makealiases-win32.exe
# PO
	for %d in ($(PO)) do for %f in (atk10.mo glib20.mo gtk20.mo) do if exist $(PREFIX)\lib\locale\%d\LC_MESSAGES\%f del /q $(PREFIX)\lib\locale\%d\LC_MESSAGES\%f
	for %d in ($(PO)) do if exist $(PREFIX)\lib\locale\%d\LC_MESSAGES rmdir /q $(PREFIX)\lib\locale\%d\LC_MESSAGES
	for %d in ($(PO)) do if exist $(PREFIX)\lib\locale\%d rmdir /q $(PREFIX)\lib\locale\%d
# Config
	if exist $(PREFIX)\etc\gtk-2.0\gtk.immodules del /q $(PREFIX)\etc\gtk-2.0\gtk.immodules
	if exist $(PREFIX)\etc\pango\pango.aliases del /q $(PREFIX)\etc\pango\pango.aliases
	if exist $(PREFIX)\etc\pango\pango.modules del /q $(PREFIX)\etc\pango\pango.modules
# Documents
	if exist $(PREFIX)\doc\$(ATK)\COPYING del /q $(PREFIX)\doc\$(ATK)\COPYING
	if exist $(PREFIX)\doc\$(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\$(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\$(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)
	-rmdir $(PREFIX)\lib\gtk-2.0
	-rmdir $(PREFIX)\lib\locale
	-rmdir $(PREFIX)\lib\pango\$(PANGO_VERSION)\modules
	-rmdir $(PREFIX)\lib\pango\$(PANGO_VERSION)
	-rmdir $(PREFIX)\lib\pango
	-rmdir $(PREFIX)\lib
	-rmdir $(PREFIX)\include\atk
	-rmdir $(PREFIX)\include\gdk
	-rmdir $(PREFIX)\include\gdk-pixbuf
	-rmdir $(PREFIX)\include\glib
	-rmdir $(PREFIX)\include\gobject
	-rmdir $(PREFIX)\include\gtk
	-rmdir $(PREFIX)\include\pango
	-rmdir $(PREFIX)\include
	-rmdir $(PREFIX)


###############################################################################
#                                                                             #
# 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\$(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 $(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
# 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)\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)\immodules
	for %f in ($(gtk_MODULES)) do copy /y $(GTK)\modules\input\%f $*\lib\gtk-2.0\$(GTK_VERSION)\immodules
# gettext
	copy /y $(GETTEXT)\gettext-runtime\intl\intl.dll $*\bin
# 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
# 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 CVS
	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
	copy /y iwm\config\gtk.immodules $*\etc\gtk-2.0
	copy /y iwm\config\pango.aliases $*\etc\pango
	copy /y iwm\config\pango.modules $*\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\$(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 $(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.h $*\include
	copy /y $(CAIRO)\src\cairo-features.h $*\include
# 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
# 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
	zip -9 -r $@ $*
	rmdir /q /s $*

gtk-$(VERSION).$(RELEASE)-src.zip:
	mkdir $*
	mkdir $*\iwm
!ifndef CVS
	mkdir $*\iwm\atk
	mkdir $*\iwm\cairo
!endif
	mkdir $*\iwm\config
	mkdir $*\iwm\glib
	copy /y atk-$(ATK_VERSION).tar.gz $*
	copy /y cairo-$(CAIRO_VERSION).tar.gz $*
	copy /y gettext-0.14.5.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.10.tar.gz $*
	copy /y libpng-1.2.8.tar.gz $*
	copy /y pango-$(PANGO_VERSION).tar.gz $*
	copy /y tiff-3.8.0.tar.gz $*
	copy /y zlib-1.2.3.tar.gz $*
	copy /y autogen.bat $*
	copy /y makefile $*
	copy /y README $*
	copy /y replace.pl $*
	copy /y iwm\pango-makealiases-win32.c $*\iwm
!ifndef CVS
	copy /y iwm\atk\atkobject.c $*\iwm\atk
	copy /y iwm\cairo\cairo-mutex.h $*\iwm\cairo
!endif
	copy /y iwm\config\gtk.immodules $*\iwm\config
	copy /y iwm\config\pango.aliases $*\iwm\config
	copy /y iwm\config\pango.modules $*\iwm\config
	copy /y iwm\glib\gatomic.c $*\iwm\glib
	zip -9 -r $@ $*
	rmdir /q /s $*
