changeset 14315:8793fc8f7064

[gaim-migrate @ 17008] Lee Roach revamped the win32 makefiles. This makes me happy, they were in dire need of some loving. This makes life a great deal easier for anyone who wants to build out-of-tree plugins. committer: Tailor Script <tailor@pidgin.im>
author Daniel Atallah <daniel.atallah@gmail.com>
date Wed, 23 Aug 2006 21:34:43 +0000
parents 8b8188fa98f4
children b3697123b01a
files Makefile.mingw gtk/Makefile.mingw gtk/pixmaps/Makefile.mingw gtk/pixmaps/smileys/Makefile.mingw gtk/pixmaps/smileys/default/Makefile.mingw gtk/pixmaps/smileys/none/Makefile.mingw gtk/pixmaps/status/Makefile.mingw gtk/pixmaps/status/default/Makefile.mingw gtk/plugins/Makefile.mingw gtk/plugins/docklet/Makefile.mingw gtk/plugins/ticker/Makefile.mingw gtk/plugins/win32/transparency/Makefile.mingw gtk/plugins/win32/winprefs/Makefile.mingw gtk/sounds/Makefile.mingw gtk/win32/IdleTracker/Makefile.mingw libgaim/Makefile.mingw libgaim/plugins/Makefile.mingw libgaim/plugins/perl/Makefile.mingw libgaim/plugins/perl/common/Makefile.mingw libgaim/plugins/perl/common/module.h libgaim/plugins/ssl/Makefile.mingw libgaim/plugins/tcl/Makefile.mingw libgaim/protocols/Makefile.mingw libgaim/protocols/bonjour/Makefile.mingw libgaim/protocols/gg/Makefile.mingw libgaim/protocols/irc/Makefile.mingw libgaim/protocols/jabber/Makefile.mingw libgaim/protocols/msn/Makefile.mingw libgaim/protocols/novell/Makefile.mingw libgaim/protocols/oscar/Makefile.mingw libgaim/protocols/qq/Makefile.mingw libgaim/protocols/sametime/Makefile.mingw libgaim/protocols/silc/Makefile.mingw libgaim/protocols/simple/Makefile.mingw libgaim/protocols/toc/Makefile.mingw libgaim/protocols/yahoo/Makefile.mingw libgaim/protocols/zephyr/Makefile.mingw libgaim/win32/global.mak libgaim/win32/rules.mak libgaim/win32/targets.mak po/Makefile.mingw
diffstat 41 files changed, 781 insertions(+), 1963 deletions(-) [+]
line wrap: on
line diff
--- a/Makefile.mingw	Wed Aug 23 18:50:46 2006 +0000
+++ b/Makefile.mingw	Wed Aug 23 21:34:43 2006 +0000
@@ -5,44 +5,37 @@
 # Description: Top Makefile for win32 (mingw) port of Gaim
 #
 
-LIBGAIM_TOP = ./libgaim
-GTKGAIM_TOP = ./gtk
-GAIM_SOUNDS = ./sounds
-GAIM_INSTALL_DIR = ./win32-install-dir
-PO = ./po
-
-MAKENSIS := makensis.exe
+GAIM_TOP := .
+include $(GAIM_TOP)/libgaim/win32/global.mak
 
-VERSION := $(shell cat ./VERSION)
-
-
-all:
-	cp config.h.mingw config.h
-	$(MAKE) -C $(LIBGAIM_TOP) -f Makefile.mingw
-	$(MAKE) -C $(GTKGAIM_TOP) -f Makefile.mingw
+all: $(GAIM_CONFIG_H)
+	$(MAKE) -C $(GAIM_LIB_TOP) -f $(GAIM_WIN32_MAKEFILE)
+	$(MAKE) -C $(GAIM_GTK_TOP) -f $(GAIM_WIN32_MAKEFILE)
+	$(MAKE) -C $(GAIM_PO_TOP) -f $(GAIM_WIN32_MAKEFILE)
 
-install: all
-	mkdir -p $(GAIM_INSTALL_DIR)/plugins
-	mkdir -p $(GAIM_INSTALL_DIR)/sounds/gaim
-	$(MAKE) -C $(PO) -f Makefile.mingw install
-	$(MAKE) -C $(LIBGAIM_TOP) -f Makefile.mingw install
-	$(MAKE) -C $(GTKGAIM_TOP) -f Makefile.mingw install
+install: all $(GAIM_INSTALL_DIR)
+	$(MAKE) -C $(GAIM_LIB_TOP) -f $(GAIM_WIN32_MAKEFILE) install
+	$(MAKE) -C $(GAIM_GTK_TOP) -f $(GAIM_WIN32_MAKEFILE) install
+	$(MAKE) -C $(GAIM_PO_TOP) -f $(GAIM_WIN32_MAKEFILE) install
 
-installer:
-	$(MAKENSIS) /DGAIM_VERSION="$(VERSION)" /DWITH_GTK gaim-installer.nsi
+installer: install
+	$(MAKENSIS) /V3 /DGAIM_VERSION="$(GAIM_VERSION)" /DWITH_GTK gaim-installer.nsi
 
-installer_nogtk:
-	$(MAKENSIS) /DGAIM_VERSION="$(VERSION)" gaim-installer.nsi
+installer_nogtk: install
+	$(MAKENSIS) /V3 /DGAIM_VERSION="$(GAIM_VERSION)" gaim-installer.nsi
 
-installer_debug:
-	$(MAKENSIS) /DGAIM_VERSION="$(VERSION)" /DDEBUG gaim-installer.nsi
+installer_debug: install
+	$(MAKENSIS) /V3 /DGAIM_VERSION="$(GAIM_VERSION)" /DDEBUG gaim-installer.nsi
 
 installers: installer installer_nogtk
 
+clean:
+	$(MAKE) -C $(GAIM_PO_TOP) -f $(GAIM_WIN32_MAKEFILE) clean
+	$(MAKE) -C $(GAIM_GTK_TOP) -f $(GAIM_WIN32_MAKEFILE) clean
+	$(MAKE) -C $(GAIM_LIB_TOP) -f $(GAIM_WIN32_MAKEFILE) clean
+	rm -rf $(GAIM_CONFIG_H)
+	rm -rf gaim*.exe
+	rm -rf $(GAIM_INSTALL_PERLMOD_DIR) $(GAIM_INSTALL_PIXMAPS_DIR) $(GAIM_INSTALL_PLUGINS_DIR)
+	rm -rf $(GAIM_INSTALL_PO_DIR) $(GAIM_INSTALL_SOUNDS_DIR) $(GAIM_INSTALL_DIR)
 
-clean:
-	$(MAKE) -C $(PO) -f Makefile.mingw clean
-	$(MAKE) -C $(LIBGAIM_TOP) -f Makefile.mingw clean
-	$(MAKE) -C $(GTKGAIM_TOP) -f Makefile.mingw clean
-	rm -rf config.h $(GAIM_INSTALL_DIR)
-	rm -rf gaim*.exe
+include $(GAIM_COMMON_TARGETS)
--- a/gtk/Makefile.mingw	Wed Aug 23 18:50:46 2006 +0000
+++ b/gtk/Makefile.mingw	Wed Aug 23 21:34:43 2006 +0000
@@ -4,46 +4,17 @@
 # Description: Makefile for win32 (mingw) version of Gaim
 #
 
-#
-# PATHS
-#
+GAIM_TOP := ..
+include $(GAIM_TOP)/libgaim/win32/global.mak
 
-GTK_TOP :=		../../win32-dev/gtk_2_0
-GAIM_TOP :=		..
-GTKGAIM_TOP :=		.
-LIBGAIM_TOP :=		$(GAIM_TOP)/libgaim
-PLUGINS_TOP :=		$(GTKGAIM_TOP)/plugins
-PIXMAPS_TOP :=		$(GTKGAIM_TOP)/pixmaps
-SOUNDS_TOP :=		$(GTKGAIM_TOP)/sounds
-ASPELL_TOP :=		../../win32-dev/aspell-dev-0-50-3-3
-GTKSPELL_TOP :=		../../win32-dev/gtkspell-2.0.6
-IDLETRACK_TOP :=	$(GTKGAIM_TOP)/win32/IdleTracker
-GAIM_INSTALL_DIR :=	$(GAIM_TOP)/win32-install-dir
-#LIBXML2_DIR :=		../../win32-dev/libxml2
-
-NEEDED_DLLS =		$(GTKSPELL_TOP)/gtkspell/libgtkspell.dll \
-			$(IDLETRACK_TOP)/idletrack.dll
-
-SOUNDS =		$(SOUNDS_TOP)/alert.wav \
-			$(SOUNDS_TOP)/login.wav \
-			$(SOUNDS_TOP)/logout.wav \
-			$(SOUNDS_TOP)/receive.wav \
-			$(SOUNDS_TOP)/send.wav
+NEEDED_DLLS = $(GTKSPELL_TOP)/gtkspell/libgtkspell.dll
 
 ##
 ## VARIABLE DEFINITIONS
 ##
-
 EXE_TARGET = gaim
-
 GTKGAIM_TARGET = gtkgaim
 
-# Compiler and Linker Options
-
-CFLAGS =
-
-DEFINES =
-
 ifeq ($(MAKECMDGOALS), $(EXE_TARGET)-portable.exe)
 DEFINES := $(DEFINES) -DPORTABLE
 endif
@@ -54,33 +25,22 @@
 
 LDFLAGS := $(WINAPP)
 
-WINDRES := windres
-
-##
-## INCLUDE  MAKEFILES
-##
-
-include $(LIBGAIM_TOP)/win32/global.mak
-
 ##
 ## INCLUDE PATHS
 ##
-
 LIBGAIM_INCLUDE_PATHS =	\
-			-I$(LIBGAIM_TOP) \
-			-I$(LIBGAIM_TOP)/win32 \
+			-I$(GAIM_LIB_TOP) \
+			-I$(GAIM_LIB_TOP)/win32 \
 			-I$(GAIM_TOP) \
 			-I$(GTK_TOP)/include \
 			-I$(GTK_TOP)/include/glib-2.0 \
 			-I$(GTK_TOP)/lib/glib-2.0/include
 
-#			-I$(LIBXML2_DIR)/include
-
 INCLUDE_PATHS =	\
 			$(LIBGAIM_INCLUDE_PATHS) \
-			-I$(IDLETRACK_TOP) \
-			-I$(GTKGAIM_TOP) \
-			-I$(GTKGAIM_TOP)/win32 \
+			-I$(GAIM_GTK_IDLETRACK_TOP) \
+			-I$(GAIM_GTK_TOP) \
+			-I$(GAIM_GTK_TOP)/win32 \
 			-I$(GTK_TOP)/include/gtk-2.0 \
 			-I$(GTK_TOP)/include/pango-1.0 \
 			-I$(GTK_TOP)/include/atk-1.0 \
@@ -88,20 +48,15 @@
 			-I$(GTKSPELL_TOP) \
 			-I$(ASPELL_TOP)/include
 
-
-
 LIB_PATHS =		-L$(GTK_TOP)/lib \
-			-L$(LIBGAIM_TOP) \
-			-L$(GTKGAIM_TOP) \
-			-L$(IDLETRACK_TOP) \
+			-L$(GAIM_LIB_TOP) \
+			-L$(GAIM_GTK_TOP) \
+			-L$(GAIM_GTK_IDLETRACK_TOP) \
 			-L$(ASPELL_TOP)/lib
 
-#			-L$(LIBXML2_DIR)/lib
-
 ##
 ##  SOURCES, OBJECTS
 ##
-
 GTKGAIM_C_SRC =	\
 			gaimstock.c \
 			gtkaccount.c \
@@ -140,18 +95,14 @@
 			win32/untar.c \
 			win32/wspell.c
 
-RC_SRC =		win32/gaimrc.rc
-
-EXE_C_SRC = 		win32/win_gaim.c
-
+RC_SRC = win32/gaimrc.rc
+EXE_C_SRC = win32/win_gaim.c
 GTKGAIM_OBJECTS = $(GTKGAIM_C_SRC:%.c=%.o)
-
 EXE_OBJECTS = $(EXE_C_SRC:%.c=%.o) $(RC_SRC:%.rc=%.o)
 
 ##
 ## LIBRARIES
 ##
-
 LIBGAIM_LIBS =	\
 		-lgaim \
 		-lglib-2.0 \
@@ -165,8 +116,6 @@
 		-liberty \
 		-lidletrack
 
-#		-lxml2
-
 GTKGAIM_LIBS =	\
 		$(LIBGAIM_LIBS) \
 		-lgtk-win32-2.0 \
@@ -175,70 +124,49 @@
 		-lgdk-win32-2.0 \
 		-lgdk_pixbuf-2.0
 
-EXE_LIBS =
-
-##
-## RULES
-##
-
-# How to make a C file
-%.o: %.c
-	$(CC) $(CFLAGS) $(INCLUDE_PATHS) $(DEFINES) -c $< -o $@
-
-# How to make an RC file
-%.o: %.rc
-	$(WINDRES) -i $< -o $@
+include $(GAIM_COMMON_RULES)
 
 ##
 ## TARGET DEFINITIONS
 ##
-
 .PHONY: all clean
 
 all: $(EXE_TARGET).exe $(GTKGAIM_TARGET).dll
-	$(MAKE) -C $(PLUGINS_TOP) -f Makefile.mingw
-
-install: all
-	$(MAKE) -C $(PLUGINS_TOP) -f Makefile.mingw install
-	$(MAKE) -C $(PIXMAPS_TOP) -f Makefile.mingw install
-	cp $(GTKGAIM_TOP)/$(EXE_TARGET).exe $(GTKGAIM_TOP)/$(GTKGAIM_TARGET).dll $(GAIM_INSTALL_DIR)
-	cp $(NEEDED_DLLS) $(GAIM_INSTALL_DIR)
-	cp $(SOUNDS) $(GAIM_INSTALL_DIR)/sounds/gaim
+	$(MAKE) -C $(GAIM_GTK_PLUGINS_TOP) -f $(GAIM_WIN32_MAKEFILE)
 
-$(LIBGAIM_TOP)/libgaim.dll.a:
-	S(MAKE) -C $(LIBGAIM_TOP) -f Makefile.mingw libgaim.dll.a
+install: all $(GAIM_INSTALL_DIR)
+	$(MAKE) -C $(GAIM_GTK_PLUGINS_TOP) -f $(GAIM_WIN32_MAKEFILE) install
+	$(MAKE) -C $(GAIM_GTK_PIXMAPS_TOP) -f $(GAIM_WIN32_MAKEFILE) install
+	$(MAKE) -C $(GAIM_GTK_SOUNDS_TOP) -f $(GAIM_WIN32_MAKEFILE) install
+	$(MAKE) -C $(GAIM_GTK_IDLETRACK_TOP) -f $(GAIM_WIN32_MAKEFILE) install
+	cp $(EXE_TARGET).exe $(GTKGAIM_TARGET).dll $(GAIM_INSTALL_DIR)
+	cp $(NEEDED_DLLS) $(GAIM_INSTALL_DIR)
 
-$(IDLETRACK_TOP)/idletrack.dll:
-	$(MAKE) -C $(IDLETRACK_TOP) -f Makefile.mingw
+$(GTKGAIM_OBJECTS): $(GAIM_CONFIG_H)
 
-#
-# BUILD DLL
-#
-$(GTKGAIM_TARGET).dll.a $(GTKGAIM_TARGET).dll: $(LIBGAIM_TOP)/libgaim.dll.a $(GTKGAIM_OBJECTS) $(IDLETRACK_TOP)/idletrack.dll
+$(GTKGAIM_TARGET).dll $(GTKGAIM_TARGET).dll.a: $(GAIM_LIBGAIM_DLL).a $(GAIM_IDLETRACK_DLL).a $(GTKGAIM_OBJECTS)
 	$(CC) -shared $(LIBGAIM_OBJECTS) $(GTKGAIM_OBJECTS) $(LIB_PATHS) $(GTKGAIM_LIBS) $(DLL_LD_FLAGS) -Wl,--out-implib,$(GTKGAIM_TARGET).dll.a -o $(GTKGAIM_TARGET).dll
 
-#
-# BUILD EXE
-#
-
-$(EXE_TARGET).exe: $(GTKGAIM_TARGET).dll $(EXE_OBJECTS)
+$(EXE_TARGET).exe: $(GAIM_CONFIG_H) $(GAIM_GTKGAIM_DLL).a $(GAIM_IDLETRACK_DLL).a $(EXE_OBJECTS)
 	$(CC) $(LDFLAGS) $(EXE_OBJECTS) $(LIB_PATHS) $(EXE_LIBS) -o $(EXE_TARGET).exe
 
-$(EXE_TARGET)-portable.exe: clean_exe $(EXE_OBJECTS)
+$(EXE_TARGET)-portable.exe: clean_exe $(GAIM_CONFIG_H) $(GAIM_GTKGAIM_DLL).a $(GAIM_IDLETRACK_DLL).a $(EXE_OBJECTS)
 	$(CC) $(LDFLAGS) $(EXE_OBJECTS) $(LIB_PATHS) $(EXE_LIBS) -o $(EXE_TARGET)-portable.exe
 	rm win_gaim.o
 
 ##
 ## CLEAN RULES
 ##
-
 clean:
-	$(MAKE) -C $(IDLETRACK_TOP) -f Makefile.mingw clean
-	rm -rf *.o ./win32/*.o
-	rm -rf $(GTKGAIM_TARGET).dll
-	rm -rf $(GTKGAIM_TARGET).dll.a
-	rm -rf $(EXE_TARGET).exe
-	$(MAKE) -C $(PLUGINS_TOP) -f Makefile.mingw clean
+	$(MAKE) -C $(GAIM_GTK_IDLETRACK_TOP) -f $(GAIM_WIN32_MAKEFILE) clean
+	$(MAKE) -C $(GAIM_GTK_PLUGINS_TOP) -f $(GAIM_WIN32_MAKEFILE) clean
+	rm -rf $(GTKGAIM_OBJECTS) $(EXE_OBJECTS)
+	rm $(GTKGAIM_TARGET).dll
+	rm $(GTKGAIM_TARGET).dll.a
+	rm $(EXE_TARGET).exe
+	rm $(EXE_TARGET)-portable.exe
 
 clean_exe:
-	rm -rf win_gaim.o
+	rm win_gaim.o
+
+include $(GAIM_COMMON_TARGETS)
--- a/gtk/pixmaps/Makefile.mingw	Wed Aug 23 18:50:46 2006 +0000
+++ b/gtk/pixmaps/Makefile.mingw	Wed Aug 23 21:34:43 2006 +0000
@@ -5,9 +5,9 @@
 #
 
 GAIM_TOP := ../..
+include $(GAIM_TOP)/libgaim/win32/global.mak
 
-datadir = $(GAIM_TOP)/win32-install-dir
-
+datadir = $(GAIM_INSTALL_DIR)
 include ./Makefile.am
 
 install:
--- a/gtk/pixmaps/smileys/Makefile.mingw	Wed Aug 23 18:50:46 2006 +0000
+++ b/gtk/pixmaps/smileys/Makefile.mingw	Wed Aug 23 21:34:43 2006 +0000
@@ -4,10 +4,6 @@
 # Description: Makefile for win32 (mingw) version of Gaim pixmaps
 #
 
-GAIM_TOP = ../../..
-
-INSTALL_DIR = $(GAIM_TOP)/win32-install-dir/pixmaps/gaim/smileys
-
 include ./Makefile.am
 
 install:
--- a/gtk/pixmaps/smileys/default/Makefile.mingw	Wed Aug 23 18:50:46 2006 +0000
+++ b/gtk/pixmaps/smileys/default/Makefile.mingw	Wed Aug 23 21:34:43 2006 +0000
@@ -4,9 +4,10 @@
 # Description: Makefile for win32 (mingw) version of Gaim pixmaps
 #
 
-GAIM_TOP = ../../../..
+GAIM_TOP := ../../../..
+include $(GAIM_TOP)/libgaim/win32/global.mak
 
-datadir = $(GAIM_TOP)/win32-install-dir
+datadir = $(GAIM_INSTALL_DIR)
 include ./Makefile.am
 
 install:
--- a/gtk/pixmaps/smileys/none/Makefile.mingw	Wed Aug 23 18:50:46 2006 +0000
+++ b/gtk/pixmaps/smileys/none/Makefile.mingw	Wed Aug 23 21:34:43 2006 +0000
@@ -4,9 +4,10 @@
 # Description: Makefile for win32 (mingw) version of Gaim pixmaps
 #
 
-GAIM_TOP = ../../../..
+GAIM_TOP := ../../../..
+include $(GAIM_TOP)/libgaim/win32/global.mak
 
-datadir = $(GAIM_TOP)/win32-install-dir
+datadir = $(GAIM_INSTALL_DIR)
 include ./Makefile.am
 
 install:
--- a/gtk/pixmaps/status/Makefile.mingw	Wed Aug 23 18:50:46 2006 +0000
+++ b/gtk/pixmaps/status/Makefile.mingw	Wed Aug 23 21:34:43 2006 +0000
@@ -4,10 +4,6 @@
 # Description: Makefile for win32 (mingw) version of Gaim pixmaps
 #
 
-GAIM_TOP = ../../..
-
-INSTALL_DIR = $(GAIM_TOP)/win32-install-dir/pixmaps/gaim/status
-
 include ./Makefile.am
 
 install:
--- a/gtk/pixmaps/status/default/Makefile.mingw	Wed Aug 23 18:50:46 2006 +0000
+++ b/gtk/pixmaps/status/default/Makefile.mingw	Wed Aug 23 21:34:43 2006 +0000
@@ -5,8 +5,9 @@
 #
 
 GAIM_TOP = ../../../..
+include $(GAIM_TOP)/libgaim/win32/global.mak
 
-datadir = $(GAIM_TOP)/win32-install-dir
+datadir = $(GAIM_INSTALL_DIR)
 include ./Makefile.am
 
 install:
--- a/gtk/plugins/Makefile.mingw	Wed Aug 23 18:50:46 2006 +0000
+++ b/gtk/plugins/Makefile.mingw	Wed Aug 23 21:34:43 2006 +0000
@@ -4,46 +4,20 @@
 # Description: Makefile for win32 (mingw) version of Gaim Plugins 
 #
 
-#
-# PATHS
-#
+GAIM_TOP := ../..
+include $(GAIM_TOP)/libgaim/win32/global.mak
 
-GAIM_PLUGINS := 	.
-GAIM_TOP :=		../..
-GTKGAIM_TOP :=		..
-LIBGAIM_TOP :=		$(GAIM_TOP)/libgaim
-GTK_TOP :=		../../../win32-dev/gtk_2_0
-#OSCAR_ROOT :=		../src/protocols/oscar
-GAIM_INSTALL_DIR :=	$(GAIM_TOP)/win32-install-dir
-TICKER :=		./ticker
-TRANSPARENCY :=		./win32/transparency
-WINPREFS :=		./win32/winprefs
-#PERL_PLUGIN_LOADER :=	./perl
-DOCKLET :=		./docklet
-
-##
-## VARIABLE DEFINITIONS
-##
-
-# Compiler Options
-
-CFLAGS =
-
-DEFINES =
+DOCKLET_PLUGIN := $(GAIM_GTK_PLUGINS_TOP)/docklet
+TICKER_PLUGIN := $(GAIM_GTK_PLUGINS_TOP)/ticker
+TRANSPARENCY_PLUGIN := $(GAIM_GTK_PLUGINS_TOP)/win32/transparency
+WINPREFS_PLUGIN := $(GAIM_GTK_PLUGINS_TOP)/win32/winprefs
 
 .SUFFIXES:
 .SUFFIXES: .c .dll
 
 ##
-## INCLUDE  MAKEFILES
-##
-
-include $(LIBGAIM_TOP)/win32/global.mak
-
-##
 ## INCLUDE PATHS
 ##
-
 INCLUDE_PATHS +=	\
 			-I$(GTK_TOP)/include \
 			-I$(GTK_TOP)/include/gtk-2.0 \
@@ -53,21 +27,18 @@
 			-I$(GTK_TOP)/lib/glib-2.0/include \
 			-I$(GTK_TOP)/lib/gtk-2.0/include \
 			-I$(GAIM_TOP) \
-			-I$(LIBGAIM_TOP) \
-			-I$(LIBGAIM_TOP)/win32 \
-			-I$(GTKGAIM_TOP) \
-			-I$(GTKGAIM_TOP)/win32
-
+			-I$(GAIM_LIB_TOP) \
+			-I$(GAIM_LIB_TOP)/win32 \
+			-I$(GAIM_GTK_TOP) \
+			-I$(GAIM_GTK_TOP)/win32
 
 LIB_PATHS =		-L$(GTK_TOP)/lib \
-			-L$(LIBGAIM_TOP) \
-			-L$(GTKGAIM_TOP)
-
+			-L$(GAIM_LIB_TOP) \
+			-L$(GAIM_GTK_TOP)
 
 ##
 ## LIBRARIES
 ##
-
 LIBS =			-lgtk-win32-2.0 \
 			-lglib-2.0 \
 			-lgdk-win32-2.0 \
@@ -81,31 +52,22 @@
 			-lgtkgaim
 
 ##
-## RULES
-##
-
-##
 ## TARGET DEFINITIONS
 ##
-
 .PHONY: all clean
 
 all: plugins
-	$(MAKE) -C $(TICKER) -f Makefile.mingw
-	$(MAKE) -C $(WINPREFS) -f Makefile.mingw
-	$(MAKE) -C $(TRANSPARENCY) -f Makefile.mingw
-	$(MAKE) -C $(DOCKLET) -f Makefile.mingw
+	$(MAKE) -C $(DOCKLET_PLUGIN) -f $(GAIM_WIN32_MAKEFILE)
+	$(MAKE) -C $(TICKER_PLUGIN) -f $(GAIM_WIN32_MAKEFILE)
+	$(MAKE) -C $(TRANSPARENCY_PLUGIN) -f $(GAIM_WIN32_MAKEFILE)
+	$(MAKE) -C $(WINPREFS_PLUGIN) -f $(GAIM_WIN32_MAKEFILE)
 
-install:
-	cp $(GAIM_PLUGINS)/*.dll $(GAIM_INSTALL_DIR)/plugins
-	$(MAKE) -C $(TICKER) -f Makefile.mingw install
-	$(MAKE) -C $(WINPREFS) -f Makefile.mingw install
-	$(MAKE) -C $(TRANSPARENCY) -f Makefile.mingw install
-	$(MAKE) -C $(DOCKLET) -f Makefile.mingw install
-
-#
-# BUILD Plugin
-#
+install: $(GAIM_INSTALL_PLUGINS_DIR)
+	$(MAKE) -C $(DOCKLET_PLUGIN) -f $(GAIM_WIN32_MAKEFILE) install
+	$(MAKE) -C $(TICKER_PLUGIN) -f $(GAIM_WIN32_MAKEFILE) install
+	$(MAKE) -C $(TRANSPARENCY_PLUGIN) -f $(GAIM_WIN32_MAKEFILE) install
+	$(MAKE) -C $(WINPREFS_PLUGIN) -f $(GAIM_WIN32_MAKEFILE) install
+	cp $(GAIM_GTK_PLUGINS_TOP)/*.dll $(GAIM_INSTALL_PLUGINS_DIR)
 
 .c.dll:
 	$(CC) $(CFLAGS) $(DEFINES) $(INCLUDE_PATHS) -o $@.o -c $<
@@ -115,22 +77,22 @@
 		extplacement.dll \
 		gaimrc.dll \
 		history.dll \
-	 	iconaway.dll \
+		iconaway.dll \
 		notify.dll \
 		relnot.dll \
 		spellchk.dll \
 		timestamp_format.dll \
 		timestamp.dll
 
-
 ##
 ## CLEAN RULES
 ##
+clean:
+	rm -rf $(GAIM_GTK_PLUGINS_TOP)/*.o
+	rm -rf $(GAIM_GTK_PLUGINS_TOP)/*.dll
+	$(MAKE) -C $(DOCKLET_PLUGIN) -f $(GAIM_WIN32_MAKEFILE) clean
+	$(MAKE) -C $(TICKER_PLUGIN) -f $(GAIM_WIN32_MAKEFILE) clean
+	$(MAKE) -C $(TRANSPARENCY_PLUGIN) -f $(GAIM_WIN32_MAKEFILE) clean
+	$(MAKE) -C $(WINPREFS_PLUGIN) -f $(GAIM_WIN32_MAKEFILE) clean
 
-clean:
-	rm -rf *.o
-	rm -rf *.dll
-	$(MAKE) -C $(TICKER) -f Makefile.mingw clean
-	$(MAKE) -C $(TRANSPARENCY) -f Makefile.mingw clean
-	$(MAKE) -C $(WINPREFS) -f Makefile.mingw clean
-	$(MAKE) -C $(DOCKLET) -f Makefile.mingw clean
+include $(GAIM_COMMON_TARGETS)
--- a/gtk/plugins/docklet/Makefile.mingw	Wed Aug 23 18:50:46 2006 +0000
+++ b/gtk/plugins/docklet/Makefile.mingw	Wed Aug 23 21:34:43 2006 +0000
@@ -4,39 +4,14 @@
 # Description: Makefile for docklet plugin.
 #
 
-#
-# PATHS
-#
-
-GTK_TOP :=		../../../../win32-dev/gtk_2_0
-GAIM_TOP :=		../../..
-LIBGAIM_TOP :=		$(GAIM_TOP)/libgaim
-GTKGAIM_TOP :=		$(GAIM_TOP)/gtk
-GAIM_INSTALL_DIR :=	$(GAIM_TOP)/win32-install-dir
-DLL_INSTALL_DIR :=	$(GAIM_INSTALL_DIR)/plugins
-
-##
-## VARIABLE DEFINITIONS
-##
+GAIM_TOP := ../../..
+include $(GAIM_TOP)/libgaim/win32/global.mak
 
 TARGET = docklet
 
-# Compiler Options
-
-CFLAGS =
-
-DEFINES =
-
-##
-## INCLUDE  MAKEFILES
-##
-
-include $(LIBGAIM_TOP)/win32/global.mak
-
 ##
 ## INCLUDE PATHS
 ##
-
 INCLUDE_PATHS +=	-I. \
 			-I$(GTK_TOP)/include \
 			-I$(GTK_TOP)/include/gtk-2.0 \
@@ -45,34 +20,28 @@
 			-I$(GTK_TOP)/include/atk-1.0 \
 			-I$(GTK_TOP)/lib/glib-2.0/include \
 			-I$(GTK_TOP)/lib/gtk-2.0/include \
-			-I$(LIBGAIM_TOP) \
-			-I$(LIBGAIM_TOP)/win32 \
-			-I$(GTKGAIM_TOP) \
-			-I$(GTKGAIM_TOP)/win32 \
+			-I$(GAIM_LIB_TOP) \
+			-I$(GAIM_LIB_TOP)/win32 \
+			-I$(GAIM_GTK_TOP) \
+			-I$(GAIM_GTK_TOP)/win32 \
 			-I$(GAIM_TOP)
 
-
 LIB_PATHS =		-L$(GTK_TOP)/lib \
-			-L$(LIBGAIM_TOP) \
-			-L$(GTKGAIM_TOP)
-
+			-L$(GAIM_LIB_TOP) \
+			-L$(GAIM_GTK_TOP)
 
 ##
 ##  SOURCES, OBJECTS
 ##
-
 C_SRC =			docklet.c   \
 			docklet-win32.c \
 			MinimizeToTray.c
 
-
 OBJECTS = $(C_SRC:%.c=%.o)
 
-
 ##
 ## LIBRARIES
 ##
-
 LIBS =			-lgtk-win32-2.0 \
 			-lglib-2.0 \
 			-lgdk-win32-2.0 \
@@ -81,47 +50,28 @@
 			-lgaim \
 			-lgtkgaim
 
-
-##
-## RULES
-##
-
-# How to make a C file
-
-%.o: %.c
-	$(CC) $(CFLAGS) $(DEFINES) $(INCLUDE_PATHS) -o $@ -c $<
+include $(GAIM_COMMON_RULES)
 
 ##
 ## TARGET DEFINITIONS
 ##
-
 .PHONY: all clean
 
 all: $(TARGET).dll
 
-install: all
-	cp $(TARGET).dll $(DLL_INSTALL_DIR)
-
-
-##
-## BUILD Dependencies
-##
+install: all $(GAIM_INSTALL_PLUGINS_DIR)
+	cp $(TARGET).dll $(GAIM_INSTALL_PLUGINS_DIR)
 
-$(GTKGAIM_TOP)/gtkgaim.dll.a:
-	$(MAKE) -C $(GTKGAIM_TOP) -f Makefile.mingw gtkgaim.dll.a
-
+$(OBJECTS): $(GAIM_CONFIG_H)
 
-##
-## BUILD DLL
-##
-
-$(TARGET).dll: $(OBJECTS) $(GTKGAIM_TOP)/gtkgaim.dll.a
+$(TARGET).dll: $(GAIM_LIBGAIM_DLL).a $(GAIM_GTKGAIM_DLL).a $(OBJECTS)
 	$(CC) -shared $(OBJECTS) $(LIB_PATHS) $(LIBS) $(DLL_LD_FLAGS) -o $(TARGET).dll
 
 ##
 ## CLEAN RULES
 ##
+clean:
+	rm -rf $(OBJECTS)
+	rm -rf $(TARGET).dll
 
-clean:
-	rm -rf *.o
-	rm -rf $(TARGET).dll
+include $(GAIM_COMMON_TARGETS)
--- a/gtk/plugins/ticker/Makefile.mingw	Wed Aug 23 18:50:46 2006 +0000
+++ b/gtk/plugins/ticker/Makefile.mingw	Wed Aug 23 21:34:43 2006 +0000
@@ -4,42 +4,15 @@
 # Description: Makefile for ticker plugin.
 #
 
-#
-# PATHS
-#
-
-GTK_TOP :=		../../../../win32-dev/gtk_2_0
-GAIM_TOP :=		../../..
-GTKGAIM_TOP :=		$(GAIM_TOP)/gtk
-LIBGAIM_TOP :=		$(GAIM_TOP)/libgaim
-TICKER_ROOT :=		.
-GAIM_INSTALL_DIR :=	$(GAIM_TOP)/win32-install-dir
-DLL_INSTALL_DIR :=	$(GAIM_INSTALL_DIR)/plugins
-
-##
-## VARIABLE DEFINITIONS
-##
+GAIM_TOP := ../../..
+include $(GAIM_TOP)/libgaim/win32/global.mak
 
 TARGET = ticker
 
-# Compiler Options
-
-CFLAGS =
-
-DEFINES =
-
-
-##
-## INCLUDE  MAKEFILES
-##
-
-include $(LIBGAIM_TOP)/win32/global.mak
-
 ##
 ## INCLUDE PATHS
 ##
-
-INCLUDE_PATHS +=	-I$(TICKER_ROOT) \
+INCLUDE_PATHS +=	-I. \
 			-I$(GTK_TOP)/include \
 			-I$(GTK_TOP)/include/gtk-2.0 \
 			-I$(GTK_TOP)/include/glib-2.0 \
@@ -47,33 +20,27 @@
 			-I$(GTK_TOP)/include/atk-1.0 \
 			-I$(GTK_TOP)/lib/glib-2.0/include \
 			-I$(GTK_TOP)/lib/gtk-2.0/include \
-			-I$(LIBGAIM_TOP) \
-			-I$(LIBGAIM_TOP)/win32 \
-			-I$(GTKGAIM_TOP) \
-			-I$(GTKGAIM_TOP)/win32 \
+			-I$(GAIM_LIB_TOP) \
+			-I$(GAIM_LIB_TOP)/win32 \
+			-I$(GAIM_GTK_TOP) \
+			-I$(GAIM_GTK_TOP)/win32 \
 			-I$(GAIM_TOP)
 
-
 LIB_PATHS =		-L$(GTK_TOP)/lib \
-			-L$(LIBGAIM_TOP) \
-			-L$(GTKGAIM_TOP)
-
+			-L$(GAIM_LIB_TOP) \
+			-L$(GAIM_GTK_TOP)
 
 ##
 ##  SOURCES, OBJECTS
 ##
-
 C_SRC =			ticker.c \
 			gtkticker.c
 
-
 OBJECTS = $(C_SRC:%.c=%.o)
 
-
 ##
 ## LIBRARIES
 ##
-
 LIBS =			-lgtk-win32-2.0 \
 			-lglib-2.0 \
 			-lgdk-win32-2.0 \
@@ -83,45 +50,28 @@
 			-lgaim \
 			-lgtkgaim
 
-##
-## RULES
-##
-
-# How to make a C file
-
-%.o: %.c
-	$(CC) $(CFLAGS) $(DEFINES) $(INCLUDE_PATHS) -o $@ -c $<
+include $(GAIM_COMMON_RULES)
 
 ##
 ## TARGET DEFINITIONS
 ##
-
 .PHONY: all clean
 
 all: $(TARGET).dll
 
-install:
-	cp $(TICKER_ROOT)/$(TARGET).dll $(DLL_INSTALL_DIR)
-
-
-##
-## BUILD Dependencies
-##
+install: $(GAIM_INSTALL_PLUGINS_DIR)
+	cp $(TARGET).dll $(GAIM_INSTALL_PLUGINS_DIR)
 
-$(GTKGAIM_TOP)/gtkgaim.dll.a:
-	$(MAKE) -C $(GTKGAIM_TOP) -f Makefile.mingw gtkgaim.dll.a
+$(OBJECTS): $(GAIM_CONFIG_H)
 
-##
-## BUILD DLL
-##
-
-$(TARGET).dll: $(OBJECTS) $(GTKGAIM_TOP)/gtkgaim.dll.a
+$(TARGET).dll: $(GAIM_LIBGAIM_DLL).a $(GAIM_GTKGAIM_DLL).a $(OBJECTS)
 	$(CC) -shared $(OBJECTS) $(LIB_PATHS) $(LIBS) $(DLL_LD_FLAGS) -o $(TARGET).dll
 
 ##
 ## CLEAN RULES
 ##
+clean:
+	rm -rf $(OBJECTS)
+	rm -rf $(TARGET).dll
 
-clean:
-	rm -rf *.o
-	rm -rf $(TARGET).dll
+include $(GAIM_COMMON_TARGETS)
--- a/gtk/plugins/win32/transparency/Makefile.mingw	Wed Aug 23 18:50:46 2006 +0000
+++ b/gtk/plugins/win32/transparency/Makefile.mingw	Wed Aug 23 21:34:43 2006 +0000
@@ -4,40 +4,15 @@
 # Description: Makefile for win32trans plugin.
 #
 
-#
-# PATHS
-#
-
-GTK_TOP :=		../../../../../win32-dev/gtk_2_0
-GAIM_TOP :=		../../../..
-LIBGAIM_TOP :=		../../../../libgaim
-GTKGAIM_TOP :=		../../../../gtk
-GAIM_INSTALL_DIR :=	$(GAIM_TOP)/win32-install-dir
-DLL_INSTALL_DIR :=	$(GAIM_INSTALL_DIR)/plugins
-
-##
-## VARIABLE DEFINITIONS
-##
+GAIM_TOP := ../../../..
+include $(GAIM_TOP)/libgaim/win32/global.mak
 
 TARGET = win2ktrans
-
-# Compiler Options
-
-CFLAGS =
-
-# This plugin requires W2K+ API
-DEFINES = -D_WIN32_WINNT=0x0500
-
-##
-## INCLUDE  MAKEFILES
-##
-
-include $(LIBGAIM_TOP)/win32/global.mak
+DEFINES += -D_WIN32_WINNT=0x0500
 
 ##
 ## INCLUDE PATHS
 ##
-
 INCLUDE_PATHS +=	-I. \
 			-I$(GTK_TOP)/include \
 			-I$(GTK_TOP)/include/gtk-2.0 \
@@ -46,32 +21,26 @@
 			-I$(GTK_TOP)/include/atk-1.0 \
 			-I$(GTK_TOP)/lib/glib-2.0/include \
 			-I$(GTK_TOP)/lib/gtk-2.0/include \
-			-I$(LIBGAIM_TOP) \
-			-I$(LIBGAIM_TOP)/win32 \
-			-I$(GTKGAIM_TOP) \
-			-I$(GTKGAIM_TOP)/win32 \
+			-I$(GAIM_LIB_TOP) \
+			-I$(GAIM_LIB_TOP)/win32 \
+			-I$(GAIM_GTK_TOP) \
+			-I$(GAIM_GTK_TOP)/win32 \
 			-I$(GAIM_TOP)
 
-
 LIB_PATHS =		-L$(GTK_TOP)/lib \
-			-L$(LIBGAIM_TOP) \
-			-L$(GTKGAIM_TOP)
-
+			-L$(GAIM_LIB_TOP) \
+			-L$(GAIM_GTK_TOP)
 
 ##
 ##  SOURCES, OBJECTS
 ##
-
 C_SRC =			win2ktrans.c
 
-
 OBJECTS = $(C_SRC:%.c=%.o)
 
-
 ##
 ## LIBRARIES
 ##
-
 LIBS =			-lgtk-win32-2.0 \
 			-lglib-2.0 \
 			-lgdk-win32-2.0 \
@@ -81,46 +50,26 @@
 			-lgtkgaim \
 			-lgaim
 
-
-##
-## RULES
-##
-
-# How to make a C file
-
-%.o: %.c
-	$(CC) $(CFLAGS) $(DEFINES) $(INCLUDE_PATHS) -o $@ -c $<
+include $(GAIM_COMMON_RULES)
 
 ##
 ## TARGET DEFINITIONS
 ##
-
 .PHONY: all clean
 
 all: $(TARGET).dll
 
-install: all
-	cp $(TARGET).dll $(DLL_INSTALL_DIR)
-
-
-##
-## BUILD Dependencies
-##
+install: all $(GAIM_INSTALL_PLUGINS_DIR)
+	cp $(TARGET).dll $(GAIM_INSTALL_PLUGINS_DIR)
 
-$(GTKGAIM_TOP)/gtkgaim.dll.a:
-	$(MAKE) -C $(GTKGAIM_TOP) -f Makefile.mingw gtkgaim.dll.a
-
-##
-## BUILD DLL
-##
-
-$(TARGET).dll: $(OBJECTS) $(GTKGAIM_TOP)/gtkgaim.dll.a
+$(TARGET).dll: $(GAIM_LIBGAIM_DLL).a $(GAIM_GTKGAIM_DLL).a $(OBJECTS)
 	$(CC) -shared $(OBJECTS) $(LIB_PATHS) $(LIBS) $(DLL_LD_FLAGS) -o $(TARGET).dll
 
 ##
 ## CLEAN RULES
 ##
+clean:
+	rm -rf $(OBJECTS)
+	rm -rf $(TARGET).dll
 
-clean:
-	rm -rf *.o
-	rm -rf $(TARGET).dll
+include $(GAIM_COMMON_TARGETS)
--- a/gtk/plugins/win32/winprefs/Makefile.mingw	Wed Aug 23 18:50:46 2006 +0000
+++ b/gtk/plugins/win32/winprefs/Makefile.mingw	Wed Aug 23 21:34:43 2006 +0000
@@ -4,39 +4,15 @@
 # Description: Makefile for winprefs plugin.
 #
 
-#
-# PATHS
-#
-
-GTK_TOP :=		../../../../../win32-dev/gtk_2_0
-GAIM_TOP :=		../../../..
-LIBGAIM_TOP :=		$(GAIM_TOP)/libgaim
-GTKGAIM_TOP :=		$(GAIM_TOP)/gtk
-GAIM_INSTALL_DIR :=	$(GAIM_TOP)/win32-install-dir
-DLL_INSTALL_DIR :=	$(GAIM_INSTALL_DIR)/plugins
-
-##
-## VARIABLE DEFINITIONS
-##
+GAIM_TOP := ../../../..
+include $(GAIM_TOP)/libgaim/win32/global.mak
 
 TARGET = winprefs
-
-# Compiler Options
-
-CFLAGS =
-
-DEFINES = -DWINVER=0x500
-
-##
-## INCLUDE  MAKEFILES
-##
-
-include $(LIBGAIM_TOP)/win32/global.mak
+DEFINES += -DWINVER=0x500
 
 ##
 ## INCLUDE PATHS
 ##
-
 INCLUDE_PATHS +=	-I. \
 			-I$(GTK_TOP)/include \
 			-I$(GTK_TOP)/include/gtk-2.0 \
@@ -45,33 +21,27 @@
 			-I$(GTK_TOP)/include/atk-1.0 \
 			-I$(GTK_TOP)/lib/glib-2.0/include \
 			-I$(GTK_TOP)/lib/gtk-2.0/include \
-			-I$(LIBGAIM_TOP) \
-			-I$(LIBGAIM_TOP)/win32 \
-			-I$(GTKGAIM_TOP) \
-			-I$(GTKGAIM_TOP)/win32 \
+			-I$(GAIM_LIB_TOP) \
+			-I$(GAIM_LIB_TOP)/win32 \
+			-I$(GAIM_GTK_TOP) \
+			-I$(GAIM_GTK_TOP)/win32 \
 			-I$(GAIM_TOP)
 
-
 LIB_PATHS =		-L$(GTK_TOP)/lib \
-			-L$(LIBGAIM_TOP) \
-			-L$(GTKGAIM_TOP)
-
+			-L$(GAIM_LIB_TOP) \
+			-L$(GAIM_GTK_TOP)
 
 ##
 ##  SOURCES, OBJECTS
 ##
-
 C_SRC =			winprefs.c \
 			gtkappbar.c
 
-
 OBJECTS = $(C_SRC:%.c=%.o)
 
-
 ##
 ## LIBRARIES
 ##
-
 LIBS =			-lgtk-win32-2.0 \
 			-lglib-2.0 \
 			-lgdk-win32-2.0 \
@@ -82,46 +52,29 @@
 			-lgaim \
 			-lgtkgaim
 
-
-##
-## RULES
-##
-
-# How to make a C file
-
-%.o: %.c
-	$(CC) $(CFLAGS) $(DEFINES) $(INCLUDE_PATHS) -o $@ -c $<
+include $(GAIM_COMMON_RULES)
 
 ##
 ## TARGET DEFINITIONS
 ##
-
 .PHONY: all clean
 
 all: $(TARGET).dll
 
-install: $(TARGET).dll
-	cp $(TARGET).dll $(DLL_INSTALL_DIR)
-
-
-##
-## BUILD Dependencies
-##
-
-$(GTKGAIM_TOP)/gtkgaim.dll.a:
-	$(MAKE) -C $(GTKGAIM_TOP) -f Makefile.mingw gtkgaim.dll.a
+install: $(TARGET).dll $(GAIM_INSTALL_PLUGINS_DIR)
+	cp $(TARGET).dll $(GAIM_INSTALL_PLUGINS_DIR)
 
 ##
 ## BUILD DLL
 ##
-
-$(TARGET).dll: $(OBJECTS) $(GTKGAIM_TOP)/gtkgaim.dll.a
+$(TARGET).dll: $(GAIM_LIBGAIM_DLL).a $(GAIM_GTKGAIM_DLL).a $(OBJECTS)
 	$(CC) -shared $(OBJECTS) $(LIB_PATHS) $(LIBS) $(DLL_LD_FLAGS) -o $(TARGET).dll
 
 ##
 ## CLEAN RULES
 ##
+clean:
+	rm -rf $(OBJECTS)
+	rm -rf $(TARGET).dll
 
-clean:
-	rm -rf *.o
-	rm -rf $(TARGET).dll
+include $(GAIM_COMMON_TARGETS)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gtk/sounds/Makefile.mingw	Wed Aug 23 21:34:43 2006 +0000
@@ -0,0 +1,14 @@
+#
+# Makefile.mingw
+#
+# Description: Makefile for win32 (mingw) version of Gaim
+#
+
+GAIM_TOP := ../..
+include $(GAIM_TOP)/libgaim/win32/global.mak
+include $(GAIM_GTK_SOUNDS_TOP)/Makefile.am
+
+install: $(GAIM_INSTALL_SOUNDS_DIR)
+	cp $(EXTRA_DIST) $(GAIM_INSTALL_SOUNDS_DIR)
+
+include $(GAIM_COMMON_TARGETS)
--- a/gtk/win32/IdleTracker/Makefile.mingw	Wed Aug 23 18:50:46 2006 +0000
+++ b/gtk/win32/IdleTracker/Makefile.mingw	Wed Aug 23 21:34:43 2006 +0000
@@ -4,63 +4,20 @@
 # Description: Makefile for idletrack
 #
 
-#
-# PATHS
-#
-
-GAIM_TOP :=		../../..
-LIBGAIM_TOP :=		$(GAIM_TOP)/libgaim
-GAIM_INSTALL_DIR :=	$(GAIM_TOP)/win32-install-dir
-
-##
-## VARIABLE DEFINITIONS
-##
+GAIM_TOP := ../../..
+include $(GAIM_TOP)/libgaim/win32/global.mak
 
 TARGET = idletrack
 
-# Compiler Options
-
-CFLAGS =
-
-DEFINES =
-
-##
-## INCLUDE  MAKEFILES
-##
-
-include $(LIBGAIM_TOP)/win32/global.mak
-
-##
-## INCLUDE PATHS
-##
-
-INCLUDE_PATHS +=
-
-LIB_PATHS =
-
 ##
 ##  SOURCES, OBJECTS
 ##
 
-C_SRC =			idletrack.c
+C_SRC =	idletrack.c
 
 OBJECTS = $(C_SRC:%.c=%.o)
 
-
-##
-## LIBRARIES
-##
-
-LIBS =
-
-##
-## RULES
-##
-
-# How to make a C file
-
-%.o: %.c
-	$(CC) $(CFLAGS) $(DEFINES) $(INCLUDE_PATHS) -o $@ -c $<
+include $(GAIM_COMMON_RULES)
 
 ##
 ## TARGET DEFINITIONS
@@ -70,14 +27,14 @@
 
 all: $(TARGET).dll
 
-install:
-
+install: $(GAIM_INSTALL_DIR)
+	cp $(TARGET).dll $(GAIM_INSTALL_DIR)
 
 ##
 ## BUILD DLL
 ##
 
-$(TARGET).dll: $(OBJECTS)
+$(TARGET).dll $(TARGET).dll.a: $(OBJECTS)
 	$(CC) -shared $(OBJECTS) $(LIB_PATHS) $(LIBS) $(DLL_LD_FLAGS) -Wl,--out-implib,$(TARGET).dll.a -o $(TARGET).dll
 
 ##
@@ -85,6 +42,8 @@
 ##
 
 clean:
-	rm -rf *.o
+	rm -rf $(OBJECTS)
 	rm -rf $(TARGET).dll
 	rm -rf $(TARGET).dll.a
+
+include $(GAIM_COMMON_TARGETS)
--- a/libgaim/Makefile.mingw	Wed Aug 23 18:50:46 2006 +0000
+++ b/libgaim/Makefile.mingw	Wed Aug 23 21:34:43 2006 +0000
@@ -1,63 +1,33 @@
 #
 # Makefile.mingw
 #
-# Description: Makefile for win32 (mingw) version of Gaim
-#
-
-#
-# PATHS
+# Description: Makefile for win32 (mingw) version of libGaim
 #
 
-GTK_TOP :=		../../win32-dev/gtk_2_0
-GAIM_TOP :=		..
-LIBGAIM_TOP :=		.
-PLUGINS_TOP :=		$(LIBGAIM_TOP)/plugins
-PROTOCOLS_TOP :=	$(LIBGAIM_TOP)/protocols
-GAIM_INSTALL_DIR :=	$(GAIM_TOP)/win32-install-dir
-LIBXML2_DIR :=		../../win32-dev/libxml2
-
-NEEDED_DLLS = $(LIBXML2_DIR)/bin/libxml2.dll
-
-
-##
-## VARIABLE DEFINITIONS
-##
+GAIM_TOP := ..
+include $(GAIM_TOP)/libgaim/win32/global.mak
 
 TARGET = libgaim
-
-# Compiler and Linker Options
-
-CFLAGS =
-
-DEFINES =
-
-##
-## INCLUDE  MAKEFILES
-##
-
-include $(LIBGAIM_TOP)/win32/global.mak
+NEEDED_DLLS = $(LIBXML2_TOP)/bin/libxml2.dll
 
 ##
 ## INCLUDE PATHS
 ##
-
 INCLUDE_PATHS =	\
-			-I$(LIBGAIM_TOP) \
-			-I$(LIBGAIM_TOP)/win32 \
+			-I$(GAIM_LIB_TOP) \
+			-I$(GAIM_LIB_TOP)/win32 \
 			-I$(GAIM_TOP) \
 			-I$(GTK_TOP)/include \
 			-I$(GTK_TOP)/include/glib-2.0 \
 			-I$(GTK_TOP)/lib/glib-2.0/include \
-			-I$(LIBXML2_DIR)/include
+			-I$(LIBXML2_TOP)/include
 
 LIB_PATHS =		-L$(GTK_TOP)/lib \
-			-L$(LIBGAIM_TOP) \
-			-L$(LIBXML2_DIR)/lib
+			-L$(LIBXML2_TOP)/lib
 
 ##
 ##  SOURCES, OBJECTS
 ##
-
 C_SRC =	\
 			account.c \
 			accountopt.c \
@@ -106,13 +76,11 @@
 			win32/libc_interface.c \
 			win32/win32dep.c
 
-
 OBJECTS = $(C_SRC:%.c=%.o)
 
 ##
 ## LIBRARIES
 ##
-
 LIBS =	\
 		-lglib-2.0 \
 		-lgthread-2.0 \
@@ -123,44 +91,36 @@
 		-liberty \
 		-lxml2
 
-##
-## RULES
-##
-
-# How to make a C file
-%.o: %.c
-	$(CC) $(CFLAGS) $(INCLUDE_PATHS) $(DEFINES) -c $< -o $@
+include $(GAIM_COMMON_RULES)
 
 ##
 ## TARGET DEFINITIONS
 ##
-
-.PHONY: all clean include_path
+.PHONY: all clean
 
 all: $(TARGET).dll
-	$(MAKE) -C $(PROTOCOLS_TOP) -f Makefile.mingw
-	$(MAKE) -C $(PLUGINS_TOP) -f Makefile.mingw
+	$(MAKE) -C $(GAIM_PROTOS_TOP) -f $(GAIM_WIN32_MAKEFILE)
+	$(MAKE) -C $(GAIM_LIB_PLUGINS_TOP) -f $(GAIM_WIN32_MAKEFILE)
 
-install: all
-	$(MAKE) -C $(PROTOCOLS_TOP) -f Makefile.mingw install
-	$(MAKE) -C $(PLUGINS_TOP) -f Makefile.mingw install
-	cp $(LIBGAIM_TOP)/$(TARGET).dll $(GAIM_INSTALL_DIR)
+install: all $(GAIM_INSTALL_DIR)
+	$(MAKE) -C $(GAIM_PROTOS_TOP) -f $(GAIM_WIN32_MAKEFILE) install
+	$(MAKE) -C $(GAIM_LIB_PLUGINS_TOP) -f $(GAIM_WIN32_MAKEFILE) install
+	cp $(TARGET).dll $(GAIM_INSTALL_DIR)
 	cp $(NEEDED_DLLS) $(GAIM_INSTALL_DIR)
 
-#
-# BUILD DLL
-#
-$(TARGET).dll.a $(TARGET).dll:
-$(TARGET).dll.a $(TARGET).dll: $(OBJECTS)
+$(OBJECTS): $(GAIM_CONFIG_H)
+
+$(TARGET).dll $(TARGET).dll.a: $(OBJECTS)
 	$(CC) -shared $(OBJECTS) $(LIB_PATHS) $(LIBS) $(DLL_LD_FLAGS) -Wl,--out-implib,$(TARGET).dll.a -o $(TARGET).dll
 
 ##
 ## CLEAN RULES
 ##
-
 clean:
-	rm -rf *.o ./win32/*.o
+	rm -rf $(OBJECTS)
 	rm -rf $(TARGET).dll
 	rm -rf $(TARGET).dll.a
-	$(MAKE) -C $(PROTOCOLS_TOP) -f Makefile.mingw clean
-	$(MAKE) -C $(PLUGINS_TOP) -f Makefile.mingw clean
+	$(MAKE) -C $(GAIM_PROTOS_TOP) -f $(GAIM_WIN32_MAKEFILE) clean
+	$(MAKE) -C $(GAIM_LIB_PLUGINS_TOP) -f $(GAIM_WIN32_MAKEFILE) clean
+
+include $(GAIM_COMMON_TARGETS)
--- a/libgaim/plugins/Makefile.mingw	Wed Aug 23 18:50:46 2006 +0000
+++ b/libgaim/plugins/Makefile.mingw	Wed Aug 23 21:34:43 2006 +0000
@@ -4,59 +4,33 @@
 # Description: Makefile for win32 (mingw) version of Gaim Plugins 
 #
 
-#
-# PATHS
-#
+GAIM_TOP := ../..
+include $(GAIM_TOP)/libgaim/win32/global.mak
 
-GAIM_PLUGINS := 	.
-GAIM_TOP :=		../..
-LIBGAIM_TOP :=		..
-GTK_TOP :=		../../../win32-dev/gtk_2_0
-GAIM_INSTALL_DIR :=	$(GAIM_TOP)/win32-install-dir
-PERL_PLUGIN_LOADER :=	./perl
-TCL_PLUGIN_LOADER :=    ./tcl
-SSL :=			./ssl
-
-##
-## VARIABLE DEFINITIONS
-##
-
-# Compiler Options
-
-CFLAGS =
-
-DEFINES =
+PERL_PLUGIN := ./perl
+TCL_PLUGIN := ./tcl
+SSL_PLUGIN := ./ssl
 
 .SUFFIXES:
 .SUFFIXES: .c .dll
 
 ##
-## INCLUDE  MAKEFILES
-##
-
-include $(LIBGAIM_TOP)/win32/global.mak
-
-##
 ## INCLUDE PATHS
 ##
-
 INCLUDE_PATHS +=	\
 			-I$(GTK_TOP)/include \
 			-I$(GTK_TOP)/include/glib-2.0 \
 			-I$(GTK_TOP)/lib/glib-2.0/include \
 			-I$(GAIM_TOP) \
-			-I$(LIBGAIM_TOP) \
-			-I$(LIBGAIM_TOP)/win32
-
+			-I$(GAIM_LIB_TOP) \
+			-I$(GAIM_LIB_TOP)/win32
 
 LIB_PATHS =		-L$(GTK_TOP)/lib \
-			-L$(LIBGAIM_TOP)
-
+			-L$(GAIM_LIB_TOP)
 
 ##
 ## LIBRARIES
 ##
-
 LIBS =	\
 			-lglib-2.0 \
 			-lgobject-2.0 \
@@ -66,29 +40,20 @@
 			-lgaim
 
 ##
-## RULES
-##
-
-##
 ## TARGET DEFINITIONS
 ##
-
 .PHONY: all clean
 
-all: plugins
-#	$(MAKE) -C $(PERL_PLUGIN_LOADER) -f Makefile.mingw
-	$(MAKE) -C $(TCL_PLUGIN_LOADER) -f Makefile.mingw
-	$(MAKE) -C $(SSL) -f Makefile.mingw
+all: $(GAIM_LIBGAIM_DLL).a plugins
+#	$(MAKE) -C $(PERL_PLUGIN) -f $(GAIM_WIN32_MAKEFILE)
+	$(MAKE) -C $(TCL_PLUGIN) -f $(GAIM_WIN32_MAKEFILE)
+	$(MAKE) -C $(SSL_PLUGIN) -f $(GAIM_WIN32_MAKEFILE)
 
-install:
-	cp $(GAIM_PLUGINS)/*.dll $(GAIM_INSTALL_DIR)/plugins
-#	$(MAKE) -C $(PERL_PLUGIN_LOADER) -f Makefile.mingw install
-	$(MAKE) -C $(TCL_PLUGIN_LOADER) -f Makefile.mingw install
-	$(MAKE) -C $(SSL) -f Makefile.mingw install
-
-#
-# BUILD Plugin
-#
+install: all $(GAIM_INSTALL_PLUGINS_DIR)
+#	$(MAKE) -C $(PERL_PLUGIN) -f $(GAIM_WIN32_MAKEFILE) install
+	$(MAKE) -C $(TCL_PLUGIN) -f $(GAIM_WIN32_MAKEFILE) install
+	$(MAKE) -C $(SSL_PLUGIN) -f $(GAIM_WIN32_MAKEFILE) install
+	cp $(GAIM_LIB_PLUGINS_TOP)/*.dll $(GAIM_INSTALL_PLUGINS_DIR)
 
 .c.dll:
 	$(CC) $(CFLAGS) $(DEFINES) $(INCLUDE_PATHS) -o $@.o -c $<
@@ -100,14 +65,14 @@
 		psychic.dll \
 		statenotify.dll
 
-
 ##
 ## CLEAN RULES
 ##
+clean:
+	rm -rf $(GAIM_LIB_PLUGINS_TOP)/*.o
+	rm -rf $(GAIM_LIB_PLUGINS_TOP)/*.dll
+	$(MAKE) -C $(PERL_PLUGIN) -f $(GAIM_WIN32_MAKEFILE) clean
+	$(MAKE) -C $(TCL_PLUGIN) -f $(GAIM_WIN32_MAKEFILE) clean
+	$(MAKE) -C $(SSL_PLUGIN) -f $(GAIM_WIN32_MAKEFILE) clean
 
-clean:
-	rm -rf *.o
-	rm -rf *.dll
-	$(MAKE) -C $(PERL_PLUGIN_LOADER) -f Makefile.mingw clean
-	$(MAKE) -C $(TCL_PLUGIN_LOADER) -f Makefile.mingw clean
-	$(MAKE) -C $(SSL) -f Makefile.mingw clean
+include $(GAIM_COMMON_TARGETS)
--- a/libgaim/plugins/perl/Makefile.mingw	Wed Aug 23 18:50:46 2006 +0000
+++ b/libgaim/plugins/perl/Makefile.mingw	Wed Aug 23 21:34:43 2006 +0000
@@ -4,78 +4,49 @@
 # Description: Makefile for perl plugin loader plugin.
 #
 
-#
-# PATHS
-#
-
-GTK_TOP :=		../../../../win32-dev/gtk_2_0
-GAIM_TOP :=		../../..
-LIBGAIM_TOP :=		../..
-PERL_LIB_DIR :=		../../../../win32-dev/perl58
-PERL_INCLUDE :=		$(PERL_LIB_DIR)/CORE
-GAIM_INSTALL_DIR :=	$(GAIM_TOP)/win32-install-dir
-DLL_INSTALL_DIR :=	$(GAIM_INSTALL_DIR)/plugins
-
-##
-## VARIABLE DEFINITIONS
-##
+GAIM_TOP := ../../..
+include $(GAIM_TOP)/libgaim/win32/global.mak
 
 TARGET = perl
 
-CC := gcc.exe
-
-# Compiler Options
-
-CFLAGS =
-
-DEFINES =
-
-##
-## INCLUDE  MAKEFILES
-##
-
-include $(LIBGAIM_TOP)/win32/global.mak
-
 # Perl headers with /* /* */ type comments.. Turn off warnings.
 CFLAGS += -Wno-comment
 
 ##
 ## INCLUDE PATHS
 ##
-
 INCLUDE_PATHS +=	-I. \
 			-I$(GAIM_TOP) \
-			-I$(LIBGAIM_TOP) \
-			-I$(LIBGAIM_TOP)/win32 \
+			-I$(GAIM_LIB_TOP) \
+			-I$(GAIM_LIB_TOP)/win32 \
+			-I$(GAIM_GTK_TOP) \
+			-I$(GAIM_GTK_TOP)/win32 \
 			-I$(GTK_TOP)/include \
+			-I$(GTK_TOP)/include/gtk-2.0 \
 			-I$(GTK_TOP)/include/glib-2.0 \
+			-I$(GTK_TOP)/include/pango-1.0 \
+			-I$(GTK_TOP)/include/atk-1.0 \
+			-I$(GTK_TOP)/lib/gtk-2.0/include \
 			-I$(GTK_TOP)/lib/glib-2.0/include \
-			-I$(PERL_INCLUDE)
-
-
-
+			-I$(PERL_LIB_TOP)/CORE
 
 LIB_PATHS =		-L$(GTK_TOP)/lib \
-			-L$(GAIM_TOP)/src \
-			-L$(PERL_LIB_DIR)
-
+			-L$(GAIM_LIB_TOP) \
+			-L$(GAIM_GTK_TOP) \
+			-L$(PERL_LIB_TOP)
 
 ##
 ##  SOURCES, OBJECTS
 ##
-
 C_SRC =			perl.c \
 			perl-common.c \
 			perl-handlers.c
 
-
 OBJECTS = $(C_SRC:%.c=%.o)
 
-
 ##
 ## LIBRARIES
 ##
-
 LIBS =	\
 			-lglib-2.0 \
 			-lgmodule-2.0 \
@@ -83,51 +54,37 @@
 			-lws2_32 \
 			-lintl \
 			-lgaim \
+			-lgtkgaim \
 			-lperl58
 
-
-##
-## RULES
-##
-
-# How to make a C file
-
-%.o: %.c
-	$(CC) $(CFLAGS) $(DEFINES) $(INCLUDE_PATHS) -o $@ -c $<
+include $(GAIM_COMMON_RULES)
 
 ##
 ## TARGET DEFINITIONS
 ##
-
 .PHONY: all clean
 
 all: $(TARGET).dll
-	$(MAKE) -C ./common -f Makefile.mingw
-
-install:
-	cp $(TARGET).dll $(DLL_INSTALL_DIR)
-	$(MAKE) -C ./common -f Makefile.mingw install
+	$(MAKE) -C ./common -f $(GAIM_WIN32_MAKEFILE)
 
-##
-## BUILD Dependencies
-##
+install: all $(GAIM_INSTALL_PLUGINS_DIR)
+	cp $(TARGET).dll $(GAIM_INSTALL_PLUGINS_DIR)
+	$(MAKE) -C ./common -f $(GAIM_WIN32_MAKEFILE) install
 
-$(GAIM_TOP)/src/libgaim.dll.a:
-	$(MAKE) -C $(GAIM_TOP)/src -f Makefile.mingw libgaim.dll.a
+$(OBJECTS): $(GAIM_CONFIG_H)
 
 ##
 ## BUILD DLL
 ##
-
-$(TARGET).dll: $(OBJECTS) $(GAIM_TOP)/src/libgaim.dll.a
+$(TARGET).dll: $(GAIM_LIBGAIM_DLL).a $(GAIM_GTKGAIM_DLL).a $(OBJECTS)
 	$(CC) -shared $(OBJECTS) $(LIB_PATHS) $(LIBS) $(DLL_LD_FLAGS)  -Wl,--export-all-symbols -o $(TARGET).dll
 
-
 ##
 ## CLEAN RULES
 ##
+clean:
+	rm -rf $(OBJECTS)
+	rm -rf $(TARGET).dll $(TARGET).lib
+	$(MAKE) -C ./common -f $(GAIM_WIN32_MAKEFILE) clean
 
-clean:
-	rm -rf *.o
-	rm -rf $(TARGET).dll $(TARGET).lib
-	$(MAKE) -C ./common -f Makefile.mingw clean
+include $(GAIM_COMMON_TARGETS)
--- a/libgaim/plugins/perl/common/Makefile.mingw	Wed Aug 23 18:50:46 2006 +0000
+++ b/libgaim/plugins/perl/common/Makefile.mingw	Wed Aug 23 21:34:43 2006 +0000
@@ -4,32 +4,23 @@
 # Description: Makefile for Gaim perl module.
 #
 
+GAIM_TOP := ../../../..
+include $(GAIM_TOP)/libgaim/win32/global.mak
+
 TARGET = Gaim
 AUTOSPLIT = lib/auto/Gaim/autosplit.ix
+EXTUTILS := C:/perl/lib/ExtUtils
+PERL_PLUGIN_TOP := ..
 
-##
-## TOOLS
-##
-
-CC := gcc
-PERL := /cygdrive/c/perl/bin/perl
+CFLAGS += -Wno-comment
 
 ##
-## PATHS
+## INCLUDE PATHS
 ##
-
-EXTUTILS := C:/perl/lib/ExtUtils
-GAIM_TOP := ../../..
-GTK_TOP := ../../../../win32-dev/gtk_2_0
-PERL_TOP := ../../../../win32-dev/perl58
-PERL_PLUGIN_TOP := ..
-GAIM_INSTALL_DIR :=	$(GAIM_TOP)/win32-install-dir
-PERLMOD_INSTALL_DIR :=	$(GAIM_INSTALL_DIR)/perlmod
-
-
 INCLUDE_PATHS =		-I. \
 			-I$(GAIM_TOP) \
-			-I$(GAIM_TOP)/src \
+			-I$(GAIM_LIB_TOP) \
+			-I$(GAIM_GTK_TOP) \
 			-I$(GTK_TOP)/include \
 			-I$(GTK_TOP)/include/gtk-2.0 \
 			-I$(GTK_TOP)/include/glib-2.0 \
@@ -37,18 +28,17 @@
 			-I$(GTK_TOP)/include/atk-1.0 \
 			-I$(GTK_TOP)/lib/gtk-2.0/include \
 			-I$(GTK_TOP)/lib/glib-2.0/include \
-			-I$(PERL_TOP)/CORE
+			-I$(PERL_LIB_TOP)/CORE
 
-LIB_PATHS = 		-L$(PERL_TOP) \
+LIB_PATHS = 		-L$(PERL_LIB_TOP) \
 			-L$(PERL_PLUGIN_TOP) \
-			-L$(GAIM_TOP)/src \
+			-L$(GAIM_LIB_TOP) \
+			-L$(GAIM_GTK_TOP) \
 			-L$(GTK_TOP)/lib
 
-
 ##
 ##  SOURCES, OBJECTS
 ##
-
 XS_FILES =		Account.xs \
 				AccountOpts.xs \
 				BuddyIcon.xs \
@@ -83,32 +73,20 @@
 				Util.xs \
 				XMLNode.xs \
 
-FALLBACKS =		const-c.inc const-xs.inc
-
+FALLBACKS =	const-c.inc const-xs.inc
 C_FILES = $(XS_FILES:%.xs=%.c)
-
 OBJECTS = $(C_FILES:%.c=%.o)
 
 ##
 ## LIBRARIES
 ##
-
 LIBS =			-lperl58 \
 			-lperl \
 			-lgaim \
+			-lgtkgaim \
 			-lglib-2.0
 
-##
-## RULES
-##
-
-# How to make a C file
-%.o: %.c
-	$(CC) $(CFLAGS) $(INCLUDE_PATHS) $(DEFINES) -c $< -o $@
-
-# How to make a XS file
-%.c: %.xs
-	$(PERL) $(EXTUTILS)/xsubpp -typemap $(EXTUTILS)/typemap -typemap typemap $< > $@
+include $(GAIM_COMMON_RULES)
 
 %.inc:
 	cp fallback/$@ ./
@@ -116,27 +94,29 @@
 ##
 ## TARGETS
 ##
-
 .PHONY: all clean
 
 all: $(TARGET).dll $(AUTOSPLIT)
 	
-install:
-	rm -rf $(PERLMOD_INSTALL_DIR)
-	cp -R lib $(PERLMOD_INSTALL_DIR)
-	cp $(TARGET).dll $(PERLMOD_INSTALL_DIR)
-	
+install: all
+	rm -rf $(GAIM_INSTALL_PERLMOD_DIR)
+	cp -R lib $(GAIM_INSTALL_PERLMOD_DIR)
+	cp $(TARGET).dll $(GAIM_INSTALL_PERLMOD_DIR)
+
+$(C_FILES): $(GAIM_CONFIG_H)
+
 $(AUTOSPLIT): Gaim.pm
 	mkdir -p ./lib/auto
 	cp Gaim.pm ./lib
 	$(PERL) -MAutoSplit -e 'autosplit("lib/Gaim.pm")'
 
-$(TARGET).dll: $(FALLBACKS) $(OBJECTS)
+$(TARGET).dll: $(GAIM_LIBGAIM_DLL).a $(GAIM_GTKGAIM_DLL).a $(FALLBACKS) $(OBJECTS)
 	$(CC) -shared $(OBJECTS) $(LIB_PATHS) $(LIBS) -o $(TARGET).dll
 
 ##
 ## CLEAN
 ##
-
 clean:
 	rm -rf *.o $(TARGET).dll $(FALLBACKS) lib
+
+include $(GAIM_COMMON_TARGETS)
--- a/libgaim/plugins/perl/common/module.h	Wed Aug 23 18:50:46 2006 +0000
+++ b/libgaim/plugins/perl/common/module.h	Wed Aug 23 21:34:43 2006 +0000
@@ -53,7 +53,7 @@
 #include "status.h"
 #include "stringref.h"
 /* Ewww. perl has it's own util.h which is in the include path :( */
-#include "src/util.h"
+#include "libgaim/util.h"
 #include "value.h"
 #include "xmlnode.h"
 
--- a/libgaim/plugins/ssl/Makefile.mingw	Wed Aug 23 18:50:46 2006 +0000
+++ b/libgaim/plugins/ssl/Makefile.mingw	Wed Aug 23 21:34:43 2006 +0000
@@ -4,82 +4,52 @@
 # Description: Makefile for ssl plugin.
 #
 
-#
-# PATHS
-#
-
-GTK_TOP :=		../../../../win32-dev/gtk_2_0
-GAIM_TOP :=		../../..
-LIBGAIM_TOP :=		../..
-GAIM_INSTALL_DIR :=	$(GAIM_TOP)/win32-install-dir
-DLL_INSTALL_DIR :=	$(GAIM_INSTALL_DIR)/plugins
-NSS_DIR :=              ../../../../win32-dev/nss-3.9
-NSPR_DIR :=             ../../../../win32-dev/nspr-4.4.1
+GAIM_TOP := ../../..
+include $(GAIM_TOP)/libgaim/win32/global.mak
 
 ##
 ## VARIABLE DEFINITIONS
 ##
-
 TARGET = ssl
 TARGET_NSS = ssl-nss
 
-NEEDED_DLLS =		$(NSS_DIR)/lib/nss3.dll \
-			$(NSS_DIR)/lib/nssckbi.dll \
-			$(NSS_DIR)/lib/softokn3.dll \
-			$(NSS_DIR)/lib/ssl3.dll \
-			$(NSPR_DIR)/lib/nspr4.dll \
-			$(NSPR_DIR)/lib/plc4.dll \
-			$(NSPR_DIR)/lib/plds4.dll
-
-# Compiler Options
-
-CFLAGS =
-
-DEFINES =
-
-##
-## INCLUDE  MAKEFILES
-##
-
-include $(LIBGAIM_TOP)/win32/global.mak
+NEEDED_DLLS =		$(NSS_TOP)/lib/nss3.dll \
+			$(NSS_TOP)/lib/nssckbi.dll \
+			$(NSS_TOP)/lib/softokn3.dll \
+			$(NSS_TOP)/lib/ssl3.dll \
+			$(NSPR_TOP)/lib/nspr4.dll \
+			$(NSPR_TOP)/lib/plc4.dll \
+			$(NSPR_TOP)/lib/plds4.dll
 
 ##
 ## INCLUDE PATHS
 ##
-
 INCLUDE_PATHS +=	-I. \
 			-I$(GTK_TOP)/include \
 			-I$(GTK_TOP)/include/glib-2.0 \
 			-I$(GTK_TOP)/lib/glib-2.0/include \
-			-I$(LIBGAIM_TOP) \
-			-I$(LIBGAIM_TOP)/win32 \
+			-I$(GAIM_LIB_TOP) \
+			-I$(GAIM_LIB_TOP)/win32 \
 			-I$(GAIM_TOP) \
-			-I$(NSS_DIR)/include \
-			-I$(NSPR_DIR)/include
+			-I$(NSS_TOP)/include \
+			-I$(NSPR_TOP)/include
 
 LIB_PATHS =		-L$(GTK_TOP)/lib \
-			-L$(LIBGAIM_TOP) \
-			-L$(NSS_DIR)/lib \
-			-L$(NSPR_DIR)/lib
+			-L$(GAIM_LIB_TOP) \
+			-L$(NSS_TOP)/lib \
+			-L$(NSPR_TOP)/lib
 
 ##
 ##  SOURCES, OBJECTS
 ##
-
 C_SRC =			ssl.c
-
 C_SRC_NSS =		ssl-nss.c
-
-
 OBJECTS = $(C_SRC:%.c=%.o)
-
 OBJECTS_NSS = $(C_SRC_NSS:%.c=%.o)
 
-
 ##
 ## LIBRARIES
 ##
-
 LIBS =	\
 			-lglib-2.0 \
 			-lws2_32 \
@@ -89,51 +59,36 @@
 			-lnspr4 \
 			-lssl3
 
-
-##
-## RULES
-##
-
-# How to make a C file
-
-%.o: %.c
-	$(CC) $(CFLAGS) $(DEFINES) $(INCLUDE_PATHS) -o $@ -c $<
+include $(GAIM_COMMON_RULES)
 
 ##
 ## TARGET DEFINITIONS
 ##
-
 .PHONY: all clean
 
 all: $(TARGET).dll $(TARGET_NSS).dll
 
-install:
-	cp $(TARGET).dll $(DLL_INSTALL_DIR)
-	cp $(TARGET_NSS).dll $(DLL_INSTALL_DIR)
+install: all $(GAIM_INSTALL_PLUGINS_DIR) $(GAIM_INSTALL_DIR)
+	cp $(TARGET).dll $(GAIM_INSTALL_PLUGINS_DIR)
+	cp $(TARGET_NSS).dll $(GAIM_INSTALL_PLUGINS_DIR)
 	cp $(NEEDED_DLLS) $(GAIM_INSTALL_DIR)
 
-##
-## BUILD Dependencies
-##
-
-$(LIBGAIM_TOP)/libgaim.dll.a:
-	$(MAKE) -C $(LIBGAIM_TOP) -f Makefile.mingw libgaim.dll.a
+$(OBJECTS) $(OBJECTS_NSS): $(GAIM_CONFIG_H)
 
 ##
 ## BUILD DLL
 ##
-
-$(TARGET).dll: $(OBJECTS) $(LIBGAIM_TOP)/libgaim.dll.a
+$(TARGET).dll: $(GAIM_LIBGAIM_DLL).a $(OBJECTS)
 	$(CC) -shared $(OBJECTS) $(LIB_PATHS) $(LIBS) $(DLL_LD_FLAGS) -o $(TARGET).dll
 
-$(TARGET_NSS).dll: $(OBJECTS_NSS) $(LIBGAIM_TOP)/libgaim.dll.a
+$(TARGET_NSS).dll: $(GAIM_LIBGAIM_DLL) $(OBJECTS_NSS)
 	$(CC) -shared $(OBJECTS_NSS) $(LIB_PATHS) $(LIBS) $(DLL_LD_FLAGS) -o $(TARGET_NSS).dll
 
 ##
 ## CLEAN RULES
 ##
+clean:
+	rm -rf $(OBJECTS) $(OBJECTS_NSS)
+	rm -rf $(TARGET).dll $(TARGET_NSS).dll
 
-clean:
-	rm -rf *.o
-	rm -rf $(TARGET).dll
-	rm -rf $(TARGET_NSS).dll
+include $(GAIM_COMMON_TARGETS)
--- a/libgaim/plugins/tcl/Makefile.mingw	Wed Aug 23 18:50:46 2006 +0000
+++ b/libgaim/plugins/tcl/Makefile.mingw	Wed Aug 23 21:34:43 2006 +0000
@@ -4,59 +4,32 @@
 # Description: Makefile for tcl plugin loader plugin.
 #
 
-#
-# PATHS
-#
-
-GTK_TOP :=		../../../../win32-dev/gtk_2_0
-GAIM_TOP :=		../../..
-LIBGAIM_TOP :=		../..
-TCL_LIB_DIR :=		../../../../win32-dev/tcl-8.4.5
-TCL_INC_DIR :=		$(TCL_LIB_DIR)/include
-GAIM_INSTALL_DIR :=	$(GAIM_TOP)/win32-install-dir
-DLL_INSTALL_DIR :=	$(GAIM_INSTALL_DIR)/plugins
-
-##
-## VARIABLE DEFINITIONS
-##
+GAIM_TOP := ../../..
+include $(GAIM_TOP)/libgaim/win32/global.mak
 
 TARGET = tcl
-
-# Compiler Options
-
-CFLAGS =
-
-DEFINES = -DHAVE_TK -DUSE_TCL_STUBS -DUSE_TK_STUBS
-
-##
-## INCLUDE  MAKEFILES
-##
-
-include $(LIBGAIM_TOP)/win32/global.mak
+TCL_INC_DIR := $(TCL_LIB_TOP)/include
+DEFINES += -DHAVE_TK -DUSE_TCL_STUBS -DUSE_TK_STUBS
 
 ##
 ## INCLUDE PATHS
 ##
-
 INCLUDE_PATHS +=	-I. \
 			-I$(GAIM_TOP) \
-			-I$(LIBGAIM_TOP) \
-			-I$(LIBGAIM_TOP)/win32 \
+			-I$(GAIM_LIB_TOP) \
+			-I$(GAIM_LIB_TOP)/win32 \
 			-I$(GTK_TOP)/include \
 			-I$(GTK_TOP)/include/glib-2.0 \
 			-I$(GTK_TOP)/lib/glib-2.0/include \
 			-I$(TCL_INC_DIR)
 
-
-LIB_PATHS =		-L$(GTK_TOP)/lib \
-			-L$(LIBGAIM_TOP) \
-			-L$(TCL_LIB_DIR)
-
+LIB_PATHS +=		-L$(GTK_TOP)/lib \
+			-L$(GAIM_LIB_TOP) \
+			-L$(TCL_LIB_TOP)
 
 ##
 ##  SOURCES, OBJECTS
 ##
-
 C_SRC =			tcl.c \
 			tcl_cmd.c \
 			tcl_cmds.c \
@@ -64,14 +37,11 @@
 			tcl_ref.c \
 			tcl_signals.c
 
-
 OBJECTS = $(C_SRC:%.c=%.o)
 
-
 ##
 ## LIBRARIES
 ##
-
 LIBS =	\
 			-lglib-2.0 \
 			-lws2_32 \
@@ -80,46 +50,28 @@
 			-ltclstub84 \
 			-ltkstub84
 
-
-##
-## RULES
-##
-
-# How to make a C file
-
-%.o: %.c
-	$(CC) $(CFLAGS) $(DEFINES) $(INCLUDE_PATHS) -o $@ -c $<
+include $(GAIM_COMMON_RULES)
 
 ##
 ## TARGET DEFINITIONS
 ##
-
 .PHONY: all clean
 
 all: $(TARGET).dll
 
-install: $(TARGET).dll
-	cp $(TARGET).dll $(DLL_INSTALL_DIR)
-
-##
-## BUILD Dependencies
-##
+install: all $(GAIM_INSTALL_PLUGINS_DIR)
+	cp $(TARGET).dll $(GAIM_INSTALL_PLUGINS_DIR)
 
-$(LIBGAIM_TOP)/libgaim.dll.a:
-	$(MAKE) -C $(LIBGAIM_TOP) -f Makefile.mingw libgaim.dll.a
+$(OBJECTS): $(GAIM_CONFIG_H)
 
-##
-## BUILD DLL
-##
-
-$(TARGET).dll: $(OBJECTS) $(LIBGAIM_TOP)/libgaim.dll.a
+$(TARGET).dll: $(GAIM_LIBGAIM_DLL).a $(OBJECTS)
 	$(CC) -shared $(OBJECTS) $(LIB_PATHS) $(LIBS) $(DLL_LD_FLAGS) -o $(TARGET).dll
 
-
 ##
 ## CLEAN RULES
 ##
+clean:
+	rm -rf $(OBJECTS)
+	rm -rf $(TARGET).dll
 
-clean:
-	rm -rf *.o
-	rm -rf $(TARGET).dll
+include $(GAIM_COMMON_TARGETS)
--- a/libgaim/protocols/Makefile.mingw	Wed Aug 23 18:50:46 2006 +0000
+++ b/libgaim/protocols/Makefile.mingw	Wed Aug 23 21:34:43 2006 +0000
@@ -5,74 +5,70 @@
 # Description: Top Makefile for win32 (mingw) port of Gaim
 #
 
-GAIM_TOP = ../..
-LIBGAIM_TOP = ../
-GAIM_PROTOS = .
-GAIM_INSTALL_DIR = $(GAIM_TOP)/win32-install-dir
+GAIM_TOP := ../..
+include $(GAIM_TOP)/libgaim/win32/global.mak
 
-OSCAR = $(GAIM_PROTOS)/oscar
-YAHOO = $(GAIM_PROTOS)/yahoo
-MSN = $(GAIM_PROTOS)/msn
-TOC = $(GAIM_PROTOS)/toc
-IRC = $(GAIM_PROTOS)/irc
-JABBER = $(GAIM_PROTOS)/jabber
-GG = $(GAIM_PROTOS)/gg
-NOVELL = $(GAIM_PROTOS)/novell
-SILC = $(GAIM_PROTOS)/silc
-SIMPLE = $(GAIM_PROTOS)/simple
-SAMETIME = $(GAIM_PROTOS)/sametime
+GG = $(GAIM_PROTOS_TOP)/gg
+IRC = $(GAIM_PROTOS_TOP)/irc
+JABBER = $(GAIM_PROTOS_TOP)/jabber
+MSN = $(GAIM_PROTOS_TOP)/msn
+NOVELL = $(GAIM_PROTOS_TOP)/novell
+OSCAR = $(GAIM_PROTOS_TOP)/oscar
+SAMETIME = $(GAIM_PROTOS_TOP)/sametime
+SILC = $(GAIM_PROTOS_TOP)/silc
+SIMPLE = $(GAIM_PROTOS_TOP)/simple
+TOC = $(GAIM_PROTOS_TOP)/toc
+YAHOO = $(GAIM_PROTOS_TOP)/yahoo
 
 ##
 ## Don't forget to change STATIC_PROTO_INIT, in config.h.mingw if you
 ## change the status of a protocol (static/plugin)
 ##
 
-OSCAR_TYPE = PLUGIN
-YAHOO_TYPE = PLUGIN
-MSN_TYPE = PLUGIN
-TOC_TYPE = PLUGIN
+GG_TYPE = PLUGIN
 IRC_TYPE = PLUGIN
 JABBER_TYPE = PLUGIN
-GG_TYPE = PLUGIN
+MSN_TYPE = PLUGIN
 NOVELL_TYPE = PLUGIN
+OSCAR_TYPE = PLUGIN
+SAMETIME_TYPE = PLUGIN
 SILC_TYPE = PLUGIN
 SIMPLE_TYPE = PLUGIN
-SAMETIME_TYPE = PLUGIN
+TOC_TYPE = PLUGIN
+YAHOO_TYPE = PLUGIN
 
 all:
-	$(MAKE) TYPE='$(OSCAR_TYPE)' -C $(OSCAR) -f Makefile.mingw
-	$(MAKE) TYPE='$(YAHOO_TYPE)' -C $(YAHOO) -f Makefile.mingw
-	$(MAKE) TYPE='$(MSN_TYPE)' -C $(MSN) -f Makefile.mingw
-	$(MAKE) TYPE='$(IRC_TYPE)' -C $(IRC) -f Makefile.mingw
-	$(MAKE) TYPE='$(JABBER_TYPE)' -C $(JABBER) -f Makefile.mingw
-	$(MAKE) TYPE='$(GG_TYPE)' -C $(GG) -f Makefile.mingw
-	$(MAKE) TYPE='$(NOVELL_TYPE)' -C $(NOVELL) -f Makefile.mingw
-	$(MAKE) TYPE='$(SILC_TYPE)' -C $(SILC) -f Makefile.mingw
-	$(MAKE) TYPE='$(SIMPLE_TYPE)' -C $(SIMPLE) -f Makefile.mingw
-	$(MAKE) TYPE='$(SAMETIME_TYPE)' -C $(SAMETIME) -f Makefile.mingw
-
+	$(MAKE) TYPE='$(GG_TYPE)' -C $(GG) -f $(GAIM_WIN32_MAKEFILE)
+	$(MAKE) TYPE='$(IRC_TYPE)' -C $(IRC) -f $(GAIM_WIN32_MAKEFILE)
+	$(MAKE) TYPE='$(JABBER_TYPE)' -C $(JABBER) -f $(GAIM_WIN32_MAKEFILE)
+	$(MAKE) TYPE='$(MSN_TYPE)' -C $(MSN) -f $(GAIM_WIN32_MAKEFILE)
+	$(MAKE) TYPE='$(NOVELL_TYPE)' -C $(NOVELL) -f $(GAIM_WIN32_MAKEFILE)
+	$(MAKE) TYPE='$(OSCAR_TYPE)' -C $(OSCAR) -f $(GAIM_WIN32_MAKEFILE)
+	$(MAKE) TYPE='$(SAMETIME_TYPE)' -C $(SAMETIME) -f $(GAIM_WIN32_MAKEFILE)
+	$(MAKE) TYPE='$(SILC_TYPE)' -C $(SILC) -f $(GAIM_WIN32_MAKEFILE)
+	$(MAKE) TYPE='$(SIMPLE_TYPE)' -C $(SIMPLE) -f $(GAIM_WIN32_MAKEFILE)
+	$(MAKE) TYPE='$(YAHOO_TYPE)' -C $(YAHOO) -f $(GAIM_WIN32_MAKEFILE)
 
 install: all
-	mkdir -p $(GAIM_INSTALL_DIR)/plugins
-	$(MAKE) TYPE='$(OSCAR_TYPE)' -C $(OSCAR) -f Makefile.mingw install
-	$(MAKE) TYPE='$(YAHOO_TYPE)' -C $(YAHOO) -f Makefile.mingw install
-	$(MAKE) TYPE='$(MSN_TYPE)' -C $(MSN) -f Makefile.mingw install
-	$(MAKE) TYPE='$(IRC_TYPE)' -C $(IRC) -f Makefile.mingw install
-	$(MAKE) TYPE='$(JABBER_TYPE)' -C $(JABBER) -f Makefile.mingw install
-	$(MAKE) TYPE='$(GG_TYPE)' -C $(GG) -f Makefile.mingw install
-	$(MAKE) TYPE='$(NOVELL_TYPE)' -C $(NOVELL) -f Makefile.mingw install
-	$(MAKE) TYPE='$(SILC_TYPE)' -C $(SILC) -f Makefile.mingw install
-	$(MAKE) TYPE='$(SIMPLE_TYPE)' -C $(SIMPLE) -f Makefile.mingw install
-	$(MAKE) TYPE='$(SAMETIME_TYPE)' -C $(SAMETIME) -f Makefile.mingw install
+	$(MAKE) TYPE='$(GG_TYPE)' -C $(GG) -f $(GAIM_WIN32_MAKEFILE) install
+	$(MAKE) TYPE='$(IRC_TYPE)' -C $(IRC) -f $(GAIM_WIN32_MAKEFILE) install
+	$(MAKE) TYPE='$(JABBER_TYPE)' -C $(JABBER) -f $(GAIM_WIN32_MAKEFILE) install
+	$(MAKE) TYPE='$(MSN_TYPE)' -C $(MSN) -f $(GAIM_WIN32_MAKEFILE) install
+	$(MAKE) TYPE='$(NOVELL_TYPE)' -C $(NOVELL) -f $(GAIM_WIN32_MAKEFILE) install
+	$(MAKE) TYPE='$(OSCAR_TYPE)' -C $(OSCAR) -f $(GAIM_WIN32_MAKEFILE) install
+	$(MAKE) TYPE='$(SAMETIME_TYPE)' -C $(SAMETIME) -f $(GAIM_WIN32_MAKEFILE) install
+	$(MAKE) TYPE='$(SILC_TYPE)' -C $(SILC) -f $(GAIM_WIN32_MAKEFILE) install
+	$(MAKE) TYPE='$(SIMPLE_TYPE)' -C $(SIMPLE) -f $(GAIM_WIN32_MAKEFILE) install
+	$(MAKE) TYPE='$(YAHOO_TYPE)' -C $(YAHOO) -f $(GAIM_WIN32_MAKEFILE) install
 
 clean:
-	$(MAKE) -C $(OSCAR) -f Makefile.mingw clean
-	$(MAKE) -C $(YAHOO) -f Makefile.mingw clean
-	$(MAKE) -C $(MSN) -f Makefile.mingw clean
-	$(MAKE) -C $(IRC) -f Makefile.mingw clean
-	$(MAKE) -C $(JABBER) -f Makefile.mingw clean
-	$(MAKE) -C $(GG) -f Makefile.mingw clean
-	$(MAKE) -C $(NOVELL) -f Makefile.mingw clean
-	$(MAKE) -C $(SILC) -f Makefile.mingw clean
-	$(MAKE) -C $(SIMPLE) -f Makefile.mingw clean
-	$(MAKE) -C $(SAMETIME) -f Makefile.mingw clean
+	$(MAKE) TYPE='$(GG_TYPE)' -C $(GG) -f $(GAIM_WIN32_MAKEFILE) clean
+	$(MAKE) TYPE='$(IRC_TYPE)' -C $(IRC) -f $(GAIM_WIN32_MAKEFILE) clean
+	$(MAKE) TYPE='$(JABBER_TYPE)' -C $(JABBER) -f $(GAIM_WIN32_MAKEFILE) clean
+	$(MAKE) TYPE='$(MSN_TYPE)' -C $(MSN) -f $(GAIM_WIN32_MAKEFILE) clean
+	$(MAKE) TYPE='$(NOVELL_TYPE)' -C $(NOVELL) -f $(GAIM_WIN32_MAKEFILE) clean
+	$(MAKE) TYPE='$(OSCAR_TYPE)' -C $(OSCAR) -f $(GAIM_WIN32_MAKEFILE) clean
+	$(MAKE) TYPE='$(SAMETIME_TYPE)' -C $(SAMETIME) -f $(GAIM_WIN32_MAKEFILE) clean
+	$(MAKE) TYPE='$(SILC_TYPE)' -C $(SILC) -f $(GAIM_WIN32_MAKEFILE) clean
+	$(MAKE) TYPE='$(SIMPLE_TYPE)' -C $(SIMPLE) -f $(GAIM_WIN32_MAKEFILE) clean
+	$(MAKE) TYPE='$(YAHOO_TYPE)' -C $(YAHOO) -f $(GAIM_WIN32_MAKEFILE) clean
--- a/libgaim/protocols/bonjour/Makefile.mingw	Wed Aug 23 18:50:46 2006 +0000
+++ b/libgaim/protocols/bonjour/Makefile.mingw	Wed Aug 23 21:34:43 2006 +0000
@@ -4,30 +4,11 @@
 # Description: Makefile for win32 (mingw) version of libbonjour
 #
 
-#
-# PATHS
-#
-
-GTK_TOP :=		../../../../win32-dev/gtk_2_0
-GAIM_TOP :=		../../..
-LIBGAIM_TOP :=		../..
-BONJOUR_ROOT :=		.
-GAIM_INSTALL_DIR :=	$(GAIM_TOP)/win32-install-dir
-HOWL_DIR := $(GAIM_TOP)/../win32-dev/howl-1.0.0
-
-##
-## VARIABLE DEFINITIONS
-##
+GAIM_TOP := ../../..
+include $(GAIM_TOP)/libgaim/win32/global.mak
 
 TARGET = libbonjour
-
-NEEDED_DLLS =		$(HOWL_DIR)/bin/libhowl-1.dll
-
-# Compiler Options
-
-CFLAGS =
-
-DEFINES =
+NEEDED_DLLS = $(HOWL_TOP)/bin/libhowl-1.dll
 
 # Static or Plugin...
 ifeq ($(TYPE),STATIC)
@@ -35,53 +16,39 @@
   DLL_INSTALL_DIR =	$(GAIM_INSTALL_DIR)
 else
 ifeq ($(TYPE),PLUGIN)
-  DLL_INSTALL_DIR =	$(GAIM_INSTALL_DIR)/plugins
+  DLL_INSTALL_DIR =	$(GAIM_INSTALL_PLUGINS_DIR)
 endif
 endif
 
-
-##
-## INCLUDE  MAKEFILES
-##
-
-include $(LIBGAIM_TOP)/win32/global.mak
-
 ##
 ## INCLUDE PATHS
 ##
-
 INCLUDE_PATHS +=	-I$(BONJOUR_ROOT) \
 			-I$(GTK_TOP)/include \
 			-I$(GTK_TOP)/include/glib-2.0 \
 			-I$(GTK_TOP)/lib/glib-2.0/include \
-			-I$(HOWL_DIR)/include \
-			-I$(LIBGAIM_TOP) \
-			-I$(LIBGAIM_TOP)/win32 \
+			-I$(HOWL_TOP)/include \
+			-I$(GAIM_LIB_TOP) \
+			-I$(GAIM_LIB_TOP)/win32 \
 			-I$(GAIM_TOP)
 
-
 LIB_PATHS =		-L$(GTK_TOP)/lib \
-			-L$(HOWL_DIR)/lib \
-			-L$(LIBGAIM_TOP)
-
+			-L$(HOWL_TOP)/lib \
+			-L$(GAIM_LIB_TOP)
 
 ##
 ##  SOURCES, OBJECTS
 ##
-
 C_SRC =			bonjour.c \
 			buddy.c \
 			dns_sd.c \
 			jabber.c
 
-
 OBJECTS = $(C_SRC:%.c=%.o)
 
-
 ##
 ## LIBRARIES
 ##
-
 LIBS =	\
 			-lglib-2.0 \
 			-lws2_32 \
@@ -89,41 +56,22 @@
 			-lhowl \
 			-lgaim
 
-
-##
-## RULES
-##
-
-# How to make a C file
-
-%.o: %.c
-	$(CC) $(CFLAGS) $(DEFINES) $(INCLUDE_PATHS) -o $@ -c $<
+include $(GAIM_COMMON_RULES)
 
 ##
 ## TARGET DEFINITIONS
 ##
-
 .PHONY: all clean
 
 all: $(TARGET).dll
 
-install:
-	cp $(BONJOUR_ROOT)/$(TARGET).dll $(DLL_INSTALL_DIR)
+install: all $(DLL_INSTALL_DIR)
+	cp $(TARGET).dll $(DLL_INSTALL_DIR)
 	cp $(NEEDED_DLLS) $(GAIM_INSTALL_DIR)
 
-
-##
-## BUILD Dependencies
-##
+$(OBJECTS): $(GAIM_CONFIG_H)
 
-$(LIBGAIM_TOP)/libgaim.dll.a:
-	$(MAKE) -C $(LIBGAIM_TOP) -f Makefile.mingw libgaim.dll.a
-
-##
-## BUILD DLL
-##
-
-$(TARGET).dll: $(OBJECTS) $(LIBGAIM_TOP)/libgaim.dll.a
+$(TARGET).dll: $(GAIM_LIBGAIM_DLL).a $(OBJECTS)
 	$(CC) -shared $(OBJECTS) $(LIB_PATHS) $(LIBS) $(DLL_LD_FLAGS) -o $(TARGET).dll
 
 ##
@@ -131,5 +79,7 @@
 ##
 
 clean:
-	rm -rf *.o
+	rm -rf $(OBJECTS)
 	rm -rf $(TARGET).dll
+
+include $(GAIM_COMMON_TARGETS)
--- a/libgaim/protocols/gg/Makefile.mingw	Wed Aug 23 18:50:46 2006 +0000
+++ b/libgaim/protocols/gg/Makefile.mingw	Wed Aug 23 21:34:43 2006 +0000
@@ -4,27 +4,11 @@
 # Description: Makefile for win32 (mingw) version of libgg
 #
 
-#
-# PATHS
-#
-
-GTK_TOP :=		../../../../win32-dev/gtk_2_0
-GAIM_TOP :=		../../..
-LIBGAIM_TOP :=		../..
-GG_ROOT :=		.
-GAIM_INSTALL_DIR :=	$(GAIM_TOP)/win32-install-dir
-
-##
-## VARIABLE DEFINITIONS
-##
+GAIM_TOP := ../../..
+include $(GAIM_TOP)/libgaim/win32/global.mak
 
 TARGET = libgg
-
-# Compiler Options
-
-CFLAGS = -include win32dep.h
-
-DEFINES =
+CFLAGS += -include win32dep.h
 
 # Static or Plugin...
 ifeq ($(TYPE),STATIC)
@@ -32,39 +16,28 @@
   DLL_INSTALL_DIR =	$(GAIM_INSTALL_DIR)
 else
 ifeq ($(TYPE),PLUGIN)
-  DLL_INSTALL_DIR =	$(GAIM_INSTALL_DIR)/plugins
+  DLL_INSTALL_DIR =	$(GAIM_INSTALL_PLUGINS_DIR)
 endif
 endif
 
-
-##
-## INCLUDE  MAKEFILES
-##
-
-include $(LIBGAIM_TOP)/win32/global.mak
-
 ##
 ## INCLUDE PATHS
 ##
-
-INCLUDE_PATHS +=	-I$(GG_ROOT) \
-			-I$(GG_ROOT)/lib \
+INCLUDE_PATHS +=	-I. \
+			-I./lib \
 			-I$(GTK_TOP)/include \
 			-I$(GTK_TOP)/include/glib-2.0 \
 			-I$(GTK_TOP)/lib/glib-2.0/include \
-			-I$(LIBGAIM_TOP) \
-			-I$(LIBGAIM_TOP)/win32 \
+			-I$(GAIM_LIB_TOP) \
+			-I$(GAIM_LIB_TOP)/win32 \
 			-I$(GAIM_TOP)
 
-
 LIB_PATHS =		-L$(GTK_TOP)/lib \
-			-L$(LIBGAIM_TOP) \
-
+			-L$(GAIM_LIB_TOP) \
 
 ##
 ##  SOURCES, OBJECTS
 ##
-
 C_SRC =	\
 	lib/common.c \
 	lib/events.c \
@@ -81,11 +54,9 @@
 
 OBJECTS = $(C_SRC:%.c=%.o)
 
-
 ##
 ## LIBRARIES
 ##
-
 LIBS =	\
 			-lglib-2.0 \
 			-lgmodule-2.0 \
@@ -94,47 +65,28 @@
 			-lgaim \
 			-lws2_32
 
-
-##
-## RULES
-##
-
-# How to make a C file
-
-%.o: %.c
-	$(CC) $(CFLAGS) $(DEFINES) $(INCLUDE_PATHS) -o $@ -c $<
+include $(GAIM_COMMON_RULES)
 
 ##
 ## TARGET DEFINITIONS
 ##
-
 .PHONY: all clean
 
 all: $(TARGET).dll
 
-install:
-	cp $(GG_ROOT)/$(TARGET).dll $(DLL_INSTALL_DIR)
-
-
-##
-## BUILD Dependencies
-##
+install: all $(DLL_INSTALL_DIR)
+	cp $(TARGET).dll $(DLL_INSTALL_DIR)
 
-$(LIBGAIM_TOP)/libgaim.dll.a:
-	$(MAKE) -C $(LIBGAIM_TOP) -f Makefile.mingw libgaim.dll.a
+$(OBJECTS): $(GAIM_CONFIG_H)
 
-##
-## BUILD DLL
-##
-
-$(TARGET).dll: $(OBJECTS) $(LIBGAIM_TOP)/libgaim.dll.a
+$(TARGET).dll: $(GAIM_LIBGAIM_DLL).a $(OBJECTS)
 	$(CC) -shared $(OBJECTS) $(LIB_PATHS) $(LIBS) $(DLL_LD_FLAGS) -o $(TARGET).dll
 
 ##
 ## CLEAN RULES
 ##
+clean:
+	rm -rf $(OBJECTS)
+	rm -rf $(TARGET).dll
 
-clean:
-	rm -rf *.o
-	rm -rf $(GG_ROOT)/lib/*.o
-	rm -rf $(TARGET).dll
+include $(GAIM_COMMON_TARGETS)
--- a/libgaim/protocols/irc/Makefile.mingw	Wed Aug 23 18:50:46 2006 +0000
+++ b/libgaim/protocols/irc/Makefile.mingw	Wed Aug 23 21:34:43 2006 +0000
@@ -4,80 +4,49 @@
 # Description: Makefile for win32 (mingw) version of libirc
 #
 
-#
-# PATHS
-#
-
-GTK_TOP :=		../../../../win32-dev/gtk_2_0
-GAIM_TOP :=		../../..
-LIBGAIM_TOP :=		../..
-IRC_ROOT :=		.
-GAIM_INSTALL_DIR :=	$(GAIM_TOP)/win32-install-dir
-
-##
-## VARIABLE DEFINITIONS
-##
+GAIM_TOP := ../../..
+include $(GAIM_TOP)/libgaim/win32/global.mak
 
 TARGET = libirc
 
-# Compiler Options
-
-CFLAGS =
-
-DEFINES =
-
 # Static or Plugin...
 ifeq ($(TYPE),STATIC)
   DEFINES += -DSTATIC
   DLL_INSTALL_DIR =	$(GAIM_INSTALL_DIR)
 else
 ifeq ($(TYPE),PLUGIN)
-  DLL_INSTALL_DIR =	$(GAIM_INSTALL_DIR)/plugins
+  DLL_INSTALL_DIR =	$(GAIM_INSTALL_PLUGINS_DIR)
 endif
 endif
 
-
-##
-## INCLUDE  MAKEFILES
-##
-
-include $(LIBGAIM_TOP)/win32/global.mak
-
 ##
 ## INCLUDE PATHS
 ##
-
-INCLUDE_PATHS +=	-I$(IRC_ROOT) \
+INCLUDE_PATHS +=	-I. \
 			-I$(GTK_TOP)/include \
 			-I$(GTK_TOP)/include/glib-2.0 \
 			-I$(GTK_TOP)/lib/glib-2.0/include \
-			-I$(LIBGAIM_TOP) \
-			-I$(LIBGAIM_TOP)/win32 \
+			-I$(GAIM_LIB_TOP) \
+			-I$(GAIM_LIB_TOP)/win32 \
 			-I$(GAIM_TOP)
 
-
 LIB_PATHS =		-L$(GTK_TOP)/lib \
-			-L$(LIBGAIM_TOP)
-
+			-L$(GAIM_LIB_TOP)
 
 ##
 ##  SOURCES, OBJECTS
 ##
-
 C_SRC =			cmds.c \
 			dcc_send.c \
 			irc.c \
 			msgs.c \
 			parse.c
 
-
 OBJECTS = $(C_SRC:%.c=%.o)
 
-
 ##
 ## LIBRARIES
 ##
-
 LIBS =	\
 			-lglib-2.0 \
 			-lgobject-2.0 \
@@ -85,40 +54,24 @@
 			-lintl \
 			-lgaim
 
-
-##
-## RULES
-##
-
-# How to make a C file
-
-%.o: %.c
-	$(CC) $(CFLAGS) $(DEFINES) $(INCLUDE_PATHS) -o $@ -c $<
+include $(GAIM_COMMON_RULES)
 
 ##
 ## TARGET DEFINITIONS
 ##
-
 .PHONY: all clean
 
 all: $(TARGET).dll
 
-install:
-	cp $(IRC_ROOT)/$(TARGET).dll $(DLL_INSTALL_DIR)
-
+install: all $(DLL_INSTALL_DIR)
+	cp $(TARGET).dll $(DLL_INSTALL_DIR)
 
-##
-## BUILD Dependencies
-##
-
-$(LIBGAIM_TOP)/libgaim.dll.a:
-	$(MAKE) -C $(LIBGAIM_TOP) -f Makefile.mingw libgaim.dll.a
+$(OBJECTS): $(GAIM_CONFIG_H)
 
 ##
 ## BUILD DLL
 ##
-
-$(TARGET).dll: $(OBJECTS) $(LIBGAIM_TOP)/libgaim.dll.a
+$(TARGET).dll: $(GAIM_LIBGAIM_DLL).a $(OBJECTS)
 	$(CC) -shared $(OBJECTS) $(LIB_PATHS) $(LIBS) $(DLL_LD_FLAGS) -o $(TARGET).dll
 
 ##
@@ -126,5 +79,7 @@
 ##
 
 clean:
-	rm -rf *.o
+	rm -rf $(OBJECTS)
 	rm -rf $(TARGET).dll
+
+include $(GAIM_COMMON_RULES)
--- a/libgaim/protocols/jabber/Makefile.mingw	Wed Aug 23 18:50:46 2006 +0000
+++ b/libgaim/protocols/jabber/Makefile.mingw	Wed Aug 23 21:34:43 2006 +0000
@@ -4,70 +4,41 @@
 # Description: Makefile for win32 (mingw) version of libjabber
 #
 
-#
-# PATHS
-#
-
-GTK_TOP :=		../../../../win32-dev/gtk_2_0
-LIBXML2_DIR:=		../../../../win32-dev/libxml2
-GAIM_TOP :=		../../..
-LIBGAIM_TOP :=		../..
-JABBER_ROOT :=		.
-GAIM_INSTALL_DIR :=	$(GAIM_TOP)/win32-install-dir
-
-##
-## VARIABLE DEFINITIONS
-##
+GAIM_TOP := ../../..
+include $(GAIM_TOP)/libgaim/win32/global.mak
 
 TARGET = libjabber
 
-# Compiler Options
-
-CFLAGS =
-
-DEFINES =
-
 # Static or Plugin...
 ifeq ($(TYPE),STATIC)
   DEFINES += -DSTATIC
   DLL_INSTALL_DIR =	$(GAIM_INSTALL_DIR)
 else
 ifeq ($(TYPE),PLUGIN)
-  DLL_INSTALL_DIR =	$(GAIM_INSTALL_DIR)/plugins
+  DLL_INSTALL_DIR =	$(GAIM_INSTALL_PLUGINS_DIR)
 endif
 endif
 
-
-##
-## INCLUDE  MAKEFILES
-##
-
-include $(LIBGAIM_TOP)/win32/global.mak
-
 ##
 ## INCLUDE PATHS
 ##
-
-INCLUDE_PATHS +=	-I$(JABBER_ROOT) \
-			-I$(JABBER_ROOT)/win32 \
+INCLUDE_PATHS +=	-I. \
+			-I./win32 \
 			-I$(GTK_TOP)/include \
 			-I$(GTK_TOP)/include/glib-2.0 \
 			-I$(GTK_TOP)/lib/glib-2.0/include \
-			-I$(LIBXML2_DIR)/include \
-			-I$(LIBGAIM_TOP) \
-			-I$(LIBGAIM_TOP)/win32 \
+			-I$(LIBXML2_TOP)/include \
+			-I$(GAIM_LIB_TOP) \
+			-I$(GAIM_LIB_TOP)/win32 \
 			-I$(GAIM_TOP)
 
-
 LIB_PATHS =		-L$(GTK_TOP)/lib \
-			-L$(LIBXML2_DIR)/lib \
-			-L$(LIBGAIM_TOP)
-
+			-L$(LIBXML2_TOP)/lib \
+			-L$(GAIM_LIB_TOP)
 
 ##
 ##  SOURCES, OBJECTS
 ##
-
 C_SRC =			auth.c \
 			buddy.c \
 			chat.c \
@@ -84,14 +55,11 @@
 			xdata.c \
 			win32/posix.uname.c
 
-
 OBJECTS = $(C_SRC:%.c=%.o)
 
-
 ##
 ## LIBRARIES
 ##
-
 LIBS = \
 			-lglib-2.0 \
 			-lxml2 \
@@ -99,46 +67,28 @@
 			-lintl \
 			-lgaim
 
-##
-## RULES
-##
-
-# How to make a C file
-
-%.o: %.c
-	$(CC) $(CFLAGS) $(DEFINES) $(INCLUDE_PATHS) -o $@ -c $<
+include $(GAIM_COMMON_RULES)
 
 ##
 ## TARGET DEFINITIONS
 ##
-
 .PHONY: all clean
 
 all: $(TARGET).dll
 
-install:
-	cp $(JABBER_ROOT)/$(TARGET).dll $(DLL_INSTALL_DIR)
-
-
-##
-## BUILD Dependencies
-##
+install: all $(DLL_INSTALL_DIR)
+	cp $(TARGET).dll $(DLL_INSTALL_DIR)
 
-$(LIBGAIM_TOP)/libgaim.dll.a:
-	$(MAKE) -C $(LIBGAIM_TOP) -f Makefile.mingw libgaim.dll.a
+$(OBJECTS): $(GAIM_CONFIG_H)
 
-##
-## BUILD DLL
-##
-
-$(TARGET).dll: $(OBJECTS) $(LIBGAIM_TOP)/libgaim.dll.a
+$(TARGET).dll: $(GAIM_LIBGAIM_DLL).a $(OBJECTS)
 	$(CC) -shared $(OBJECTS) $(LIB_PATHS) $(LIBS) $(DLL_LD_FLAGS) -o $(TARGET).dll
 
 ##
 ## CLEAN RULES
 ##
+clean:
+	rm -rf $(OBJECTS)
+	rm -rf $(TARGET).dll
 
-clean:
-	rm -rf *.o
-	rm -rf ./win32/*.o
-	rm -rf $(TARGET).dll
+include $(GAIM_COMMON_TARGETS)
--- a/libgaim/protocols/msn/Makefile.mingw	Wed Aug 23 18:50:46 2006 +0000
+++ b/libgaim/protocols/msn/Makefile.mingw	Wed Aug 23 21:34:43 2006 +0000
@@ -4,66 +4,38 @@
 # Description: Makefile for win32 (mingw) version of libmsn
 #
 
-#
-# PATHS
-#
-
-GTK_TOP :=		../../../../win32-dev/gtk_2_0
-GAIM_TOP :=		../../..
-LIBGAIM_TOP :=		../..
-MSN_ROOT :=		.
-GAIM_INSTALL_DIR :=	$(GAIM_TOP)/win32-install-dir
-
-##
-## VARIABLE DEFINITIONS
-##
+GAIM_TOP := ../../..
+include $(GAIM_TOP)/libgaim/win32/global.mak
 
 TARGET = libmsn
 
-# Compiler Options
-
-CFLAGS =
-
-DEFINES =
-
 # Static or Plugin... 
 ifeq ($(TYPE),STATIC)
   DEFINES += -DSTATIC
   DLL_INSTALL_DIR =	$(GAIM_INSTALL_DIR)
 else
 ifeq ($(TYPE),PLUGIN)
-  DLL_INSTALL_DIR =	$(GAIM_INSTALL_DIR)/plugins
+  DLL_INSTALL_DIR =	$(GAIM_INSTALL_PLUGINS_DIR)
 endif
 endif
 
-
-##
-## INCLUDE  MAKEFILES
-##
-
-include $(LIBGAIM_TOP)/win32/global.mak
-
 ##
 ## INCLUDE PATHS
 ##
-
-INCLUDE_PATHS +=	-I$(MSN_ROOT) \
+INCLUDE_PATHS +=	-I. \
 			-I$(GTK_TOP)/include \
 			-I$(GTK_TOP)/include/glib-2.0 \
 			-I$(GTK_TOP)/lib/glib-2.0/include \
-			-I$(LIBGAIM_TOP) \
-			-I$(LIBGAIM_TOP)/win32 \
+			-I$(GAIM_LIB_TOP) \
+			-I$(GAIM_LIB_TOP)/win32 \
 			-I$(GAIM_TOP)
 
-
 LIB_PATHS =		-L$(GTK_TOP)/lib \
-			-L$(LIBGAIM_TOP)
-
+			-L$(GAIM_LIB_TOP)
 
 ##
 ##  SOURCES, OBJECTS
 ##
-
 C_SRC =			cmdproc.c \
 			command.c \
 			dialog.c \
@@ -94,61 +66,39 @@
 			userlist.c \
 			msn-utils.c
 
-
 OBJECTS = $(C_SRC:%.c=%.o)
 
-
 ##
 ## LIBRARIES
 ##
-
 LIBS =	\
 			-lglib-2.0 \
 			-lintl \
 			-lws2_32 \
 			-lgaim
 
-
-##
-## RULES
-##
-
-# How to make a C file
-
-%.o: %.c
-	$(CC) $(CFLAGS) $(DEFINES) $(INCLUDE_PATHS) -o $@ -c $<
+include $(GAIM_COMMON_RULES)
 
 ##
 ## TARGET DEFINITIONS
 ##
-
 .PHONY: all clean
 
 all: $(TARGET).dll
 
-install:
-	cp $(MSN_ROOT)/$(TARGET).dll $(DLL_INSTALL_DIR)
-
-
-##
-## BUILD Dependencies
-##
+install: all $(DLL_INSTALL_DIR)
+	cp $(TARGET).dll $(DLL_INSTALL_DIR)
 
-$(LIBGAIM_TOP)/libgaim.dll.a:
-	$(MAKE) -C $(LIBGAIM_TOP) -f Makefile.mingw libgaim.dll.a
+$(OBJECTS): $(GAIM_CONFIG_H)
 
-##
-## BUILD DLL
-##
-
-$(TARGET).dll: $(OBJECTS) $(LIBGAIM_TOP)/libgaim.dll.a
+$(TARGET).dll: $(GAIM_LIBGAIM_DLL).a $(OBJECTS)
 	$(CC) -shared $(OBJECTS) $(LIB_PATHS) $(LIBS) $(DLL_LD_FLAGS) -o $(TARGET).dll
 
-
 ##
 ## CLEAN RULES
 ##
+clean:
+	rm -rf $(OBJECTS)
+	rm -rf $(TARGET).dll
 
-clean:
-	rm -rf *.o
-	rm -rf $(TARGET).dll
+include $(GAIM_COMMON_TARGETS)
--- a/libgaim/protocols/novell/Makefile.mingw	Wed Aug 23 18:50:46 2006 +0000
+++ b/libgaim/protocols/novell/Makefile.mingw	Wed Aug 23 21:34:43 2006 +0000
@@ -4,66 +4,38 @@
 # Description: Makefile for win32 (mingw) version of libnovell
 #
 
-#
-# PATHS
-#
-
-GTK_TOP :=		../../../../win32-dev/gtk_2_0
-GAIM_TOP :=		../../..
-LIBGAIM_TOP :=		../../.
-NOVELL_ROOT :=		.
-GAIM_INSTALL_DIR :=	$(GAIM_TOP)/win32-install-dir
-
-##
-## VARIABLE DEFINITIONS
-##
+GAIM_TOP := ../../..
+include $(GAIM_TOP)/libgaim/win32/global.mak
 
 TARGET = libnovell
 
-# Compiler Options
-
-CFLAGS =
-
-DEFINES =
-
 # Static or Plugin...
 ifeq ($(TYPE),STATIC)
   DEFINES += -DSTATIC
   DLL_INSTALL_DIR =	$(GAIM_INSTALL_DIR)
 else
 ifeq ($(TYPE),PLUGIN)
-  DLL_INSTALL_DIR =	$(GAIM_INSTALL_DIR)/plugins
+  DLL_INSTALL_DIR =	$(GAIM_INSTALL_PLUGINS_DIR)
 endif
 endif
 
-
-##
-## INCLUDE  MAKEFILES
-##
-
-include $(LIBGAIM_TOP)/win32/global.mak
-
 ##
 ## INCLUDE PATHS
 ##
-
-INCLUDE_PATHS +=	-I$(NOVELL_ROOT) \
+INCLUDE_PATHS +=	-I. \
 			-I$(GTK_TOP)/include \
 			-I$(GTK_TOP)/include/glib-2.0 \
 			-I$(GTK_TOP)/lib/glib-2.0/include \
-			-I$(LIBGAIM_TOP) \
-			-I$(LIBGAIM_TOP)/win32 \
+			-I$(GAIM_LIB_TOP) \
+			-I$(GAIM_LIB_TOP)/win32 \
 			-I$(GAIM_TOP)
 
-
 LIB_PATHS =		-L$(GTK_TOP)/lib \
-			-L$(LIBGAIM_TOP)
-
+			-L$(GAIM_LIB_TOP)
 
 ##
 ##  SOURCES, OBJECTS
 ##
-
 C_SRC =	\
 		nmfield.c \
 		nmconn.c \
@@ -79,58 +51,37 @@
 
 OBJECTS = $(C_SRC:%.c=%.o)
 
-
 ##
 ## LIBRARIES
 ##
-
 LIBS =	\
 			-lglib-2.0 \
 			-lws2_32 \
 			-lintl \
 			-lgaim
 
-
-##
-## RULES
-##
-
-# How to make a C file
-
-%.o: %.c
-	$(CC) $(CFLAGS) $(DEFINES) $(INCLUDE_PATHS) -o $@ -c $<
+include $(GAIM_COMMON_RULES)
 
 ##
 ## TARGET DEFINITIONS
 ##
-
 .PHONY: all clean
 
 all: $(TARGET).dll
 
-install:
-	cp $(NOVELL_ROOT)/$(TARGET).dll $(DLL_INSTALL_DIR)
-
-
-##
-## BUILD Dependencies
-##
+install: all $(DLL_INSTALL_DIR)
+	cp $(TARGET).dll $(DLL_INSTALL_DIR)
 
-$(LIBGAIM_TOP)/libgaim.dll.a:
-	$(MAKE) -C $(LIBGAIM_TOP) -f Makefile.mingw libgaim.dll.a
+$(OBJECTS): $(GAIM_CONFIG_H)
 
-##
-## BUILD DLL
-##
-
-$(TARGET).dll: $(OBJECTS) $(LIBGAIM_TOP)/libgaim.dll.a
+$(TARGET).dll: $(GAIM_LIBGAIM_DLL).a $(OBJECTS)
 	$(CC) -shared $(OBJECTS) $(LIB_PATHS) $(LIBS) $(DLL_LD_FLAGS) -o $(TARGET).dll
 
-
 ##
 ## CLEAN RULES
 ##
+clean:
+	rm -rf $(OBJECTS)
+	rm -rf $(TARGET).dll
 
-clean:
-	rm -rf *.o
-	rm -rf $(TARGET).dll
+include $(GAIM_COMMON_TARGETS)
--- a/libgaim/protocols/oscar/Makefile.mingw	Wed Aug 23 18:50:46 2006 +0000
+++ b/libgaim/protocols/oscar/Makefile.mingw	Wed Aug 23 21:34:43 2006 +0000
@@ -4,66 +4,38 @@
 # Description: Makefile for win32 (mingw) version of liboscar
 #
 
-#
-# PATHS
-#
-
-OSCAR_ROOT :=		.
-GTK_TOP :=		../../../../win32-dev/gtk_2_0
-GAIM_TOP :=		../../..
-LIBGAIM_TOP :=		../..
-GAIM_INSTALL_DIR :=	$(GAIM_TOP)/win32-install-dir
-
-##
-## VARIABLE DEFINITIONS
-##
+GAIM_TOP := ../../..
+include $(GAIM_TOP)/libgaim/win32/global.mak
 
 TARGET = liboscar
 
-# Compiler Options
-
-CFLAGS =
-
-DEFINES =
-
 # Static or Plugin...
 ifeq ($(TYPE),STATIC)
   DEFINES += -DSTATIC
   DLL_INSTALL_DIR =		$(GAIM_INSTALL_DIR)
 else
   ifeq ($(TYPE),PLUGIN)
-    DLL_INSTALL_DIR =	$(GAIM_INSTALL_DIR)/plugins
+    DLL_INSTALL_DIR =	$(GAIM_INSTALL_PLUGINS_DIR)
   endif
 endif
 
-
-##
-## INCLUDE  MAKEFILES
-##
-
-include $(LIBGAIM_TOP)/win32/global.mak
-
 ##
 ## INCLUDE PATHS
 ##
-
-INCLUDE_PATHS +=	-I$(OSCAR_ROOT) \
+INCLUDE_PATHS +=	-I. \
 			-I$(GTK_TOP)/include \
 			-I$(GTK_TOP)/include/glib-2.0 \
 			-I$(GTK_TOP)/lib/glib-2.0/include \
-			-I$(LIBGAIM_TOP) \
-			-I$(LIBGAIM_TOP)/win32 \
+			-I$(GAIM_LIB_TOP) \
+			-I$(GAIM_LIB_TOP)/win32 \
 			-I$(GAIM_TOP)
 
-
 LIB_PATHS =		-L$(GTK_TOP)/lib \
-			-L$(LIBGAIM_TOP)
-
+			-L$(GAIM_LIB_TOP)
 
 ##
 ##  SOURCES, OBJECTS
 ##
-
 C_SRC = \
 	bstream.c		\
 	family_admin.c		\
@@ -100,60 +72,39 @@
 	tlv.c			\
 	util.c
 
-
 OBJECTS = $(C_SRC:%.c=%.o)
 
-
 ##
 ## LIBRARIES
 ##
-
 LIBS =	\
 			-lglib-2.0 \
 			-lintl \
 			-lws2_32 \
 			-lgaim
 
-
-##
-## RULES
-##
-
-# How to make a C file
-
-%.o: %.c
-	$(CC) $(CFLAGS) $(DEFINES) $(INCLUDE_PATHS) -o $@ -c $<
+include $(GAIM_COMMON_RULES)
 
 ##
 ## TARGET DEFINITIONS
 ##
-
 .PHONY: all clean
 
 all: $(TARGET).dll
 
-install:
-	cp $(OSCAR_ROOT)/$(TARGET).dll $(DLL_INSTALL_DIR)
-
-
-##
-## BUILD Dependencies
-##
+install: all $(DLL_INSTALL_DIR)
+	cp $(TARGET).dll $(DLL_INSTALL_DIR)
 
-$(LIBGAIM_TOP)/libgaim.dll.a:
-	$(MAKE) -C $(LIBGAIM_TOP) -f Makefile.mingw libgaim.dll.a
+$(OBJECTS): $(GAIM_CONFIG_H)
 
-##
-## BUILD DLL
-##
-
-$(TARGET).dll: $(OBJECTS) $(LIBGAIM_TOP)/libgaim.dll.a
+$(TARGET).dll: $(GAIM_LIBGAIM_DLL).a $(OBJECTS)
 	$(CC) -shared $(OBJECTS) $(LIB_PATHS) $(LIBS) $(DLL_LD_FLAGS) -o $(TARGET).dll
 
 ##
 ## CLEAN RULES
 ##
+clean:
+	rm -rf $(OBJECTS)
+	rm -rf $(TARGET).dll
 
-clean:
-	rm -rf *.o
-	rm -rf $(TARGET).dll
+include $(GAIM_COMMON_TARGETS)
--- a/libgaim/protocols/qq/Makefile.mingw	Wed Aug 23 18:50:46 2006 +0000
+++ b/libgaim/protocols/qq/Makefile.mingw	Wed Aug 23 21:34:43 2006 +0000
@@ -4,33 +4,14 @@
 # Description: Makefile for win32 (mingw) version of OpenQ src
 #
 
-#
-# PATHS
-#
-
-INCLUDE_DIR :=		.
-OPENQ_TOP :=		../
-GTK_TOP :=		../../../../win32-dev/gtk_2_0
-GAIM_TOP :=		../../..
-LIBGAIM_TOP :=		../..
-OPENQ_ROOT :=		.
-GAIM_INSTALL_DIR :=	$(GAIM_TOP)/win32-install-dir
-
-##
-## VARIABLE DEFINITIONS
-##
+GAIM_TOP := ../../..
+include $(GAIM_TOP)/libgaim/win32/global.mak
 
 TARGET = openq
-
+OPENQ_TOP := ..
 TYPE = PLUGIN
-
 OPENQ_VERSION := $(shell cat $(OPENQ_TOP)/VERSION)
-
-# Compiler Options
-
-CFLAGS =
-
-DEFINES = -DOPENQ_VERSION=\"$(OPENQ_VERSION)\"
+DEFINES += -DOPENQ_VERSION=\"$(OPENQ_VERSION)\"
 
 # Static or Plugin...
 ifeq ($(TYPE),STATIC)
@@ -38,38 +19,29 @@
 	DLL_INSTALL_DIR =	$(GAIM_INSTALL_DIR)
 else
 ifeq ($(TYPE),PLUGIN)
-	DLL_INSTALL_DIR =	$(GAIM_INSTALL_DIR)/plugins
+	DLL_INSTALL_DIR =	$(GAIM_INSTALL_PLUGINS_DIR)
 endif
 endif
 
-
-##
-## INCLUDE  MAKEFILES
-##
-
-include $(LIBGAIM_TOP)/win32/global.mak
-
 ##
 ## INCLUDE PATHS
 ##
-
 INCLUDE_PATHS += \
 	-I$(OPENQ_ROOT) \
 	-I$(GTK_TOP)/include \
 	-I$(GTK_TOP)/include/glib-2.0 \
 	-I$(GTK_TOP)/lib/glib-2.0/include \
-	-I$(LIBGAIM_TOP) \
-	-I$(LIBGAIM_TOP)/win32 \
+	-I$(GAIM_LIB_TOP) \
+	-I$(GAIM_LIB_TOP)/win32 \
 	-I$(GAIM_TOP)
 
 LIB_PATHS = \
 	-L$(GTK_TOP)/lib \
-	-L$(LIBGAIM_TOP)
+	-L$(GAIM_LIB_TOP)
 
 ##
 ##  SOURCES, OBJECTS
 ##
-
 C_SRC = \
 	buddy_info.c \
 	buddy_list.c \
@@ -111,54 +83,34 @@
 ##
 ## LIBRARIES
 ##
-
 LIBS = \
 	-lglib-2.0 \
 	-lws2_32 \
 	-lintl \
 	-lgaim
 
-##
-## RULES
-##
-
-# How to make a C file
-
-%.o: %.c
-	$(CC) $(CFLAGS) $(DEFINES) $(INCLUDE_PATHS) -o $@ -c $<
+include $(GAIM_COMMON_RULES)
 
 ##
 ## TARGET DEFINITIONS
 ##
-
 .PHONY: all clean
 
 all: $(TARGET).dll
 
-install:
-	mkdir -p $(DLL_INSTALL_DIR)
-	cp $(OPENQ_ROOT)/$(TARGET).dll $(DLL_INSTALL_DIR)
-
-
-##
-## BUILD Dependencies
-##
+install: all $(DLL_INSTALL_DIR)
+	cp $(TARGET).dll $(DLL_INSTALL_DIR)
 
-$(LIBGAIM_TOP)/libgaim.dll.a:
-	$(MAKE) -C $(LIBGAIM_TOP) -f Makefile.mingw libgaim.dll.a
+$(OBJECTS): $(GAIM_CONFIG_H)
 
-##
-## BUILD DLL
-##
-
-$(TARGET).dll: $(OBJECTS) $(LIBGAIM_TOP)/libgaim.dll.a
+$(TARGET).dll: $(GAIM_LIBGAIM_DLL).a $(OBJECTS)
 	$(CC) -shared $(OBJECTS) $(LIB_PATHS) $(LIBS) $(DLL_LD_FLAGS) -o $(TARGET).dll
 
 ##
 ## CLEAN RULES
 ##
-
 clean:
-	rm -rf *.o
+	rm -rf $(OBJECTS)
 	rm -rf $(TARGET).dll
 
+include $(GAIM_COMMON_TARGETS)
--- a/libgaim/protocols/sametime/Makefile.mingw	Wed Aug 23 18:50:46 2006 +0000
+++ b/libgaim/protocols/sametime/Makefile.mingw	Wed Aug 23 21:34:43 2006 +0000
@@ -4,79 +4,48 @@
 # Description: Makefile for win32 (mingw) version of libsametime
 #
 
-#
-# PATHS
-#
-
-SAMETIME_ROOT :=	.
-GTK_TOP :=		../../../../win32-dev/gtk_2_0
-MEANWHILE_TOP:=		../../../../win32-dev/meanwhile-1.0.2
-GAIM_TOP :=		../../..
-LIBGAIM_TOP :=		../..
-GAIM_INSTALL_DIR :=	$(GAIM_TOP)/win32-install-dir
-
-##
-## VARIABLE DEFINITIONS
-##
+GAIM_TOP := ../../..
+include $(GAIM_TOP)/libgaim/win32/global.mak
 
 TARGET = libsametime
-
 NEEDED_DLLS = $(MEANWHILE_TOP)/bin/libmeanwhile-1.dll
 
-# Compiler Options
-
-CFLAGS =
-
-DEFINES =
-
 # Static or Plugin...
 ifeq ($(TYPE),STATIC)
   DEFINES += -DSTATIC
   DLL_INSTALL_DIR = 	$(GAIM_INSTALL_DIR)
 else
   ifeq ($(TYPE),PLUGIN)
-    DLL_INSTALL_DIR = 	$(GAIM_INSTALL_DIR)/plugins
+    DLL_INSTALL_DIR = 	$(GAIM_INSTALL_PLUGINS_DIR)
   endif
 endif
 
-
-##
-## INCLUDE  MAKEFILES
-##
-
-include $(LIBGAIM_TOP)/win32/global.mak
-
 ##
 ## INCLUDE PATHS
 ##
-
-INCLUDE_PATHS +=	-I$(SAMETIME_ROOT) \
+INCLUDE_PATHS +=	-I. \
 			-I$(MEANWHILE_TOP)/include/meanwhile \
 			-I$(GTK_TOP)/include \
 			-I$(GTK_TOP)/include/glib-2.0 \
 			-I$(GTK_TOP)/lib/glib-2.0/include \
-			-I$(LIBGAIM_TOP) \
-			-I$(LIBGAIM_TOP)/win32 \
+			-I$(GAIM_LIB_TOP) \
+			-I$(GAIM_LIB_TOP)/win32 \
 			-I$(GAIM_TOP)
 
 LIB_PATHS =		-L$(GTK_TOP)/lib \
 			-L$(MEANWHILE_TOP)/lib \
-			-L$(LIBGAIM_TOP)
-
+			-L$(GAIM_LIB_TOP)
 
 ##
 ##  SOURCES, OBJECTS
 ##
-
 C_SRC =		sametime.c
 
 OBJECTS = $(C_SRC:%.c=%.o)
 
-
 ##
 ## LIBRARIES
 ##
-
 LIBS =		\
 		-lglib-2.0 \
 		-lintl \
@@ -84,40 +53,22 @@
 		-lmeanwhile \
 		-lgaim \
 
-##
-## RULES
-##
-
-# How to make a C file
-
-%.o: %.c
-	$(CC) $(CFLAGS) $(DEFINES) $(INCLUDE_PATHS) -o $@ -c $<
+include $(GAIM_COMMON_RULES)
 
 ##
 ## TARGET DEFINITIONS
 ##
-
 .PHONY: all clean
 
 all: $(TARGET).dll
 
-install:
-	cp $(SAMETIME_ROOT)/$(TARGET).dll $(DLL_INSTALL_DIR)
+install: all $(DLL_INSTALL_DIR) $(GAIM_INSTALL_DIR)
+	cp $(TARGET).dll $(DLL_INSTALL_DIR)
 	cp $(NEEDED_DLLS) $(GAIM_INSTALL_DIR)
 
-
-##
-## BUILD Dependencies
-##
+$(OBJECTS): $(GAIM_CONFIG_H)
 
-$(LIBGAIM_TOP)/libgaim.dll.a:
-	$(MAKE) -C $(LIBGAIM_TOP) -f Makefile.mingw libgaim.dll.a
-
-##
-## BUILD DLL
-##
-
-$(TARGET).dll: $(OBJECTS) $(LIBGAIM_TOP)/libgaim.dll.a
+$(TARGET).dll: $(GAIM_LIBGAIM_DLL).a $(OBJECTS)
 	$(CC) -shared $(OBJECTS) $(LIB_PATHS) $(LIBS) $(DLL_LD_FLAGS) -o $(TARGET).dll
 
 ##
@@ -125,5 +76,7 @@
 ##
 
 clean:
-	rm -rf *.o
+	rm -rf $(OBJECTS)
 	rm -rf $(TARGET).dll
+
+include $(GAIM_COMMON_TARGETS)
--- a/libgaim/protocols/silc/Makefile.mingw	Wed Aug 23 18:50:46 2006 +0000
+++ b/libgaim/protocols/silc/Makefile.mingw	Wed Aug 23 21:34:43 2006 +0000
@@ -4,72 +4,42 @@
 # Description: Makefile for win32 (mingw) version of libsilc protocol plugin
 #
 
-#
-# PATHS
-#
-
-GTK_TOP :=		../../../../win32-dev/gtk_2_0
-GAIM_TOP :=		../../..
-LIBGAIM_TOP :=		../..
-SILC_TOP :=		.
-GAIM_INSTALL_DIR :=	$(GAIM_TOP)/win32-install-dir
-SILC_TOOLKIT :=		../../../../win32-dev/silc-toolkit-1.0.2
-
-##
-## VARIABLE DEFINITIONS
-##
+GAIM_TOP := ../../..
+include $(GAIM_TOP)/libgaim/win32/global.mak
 
 TARGET = libsilc
-
 NEEDED_DLLS =		$(SILC_TOOLKIT)/lib/silc.dll \
 			$(SILC_TOOLKIT)/lib/silcclient.dll
 
-# Compiler Options
-
-CFLAGS =
-
-DEFINES =
-
 # Static or Plugin...
 ifeq ($(TYPE),STATIC)
   DEFINES += -DSTATIC
   DLL_INSTALL_DIR =	$(GAIM_INSTALL_DIR)
 else
 ifeq ($(TYPE),PLUGIN)
-  DLL_INSTALL_DIR =	$(GAIM_INSTALL_DIR)/plugins
+  DLL_INSTALL_DIR =	$(GAIM_INSTALL_PLUGINS_DIR)
 endif
 endif
 
-
-##
-## INCLUDE  MAKEFILES
-##
-
-include $(LIBGAIM_TOP)/win32/global.mak
-
 ##
 ## INCLUDE PATHS
 ##
-
-INCLUDE_PATHS +=	-I$(SILC_TOP) \
+INCLUDE_PATHS +=	-I. \
 			-I$(GTK_TOP)/include \
 			-I$(GTK_TOP)/include/glib-2.0 \
 			-I$(GTK_TOP)/lib/glib-2.0/include \
-			-I$(LIBGAIM_TOP) \
-			-I$(LIBGAIM_TOP)/win32 \
+			-I$(GAIM_LIB_TOP) \
+			-I$(GAIM_LIB_TOP)/win32 \
 			-I$(GAIM_TOP) \
 			-I$(SILC_TOOLKIT)/include
 
-
 LIB_PATHS =		-L$(GTK_TOP)/lib \
-			-L$(LIBGAIM_TOP) \
+			-L$(GAIM_LIB_TOP) \
 			-L$(SILC_TOOLKIT)/lib
 
-
 ##
 ##  SOURCES, OBJECTS
 ##
-
 C_SRC =			silc.c \
 			buddy.c \
 			chat.c \
@@ -79,14 +49,11 @@
 			util.c \
 			wb.c
 
-
 OBJECTS = $(C_SRC:%.c=%.o)
 
-
 ##
 ## LIBRARIES
 ##
-
 LIBS = \
 			-lglib-2.0 \
 			-lws2_32 \
@@ -95,47 +62,29 @@
 			-lsilc \
 			-lsilcclient
 
-
-##
-## RULES
-##
-
-# How to make a C file
-
-%.o: %.c
-	$(CC) $(CFLAGS) $(DEFINES) $(INCLUDE_PATHS) -o $@ -c $<
+include $(GAIM_COMMON_RULES)
 
 ##
 ## TARGET DEFINITIONS
 ##
-
 .PHONY: all clean
 
 all: $(TARGET).dll
 
-install:
-	cp $(SILC_TOP)/$(TARGET).dll $(DLL_INSTALL_DIR)
+install: all $(DLL_INSTALL_DIR) $(GAIM_INSTALL_DIR)
+	cp $(TARGET).dll $(DLL_INSTALL_DIR)
 	cp $(NEEDED_DLLS) $(GAIM_INSTALL_DIR)
 
-
-##
-## BUILD Dependencies
-##
+$(OBJECTS): $(GAIM_CONFIG_H)
 
-$(LIBGAIM_TOP)/libgaim.dll.a:
-	$(MAKE) -C $(LIBGAIM_TOP) -f Makefile.mingw libgaim.dll.a
-
-##
-## BUILD DLL
-##
-
-$(TARGET).dll: $(OBJECTS) $(LIBGAIM_TOP)/libgaim.dll.a
+$(TARGET).dll: $(GAIM_LIBGAIM_DLL).a $(OBJECTS)
 	$(CC) -shared $(OBJECTS) $(LIB_PATHS) $(LIBS) $(DLL_LD_FLAGS) -Wl,--image-base,0x64000000 -o $(TARGET).dll
 
 ##
 ## CLEAN RULES
 ##
+clean:
+	rm -rf $(OBJECTS)
+	rm -rf $(TARGET).dll
 
-clean:
-	rm -rf *.o
-	rm -rf $(TARGET).dll
+include $(GAIM_COMMON_TARGETS)
--- a/libgaim/protocols/simple/Makefile.mingw	Wed Aug 23 18:50:46 2006 +0000
+++ b/libgaim/protocols/simple/Makefile.mingw	Wed Aug 23 21:34:43 2006 +0000
@@ -4,77 +4,46 @@
 # Description: Makefile for win32 (mingw) version of libsimple
 #
 
-#
-# PATHS
-#
-
-GTK_TOP :=		../../../../win32-dev/gtk_2_0
-GAIM_TOP :=		../../..
-LIBGAIM_TOP :=		../..
-SIMPLE_ROOT :=		.
-GAIM_INSTALL_DIR :=	$(GAIM_TOP)/win32-install-dir
-
-##
-## VARIABLE DEFINITIONS
-##
+GAIM_TOP := ../../..
+include $(GAIM_TOP)/libgaim/win32/global.mak
 
 TARGET = libsimple
 
-# Compiler Options
-
-CFLAGS =
-
-DEFINES =
-
 # Static or Plugin...
 ifeq ($(TYPE),STATIC)
   DEFINES += -DSTATIC
   DLL_INSTALL_DIR =	$(GAIM_INSTALL_DIR)
 else
 ifeq ($(TYPE),PLUGIN)
-  DLL_INSTALL_DIR =	$(GAIM_INSTALL_DIR)/plugins
+  DLL_INSTALL_DIR =	$(GAIM_INSTALL_PLUGINS_DIR)
 endif
 endif
 
-
-##
-## INCLUDE  MAKEFILES
-##
-
-include $(LIBGAIM_TOP)/win32/global.mak
-
 ##
 ## INCLUDE PATHS
 ##
-
-INCLUDE_PATHS +=	-I$(SIMPLE_ROOT) \
+INCLUDE_PATHS +=	-I. \
 			-I$(GTK_TOP)/include \
 			-I$(GTK_TOP)/include/glib-2.0 \
 			-I$(GTK_TOP)/lib/glib-2.0/include \
-			-I$(LIBGAIM_TOP) \
-			-I$(LIBGAIM_TOP)/win32 \
+			-I$(GAIM_LIB_TOP) \
+			-I$(GAIM_LIB_TOP)/win32 \
 			-I$(GAIM_TOP)
 
-
 LIB_PATHS =		-L$(GTK_TOP)/lib \
-			-L$(LIBGAIM_TOP)
-
+			-L$(GAIM_LIB_TOP)
 
 ##
 ##  SOURCES, OBJECTS
 ##
-
 C_SRC =			simple.c \
 			sipmsg.c
 
-
 OBJECTS = $(C_SRC:%.c=%.o)
 
-
 ##
 ## LIBRARIES
 ##
-
 LIBS =	\
 			-lglib-2.0 \
 			-lgobject-2.0 \
@@ -82,47 +51,28 @@
 			-lintl \
 			-lgaim
 
-
-##
-## RULES
-##
-
-# How to make a C file
-
-%.o: %.c
-	$(CC) $(CFLAGS) $(DEFINES) $(INCLUDE_PATHS) -o $@ -c $<
+include $(GAIM_COMMON_RULES)
 
 ##
 ## TARGET DEFINITIONS
 ##
-
 .PHONY: all clean
 
 all: $(TARGET).dll
 
-install:
-	cp $(SIMPLE_ROOT)/$(TARGET).dll $(DLL_INSTALL_DIR)
-
-
-##
-## BUILD Dependencies
-##
+install: all $(DLL_INSTALL_DIR)
+	cp $(TARGET).dll $(DLL_INSTALL_DIR)
 
-$(LIBGAIM_TOP)/libgaim.dll.a:
-	$(MAKE) -C $(LIBGAIM_TOP) -f Makefile.mingw libgaim.dll.a
+$(OBJECTS): $(GAIM_CONFIG_H)
 
-##
-## BUILD DLL
-##
-
-$(TARGET).dll: $(OBJECTS) $(LIBGAIM_TOP)/libgaim.dll.a
+$(TARGET).dll: $(GAIM_LIBGAIM_DLL).a $(OBJECTS)
 	$(CC) -shared $(OBJECTS) $(LIB_PATHS) $(LIBS) $(DLL_LD_FLAGS) -o $(TARGET).dll
 
-
 ##
 ## CLEAN RULES
 ##
+clean:
+	rm -rf $(OBJECTS)
+	rm -rf $(TARGET).dll
 
-clean:
-	rm -rf *.o
-	rm -rf $(TARGET).dll
+include $(GAIM_COMMON_TARGETS)
--- a/libgaim/protocols/toc/Makefile.mingw	Wed Aug 23 18:50:46 2006 +0000
+++ b/libgaim/protocols/toc/Makefile.mingw	Wed Aug 23 21:34:43 2006 +0000
@@ -4,50 +4,24 @@
 # Description: Makefile for win32 (mingw) version of libtoc
 #
 
-#
-# PATHS
-#
-
-INCLUDE_DIR :=		.
-GTK_TOP :=		../../../../win32-dev/gtk_2_0
-GAIM_TOP :=		../../..
-LIBGAIM_TOP :=		../..
-TOC_ROOT :=		.
-GAIM_INSTALL_DIR :=	$(GAIM_TOP)/win32-install-dir
-
-##
-## VARIABLE DEFINITIONS
-##
+GAIM_TOP := ../../..
+include $(GAIM_TOP)/libgaim/win32/global.mak
 
 TARGET = libtoc
 
-# Compiler Options
-
-CFLAGS =
-
-DEFINES =
-
 # Static or Plugin...
 ifeq ($(TYPE),STATIC)
   DEFINES += -DSTATIC
   DLL_INSTALL_DIR =	$(GAIM_INSTALL_DIR)
 else
 ifeq ($(TYPE),PLUGIN)
-  DLL_INSTALL_DIR =	$(GAIM_INSTALL_DIR)/plugins
+  DLL_INSTALL_DIR =	$(GAIM_INSTALL_PLUGINS_DIR)
 endif
 endif
 
-
-##
-## INCLUDE  MAKEFILES
-##
-
-include $(LIBGAIM_TOP)/win32/global.mak
-
 ##
 ## INCLUDE PATHS
 ##
-
 INCLUDE_PATHS +=	-I$(TOC_ROOT) \
 			-I$(GTK_TOP)/include \
 			-I$(GTK_TOP)/include/glib-2.0 \
@@ -56,39 +30,26 @@
 			-I$(LIBGAIM_TOP)/win32 \
 			-I$(GAIM_TOP)
 
-
 LIB_PATHS =		-L$(GTK_TOP)/lib \
 			-L$(LIBGAIM_TOP)
 
-
 ##
 ##  SOURCES, OBJECTS
 ##
-
 C_SRC =			toc.c
 
-
 OBJECTS = $(C_SRC:%.c=%.o)
 
-
 ##
 ## LIBRARIES
 ##
-
 LIBS =	\
 			-lglib-2.0 \
 			-lws2_32 \
 			-lintl \
 			-lgaim
 
-##
-## RULES
-##
-
-# How to make a C file
-
-%.o: %.c
-	$(CC) $(CFLAGS) $(DEFINES) $(INCLUDE_PATHS) -o $@ -c $<
+include $(GAIM_COMMON_RULES)
 
 ##
 ## TARGET DEFINITIONS
@@ -98,29 +59,19 @@
 
 all: $(TARGET).dll
 
-install:
-	cp $(TOC_ROOT)/$(TARGET).dll $(DLL_INSTALL_DIR)
-
-
-##
-## BUILD Dependencies
-##
+install: all $(DLL_INSTALL_DIR)
+	cp $(TARGET).dll $(DLL_INSTALL_DIR)
 
-$(LIBGAIM_TOP)/libgaim.dll.a:
-	$(MAKE) -C $(LIBGAIM_TOP) -f Makefile.mingw libgaim.dll.a
+$(OBJECTS): $(GAIM_CONFIG_H)
 
-##
-## BUILD DLL
-##
-
-$(TARGET).dll: $(OBJECTS) $(LIBGAIM_TOP)/libgaim.dll.a
+$(TARGET).dll: $(GAIM_LIBGAIM_DLL).a $(OBJECTS)
 	$(CC) -shared $(OBJECTS) $(LIB_PATHS) $(LIBS) $(DLL_LD_FLAGS) -o $(TARGET).dll
 
-
 ##
 ## CLEAN RULES
 ##
+clean:
+	rm -rf $(OBJECTS)
+	rm -rf $(TARGET).dll
 
-clean:
-	rm -rf *.o
-	rm -rf $(TARGET).dll
+include $(GAIM_COMMON_TARGETS)
--- a/libgaim/protocols/yahoo/Makefile.mingw	Wed Aug 23 18:50:46 2006 +0000
+++ b/libgaim/protocols/yahoo/Makefile.mingw	Wed Aug 23 21:34:43 2006 +0000
@@ -4,66 +4,38 @@
 # Description: Makefile for win32 (mingw) version of libyahoo
 #
 
-#
-# PATHS
-#
-
-GTK_TOP :=		../../../../win32-dev/gtk_2_0
-GAIM_TOP :=		../../..
-LIBGAIM_TOP :=		../..
-YAHOO_ROOT :=		.
-GAIM_INSTALL_DIR :=	$(GAIM_TOP)/win32-install-dir
-
-##
-## VARIABLE DEFINITIONS
-##
+GAIM_TOP := ../../..
+include $(GAIM_TOP)/libgaim/win32/global.mak
 
 TARGET = libyahoo
 
-# Compiler Options
-
-CFLAGS =
-
-DEFINES =
-
 # Static or Plugin...
 ifeq ($(TYPE),STATIC)
   DEFINES += -DSTATIC
   DLL_INSTALL_DIR =	$(GAIM_INSTALL_DIR)
 else
 ifeq ($(TYPE),PLUGIN)
-  DLL_INSTALL_DIR =	$(GAIM_INSTALL_DIR)/plugins
+  DLL_INSTALL_DIR =	$(GAIM_INSTALL_PLUGINS_DIR)
 endif
 endif
 
-
-##
-## INCLUDE  MAKEFILES
-##
-
-include $(LIBGAIM_TOP)/win32/global.mak
-
 ##
 ## INCLUDE PATHS
 ##
-
-INCLUDE_PATHS +=	-I$(YAHOO_ROOT) \
+INCLUDE_PATHS +=	-I. \
 			-I$(GTK_TOP)/include \
 			-I$(GTK_TOP)/include/glib-2.0 \
 			-I$(GTK_TOP)/lib/glib-2.0/include \
-			-I$(LIBGAIM_TOP) \
-			-I$(LIBGAIM_TOP)/win32 \
+			-I$(GAIM_LIB_TOP) \
+			-I$(GAIM_LIB_TOP)/win32 \
 			-I$(GAIM_TOP)
 
-
 LIB_PATHS =		-L$(GTK_TOP)/lib \
-			-L$(LIBGAIM_TOP)
-
+			-L$(GAIM_LIB_TOP)
 
 ##
 ##  SOURCES, OBJECTS
 ##
-
 C_SRC =			util.c \
 			yahoo.c \
 			yahoochat.c \
@@ -77,14 +49,11 @@
 			yahoo_profile.c \
 			ycht.c
 
-
 OBJECTS = $(C_SRC:%.c=%.o)
 
-
 ##
 ## LIBRARIES
 ##
-
 LIBS =			\
 			-lglib-2.0 \
 			-lgobject-2.0 \
@@ -92,15 +61,7 @@
 			-lintl \
 			-lgaim
 
-
-##
-## RULES
-##
-
-# How to make a C file
-
-%.o: %.c
-	$(CC) $(CFLAGS) $(DEFINES) $(INCLUDE_PATHS) -o $@ -c $<
+include $(GAIM_COMMON_RULES)
 
 ##
 ## TARGET DEFINITIONS
@@ -110,29 +71,19 @@
 
 all: $(TARGET).dll
 
-install:
-	cp $(YAHOO_ROOT)/$(TARGET).dll $(DLL_INSTALL_DIR)
-
-
-##
-## BUILD Dependencies
-##
+install: all $(DLL_INSTALL_DIR)
+	cp $(TARGET).dll $(DLL_INSTALL_DIR)
 
-$(LIBGAIM_TOP)/libgaim.dll.a:
-	$(MAKE) -C $(LIBGAIM_TOP) -f Makefile.mingw libgaim.dll.a
+$(OBJECTS): $(GAIM_CONFIG_H)
 
-##
-## BUILD DLL
-##
-
-$(TARGET).dll: $(OBJECTS) $(LIBGAIM_TOP)/libgaim.dll.a
+$(TARGET).dll: $(GAIM_LIBGAIM_DLL).a $(OBJECTS)
 	$(CC) -shared $(OBJECTS) $(LIB_PATHS) $(LIBS) $(DLL_LD_FLAGS) -o $(TARGET).dll
 
-
 ##
 ## CLEAN RULES
 ##
+clean:
+	rm -rf $(OBJECTS)
+	rm -rf $(TARGET).dll
 
-clean:
-	rm -rf *.o
-	rm -rf $(TARGET).dll
+include $(GAIM_COMMON_TARGETS)
--- a/libgaim/protocols/zephyr/Makefile.mingw	Wed Aug 23 18:50:46 2006 +0000
+++ b/libgaim/protocols/zephyr/Makefile.mingw	Wed Aug 23 21:34:43 2006 +0000
@@ -4,31 +4,17 @@
 # Description: Makefile for win32 (mingw) version of libzephyr
 #
 
-#
-# PATHS
-#
- 
-INCLUDE_DIR :=		.
-GTK_TOP :=		../../../../win32-dev/gtk_2_0
-GAIM_TOP :=		../../..
-LIBGAIM_TOP :=		../..
-ZEPHYR_ROOT :=		.
-KRB4_TOP :=             ../../../../win32-dev/kfw-2.6.3-final.fixed
-GAIM_INSTALL_DIR :=	$(GAIM_TOP)/win32-install-dir
-
-USE_KRB4 := false
-
-##
-## VARIABLE DEFINITIONS
-##
+GAIM_TOP := ../../..
+include $(GAIM_TOP)/libgaim/win32/global.mak
 
 TARGET = libzephyr
-
-# Compiler Options
+KRB4_TOP := $(WIN32_DEV_TOP)/kfw-2.6.3-final.fixed
+USE_KRB4 := false
+DEFINES += -DWIN32 -DKRB5_SYSTYPES__
 
-CFLAGS =
-
-DEFINES =
+ifeq ($(USE_KRB4),true)
+  DEFINES += -DZEPHYR_USES_KERBEROS
+endif
 
 # Static or Plugin...
 ifeq ($(TYPE),STATIC)
@@ -36,32 +22,19 @@
   DLL_INSTALL_DIR =	$(GAIM_INSTALL_DIR)
 else
 ifeq ($(TYPE),PLUGIN)
-  DLL_INSTALL_DIR =	$(GAIM_INSTALL_DIR)/plugins
+  DLL_INSTALL_DIR =	$(GAIM_INSTALL_PLUGINS_DIR)
 endif
 endif
 
-DEFINES += -DWIN32 -DKRB5_SYSTYPES__
-
-ifeq ($(USE_KRB4),true)
-  DEFINES += -DZEPHYR_USES_KERBEROS
-endif
-
-##
-## INCLUDE  MAKEFILES
-##
-
-include $(LIBGAIM_TOP)/win32/global.mak
-
 ##
 ## INCLUDE PATHS
 ##
-
 INCLUDE_PATHS +=	-I$(ZEPHYR_ROOT) \
 			-I$(GTK_TOP)/include \
 			-I$(GTK_TOP)/include/glib-2.0 \
 			-I$(GTK_TOP)/lib/glib-2.0/include \
-			-I$(LIBGAIM_TOP) \
-			-I$(LIBGAIM_TOP)/win32 \
+			-I$(GAIM_LIB_TOP) \
+			-I$(GAIM_LIB_TOP)/win32 \
 			-I$(GAIM_TOP)
 
 ifeq ($(USE_KRB4), true)
@@ -69,7 +42,7 @@
 endif
 
 LIB_PATHS =		-L$(GTK_TOP)/lib \
-			-L$(LIBGAIM_TOP)
+			-L$(GAIM_LIB_TOP)
 
 ifeq ($(USE_KRB4), true)
   LIB_PATHS+=-L$(KRB4_TOP)/lib/i386
@@ -78,70 +51,66 @@
 ##
 ##  SOURCES, OBJECTS
 ##
-
 C_SRC =			ZAsyncLocate.c \
 			ZCkAuth.c \
 			ZCkIfNot.c \
 			ZClosePort.c \
 			ZCmpUID.c \
 			ZCmpUIDP.c \
-ZFlsLocs.c \
-ZFlsSubs.c \
-ZFmtAuth.c \
-ZFmtList.c \
-ZFmtNotice.c \
-ZFmtRaw.c \
-ZFmtRawLst.c \
-ZFmtSmRLst.c \
-ZFmtSmRaw.c \
-ZFreeNot.c \
-ZGetLocs.c \
-ZGetSender.c \
-ZGetSubs.c \
-ZGetWGPort.c \
-ZIfNotice.c \
-ZInit.c \
-ZLocations.c \
-ZMakeAscii.c \
-ZMkAuth.c \
-ZNewLocU.c \
-ZOpenPort.c \
-ZParseNot.c \
-ZPeekIfNot.c \
-ZPeekNot.c \
-ZPeekPkt.c \
-ZPending.c \
-ZReadAscii.c \
-ZRecvNot.c \
-ZRecvPkt.c \
-ZRetSubs.c \
-ZSendList.c \
-ZSendNot.c \
-ZSendPkt.c \
-ZSendRLst.c \
-ZSendRaw.c \
-ZSetDest.c \
-ZSetFD.c \
-ZSetSrv.c \
-ZSubs.c \
-ZVariables.c \
-ZWait4Not.c \
-ZhmStat.c \
-Zinternal.c \
-error_message.c \
-et_name.c \
-init_et.c \
-zephyr_err.c \
-zephyr.c
-
+			ZFlsLocs.c \
+			ZFlsSubs.c \
+			ZFmtAuth.c \
+			ZFmtList.c \
+			ZFmtNotice.c \
+			ZFmtRaw.c \
+			ZFmtRawLst.c \
+			ZFmtSmRLst.c \
+			ZFmtSmRaw.c \
+			ZFreeNot.c \
+			ZGetLocs.c \
+			ZGetSender.c \
+			ZGetSubs.c \
+			ZGetWGPort.c \
+			ZIfNotice.c \
+			ZInit.c \
+			ZLocations.c \
+			ZMakeAscii.c \
+			ZMkAuth.c \
+			ZNewLocU.c \
+			ZOpenPort.c \
+			ZParseNot.c \
+			ZPeekIfNot.c \
+			ZPeekNot.c \
+			ZPeekPkt.c \
+			ZPending.c \
+			ZReadAscii.c \
+			ZRecvNot.c \
+			ZRecvPkt.c \
+			ZRetSubs.c \
+			ZSendList.c \
+			ZSendNot.c \
+			ZSendPkt.c \
+			ZSendRLst.c \
+			ZSendRaw.c \
+			ZSetDest.c \
+			ZSetFD.c \
+			ZSetSrv.c \
+			ZSubs.c \
+			ZVariables.c \
+			ZWait4Not.c \
+			ZhmStat.c \
+			Zinternal.c \
+			error_message.c \
+			et_name.c \
+			init_et.c \
+			zephyr_err.c \
+			zephyr.c
 
 OBJECTS = $(C_SRC:%.c=%.o)
 
-
 ##
 ## LIBRARIES
 ##
-
 LIBS =	\
 			-lglib-2.0 \
 			-lws2_32 \
@@ -152,46 +121,28 @@
   LIBS+= -lkrbv4w32
 endif
 
-##
-## RULES
-##
-
-# How to make a C file
-
-%.o: %.c
-	$(CC) $(CFLAGS) $(DEFINES) $(INCLUDE_PATHS) -o $@ -c $<
+include $(GAIM_COMMON_RULES)
 
 ##
 ## TARGET DEFINITIONS
 ##
-
 .PHONY: all clean
 
 all: $(TARGET).dll
 
-install:
-	cp $(ZEPHYR_ROOT)/$(TARGET).dll $(DLL_INSTALL_DIR)
-
-
-##
-## BUILD Dependencies
-##
+install: all $(DLL_INSTALL_DIR)
+	cp $(TARGET).dll $(DLL_INSTALL_DIR)
 
-$(LIBGAIM_TOP)/libgaim.dll.a:
-	$(MAKE) -C $(LIBGAIM_TOP) -f Makefile.mingw libgaim.dll.a
+$(OBJECTS): $(GAIM_CONFIG_H)
 
-##
-## BUILD DLL
-##
-
-$(TARGET).dll: $(OBJECTS) $(LIBGAIM_TOP)/libgaim.dll.a
+$(TARGET).dll: $(GAIM_LIBGAIM_DLL).a $(OBJECTS)
 	$(CC) -shared $(OBJECTS) $(LIB_PATHS) $(LIBS) $(DLL_LD_FLAGS) -Wl,--enable-stdcall-fixup -o $(TARGET).dll
 
-
 ##
 ## CLEAN RULES
 ##
+clean:
+	rm -rf $(OBJECTS)
+	rm -rf $(TARGET).dll
 
-clean:
-	rm -rf *.o
-	rm -rf $(TARGET).dll
+include $(GAIM_COMMON_TARGETS)
--- a/libgaim/win32/global.mak	Wed Aug 23 18:50:46 2006 +0000
+++ b/libgaim/win32/global.mak	Wed Aug 23 21:34:43 2006 +0000
@@ -2,19 +2,61 @@
 # global.mak
 #
 # This file should be included by all Makefile.mingw files for project
-# wide definitions.
+# wide definitions (after correctly defining GAIM_TOP).
 #
 
-CC = gcc.exe
+# Locations of our various dependencies
+WIN32_DEV_TOP := $(GAIM_TOP)/../win32-dev
+ASPELL_TOP := $(WIN32_DEV_TOP)/aspell-dev-0-50-3-3
+GTKSPELL_TOP := $(WIN32_DEV_TOP)/gtkspell-2.0.6
+GTK_TOP := $(WIN32_DEV_TOP)/gtk_2_0
+GTK_BIN := $(GTK_TOP)/bin
+HOWL_TOP := $(WIN32_DEV_TOP)/howl-1.0.0
+LIBXML2_TOP := $(WIN32_DEV_TOP)/libxml2
+MEANWHILE_TOP := $(WIN32_DEV_TOP)/meanwhile-1.0.2
+NSPR_TOP := $(WIN32_DEV_TOP)/nspr-4.4.1
+NSS_TOP := $(WIN32_DEV_TOP)/nss-3.9
+PERL_LIB_TOP := $(WIN32_DEV_TOP)/perl58
+SILC_TOOLKIT := $(WIN32_DEV_TOP)/silc-toolkit-1.0.2
+TCL_LIB_TOP := $(WIN32_DEV_TOP)/tcl-8.4.5
+
+# Where we installing this stuff to?
+GAIM_INSTALL_DIR := $(GAIM_TOP)/win32-install-dir
+GAIM_INSTALL_PERLMOD_DIR := $(GAIM_INSTALL_DIR)/perlmod
+GAIM_INSTALL_PIXMAPS_DIR := $(GAIM_INSTALL_DIR)/pixmaps
+GAIM_INSTALL_PLUGINS_DIR := $(GAIM_INSTALL_DIR)/plugins
+GAIM_INSTALL_PO_DIR := $(GAIM_INSTALL_DIR)/locale
+GAIM_INSTALL_SOUNDS_DIR := $(GAIM_INSTALL_DIR)/sounds
+
+# Important (enough) locations in our source code
+GAIM_LIB_TOP := $(GAIM_TOP)/libgaim
+GAIM_LIB_PLUGINS_TOP := $(GAIM_LIB_TOP)/plugins
+GAIM_GTK_TOP := $(GAIM_TOP)/gtk
+GAIM_GTK_IDLETRACK_TOP := $(GAIM_GTK_TOP)/win32/IdleTracker
+GAIM_GTK_PIXMAPS_TOP := $(GAIM_GTK_TOP)/pixmaps
+GAIM_GTK_PLUGINS_TOP := $(GAIM_GTK_TOP)/plugins
+GAIM_GTK_SOUNDS_TOP := $(GAIM_GTK_TOP)/sounds
+GAIM_PO_TOP := $(GAIM_TOP)/po
+GAIM_PROTOS_TOP := $(GAIM_LIB_TOP)/protocols
+
+# Locations of important (in-tree) build targets
+GAIM_CONFIG_H := $(GAIM_TOP)/config.h
+GAIM_IDLETRACK_DLL := $(GAIM_GTK_IDLETRACK_TOP)/idletrack.dll
+GAIM_LIBGAIM_DLL := $(GAIM_LIB_TOP)/libgaim.dll
+GAIM_GTKGAIM_DLL := $(GAIM_GTK_TOP)/gtkgaim.dll
+GAIM_EXE := $(GAIM_GTK_TOP)/gaim.exe
+GAIM_PORTABLE_EXE := $(GAIM_GTK_TOP)/gaim-portable.exe
 
 GCCWARNINGS := -Waggregate-return -Wcast-align -Wdeclaration-after-statement -Werror-implicit-function-declaration -Wextra -Wno-sign-compare -Wno-unused-parameter -Winit-self -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wundef
+GAIM_VERSION := $(shell cat $(GAIM_TOP)/VERSION)
+DEFINES += 	-DVERSION=\"$(GAIM_VERSION)\" \
+		-DHAVE_CONFIG_H
 
 # Use -g flag when building debug version of Gaim (including plugins).
 # Use -fnative-struct instead of -mms-bitfields when using mingw 1.1
 # (gcc 2.95)
 CFLAGS += -O2 -Wall $(GCCWARNINGS) -pipe -mno-cygwin -mms-bitfields -g
 
-
 # If not specified, dlls are built with the default base address of 0x10000000.
 # When loaded into a process address space a dll will be rebased if its base
 # address colides with the base address of an existing dll.  To avoid rebasing 
@@ -22,7 +64,13 @@
 # also renders debug info useless.
 DLL_LD_FLAGS += -Wl,--enable-auto-image-base
 
-VERSION := $(shell cat $(GAIM_TOP)/VERSION)
+# Build programs
+CC := gcc.exe
+GMSGFMT := $(GTK_BIN)/msgfmt
+MAKENSIS := makensis.exe
+PERL := /cygdrive/c/perl/bin/perl
+WINDRES := windres
 
-DEFINES += 	-DVERSION=\"$(VERSION)\" \
-		-DHAVE_CONFIG_H
+GAIM_COMMON_RULES := $(GAIM_LIB_TOP)/win32/rules.mak
+GAIM_COMMON_TARGETS := $(GAIM_LIB_TOP)/win32/targets.mak
+GAIM_WIN32_MAKEFILE := Makefile.mingw
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/libgaim/win32/rules.mak	Wed Aug 23 21:34:43 2006 +0000
@@ -0,0 +1,10 @@
+# Rules on how to make object files from various sources
+
+%.o: %.c
+	$(CC) $(CFLAGS) $(DEFINES) $(INCLUDE_PATHS) -o $@ -c $<
+
+%.c: %.xs
+	$(PERL) $(EXTUTILS)/xsubpp -typemap $(EXTUTILS)/typemap -typemap typemap $< > $@
+
+%.o: %.rc
+	$(WINDRES) -i $< -o $@
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/libgaim/win32/targets.mak	Wed Aug 23 21:34:43 2006 +0000
@@ -0,0 +1,43 @@
+#
+# targets.mak
+#
+# This file should be included at the end of all Makefile.mingw
+# files for better handling of cross directory dependencies
+#
+
+$(GAIM_CONFIG_H): $(GAIM_TOP)/config.h.mingw
+	cp $(GAIM_TOP)/config.h.mingw $(GAIM_CONFIG_H)
+
+$(GAIM_LIBGAIM_DLL) $(GAIM_LIBGAIM_DLL).a:
+	$(MAKE) -C $(GAIM_LIB_TOP) -f $(GAIM_WIN32_MAKEFILE) libgaim.dll
+
+$(GAIM_GTKGAIM_DLL) $(GAIM_GTKGAIM_DLL).a:
+	$(MAKE) -C $(GAIM_GTK_TOP) -f $(GAIM_WIN32_MAKEFILE) gtkgaim.dll
+
+$(GAIM_IDLETRACK_DLL) $(GAIM_IDLETRACK_DLL).a:
+	$(MAKE) -C $(GAIM_GTK_IDLETRACK_TOP) -f $(GAIM_WIN32_MAKEFILE) idletrack.dll
+
+$(GAIM_EXE):
+	$(MAKE) -C $(GAIM_GTK_TOP) -f $(GAIM_WIN32_MAKEFILE) gaim.exe
+
+$(GAIM_PORTABLE_EXE):
+	$(MAKE) -C $(GAIM_GTK_TOP) -f $(GAIM_WIN32_MAKEFILE) gaim-portable.exe
+
+# Installation Directories
+$(GAIM_INSTALL_DIR):
+	mkdir -p $(GAIM_INSTALL_DIR)
+
+$(GAIM_INSTALL_PERLMOD_DIR):
+	mkdir -p $(GAIM_INSTALL_PERLMOD_DIR)
+
+$(GAIM_INSTALL_PLUGINS_DIR):
+	mkdir -p $(GAIM_INSTALL_PLUGINS_DIR)
+
+$(GAIM_INSTALL_PIXMAPS_DIR):
+	mkdir -p $(GAIM_INSTALL_PIXMAPS_DIR)
+
+$(GAIM_INSTALL_PO_DIR):
+	mkdir -p $(GAIM_INSTALL_PO_DIR)
+
+$(GAIM_INSTALL_SOUNDS_DIR):
+	mkdir -p $(GAIM_INSTALL_SOUNDS_DIR)
--- a/po/Makefile.mingw	Wed Aug 23 18:50:46 2006 +0000
+++ b/po/Makefile.mingw	Wed Aug 23 21:34:43 2006 +0000
@@ -3,29 +3,14 @@
 # Description: Makefile to generate mo files
 #
 
-PACKAGE = gaim
-
-##
-## PATHS
-##
+GAIM_TOP := ..
+include $(GAIM_TOP)/libgaim/win32/global.mak
 
-srcdir = .
-GAIM_TOP = ..
-GAIM_INSTALL_DIR = ../win32-install-dir
-LOCALEDIR = $(GAIM_INSTALL_DIR)/locale
-GTK_BIN = ../../win32-dev/gtk_2_0/bin
-
-##
-## TOOLS
-##
-
-GMSGFMT := $(GTK_BIN)/msgfmt
-
+PACKAGE = gaim
 
 .SUFFIXES:
 .SUFFIXES: .po .gmo
 
-
 ##
 ## SOURCES, OBJECTS
 ##
@@ -39,28 +24,26 @@
 .po.gmo:
 	rm -f $@ && $(GMSGFMT) --statistics -o $@ $<
 
-
 ##
 ## TARGETS
 ##
 
-
 all: $(CATALOGS)
 
 install: all
-	mkdir -p $(LOCALEDIR)
+	mkdir -p $(GAIM_INSTALL_PO_DIR)
 	@catalogs='$(CATALOGS)'; \
 	for cat in $$catalogs; do \
 	  cat=`basename $$cat`; \
 	  lang=`echo $$cat | sed 's/\.gmo$$//'`; \
-	  dir=$(LOCALEDIR)/$$lang/LC_MESSAGES; \
+	  dir=$(GAIM_INSTALL_PO_DIR)/$$lang/LC_MESSAGES; \
 	  mkdir -p $$dir; \
 	  if test -r $$cat; then \
 	    cp $$cat $$dir/$(PACKAGE).mo; \
 	    echo "installing $$cat as $$dir/$(PACKAGE).mo"; \
 	  else \
-	    cp $(srcdir)/$$cat $$dir/$(PACKAGE).mo; \
-	    echo "installing $(srcdir)/$$cat as" \
+	    cp $(GAIM_PO_TOP)/$$cat $$dir/$(PACKAGE).mo; \
+	    echo "installing $(GAIM_PO_TOP)/$$cat as" \
 		 "$$dir/$(PACKAGE).mo"; \
 	  fi; \
 	done