#copyright (c) 2004 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
ATK=atk-1.6.1
GETTEXT=gettext-0.14.1
GLIB=glib-2.4.6
GTK=gtk-2.4.9
IMIME=imime-0.1.2
JPEG=jpeg-6b
LIBICONV=libiconv-1.9.2
LIBPNG=libpng-1.2.6
PANGO=pango-1.4.1
TIFF=tiff-v3.6.1
ZLIB=zlib-1.2.1

VERSION=2.4.9
RELEASE=2

LIB32=lib
LINK=link

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 /WARN:0
RFLAGS=/DWIN32 /DNDEBUG /D_WINDOWS /D_MBCS /DWINVER=0x0400 /Fo$@


###############################################################################
#                                                                             #
# all                                                                         #
#                                                                             #
###############################################################################
all: imime


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

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

$(ATK)\atk\libatk-1.0-0.dll: $(atk_OBJECTS)
	$(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_OBJECTS): $(ATK)\config.h $(ATK)\atk\atkmarshal.c $(ATK)\atk\atkmarshal.h
	$(CC) $(CFLAGS) /DHAVE_CONFIG_H /I$(ATK) /I$(ATK)\atk /I$(GLIB) /I$(GLIB)\glib $*.c

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

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

$(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 1.6.1" >> $@
	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 "1.6.1" >> $@
	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 "1.6.1" >> $@
	echo. >> $@
	echo /* Define the location where the catalogs will be installed */ >> $@
	echo #define atklocaledir "NONE/lib/locale" >> $@


###############################################################################
# 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\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 $**

$(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\windows\intl.res:

$(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\read-po-abstract.obj \
		$(GETTEXT)\gettext-tools\src\po-lex.obj \
		$(GETTEXT)\gettext-tools\src\po-gram-gen.obj \
		$(GETTEXT)\gettext-tools\src\po-hash-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-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-java.obj \
		$(GETTEXT)\gettext-tools\src\format-csharp.obj \
		$(GETTEXT)\gettext-tools\src\format-awk.obj \
		$(GETTEXT)\gettext-tools\src\format-pascal.obj \
		$(GETTEXT)\gettext-tools\src\format-ycp.obj \
		$(GETTEXT)\gettext-tools\src\format-tcl.obj \
		$(GETTEXT)\gettext-tools\src\format-perl.obj \
		$(GETTEXT)\gettext-tools\src\format-perl-brace.obj \
		$(GETTEXT)\gettext-tools\src\format-php.obj \
		$(GETTEXT)\gettext-tools\src\format-gcc-internal.obj \
		$(GETTEXT)\gettext-tools\src\format-qt.obj \
		$(GETTEXT)\gettext-tools\lib\allocsa.obj \
		$(GETTEXT)\gettext-tools\lib\argmatch.obj \
		$(GETTEXT)\gettext-tools\lib\backupfile.obj \
		$(GETTEXT)\gettext-tools\lib\addext.obj \
		$(GETTEXT)\gettext-tools\lib\basename.obj \
		$(GETTEXT)\gettext-tools\lib\c-ctype.obj \
		$(GETTEXT)\gettext-tools\lib\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.obj \
		$(GETTEXT)\gettext-tools\lib\error-progname.obj \
		$(GETTEXT)\gettext-tools\lib\execute.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\getopt.obj \
		$(GETTEXT)\gettext-tools\lib\getopt1.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-bidi.obj \
		$(GETTEXT)\gettext-tools\lib\pipe-in.obj \
		$(GETTEXT)\gettext-tools\lib\pipe-out.obj \
		$(GETTEXT)\gettext-tools\lib\progname.obj \
		$(GETTEXT)\gettext-tools\lib\progreloc.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\stpncpy.obj \
		$(GETTEXT)\gettext-tools\lib\strtoul.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\fnmatch.obj \
		$(GETTEXT)\gettext-tools\lib\getline.obj \
		$(GETTEXT)\gettext-tools\lib\getndelim2.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\strcasecmp.obj \
		$(GETTEXT)\gettext-tools\lib\strncasecmp.obj \
		$(GETTEXT)\gettext-tools\lib\vasprintf.obj

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

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

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

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

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


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

# GLib
glib_OBJECTS= \
		$(GLIB)\glib\garray.obj \
		$(GLIB)\glib\gasyncqueue.obj \
		$(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\glist.obj \
		$(GLIB)\glib\gmain.obj \
		$(GLIB)\glib\gmarkup.obj \
		$(GLIB)\glib\gmem.obj \
		$(GLIB)\glib\gmessages.obj \
		$(GLIB)\glib\gnode.obj \
		$(GLIB)\glib\gprimes.obj \
		$(GLIB)\glib\gqsort.obj \
		$(GLIB)\glib\gqueue.obj \
		$(GLIB)\glib\gpattern.obj \
		$(GLIB)\glib\gprintf.obj \
		$(GLIB)\glib\grand.obj \
		$(GLIB)\glib\grel.obj \
		$(GLIB)\glib\gscanner.obj \
		$(GLIB)\glib\gshell.obj \
		$(GLIB)\glib\gslist.obj \
		$(GLIB)\glib\gspawn-win32.obj \
		$(GLIB)\glib\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 \
#MODIFY	$(GLIB)\glib\gwin32.obj \
		iwm\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)\glib\libglib-2.0-0.dll: $(glib_OBJECTS) $(GLIB)\build\win32\dirent\dirent.obj $(GLIB)\glib\glib.res
	$(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 user32.lib wsock32.lib $**

$(glib_OBJECTS): $(GLIB)\config.h $(GLIB)\glibconfig.h $(GLIB)\libintl.h
	$(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)\build\win32\dirent\dirent.obj: $(GLIB)\config.h
	$(CC) $(CFLAGS) /I$(GLIB) /I$(GLIB)\build\win32\dirent $*.c

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

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

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

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

# 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: $(GLIB)\config.h
	$(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
	$(LINK) $(LFLAGS) /DLL /DEF:$(GLIB)\gmodule\gmodule.def /IMPLIB:$(GLIB)\gmodule\gmodule-2.0.lib $(GLIB)\glib\glib-2.0.lib $**

$(GLIB)\gmodule\gmodule.obj: $(GLIB)\config.h $(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\gmodule.res:
	$(RC) $(RFLAGS) /DBUILDNUMBER=0 $*.rc

$(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)
	$(LINK) $(LFLAGS) /DLL /DEF:$(GLIB)\gobject\gobject.def /IMPLIB:$(GLIB)\gobject\gobject-2.0.lib $(GLIB)\glib\glib-2.0.lib $**

$(gobject_OBJECTS): $(GLIB)\config.h
	$(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\gobject.res:
	$(RC) $(RFLAGS) /DBUILDNUMBER=0 $*.rc

# 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)\config.h
	$(CC) $(CFLAGS) /DG_LOG_DOMAIN=\"GLib-Genmarshal\" /DHAVE_CONFIG_H /FImsvc_recommended_pragmas.h /I$(GLIB) /I$(GLIB)\glib $*.c

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

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

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


###############################################################################
# GTK+                                                                        #
###############################################################################
gtk: atk jpeg libpng pango tiff \
		$(GTK)\gdk-pixbuf\libgdk_pixbuf-2.0-0.dll \
		$(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-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.4.exe

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

$(GTK)\gdk-pixbuf\libgdk_pixbuf-2.0-0.dll: $(gdk_pixbuf_OBJECTS) $(GTK)\gdk-pixbuf\gdk_pixbuf.res
	$(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)\config.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 /I$(JPEG) /I$(LIBPNG) /I$(ZLIB) $*.c

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

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

# GDK
gdk_OBJECTS= \
		$(GTK)\gdk\gdk.obj \
		$(GTK)\gdk\gdkcolor.obj \
		$(GTK)\gdk\gdkcursor.obj \
		$(GTK)\gdk\gdkdisplay.obj \
		$(GTK)\gdk\gdkdisplaymanager.obj \
		$(GTK)\gdk\gdkdnd.obj \
		$(GTK)\gdk\gdkdraw.obj \
		$(GTK)\gdk\gdkenumtypes.obj \
		$(GTK)\gdk\gdkevents.obj \
		$(GTK)\gdk\gdkfont.obj \
		$(GTK)\gdk\gdkgc.obj \
		$(GTK)\gdk\gdkglobals.obj \
		$(GTK)\gdk\gdkimage.obj \
		$(GTK)\gdk\gdkkeynames.obj \
		$(GTK)\gdk\gdkkeys.obj \
		$(GTK)\gdk\gdkkeyuni.obj \
		$(GTK)\gdk\gdkpango.obj \
		$(GTK)\gdk\gdkpixbuf-drawable.obj \
		$(GTK)\gdk\gdkpixbuf-render.obj \
		$(GTK)\gdk\gdkpixmap.obj \
		$(GTK)\gdk\gdkpolyreg-generic.obj \
		$(GTK)\gdk\gdkrectangle.obj \
		$(GTK)\gdk\gdkregion-generic.obj \
		$(GTK)\gdk\gdkrgb.obj \
		$(GTK)\gdk\gdkscreen.obj \
		$(GTK)\gdk\gdkselection.obj \
		$(GTK)\gdk\gdkvisual.obj \
		$(GTK)\gdk\gdkwindow.obj \
		$(GTK)\gdk\win32\gdkcolor-win32.obj \
		$(GTK)\gdk\win32\gdkcursor-win32.obj \
		$(GTK)\gdk\win32\gdkdnd-win32.obj \
		$(GTK)\gdk\win32\gdkdisplay-win32.obj \
		$(GTK)\gdk\win32\gdkdrawable-win32.obj \
		$(GTK)\gdk\win32\gdkevents-win32.obj \
		$(GTK)\gdk\win32\gdkfont-win32.obj \
		$(GTK)\gdk\win32\gdkgc-win32.obj \
		$(GTK)\gdk\win32\gdkgeometry-win32.obj \
		$(GTK)\gdk\win32\gdkglobals-win32.obj \
		$(GTK)\gdk\win32\gdkim-win32.obj \
		$(GTK)\gdk\win32\gdkimage-win32.obj \
		$(GTK)\gdk\win32\gdkinput.obj \
		$(GTK)\gdk\win32\gdkinput-win32.obj \
		$(GTK)\gdk\win32\gdkkeys-win32.obj \
		$(GTK)\gdk\win32\gdkmain-win32.obj \
		$(GTK)\gdk\win32\gdkpango-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 \
#MODIFY	$(GTK)\gdk\win32\gdkwindow-win32.obj
		iwm\gdk\gdkwindow-win32.obj

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

$(gdk_OBJECTS): $(GTK)\config.h $(GTK)\gdk\gdkconfig.h
	$(CC) $(CFLAGS) /DG_LOG_DOMAIN=\"Gdk\" /DGDK_ENABLE_BROKEN /DGDK_VERSION=\"2.0\" /DHAVE_CONFIG_H /DINSIDE_GDK_WIN32 /FImsvc_recommended_pragmas.h /I$(GTK) /I$(GTK)\gdk /I$(GTK)\gdk\win32 /I$(GTK)\gdk-pixbuf /I$(GLIB) /I$(GLIB)\glib /I$(GLIB)\gmodule /I$(PANGO) $*.c

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

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

# GTK+
gtk_OBJECTS= \
		$(GTK)\gtk\fnmatch.obj \
		$(GTK)\gtk\gtkaccelgroup.obj \
		$(GTK)\gtk\gtkaccellabel.obj \
		$(GTK)\gtk\gtkaccelmap.obj \
		$(GTK)\gtk\gtkaccessible.obj \
		$(GTK)\gtk\gtkaction.obj \
		$(GTK)\gtk\gtkactiongroup.obj \
		$(GTK)\gtk\gtkadjustment.obj \
		$(GTK)\gtk\gtkalignment.obj \
		$(GTK)\gtk\gtkarrow.obj \
		$(GTK)\gtk\gtkaspectframe.obj \
		$(GTK)\gtk\gtkbin.obj \
		$(GTK)\gtk\gtkbindings.obj \
		$(GTK)\gtk\gtkbbox.obj \
		$(GTK)\gtk\gtkbox.obj \
		$(GTK)\gtk\gtkbutton.obj \
		$(GTK)\gtk\gtkcalendar.obj \
		$(GTK)\gtk\gtkcelleditable.obj \
		$(GTK)\gtk\gtkcelllayout.obj \
		$(GTK)\gtk\gtkcellrenderer.obj \
		$(GTK)\gtk\gtkcellrenderertext.obj \
		$(GTK)\gtk\gtkcellrenderertoggle.obj \
		$(GTK)\gtk\gtkcellrendererpixbuf.obj \
		$(GTK)\gtk\gtkcellrendererseptext.obj \
		$(GTK)\gtk\gtkcellview.obj \
		$(GTK)\gtk\gtkcellviewmenuitem.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\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\gtkiconfactory.obj \
		$(GTK)\gtk\gtkicontheme.obj \
		$(GTK)\gtk\gtkiconthemeparser.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\gtkmessagedialog.obj \
		$(GTK)\gtk\gtkmisc.obj \
		$(GTK)\gtk\gtknotebook.obj \
		$(GTK)\gtk\gtkobject.obj \
		$(GTK)\gtk\gtkoldeditable.obj \
		$(GTK)\gtk\gtkoptionmenu.obj \
		$(GTK)\gtk\gtkpaned.obj \
		$(GTK)\gtk\gtkpathbar.obj \
		$(GTK)\gtk\gtkpixmap.obj \
#		$(GTK)\gtk\gtkplug.obj \
		$(GTK)\gtk\gtkpreview.obj \
		$(GTK)\gtk\gtkprogress.obj \
		$(GTK)\gtk\gtkprogressbar.obj \
		$(GTK)\gtk\gtkradioaction.obj \
		$(GTK)\gtk\gtkradiobutton.obj \
		$(GTK)\gtk\gtkradiotoolbutton.obj \
		$(GTK)\gtk\gtkradiomenuitem.obj \
		$(GTK)\gtk\gtkrange.obj \
		$(GTK)\gtk\gtkrbtree.obj \
		$(GTK)\gtk\gtkrc.obj \
		$(GTK)\gtk\gtkruler.obj \
		$(GTK)\gtk\gtkscale.obj \
		$(GTK)\gtk\gtkscrollbar.obj \
		$(GTK)\gtk\gtkscrolledwindow.obj \
		$(GTK)\gtk\gtkselection.obj \
		$(GTK)\gtk\gtkseparator.obj \
		$(GTK)\gtk\gtkseparatormenuitem.obj \
		$(GTK)\gtk\gtkseparatortoolitem.obj \
		$(GTK)\gtk\gtksettings.obj \
		$(GTK)\gtk\gtksignal.obj \
		$(GTK)\gtk\gtksizegroup.obj \
#		$(GTK)\gtk\gtksocket.obj \
		$(GTK)\gtk\gtkspinbutton.obj \
		$(GTK)\gtk\gtkstyle.obj \
		$(GTK)\gtk\gtkstatusbar.obj \
		$(GTK)\gtk\gtkstock.obj \
		$(GTK)\gtk\gtktable.obj \
		$(GTK)\gtk\gtktearoffmenuitem.obj \
		$(GTK)\gtk\gtktext.obj \
		$(GTK)\gtk\gtktextbtree.obj \
		$(GTK)\gtk\gtktextbuffer.obj \
		$(GTK)\gtk\gtktextchild.obj \
		$(GTK)\gtk\gtktextdisplay.obj \
		$(GTK)\gtk\gtktextiter.obj \
		$(GTK)\gtk\gtktextlayout.obj \
		$(GTK)\gtk\gtktextmark.obj \
		$(GTK)\gtk\gtktextsegment.obj \
		$(GTK)\gtk\gtktexttag.obj \
		$(GTK)\gtk\gtktexttagtable.obj \
		$(GTK)\gtk\gtktexttypes.obj \
		$(GTK)\gtk\gtktextutil.obj \
		$(GTK)\gtk\gtktextview.obj \
		$(GTK)\gtk\gtkthemes.obj \
		$(GTK)\gtk\gtktipsquery.obj \
		$(GTK)\gtk\gtktoggleaction.obj \
		$(GTK)\gtk\gtktogglebutton.obj \
		$(GTK)\gtk\gtktoggletoolbutton.obj \
		$(GTK)\gtk\gtktoolbar.obj \
		$(GTK)\gtk\gtktoolbutton.obj \
		$(GTK)\gtk\gtktoolitem.obj \
		$(GTK)\gtk\gtktooltips.obj \
		$(GTK)\gtk\gtktree.obj \
		$(GTK)\gtk\gtktreedatalist.obj \
		$(GTK)\gtk\gtktreednd.obj \
		$(GTK)\gtk\gtktreeitem.obj \
		$(GTK)\gtk\gtktreemodel.obj \
		$(GTK)\gtk\gtktreemodelfilter.obj \
		$(GTK)\gtk\gtktreemodelsort.obj \
		$(GTK)\gtk\gtktreeselection.obj \
		$(GTK)\gtk\gtktreesortable.obj \
		$(GTK)\gtk\gtktreestore.obj \
		$(GTK)\gtk\gtktreeview.obj \
		$(GTK)\gtk\gtktreeviewcolumn.obj \
		$(GTK)\gtk\gtktypeutils.obj \
		$(GTK)\gtk\gtktypebuiltins.obj \
		$(GTK)\gtk\gtkuimanager.obj \
		$(GTK)\gtk\gtkvbbox.obj \
		$(GTK)\gtk\gtkvbox.obj \
		$(GTK)\gtk\gtkviewport.obj \
		$(GTK)\gtk\gtkvpaned.obj \
		$(GTK)\gtk\gtkvruler.obj \
		$(GTK)\gtk\gtkvscale.obj \
		$(GTK)\gtk\gtkvscrollbar.obj \
		$(GTK)\gtk\gtkvseparator.obj \
		$(GTK)\gtk\gtkwidget.obj \
		$(GTK)\gtk\gtkwindow.obj \
		$(GTK)\gtk\gtkwindow-decorate.obj

$(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 $(GLIB)\glib\glib-2.0.lib $(GLIB)\gmodule\gmodule-2.0.lib $(GLIB)\gobject\gobject-2.0.lib $(GTK)\gdk-pixbuf\gdk_pixbuf-2.0.lib $(GTK)\gdk\gdk-win32-2.0.lib $(GETTEXT)\gettext-runtime\intl\intl.lib gdi32.lib shell32.lib user32.lib ws2_32.lib $(PANGO)\pango\pango-1.0.lib $**

$(gtk_OBJECTS): $(GTK)\config.h
	$(CC) $(CFLAGS) /DG_LOG_DOMAIN=\"Gtk\" /DGTK_BINARY_VERSION=\"2.4.9\" /DGTK_DISABLE_COMPAT_H /DGTK_FILE_SYSTEM_ENABLE_UNSUPPORTED /DGTK_HOST=\"win32\" /DGTK_LIBDIR=\"/target/lib\" /DGTK_VERSION=\"2.4\" /Dnear=xxnear /DPANGO_ENABLE_BACKEND /FImsvc_recommended_pragmas.h /I$(GTK) /I$(GTK)\gdk /I$(ATK) /I$(GLIB) /I$(GLIB)\glib /I$(GLIB)\gmodule /I$(PANGO) $*.c

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

# im-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: $(GTK)\config.h
	$(CC) $(CFLAGS) /DG_DISABLE_DEPRECATED /DGDK_PIXBUF_DISABLE_DEPRECATED /DGDK_DISABLE_DEPRECATED /DGTK_DISABLE_DEPRECATED /DGTK_LOCALEDIR=\"\" /I$(GTK) /I$(GTK)\gdk /I$(GLIB) /I$(GLIB)\glib /I$(PANGO) $*.c

# im-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: $(GTK)\config.h
	$(CC) $(CFLAGS) /DG_DISABLE_DEPRECATED /DGDK_PIXBUF_DISABLE_DEPRECATED /DGDK_DISABLE_DEPRECATED /DGTK_DISABLE_DEPRECATED /DGTK_LOCALEDIR=\"\" /I$(GTK) /I$(GTK)\gdk /I$(GLIB) /I$(GLIB)\glib /I$(PANGO) $*.c

# im-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: $(GTK)\config.h
	$(CC) $(CFLAGS) /DG_DISABLE_DEPRECATED /DGDK_PIXBUF_DISABLE_DEPRECATED /DGDK_DISABLE_DEPRECATED /DGTK_DISABLE_DEPRECATED /DGTK_LOCALEDIR=\"\" /I$(GTK) /I$(GTK)\gdk /I$(GLIB) /I$(GLIB)\glib /I$(PANGO) $*.c

# im-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: $(GTK)\config.h
	$(CC) $(CFLAGS) /DG_DISABLE_DEPRECATED /DGDK_PIXBUF_DISABLE_DEPRECATED /DGDK_DISABLE_DEPRECATED /DGTK_DISABLE_DEPRECATED /DGTK_LOCALEDIR=\"\" /I$(GTK) /I$(GTK)\gdk /I$(GLIB) /I$(GLIB)\glib /I$(PANGO) $*.c

# im-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: $(GTK)\config.h
	$(CC) $(CFLAGS) /DG_DISABLE_DEPRECATED /DGDK_PIXBUF_DISABLE_DEPRECATED /DGDK_DISABLE_DEPRECATED /DGTK_DISABLE_DEPRECATED /DGTK_LOCALEDIR=\"\" /I$(GTK) /I$(GTK)\gdk /I$(GLIB) /I$(GLIB)\glib /I$(PANGO) $*.c

# im-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: $(GTK)\config.h
	$(CC) $(CFLAGS) /DG_DISABLE_DEPRECATED /DGDK_PIXBUF_DISABLE_DEPRECATED /DGDK_DISABLE_DEPRECATED /DGTK_DISABLE_DEPRECATED /DGTK_LOCALEDIR=\"\" /I$(GTK) /I$(GTK)\gdk /I$(GLIB) /I$(GLIB)\glib /I$(PANGO) $*.c

# im-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: $(GTK)\config.h
	$(CC) $(CFLAGS) /DG_DISABLE_DEPRECATED /DGDK_PIXBUF_DISABLE_DEPRECATED /DGDK_DISABLE_DEPRECATED /DGTK_DISABLE_DEPRECATED /DGTK_LOCALEDIR=\"\" /I$(GTK) /I$(GTK)\gdk /I$(GLIB) /I$(GLIB)\glib /I$(PANGO) $*.c

# im-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: $(GTK)\config.h
	$(CC) $(CFLAGS) /DG_DISABLE_DEPRECATED /DGDK_PIXBUF_DISABLE_DEPRECATED /DGDK_DISABLE_DEPRECATED /DGTK_DISABLE_DEPRECATED /DGTK_LOCALEDIR=\"\" /I$(GTK) /I$(GTK)\gdk /I$(GLIB) /I$(GLIB)\glib /I$(PANGO) $*.c

# im-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: $(GTK)\config.h
	$(CC) $(CFLAGS) /DG_DISABLE_DEPRECATED /DGDK_PIXBUF_DISABLE_DEPRECATED /DGDK_DISABLE_DEPRECATED /DGTK_DISABLE_DEPRECATED /DGTK_LOCALEDIR=\"\" /I$(GTK) /I$(GTK)\gdk /I$(GLIB) /I$(GLIB)\glib /I$(PANGO) $*.c

# gtk-query-immodules-2.4.exe
#MODIFY $(GTK)\gtk\gtk-query-immodules-2.4.exe: $(GTK)\gtk\queryimmodules.obj
$(GTK)\gtk\gtk-query-immodules-2.4.exe: iwm\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 $**

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


###############################################################################
# imime                                                                       #
###############################################################################
imime: gtk $(IMIME)\inputim-ime.dll

imime_OBJECTS= \
		$(IMIME)\gtkimcontextime.obj \
		$(IMIME)\imime.obj

$(IMIME)\inputim-ime.dll: $(imime_OBJECTS)
	$(LINK) $(LFLAGS) /DLL /DEF:$(IMIME)\imime.def imm32.lib user32.lib $(GLIB)\glib\glib-2.0.lib $(GLIB)\gobject\gobject-2.0.lib $(GTK)\gdk\gdk-win32-2.0.lib $(GTK)\gtk\gtk-win32-2.0.lib $(PANGO)\pango\pango-1.0.lib $(PANGO)\pango\pangowin32-1.0.lib $**

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

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


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

$(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 /EXPORT:png_create_read_struct_2,@180 $(ZLIB)\zlib.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)\libjpeg.lib

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)\libjpeg.lib: $(jpeg_OBJECTS)
	$(LIB32) /NOLOGO /OUT:$@ $**

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

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

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

# pango
pango_OBJECTS= \
		$(PANGO)\pango\pango-enum-types.obj \
		$(PANGO)\pango\break.obj \
		$(PANGO)\pango\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-script.obj \
		$(PANGO)\pango\pango-tabs.obj \
		$(PANGO)\pango\pango-utils.obj \
		$(PANGO)\pango\reorder-items.obj \
		$(PANGO)\pango\shape.obj \
		$(PANGO)\pango\mini-fribidi\fribidi.obj \
		$(PANGO)\pango\mini-fribidi\fribidi_char_type.obj \
		$(PANGO)\pango\mini-fribidi\fribidi_types.obj

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

$(pango_OBJECTS): $(GLIB)\config.h
	$(CC) $(CFLAGS) /DLIBDIR=\"/target/lib\" /DMODULE_VERSION=\"1.4.1\" /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)\pango\pango.res:
	$(RC) $(RFLAGS) /DBUILDNUMBER=0 $*.rc

# pangowin32
pangowin32_OBJECTS= \
		$(PANGO)\pango\module-defs-win32.obj \
		$(PANGO)\pango\pangowin32.obj \
		$(PANGO)\pango\pangowin32-fontcache.obj \
#MODIFY	$(PANGO)\pango\pangowin32-fontmap.obj
		iwm\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 $**

$(pangowin32_OBJECTS): $(GLIB)\config.h $(PANGO)\pango\module-defs-win32.c
	$(CC) $(CFLAGS) /DLIBDIR=\"/target/lib\" /DMODULE_VERSION=\"1.4.1\" /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 $*.c

$(PANGO)\pango\basic-win32.obj: $(GLIB)\config.h $(PANGO)\pango\module-defs-win32.c
	$(CC) $(CFLAGS) /DLIBDIR=\"/target/lib\" /DMODULE_VERSION=\"1.4.1\" /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\pangowin32.res:
	$(RC) $(RFLAGS) /DBUILDNUMBER=0 $*.rc

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

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

$(PANGO)\modules\basic\basic-win32.obj:
	$(CC) $(CFLAGS) /DLIBDIR=\"/target/lib\" /DMODULE_VERSION=\"1.4.1\" /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
#MODIFY $(PANGO)\pango\pango-querymodules.exe: $(PANGO)\pango\querymodules.obj
$(PANGO)\pango\pango-querymodules.exe: iwm\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 $**

#MODIFY $(PANGO)\pango\querymodules.obj:
iwm\pango\querymodules.obj:
	$(CC) $(CFLAGS) /DMODULE_VERSION=\"1.4.1\" /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

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

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

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

$(tiff_OBJECTS):
	$(CC) $(CFLAGS) /DJPEG_SUPPORT /DTIF_PLATFORM_WINDOWED /I$(JPEG) $*.c


###############################################################################
# zlib                                                                        #
###############################################################################
zlib: $(ZLIB)\zlib.lib

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)\zlib.lib: $(zlib_OBJECTS)
	$(LIB32) /NOLOGO /OUT:$@ $**

$(zlib_OBJECTS):
	$(CC) $(CFLAGS) /DXML_DTD /DXML_NS $*.c


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


###############################################################################
# Install                                                                     #
###############################################################################
install: all
# Folders
	if not exist $(PREFIX) mkdir $(PREFIX)
	if not exist $(PREFIX)\bin mkdir $(PREFIX)\bin
	if not exist $(PREFIX)\lib mkdir $(PREFIX)\lib
	if not exist $(PREFIX)\include mkdir $(PREFIX)\include
# Documents
	if not exist $(PREFIX)\doc mkdir $(PREFIX)\doc
	if not exist $(PREFIX)\doc\$(ATK) mkdir $(PREFIX)\doc\$(ATK)
	if not exist $(PREFIX)\doc\$(GETTEXT) mkdir $(PREFIX)\doc\$(GETTEXT)
	if not exist $(PREFIX)\doc\$(GETTEXT)\gettext-runtime mkdir $(PREFIX)\doc\$(GETTEXT)\gettext-runtime
	if not exist $(PREFIX)\doc\$(GETTEXT)\gettext-runtime\intl mkdir $(PREFIX)\doc\$(GETTEXT)\gettext-runtime\intl
	if not exist $(PREFIX)\doc\$(GLIB) mkdir $(PREFIX)\doc\$(GLIB)
	if not exist $(PREFIX)\doc\$(GTK) mkdir $(PREFIX)\doc\$(GTK)
	if not exist $(PREFIX)\doc\$(IMIME) mkdir $(PREFIX)\doc\$(IMIME)
	if not exist $(PREFIX)\doc\$(JPEG) mkdir $(PREFIX)\doc\$(JPEG)
	if not exist $(PREFIX)\doc\$(LIBPNG) mkdir $(PREFIX)\doc\$(LIBPNG)
	if not exist $(PREFIX)\doc\$(PANGO) mkdir $(PREFIX)\doc\$(PANGO)
	if not exist $(PREFIX)\doc\$(TIFF) mkdir $(PREFIX)\doc\$(TIFF)
	if not exist $(PREFIX)\doc\$(ZLIB) mkdir $(PREFIX)\doc\$(ZLIB)
	copy /y $(ATK)\COPYING $(PREFIX)\doc\$(ATK)
	copy /y $(GETTEXT)\COPYING $(PREFIX)\doc\$(GETTEXT)
	copy /y $(GETTEXT)\gettext-runtime\intl\COPYING.LIB-2.1 $(PREFIX)\doc\$(GETTEXT)\gettext-runtime\intl
	copy /y $(GLIB)\COPYING $(PREFIX)\doc\$(GLIB)
	copy /y $(GTK)\COPYING $(PREFIX)\doc\$(GTK)
	copy /y $(IMIME)\COPYING $(PREFIX)\doc\$(IMIME)
	copy /y $(JPEG)\README $(PREFIX)\doc\$(JPEG)
	copy /y $(LIBPNG)\LICENSE $(PREFIX)\doc\$(LIBPNG)
	copy /y $(PANGO)\COPYING $(PREFIX)\doc\$(PANGO)
	copy /y $(TIFF)\COPYRIGHT $(PREFIX)\doc\$(TIFF)
	copy /y $(ZLIB)\README $(PREFIX)\doc\$(ZLIB)
	if not exist $(PREFIX)\README copy /y README $(PREFIX)
# ATK
	copy /y $(ATK)\atk\libatk-1.0-0.dll $(PREFIX)\bin
	copy /y $(ATK)\atk\atk-1.0.lib $(PREFIX)\lib
	if not exist $(PREFIX)\include\atk mkdir $(PREFIX)\include\atk
	for %f in ($(atk_HEADERS)) do copy /y $(ATK)\atk\%f $(PREFIX)\include\atk
# GLib
	copy /y $(GLIB)\glib\libglib-2.0-0.dll $(PREFIX)\bin
	copy /y $(GLIB)\glib\gspawn-win32-helper.exe $(PREFIX)\bin
	copy /y $(GLIB)\gmodule\libgmodule-2.0-0.dll $(PREFIX)\bin
	copy /y $(GLIB)\gobject\libgobject-2.0-0.dll $(PREFIX)\bin
	copy /y $(GLIB)\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.4.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\2.4.9 mkdir $(PREFIX)\lib\gtk-2.0\2.4.9
	if not exist $(PREFIX)\lib\gtk-2.0\2.4.9\immodules mkdir $(PREFIX)\lib\gtk-2.0\2.4.9\immodules
	for %f in ($(gtk_MODULES)) do copy /y $(GTK)\modules\input\%f $(PREFIX)\lib\gtk-2.0\2.4.9\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
# imime
	copy /y $(IMIME)\inputim-ime.dll $(PREFIX)\lib\gtk-2.0\2.4.9\immodules
# libiconv
	copy /y $(LIBICONV)\lib\iconv.dll $(PREFIX)\bin
# libpng
	copy /y $(LIBPNG)\libpng13.dll $(PREFIX)\bin
# Pango
	copy /y $(PANGO)\pango\libpango-1.0-0.dll $(PREFIX)\bin
	copy /y $(PANGO)\pango\libpangowin32-1.0-0.dll $(PREFIX)\bin
	copy /y $(PANGO)\pango\pango-querymodules.exe $(PREFIX)\bin
	copy /y $(PANGO)\pango\pango-1.0.lib $(PREFIX)\lib
	copy /y $(PANGO)\pango\pangowin32-1.0.lib $(PREFIX)\lib
	if not exist $(PREFIX)\include\pango mkdir $(PREFIX)\include\pango
	for %f in ($(pango_HEADERS)) do copy /y $(PANGO)\pango\%f $(PREFIX)\include\pango
	if not exist $(PREFIX)\lib\pango mkdir $(PREFIX)\lib\pango
	if not exist $(PREFIX)\lib\pango\1.4.1 mkdir $(PREFIX)\lib\pango\1.4.1
	if not exist $(PREFIX)\lib\pango\1.4.1\modules mkdir $(PREFIX)\lib\pango\1.4.1\modules
	copy /y $(PANGO)\modules\basic\pango-basic-win32.dll $(PREFIX)\lib\pango\1.4.1\modules
# TIFF
	copy /y $(TIFF)\libtiff\libtiff.dll $(PREFIX)\bin
# PO
	if not exist $(PREFIX)\lib\locale mkdir $(PREFIX)\lib\locale
	for %d in ($(PO)) do if not exist $(PREFIX)\lib\locale\%d mkdir $(PREFIX)\lib\locale\%d
	for %d in ($(PO)) do if not exist $(PREFIX)\lib\locale\%d\LC_MESSAGES mkdir $(PREFIX)\lib\locale\%d\LC_MESSAGES
	for %f in ($(PO)) do copy /y $(ATK)\po\%f.gmo $(PREFIX)\lib\locale\%f\LC_MESSAGES\atk10.mo
	for %f in ($(PO)) do copy /y $(GLIB)\po\%f.gmo $(PREFIX)\lib\locale\%f\LC_MESSAGES\glib20.mo
	for %f in ($(PO)) do copy /y $(GTK)\po\%f.gmo $(PREFIX)\lib\locale\%f\LC_MESSAGES\gtk20.mo
# Config
	if not exist $(PREFIX)\etc mkdir $(PREFIX)\etc
	if not exist $(PREFIX)\etc\gtk-2.0 mkdir $(PREFIX)\etc\gtk-2.0
	if not exist $(PREFIX)\etc\pango mkdir $(PREFIX)\etc\pango
	copy /y iwm\config\pango.aliases $(PREFIX)\etc\pango
	$(PREFIX)\bin\gtk-query-immodules-2.4.exe > $(PREFIX)\etc\gtk-2.0\gtk.immodules
	$(PREFIX)\bin\pango-querymodules $(PREFIX)\lib\pango\1.4.1\modules\pango-basic-win32.dll > $(PREFIX)\etc\pango\pango.modules

###############################################################################
# Uninstall                                                                   #
###############################################################################
uninstall:
# ATK
	if exist $(PREFIX)\bin\libatk-1.0-0.dll del /q $(PREFIX)\bin\libatk-1.0-0.dll
	if exist $(PREFIX)\lib\atk-1.0.lib del /q $(PREFIX)\lib\atk-1.0.lib
	for %f in ($(atk_HEADERS)) do if exist $(PREFIX)\include\atk\%f del /q $(PREFIX)\include\atk\%f
# GLib
	if exist $(PREFIX)\bin\libglib-2.0-0.dll del /q $(PREFIX)\bin\libglib-2.0-0.dll
	if exist $(PREFIX)\bin\libgmodule-2.0-0.dll del /q $(PREFIX)\bin\libgmodule-2.0-0.dll
	if exist $(PREFIX)\bin\gspawn-win32-helper.exe del /q $(PREFIX)\bin\gspawn-win32-helper.exe
	if exist $(PREFIX)\bin\libgobject-2.0-0.dll del /q $(PREFIX)\bin\libgobject-2.0-0.dll
	if exist $(PREFIX)\bin\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.4.exe del /q $(PREFIX)\bin\gtk-query-immodules-2.4.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\2.4.9\immodules\%f del /q $(PREFIX)\lib\gtk-2.0\2.4.9\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
# imime
	if exist $(PREFIX)\lib\gtk-2.0\2.4.9\immodules\inputim-ime.dll del /q $(PREFIX)\lib\gtk-2.0\2.4.9\immodules\inputim-ime.dll
# libiconv
	if exist $(PREFIX)\bin\iconv.dll del /q $(PREFIX)\bin\iconv.dll
# libpng
	if exist $(PREFIX)\bin\libpng13.dll del /q $(PREFIX)\bin\libpng13.dll
# Pango
	if exist $(PREFIX)\bin\libpango-1.0-0.dll del /q $(PREFIX)\bin\libpango-1.0-0.dll
	if exist $(PREFIX)\bin\libpangowin32-1.0-0.dll del /q $(PREFIX)\bin\libpangowin32-1.0-0.dll
	if exist $(PREFIX)\bin\pango-querymodules.exe del /q $(PREFIX)\bin\pango-querymodules.exe
	if exist $(PREFIX)\lib\pango-1.0.lib del /q $(PREFIX)\lib\pango-1.0.lib
	if exist $(PREFIX)\lib\pangowin32-1.0.lib del /q $(PREFIX)\lib\pangowin32-1.0.lib
	if exist $(PREFIX)\include\pango.h del /q $(PREFIX)\include\pango.h
	for %f in ($(pango_HEADERS)) do if exist $(PREFIX)\include\pango\%f del /q $(PREFIX)\include\pango\%f
	if exist $(PREFIX)\lib\pango\1.4.1\modules\pango-basic-win32.dll del /q $(PREFIX)\lib\pango\1.4.1\modules\pango-basic-win32.dll
# TIFF
	if exist $(PREFIX)\bin\libtiff.dll del /q $(PREFIX)\bin\libtiff.dll
# PO
	for %d in ($(PO)) do for %f in (atk10.mo glib20.mo gtk20.mo) do if exist $(PREFIX)\lib\locale\%d\LC_MESSAGES\%f del /q $(PREFIX)\lib\locale\%d\LC_MESSAGES\%f
	for %d in ($(PO)) do if exist $(PREFIX)\lib\locale\%d\LC_MESSAGES rmdir /q $(PREFIX)\lib\locale\%d\LC_MESSAGES
	for %d in ($(PO)) do if exist $(PREFIX)\lib\locale\%d rmdir /q $(PREFIX)\lib\locale\%d
# Config
	if exist $(PREFIX)\etc\gtk-2.0\gtk.immodules del /q $(PREFIX)\etc\gtk-2.0\gtk.immodules
	if exist $(PREFIX)\etc\pango\pango.aliases del /q $(PREFIX)\etc\pango\pango.aliases
	if exist $(PREFIX)\etc\pango\pango.modules del /q $(PREFIX)\etc\pango\pango.modules
# Documents
	if exist $(PREFIX)\doc\$(ATK)\COPYING del /q $(PREFIX)\doc\$(ATK)\COPYING
	if exist $(PREFIX)\doc\$(GETTEXT)\COPYING del /q $(PREFIX)\doc\$(GETTEXT)\COPYING
	if exist $(PREFIX)\doc\$(GETTEXT)\gettext-runtime\intl\COPYING.LIB-2.1 del /q $(PREFIX)\doc\$(GETTEXT)\gettext-runtime\intl\COPYING.LIB-2.1
	if exist $(PREFIX)\doc\$(GLIB)\COPYING del /q $(PREFIX)\doc\$(GLIB)\COPYING
	if exist $(PREFIX)\doc\$(GTK)\COPYING del /q $(PREFIX)\doc\$(GTK)\COPYING
	if exist $(PREFIX)\doc\$(IMIME)\COPYING del /q $(PREFIX)\doc\$(IMIME)\COPYING
	if exist $(PREFIX)\doc\$(JPEG)\README del /q $(PREFIX)\doc\$(JPEG)\README
	if exist $(PREFIX)\doc\$(LIBPNG)\LICENSE del /q $(PREFIX)\doc\$(LIBPNG)\LICENSE
	if exist $(PREFIX)\doc\$(PANGO)\COPYING del /q $(PREFIX)\doc\$(PANGO)\COPYING
	if exist $(PREFIX)\doc\$(TIFF)\COPYRIGHT del /q $(PREFIX)\doc\$(TIFF)\COPYRIGHT
	if exist $(PREFIX)\doc\$(ZLIB)\README del /q $(PREFIX)\doc\$(ZLIB)\README
	if not "$(PREFIX)"=="." if exist $(PREFIX)\README del /q $(PREFIX)\README
	-rmdir $(PREFIX)\doc\$(ATK)
	-rmdir $(PREFIX)\doc\$(GETTEXT)\gettext-runtime\intl
	-rmdir $(PREFIX)\doc\$(GETTEXT)\gettext-runtime
	-rmdir $(PREFIX)\doc\$(GETTEXT)
	-rmdir $(PREFIX)\doc\$(GLIB)
	-rmdir $(PREFIX)\doc\$(GTK)
	-rmdir $(PREFIX)\doc\$(IMIME)
	-rmdir $(PREFIX)\doc\$(JPEG)
	-rmdir $(PREFIX)\doc\$(LIBPNG)
	-rmdir $(PREFIX)\doc\$(PANGO)
	-rmdir $(PREFIX)\doc\$(TIFF)
	-rmdir $(PREFIX)\doc\$(ZLIB)
	-rmdir $(PREFIX)\doc
# Folders
	-rmdir $(PREFIX)\bin
	-rmdir $(PREFIX)\etc\gtk-2.0
	-rmdir $(PREFIX)\etc\pango
	-rmdir $(PREFIX)\etc
	-rmdir $(PREFIX)\lib\gtk-2.0\2.4.9\immodules
	-rmdir $(PREFIX)\lib\gtk-2.0\2.4.9
	-rmdir $(PREFIX)\lib\gtk-2.0
	-rmdir $(PREFIX)\lib\locale
	-rmdir $(PREFIX)\lib\pango\1.4.1\modules
	-rmdir $(PREFIX)\lib\pango\1.4.1
	-rmdir $(PREFIX)\lib\pango
	-rmdir $(PREFIX)\lib
	-rmdir $(PREFIX)\include\atk
	-rmdir $(PREFIX)\include\gdk
	-rmdir $(PREFIX)\include\gdk-pixbuf
	-rmdir $(PREFIX)\include\glib
	-rmdir $(PREFIX)\include\gobject
	-rmdir $(PREFIX)\include\gtk
	-rmdir $(PREFIX)\include\pango
	-rmdir $(PREFIX)\include
	-rmdir $(PREFIX)


###############################################################################
#                                                                             #
# Clean                                                                       #
#                                                                             #
###############################################################################
# ATK
atk_CLEANS= \
		$(ATK)\atk\libatk-1.0-0.dll \
		$(ATK)\atk\atk-1.0.exp \
		$(ATK)\atk\atk-1.0.lib \
		$(ATK)\config.h \
		$(ATK)\atk\atkmarshal.c \
		$(ATK)\atk\atkmarshal.h \
		$(ATK)\atk\*.obj \
		$(ATK)\atk\*.pch
# GLib
glib_CLEANS= \
		$(GLIB)\config.h \
		$(GLIB)\glibconfig.h \
		$(GLIB)\libintl.h \
		$(GLIB)\build\win32\dirent\dirent.obj \
		$(GLIB)\build\win32\dirent\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)\gobject\glib-genmarshal.exe \
		$(GLIB)\glib\libcharset\localcharset.obj \
		$(GLIB)\glib\libcharset\localcharset.pch \
		$(GLIB)\glib\glib.res \
		$(GLIB)\glib\*.obj \
		$(GLIB)\glib\*.pch \
		$(GLIB)\glib\gnulib\*.obj \
		$(GLIB)\glib\gnulib\*.pch \
		$(GLIB)\gmodule\libgmodule-2.0-0.dll \
		$(GLIB)\gmodule\gmodule-2.0.exp \
		$(GLIB)\gmodule\gmodule-2.0.lib \
		$(GLIB)\gmodule\gmoduleconf.h \
		$(GLIB)\gmodule\gmodule.obj \
		$(GLIB)\gmodule\gmodule.pch \
		$(GLIB)\gmodule\gmodule.res \
		$(GLIB)\gobject\libgobject-2.0-0.dll \
		$(GLIB)\gobject\gobject-2.0.exp \
		$(GLIB)\gobject\gobject-2.0.lib \
		$(GLIB)\gobject\gobject.res \
		$(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 \
		$(GLIB)\gthread\gthread.res \
		$(GLIB)\gthread\*.obj \
		$(GLIB)\gthread\*.pch
# GTK+
gtk_CLEANS= \
		$(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 \
		$(GTK)\gdk-pixbuf\gdk_pixbuf.res \
		$(GTK)\gdk-pixbuf\*.obj \
		$(GTK)\gdk-pixbuf\*.pch \
		$(GTK)\gdk-pixbuf\pixops\*.obj \
		$(GTK)\gdk-pixbuf\pixops\*.pch \
		$(GTK)\gdk\libgdk-win32-2.0-0.dll \
		$(GTK)\gdk\gdk-win32-2.0.exp \
		$(GTK)\gdk\gdk-win32-2.0.lib \
		$(GTK)\gdk\win32\rc\gdk.res \
		$(GTK)\gdk\*.obj \
		$(GTK)\gdk\*.pch \
		$(GTK)\gdk\win32\*.obj \
		$(GTK)\gdk\win32\*.pch \
		$(GTK)\gtk\libgtk-win32-2.0-0.dll \
		$(GTK)\gtk\gtk-win32-2.0.exp \
		$(GTK)\gtk\gtk-win32-2.0.lib \
		$(GTK)\gtk\*.obj \
		$(GTK)\gtk\*.pch \
		$(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-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.4.exe
# gettext
gettext_CLEANS= \
		$(GETTEXT)\gettext-runtime\intl\intl.dll \
		$(GETTEXT)\gettext-runtime\intl\intl.exp \
		$(GETTEXT)\gettext-runtime\intl\intl.lib \
		$(GETTEXT)\gettext-runtime\config.h \
		$(GETTEXT)\gettext-runtime\intl\libgnuintl.h \
		$(GETTEXT)\gettext-runtime\windows\intl.res \
		$(GETTEXT)\gettext-runtime\intl\*.obj \
		$(GETTEXT)\gettext-runtime\intl\*.pch \
		$(GETTEXT)\gettext-tools\src\msgfmt.exe \
		$(GETTEXT)\gettext-tools\config.h \
		$(GETTEXT)\gettext-tools\libintl.h \
		$(GETTEXT)\gettext-tools\lib\*.obj \
		$(GETTEXT)\gettext-tools\lib\*.pch \
		$(GETTEXT)\gettext-tools\src\*.obj \
		$(GETTEXT)\gettext-tools\src\*.pch
# imime
imime_CLEANS= \
		$(IMIME)\inputim-ime.dll \
		$(IMIME)\inputim-ime.exp \
		$(IMIME)\inputim-ime.lib \
		$(GTK)\gdk\gdkwin32.h \
		$(IMIME)\*.pch \
		$(IMIME)\*.obj
# JPEG
jpeg_CLEANS= \
		$(JPEG)\libjpeg.lib \
		$(JPEG)\jconfig.h \
		$(JPEG)\*.obj \
		$(JPEG)\*.pch
# libiconv
libiconv_CLEANS= \
		$(LIBICONV)\lib\iconv.dll \
		$(LIBICONV)\lib\iconv.exp \
		$(LIBICONV)\lib\iconv.lib \
		$(LIBICONV)\libcharset\include\localcharset.h \
		$(LIBICONV)\libcharset\config.h \
		$(LIBICONV)\windows\iconv.res \
		$(LIBICONV)\libcharset\lib\*.obj \
		$(LIBICONV)\libcharset\lib\*.pch \
		$(LIBICONV)\lib\*.obj \
		$(LIBICONV)\lib\*.pch
# libpng
libpng_CLEANS= \
		$(LIBPNG)\libpng13.dll \
		$(LIBPNG)\libpng13.exp \
		$(LIBPNG)\libpng13.lib \
		$(LIBPNG)\projects\msvc\png.res \
		$(LIBPNG)\*.obj \
		$(LIBPNG)\*.pch
# Pango
pango_CLEANS= \
		$(PANGO)\pango\libpango-1.0-0.dll \
		$(PANGO)\pango\pango-1.0.exp \
		$(PANGO)\pango\pango-1.0.lib \
		$(PANGO)\pango\pango.res \
		$(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 \
		$(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\*.obj \
		$(TIFF)\libtiff\*.pch
# zlib
zlib_CLEANS= \
		$(ZLIB)\zlib.lib \
		$(ZLIB)\*.obj \
		$(ZLIB)\*.pch
# iwm
iwm_CLEANS= \
		iwm\gdk\gdkwindow-win32.obj \
		iwm\gdk\gdkwindow-win32.pch \
		iwm\glib\gwin32.obj \
		iwm\glib\gwin32.pch \
		iwm\gtk\queryimmodules.obj \
		iwm\gtk\queryimmodules.pch \
		iwm\pango\*.obj \
		iwm\pango\*.pch

clean:
	for %f in ($(atk_CLEANS)) do if exist %f del /q %f
	for %f in ($(glib_CLEANS)) do if exist %f del /q %f
	for %f in ($(gtk_CLEANS)) do if exist %f del /q %f
	for %f in ($(gettext_CLEANS)) do if exist %f del /q %f
	for %f in ($(imime_CLEANS)) do if exist %f del /q %f
	for %f in ($(jpeg_CLEANS)) do if exist %f del /q %f
	for %f in ($(libiconv_CLEANS)) do if exist %f del /q %f
	for %f in ($(libpng_CLEANS)) do if exist %f del /q %f
	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
	for %f in ($(tiff_CLEANS)) do if exist %f del /q %f
	for %f in ($(zlib_CLEANS)) do if exist %f del /q %f
	for %f in ($(iwm_CLEANS)) do if exist %f del /q %f


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

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

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

gtk-$(VERSION).$(RELEASE)-src.zip:
	mkdir $*
	mkdir $*\iwm
	mkdir $*\iwm\config
	mkdir $*\iwm\gdk
	mkdir $*\iwm\glib
	mkdir $*\iwm\gtk
	mkdir $*\iwm\pango
	copy /y atk-1.6.1.tar.gz $*
	copy /y gettext-0.14.1.tar.gz $*
	copy /y glib-2.4.6.tar.gz $*
	copy /y "gtk+-2.4.9.tar.gz" $*
	copy /y imime-0.1.2.tar.gz $*
	copy /y jpegsrc.v6b.tar.gz $*
	copy /y libiconv-1.9.2.tar.gz $*
	copy /y libpng-1.2.6.tar.gz $*
	copy /y pango-1.4.1.tar.gz $*
	copy /y tiff-v3.6.1.tar.gz $*
	copy /y zlib-1.2.1.tar.gz $*
	copy /y autogen.bat $*
	copy /y makefile $*
	copy /y README $*
	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\gdk\gdkwindow-win32.c $*\iwm\gdk
	copy /y iwm\glib\gwin32.c $*\iwm\glib
	copy /y iwm\gtk\queryimmodules.c $*\iwm\gtk
	copy /y iwm\pango\pangowin32-fontmap.c $*\iwm\pango
	copy /y iwm\pango\querymodules.c $*\iwm\pango
	zip -9 -r $@ $*
	rmdir /q /s $*
