diff --git a/Makefile.in b/Makefile.in
index 4ae4e831f80..351d510328a 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -87,8 +87,9 @@ uninstall::
 # Import libraries
 
 STATIC_LIBS = @ALL_STATIC_LIBS@
+IMPORT_LIBS = @ALL_IMPORT_LIBS@
 
-implib: $(ALL_STATICLIB_DIRS)
+implib: $(ALL_STATICLIB_DIRS) $(IMPORT_LIBS)
 .PHONY: implib
 
 # Dependencies between directories
@@ -96,8 +97,8 @@ implib: $(ALL_STATICLIB_DIRS)
 all: $(INSTALLSUBDIRS)
 
 # dependencies needed to build any dll or program
-__builddeps__: libs/port libs/wine libs/wpp $(ALL_TOOL_DIRS) include $(ALL_STATICLIB_DIRS)
-__buildcrossdeps__: libs/port libs/wine $(ALL_TOOL_DIRS) include $(STATIC_LIBS:.a=.cross.a)
+__builddeps__: libs/port libs/wine libs/wpp $(ALL_TOOL_DIRS) include $(ALL_STATICLIB_DIRS) $(IMPORT_LIBS)
+__buildcrossdeps__: libs/port libs/wine $(ALL_TOOL_DIRS) include $(STATIC_LIBS:.a=.cross.a) $(IMPORT_LIBS:.def=.cross.a)
 .PHONY: __builddeps__ __buildcrossdeps__
 
 dlls programs: __builddeps__
@@ -117,8 +118,6 @@ include/__install__ include/__install-dev__: include
 libs/wine/__install__ libs/wine/__install-lib__ libs/wine/__install-dev__: libs/wine
 loader/__install__ loader/__install-lib__: libs/port libs/wine tools
 server/__install__ server/__install-lib__: libs/port libs/wine tools
-programs/__install__: dlls/__install__
-programs/__install-lib__: dlls/__install-lib__
 tools/__install__ tools/__install-lib__ tools/__install-dev__: tools
 tools/widl/__install__ tools/widl/__install-dev__: tools/widl
 tools/winebuild/__install__ tools/winebuild/__install-dev__: tools/winebuild
diff --git a/aclocal.m4 b/aclocal.m4
index bedb3083d6c..1d69de6decf 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -187,26 +187,27 @@ dnl Usage: WINE_CONFIG_DLL(name,enable,implib,implibsrc)
 dnl
 AC_DEFUN([WINE_CONFIG_DLL],
 [m4_ifval([$3],[m4_ifval([$2],[test "x$[$2]" = xno || ])ALL_IMPORT_LIBS="$ALL_IMPORT_LIBS \\
-	$1/lib$3.$IMPLIBEXT[]dnl
+	dlls/$1/lib$3.$IMPLIBEXT[]dnl
 m4_if($1,$3,,[ \\
-	lib$3.$IMPLIBEXT])[]dnl
+	dlls/lib$3.$IMPLIBEXT])[]dnl
 m4_ifval([$4],[ \\
-	$1/lib$3.$STATIC_IMPLIBEXT])"
-ALL_IMPORTLIB_RULES="$ALL_IMPORTLIB_RULES
-m4_if($1,$3,,[lib$3.a: $1/lib$3.a
+	dlls/$1/lib$3.$STATIC_IMPLIBEXT])"
+ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS
+dlls/$1/lib$3.$IMPLIBEXT m4_ifval([$4],[dlls/$1/lib$3.$STATIC_IMPLIBEXT ])dlls/$1/lib$3.cross.a: tools/widl tools/winebuild tools/winegcc include
+m4_if($1,$3,,[dlls/lib$3.a: dlls/$1/lib$3.a
 	\$(RM) \$[@] && \$(LN_S) $1/lib$3.a \$[@]
-lib$3.cross.a: $1/lib$3.cross.a
+dlls/lib$3.cross.a: dlls/$1/lib$3.cross.a
 	\$(RM) \$[@] && \$(LN_S) $1/lib$3.cross.a \$[@]
-lib$3.def: $1/lib$3.def
+dlls/lib$3.def: dlls/$1/lib$3.def
 	\$(RM) \$[@] && \$(LN_S) $1/lib$3.def \$[@]
 clean::
-	\$(RM) lib$3.def
-])m4_ifval([$4],[$1/lib$3.def: $1/$1.spec \$(WINEBUILD)
-	@cd $1 && \$(MAKE) \`basename \$[@]\`
-$1/lib$3.$STATIC_IMPLIBEXT $1/lib$3.cross.a: dummy
-	@cd $1 && \$(MAKE) \`basename \$[@]\`],
-[$1/lib$3.def $1/lib$3.a $1/lib$3.cross.a: $1/$1.spec \$(WINEBUILD)
-	@cd $1 && \$(MAKE) \`basename \$[@]\`])"
+	\$(RM) dlls/lib$3.def
+])m4_ifval([$4],[dlls/$1/lib$3.def: dlls/$1/$1.spec dlls/$1/Makefile
+	@cd dlls/$1 && \$(MAKE) \`basename \$[@]\`
+dlls/$1/lib$3.$STATIC_IMPLIBEXT dlls/$1/lib$3.cross.a: dlls/$1/Makefile dummy
+	@cd dlls/$1 && \$(MAKE) \`basename \$[@]\`],
+[dlls/$1/lib$3.$IMPLIBEXT dlls/$1/lib$3.cross.a: dlls/$1/$1.spec dlls/$1/Makefile
+	@cd dlls/$1 && \$(MAKE) \`basename \$[@]\`])"
 ])dnl
 WINE_CONFIG_MAKEFILE([dlls/$1/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS],[$2])])
 
diff --git a/configure b/configure
index 1128d1b5ad1..a93e6858c61 100755
--- a/configure
+++ b/configure
@@ -601,7 +601,6 @@ ALL_PROGRAM_INSTALL_DIRS
 ALL_PROGRAM_DIRS
 ALL_TEST_BINARIES
 ALL_TEST_DIRS
-ALL_IMPORTLIB_RULES
 ALL_IMPORT_LIBS
 ALL_STATIC_LIBS
 ALL_STATICLIB_DIRS
@@ -13675,8 +13674,6 @@ ALL_STATIC_LIBS=""
 
 ALL_IMPORT_LIBS=""
 
-ALL_IMPORTLIB_RULES=""
-
 ALL_TEST_DIRS=""
 
 ALL_TEST_BINARIES=""
@@ -13785,10 +13782,11 @@ dlls/acledit/Makefile: dlls/acledit/Makefile.in dlls/Makedll.rules config.status
 ac_config_files="$ac_config_files dlls/acledit/Makefile"
 
 ALL_IMPORT_LIBS="$ALL_IMPORT_LIBS \\
-	aclui/libaclui.$IMPLIBEXT"
-ALL_IMPORTLIB_RULES="$ALL_IMPORTLIB_RULES
-aclui/libaclui.def aclui/libaclui.a aclui/libaclui.cross.a: aclui/aclui.spec \$(WINEBUILD)
-	@cd aclui && \$(MAKE) \`basename \$@\`"
+	dlls/aclui/libaclui.$IMPLIBEXT"
+ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS
+dlls/aclui/libaclui.$IMPLIBEXT dlls/aclui/libaclui.cross.a: tools/widl tools/winebuild tools/winegcc include
+dlls/aclui/libaclui.$IMPLIBEXT dlls/aclui/libaclui.cross.a: dlls/aclui/aclui.spec dlls/aclui/Makefile
+	@cd dlls/aclui && \$(MAKE) \`basename \$@\`"
 ALL_MAKEFILES="$ALL_MAKEFILES \\
 	dlls/aclui/Makefile"
 test "x$enable_aclui" != xno && ALL_DLL_DIRS="$ALL_DLL_DIRS \\
@@ -13798,10 +13796,11 @@ dlls/aclui/Makefile: dlls/aclui/Makefile.in dlls/Makedll.rules config.status"
 ac_config_files="$ac_config_files dlls/aclui/Makefile"
 
 ALL_IMPORT_LIBS="$ALL_IMPORT_LIBS \\
-	activeds/libactiveds.$IMPLIBEXT"
-ALL_IMPORTLIB_RULES="$ALL_IMPORTLIB_RULES
-activeds/libactiveds.def activeds/libactiveds.a activeds/libactiveds.cross.a: activeds/activeds.spec \$(WINEBUILD)
-	@cd activeds && \$(MAKE) \`basename \$@\`"
+	dlls/activeds/libactiveds.$IMPLIBEXT"
+ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS
+dlls/activeds/libactiveds.$IMPLIBEXT dlls/activeds/libactiveds.cross.a: tools/widl tools/winebuild tools/winegcc include
+dlls/activeds/libactiveds.$IMPLIBEXT dlls/activeds/libactiveds.cross.a: dlls/activeds/activeds.spec dlls/activeds/Makefile
+	@cd dlls/activeds && \$(MAKE) \`basename \$@\`"
 ALL_MAKEFILES="$ALL_MAKEFILES \\
 	dlls/activeds/Makefile"
 test "x$enable_activeds" != xno && ALL_DLL_DIRS="$ALL_DLL_DIRS \\
@@ -13835,10 +13834,11 @@ dlls/adsiid/Makefile: dlls/adsiid/Makefile.in dlls/Makeimplib.rules config.statu
 ac_config_files="$ac_config_files dlls/adsiid/Makefile"
 
 ALL_IMPORT_LIBS="$ALL_IMPORT_LIBS \\
-	advapi32/libadvapi32.$IMPLIBEXT"
-ALL_IMPORTLIB_RULES="$ALL_IMPORTLIB_RULES
-advapi32/libadvapi32.def advapi32/libadvapi32.a advapi32/libadvapi32.cross.a: advapi32/advapi32.spec \$(WINEBUILD)
-	@cd advapi32 && \$(MAKE) \`basename \$@\`"
+	dlls/advapi32/libadvapi32.$IMPLIBEXT"
+ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS
+dlls/advapi32/libadvapi32.$IMPLIBEXT dlls/advapi32/libadvapi32.cross.a: tools/widl tools/winebuild tools/winegcc include
+dlls/advapi32/libadvapi32.$IMPLIBEXT dlls/advapi32/libadvapi32.cross.a: dlls/advapi32/advapi32.spec dlls/advapi32/Makefile
+	@cd dlls/advapi32 && \$(MAKE) \`basename \$@\`"
 ALL_MAKEFILES="$ALL_MAKEFILES \\
 	dlls/advapi32/Makefile"
 test "x$enable_advapi32" != xno && ALL_DLL_DIRS="$ALL_DLL_DIRS \\
@@ -13864,10 +13864,11 @@ dlls/advapi32/tests/Makefile: dlls/advapi32/tests/Makefile.in dlls/Maketest.rule
 ac_config_files="$ac_config_files dlls/advapi32/tests/Makefile"
 
 ALL_IMPORT_LIBS="$ALL_IMPORT_LIBS \\
-	advpack/libadvpack.$IMPLIBEXT"
-ALL_IMPORTLIB_RULES="$ALL_IMPORTLIB_RULES
-advpack/libadvpack.def advpack/libadvpack.a advpack/libadvpack.cross.a: advpack/advpack.spec \$(WINEBUILD)
-	@cd advpack && \$(MAKE) \`basename \$@\`"
+	dlls/advpack/libadvpack.$IMPLIBEXT"
+ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS
+dlls/advpack/libadvpack.$IMPLIBEXT dlls/advpack/libadvpack.cross.a: tools/widl tools/winebuild tools/winegcc include
+dlls/advpack/libadvpack.$IMPLIBEXT dlls/advpack/libadvpack.cross.a: dlls/advpack/advpack.spec dlls/advpack/Makefile
+	@cd dlls/advpack && \$(MAKE) \`basename \$@\`"
 ALL_MAKEFILES="$ALL_MAKEFILES \\
 	dlls/advpack/Makefile"
 test "x$enable_advpack" != xno && ALL_DLL_DIRS="$ALL_DLL_DIRS \\
@@ -13925,10 +13926,11 @@ dlls/appwiz.cpl/Makefile: dlls/appwiz.cpl/Makefile.in dlls/Makedll.rules config.
 ac_config_files="$ac_config_files dlls/appwiz.cpl/Makefile"
 
 ALL_IMPORT_LIBS="$ALL_IMPORT_LIBS \\
-	atl/libatl.$IMPLIBEXT"
-ALL_IMPORTLIB_RULES="$ALL_IMPORTLIB_RULES
-atl/libatl.def atl/libatl.a atl/libatl.cross.a: atl/atl.spec \$(WINEBUILD)
-	@cd atl && \$(MAKE) \`basename \$@\`"
+	dlls/atl/libatl.$IMPLIBEXT"
+ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS
+dlls/atl/libatl.$IMPLIBEXT dlls/atl/libatl.cross.a: tools/widl tools/winebuild tools/winegcc include
+dlls/atl/libatl.$IMPLIBEXT dlls/atl/libatl.cross.a: dlls/atl/atl.spec dlls/atl/Makefile
+	@cd dlls/atl && \$(MAKE) \`basename \$@\`"
 ALL_MAKEFILES="$ALL_MAKEFILES \\
 	dlls/atl/Makefile"
 test "x$enable_atl" != xno && ALL_DLL_DIRS="$ALL_DLL_DIRS \\
@@ -13946,10 +13948,11 @@ dlls/authz/Makefile: dlls/authz/Makefile.in dlls/Makedll.rules config.status"
 ac_config_files="$ac_config_files dlls/authz/Makefile"
 
 ALL_IMPORT_LIBS="$ALL_IMPORT_LIBS \\
-	avicap32/libavicap32.$IMPLIBEXT"
-ALL_IMPORTLIB_RULES="$ALL_IMPORTLIB_RULES
-avicap32/libavicap32.def avicap32/libavicap32.a avicap32/libavicap32.cross.a: avicap32/avicap32.spec \$(WINEBUILD)
-	@cd avicap32 && \$(MAKE) \`basename \$@\`"
+	dlls/avicap32/libavicap32.$IMPLIBEXT"
+ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS
+dlls/avicap32/libavicap32.$IMPLIBEXT dlls/avicap32/libavicap32.cross.a: tools/widl tools/winebuild tools/winegcc include
+dlls/avicap32/libavicap32.$IMPLIBEXT dlls/avicap32/libavicap32.cross.a: dlls/avicap32/avicap32.spec dlls/avicap32/Makefile
+	@cd dlls/avicap32 && \$(MAKE) \`basename \$@\`"
 ALL_MAKEFILES="$ALL_MAKEFILES \\
 	dlls/avicap32/Makefile"
 test "x$enable_avicap32" != xno && ALL_DLL_DIRS="$ALL_DLL_DIRS \\
@@ -13959,10 +13962,11 @@ dlls/avicap32/Makefile: dlls/avicap32/Makefile.in dlls/Makedll.rules config.stat
 ac_config_files="$ac_config_files dlls/avicap32/Makefile"
 
 ALL_IMPORT_LIBS="$ALL_IMPORT_LIBS \\
-	avifil32/libavifil32.$IMPLIBEXT"
-ALL_IMPORTLIB_RULES="$ALL_IMPORTLIB_RULES
-avifil32/libavifil32.def avifil32/libavifil32.a avifil32/libavifil32.cross.a: avifil32/avifil32.spec \$(WINEBUILD)
-	@cd avifil32 && \$(MAKE) \`basename \$@\`"
+	dlls/avifil32/libavifil32.$IMPLIBEXT"
+ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS
+dlls/avifil32/libavifil32.$IMPLIBEXT dlls/avifil32/libavifil32.cross.a: tools/widl tools/winebuild tools/winegcc include
+dlls/avifil32/libavifil32.$IMPLIBEXT dlls/avifil32/libavifil32.cross.a: dlls/avifil32/avifil32.spec dlls/avifil32/Makefile
+	@cd dlls/avifil32 && \$(MAKE) \`basename \$@\`"
 ALL_MAKEFILES="$ALL_MAKEFILES \\
 	dlls/avifil32/Makefile"
 test "x$enable_avifil32" != xno && ALL_DLL_DIRS="$ALL_DLL_DIRS \\
@@ -13996,10 +14000,11 @@ dlls/avifile.dll16/Makefile: dlls/avifile.dll16/Makefile.in dlls/Makedll.rules c
 ac_config_files="$ac_config_files dlls/avifile.dll16/Makefile"
 
 ALL_IMPORT_LIBS="$ALL_IMPORT_LIBS \\
-	avrt/libavrt.$IMPLIBEXT"
-ALL_IMPORTLIB_RULES="$ALL_IMPORTLIB_RULES
-avrt/libavrt.def avrt/libavrt.a avrt/libavrt.cross.a: avrt/avrt.spec \$(WINEBUILD)
-	@cd avrt && \$(MAKE) \`basename \$@\`"
+	dlls/avrt/libavrt.$IMPLIBEXT"
+ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS
+dlls/avrt/libavrt.$IMPLIBEXT dlls/avrt/libavrt.cross.a: tools/widl tools/winebuild tools/winegcc include
+dlls/avrt/libavrt.$IMPLIBEXT dlls/avrt/libavrt.cross.a: dlls/avrt/avrt.spec dlls/avrt/Makefile
+	@cd dlls/avrt && \$(MAKE) \`basename \$@\`"
 ALL_MAKEFILES="$ALL_MAKEFILES \\
 	dlls/avrt/Makefile"
 test "x$enable_avrt" != xno && ALL_DLL_DIRS="$ALL_DLL_DIRS \\
@@ -14041,10 +14046,11 @@ dlls/browseui/tests/Makefile: dlls/browseui/tests/Makefile.in dlls/Maketest.rule
 ac_config_files="$ac_config_files dlls/browseui/tests/Makefile"
 
 ALL_IMPORT_LIBS="$ALL_IMPORT_LIBS \\
-	cabinet/libcabinet.$IMPLIBEXT"
-ALL_IMPORTLIB_RULES="$ALL_IMPORTLIB_RULES
-cabinet/libcabinet.def cabinet/libcabinet.a cabinet/libcabinet.cross.a: cabinet/cabinet.spec \$(WINEBUILD)
-	@cd cabinet && \$(MAKE) \`basename \$@\`"
+	dlls/cabinet/libcabinet.$IMPLIBEXT"
+ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS
+dlls/cabinet/libcabinet.$IMPLIBEXT dlls/cabinet/libcabinet.cross.a: tools/widl tools/winebuild tools/winegcc include
+dlls/cabinet/libcabinet.$IMPLIBEXT dlls/cabinet/libcabinet.cross.a: dlls/cabinet/cabinet.spec dlls/cabinet/Makefile
+	@cd dlls/cabinet && \$(MAKE) \`basename \$@\`"
 ALL_MAKEFILES="$ALL_MAKEFILES \\
 	dlls/cabinet/Makefile"
 test "x$enable_cabinet" != xno && ALL_DLL_DIRS="$ALL_DLL_DIRS \\
@@ -14070,10 +14076,11 @@ dlls/cabinet/tests/Makefile: dlls/cabinet/tests/Makefile.in dlls/Maketest.rules
 ac_config_files="$ac_config_files dlls/cabinet/tests/Makefile"
 
 ALL_IMPORT_LIBS="$ALL_IMPORT_LIBS \\
-	capi2032/libcapi2032.$IMPLIBEXT"
-ALL_IMPORTLIB_RULES="$ALL_IMPORTLIB_RULES
-capi2032/libcapi2032.def capi2032/libcapi2032.a capi2032/libcapi2032.cross.a: capi2032/capi2032.spec \$(WINEBUILD)
-	@cd capi2032 && \$(MAKE) \`basename \$@\`"
+	dlls/capi2032/libcapi2032.$IMPLIBEXT"
+ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS
+dlls/capi2032/libcapi2032.$IMPLIBEXT dlls/capi2032/libcapi2032.cross.a: tools/widl tools/winebuild tools/winegcc include
+dlls/capi2032/libcapi2032.$IMPLIBEXT dlls/capi2032/libcapi2032.cross.a: dlls/capi2032/capi2032.spec dlls/capi2032/Makefile
+	@cd dlls/capi2032 && \$(MAKE) \`basename \$@\`"
 ALL_MAKEFILES="$ALL_MAKEFILES \\
 	dlls/capi2032/Makefile"
 test "x$enable_capi2032" != xno && ALL_DLL_DIRS="$ALL_DLL_DIRS \\
@@ -14083,10 +14090,11 @@ dlls/capi2032/Makefile: dlls/capi2032/Makefile.in dlls/Makedll.rules config.stat
 ac_config_files="$ac_config_files dlls/capi2032/Makefile"
 
 ALL_IMPORT_LIBS="$ALL_IMPORT_LIBS \\
-	cards/libcards.$IMPLIBEXT"
-ALL_IMPORTLIB_RULES="$ALL_IMPORTLIB_RULES
-cards/libcards.def cards/libcards.a cards/libcards.cross.a: cards/cards.spec \$(WINEBUILD)
-	@cd cards && \$(MAKE) \`basename \$@\`"
+	dlls/cards/libcards.$IMPLIBEXT"
+ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS
+dlls/cards/libcards.$IMPLIBEXT dlls/cards/libcards.cross.a: tools/widl tools/winebuild tools/winegcc include
+dlls/cards/libcards.$IMPLIBEXT dlls/cards/libcards.cross.a: dlls/cards/cards.spec dlls/cards/Makefile
+	@cd dlls/cards && \$(MAKE) \`basename \$@\`"
 ALL_MAKEFILES="$ALL_MAKEFILES \\
 	dlls/cards/Makefile"
 test "x$enable_cards" != xno && ALL_DLL_DIRS="$ALL_DLL_DIRS \\
@@ -14096,10 +14104,11 @@ dlls/cards/Makefile: dlls/cards/Makefile.in dlls/Makedll.rules config.status"
 ac_config_files="$ac_config_files dlls/cards/Makefile"
 
 ALL_IMPORT_LIBS="$ALL_IMPORT_LIBS \\
-	cfgmgr32/libcfgmgr32.$IMPLIBEXT"
-ALL_IMPORTLIB_RULES="$ALL_IMPORTLIB_RULES
-cfgmgr32/libcfgmgr32.def cfgmgr32/libcfgmgr32.a cfgmgr32/libcfgmgr32.cross.a: cfgmgr32/cfgmgr32.spec \$(WINEBUILD)
-	@cd cfgmgr32 && \$(MAKE) \`basename \$@\`"
+	dlls/cfgmgr32/libcfgmgr32.$IMPLIBEXT"
+ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS
+dlls/cfgmgr32/libcfgmgr32.$IMPLIBEXT dlls/cfgmgr32/libcfgmgr32.cross.a: tools/widl tools/winebuild tools/winegcc include
+dlls/cfgmgr32/libcfgmgr32.$IMPLIBEXT dlls/cfgmgr32/libcfgmgr32.cross.a: dlls/cfgmgr32/cfgmgr32.spec dlls/cfgmgr32/Makefile
+	@cd dlls/cfgmgr32 && \$(MAKE) \`basename \$@\`"
 ALL_MAKEFILES="$ALL_MAKEFILES \\
 	dlls/cfgmgr32/Makefile"
 test "x$enable_cfgmgr32" != xno && ALL_DLL_DIRS="$ALL_DLL_DIRS \\
@@ -14109,10 +14118,11 @@ dlls/cfgmgr32/Makefile: dlls/cfgmgr32/Makefile.in dlls/Makedll.rules config.stat
 ac_config_files="$ac_config_files dlls/cfgmgr32/Makefile"
 
 ALL_IMPORT_LIBS="$ALL_IMPORT_LIBS \\
-	clusapi/libclusapi.$IMPLIBEXT"
-ALL_IMPORTLIB_RULES="$ALL_IMPORTLIB_RULES
-clusapi/libclusapi.def clusapi/libclusapi.a clusapi/libclusapi.cross.a: clusapi/clusapi.spec \$(WINEBUILD)
-	@cd clusapi && \$(MAKE) \`basename \$@\`"
+	dlls/clusapi/libclusapi.$IMPLIBEXT"
+ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS
+dlls/clusapi/libclusapi.$IMPLIBEXT dlls/clusapi/libclusapi.cross.a: tools/widl tools/winebuild tools/winegcc include
+dlls/clusapi/libclusapi.$IMPLIBEXT dlls/clusapi/libclusapi.cross.a: dlls/clusapi/clusapi.spec dlls/clusapi/Makefile
+	@cd dlls/clusapi && \$(MAKE) \`basename \$@\`"
 ALL_MAKEFILES="$ALL_MAKEFILES \\
 	dlls/clusapi/Makefile"
 test "x$enable_clusapi" != xno && ALL_DLL_DIRS="$ALL_DLL_DIRS \\
@@ -14146,10 +14156,11 @@ dlls/comcat/tests/Makefile: dlls/comcat/tests/Makefile.in dlls/Maketest.rules co
 ac_config_files="$ac_config_files dlls/comcat/tests/Makefile"
 
 ALL_IMPORT_LIBS="$ALL_IMPORT_LIBS \\
-	comctl32/libcomctl32.$IMPLIBEXT"
-ALL_IMPORTLIB_RULES="$ALL_IMPORTLIB_RULES
-comctl32/libcomctl32.def comctl32/libcomctl32.a comctl32/libcomctl32.cross.a: comctl32/comctl32.spec \$(WINEBUILD)
-	@cd comctl32 && \$(MAKE) \`basename \$@\`"
+	dlls/comctl32/libcomctl32.$IMPLIBEXT"
+ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS
+dlls/comctl32/libcomctl32.$IMPLIBEXT dlls/comctl32/libcomctl32.cross.a: tools/widl tools/winebuild tools/winegcc include
+dlls/comctl32/libcomctl32.$IMPLIBEXT dlls/comctl32/libcomctl32.cross.a: dlls/comctl32/comctl32.spec dlls/comctl32/Makefile
+	@cd dlls/comctl32 && \$(MAKE) \`basename \$@\`"
 ALL_MAKEFILES="$ALL_MAKEFILES \\
 	dlls/comctl32/Makefile"
 test "x$enable_comctl32" != xno && ALL_DLL_DIRS="$ALL_DLL_DIRS \\
@@ -14175,10 +14186,11 @@ dlls/comctl32/tests/Makefile: dlls/comctl32/tests/Makefile.in dlls/Maketest.rule
 ac_config_files="$ac_config_files dlls/comctl32/tests/Makefile"
 
 ALL_IMPORT_LIBS="$ALL_IMPORT_LIBS \\
-	comdlg32/libcomdlg32.$IMPLIBEXT"
-ALL_IMPORTLIB_RULES="$ALL_IMPORTLIB_RULES
-comdlg32/libcomdlg32.def comdlg32/libcomdlg32.a comdlg32/libcomdlg32.cross.a: comdlg32/comdlg32.spec \$(WINEBUILD)
-	@cd comdlg32 && \$(MAKE) \`basename \$@\`"
+	dlls/comdlg32/libcomdlg32.$IMPLIBEXT"
+ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS
+dlls/comdlg32/libcomdlg32.$IMPLIBEXT dlls/comdlg32/libcomdlg32.cross.a: tools/widl tools/winebuild tools/winegcc include
+dlls/comdlg32/libcomdlg32.$IMPLIBEXT dlls/comdlg32/libcomdlg32.cross.a: dlls/comdlg32/comdlg32.spec dlls/comdlg32/Makefile
+	@cd dlls/comdlg32 && \$(MAKE) \`basename \$@\`"
 ALL_MAKEFILES="$ALL_MAKEFILES \\
 	dlls/comdlg32/Makefile"
 test "x$enable_comdlg32" != xno && ALL_DLL_DIRS="$ALL_DLL_DIRS \\
@@ -14228,10 +14240,11 @@ dlls/compobj.dll16/Makefile: dlls/compobj.dll16/Makefile.in dlls/Makedll.rules c
 ac_config_files="$ac_config_files dlls/compobj.dll16/Makefile"
 
 ALL_IMPORT_LIBS="$ALL_IMPORT_LIBS \\
-	compstui/libcompstui.$IMPLIBEXT"
-ALL_IMPORTLIB_RULES="$ALL_IMPORTLIB_RULES
-compstui/libcompstui.def compstui/libcompstui.a compstui/libcompstui.cross.a: compstui/compstui.spec \$(WINEBUILD)
-	@cd compstui && \$(MAKE) \`basename \$@\`"
+	dlls/compstui/libcompstui.$IMPLIBEXT"
+ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS
+dlls/compstui/libcompstui.$IMPLIBEXT dlls/compstui/libcompstui.cross.a: tools/widl tools/winebuild tools/winegcc include
+dlls/compstui/libcompstui.$IMPLIBEXT dlls/compstui/libcompstui.cross.a: dlls/compstui/compstui.spec dlls/compstui/Makefile
+	@cd dlls/compstui && \$(MAKE) \`basename \$@\`"
 ALL_MAKEFILES="$ALL_MAKEFILES \\
 	dlls/compstui/Makefile"
 test "x$enable_compstui" != xno && ALL_DLL_DIRS="$ALL_DLL_DIRS \\
@@ -14241,10 +14254,11 @@ dlls/compstui/Makefile: dlls/compstui/Makefile.in dlls/Makedll.rules config.stat
 ac_config_files="$ac_config_files dlls/compstui/Makefile"
 
 ALL_IMPORT_LIBS="$ALL_IMPORT_LIBS \\
-	credui/libcredui.$IMPLIBEXT"
-ALL_IMPORTLIB_RULES="$ALL_IMPORTLIB_RULES
-credui/libcredui.def credui/libcredui.a credui/libcredui.cross.a: credui/credui.spec \$(WINEBUILD)
-	@cd credui && \$(MAKE) \`basename \$@\`"
+	dlls/credui/libcredui.$IMPLIBEXT"
+ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS
+dlls/credui/libcredui.$IMPLIBEXT dlls/credui/libcredui.cross.a: tools/widl tools/winebuild tools/winegcc include
+dlls/credui/libcredui.$IMPLIBEXT dlls/credui/libcredui.cross.a: dlls/credui/credui.spec dlls/credui/Makefile
+	@cd dlls/credui && \$(MAKE) \`basename \$@\`"
 ALL_MAKEFILES="$ALL_MAKEFILES \\
 	dlls/credui/Makefile"
 test "x$enable_credui" != xno && ALL_DLL_DIRS="$ALL_DLL_DIRS \\
@@ -14270,10 +14284,11 @@ dlls/credui/tests/Makefile: dlls/credui/tests/Makefile.in dlls/Maketest.rules co
 ac_config_files="$ac_config_files dlls/credui/tests/Makefile"
 
 ALL_IMPORT_LIBS="$ALL_IMPORT_LIBS \\
-	crtdll/libcrtdll.$IMPLIBEXT"
-ALL_IMPORTLIB_RULES="$ALL_IMPORTLIB_RULES
-crtdll/libcrtdll.def crtdll/libcrtdll.a crtdll/libcrtdll.cross.a: crtdll/crtdll.spec \$(WINEBUILD)
-	@cd crtdll && \$(MAKE) \`basename \$@\`"
+	dlls/crtdll/libcrtdll.$IMPLIBEXT"
+ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS
+dlls/crtdll/libcrtdll.$IMPLIBEXT dlls/crtdll/libcrtdll.cross.a: tools/widl tools/winebuild tools/winegcc include
+dlls/crtdll/libcrtdll.$IMPLIBEXT dlls/crtdll/libcrtdll.cross.a: dlls/crtdll/crtdll.spec dlls/crtdll/Makefile
+	@cd dlls/crtdll && \$(MAKE) \`basename \$@\`"
 ALL_MAKEFILES="$ALL_MAKEFILES \\
 	dlls/crtdll/Makefile"
 test "x$enable_crtdll" != xno && ALL_DLL_DIRS="$ALL_DLL_DIRS \\
@@ -14283,10 +14298,11 @@ dlls/crtdll/Makefile: dlls/crtdll/Makefile.in dlls/Makedll.rules config.status"
 ac_config_files="$ac_config_files dlls/crtdll/Makefile"
 
 ALL_IMPORT_LIBS="$ALL_IMPORT_LIBS \\
-	crypt32/libcrypt32.$IMPLIBEXT"
-ALL_IMPORTLIB_RULES="$ALL_IMPORTLIB_RULES
-crypt32/libcrypt32.def crypt32/libcrypt32.a crypt32/libcrypt32.cross.a: crypt32/crypt32.spec \$(WINEBUILD)
-	@cd crypt32 && \$(MAKE) \`basename \$@\`"
+	dlls/crypt32/libcrypt32.$IMPLIBEXT"
+ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS
+dlls/crypt32/libcrypt32.$IMPLIBEXT dlls/crypt32/libcrypt32.cross.a: tools/widl tools/winebuild tools/winegcc include
+dlls/crypt32/libcrypt32.$IMPLIBEXT dlls/crypt32/libcrypt32.cross.a: dlls/crypt32/crypt32.spec dlls/crypt32/Makefile
+	@cd dlls/crypt32 && \$(MAKE) \`basename \$@\`"
 ALL_MAKEFILES="$ALL_MAKEFILES \\
 	dlls/crypt32/Makefile"
 test "x$enable_crypt32" != xno && ALL_DLL_DIRS="$ALL_DLL_DIRS \\
@@ -14320,10 +14336,11 @@ dlls/cryptdlg/Makefile: dlls/cryptdlg/Makefile.in dlls/Makedll.rules config.stat
 ac_config_files="$ac_config_files dlls/cryptdlg/Makefile"
 
 ALL_IMPORT_LIBS="$ALL_IMPORT_LIBS \\
-	cryptdll/libcryptdll.$IMPLIBEXT"
-ALL_IMPORTLIB_RULES="$ALL_IMPORTLIB_RULES
-cryptdll/libcryptdll.def cryptdll/libcryptdll.a cryptdll/libcryptdll.cross.a: cryptdll/cryptdll.spec \$(WINEBUILD)
-	@cd cryptdll && \$(MAKE) \`basename \$@\`"
+	dlls/cryptdll/libcryptdll.$IMPLIBEXT"
+ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS
+dlls/cryptdll/libcryptdll.$IMPLIBEXT dlls/cryptdll/libcryptdll.cross.a: tools/widl tools/winebuild tools/winegcc include
+dlls/cryptdll/libcryptdll.$IMPLIBEXT dlls/cryptdll/libcryptdll.cross.a: dlls/cryptdll/cryptdll.spec dlls/cryptdll/Makefile
+	@cd dlls/cryptdll && \$(MAKE) \`basename \$@\`"
 ALL_MAKEFILES="$ALL_MAKEFILES \\
 	dlls/cryptdll/Makefile"
 test "x$enable_cryptdll" != xno && ALL_DLL_DIRS="$ALL_DLL_DIRS \\
@@ -14333,10 +14350,11 @@ dlls/cryptdll/Makefile: dlls/cryptdll/Makefile.in dlls/Makedll.rules config.stat
 ac_config_files="$ac_config_files dlls/cryptdll/Makefile"
 
 ALL_IMPORT_LIBS="$ALL_IMPORT_LIBS \\
-	cryptnet/libcryptnet.$IMPLIBEXT"
-ALL_IMPORTLIB_RULES="$ALL_IMPORTLIB_RULES
-cryptnet/libcryptnet.def cryptnet/libcryptnet.a cryptnet/libcryptnet.cross.a: cryptnet/cryptnet.spec \$(WINEBUILD)
-	@cd cryptnet && \$(MAKE) \`basename \$@\`"
+	dlls/cryptnet/libcryptnet.$IMPLIBEXT"
+ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS
+dlls/cryptnet/libcryptnet.$IMPLIBEXT dlls/cryptnet/libcryptnet.cross.a: tools/widl tools/winebuild tools/winegcc include
+dlls/cryptnet/libcryptnet.$IMPLIBEXT dlls/cryptnet/libcryptnet.cross.a: dlls/cryptnet/cryptnet.spec dlls/cryptnet/Makefile
+	@cd dlls/cryptnet && \$(MAKE) \`basename \$@\`"
 ALL_MAKEFILES="$ALL_MAKEFILES \\
 	dlls/cryptnet/Makefile"
 test "x$enable_cryptnet" != xno && ALL_DLL_DIRS="$ALL_DLL_DIRS \\
@@ -14362,10 +14380,11 @@ dlls/cryptnet/tests/Makefile: dlls/cryptnet/tests/Makefile.in dlls/Maketest.rule
 ac_config_files="$ac_config_files dlls/cryptnet/tests/Makefile"
 
 ALL_IMPORT_LIBS="$ALL_IMPORT_LIBS \\
-	cryptui/libcryptui.$IMPLIBEXT"
-ALL_IMPORTLIB_RULES="$ALL_IMPORTLIB_RULES
-cryptui/libcryptui.def cryptui/libcryptui.a cryptui/libcryptui.cross.a: cryptui/cryptui.spec \$(WINEBUILD)
-	@cd cryptui && \$(MAKE) \`basename \$@\`"
+	dlls/cryptui/libcryptui.$IMPLIBEXT"
+ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS
+dlls/cryptui/libcryptui.$IMPLIBEXT dlls/cryptui/libcryptui.cross.a: tools/widl tools/winebuild tools/winegcc include
+dlls/cryptui/libcryptui.$IMPLIBEXT dlls/cryptui/libcryptui.cross.a: dlls/cryptui/cryptui.spec dlls/cryptui/Makefile
+	@cd dlls/cryptui && \$(MAKE) \`basename \$@\`"
 ALL_MAKEFILES="$ALL_MAKEFILES \\
 	dlls/cryptui/Makefile"
 test "x$enable_cryptui" != xno && ALL_DLL_DIRS="$ALL_DLL_DIRS \\
@@ -14407,10 +14426,11 @@ dlls/ctl3d.dll16/Makefile: dlls/ctl3d.dll16/Makefile.in dlls/Makedll.rules confi
 ac_config_files="$ac_config_files dlls/ctl3d.dll16/Makefile"
 
 ALL_IMPORT_LIBS="$ALL_IMPORT_LIBS \\
-	ctl3d32/libctl3d32.$IMPLIBEXT"
-ALL_IMPORTLIB_RULES="$ALL_IMPORTLIB_RULES
-ctl3d32/libctl3d32.def ctl3d32/libctl3d32.a ctl3d32/libctl3d32.cross.a: ctl3d32/ctl3d32.spec \$(WINEBUILD)
-	@cd ctl3d32 && \$(MAKE) \`basename \$@\`"
+	dlls/ctl3d32/libctl3d32.$IMPLIBEXT"
+ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS
+dlls/ctl3d32/libctl3d32.$IMPLIBEXT dlls/ctl3d32/libctl3d32.cross.a: tools/widl tools/winebuild tools/winegcc include
+dlls/ctl3d32/libctl3d32.$IMPLIBEXT dlls/ctl3d32/libctl3d32.cross.a: dlls/ctl3d32/ctl3d32.spec dlls/ctl3d32/Makefile
+	@cd dlls/ctl3d32 && \$(MAKE) \`basename \$@\`"
 ALL_MAKEFILES="$ALL_MAKEFILES \\
 	dlls/ctl3d32/Makefile"
 test "x$enable_ctl3d32" != xno && ALL_DLL_DIRS="$ALL_DLL_DIRS \\
@@ -14428,10 +14448,11 @@ dlls/ctl3dv2.dll16/Makefile: dlls/ctl3dv2.dll16/Makefile.in dlls/Makedll.rules c
 ac_config_files="$ac_config_files dlls/ctl3dv2.dll16/Makefile"
 
 ALL_IMPORT_LIBS="$ALL_IMPORT_LIBS \\
-	d3d10/libd3d10.$IMPLIBEXT"
-ALL_IMPORTLIB_RULES="$ALL_IMPORTLIB_RULES
-d3d10/libd3d10.def d3d10/libd3d10.a d3d10/libd3d10.cross.a: d3d10/d3d10.spec \$(WINEBUILD)
-	@cd d3d10 && \$(MAKE) \`basename \$@\`"
+	dlls/d3d10/libd3d10.$IMPLIBEXT"
+ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS
+dlls/d3d10/libd3d10.$IMPLIBEXT dlls/d3d10/libd3d10.cross.a: tools/widl tools/winebuild tools/winegcc include
+dlls/d3d10/libd3d10.$IMPLIBEXT dlls/d3d10/libd3d10.cross.a: dlls/d3d10/d3d10.spec dlls/d3d10/Makefile
+	@cd dlls/d3d10 && \$(MAKE) \`basename \$@\`"
 ALL_MAKEFILES="$ALL_MAKEFILES \\
 	dlls/d3d10/Makefile"
 test "x$enable_d3d10" != xno && ALL_DLL_DIRS="$ALL_DLL_DIRS \\
@@ -14457,10 +14478,11 @@ dlls/d3d10/tests/Makefile: dlls/d3d10/tests/Makefile.in dlls/Maketest.rules conf
 ac_config_files="$ac_config_files dlls/d3d10/tests/Makefile"
 
 ALL_IMPORT_LIBS="$ALL_IMPORT_LIBS \\
-	d3d10core/libd3d10core.$IMPLIBEXT"
-ALL_IMPORTLIB_RULES="$ALL_IMPORTLIB_RULES
-d3d10core/libd3d10core.def d3d10core/libd3d10core.a d3d10core/libd3d10core.cross.a: d3d10core/d3d10core.spec \$(WINEBUILD)
-	@cd d3d10core && \$(MAKE) \`basename \$@\`"
+	dlls/d3d10core/libd3d10core.$IMPLIBEXT"
+ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS
+dlls/d3d10core/libd3d10core.$IMPLIBEXT dlls/d3d10core/libd3d10core.cross.a: tools/widl tools/winebuild tools/winegcc include
+dlls/d3d10core/libd3d10core.$IMPLIBEXT dlls/d3d10core/libd3d10core.cross.a: dlls/d3d10core/d3d10core.spec dlls/d3d10core/Makefile
+	@cd dlls/d3d10core && \$(MAKE) \`basename \$@\`"
 ALL_MAKEFILES="$ALL_MAKEFILES \\
 	dlls/d3d10core/Makefile"
 test "x$enable_d3d10core" != xno && ALL_DLL_DIRS="$ALL_DLL_DIRS \\
@@ -14486,10 +14508,11 @@ dlls/d3d10core/tests/Makefile: dlls/d3d10core/tests/Makefile.in dlls/Maketest.ru
 ac_config_files="$ac_config_files dlls/d3d10core/tests/Makefile"
 
 ALL_IMPORT_LIBS="$ALL_IMPORT_LIBS \\
-	d3d8/libd3d8.$IMPLIBEXT"
-ALL_IMPORTLIB_RULES="$ALL_IMPORTLIB_RULES
-d3d8/libd3d8.def d3d8/libd3d8.a d3d8/libd3d8.cross.a: d3d8/d3d8.spec \$(WINEBUILD)
-	@cd d3d8 && \$(MAKE) \`basename \$@\`"
+	dlls/d3d8/libd3d8.$IMPLIBEXT"
+ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS
+dlls/d3d8/libd3d8.$IMPLIBEXT dlls/d3d8/libd3d8.cross.a: tools/widl tools/winebuild tools/winegcc include
+dlls/d3d8/libd3d8.$IMPLIBEXT dlls/d3d8/libd3d8.cross.a: dlls/d3d8/d3d8.spec dlls/d3d8/Makefile
+	@cd dlls/d3d8 && \$(MAKE) \`basename \$@\`"
 ALL_MAKEFILES="$ALL_MAKEFILES \\
 	dlls/d3d8/Makefile"
 test "x$enable_d3d8" != xno && ALL_DLL_DIRS="$ALL_DLL_DIRS \\
@@ -14515,10 +14538,11 @@ dlls/d3d8/tests/Makefile: dlls/d3d8/tests/Makefile.in dlls/Maketest.rules config
 ac_config_files="$ac_config_files dlls/d3d8/tests/Makefile"
 
 ALL_IMPORT_LIBS="$ALL_IMPORT_LIBS \\
-	d3d9/libd3d9.$IMPLIBEXT"
-ALL_IMPORTLIB_RULES="$ALL_IMPORTLIB_RULES
-d3d9/libd3d9.def d3d9/libd3d9.a d3d9/libd3d9.cross.a: d3d9/d3d9.spec \$(WINEBUILD)
-	@cd d3d9 && \$(MAKE) \`basename \$@\`"
+	dlls/d3d9/libd3d9.$IMPLIBEXT"
+ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS
+dlls/d3d9/libd3d9.$IMPLIBEXT dlls/d3d9/libd3d9.cross.a: tools/widl tools/winebuild tools/winegcc include
+dlls/d3d9/libd3d9.$IMPLIBEXT dlls/d3d9/libd3d9.cross.a: dlls/d3d9/d3d9.spec dlls/d3d9/Makefile
+	@cd dlls/d3d9 && \$(MAKE) \`basename \$@\`"
 ALL_MAKEFILES="$ALL_MAKEFILES \\
 	dlls/d3d9/Makefile"
 test "x$enable_d3d9" != xno && ALL_DLL_DIRS="$ALL_DLL_DIRS \\
@@ -14544,10 +14568,11 @@ dlls/d3d9/tests/Makefile: dlls/d3d9/tests/Makefile.in dlls/Maketest.rules config
 ac_config_files="$ac_config_files dlls/d3d9/tests/Makefile"
 
 ALL_IMPORT_LIBS="$ALL_IMPORT_LIBS \\
-	d3dim/libd3dim.$IMPLIBEXT"
-ALL_IMPORTLIB_RULES="$ALL_IMPORTLIB_RULES
-d3dim/libd3dim.def d3dim/libd3dim.a d3dim/libd3dim.cross.a: d3dim/d3dim.spec \$(WINEBUILD)
-	@cd d3dim && \$(MAKE) \`basename \$@\`"
+	dlls/d3dim/libd3dim.$IMPLIBEXT"
+ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS
+dlls/d3dim/libd3dim.$IMPLIBEXT dlls/d3dim/libd3dim.cross.a: tools/widl tools/winebuild tools/winegcc include
+dlls/d3dim/libd3dim.$IMPLIBEXT dlls/d3dim/libd3dim.cross.a: dlls/d3dim/d3dim.spec dlls/d3dim/Makefile
+	@cd dlls/d3dim && \$(MAKE) \`basename \$@\`"
 ALL_MAKEFILES="$ALL_MAKEFILES \\
 	dlls/d3dim/Makefile"
 test "x$enable_d3dim" != xno && ALL_DLL_DIRS="$ALL_DLL_DIRS \\
@@ -14557,10 +14582,11 @@ dlls/d3dim/Makefile: dlls/d3dim/Makefile.in dlls/Makedll.rules config.status"
 ac_config_files="$ac_config_files dlls/d3dim/Makefile"
 
 ALL_IMPORT_LIBS="$ALL_IMPORT_LIBS \\
-	d3drm/libd3drm.$IMPLIBEXT"
-ALL_IMPORTLIB_RULES="$ALL_IMPORTLIB_RULES
-d3drm/libd3drm.def d3drm/libd3drm.a d3drm/libd3drm.cross.a: d3drm/d3drm.spec \$(WINEBUILD)
-	@cd d3drm && \$(MAKE) \`basename \$@\`"
+	dlls/d3drm/libd3drm.$IMPLIBEXT"
+ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS
+dlls/d3drm/libd3drm.$IMPLIBEXT dlls/d3drm/libd3drm.cross.a: tools/widl tools/winebuild tools/winegcc include
+dlls/d3drm/libd3drm.$IMPLIBEXT dlls/d3drm/libd3drm.cross.a: dlls/d3drm/d3drm.spec dlls/d3drm/Makefile
+	@cd dlls/d3drm && \$(MAKE) \`basename \$@\`"
 ALL_MAKEFILES="$ALL_MAKEFILES \\
 	dlls/d3drm/Makefile"
 test "x$enable_d3drm" != xno && ALL_DLL_DIRS="$ALL_DLL_DIRS \\
@@ -14682,19 +14708,20 @@ dlls/d3dx9_35/Makefile: dlls/d3dx9_35/Makefile.in dlls/Makedll.rules config.stat
 ac_config_files="$ac_config_files dlls/d3dx9_35/Makefile"
 
 ALL_IMPORT_LIBS="$ALL_IMPORT_LIBS \\
-	d3dx9_36/libd3dx9.$IMPLIBEXT \\
-	libd3dx9.$IMPLIBEXT"
-ALL_IMPORTLIB_RULES="$ALL_IMPORTLIB_RULES
-libd3dx9.a: d3dx9_36/libd3dx9.a
+	dlls/d3dx9_36/libd3dx9.$IMPLIBEXT \\
+	dlls/libd3dx9.$IMPLIBEXT"
+ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS
+dlls/d3dx9_36/libd3dx9.$IMPLIBEXT dlls/d3dx9_36/libd3dx9.cross.a: tools/widl tools/winebuild tools/winegcc include
+dlls/libd3dx9.a: dlls/d3dx9_36/libd3dx9.a
 	\$(RM) \$@ && \$(LN_S) d3dx9_36/libd3dx9.a \$@
-libd3dx9.cross.a: d3dx9_36/libd3dx9.cross.a
+dlls/libd3dx9.cross.a: dlls/d3dx9_36/libd3dx9.cross.a
 	\$(RM) \$@ && \$(LN_S) d3dx9_36/libd3dx9.cross.a \$@
-libd3dx9.def: d3dx9_36/libd3dx9.def
+dlls/libd3dx9.def: dlls/d3dx9_36/libd3dx9.def
 	\$(RM) \$@ && \$(LN_S) d3dx9_36/libd3dx9.def \$@
 clean::
-	\$(RM) libd3dx9.def
-d3dx9_36/libd3dx9.def d3dx9_36/libd3dx9.a d3dx9_36/libd3dx9.cross.a: d3dx9_36/d3dx9_36.spec \$(WINEBUILD)
-	@cd d3dx9_36 && \$(MAKE) \`basename \$@\`"
+	\$(RM) dlls/libd3dx9.def
+dlls/d3dx9_36/libd3dx9.$IMPLIBEXT dlls/d3dx9_36/libd3dx9.cross.a: dlls/d3dx9_36/d3dx9_36.spec dlls/d3dx9_36/Makefile
+	@cd dlls/d3dx9_36 && \$(MAKE) \`basename \$@\`"
 ALL_MAKEFILES="$ALL_MAKEFILES \\
 	dlls/d3dx9_36/Makefile"
 test "x$enable_d3dx9_36" != xno && ALL_DLL_DIRS="$ALL_DLL_DIRS \\
@@ -14768,10 +14795,11 @@ dlls/d3dx9_42/Makefile: dlls/d3dx9_42/Makefile.in dlls/Makedll.rules config.stat
 ac_config_files="$ac_config_files dlls/d3dx9_42/Makefile"
 
 ALL_IMPORT_LIBS="$ALL_IMPORT_LIBS \\
-	d3dxof/libd3dxof.$IMPLIBEXT"
-ALL_IMPORTLIB_RULES="$ALL_IMPORTLIB_RULES
-d3dxof/libd3dxof.def d3dxof/libd3dxof.a d3dxof/libd3dxof.cross.a: d3dxof/d3dxof.spec \$(WINEBUILD)
-	@cd d3dxof && \$(MAKE) \`basename \$@\`"
+	dlls/d3dxof/libd3dxof.$IMPLIBEXT"
+ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS
+dlls/d3dxof/libd3dxof.$IMPLIBEXT dlls/d3dxof/libd3dxof.cross.a: tools/widl tools/winebuild tools/winegcc include
+dlls/d3dxof/libd3dxof.$IMPLIBEXT dlls/d3dxof/libd3dxof.cross.a: dlls/d3dxof/d3dxof.spec dlls/d3dxof/Makefile
+	@cd dlls/d3dxof && \$(MAKE) \`basename \$@\`"
 ALL_MAKEFILES="$ALL_MAKEFILES \\
 	dlls/d3dxof/Makefile"
 test "x$enable_d3dxof" != xno && ALL_DLL_DIRS="$ALL_DLL_DIRS \\
@@ -14797,10 +14825,11 @@ dlls/d3dxof/tests/Makefile: dlls/d3dxof/tests/Makefile.in dlls/Maketest.rules co
 ac_config_files="$ac_config_files dlls/d3dxof/tests/Makefile"
 
 ALL_IMPORT_LIBS="$ALL_IMPORT_LIBS \\
-	dbghelp/libdbghelp.$IMPLIBEXT"
-ALL_IMPORTLIB_RULES="$ALL_IMPORTLIB_RULES
-dbghelp/libdbghelp.def dbghelp/libdbghelp.a dbghelp/libdbghelp.cross.a: dbghelp/dbghelp.spec \$(WINEBUILD)
-	@cd dbghelp && \$(MAKE) \`basename \$@\`"
+	dlls/dbghelp/libdbghelp.$IMPLIBEXT"
+ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS
+dlls/dbghelp/libdbghelp.$IMPLIBEXT dlls/dbghelp/libdbghelp.cross.a: tools/widl tools/winebuild tools/winegcc include
+dlls/dbghelp/libdbghelp.$IMPLIBEXT dlls/dbghelp/libdbghelp.cross.a: dlls/dbghelp/dbghelp.spec dlls/dbghelp/Makefile
+	@cd dlls/dbghelp && \$(MAKE) \`basename \$@\`"
 ALL_MAKEFILES="$ALL_MAKEFILES \\
 	dlls/dbghelp/Makefile"
 test "x$enable_dbghelp" != xno && ALL_DLL_DIRS="$ALL_DLL_DIRS \\
@@ -14810,10 +14839,11 @@ dlls/dbghelp/Makefile: dlls/dbghelp/Makefile.in dlls/Makedll.rules config.status
 ac_config_files="$ac_config_files dlls/dbghelp/Makefile"
 
 ALL_IMPORT_LIBS="$ALL_IMPORT_LIBS \\
-	dciman32/libdciman32.$IMPLIBEXT"
-ALL_IMPORTLIB_RULES="$ALL_IMPORTLIB_RULES
-dciman32/libdciman32.def dciman32/libdciman32.a dciman32/libdciman32.cross.a: dciman32/dciman32.spec \$(WINEBUILD)
-	@cd dciman32 && \$(MAKE) \`basename \$@\`"
+	dlls/dciman32/libdciman32.$IMPLIBEXT"
+ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS
+dlls/dciman32/libdciman32.$IMPLIBEXT dlls/dciman32/libdciman32.cross.a: tools/widl tools/winebuild tools/winegcc include
+dlls/dciman32/libdciman32.$IMPLIBEXT dlls/dciman32/libdciman32.cross.a: dlls/dciman32/dciman32.spec dlls/dciman32/Makefile
+	@cd dlls/dciman32 && \$(MAKE) \`basename \$@\`"
 ALL_MAKEFILES="$ALL_MAKEFILES \\
 	dlls/dciman32/Makefile"
 test "x$enable_dciman32" != xno && ALL_DLL_DIRS="$ALL_DLL_DIRS \\
@@ -14831,10 +14861,11 @@ dlls/ddeml.dll16/Makefile: dlls/ddeml.dll16/Makefile.in dlls/Makedll.rules confi
 ac_config_files="$ac_config_files dlls/ddeml.dll16/Makefile"
 
 ALL_IMPORT_LIBS="$ALL_IMPORT_LIBS \\
-	ddraw/libddraw.$IMPLIBEXT"
-ALL_IMPORTLIB_RULES="$ALL_IMPORTLIB_RULES
-ddraw/libddraw.def ddraw/libddraw.a ddraw/libddraw.cross.a: ddraw/ddraw.spec \$(WINEBUILD)
-	@cd ddraw && \$(MAKE) \`basename \$@\`"
+	dlls/ddraw/libddraw.$IMPLIBEXT"
+ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS
+dlls/ddraw/libddraw.$IMPLIBEXT dlls/ddraw/libddraw.cross.a: tools/widl tools/winebuild tools/winegcc include
+dlls/ddraw/libddraw.$IMPLIBEXT dlls/ddraw/libddraw.cross.a: dlls/ddraw/ddraw.spec dlls/ddraw/Makefile
+	@cd dlls/ddraw && \$(MAKE) \`basename \$@\`"
 ALL_MAKEFILES="$ALL_MAKEFILES \\
 	dlls/ddraw/Makefile"
 test "x$enable_ddraw" != xno && ALL_DLL_DIRS="$ALL_DLL_DIRS \\
@@ -14892,13 +14923,14 @@ dlls/devenum/Makefile: dlls/devenum/Makefile.in dlls/Makedll.rules config.status
 ac_config_files="$ac_config_files dlls/devenum/Makefile"
 
 ALL_IMPORT_LIBS="$ALL_IMPORT_LIBS \\
-	dinput/libdinput.$IMPLIBEXT \\
-	dinput/libdinput.$STATIC_IMPLIBEXT"
-ALL_IMPORTLIB_RULES="$ALL_IMPORTLIB_RULES
-dinput/libdinput.def: dinput/dinput.spec \$(WINEBUILD)
-	@cd dinput && \$(MAKE) \`basename \$@\`
-dinput/libdinput.$STATIC_IMPLIBEXT dinput/libdinput.cross.a: dummy
-	@cd dinput && \$(MAKE) \`basename \$@\`"
+	dlls/dinput/libdinput.$IMPLIBEXT \\
+	dlls/dinput/libdinput.$STATIC_IMPLIBEXT"
+ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS
+dlls/dinput/libdinput.$IMPLIBEXT dlls/dinput/libdinput.$STATIC_IMPLIBEXT dlls/dinput/libdinput.cross.a: tools/widl tools/winebuild tools/winegcc include
+dlls/dinput/libdinput.def: dlls/dinput/dinput.spec dlls/dinput/Makefile
+	@cd dlls/dinput && \$(MAKE) \`basename \$@\`
+dlls/dinput/libdinput.$STATIC_IMPLIBEXT dlls/dinput/libdinput.cross.a: dlls/dinput/Makefile dummy
+	@cd dlls/dinput && \$(MAKE) \`basename \$@\`"
 ALL_MAKEFILES="$ALL_MAKEFILES \\
 	dlls/dinput/Makefile"
 test "x$enable_dinput" != xno && ALL_DLL_DIRS="$ALL_DLL_DIRS \\
@@ -14924,10 +14956,11 @@ dlls/dinput/tests/Makefile: dlls/dinput/tests/Makefile.in dlls/Maketest.rules co
 ac_config_files="$ac_config_files dlls/dinput/tests/Makefile"
 
 ALL_IMPORT_LIBS="$ALL_IMPORT_LIBS \\
-	dinput8/libdinput8.$IMPLIBEXT"
-ALL_IMPORTLIB_RULES="$ALL_IMPORTLIB_RULES
-dinput8/libdinput8.def dinput8/libdinput8.a dinput8/libdinput8.cross.a: dinput8/dinput8.spec \$(WINEBUILD)
-	@cd dinput8 && \$(MAKE) \`basename \$@\`"
+	dlls/dinput8/libdinput8.$IMPLIBEXT"
+ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS
+dlls/dinput8/libdinput8.$IMPLIBEXT dlls/dinput8/libdinput8.cross.a: tools/widl tools/winebuild tools/winegcc include
+dlls/dinput8/libdinput8.$IMPLIBEXT dlls/dinput8/libdinput8.cross.a: dlls/dinput8/dinput8.spec dlls/dinput8/Makefile
+	@cd dlls/dinput8 && \$(MAKE) \`basename \$@\`"
 ALL_MAKEFILES="$ALL_MAKEFILES \\
 	dlls/dinput8/Makefile"
 test "x$enable_dinput8" != xno && ALL_DLL_DIRS="$ALL_DLL_DIRS \\
@@ -15033,10 +15066,11 @@ dlls/dmusic/Makefile: dlls/dmusic/Makefile.in dlls/Makedll.rules config.status"
 ac_config_files="$ac_config_files dlls/dmusic/Makefile"
 
 ALL_IMPORT_LIBS="$ALL_IMPORT_LIBS \\
-	dmusic32/libdmusic32.$IMPLIBEXT"
-ALL_IMPORTLIB_RULES="$ALL_IMPORTLIB_RULES
-dmusic32/libdmusic32.def dmusic32/libdmusic32.a dmusic32/libdmusic32.cross.a: dmusic32/dmusic32.spec \$(WINEBUILD)
-	@cd dmusic32 && \$(MAKE) \`basename \$@\`"
+	dlls/dmusic32/libdmusic32.$IMPLIBEXT"
+ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS
+dlls/dmusic32/libdmusic32.$IMPLIBEXT dlls/dmusic32/libdmusic32.cross.a: tools/widl tools/winebuild tools/winegcc include
+dlls/dmusic32/libdmusic32.$IMPLIBEXT dlls/dmusic32/libdmusic32.cross.a: dlls/dmusic32/dmusic32.spec dlls/dmusic32/Makefile
+	@cd dlls/dmusic32 && \$(MAKE) \`basename \$@\`"
 ALL_MAKEFILES="$ALL_MAKEFILES \\
 	dlls/dmusic32/Makefile"
 test "x$enable_dmusic32" != xno && ALL_DLL_DIRS="$ALL_DLL_DIRS \\
@@ -15046,10 +15080,11 @@ dlls/dmusic32/Makefile: dlls/dmusic32/Makefile.in dlls/Makedll.rules config.stat
 ac_config_files="$ac_config_files dlls/dmusic32/Makefile"
 
 ALL_IMPORT_LIBS="$ALL_IMPORT_LIBS \\
-	dnsapi/libdnsapi.$IMPLIBEXT"
-ALL_IMPORTLIB_RULES="$ALL_IMPORTLIB_RULES
-dnsapi/libdnsapi.def dnsapi/libdnsapi.a dnsapi/libdnsapi.cross.a: dnsapi/dnsapi.spec \$(WINEBUILD)
-	@cd dnsapi && \$(MAKE) \`basename \$@\`"
+	dlls/dnsapi/libdnsapi.$IMPLIBEXT"
+ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS
+dlls/dnsapi/libdnsapi.$IMPLIBEXT dlls/dnsapi/libdnsapi.cross.a: tools/widl tools/winebuild tools/winegcc include
+dlls/dnsapi/libdnsapi.$IMPLIBEXT dlls/dnsapi/libdnsapi.cross.a: dlls/dnsapi/dnsapi.spec dlls/dnsapi/Makefile
+	@cd dlls/dnsapi && \$(MAKE) \`basename \$@\`"
 ALL_MAKEFILES="$ALL_MAKEFILES \\
 	dlls/dnsapi/Makefile"
 test "x$enable_dnsapi" != xno && ALL_DLL_DIRS="$ALL_DLL_DIRS \\
@@ -15075,10 +15110,11 @@ dlls/dnsapi/tests/Makefile: dlls/dnsapi/tests/Makefile.in dlls/Maketest.rules co
 ac_config_files="$ac_config_files dlls/dnsapi/tests/Makefile"
 
 ALL_IMPORT_LIBS="$ALL_IMPORT_LIBS \\
-	dplay/libdplay.$IMPLIBEXT"
-ALL_IMPORTLIB_RULES="$ALL_IMPORTLIB_RULES
-dplay/libdplay.def dplay/libdplay.a dplay/libdplay.cross.a: dplay/dplay.spec \$(WINEBUILD)
-	@cd dplay && \$(MAKE) \`basename \$@\`"
+	dlls/dplay/libdplay.$IMPLIBEXT"
+ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS
+dlls/dplay/libdplay.$IMPLIBEXT dlls/dplay/libdplay.cross.a: tools/widl tools/winebuild tools/winegcc include
+dlls/dplay/libdplay.$IMPLIBEXT dlls/dplay/libdplay.cross.a: dlls/dplay/dplay.spec dlls/dplay/Makefile
+	@cd dlls/dplay && \$(MAKE) \`basename \$@\`"
 ALL_MAKEFILES="$ALL_MAKEFILES \\
 	dlls/dplay/Makefile"
 test "x$enable_dplay" != xno && ALL_DLL_DIRS="$ALL_DLL_DIRS \\
@@ -15088,10 +15124,11 @@ dlls/dplay/Makefile: dlls/dplay/Makefile.in dlls/Makedll.rules config.status"
 ac_config_files="$ac_config_files dlls/dplay/Makefile"
 
 ALL_IMPORT_LIBS="$ALL_IMPORT_LIBS \\
-	dplayx/libdplayx.$IMPLIBEXT"
-ALL_IMPORTLIB_RULES="$ALL_IMPORTLIB_RULES
-dplayx/libdplayx.def dplayx/libdplayx.a dplayx/libdplayx.cross.a: dplayx/dplayx.spec \$(WINEBUILD)
-	@cd dplayx && \$(MAKE) \`basename \$@\`"
+	dlls/dplayx/libdplayx.$IMPLIBEXT"
+ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS
+dlls/dplayx/libdplayx.$IMPLIBEXT dlls/dplayx/libdplayx.cross.a: tools/widl tools/winebuild tools/winegcc include
+dlls/dplayx/libdplayx.$IMPLIBEXT dlls/dplayx/libdplayx.cross.a: dlls/dplayx/dplayx.spec dlls/dplayx/Makefile
+	@cd dlls/dplayx && \$(MAKE) \`basename \$@\`"
 ALL_MAKEFILES="$ALL_MAKEFILES \\
 	dlls/dplayx/Makefile"
 test "x$enable_dplayx" != xno && ALL_DLL_DIRS="$ALL_DLL_DIRS \\
@@ -15125,10 +15162,11 @@ dlls/dpnaddr/Makefile: dlls/dpnaddr/Makefile.in dlls/Makedll.rules config.status
 ac_config_files="$ac_config_files dlls/dpnaddr/Makefile"
 
 ALL_IMPORT_LIBS="$ALL_IMPORT_LIBS \\
-	dpnet/libdpnet.$IMPLIBEXT"
-ALL_IMPORTLIB_RULES="$ALL_IMPORTLIB_RULES
-dpnet/libdpnet.def dpnet/libdpnet.a dpnet/libdpnet.cross.a: dpnet/dpnet.spec \$(WINEBUILD)
-	@cd dpnet && \$(MAKE) \`basename \$@\`"
+	dlls/dpnet/libdpnet.$IMPLIBEXT"
+ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS
+dlls/dpnet/libdpnet.$IMPLIBEXT dlls/dpnet/libdpnet.cross.a: tools/widl tools/winebuild tools/winegcc include
+dlls/dpnet/libdpnet.$IMPLIBEXT dlls/dpnet/libdpnet.cross.a: dlls/dpnet/dpnet.spec dlls/dpnet/Makefile
+	@cd dlls/dpnet && \$(MAKE) \`basename \$@\`"
 ALL_MAKEFILES="$ALL_MAKEFILES \\
 	dlls/dpnet/Makefile"
 test "x$enable_dpnet" != xno && ALL_DLL_DIRS="$ALL_DLL_DIRS \\
@@ -15170,10 +15208,11 @@ dlls/drmclien/Makefile: dlls/drmclien/Makefile.in dlls/Makedll.rules config.stat
 ac_config_files="$ac_config_files dlls/drmclien/Makefile"
 
 ALL_IMPORT_LIBS="$ALL_IMPORT_LIBS \\
-	dsound/libdsound.$IMPLIBEXT"
-ALL_IMPORTLIB_RULES="$ALL_IMPORTLIB_RULES
-dsound/libdsound.def dsound/libdsound.a dsound/libdsound.cross.a: dsound/dsound.spec \$(WINEBUILD)
-	@cd dsound && \$(MAKE) \`basename \$@\`"
+	dlls/dsound/libdsound.$IMPLIBEXT"
+ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS
+dlls/dsound/libdsound.$IMPLIBEXT dlls/dsound/libdsound.cross.a: tools/widl tools/winebuild tools/winegcc include
+dlls/dsound/libdsound.$IMPLIBEXT dlls/dsound/libdsound.cross.a: dlls/dsound/dsound.spec dlls/dsound/Makefile
+	@cd dlls/dsound && \$(MAKE) \`basename \$@\`"
 ALL_MAKEFILES="$ALL_MAKEFILES \\
 	dlls/dsound/Makefile"
 test "x$enable_dsound" != xno && ALL_DLL_DIRS="$ALL_DLL_DIRS \\
@@ -15215,10 +15254,11 @@ dlls/dswave/Makefile: dlls/dswave/Makefile.in dlls/Makedll.rules config.status"
 ac_config_files="$ac_config_files dlls/dswave/Makefile"
 
 ALL_IMPORT_LIBS="$ALL_IMPORT_LIBS \\
-	dwmapi/libdwmapi.$IMPLIBEXT"
-ALL_IMPORTLIB_RULES="$ALL_IMPORTLIB_RULES
-dwmapi/libdwmapi.def dwmapi/libdwmapi.a dwmapi/libdwmapi.cross.a: dwmapi/dwmapi.spec \$(WINEBUILD)
-	@cd dwmapi && \$(MAKE) \`basename \$@\`"
+	dlls/dwmapi/libdwmapi.$IMPLIBEXT"
+ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS
+dlls/dwmapi/libdwmapi.$IMPLIBEXT dlls/dwmapi/libdwmapi.cross.a: tools/widl tools/winebuild tools/winegcc include
+dlls/dwmapi/libdwmapi.$IMPLIBEXT dlls/dwmapi/libdwmapi.cross.a: dlls/dwmapi/dwmapi.spec dlls/dwmapi/Makefile
+	@cd dlls/dwmapi && \$(MAKE) \`basename \$@\`"
 ALL_MAKEFILES="$ALL_MAKEFILES \\
 	dlls/dwmapi/Makefile"
 test "x$enable_dwmapi" != xno && ALL_DLL_DIRS="$ALL_DLL_DIRS \\
@@ -15284,10 +15324,11 @@ dlls/dxerr9/Makefile: dlls/dxerr9/Makefile.in dlls/Makeimplib.rules config.statu
 ac_config_files="$ac_config_files dlls/dxerr9/Makefile"
 
 ALL_IMPORT_LIBS="$ALL_IMPORT_LIBS \\
-	dxgi/libdxgi.$IMPLIBEXT"
-ALL_IMPORTLIB_RULES="$ALL_IMPORTLIB_RULES
-dxgi/libdxgi.def dxgi/libdxgi.a dxgi/libdxgi.cross.a: dxgi/dxgi.spec \$(WINEBUILD)
-	@cd dxgi && \$(MAKE) \`basename \$@\`"
+	dlls/dxgi/libdxgi.$IMPLIBEXT"
+ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS
+dlls/dxgi/libdxgi.$IMPLIBEXT dlls/dxgi/libdxgi.cross.a: tools/widl tools/winebuild tools/winegcc include
+dlls/dxgi/libdxgi.$IMPLIBEXT dlls/dxgi/libdxgi.cross.a: dlls/dxgi/dxgi.spec dlls/dxgi/Makefile
+	@cd dlls/dxgi && \$(MAKE) \`basename \$@\`"
 ALL_MAKEFILES="$ALL_MAKEFILES \\
 	dlls/dxgi/Makefile"
 test "x$enable_dxgi" != xno && ALL_DLL_DIRS="$ALL_DLL_DIRS \\
@@ -15385,10 +15426,11 @@ dlls/gdi.exe16/Makefile: dlls/gdi.exe16/Makefile.in dlls/Makedll.rules config.st
 ac_config_files="$ac_config_files dlls/gdi.exe16/Makefile"
 
 ALL_IMPORT_LIBS="$ALL_IMPORT_LIBS \\
-	gdi32/libgdi32.$IMPLIBEXT"
-ALL_IMPORTLIB_RULES="$ALL_IMPORTLIB_RULES
-gdi32/libgdi32.def gdi32/libgdi32.a gdi32/libgdi32.cross.a: gdi32/gdi32.spec \$(WINEBUILD)
-	@cd gdi32 && \$(MAKE) \`basename \$@\`"
+	dlls/gdi32/libgdi32.$IMPLIBEXT"
+ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS
+dlls/gdi32/libgdi32.$IMPLIBEXT dlls/gdi32/libgdi32.cross.a: tools/widl tools/winebuild tools/winegcc include
+dlls/gdi32/libgdi32.$IMPLIBEXT dlls/gdi32/libgdi32.cross.a: dlls/gdi32/gdi32.spec dlls/gdi32/Makefile
+	@cd dlls/gdi32 && \$(MAKE) \`basename \$@\`"
 ALL_MAKEFILES="$ALL_MAKEFILES \\
 	dlls/gdi32/Makefile"
 test "x$enable_gdi32" != xno && ALL_DLL_DIRS="$ALL_DLL_DIRS \\
@@ -15414,10 +15456,11 @@ dlls/gdi32/tests/Makefile: dlls/gdi32/tests/Makefile.in dlls/Maketest.rules conf
 ac_config_files="$ac_config_files dlls/gdi32/tests/Makefile"
 
 ALL_IMPORT_LIBS="$ALL_IMPORT_LIBS \\
-	gdiplus/libgdiplus.$IMPLIBEXT"
-ALL_IMPORTLIB_RULES="$ALL_IMPORTLIB_RULES
-gdiplus/libgdiplus.def gdiplus/libgdiplus.a gdiplus/libgdiplus.cross.a: gdiplus/gdiplus.spec \$(WINEBUILD)
-	@cd gdiplus && \$(MAKE) \`basename \$@\`"
+	dlls/gdiplus/libgdiplus.$IMPLIBEXT"
+ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS
+dlls/gdiplus/libgdiplus.$IMPLIBEXT dlls/gdiplus/libgdiplus.cross.a: tools/widl tools/winebuild tools/winegcc include
+dlls/gdiplus/libgdiplus.$IMPLIBEXT dlls/gdiplus/libgdiplus.cross.a: dlls/gdiplus/gdiplus.spec dlls/gdiplus/Makefile
+	@cd dlls/gdiplus && \$(MAKE) \`basename \$@\`"
 ALL_MAKEFILES="$ALL_MAKEFILES \\
 	dlls/gdiplus/Makefile"
 test "x$enable_gdiplus" != xno && ALL_DLL_DIRS="$ALL_DLL_DIRS \\
@@ -15443,10 +15486,11 @@ dlls/gdiplus/tests/Makefile: dlls/gdiplus/tests/Makefile.in dlls/Maketest.rules
 ac_config_files="$ac_config_files dlls/gdiplus/tests/Makefile"
 
 ALL_IMPORT_LIBS="$ALL_IMPORT_LIBS \\
-	glu32/libglu32.$IMPLIBEXT"
-ALL_IMPORTLIB_RULES="$ALL_IMPORTLIB_RULES
-glu32/libglu32.def glu32/libglu32.a glu32/libglu32.cross.a: glu32/glu32.spec \$(WINEBUILD)
-	@cd glu32 && \$(MAKE) \`basename \$@\`"
+	dlls/glu32/libglu32.$IMPLIBEXT"
+ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS
+dlls/glu32/libglu32.$IMPLIBEXT dlls/glu32/libglu32.cross.a: tools/widl tools/winebuild tools/winegcc include
+dlls/glu32/libglu32.$IMPLIBEXT dlls/glu32/libglu32.cross.a: dlls/glu32/glu32.spec dlls/glu32/Makefile
+	@cd dlls/glu32 && \$(MAKE) \`basename \$@\`"
 ALL_MAKEFILES="$ALL_MAKEFILES \\
 	dlls/glu32/Makefile"
 test "x$enable_glu32" != xno && ALL_DLL_DIRS="$ALL_DLL_DIRS \\
@@ -15488,10 +15532,11 @@ dlls/hhctrl.ocx/Makefile: dlls/hhctrl.ocx/Makefile.in dlls/Makedll.rules config.
 ac_config_files="$ac_config_files dlls/hhctrl.ocx/Makefile"
 
 ALL_IMPORT_LIBS="$ALL_IMPORT_LIBS \\
-	hid/libhid.$IMPLIBEXT"
-ALL_IMPORTLIB_RULES="$ALL_IMPORTLIB_RULES
-hid/libhid.def hid/libhid.a hid/libhid.cross.a: hid/hid.spec \$(WINEBUILD)
-	@cd hid && \$(MAKE) \`basename \$@\`"
+	dlls/hid/libhid.$IMPLIBEXT"
+ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS
+dlls/hid/libhid.$IMPLIBEXT dlls/hid/libhid.cross.a: tools/widl tools/winebuild tools/winegcc include
+dlls/hid/libhid.$IMPLIBEXT dlls/hid/libhid.cross.a: dlls/hid/hid.spec dlls/hid/Makefile
+	@cd dlls/hid && \$(MAKE) \`basename \$@\`"
 ALL_MAKEFILES="$ALL_MAKEFILES \\
 	dlls/hid/Makefile"
 test "x$enable_hid" != xno && ALL_DLL_DIRS="$ALL_DLL_DIRS \\
@@ -15501,10 +15546,11 @@ dlls/hid/Makefile: dlls/hid/Makefile.in dlls/Makedll.rules config.status"
 ac_config_files="$ac_config_files dlls/hid/Makefile"
 
 ALL_IMPORT_LIBS="$ALL_IMPORT_LIBS \\
-	hlink/libhlink.$IMPLIBEXT"
-ALL_IMPORTLIB_RULES="$ALL_IMPORTLIB_RULES
-hlink/libhlink.def hlink/libhlink.a hlink/libhlink.cross.a: hlink/hlink.spec \$(WINEBUILD)
-	@cd hlink && \$(MAKE) \`basename \$@\`"
+	dlls/hlink/libhlink.$IMPLIBEXT"
+ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS
+dlls/hlink/libhlink.$IMPLIBEXT dlls/hlink/libhlink.cross.a: tools/widl tools/winebuild tools/winegcc include
+dlls/hlink/libhlink.$IMPLIBEXT dlls/hlink/libhlink.cross.a: dlls/hlink/hlink.spec dlls/hlink/Makefile
+	@cd dlls/hlink && \$(MAKE) \`basename \$@\`"
 ALL_MAKEFILES="$ALL_MAKEFILES \\
 	dlls/hlink/Makefile"
 test "x$enable_hlink" != xno && ALL_DLL_DIRS="$ALL_DLL_DIRS \\
@@ -15578,10 +15624,11 @@ dlls/imaadp32.acm/Makefile: dlls/imaadp32.acm/Makefile.in dlls/Makedll.rules con
 ac_config_files="$ac_config_files dlls/imaadp32.acm/Makefile"
 
 ALL_IMPORT_LIBS="$ALL_IMPORT_LIBS \\
-	imagehlp/libimagehlp.$IMPLIBEXT"
-ALL_IMPORTLIB_RULES="$ALL_IMPORTLIB_RULES
-imagehlp/libimagehlp.def imagehlp/libimagehlp.a imagehlp/libimagehlp.cross.a: imagehlp/imagehlp.spec \$(WINEBUILD)
-	@cd imagehlp && \$(MAKE) \`basename \$@\`"
+	dlls/imagehlp/libimagehlp.$IMPLIBEXT"
+ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS
+dlls/imagehlp/libimagehlp.$IMPLIBEXT dlls/imagehlp/libimagehlp.cross.a: tools/widl tools/winebuild tools/winegcc include
+dlls/imagehlp/libimagehlp.$IMPLIBEXT dlls/imagehlp/libimagehlp.cross.a: dlls/imagehlp/imagehlp.spec dlls/imagehlp/Makefile
+	@cd dlls/imagehlp && \$(MAKE) \`basename \$@\`"
 ALL_MAKEFILES="$ALL_MAKEFILES \\
 	dlls/imagehlp/Makefile"
 test "x$enable_imagehlp" != xno && ALL_DLL_DIRS="$ALL_DLL_DIRS \\
@@ -15615,10 +15662,11 @@ dlls/imm.dll16/Makefile: dlls/imm.dll16/Makefile.in dlls/Makedll.rules config.st
 ac_config_files="$ac_config_files dlls/imm.dll16/Makefile"
 
 ALL_IMPORT_LIBS="$ALL_IMPORT_LIBS \\
-	imm32/libimm32.$IMPLIBEXT"
-ALL_IMPORTLIB_RULES="$ALL_IMPORTLIB_RULES
-imm32/libimm32.def imm32/libimm32.a imm32/libimm32.cross.a: imm32/imm32.spec \$(WINEBUILD)
-	@cd imm32 && \$(MAKE) \`basename \$@\`"
+	dlls/imm32/libimm32.$IMPLIBEXT"
+ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS
+dlls/imm32/libimm32.$IMPLIBEXT dlls/imm32/libimm32.cross.a: tools/widl tools/winebuild tools/winegcc include
+dlls/imm32/libimm32.$IMPLIBEXT dlls/imm32/libimm32.cross.a: dlls/imm32/imm32.spec dlls/imm32/Makefile
+	@cd dlls/imm32 && \$(MAKE) \`basename \$@\`"
 ALL_MAKEFILES="$ALL_MAKEFILES \\
 	dlls/imm32/Makefile"
 test "x$enable_imm32" != xno && ALL_DLL_DIRS="$ALL_DLL_DIRS \\
@@ -15644,10 +15692,11 @@ dlls/imm32/tests/Makefile: dlls/imm32/tests/Makefile.in dlls/Maketest.rules conf
 ac_config_files="$ac_config_files dlls/imm32/tests/Makefile"
 
 ALL_IMPORT_LIBS="$ALL_IMPORT_LIBS \\
-	inetcomm/libinetcomm.$IMPLIBEXT"
-ALL_IMPORTLIB_RULES="$ALL_IMPORTLIB_RULES
-inetcomm/libinetcomm.def inetcomm/libinetcomm.a inetcomm/libinetcomm.cross.a: inetcomm/inetcomm.spec \$(WINEBUILD)
-	@cd inetcomm && \$(MAKE) \`basename \$@\`"
+	dlls/inetcomm/libinetcomm.$IMPLIBEXT"
+ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS
+dlls/inetcomm/libinetcomm.$IMPLIBEXT dlls/inetcomm/libinetcomm.cross.a: tools/widl tools/winebuild tools/winegcc include
+dlls/inetcomm/libinetcomm.$IMPLIBEXT dlls/inetcomm/libinetcomm.cross.a: dlls/inetcomm/inetcomm.spec dlls/inetcomm/Makefile
+	@cd dlls/inetcomm && \$(MAKE) \`basename \$@\`"
 ALL_MAKEFILES="$ALL_MAKEFILES \\
 	dlls/inetcomm/Makefile"
 test "x$enable_inetcomm" != xno && ALL_DLL_DIRS="$ALL_DLL_DIRS \\
@@ -15745,10 +15794,11 @@ dlls/inseng/Makefile: dlls/inseng/Makefile.in dlls/Makedll.rules config.status"
 ac_config_files="$ac_config_files dlls/inseng/Makefile"
 
 ALL_IMPORT_LIBS="$ALL_IMPORT_LIBS \\
-	iphlpapi/libiphlpapi.$IMPLIBEXT"
-ALL_IMPORTLIB_RULES="$ALL_IMPORTLIB_RULES
-iphlpapi/libiphlpapi.def iphlpapi/libiphlpapi.a iphlpapi/libiphlpapi.cross.a: iphlpapi/iphlpapi.spec \$(WINEBUILD)
-	@cd iphlpapi && \$(MAKE) \`basename \$@\`"
+	dlls/iphlpapi/libiphlpapi.$IMPLIBEXT"
+ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS
+dlls/iphlpapi/libiphlpapi.$IMPLIBEXT dlls/iphlpapi/libiphlpapi.cross.a: tools/widl tools/winebuild tools/winegcc include
+dlls/iphlpapi/libiphlpapi.$IMPLIBEXT dlls/iphlpapi/libiphlpapi.cross.a: dlls/iphlpapi/iphlpapi.spec dlls/iphlpapi/Makefile
+	@cd dlls/iphlpapi && \$(MAKE) \`basename \$@\`"
 ALL_MAKEFILES="$ALL_MAKEFILES \\
 	dlls/iphlpapi/Makefile"
 test "x$enable_iphlpapi" != xno && ALL_DLL_DIRS="$ALL_DLL_DIRS \\
@@ -15830,10 +15880,11 @@ dlls/jscript/tests/Makefile: dlls/jscript/tests/Makefile.in dlls/Maketest.rules
 ac_config_files="$ac_config_files dlls/jscript/tests/Makefile"
 
 ALL_IMPORT_LIBS="$ALL_IMPORT_LIBS \\
-	kernel32/libkernel32.$IMPLIBEXT"
-ALL_IMPORTLIB_RULES="$ALL_IMPORTLIB_RULES
-kernel32/libkernel32.def kernel32/libkernel32.a kernel32/libkernel32.cross.a: kernel32/kernel32.spec \$(WINEBUILD)
-	@cd kernel32 && \$(MAKE) \`basename \$@\`"
+	dlls/kernel32/libkernel32.$IMPLIBEXT"
+ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS
+dlls/kernel32/libkernel32.$IMPLIBEXT dlls/kernel32/libkernel32.cross.a: tools/widl tools/winebuild tools/winegcc include
+dlls/kernel32/libkernel32.$IMPLIBEXT dlls/kernel32/libkernel32.cross.a: dlls/kernel32/kernel32.spec dlls/kernel32/Makefile
+	@cd dlls/kernel32 && \$(MAKE) \`basename \$@\`"
 ALL_MAKEFILES="$ALL_MAKEFILES \\
 	dlls/kernel32/Makefile"
 test "x$enable_kernel32" != xno && ALL_DLL_DIRS="$ALL_DLL_DIRS \\
@@ -15867,19 +15918,20 @@ dlls/keyboard.drv16/Makefile: dlls/keyboard.drv16/Makefile.in dlls/Makedll.rules
 ac_config_files="$ac_config_files dlls/keyboard.drv16/Makefile"
 
 test "x$enable_win16" = xno || ALL_IMPORT_LIBS="$ALL_IMPORT_LIBS \\
-	krnl386.exe16/libkernel.$IMPLIBEXT \\
-	libkernel.$IMPLIBEXT"
-ALL_IMPORTLIB_RULES="$ALL_IMPORTLIB_RULES
-libkernel.a: krnl386.exe16/libkernel.a
+	dlls/krnl386.exe16/libkernel.$IMPLIBEXT \\
+	dlls/libkernel.$IMPLIBEXT"
+ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS
+dlls/krnl386.exe16/libkernel.$IMPLIBEXT dlls/krnl386.exe16/libkernel.cross.a: tools/widl tools/winebuild tools/winegcc include
+dlls/libkernel.a: dlls/krnl386.exe16/libkernel.a
 	\$(RM) \$@ && \$(LN_S) krnl386.exe16/libkernel.a \$@
-libkernel.cross.a: krnl386.exe16/libkernel.cross.a
+dlls/libkernel.cross.a: dlls/krnl386.exe16/libkernel.cross.a
 	\$(RM) \$@ && \$(LN_S) krnl386.exe16/libkernel.cross.a \$@
-libkernel.def: krnl386.exe16/libkernel.def
+dlls/libkernel.def: dlls/krnl386.exe16/libkernel.def
 	\$(RM) \$@ && \$(LN_S) krnl386.exe16/libkernel.def \$@
 clean::
-	\$(RM) libkernel.def
-krnl386.exe16/libkernel.def krnl386.exe16/libkernel.a krnl386.exe16/libkernel.cross.a: krnl386.exe16/krnl386.exe16.spec \$(WINEBUILD)
-	@cd krnl386.exe16 && \$(MAKE) \`basename \$@\`"
+	\$(RM) dlls/libkernel.def
+dlls/krnl386.exe16/libkernel.$IMPLIBEXT dlls/krnl386.exe16/libkernel.cross.a: dlls/krnl386.exe16/krnl386.exe16.spec dlls/krnl386.exe16/Makefile
+	@cd dlls/krnl386.exe16 && \$(MAKE) \`basename \$@\`"
 ALL_MAKEFILES="$ALL_MAKEFILES \\
 	dlls/krnl386.exe16/Makefile"
 test "x$enable_win16" != xno && ALL_DLL_DIRS="$ALL_DLL_DIRS \\
@@ -15889,10 +15941,11 @@ dlls/krnl386.exe16/Makefile: dlls/krnl386.exe16/Makefile.in dlls/Makedll.rules c
 ac_config_files="$ac_config_files dlls/krnl386.exe16/Makefile"
 
 ALL_IMPORT_LIBS="$ALL_IMPORT_LIBS \\
-	loadperf/libloadperf.$IMPLIBEXT"
-ALL_IMPORTLIB_RULES="$ALL_IMPORTLIB_RULES
-loadperf/libloadperf.def loadperf/libloadperf.a loadperf/libloadperf.cross.a: loadperf/loadperf.spec \$(WINEBUILD)
-	@cd loadperf && \$(MAKE) \`basename \$@\`"
+	dlls/loadperf/libloadperf.$IMPLIBEXT"
+ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS
+dlls/loadperf/libloadperf.$IMPLIBEXT dlls/loadperf/libloadperf.cross.a: tools/widl tools/winebuild tools/winegcc include
+dlls/loadperf/libloadperf.$IMPLIBEXT dlls/loadperf/libloadperf.cross.a: dlls/loadperf/loadperf.spec dlls/loadperf/Makefile
+	@cd dlls/loadperf && \$(MAKE) \`basename \$@\`"
 ALL_MAKEFILES="$ALL_MAKEFILES \\
 	dlls/loadperf/Makefile"
 test "x$enable_loadperf" != xno && ALL_DLL_DIRS="$ALL_DLL_DIRS \\
@@ -15950,10 +16003,11 @@ dlls/localui/tests/Makefile: dlls/localui/tests/Makefile.in dlls/Maketest.rules
 ac_config_files="$ac_config_files dlls/localui/tests/Makefile"
 
 ALL_IMPORT_LIBS="$ALL_IMPORT_LIBS \\
-	lz32/liblz32.$IMPLIBEXT"
-ALL_IMPORTLIB_RULES="$ALL_IMPORTLIB_RULES
-lz32/liblz32.def lz32/liblz32.a lz32/liblz32.cross.a: lz32/lz32.spec \$(WINEBUILD)
-	@cd lz32 && \$(MAKE) \`basename \$@\`"
+	dlls/lz32/liblz32.$IMPLIBEXT"
+ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS
+dlls/lz32/liblz32.$IMPLIBEXT dlls/lz32/liblz32.cross.a: tools/widl tools/winebuild tools/winegcc include
+dlls/lz32/liblz32.$IMPLIBEXT dlls/lz32/liblz32.cross.a: dlls/lz32/lz32.spec dlls/lz32/Makefile
+	@cd dlls/lz32 && \$(MAKE) \`basename \$@\`"
 ALL_MAKEFILES="$ALL_MAKEFILES \\
 	dlls/lz32/Makefile"
 test "x$enable_lz32" != xno && ALL_DLL_DIRS="$ALL_DLL_DIRS \\
@@ -15987,10 +16041,11 @@ dlls/lzexpand.dll16/Makefile: dlls/lzexpand.dll16/Makefile.in dlls/Makedll.rules
 ac_config_files="$ac_config_files dlls/lzexpand.dll16/Makefile"
 
 ALL_IMPORT_LIBS="$ALL_IMPORT_LIBS \\
-	mapi32/libmapi32.$IMPLIBEXT"
-ALL_IMPORTLIB_RULES="$ALL_IMPORTLIB_RULES
-mapi32/libmapi32.def mapi32/libmapi32.a mapi32/libmapi32.cross.a: mapi32/mapi32.spec \$(WINEBUILD)
-	@cd mapi32 && \$(MAKE) \`basename \$@\`"
+	dlls/mapi32/libmapi32.$IMPLIBEXT"
+ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS
+dlls/mapi32/libmapi32.$IMPLIBEXT dlls/mapi32/libmapi32.cross.a: tools/widl tools/winebuild tools/winegcc include
+dlls/mapi32/libmapi32.$IMPLIBEXT dlls/mapi32/libmapi32.cross.a: dlls/mapi32/mapi32.spec dlls/mapi32/Makefile
+	@cd dlls/mapi32 && \$(MAKE) \`basename \$@\`"
 ALL_MAKEFILES="$ALL_MAKEFILES \\
 	dlls/mapi32/Makefile"
 test "x$enable_mapi32" != xno && ALL_DLL_DIRS="$ALL_DLL_DIRS \\
@@ -16072,10 +16127,11 @@ dlls/midimap/Makefile: dlls/midimap/Makefile.in dlls/Makedll.rules config.status
 ac_config_files="$ac_config_files dlls/midimap/Makefile"
 
 ALL_IMPORT_LIBS="$ALL_IMPORT_LIBS \\
-	mlang/libmlang.$IMPLIBEXT"
-ALL_IMPORTLIB_RULES="$ALL_IMPORTLIB_RULES
-mlang/libmlang.def mlang/libmlang.a mlang/libmlang.cross.a: mlang/mlang.spec \$(WINEBUILD)
-	@cd mlang && \$(MAKE) \`basename \$@\`"
+	dlls/mlang/libmlang.$IMPLIBEXT"
+ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS
+dlls/mlang/libmlang.$IMPLIBEXT dlls/mlang/libmlang.cross.a: tools/widl tools/winebuild tools/winegcc include
+dlls/mlang/libmlang.$IMPLIBEXT dlls/mlang/libmlang.cross.a: dlls/mlang/mlang.spec dlls/mlang/Makefile
+	@cd dlls/mlang && \$(MAKE) \`basename \$@\`"
 ALL_MAKEFILES="$ALL_MAKEFILES \\
 	dlls/mlang/Makefile"
 test "x$enable_mlang" != xno && ALL_DLL_DIRS="$ALL_DLL_DIRS \\
@@ -16165,10 +16221,11 @@ dlls/mouse.drv16/Makefile: dlls/mouse.drv16/Makefile.in dlls/Makedll.rules confi
 ac_config_files="$ac_config_files dlls/mouse.drv16/Makefile"
 
 ALL_IMPORT_LIBS="$ALL_IMPORT_LIBS \\
-	mpr/libmpr.$IMPLIBEXT"
-ALL_IMPORTLIB_RULES="$ALL_IMPORTLIB_RULES
-mpr/libmpr.def mpr/libmpr.a mpr/libmpr.cross.a: mpr/mpr.spec \$(WINEBUILD)
-	@cd mpr && \$(MAKE) \`basename \$@\`"
+	dlls/mpr/libmpr.$IMPLIBEXT"
+ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS
+dlls/mpr/libmpr.$IMPLIBEXT dlls/mpr/libmpr.cross.a: tools/widl tools/winebuild tools/winegcc include
+dlls/mpr/libmpr.$IMPLIBEXT dlls/mpr/libmpr.cross.a: dlls/mpr/mpr.spec dlls/mpr/Makefile
+	@cd dlls/mpr && \$(MAKE) \`basename \$@\`"
 ALL_MAKEFILES="$ALL_MAKEFILES \\
 	dlls/mpr/Makefile"
 test "x$enable_mpr" != xno && ALL_DLL_DIRS="$ALL_DLL_DIRS \\
@@ -16178,10 +16235,11 @@ dlls/mpr/Makefile: dlls/mpr/Makefile.in dlls/Makedll.rules config.status"
 ac_config_files="$ac_config_files dlls/mpr/Makefile"
 
 ALL_IMPORT_LIBS="$ALL_IMPORT_LIBS \\
-	mprapi/libmprapi.$IMPLIBEXT"
-ALL_IMPORTLIB_RULES="$ALL_IMPORTLIB_RULES
-mprapi/libmprapi.def mprapi/libmprapi.a mprapi/libmprapi.cross.a: mprapi/mprapi.spec \$(WINEBUILD)
-	@cd mprapi && \$(MAKE) \`basename \$@\`"
+	dlls/mprapi/libmprapi.$IMPLIBEXT"
+ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS
+dlls/mprapi/libmprapi.$IMPLIBEXT dlls/mprapi/libmprapi.cross.a: tools/widl tools/winebuild tools/winegcc include
+dlls/mprapi/libmprapi.$IMPLIBEXT dlls/mprapi/libmprapi.cross.a: dlls/mprapi/mprapi.spec dlls/mprapi/Makefile
+	@cd dlls/mprapi && \$(MAKE) \`basename \$@\`"
 ALL_MAKEFILES="$ALL_MAKEFILES \\
 	dlls/mprapi/Makefile"
 test "x$enable_mprapi" != xno && ALL_DLL_DIRS="$ALL_DLL_DIRS \\
@@ -16207,10 +16265,11 @@ dlls/msacm32.drv/Makefile: dlls/msacm32.drv/Makefile.in dlls/Makedll.rules confi
 ac_config_files="$ac_config_files dlls/msacm32.drv/Makefile"
 
 ALL_IMPORT_LIBS="$ALL_IMPORT_LIBS \\
-	msacm32/libmsacm32.$IMPLIBEXT"
-ALL_IMPORTLIB_RULES="$ALL_IMPORTLIB_RULES
-msacm32/libmsacm32.def msacm32/libmsacm32.a msacm32/libmsacm32.cross.a: msacm32/msacm32.spec \$(WINEBUILD)
-	@cd msacm32 && \$(MAKE) \`basename \$@\`"
+	dlls/msacm32/libmsacm32.$IMPLIBEXT"
+ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS
+dlls/msacm32/libmsacm32.$IMPLIBEXT dlls/msacm32/libmsacm32.cross.a: tools/widl tools/winebuild tools/winegcc include
+dlls/msacm32/libmsacm32.$IMPLIBEXT dlls/msacm32/libmsacm32.cross.a: dlls/msacm32/msacm32.spec dlls/msacm32/Makefile
+	@cd dlls/msacm32 && \$(MAKE) \`basename \$@\`"
 ALL_MAKEFILES="$ALL_MAKEFILES \\
 	dlls/msacm32/Makefile"
 test "x$enable_msacm32" != xno && ALL_DLL_DIRS="$ALL_DLL_DIRS \\
@@ -16252,10 +16311,11 @@ dlls/mscat32/Makefile: dlls/mscat32/Makefile.in dlls/Makedll.rules config.status
 ac_config_files="$ac_config_files dlls/mscat32/Makefile"
 
 ALL_IMPORT_LIBS="$ALL_IMPORT_LIBS \\
-	mscms/libmscms.$IMPLIBEXT"
-ALL_IMPORTLIB_RULES="$ALL_IMPORTLIB_RULES
-mscms/libmscms.def mscms/libmscms.a mscms/libmscms.cross.a: mscms/mscms.spec \$(WINEBUILD)
-	@cd mscms && \$(MAKE) \`basename \$@\`"
+	dlls/mscms/libmscms.$IMPLIBEXT"
+ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS
+dlls/mscms/libmscms.$IMPLIBEXT dlls/mscms/libmscms.cross.a: tools/widl tools/winebuild tools/winegcc include
+dlls/mscms/libmscms.$IMPLIBEXT dlls/mscms/libmscms.cross.a: dlls/mscms/mscms.spec dlls/mscms/Makefile
+	@cd dlls/mscms && \$(MAKE) \`basename \$@\`"
 ALL_MAKEFILES="$ALL_MAKEFILES \\
 	dlls/mscms/Makefile"
 test "x$enable_mscms" != xno && ALL_DLL_DIRS="$ALL_DLL_DIRS \\
@@ -16321,10 +16381,11 @@ dlls/msdaps/Makefile: dlls/msdaps/Makefile.in dlls/Makedll.rules config.status"
 ac_config_files="$ac_config_files dlls/msdaps/Makefile"
 
 ALL_IMPORT_LIBS="$ALL_IMPORT_LIBS \\
-	msdmo/libmsdmo.$IMPLIBEXT"
-ALL_IMPORTLIB_RULES="$ALL_IMPORTLIB_RULES
-msdmo/libmsdmo.def msdmo/libmsdmo.a msdmo/libmsdmo.cross.a: msdmo/msdmo.spec \$(WINEBUILD)
-	@cd msdmo && \$(MAKE) \`basename \$@\`"
+	dlls/msdmo/libmsdmo.$IMPLIBEXT"
+ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS
+dlls/msdmo/libmsdmo.$IMPLIBEXT dlls/msdmo/libmsdmo.cross.a: tools/widl tools/winebuild tools/winegcc include
+dlls/msdmo/libmsdmo.$IMPLIBEXT dlls/msdmo/libmsdmo.cross.a: dlls/msdmo/msdmo.spec dlls/msdmo/Makefile
+	@cd dlls/msdmo && \$(MAKE) \`basename \$@\`"
 ALL_MAKEFILES="$ALL_MAKEFILES \\
 	dlls/msdmo/Makefile"
 test "x$enable_msdmo" != xno && ALL_DLL_DIRS="$ALL_DLL_DIRS \\
@@ -16366,10 +16427,11 @@ dlls/mshtml.tlb/Makefile: dlls/mshtml.tlb/Makefile.in dlls/Makedll.rules config.
 ac_config_files="$ac_config_files dlls/mshtml.tlb/Makefile"
 
 ALL_IMPORT_LIBS="$ALL_IMPORT_LIBS \\
-	mshtml/libmshtml.$IMPLIBEXT"
-ALL_IMPORTLIB_RULES="$ALL_IMPORTLIB_RULES
-mshtml/libmshtml.def mshtml/libmshtml.a mshtml/libmshtml.cross.a: mshtml/mshtml.spec \$(WINEBUILD)
-	@cd mshtml && \$(MAKE) \`basename \$@\`"
+	dlls/mshtml/libmshtml.$IMPLIBEXT"
+ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS
+dlls/mshtml/libmshtml.$IMPLIBEXT dlls/mshtml/libmshtml.cross.a: tools/widl tools/winebuild tools/winegcc include
+dlls/mshtml/libmshtml.$IMPLIBEXT dlls/mshtml/libmshtml.cross.a: dlls/mshtml/mshtml.spec dlls/mshtml/Makefile
+	@cd dlls/mshtml && \$(MAKE) \`basename \$@\`"
 ALL_MAKEFILES="$ALL_MAKEFILES \\
 	dlls/mshtml/Makefile"
 test "x$enable_mshtml" != xno && ALL_DLL_DIRS="$ALL_DLL_DIRS \\
@@ -16395,10 +16457,11 @@ dlls/mshtml/tests/Makefile: dlls/mshtml/tests/Makefile.in dlls/Maketest.rules co
 ac_config_files="$ac_config_files dlls/mshtml/tests/Makefile"
 
 ALL_IMPORT_LIBS="$ALL_IMPORT_LIBS \\
-	msi/libmsi.$IMPLIBEXT"
-ALL_IMPORTLIB_RULES="$ALL_IMPORTLIB_RULES
-msi/libmsi.def msi/libmsi.a msi/libmsi.cross.a: msi/msi.spec \$(WINEBUILD)
-	@cd msi && \$(MAKE) \`basename \$@\`"
+	dlls/msi/libmsi.$IMPLIBEXT"
+ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS
+dlls/msi/libmsi.$IMPLIBEXT dlls/msi/libmsi.cross.a: tools/widl tools/winebuild tools/winegcc include
+dlls/msi/libmsi.$IMPLIBEXT dlls/msi/libmsi.cross.a: dlls/msi/msi.spec dlls/msi/Makefile
+	@cd dlls/msi && \$(MAKE) \`basename \$@\`"
 ALL_MAKEFILES="$ALL_MAKEFILES \\
 	dlls/msi/Makefile"
 test "x$enable_msi" != xno && ALL_DLL_DIRS="$ALL_DLL_DIRS \\
@@ -16424,10 +16487,11 @@ dlls/msi/tests/Makefile: dlls/msi/tests/Makefile.in dlls/Maketest.rules config.s
 ac_config_files="$ac_config_files dlls/msi/tests/Makefile"
 
 ALL_IMPORT_LIBS="$ALL_IMPORT_LIBS \\
-	msimg32/libmsimg32.$IMPLIBEXT"
-ALL_IMPORTLIB_RULES="$ALL_IMPORTLIB_RULES
-msimg32/libmsimg32.def msimg32/libmsimg32.a msimg32/libmsimg32.cross.a: msimg32/msimg32.spec \$(WINEBUILD)
-	@cd msimg32 && \$(MAKE) \`basename \$@\`"
+	dlls/msimg32/libmsimg32.$IMPLIBEXT"
+ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS
+dlls/msimg32/libmsimg32.$IMPLIBEXT dlls/msimg32/libmsimg32.cross.a: tools/widl tools/winebuild tools/winegcc include
+dlls/msimg32/libmsimg32.$IMPLIBEXT dlls/msimg32/libmsimg32.cross.a: dlls/msimg32/msimg32.spec dlls/msimg32/Makefile
+	@cd dlls/msimg32 && \$(MAKE) \`basename \$@\`"
 ALL_MAKEFILES="$ALL_MAKEFILES \\
 	dlls/msimg32/Makefile"
 test "x$enable_msimg32" != xno && ALL_DLL_DIRS="$ALL_DLL_DIRS \\
@@ -16525,10 +16589,11 @@ dlls/msvcirt/Makefile: dlls/msvcirt/Makefile.in dlls/Makedll.rules config.status
 ac_config_files="$ac_config_files dlls/msvcirt/Makefile"
 
 ALL_IMPORT_LIBS="$ALL_IMPORT_LIBS \\
-	msvcr71/libmsvcr71.$IMPLIBEXT"
-ALL_IMPORTLIB_RULES="$ALL_IMPORTLIB_RULES
-msvcr71/libmsvcr71.def msvcr71/libmsvcr71.a msvcr71/libmsvcr71.cross.a: msvcr71/msvcr71.spec \$(WINEBUILD)
-	@cd msvcr71 && \$(MAKE) \`basename \$@\`"
+	dlls/msvcr71/libmsvcr71.$IMPLIBEXT"
+ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS
+dlls/msvcr71/libmsvcr71.$IMPLIBEXT dlls/msvcr71/libmsvcr71.cross.a: tools/widl tools/winebuild tools/winegcc include
+dlls/msvcr71/libmsvcr71.$IMPLIBEXT dlls/msvcr71/libmsvcr71.cross.a: dlls/msvcr71/msvcr71.spec dlls/msvcr71/Makefile
+	@cd dlls/msvcr71 && \$(MAKE) \`basename \$@\`"
 ALL_MAKEFILES="$ALL_MAKEFILES \\
 	dlls/msvcr71/Makefile"
 test "x$enable_msvcr71" != xno && ALL_DLL_DIRS="$ALL_DLL_DIRS \\
@@ -16538,10 +16603,11 @@ dlls/msvcr71/Makefile: dlls/msvcr71/Makefile.in dlls/Makedll.rules config.status
 ac_config_files="$ac_config_files dlls/msvcr71/Makefile"
 
 ALL_IMPORT_LIBS="$ALL_IMPORT_LIBS \\
-	msvcrt/libmsvcrt.$IMPLIBEXT"
-ALL_IMPORTLIB_RULES="$ALL_IMPORTLIB_RULES
-msvcrt/libmsvcrt.def msvcrt/libmsvcrt.a msvcrt/libmsvcrt.cross.a: msvcrt/msvcrt.spec \$(WINEBUILD)
-	@cd msvcrt && \$(MAKE) \`basename \$@\`"
+	dlls/msvcrt/libmsvcrt.$IMPLIBEXT"
+ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS
+dlls/msvcrt/libmsvcrt.$IMPLIBEXT dlls/msvcrt/libmsvcrt.cross.a: tools/widl tools/winebuild tools/winegcc include
+dlls/msvcrt/libmsvcrt.$IMPLIBEXT dlls/msvcrt/libmsvcrt.cross.a: dlls/msvcrt/msvcrt.spec dlls/msvcrt/Makefile
+	@cd dlls/msvcrt && \$(MAKE) \`basename \$@\`"
 ALL_MAKEFILES="$ALL_MAKEFILES \\
 	dlls/msvcrt/Makefile"
 test "x$enable_msvcrt" != xno && ALL_DLL_DIRS="$ALL_DLL_DIRS \\
@@ -16567,10 +16633,11 @@ dlls/msvcrt/tests/Makefile: dlls/msvcrt/tests/Makefile.in dlls/Maketest.rules co
 ac_config_files="$ac_config_files dlls/msvcrt/tests/Makefile"
 
 ALL_IMPORT_LIBS="$ALL_IMPORT_LIBS \\
-	msvcrt20/libmsvcrt20.$IMPLIBEXT"
-ALL_IMPORTLIB_RULES="$ALL_IMPORTLIB_RULES
-msvcrt20/libmsvcrt20.def msvcrt20/libmsvcrt20.a msvcrt20/libmsvcrt20.cross.a: msvcrt20/msvcrt20.spec \$(WINEBUILD)
-	@cd msvcrt20 && \$(MAKE) \`basename \$@\`"
+	dlls/msvcrt20/libmsvcrt20.$IMPLIBEXT"
+ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS
+dlls/msvcrt20/libmsvcrt20.$IMPLIBEXT dlls/msvcrt20/libmsvcrt20.cross.a: tools/widl tools/winebuild tools/winegcc include
+dlls/msvcrt20/libmsvcrt20.$IMPLIBEXT dlls/msvcrt20/libmsvcrt20.cross.a: dlls/msvcrt20/msvcrt20.spec dlls/msvcrt20/Makefile
+	@cd dlls/msvcrt20 && \$(MAKE) \`basename \$@\`"
 ALL_MAKEFILES="$ALL_MAKEFILES \\
 	dlls/msvcrt20/Makefile"
 test "x$enable_msvcrt20" != xno && ALL_DLL_DIRS="$ALL_DLL_DIRS \\
@@ -16580,10 +16647,11 @@ dlls/msvcrt20/Makefile: dlls/msvcrt20/Makefile.in dlls/Makedll.rules config.stat
 ac_config_files="$ac_config_files dlls/msvcrt20/Makefile"
 
 ALL_IMPORT_LIBS="$ALL_IMPORT_LIBS \\
-	msvcrt40/libmsvcrt40.$IMPLIBEXT"
-ALL_IMPORTLIB_RULES="$ALL_IMPORTLIB_RULES
-msvcrt40/libmsvcrt40.def msvcrt40/libmsvcrt40.a msvcrt40/libmsvcrt40.cross.a: msvcrt40/msvcrt40.spec \$(WINEBUILD)
-	@cd msvcrt40 && \$(MAKE) \`basename \$@\`"
+	dlls/msvcrt40/libmsvcrt40.$IMPLIBEXT"
+ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS
+dlls/msvcrt40/libmsvcrt40.$IMPLIBEXT dlls/msvcrt40/libmsvcrt40.cross.a: tools/widl tools/winebuild tools/winegcc include
+dlls/msvcrt40/libmsvcrt40.$IMPLIBEXT dlls/msvcrt40/libmsvcrt40.cross.a: dlls/msvcrt40/msvcrt40.spec dlls/msvcrt40/Makefile
+	@cd dlls/msvcrt40 && \$(MAKE) \`basename \$@\`"
 ALL_MAKEFILES="$ALL_MAKEFILES \\
 	dlls/msvcrt40/Makefile"
 test "x$enable_msvcrt40" != xno && ALL_DLL_DIRS="$ALL_DLL_DIRS \\
@@ -16593,10 +16661,11 @@ dlls/msvcrt40/Makefile: dlls/msvcrt40/Makefile.in dlls/Makedll.rules config.stat
 ac_config_files="$ac_config_files dlls/msvcrt40/Makefile"
 
 ALL_IMPORT_LIBS="$ALL_IMPORT_LIBS \\
-	msvcrtd/libmsvcrtd.$IMPLIBEXT"
-ALL_IMPORTLIB_RULES="$ALL_IMPORTLIB_RULES
-msvcrtd/libmsvcrtd.def msvcrtd/libmsvcrtd.a msvcrtd/libmsvcrtd.cross.a: msvcrtd/msvcrtd.spec \$(WINEBUILD)
-	@cd msvcrtd && \$(MAKE) \`basename \$@\`"
+	dlls/msvcrtd/libmsvcrtd.$IMPLIBEXT"
+ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS
+dlls/msvcrtd/libmsvcrtd.$IMPLIBEXT dlls/msvcrtd/libmsvcrtd.cross.a: tools/widl tools/winebuild tools/winegcc include
+dlls/msvcrtd/libmsvcrtd.$IMPLIBEXT dlls/msvcrtd/libmsvcrtd.cross.a: dlls/msvcrtd/msvcrtd.spec dlls/msvcrtd/Makefile
+	@cd dlls/msvcrtd && \$(MAKE) \`basename \$@\`"
 ALL_MAKEFILES="$ALL_MAKEFILES \\
 	dlls/msvcrtd/Makefile"
 test "x$enable_msvcrtd" != xno && ALL_DLL_DIRS="$ALL_DLL_DIRS \\
@@ -16622,10 +16691,11 @@ dlls/msvcrtd/tests/Makefile: dlls/msvcrtd/tests/Makefile.in dlls/Maketest.rules
 ac_config_files="$ac_config_files dlls/msvcrtd/tests/Makefile"
 
 ALL_IMPORT_LIBS="$ALL_IMPORT_LIBS \\
-	msvfw32/libmsvfw32.$IMPLIBEXT"
-ALL_IMPORTLIB_RULES="$ALL_IMPORTLIB_RULES
-msvfw32/libmsvfw32.def msvfw32/libmsvfw32.a msvfw32/libmsvfw32.cross.a: msvfw32/msvfw32.spec \$(WINEBUILD)
-	@cd msvfw32 && \$(MAKE) \`basename \$@\`"
+	dlls/msvfw32/libmsvfw32.$IMPLIBEXT"
+ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS
+dlls/msvfw32/libmsvfw32.$IMPLIBEXT dlls/msvfw32/libmsvfw32.cross.a: tools/widl tools/winebuild tools/winegcc include
+dlls/msvfw32/libmsvfw32.$IMPLIBEXT dlls/msvfw32/libmsvfw32.cross.a: dlls/msvfw32/msvfw32.spec dlls/msvfw32/Makefile
+	@cd dlls/msvfw32 && \$(MAKE) \`basename \$@\`"
 ALL_MAKEFILES="$ALL_MAKEFILES \\
 	dlls/msvfw32/Makefile"
 test "x$enable_msvfw32" != xno && ALL_DLL_DIRS="$ALL_DLL_DIRS \\
@@ -16667,10 +16737,11 @@ dlls/msvideo.dll16/Makefile: dlls/msvideo.dll16/Makefile.in dlls/Makedll.rules c
 ac_config_files="$ac_config_files dlls/msvideo.dll16/Makefile"
 
 ALL_IMPORT_LIBS="$ALL_IMPORT_LIBS \\
-	mswsock/libmswsock.$IMPLIBEXT"
-ALL_IMPORTLIB_RULES="$ALL_IMPORTLIB_RULES
-mswsock/libmswsock.def mswsock/libmswsock.a mswsock/libmswsock.cross.a: mswsock/mswsock.spec \$(WINEBUILD)
-	@cd mswsock && \$(MAKE) \`basename \$@\`"
+	dlls/mswsock/libmswsock.$IMPLIBEXT"
+ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS
+dlls/mswsock/libmswsock.$IMPLIBEXT dlls/mswsock/libmswsock.cross.a: tools/widl tools/winebuild tools/winegcc include
+dlls/mswsock/libmswsock.$IMPLIBEXT dlls/mswsock/libmswsock.cross.a: dlls/mswsock/mswsock.spec dlls/mswsock/Makefile
+	@cd dlls/mswsock && \$(MAKE) \`basename \$@\`"
 ALL_MAKEFILES="$ALL_MAKEFILES \\
 	dlls/mswsock/Makefile"
 test "x$enable_mswsock" != xno && ALL_DLL_DIRS="$ALL_DLL_DIRS \\
@@ -16712,10 +16783,11 @@ dlls/msxml4/Makefile: dlls/msxml4/Makefile.in dlls/Makedll.rules config.status"
 ac_config_files="$ac_config_files dlls/msxml4/Makefile"
 
 ALL_IMPORT_LIBS="$ALL_IMPORT_LIBS \\
-	nddeapi/libnddeapi.$IMPLIBEXT"
-ALL_IMPORTLIB_RULES="$ALL_IMPORTLIB_RULES
-nddeapi/libnddeapi.def nddeapi/libnddeapi.a nddeapi/libnddeapi.cross.a: nddeapi/nddeapi.spec \$(WINEBUILD)
-	@cd nddeapi && \$(MAKE) \`basename \$@\`"
+	dlls/nddeapi/libnddeapi.$IMPLIBEXT"
+ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS
+dlls/nddeapi/libnddeapi.$IMPLIBEXT dlls/nddeapi/libnddeapi.cross.a: tools/widl tools/winebuild tools/winegcc include
+dlls/nddeapi/libnddeapi.$IMPLIBEXT dlls/nddeapi/libnddeapi.cross.a: dlls/nddeapi/nddeapi.spec dlls/nddeapi/Makefile
+	@cd dlls/nddeapi && \$(MAKE) \`basename \$@\`"
 ALL_MAKEFILES="$ALL_MAKEFILES \\
 	dlls/nddeapi/Makefile"
 test "x$enable_nddeapi" != xno && ALL_DLL_DIRS="$ALL_DLL_DIRS \\
@@ -16725,10 +16797,11 @@ dlls/nddeapi/Makefile: dlls/nddeapi/Makefile.in dlls/Makedll.rules config.status
 ac_config_files="$ac_config_files dlls/nddeapi/Makefile"
 
 ALL_IMPORT_LIBS="$ALL_IMPORT_LIBS \\
-	netapi32/libnetapi32.$IMPLIBEXT"
-ALL_IMPORTLIB_RULES="$ALL_IMPORTLIB_RULES
-netapi32/libnetapi32.def netapi32/libnetapi32.a netapi32/libnetapi32.cross.a: netapi32/netapi32.spec \$(WINEBUILD)
-	@cd netapi32 && \$(MAKE) \`basename \$@\`"
+	dlls/netapi32/libnetapi32.$IMPLIBEXT"
+ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS
+dlls/netapi32/libnetapi32.$IMPLIBEXT dlls/netapi32/libnetapi32.cross.a: tools/widl tools/winebuild tools/winegcc include
+dlls/netapi32/libnetapi32.$IMPLIBEXT dlls/netapi32/libnetapi32.cross.a: dlls/netapi32/netapi32.spec dlls/netapi32/Makefile
+	@cd dlls/netapi32 && \$(MAKE) \`basename \$@\`"
 ALL_MAKEFILES="$ALL_MAKEFILES \\
 	dlls/netapi32/Makefile"
 test "x$enable_netapi32" != xno && ALL_DLL_DIRS="$ALL_DLL_DIRS \\
@@ -16754,10 +16827,11 @@ dlls/netapi32/tests/Makefile: dlls/netapi32/tests/Makefile.in dlls/Maketest.rule
 ac_config_files="$ac_config_files dlls/netapi32/tests/Makefile"
 
 ALL_IMPORT_LIBS="$ALL_IMPORT_LIBS \\
-	newdev/libnewdev.$IMPLIBEXT"
-ALL_IMPORTLIB_RULES="$ALL_IMPORTLIB_RULES
-newdev/libnewdev.def newdev/libnewdev.a newdev/libnewdev.cross.a: newdev/newdev.spec \$(WINEBUILD)
-	@cd newdev && \$(MAKE) \`basename \$@\`"
+	dlls/newdev/libnewdev.$IMPLIBEXT"
+ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS
+dlls/newdev/libnewdev.$IMPLIBEXT dlls/newdev/libnewdev.cross.a: tools/widl tools/winebuild tools/winegcc include
+dlls/newdev/libnewdev.$IMPLIBEXT dlls/newdev/libnewdev.cross.a: dlls/newdev/newdev.spec dlls/newdev/Makefile
+	@cd dlls/newdev && \$(MAKE) \`basename \$@\`"
 ALL_MAKEFILES="$ALL_MAKEFILES \\
 	dlls/newdev/Makefile"
 test "x$enable_newdev" != xno && ALL_DLL_DIRS="$ALL_DLL_DIRS \\
@@ -16767,10 +16841,11 @@ dlls/newdev/Makefile: dlls/newdev/Makefile.in dlls/Makedll.rules config.status"
 ac_config_files="$ac_config_files dlls/newdev/Makefile"
 
 ALL_IMPORT_LIBS="$ALL_IMPORT_LIBS \\
-	ntdll/libntdll.$IMPLIBEXT"
-ALL_IMPORTLIB_RULES="$ALL_IMPORTLIB_RULES
-ntdll/libntdll.def ntdll/libntdll.a ntdll/libntdll.cross.a: ntdll/ntdll.spec \$(WINEBUILD)
-	@cd ntdll && \$(MAKE) \`basename \$@\`"
+	dlls/ntdll/libntdll.$IMPLIBEXT"
+ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS
+dlls/ntdll/libntdll.$IMPLIBEXT dlls/ntdll/libntdll.cross.a: tools/widl tools/winebuild tools/winegcc include
+dlls/ntdll/libntdll.$IMPLIBEXT dlls/ntdll/libntdll.cross.a: dlls/ntdll/ntdll.spec dlls/ntdll/Makefile
+	@cd dlls/ntdll && \$(MAKE) \`basename \$@\`"
 ALL_MAKEFILES="$ALL_MAKEFILES \\
 	dlls/ntdll/Makefile"
 test "x$enable_ntdll" != xno && ALL_DLL_DIRS="$ALL_DLL_DIRS \\
@@ -16796,10 +16871,11 @@ dlls/ntdll/tests/Makefile: dlls/ntdll/tests/Makefile.in dlls/Maketest.rules conf
 ac_config_files="$ac_config_files dlls/ntdll/tests/Makefile"
 
 ALL_IMPORT_LIBS="$ALL_IMPORT_LIBS \\
-	ntdsapi/libntdsapi.$IMPLIBEXT"
-ALL_IMPORTLIB_RULES="$ALL_IMPORTLIB_RULES
-ntdsapi/libntdsapi.def ntdsapi/libntdsapi.a ntdsapi/libntdsapi.cross.a: ntdsapi/ntdsapi.spec \$(WINEBUILD)
-	@cd ntdsapi && \$(MAKE) \`basename \$@\`"
+	dlls/ntdsapi/libntdsapi.$IMPLIBEXT"
+ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS
+dlls/ntdsapi/libntdsapi.$IMPLIBEXT dlls/ntdsapi/libntdsapi.cross.a: tools/widl tools/winebuild tools/winegcc include
+dlls/ntdsapi/libntdsapi.$IMPLIBEXT dlls/ntdsapi/libntdsapi.cross.a: dlls/ntdsapi/ntdsapi.spec dlls/ntdsapi/Makefile
+	@cd dlls/ntdsapi && \$(MAKE) \`basename \$@\`"
 ALL_MAKEFILES="$ALL_MAKEFILES \\
 	dlls/ntdsapi/Makefile"
 test "x$enable_ntdsapi" != xno && ALL_DLL_DIRS="$ALL_DLL_DIRS \\
@@ -16825,10 +16901,11 @@ dlls/ntdsapi/tests/Makefile: dlls/ntdsapi/tests/Makefile.in dlls/Maketest.rules
 ac_config_files="$ac_config_files dlls/ntdsapi/tests/Makefile"
 
 ALL_IMPORT_LIBS="$ALL_IMPORT_LIBS \\
-	ntoskrnl.exe/libntoskrnl.exe.$IMPLIBEXT"
-ALL_IMPORTLIB_RULES="$ALL_IMPORTLIB_RULES
-ntoskrnl.exe/libntoskrnl.exe.def ntoskrnl.exe/libntoskrnl.exe.a ntoskrnl.exe/libntoskrnl.exe.cross.a: ntoskrnl.exe/ntoskrnl.exe.spec \$(WINEBUILD)
-	@cd ntoskrnl.exe && \$(MAKE) \`basename \$@\`"
+	dlls/ntoskrnl.exe/libntoskrnl.exe.$IMPLIBEXT"
+ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS
+dlls/ntoskrnl.exe/libntoskrnl.exe.$IMPLIBEXT dlls/ntoskrnl.exe/libntoskrnl.exe.cross.a: tools/widl tools/winebuild tools/winegcc include
+dlls/ntoskrnl.exe/libntoskrnl.exe.$IMPLIBEXT dlls/ntoskrnl.exe/libntoskrnl.exe.cross.a: dlls/ntoskrnl.exe/ntoskrnl.exe.spec dlls/ntoskrnl.exe/Makefile
+	@cd dlls/ntoskrnl.exe && \$(MAKE) \`basename \$@\`"
 ALL_MAKEFILES="$ALL_MAKEFILES \\
 	dlls/ntoskrnl.exe/Makefile"
 test "x$enable_ntoskrnl_exe" != xno && ALL_DLL_DIRS="$ALL_DLL_DIRS \\
@@ -16870,10 +16947,11 @@ dlls/objsel/Makefile: dlls/objsel/Makefile.in dlls/Makedll.rules config.status"
 ac_config_files="$ac_config_files dlls/objsel/Makefile"
 
 ALL_IMPORT_LIBS="$ALL_IMPORT_LIBS \\
-	odbc32/libodbc32.$IMPLIBEXT"
-ALL_IMPORTLIB_RULES="$ALL_IMPORTLIB_RULES
-odbc32/libodbc32.def odbc32/libodbc32.a odbc32/libodbc32.cross.a: odbc32/odbc32.spec \$(WINEBUILD)
-	@cd odbc32 && \$(MAKE) \`basename \$@\`"
+	dlls/odbc32/libodbc32.$IMPLIBEXT"
+ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS
+dlls/odbc32/libodbc32.$IMPLIBEXT dlls/odbc32/libodbc32.cross.a: tools/widl tools/winebuild tools/winegcc include
+dlls/odbc32/libodbc32.$IMPLIBEXT dlls/odbc32/libodbc32.cross.a: dlls/odbc32/odbc32.spec dlls/odbc32/Makefile
+	@cd dlls/odbc32 && \$(MAKE) \`basename \$@\`"
 ALL_MAKEFILES="$ALL_MAKEFILES \\
 	dlls/odbc32/Makefile"
 test "x$enable_odbc32" != xno && ALL_DLL_DIRS="$ALL_DLL_DIRS \\
@@ -16883,10 +16961,11 @@ dlls/odbc32/Makefile: dlls/odbc32/Makefile.in dlls/Makedll.rules config.status"
 ac_config_files="$ac_config_files dlls/odbc32/Makefile"
 
 ALL_IMPORT_LIBS="$ALL_IMPORT_LIBS \\
-	odbccp32/libodbccp32.$IMPLIBEXT"
-ALL_IMPORTLIB_RULES="$ALL_IMPORTLIB_RULES
-odbccp32/libodbccp32.def odbccp32/libodbccp32.a odbccp32/libodbccp32.cross.a: odbccp32/odbccp32.spec \$(WINEBUILD)
-	@cd odbccp32 && \$(MAKE) \`basename \$@\`"
+	dlls/odbccp32/libodbccp32.$IMPLIBEXT"
+ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS
+dlls/odbccp32/libodbccp32.$IMPLIBEXT dlls/odbccp32/libodbccp32.cross.a: tools/widl tools/winebuild tools/winegcc include
+dlls/odbccp32/libodbccp32.$IMPLIBEXT dlls/odbccp32/libodbccp32.cross.a: dlls/odbccp32/odbccp32.spec dlls/odbccp32/Makefile
+	@cd dlls/odbccp32 && \$(MAKE) \`basename \$@\`"
 ALL_MAKEFILES="$ALL_MAKEFILES \\
 	dlls/odbccp32/Makefile"
 test "x$enable_odbccp32" != xno && ALL_DLL_DIRS="$ALL_DLL_DIRS \\
@@ -16960,10 +17039,11 @@ dlls/ole2thk.dll16/Makefile: dlls/ole2thk.dll16/Makefile.in dlls/Makedll.rules c
 ac_config_files="$ac_config_files dlls/ole2thk.dll16/Makefile"
 
 ALL_IMPORT_LIBS="$ALL_IMPORT_LIBS \\
-	ole32/libole32.$IMPLIBEXT"
-ALL_IMPORTLIB_RULES="$ALL_IMPORTLIB_RULES
-ole32/libole32.def ole32/libole32.a ole32/libole32.cross.a: ole32/ole32.spec \$(WINEBUILD)
-	@cd ole32 && \$(MAKE) \`basename \$@\`"
+	dlls/ole32/libole32.$IMPLIBEXT"
+ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS
+dlls/ole32/libole32.$IMPLIBEXT dlls/ole32/libole32.cross.a: tools/widl tools/winebuild tools/winegcc include
+dlls/ole32/libole32.$IMPLIBEXT dlls/ole32/libole32.cross.a: dlls/ole32/ole32.spec dlls/ole32/Makefile
+	@cd dlls/ole32 && \$(MAKE) \`basename \$@\`"
 ALL_MAKEFILES="$ALL_MAKEFILES \\
 	dlls/ole32/Makefile"
 test "x$enable_ole32" != xno && ALL_DLL_DIRS="$ALL_DLL_DIRS \\
@@ -16989,10 +17069,11 @@ dlls/ole32/tests/Makefile: dlls/ole32/tests/Makefile.in dlls/Maketest.rules conf
 ac_config_files="$ac_config_files dlls/ole32/tests/Makefile"
 
 ALL_IMPORT_LIBS="$ALL_IMPORT_LIBS \\
-	oleacc/liboleacc.$IMPLIBEXT"
-ALL_IMPORTLIB_RULES="$ALL_IMPORTLIB_RULES
-oleacc/liboleacc.def oleacc/liboleacc.a oleacc/liboleacc.cross.a: oleacc/oleacc.spec \$(WINEBUILD)
-	@cd oleacc && \$(MAKE) \`basename \$@\`"
+	dlls/oleacc/liboleacc.$IMPLIBEXT"
+ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS
+dlls/oleacc/liboleacc.$IMPLIBEXT dlls/oleacc/liboleacc.cross.a: tools/widl tools/winebuild tools/winegcc include
+dlls/oleacc/liboleacc.$IMPLIBEXT dlls/oleacc/liboleacc.cross.a: dlls/oleacc/oleacc.spec dlls/oleacc/Makefile
+	@cd dlls/oleacc && \$(MAKE) \`basename \$@\`"
 ALL_MAKEFILES="$ALL_MAKEFILES \\
 	dlls/oleacc/Makefile"
 test "x$enable_oleacc" != xno && ALL_DLL_DIRS="$ALL_DLL_DIRS \\
@@ -17018,10 +17099,11 @@ dlls/oleacc/tests/Makefile: dlls/oleacc/tests/Makefile.in dlls/Maketest.rules co
 ac_config_files="$ac_config_files dlls/oleacc/tests/Makefile"
 
 ALL_IMPORT_LIBS="$ALL_IMPORT_LIBS \\
-	oleaut32/liboleaut32.$IMPLIBEXT"
-ALL_IMPORTLIB_RULES="$ALL_IMPORTLIB_RULES
-oleaut32/liboleaut32.def oleaut32/liboleaut32.a oleaut32/liboleaut32.cross.a: oleaut32/oleaut32.spec \$(WINEBUILD)
-	@cd oleaut32 && \$(MAKE) \`basename \$@\`"
+	dlls/oleaut32/liboleaut32.$IMPLIBEXT"
+ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS
+dlls/oleaut32/liboleaut32.$IMPLIBEXT dlls/oleaut32/liboleaut32.cross.a: tools/widl tools/winebuild tools/winegcc include
+dlls/oleaut32/liboleaut32.$IMPLIBEXT dlls/oleaut32/liboleaut32.cross.a: dlls/oleaut32/oleaut32.spec dlls/oleaut32/Makefile
+	@cd dlls/oleaut32 && \$(MAKE) \`basename \$@\`"
 ALL_MAKEFILES="$ALL_MAKEFILES \\
 	dlls/oleaut32/Makefile"
 test "x$enable_oleaut32" != xno && ALL_DLL_DIRS="$ALL_DLL_DIRS \\
@@ -17055,10 +17137,11 @@ dlls/olecli.dll16/Makefile: dlls/olecli.dll16/Makefile.in dlls/Makedll.rules con
 ac_config_files="$ac_config_files dlls/olecli.dll16/Makefile"
 
 ALL_IMPORT_LIBS="$ALL_IMPORT_LIBS \\
-	olecli32/libolecli32.$IMPLIBEXT"
-ALL_IMPORTLIB_RULES="$ALL_IMPORTLIB_RULES
-olecli32/libolecli32.def olecli32/libolecli32.a olecli32/libolecli32.cross.a: olecli32/olecli32.spec \$(WINEBUILD)
-	@cd olecli32 && \$(MAKE) \`basename \$@\`"
+	dlls/olecli32/libolecli32.$IMPLIBEXT"
+ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS
+dlls/olecli32/libolecli32.$IMPLIBEXT dlls/olecli32/libolecli32.cross.a: tools/widl tools/winebuild tools/winegcc include
+dlls/olecli32/libolecli32.$IMPLIBEXT dlls/olecli32/libolecli32.cross.a: dlls/olecli32/olecli32.spec dlls/olecli32/Makefile
+	@cd dlls/olecli32 && \$(MAKE) \`basename \$@\`"
 ALL_MAKEFILES="$ALL_MAKEFILES \\
 	dlls/olecli32/Makefile"
 test "x$enable_olecli32" != xno && ALL_DLL_DIRS="$ALL_DLL_DIRS \\
@@ -17092,10 +17175,11 @@ dlls/oledb32/tests/Makefile: dlls/oledb32/tests/Makefile.in dlls/Maketest.rules
 ac_config_files="$ac_config_files dlls/oledb32/tests/Makefile"
 
 ALL_IMPORT_LIBS="$ALL_IMPORT_LIBS \\
-	oledlg/liboledlg.$IMPLIBEXT"
-ALL_IMPORTLIB_RULES="$ALL_IMPORTLIB_RULES
-oledlg/liboledlg.def oledlg/liboledlg.a oledlg/liboledlg.cross.a: oledlg/oledlg.spec \$(WINEBUILD)
-	@cd oledlg && \$(MAKE) \`basename \$@\`"
+	dlls/oledlg/liboledlg.$IMPLIBEXT"
+ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS
+dlls/oledlg/liboledlg.$IMPLIBEXT dlls/oledlg/liboledlg.cross.a: tools/widl tools/winebuild tools/winegcc include
+dlls/oledlg/liboledlg.$IMPLIBEXT dlls/oledlg/liboledlg.cross.a: dlls/oledlg/oledlg.spec dlls/oledlg/Makefile
+	@cd dlls/oledlg && \$(MAKE) \`basename \$@\`"
 ALL_MAKEFILES="$ALL_MAKEFILES \\
 	dlls/oledlg/Makefile"
 test "x$enable_oledlg" != xno && ALL_DLL_DIRS="$ALL_DLL_DIRS \\
@@ -17105,10 +17189,11 @@ dlls/oledlg/Makefile: dlls/oledlg/Makefile.in dlls/Makedll.rules config.status"
 ac_config_files="$ac_config_files dlls/oledlg/Makefile"
 
 ALL_IMPORT_LIBS="$ALL_IMPORT_LIBS \\
-	olepro32/libolepro32.$IMPLIBEXT"
-ALL_IMPORTLIB_RULES="$ALL_IMPORTLIB_RULES
-olepro32/libolepro32.def olepro32/libolepro32.a olepro32/libolepro32.cross.a: olepro32/olepro32.spec \$(WINEBUILD)
-	@cd olepro32 && \$(MAKE) \`basename \$@\`"
+	dlls/olepro32/libolepro32.$IMPLIBEXT"
+ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS
+dlls/olepro32/libolepro32.$IMPLIBEXT dlls/olepro32/libolepro32.cross.a: tools/widl tools/winebuild tools/winegcc include
+dlls/olepro32/libolepro32.$IMPLIBEXT dlls/olepro32/libolepro32.cross.a: dlls/olepro32/olepro32.spec dlls/olepro32/Makefile
+	@cd dlls/olepro32 && \$(MAKE) \`basename \$@\`"
 ALL_MAKEFILES="$ALL_MAKEFILES \\
 	dlls/olepro32/Makefile"
 test "x$enable_olepro32" != xno && ALL_DLL_DIRS="$ALL_DLL_DIRS \\
@@ -17126,10 +17211,11 @@ dlls/olesvr.dll16/Makefile: dlls/olesvr.dll16/Makefile.in dlls/Makedll.rules con
 ac_config_files="$ac_config_files dlls/olesvr.dll16/Makefile"
 
 ALL_IMPORT_LIBS="$ALL_IMPORT_LIBS \\
-	olesvr32/libolesvr32.$IMPLIBEXT"
-ALL_IMPORTLIB_RULES="$ALL_IMPORTLIB_RULES
-olesvr32/libolesvr32.def olesvr32/libolesvr32.a olesvr32/libolesvr32.cross.a: olesvr32/olesvr32.spec \$(WINEBUILD)
-	@cd olesvr32 && \$(MAKE) \`basename \$@\`"
+	dlls/olesvr32/libolesvr32.$IMPLIBEXT"
+ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS
+dlls/olesvr32/libolesvr32.$IMPLIBEXT dlls/olesvr32/libolesvr32.cross.a: tools/widl tools/winebuild tools/winegcc include
+dlls/olesvr32/libolesvr32.$IMPLIBEXT dlls/olesvr32/libolesvr32.cross.a: dlls/olesvr32/olesvr32.spec dlls/olesvr32/Makefile
+	@cd dlls/olesvr32 && \$(MAKE) \`basename \$@\`"
 ALL_MAKEFILES="$ALL_MAKEFILES \\
 	dlls/olesvr32/Makefile"
 test "x$enable_olesvr32" != xno && ALL_DLL_DIRS="$ALL_DLL_DIRS \\
@@ -17155,10 +17241,11 @@ dlls/openal32/Makefile: dlls/openal32/Makefile.in dlls/Makedll.rules config.stat
 ac_config_files="$ac_config_files dlls/openal32/Makefile"
 
 ALL_IMPORT_LIBS="$ALL_IMPORT_LIBS \\
-	opengl32/libopengl32.$IMPLIBEXT"
-ALL_IMPORTLIB_RULES="$ALL_IMPORTLIB_RULES
-opengl32/libopengl32.def opengl32/libopengl32.a opengl32/libopengl32.cross.a: opengl32/opengl32.spec \$(WINEBUILD)
-	@cd opengl32 && \$(MAKE) \`basename \$@\`"
+	dlls/opengl32/libopengl32.$IMPLIBEXT"
+ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS
+dlls/opengl32/libopengl32.$IMPLIBEXT dlls/opengl32/libopengl32.cross.a: tools/widl tools/winebuild tools/winegcc include
+dlls/opengl32/libopengl32.$IMPLIBEXT dlls/opengl32/libopengl32.cross.a: dlls/opengl32/opengl32.spec dlls/opengl32/Makefile
+	@cd dlls/opengl32 && \$(MAKE) \`basename \$@\`"
 ALL_MAKEFILES="$ALL_MAKEFILES \\
 	dlls/opengl32/Makefile"
 test "x$enable_opengl32" != xno && ALL_DLL_DIRS="$ALL_DLL_DIRS \\
@@ -17184,10 +17271,11 @@ dlls/opengl32/tests/Makefile: dlls/opengl32/tests/Makefile.in dlls/Maketest.rule
 ac_config_files="$ac_config_files dlls/opengl32/tests/Makefile"
 
 ALL_IMPORT_LIBS="$ALL_IMPORT_LIBS \\
-	pdh/libpdh.$IMPLIBEXT"
-ALL_IMPORTLIB_RULES="$ALL_IMPORTLIB_RULES
-pdh/libpdh.def pdh/libpdh.a pdh/libpdh.cross.a: pdh/pdh.spec \$(WINEBUILD)
-	@cd pdh && \$(MAKE) \`basename \$@\`"
+	dlls/pdh/libpdh.$IMPLIBEXT"
+ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS
+dlls/pdh/libpdh.$IMPLIBEXT dlls/pdh/libpdh.cross.a: tools/widl tools/winebuild tools/winegcc include
+dlls/pdh/libpdh.$IMPLIBEXT dlls/pdh/libpdh.cross.a: dlls/pdh/pdh.spec dlls/pdh/Makefile
+	@cd dlls/pdh && \$(MAKE) \`basename \$@\`"
 ALL_MAKEFILES="$ALL_MAKEFILES \\
 	dlls/pdh/Makefile"
 test "x$enable_pdh" != xno && ALL_DLL_DIRS="$ALL_DLL_DIRS \\
@@ -17221,10 +17309,11 @@ dlls/pidgen/Makefile: dlls/pidgen/Makefile.in dlls/Makedll.rules config.status"
 ac_config_files="$ac_config_files dlls/pidgen/Makefile"
 
 ALL_IMPORT_LIBS="$ALL_IMPORT_LIBS \\
-	powrprof/libpowrprof.$IMPLIBEXT"
-ALL_IMPORTLIB_RULES="$ALL_IMPORTLIB_RULES
-powrprof/libpowrprof.def powrprof/libpowrprof.a powrprof/libpowrprof.cross.a: powrprof/powrprof.spec \$(WINEBUILD)
-	@cd powrprof && \$(MAKE) \`basename \$@\`"
+	dlls/powrprof/libpowrprof.$IMPLIBEXT"
+ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS
+dlls/powrprof/libpowrprof.$IMPLIBEXT dlls/powrprof/libpowrprof.cross.a: tools/widl tools/winebuild tools/winegcc include
+dlls/powrprof/libpowrprof.$IMPLIBEXT dlls/powrprof/libpowrprof.cross.a: dlls/powrprof/powrprof.spec dlls/powrprof/Makefile
+	@cd dlls/powrprof && \$(MAKE) \`basename \$@\`"
 ALL_MAKEFILES="$ALL_MAKEFILES \\
 	dlls/powrprof/Makefile"
 test "x$enable_powrprof" != xno && ALL_DLL_DIRS="$ALL_DLL_DIRS \\
@@ -17250,10 +17339,11 @@ dlls/propsys/Makefile: dlls/propsys/Makefile.in dlls/Makedll.rules config.status
 ac_config_files="$ac_config_files dlls/propsys/Makefile"
 
 ALL_IMPORT_LIBS="$ALL_IMPORT_LIBS \\
-	psapi/libpsapi.$IMPLIBEXT"
-ALL_IMPORTLIB_RULES="$ALL_IMPORTLIB_RULES
-psapi/libpsapi.def psapi/libpsapi.a psapi/libpsapi.cross.a: psapi/psapi.spec \$(WINEBUILD)
-	@cd psapi && \$(MAKE) \`basename \$@\`"
+	dlls/psapi/libpsapi.$IMPLIBEXT"
+ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS
+dlls/psapi/libpsapi.$IMPLIBEXT dlls/psapi/libpsapi.cross.a: tools/widl tools/winebuild tools/winegcc include
+dlls/psapi/libpsapi.$IMPLIBEXT dlls/psapi/libpsapi.cross.a: dlls/psapi/psapi.spec dlls/psapi/Makefile
+	@cd dlls/psapi && \$(MAKE) \`basename \$@\`"
 ALL_MAKEFILES="$ALL_MAKEFILES \\
 	dlls/psapi/Makefile"
 test "x$enable_psapi" != xno && ALL_DLL_DIRS="$ALL_DLL_DIRS \\
@@ -17351,10 +17441,11 @@ dlls/qmgrprxy/Makefile: dlls/qmgrprxy/Makefile.in dlls/Makedll.rules config.stat
 ac_config_files="$ac_config_files dlls/qmgrprxy/Makefile"
 
 ALL_IMPORT_LIBS="$ALL_IMPORT_LIBS \\
-	quartz/libquartz.$IMPLIBEXT"
-ALL_IMPORTLIB_RULES="$ALL_IMPORTLIB_RULES
-quartz/libquartz.def quartz/libquartz.a quartz/libquartz.cross.a: quartz/quartz.spec \$(WINEBUILD)
-	@cd quartz && \$(MAKE) \`basename \$@\`"
+	dlls/quartz/libquartz.$IMPLIBEXT"
+ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS
+dlls/quartz/libquartz.$IMPLIBEXT dlls/quartz/libquartz.cross.a: tools/widl tools/winebuild tools/winegcc include
+dlls/quartz/libquartz.$IMPLIBEXT dlls/quartz/libquartz.cross.a: dlls/quartz/quartz.spec dlls/quartz/Makefile
+	@cd dlls/quartz && \$(MAKE) \`basename \$@\`"
 ALL_MAKEFILES="$ALL_MAKEFILES \\
 	dlls/quartz/Makefile"
 test "x$enable_quartz" != xno && ALL_DLL_DIRS="$ALL_DLL_DIRS \\
@@ -17396,10 +17487,11 @@ dlls/rasapi16.dll16/Makefile: dlls/rasapi16.dll16/Makefile.in dlls/Makedll.rules
 ac_config_files="$ac_config_files dlls/rasapi16.dll16/Makefile"
 
 ALL_IMPORT_LIBS="$ALL_IMPORT_LIBS \\
-	rasapi32/librasapi32.$IMPLIBEXT"
-ALL_IMPORTLIB_RULES="$ALL_IMPORTLIB_RULES
-rasapi32/librasapi32.def rasapi32/librasapi32.a rasapi32/librasapi32.cross.a: rasapi32/rasapi32.spec \$(WINEBUILD)
-	@cd rasapi32 && \$(MAKE) \`basename \$@\`"
+	dlls/rasapi32/librasapi32.$IMPLIBEXT"
+ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS
+dlls/rasapi32/librasapi32.$IMPLIBEXT dlls/rasapi32/librasapi32.cross.a: tools/widl tools/winebuild tools/winegcc include
+dlls/rasapi32/librasapi32.$IMPLIBEXT dlls/rasapi32/librasapi32.cross.a: dlls/rasapi32/rasapi32.spec dlls/rasapi32/Makefile
+	@cd dlls/rasapi32 && \$(MAKE) \`basename \$@\`"
 ALL_MAKEFILES="$ALL_MAKEFILES \\
 	dlls/rasapi32/Makefile"
 test "x$enable_rasapi32" != xno && ALL_DLL_DIRS="$ALL_DLL_DIRS \\
@@ -17425,10 +17517,11 @@ dlls/rasapi32/tests/Makefile: dlls/rasapi32/tests/Makefile.in dlls/Maketest.rule
 ac_config_files="$ac_config_files dlls/rasapi32/tests/Makefile"
 
 ALL_IMPORT_LIBS="$ALL_IMPORT_LIBS \\
-	rasdlg/librasdlg.$IMPLIBEXT"
-ALL_IMPORTLIB_RULES="$ALL_IMPORTLIB_RULES
-rasdlg/librasdlg.def rasdlg/librasdlg.a rasdlg/librasdlg.cross.a: rasdlg/rasdlg.spec \$(WINEBUILD)
-	@cd rasdlg && \$(MAKE) \`basename \$@\`"
+	dlls/rasdlg/librasdlg.$IMPLIBEXT"
+ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS
+dlls/rasdlg/librasdlg.$IMPLIBEXT dlls/rasdlg/librasdlg.cross.a: tools/widl tools/winebuild tools/winegcc include
+dlls/rasdlg/librasdlg.$IMPLIBEXT dlls/rasdlg/librasdlg.cross.a: dlls/rasdlg/rasdlg.spec dlls/rasdlg/Makefile
+	@cd dlls/rasdlg && \$(MAKE) \`basename \$@\`"
 ALL_MAKEFILES="$ALL_MAKEFILES \\
 	dlls/rasdlg/Makefile"
 test "x$enable_rasdlg" != xno && ALL_DLL_DIRS="$ALL_DLL_DIRS \\
@@ -17438,10 +17531,11 @@ dlls/rasdlg/Makefile: dlls/rasdlg/Makefile.in dlls/Makedll.rules config.status"
 ac_config_files="$ac_config_files dlls/rasdlg/Makefile"
 
 ALL_IMPORT_LIBS="$ALL_IMPORT_LIBS \\
-	resutils/libresutils.$IMPLIBEXT"
-ALL_IMPORTLIB_RULES="$ALL_IMPORTLIB_RULES
-resutils/libresutils.def resutils/libresutils.a resutils/libresutils.cross.a: resutils/resutils.spec \$(WINEBUILD)
-	@cd resutils && \$(MAKE) \`basename \$@\`"
+	dlls/resutils/libresutils.$IMPLIBEXT"
+ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS
+dlls/resutils/libresutils.$IMPLIBEXT dlls/resutils/libresutils.cross.a: tools/widl tools/winebuild tools/winegcc include
+dlls/resutils/libresutils.$IMPLIBEXT dlls/resutils/libresutils.cross.a: dlls/resutils/resutils.spec dlls/resutils/Makefile
+	@cd dlls/resutils && \$(MAKE) \`basename \$@\`"
 ALL_MAKEFILES="$ALL_MAKEFILES \\
 	dlls/resutils/Makefile"
 test "x$enable_resutils" != xno && ALL_DLL_DIRS="$ALL_DLL_DIRS \\
@@ -17451,10 +17545,11 @@ dlls/resutils/Makefile: dlls/resutils/Makefile.in dlls/Makedll.rules config.stat
 ac_config_files="$ac_config_files dlls/resutils/Makefile"
 
 ALL_IMPORT_LIBS="$ALL_IMPORT_LIBS \\
-	riched20/libriched20.$IMPLIBEXT"
-ALL_IMPORTLIB_RULES="$ALL_IMPORTLIB_RULES
-riched20/libriched20.def riched20/libriched20.a riched20/libriched20.cross.a: riched20/riched20.spec \$(WINEBUILD)
-	@cd riched20 && \$(MAKE) \`basename \$@\`"
+	dlls/riched20/libriched20.$IMPLIBEXT"
+ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS
+dlls/riched20/libriched20.$IMPLIBEXT dlls/riched20/libriched20.cross.a: tools/widl tools/winebuild tools/winegcc include
+dlls/riched20/libriched20.$IMPLIBEXT dlls/riched20/libriched20.cross.a: dlls/riched20/riched20.spec dlls/riched20/Makefile
+	@cd dlls/riched20 && \$(MAKE) \`basename \$@\`"
 ALL_MAKEFILES="$ALL_MAKEFILES \\
 	dlls/riched20/Makefile"
 test "x$enable_riched20" != xno && ALL_DLL_DIRS="$ALL_DLL_DIRS \\
@@ -17504,10 +17599,11 @@ dlls/riched32/tests/Makefile: dlls/riched32/tests/Makefile.in dlls/Maketest.rule
 ac_config_files="$ac_config_files dlls/riched32/tests/Makefile"
 
 ALL_IMPORT_LIBS="$ALL_IMPORT_LIBS \\
-	rpcrt4/librpcrt4.$IMPLIBEXT"
-ALL_IMPORTLIB_RULES="$ALL_IMPORTLIB_RULES
-rpcrt4/librpcrt4.def rpcrt4/librpcrt4.a rpcrt4/librpcrt4.cross.a: rpcrt4/rpcrt4.spec \$(WINEBUILD)
-	@cd rpcrt4 && \$(MAKE) \`basename \$@\`"
+	dlls/rpcrt4/librpcrt4.$IMPLIBEXT"
+ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS
+dlls/rpcrt4/librpcrt4.$IMPLIBEXT dlls/rpcrt4/librpcrt4.cross.a: tools/widl tools/winebuild tools/winegcc include
+dlls/rpcrt4/librpcrt4.$IMPLIBEXT dlls/rpcrt4/librpcrt4.cross.a: dlls/rpcrt4/rpcrt4.spec dlls/rpcrt4/Makefile
+	@cd dlls/rpcrt4 && \$(MAKE) \`basename \$@\`"
 ALL_MAKEFILES="$ALL_MAKEFILES \\
 	dlls/rpcrt4/Makefile"
 test "x$enable_rpcrt4" != xno && ALL_DLL_DIRS="$ALL_DLL_DIRS \\
@@ -17541,10 +17637,11 @@ dlls/rsabase/Makefile: dlls/rsabase/Makefile.in dlls/Makedll.rules config.status
 ac_config_files="$ac_config_files dlls/rsabase/Makefile"
 
 ALL_IMPORT_LIBS="$ALL_IMPORT_LIBS \\
-	rsaenh/librsaenh.$IMPLIBEXT"
-ALL_IMPORTLIB_RULES="$ALL_IMPORTLIB_RULES
-rsaenh/librsaenh.def rsaenh/librsaenh.a rsaenh/librsaenh.cross.a: rsaenh/rsaenh.spec \$(WINEBUILD)
-	@cd rsaenh && \$(MAKE) \`basename \$@\`"
+	dlls/rsaenh/librsaenh.$IMPLIBEXT"
+ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS
+dlls/rsaenh/librsaenh.$IMPLIBEXT dlls/rsaenh/librsaenh.cross.a: tools/widl tools/winebuild tools/winegcc include
+dlls/rsaenh/librsaenh.$IMPLIBEXT dlls/rsaenh/librsaenh.cross.a: dlls/rsaenh/rsaenh.spec dlls/rsaenh/Makefile
+	@cd dlls/rsaenh && \$(MAKE) \`basename \$@\`"
 ALL_MAKEFILES="$ALL_MAKEFILES \\
 	dlls/rsaenh/Makefile"
 test "x$enable_rsaenh" != xno && ALL_DLL_DIRS="$ALL_DLL_DIRS \\
@@ -17570,10 +17667,11 @@ dlls/rsaenh/tests/Makefile: dlls/rsaenh/tests/Makefile.in dlls/Maketest.rules co
 ac_config_files="$ac_config_files dlls/rsaenh/tests/Makefile"
 
 ALL_IMPORT_LIBS="$ALL_IMPORT_LIBS \\
-	rtutils/librtutils.$IMPLIBEXT"
-ALL_IMPORTLIB_RULES="$ALL_IMPORTLIB_RULES
-rtutils/librtutils.def rtutils/librtutils.a rtutils/librtutils.cross.a: rtutils/rtutils.spec \$(WINEBUILD)
-	@cd rtutils && \$(MAKE) \`basename \$@\`"
+	dlls/rtutils/librtutils.$IMPLIBEXT"
+ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS
+dlls/rtutils/librtutils.$IMPLIBEXT dlls/rtutils/librtutils.cross.a: tools/widl tools/winebuild tools/winegcc include
+dlls/rtutils/librtutils.$IMPLIBEXT dlls/rtutils/librtutils.cross.a: dlls/rtutils/rtutils.spec dlls/rtutils/Makefile
+	@cd dlls/rtutils && \$(MAKE) \`basename \$@\`"
 ALL_MAKEFILES="$ALL_MAKEFILES \\
 	dlls/rtutils/Makefile"
 test "x$enable_rtutils" != xno && ALL_DLL_DIRS="$ALL_DLL_DIRS \\
@@ -17623,10 +17721,11 @@ dlls/schannel/tests/Makefile: dlls/schannel/tests/Makefile.in dlls/Maketest.rule
 ac_config_files="$ac_config_files dlls/schannel/tests/Makefile"
 
 ALL_IMPORT_LIBS="$ALL_IMPORT_LIBS \\
-	secur32/libsecur32.$IMPLIBEXT"
-ALL_IMPORTLIB_RULES="$ALL_IMPORTLIB_RULES
-secur32/libsecur32.def secur32/libsecur32.a secur32/libsecur32.cross.a: secur32/secur32.spec \$(WINEBUILD)
-	@cd secur32 && \$(MAKE) \`basename \$@\`"
+	dlls/secur32/libsecur32.$IMPLIBEXT"
+ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS
+dlls/secur32/libsecur32.$IMPLIBEXT dlls/secur32/libsecur32.cross.a: tools/widl tools/winebuild tools/winegcc include
+dlls/secur32/libsecur32.$IMPLIBEXT dlls/secur32/libsecur32.cross.a: dlls/secur32/secur32.spec dlls/secur32/Makefile
+	@cd dlls/secur32 && \$(MAKE) \`basename \$@\`"
 ALL_MAKEFILES="$ALL_MAKEFILES \\
 	dlls/secur32/Makefile"
 test "x$enable_secur32" != xno && ALL_DLL_DIRS="$ALL_DLL_DIRS \\
@@ -17660,10 +17759,11 @@ dlls/security/Makefile: dlls/security/Makefile.in dlls/Makedll.rules config.stat
 ac_config_files="$ac_config_files dlls/security/Makefile"
 
 ALL_IMPORT_LIBS="$ALL_IMPORT_LIBS \\
-	sensapi/libsensapi.$IMPLIBEXT"
-ALL_IMPORTLIB_RULES="$ALL_IMPORTLIB_RULES
-sensapi/libsensapi.def sensapi/libsensapi.a sensapi/libsensapi.cross.a: sensapi/sensapi.spec \$(WINEBUILD)
-	@cd sensapi && \$(MAKE) \`basename \$@\`"
+	dlls/sensapi/libsensapi.$IMPLIBEXT"
+ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS
+dlls/sensapi/libsensapi.$IMPLIBEXT dlls/sensapi/libsensapi.cross.a: tools/widl tools/winebuild tools/winegcc include
+dlls/sensapi/libsensapi.$IMPLIBEXT dlls/sensapi/libsensapi.cross.a: dlls/sensapi/sensapi.spec dlls/sensapi/Makefile
+	@cd dlls/sensapi && \$(MAKE) \`basename \$@\`"
 ALL_MAKEFILES="$ALL_MAKEFILES \\
 	dlls/sensapi/Makefile"
 test "x$enable_sensapi" != xno && ALL_DLL_DIRS="$ALL_DLL_DIRS \\
@@ -17673,10 +17773,11 @@ dlls/sensapi/Makefile: dlls/sensapi/Makefile.in dlls/Makedll.rules config.status
 ac_config_files="$ac_config_files dlls/sensapi/Makefile"
 
 ALL_IMPORT_LIBS="$ALL_IMPORT_LIBS \\
-	serialui/libserialui.$IMPLIBEXT"
-ALL_IMPORTLIB_RULES="$ALL_IMPORTLIB_RULES
-serialui/libserialui.def serialui/libserialui.a serialui/libserialui.cross.a: serialui/serialui.spec \$(WINEBUILD)
-	@cd serialui && \$(MAKE) \`basename \$@\`"
+	dlls/serialui/libserialui.$IMPLIBEXT"
+ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS
+dlls/serialui/libserialui.$IMPLIBEXT dlls/serialui/libserialui.cross.a: tools/widl tools/winebuild tools/winegcc include
+dlls/serialui/libserialui.$IMPLIBEXT dlls/serialui/libserialui.cross.a: dlls/serialui/serialui.spec dlls/serialui/Makefile
+	@cd dlls/serialui && \$(MAKE) \`basename \$@\`"
 ALL_MAKEFILES="$ALL_MAKEFILES \\
 	dlls/serialui/Makefile"
 test "x$enable_serialui" != xno && ALL_DLL_DIRS="$ALL_DLL_DIRS \\
@@ -17702,10 +17803,11 @@ dlls/serialui/tests/Makefile: dlls/serialui/tests/Makefile.in dlls/Maketest.rule
 ac_config_files="$ac_config_files dlls/serialui/tests/Makefile"
 
 ALL_IMPORT_LIBS="$ALL_IMPORT_LIBS \\
-	setupapi/libsetupapi.$IMPLIBEXT"
-ALL_IMPORTLIB_RULES="$ALL_IMPORTLIB_RULES
-setupapi/libsetupapi.def setupapi/libsetupapi.a setupapi/libsetupapi.cross.a: setupapi/setupapi.spec \$(WINEBUILD)
-	@cd setupapi && \$(MAKE) \`basename \$@\`"
+	dlls/setupapi/libsetupapi.$IMPLIBEXT"
+ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS
+dlls/setupapi/libsetupapi.$IMPLIBEXT dlls/setupapi/libsetupapi.cross.a: tools/widl tools/winebuild tools/winegcc include
+dlls/setupapi/libsetupapi.$IMPLIBEXT dlls/setupapi/libsetupapi.cross.a: dlls/setupapi/setupapi.spec dlls/setupapi/Makefile
+	@cd dlls/setupapi && \$(MAKE) \`basename \$@\`"
 ALL_MAKEFILES="$ALL_MAKEFILES \\
 	dlls/setupapi/Makefile"
 test "x$enable_setupapi" != xno && ALL_DLL_DIRS="$ALL_DLL_DIRS \\
@@ -17739,10 +17841,11 @@ dlls/setupx.dll16/Makefile: dlls/setupx.dll16/Makefile.in dlls/Makedll.rules con
 ac_config_files="$ac_config_files dlls/setupx.dll16/Makefile"
 
 ALL_IMPORT_LIBS="$ALL_IMPORT_LIBS \\
-	sfc/libsfc.$IMPLIBEXT"
-ALL_IMPORTLIB_RULES="$ALL_IMPORTLIB_RULES
-sfc/libsfc.def sfc/libsfc.a sfc/libsfc.cross.a: sfc/sfc.spec \$(WINEBUILD)
-	@cd sfc && \$(MAKE) \`basename \$@\`"
+	dlls/sfc/libsfc.$IMPLIBEXT"
+ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS
+dlls/sfc/libsfc.$IMPLIBEXT dlls/sfc/libsfc.cross.a: tools/widl tools/winebuild tools/winegcc include
+dlls/sfc/libsfc.$IMPLIBEXT dlls/sfc/libsfc.cross.a: dlls/sfc/sfc.spec dlls/sfc/Makefile
+	@cd dlls/sfc && \$(MAKE) \`basename \$@\`"
 ALL_MAKEFILES="$ALL_MAKEFILES \\
 	dlls/sfc/Makefile"
 test "x$enable_sfc" != xno && ALL_DLL_DIRS="$ALL_DLL_DIRS \\
@@ -17752,10 +17855,11 @@ dlls/sfc/Makefile: dlls/sfc/Makefile.in dlls/Makedll.rules config.status"
 ac_config_files="$ac_config_files dlls/sfc/Makefile"
 
 ALL_IMPORT_LIBS="$ALL_IMPORT_LIBS \\
-	sfc_os/libsfc_os.$IMPLIBEXT"
-ALL_IMPORTLIB_RULES="$ALL_IMPORTLIB_RULES
-sfc_os/libsfc_os.def sfc_os/libsfc_os.a sfc_os/libsfc_os.cross.a: sfc_os/sfc_os.spec \$(WINEBUILD)
-	@cd sfc_os && \$(MAKE) \`basename \$@\`"
+	dlls/sfc_os/libsfc_os.$IMPLIBEXT"
+ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS
+dlls/sfc_os/libsfc_os.$IMPLIBEXT dlls/sfc_os/libsfc_os.cross.a: tools/widl tools/winebuild tools/winegcc include
+dlls/sfc_os/libsfc_os.$IMPLIBEXT dlls/sfc_os/libsfc_os.cross.a: dlls/sfc_os/sfc_os.spec dlls/sfc_os/Makefile
+	@cd dlls/sfc_os && \$(MAKE) \`basename \$@\`"
 ALL_MAKEFILES="$ALL_MAKEFILES \\
 	dlls/sfc_os/Makefile"
 test "x$enable_sfc_os" != xno && ALL_DLL_DIRS="$ALL_DLL_DIRS \\
@@ -17773,10 +17877,11 @@ dlls/shdoclc/Makefile: dlls/shdoclc/Makefile.in dlls/Makedll.rules config.status
 ac_config_files="$ac_config_files dlls/shdoclc/Makefile"
 
 ALL_IMPORT_LIBS="$ALL_IMPORT_LIBS \\
-	shdocvw/libshdocvw.$IMPLIBEXT"
-ALL_IMPORTLIB_RULES="$ALL_IMPORTLIB_RULES
-shdocvw/libshdocvw.def shdocvw/libshdocvw.a shdocvw/libshdocvw.cross.a: shdocvw/shdocvw.spec \$(WINEBUILD)
-	@cd shdocvw && \$(MAKE) \`basename \$@\`"
+	dlls/shdocvw/libshdocvw.$IMPLIBEXT"
+ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS
+dlls/shdocvw/libshdocvw.$IMPLIBEXT dlls/shdocvw/libshdocvw.cross.a: tools/widl tools/winebuild tools/winegcc include
+dlls/shdocvw/libshdocvw.$IMPLIBEXT dlls/shdocvw/libshdocvw.cross.a: dlls/shdocvw/shdocvw.spec dlls/shdocvw/Makefile
+	@cd dlls/shdocvw && \$(MAKE) \`basename \$@\`"
 ALL_MAKEFILES="$ALL_MAKEFILES \\
 	dlls/shdocvw/Makefile"
 test "x$enable_shdocvw" != xno && ALL_DLL_DIRS="$ALL_DLL_DIRS \\
@@ -17810,10 +17915,11 @@ dlls/shell.dll16/Makefile: dlls/shell.dll16/Makefile.in dlls/Makedll.rules confi
 ac_config_files="$ac_config_files dlls/shell.dll16/Makefile"
 
 ALL_IMPORT_LIBS="$ALL_IMPORT_LIBS \\
-	shell32/libshell32.$IMPLIBEXT"
-ALL_IMPORTLIB_RULES="$ALL_IMPORTLIB_RULES
-shell32/libshell32.def shell32/libshell32.a shell32/libshell32.cross.a: shell32/shell32.spec \$(WINEBUILD)
-	@cd shell32 && \$(MAKE) \`basename \$@\`"
+	dlls/shell32/libshell32.$IMPLIBEXT"
+ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS
+dlls/shell32/libshell32.$IMPLIBEXT dlls/shell32/libshell32.cross.a: tools/widl tools/winebuild tools/winegcc include
+dlls/shell32/libshell32.$IMPLIBEXT dlls/shell32/libshell32.cross.a: dlls/shell32/shell32.spec dlls/shell32/Makefile
+	@cd dlls/shell32 && \$(MAKE) \`basename \$@\`"
 ALL_MAKEFILES="$ALL_MAKEFILES \\
 	dlls/shell32/Makefile"
 test "x$enable_shell32" != xno && ALL_DLL_DIRS="$ALL_DLL_DIRS \\
@@ -17839,10 +17945,11 @@ dlls/shell32/tests/Makefile: dlls/shell32/tests/Makefile.in dlls/Maketest.rules
 ac_config_files="$ac_config_files dlls/shell32/tests/Makefile"
 
 ALL_IMPORT_LIBS="$ALL_IMPORT_LIBS \\
-	shfolder/libshfolder.$IMPLIBEXT"
-ALL_IMPORTLIB_RULES="$ALL_IMPORTLIB_RULES
-shfolder/libshfolder.def shfolder/libshfolder.a shfolder/libshfolder.cross.a: shfolder/shfolder.spec \$(WINEBUILD)
-	@cd shfolder && \$(MAKE) \`basename \$@\`"
+	dlls/shfolder/libshfolder.$IMPLIBEXT"
+ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS
+dlls/shfolder/libshfolder.$IMPLIBEXT dlls/shfolder/libshfolder.cross.a: tools/widl tools/winebuild tools/winegcc include
+dlls/shfolder/libshfolder.$IMPLIBEXT dlls/shfolder/libshfolder.cross.a: dlls/shfolder/shfolder.spec dlls/shfolder/Makefile
+	@cd dlls/shfolder && \$(MAKE) \`basename \$@\`"
 ALL_MAKEFILES="$ALL_MAKEFILES \\
 	dlls/shfolder/Makefile"
 test "x$enable_shfolder" != xno && ALL_DLL_DIRS="$ALL_DLL_DIRS \\
@@ -17852,10 +17959,11 @@ dlls/shfolder/Makefile: dlls/shfolder/Makefile.in dlls/Makedll.rules config.stat
 ac_config_files="$ac_config_files dlls/shfolder/Makefile"
 
 ALL_IMPORT_LIBS="$ALL_IMPORT_LIBS \\
-	shlwapi/libshlwapi.$IMPLIBEXT"
-ALL_IMPORTLIB_RULES="$ALL_IMPORTLIB_RULES
-shlwapi/libshlwapi.def shlwapi/libshlwapi.a shlwapi/libshlwapi.cross.a: shlwapi/shlwapi.spec \$(WINEBUILD)
-	@cd shlwapi && \$(MAKE) \`basename \$@\`"
+	dlls/shlwapi/libshlwapi.$IMPLIBEXT"
+ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS
+dlls/shlwapi/libshlwapi.$IMPLIBEXT dlls/shlwapi/libshlwapi.cross.a: tools/widl tools/winebuild tools/winegcc include
+dlls/shlwapi/libshlwapi.$IMPLIBEXT dlls/shlwapi/libshlwapi.cross.a: dlls/shlwapi/shlwapi.spec dlls/shlwapi/Makefile
+	@cd dlls/shlwapi && \$(MAKE) \`basename \$@\`"
 ALL_MAKEFILES="$ALL_MAKEFILES \\
 	dlls/shlwapi/Makefile"
 test "x$enable_shlwapi" != xno && ALL_DLL_DIRS="$ALL_DLL_DIRS \\
@@ -17889,10 +17997,11 @@ dlls/slbcsp/Makefile: dlls/slbcsp/Makefile.in dlls/Makedll.rules config.status"
 ac_config_files="$ac_config_files dlls/slbcsp/Makefile"
 
 ALL_IMPORT_LIBS="$ALL_IMPORT_LIBS \\
-	slc/libslc.$IMPLIBEXT"
-ALL_IMPORTLIB_RULES="$ALL_IMPORTLIB_RULES
-slc/libslc.def slc/libslc.a slc/libslc.cross.a: slc/slc.spec \$(WINEBUILD)
-	@cd slc && \$(MAKE) \`basename \$@\`"
+	dlls/slc/libslc.$IMPLIBEXT"
+ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS
+dlls/slc/libslc.$IMPLIBEXT dlls/slc/libslc.cross.a: tools/widl tools/winebuild tools/winegcc include
+dlls/slc/libslc.$IMPLIBEXT dlls/slc/libslc.cross.a: dlls/slc/slc.spec dlls/slc/Makefile
+	@cd dlls/slc && \$(MAKE) \`basename \$@\`"
 ALL_MAKEFILES="$ALL_MAKEFILES \\
 	dlls/slc/Makefile"
 test "x$enable_slc" != xno && ALL_DLL_DIRS="$ALL_DLL_DIRS \\
@@ -17902,10 +18011,11 @@ dlls/slc/Makefile: dlls/slc/Makefile.in dlls/Makedll.rules config.status"
 ac_config_files="$ac_config_files dlls/slc/Makefile"
 
 ALL_IMPORT_LIBS="$ALL_IMPORT_LIBS \\
-	snmpapi/libsnmpapi.$IMPLIBEXT"
-ALL_IMPORTLIB_RULES="$ALL_IMPORTLIB_RULES
-snmpapi/libsnmpapi.def snmpapi/libsnmpapi.a snmpapi/libsnmpapi.cross.a: snmpapi/snmpapi.spec \$(WINEBUILD)
-	@cd snmpapi && \$(MAKE) \`basename \$@\`"
+	dlls/snmpapi/libsnmpapi.$IMPLIBEXT"
+ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS
+dlls/snmpapi/libsnmpapi.$IMPLIBEXT dlls/snmpapi/libsnmpapi.cross.a: tools/widl tools/winebuild tools/winegcc include
+dlls/snmpapi/libsnmpapi.$IMPLIBEXT dlls/snmpapi/libsnmpapi.cross.a: dlls/snmpapi/snmpapi.spec dlls/snmpapi/Makefile
+	@cd dlls/snmpapi && \$(MAKE) \`basename \$@\`"
 ALL_MAKEFILES="$ALL_MAKEFILES \\
 	dlls/snmpapi/Makefile"
 test "x$enable_snmpapi" != xno && ALL_DLL_DIRS="$ALL_DLL_DIRS \\
@@ -17947,10 +18057,11 @@ dlls/sound.drv16/Makefile: dlls/sound.drv16/Makefile.in dlls/Makedll.rules confi
 ac_config_files="$ac_config_files dlls/sound.drv16/Makefile"
 
 ALL_IMPORT_LIBS="$ALL_IMPORT_LIBS \\
-	spoolss/libspoolss.$IMPLIBEXT"
-ALL_IMPORTLIB_RULES="$ALL_IMPORTLIB_RULES
-spoolss/libspoolss.def spoolss/libspoolss.a spoolss/libspoolss.cross.a: spoolss/spoolss.spec \$(WINEBUILD)
-	@cd spoolss && \$(MAKE) \`basename \$@\`"
+	dlls/spoolss/libspoolss.$IMPLIBEXT"
+ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS
+dlls/spoolss/libspoolss.$IMPLIBEXT dlls/spoolss/libspoolss.cross.a: tools/widl tools/winebuild tools/winegcc include
+dlls/spoolss/libspoolss.$IMPLIBEXT dlls/spoolss/libspoolss.cross.a: dlls/spoolss/spoolss.spec dlls/spoolss/Makefile
+	@cd dlls/spoolss && \$(MAKE) \`basename \$@\`"
 ALL_MAKEFILES="$ALL_MAKEFILES \\
 	dlls/spoolss/Makefile"
 test "x$enable_spoolss" != xno && ALL_DLL_DIRS="$ALL_DLL_DIRS \\
@@ -17992,10 +18103,11 @@ dlls/stdole32.tlb/Makefile: dlls/stdole32.tlb/Makefile.in dlls/Makedll.rules con
 ac_config_files="$ac_config_files dlls/stdole32.tlb/Makefile"
 
 ALL_IMPORT_LIBS="$ALL_IMPORT_LIBS \\
-	sti/libsti.$IMPLIBEXT"
-ALL_IMPORTLIB_RULES="$ALL_IMPORTLIB_RULES
-sti/libsti.def sti/libsti.a sti/libsti.cross.a: sti/sti.spec \$(WINEBUILD)
-	@cd sti && \$(MAKE) \`basename \$@\`"
+	dlls/sti/libsti.$IMPLIBEXT"
+ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS
+dlls/sti/libsti.$IMPLIBEXT dlls/sti/libsti.cross.a: tools/widl tools/winebuild tools/winegcc include
+dlls/sti/libsti.$IMPLIBEXT dlls/sti/libsti.cross.a: dlls/sti/sti.spec dlls/sti/Makefile
+	@cd dlls/sti && \$(MAKE) \`basename \$@\`"
 ALL_MAKEFILES="$ALL_MAKEFILES \\
 	dlls/sti/Makefile"
 test "x$enable_sti" != xno && ALL_DLL_DIRS="$ALL_DLL_DIRS \\
@@ -18085,10 +18197,11 @@ dlls/t2embed/Makefile: dlls/t2embed/Makefile.in dlls/Makedll.rules config.status
 ac_config_files="$ac_config_files dlls/t2embed/Makefile"
 
 ALL_IMPORT_LIBS="$ALL_IMPORT_LIBS \\
-	tapi32/libtapi32.$IMPLIBEXT"
-ALL_IMPORTLIB_RULES="$ALL_IMPORTLIB_RULES
-tapi32/libtapi32.def tapi32/libtapi32.a tapi32/libtapi32.cross.a: tapi32/tapi32.spec \$(WINEBUILD)
-	@cd tapi32 && \$(MAKE) \`basename \$@\`"
+	dlls/tapi32/libtapi32.$IMPLIBEXT"
+ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS
+dlls/tapi32/libtapi32.$IMPLIBEXT dlls/tapi32/libtapi32.cross.a: tools/widl tools/winebuild tools/winegcc include
+dlls/tapi32/libtapi32.$IMPLIBEXT dlls/tapi32/libtapi32.cross.a: dlls/tapi32/tapi32.spec dlls/tapi32/Makefile
+	@cd dlls/tapi32 && \$(MAKE) \`basename \$@\`"
 ALL_MAKEFILES="$ALL_MAKEFILES \\
 	dlls/tapi32/Makefile"
 test "x$enable_tapi32" != xno && ALL_DLL_DIRS="$ALL_DLL_DIRS \\
@@ -18154,10 +18267,11 @@ dlls/typelib.dll16/Makefile: dlls/typelib.dll16/Makefile.in dlls/Makedll.rules c
 ac_config_files="$ac_config_files dlls/typelib.dll16/Makefile"
 
 ALL_IMPORT_LIBS="$ALL_IMPORT_LIBS \\
-	unicows/libunicows.$IMPLIBEXT"
-ALL_IMPORTLIB_RULES="$ALL_IMPORTLIB_RULES
-unicows/libunicows.def unicows/libunicows.a unicows/libunicows.cross.a: unicows/unicows.spec \$(WINEBUILD)
-	@cd unicows && \$(MAKE) \`basename \$@\`"
+	dlls/unicows/libunicows.$IMPLIBEXT"
+ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS
+dlls/unicows/libunicows.$IMPLIBEXT dlls/unicows/libunicows.cross.a: tools/widl tools/winebuild tools/winegcc include
+dlls/unicows/libunicows.$IMPLIBEXT dlls/unicows/libunicows.cross.a: dlls/unicows/unicows.spec dlls/unicows/Makefile
+	@cd dlls/unicows && \$(MAKE) \`basename \$@\`"
 ALL_MAKEFILES="$ALL_MAKEFILES \\
 	dlls/unicows/Makefile"
 test "x$enable_unicows" != xno && ALL_DLL_DIRS="$ALL_DLL_DIRS \\
@@ -18175,10 +18289,11 @@ dlls/updspapi/Makefile: dlls/updspapi/Makefile.in dlls/Makedll.rules config.stat
 ac_config_files="$ac_config_files dlls/updspapi/Makefile"
 
 ALL_IMPORT_LIBS="$ALL_IMPORT_LIBS \\
-	url/liburl.$IMPLIBEXT"
-ALL_IMPORTLIB_RULES="$ALL_IMPORTLIB_RULES
-url/liburl.def url/liburl.a url/liburl.cross.a: url/url.spec \$(WINEBUILD)
-	@cd url && \$(MAKE) \`basename \$@\`"
+	dlls/url/liburl.$IMPLIBEXT"
+ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS
+dlls/url/liburl.$IMPLIBEXT dlls/url/liburl.cross.a: tools/widl tools/winebuild tools/winegcc include
+dlls/url/liburl.$IMPLIBEXT dlls/url/liburl.cross.a: dlls/url/url.spec dlls/url/Makefile
+	@cd dlls/url && \$(MAKE) \`basename \$@\`"
 ALL_MAKEFILES="$ALL_MAKEFILES \\
 	dlls/url/Makefile"
 test "x$enable_url" != xno && ALL_DLL_DIRS="$ALL_DLL_DIRS \\
@@ -18188,10 +18303,11 @@ dlls/url/Makefile: dlls/url/Makefile.in dlls/Makedll.rules config.status"
 ac_config_files="$ac_config_files dlls/url/Makefile"
 
 ALL_IMPORT_LIBS="$ALL_IMPORT_LIBS \\
-	urlmon/liburlmon.$IMPLIBEXT"
-ALL_IMPORTLIB_RULES="$ALL_IMPORTLIB_RULES
-urlmon/liburlmon.def urlmon/liburlmon.a urlmon/liburlmon.cross.a: urlmon/urlmon.spec \$(WINEBUILD)
-	@cd urlmon && \$(MAKE) \`basename \$@\`"
+	dlls/urlmon/liburlmon.$IMPLIBEXT"
+ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS
+dlls/urlmon/liburlmon.$IMPLIBEXT dlls/urlmon/liburlmon.cross.a: tools/widl tools/winebuild tools/winegcc include
+dlls/urlmon/liburlmon.$IMPLIBEXT dlls/urlmon/liburlmon.cross.a: dlls/urlmon/urlmon.spec dlls/urlmon/Makefile
+	@cd dlls/urlmon && \$(MAKE) \`basename \$@\`"
 ALL_MAKEFILES="$ALL_MAKEFILES \\
 	dlls/urlmon/Makefile"
 test "x$enable_urlmon" != xno && ALL_DLL_DIRS="$ALL_DLL_DIRS \\
@@ -18225,10 +18341,11 @@ dlls/user.exe16/Makefile: dlls/user.exe16/Makefile.in dlls/Makedll.rules config.
 ac_config_files="$ac_config_files dlls/user.exe16/Makefile"
 
 ALL_IMPORT_LIBS="$ALL_IMPORT_LIBS \\
-	user32/libuser32.$IMPLIBEXT"
-ALL_IMPORTLIB_RULES="$ALL_IMPORTLIB_RULES
-user32/libuser32.def user32/libuser32.a user32/libuser32.cross.a: user32/user32.spec \$(WINEBUILD)
-	@cd user32 && \$(MAKE) \`basename \$@\`"
+	dlls/user32/libuser32.$IMPLIBEXT"
+ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS
+dlls/user32/libuser32.$IMPLIBEXT dlls/user32/libuser32.cross.a: tools/widl tools/winebuild tools/winegcc include
+dlls/user32/libuser32.$IMPLIBEXT dlls/user32/libuser32.cross.a: dlls/user32/user32.spec dlls/user32/Makefile
+	@cd dlls/user32 && \$(MAKE) \`basename \$@\`"
 ALL_MAKEFILES="$ALL_MAKEFILES \\
 	dlls/user32/Makefile"
 test "x$enable_user32" != xno && ALL_DLL_DIRS="$ALL_DLL_DIRS \\
@@ -18254,10 +18371,11 @@ dlls/user32/tests/Makefile: dlls/user32/tests/Makefile.in dlls/Maketest.rules co
 ac_config_files="$ac_config_files dlls/user32/tests/Makefile"
 
 ALL_IMPORT_LIBS="$ALL_IMPORT_LIBS \\
-	userenv/libuserenv.$IMPLIBEXT"
-ALL_IMPORTLIB_RULES="$ALL_IMPORTLIB_RULES
-userenv/libuserenv.def userenv/libuserenv.a userenv/libuserenv.cross.a: userenv/userenv.spec \$(WINEBUILD)
-	@cd userenv && \$(MAKE) \`basename \$@\`"
+	dlls/userenv/libuserenv.$IMPLIBEXT"
+ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS
+dlls/userenv/libuserenv.$IMPLIBEXT dlls/userenv/libuserenv.cross.a: tools/widl tools/winebuild tools/winegcc include
+dlls/userenv/libuserenv.$IMPLIBEXT dlls/userenv/libuserenv.cross.a: dlls/userenv/userenv.spec dlls/userenv/Makefile
+	@cd dlls/userenv && \$(MAKE) \`basename \$@\`"
 ALL_MAKEFILES="$ALL_MAKEFILES \\
 	dlls/userenv/Makefile"
 test "x$enable_userenv" != xno && ALL_DLL_DIRS="$ALL_DLL_DIRS \\
@@ -18283,10 +18401,11 @@ dlls/userenv/tests/Makefile: dlls/userenv/tests/Makefile.in dlls/Maketest.rules
 ac_config_files="$ac_config_files dlls/userenv/tests/Makefile"
 
 ALL_IMPORT_LIBS="$ALL_IMPORT_LIBS \\
-	usp10/libusp10.$IMPLIBEXT"
-ALL_IMPORTLIB_RULES="$ALL_IMPORTLIB_RULES
-usp10/libusp10.def usp10/libusp10.a usp10/libusp10.cross.a: usp10/usp10.spec \$(WINEBUILD)
-	@cd usp10 && \$(MAKE) \`basename \$@\`"
+	dlls/usp10/libusp10.$IMPLIBEXT"
+ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS
+dlls/usp10/libusp10.$IMPLIBEXT dlls/usp10/libusp10.cross.a: tools/widl tools/winebuild tools/winegcc include
+dlls/usp10/libusp10.$IMPLIBEXT dlls/usp10/libusp10.cross.a: dlls/usp10/usp10.spec dlls/usp10/Makefile
+	@cd dlls/usp10 && \$(MAKE) \`basename \$@\`"
 ALL_MAKEFILES="$ALL_MAKEFILES \\
 	dlls/usp10/Makefile"
 test "x$enable_usp10" != xno && ALL_DLL_DIRS="$ALL_DLL_DIRS \\
@@ -18328,10 +18447,11 @@ dlls/uuid/Makefile: dlls/uuid/Makefile.in dlls/Makeimplib.rules config.status"
 ac_config_files="$ac_config_files dlls/uuid/Makefile"
 
 ALL_IMPORT_LIBS="$ALL_IMPORT_LIBS \\
-	uxtheme/libuxtheme.$IMPLIBEXT"
-ALL_IMPORTLIB_RULES="$ALL_IMPORTLIB_RULES
-uxtheme/libuxtheme.def uxtheme/libuxtheme.a uxtheme/libuxtheme.cross.a: uxtheme/uxtheme.spec \$(WINEBUILD)
-	@cd uxtheme && \$(MAKE) \`basename \$@\`"
+	dlls/uxtheme/libuxtheme.$IMPLIBEXT"
+ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS
+dlls/uxtheme/libuxtheme.$IMPLIBEXT dlls/uxtheme/libuxtheme.cross.a: tools/widl tools/winebuild tools/winegcc include
+dlls/uxtheme/libuxtheme.$IMPLIBEXT dlls/uxtheme/libuxtheme.cross.a: dlls/uxtheme/uxtheme.spec dlls/uxtheme/Makefile
+	@cd dlls/uxtheme && \$(MAKE) \`basename \$@\`"
 ALL_MAKEFILES="$ALL_MAKEFILES \\
 	dlls/uxtheme/Makefile"
 test "x$enable_uxtheme" != xno && ALL_DLL_DIRS="$ALL_DLL_DIRS \\
@@ -18365,10 +18485,11 @@ dlls/vdhcp.vxd/Makefile: dlls/vdhcp.vxd/Makefile.in dlls/Makedll.rules config.st
 ac_config_files="$ac_config_files dlls/vdhcp.vxd/Makefile"
 
 ALL_IMPORT_LIBS="$ALL_IMPORT_LIBS \\
-	vdmdbg/libvdmdbg.$IMPLIBEXT"
-ALL_IMPORTLIB_RULES="$ALL_IMPORTLIB_RULES
-vdmdbg/libvdmdbg.def vdmdbg/libvdmdbg.a vdmdbg/libvdmdbg.cross.a: vdmdbg/vdmdbg.spec \$(WINEBUILD)
-	@cd vdmdbg && \$(MAKE) \`basename \$@\`"
+	dlls/vdmdbg/libvdmdbg.$IMPLIBEXT"
+ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS
+dlls/vdmdbg/libvdmdbg.$IMPLIBEXT dlls/vdmdbg/libvdmdbg.cross.a: tools/widl tools/winebuild tools/winegcc include
+dlls/vdmdbg/libvdmdbg.$IMPLIBEXT dlls/vdmdbg/libvdmdbg.cross.a: dlls/vdmdbg/vdmdbg.spec dlls/vdmdbg/Makefile
+	@cd dlls/vdmdbg && \$(MAKE) \`basename \$@\`"
 ALL_MAKEFILES="$ALL_MAKEFILES \\
 	dlls/vdmdbg/Makefile"
 test "x$enable_vdmdbg" != xno && ALL_DLL_DIRS="$ALL_DLL_DIRS \\
@@ -18386,10 +18507,11 @@ dlls/ver.dll16/Makefile: dlls/ver.dll16/Makefile.in dlls/Makedll.rules config.st
 ac_config_files="$ac_config_files dlls/ver.dll16/Makefile"
 
 ALL_IMPORT_LIBS="$ALL_IMPORT_LIBS \\
-	version/libversion.$IMPLIBEXT"
-ALL_IMPORTLIB_RULES="$ALL_IMPORTLIB_RULES
-version/libversion.def version/libversion.a version/libversion.cross.a: version/version.spec \$(WINEBUILD)
-	@cd version && \$(MAKE) \`basename \$@\`"
+	dlls/version/libversion.$IMPLIBEXT"
+ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS
+dlls/version/libversion.$IMPLIBEXT dlls/version/libversion.cross.a: tools/widl tools/winebuild tools/winegcc include
+dlls/version/libversion.$IMPLIBEXT dlls/version/libversion.cross.a: dlls/version/version.spec dlls/version/Makefile
+	@cd dlls/version && \$(MAKE) \`basename \$@\`"
 ALL_MAKEFILES="$ALL_MAKEFILES \\
 	dlls/version/Makefile"
 test "x$enable_version" != xno && ALL_DLL_DIRS="$ALL_DLL_DIRS \\
@@ -18519,10 +18641,11 @@ dlls/windebug.dll16/Makefile: dlls/windebug.dll16/Makefile.in dlls/Makedll.rules
 ac_config_files="$ac_config_files dlls/windebug.dll16/Makefile"
 
 ALL_IMPORT_LIBS="$ALL_IMPORT_LIBS \\
-	windowscodecs/libwindowscodecs.$IMPLIBEXT"
-ALL_IMPORTLIB_RULES="$ALL_IMPORTLIB_RULES
-windowscodecs/libwindowscodecs.def windowscodecs/libwindowscodecs.a windowscodecs/libwindowscodecs.cross.a: windowscodecs/windowscodecs.spec \$(WINEBUILD)
-	@cd windowscodecs && \$(MAKE) \`basename \$@\`"
+	dlls/windowscodecs/libwindowscodecs.$IMPLIBEXT"
+ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS
+dlls/windowscodecs/libwindowscodecs.$IMPLIBEXT dlls/windowscodecs/libwindowscodecs.cross.a: tools/widl tools/winebuild tools/winegcc include
+dlls/windowscodecs/libwindowscodecs.$IMPLIBEXT dlls/windowscodecs/libwindowscodecs.cross.a: dlls/windowscodecs/windowscodecs.spec dlls/windowscodecs/Makefile
+	@cd dlls/windowscodecs && \$(MAKE) \`basename \$@\`"
 ALL_MAKEFILES="$ALL_MAKEFILES \\
 	dlls/windowscodecs/Makefile"
 test "x$enable_windowscodecs" != xno && ALL_DLL_DIRS="$ALL_DLL_DIRS \\
@@ -18588,10 +18711,11 @@ dlls/winecrt0/Makefile: dlls/winecrt0/Makefile.in dlls/Makeimplib.rules config.s
 ac_config_files="$ac_config_files dlls/winecrt0/Makefile"
 
 ALL_IMPORT_LIBS="$ALL_IMPORT_LIBS \\
-	wined3d/libwined3d.$IMPLIBEXT"
-ALL_IMPORTLIB_RULES="$ALL_IMPORTLIB_RULES
-wined3d/libwined3d.def wined3d/libwined3d.a wined3d/libwined3d.cross.a: wined3d/wined3d.spec \$(WINEBUILD)
-	@cd wined3d && \$(MAKE) \`basename \$@\`"
+	dlls/wined3d/libwined3d.$IMPLIBEXT"
+ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS
+dlls/wined3d/libwined3d.$IMPLIBEXT dlls/wined3d/libwined3d.cross.a: tools/widl tools/winebuild tools/winegcc include
+dlls/wined3d/libwined3d.$IMPLIBEXT dlls/wined3d/libwined3d.cross.a: dlls/wined3d/wined3d.spec dlls/wined3d/Makefile
+	@cd dlls/wined3d && \$(MAKE) \`basename \$@\`"
 ALL_MAKEFILES="$ALL_MAKEFILES \\
 	dlls/wined3d/Makefile"
 test "x$enable_wined3d" != xno && ALL_DLL_DIRS="$ALL_DLL_DIRS \\
@@ -18705,10 +18829,11 @@ dlls/wing32/Makefile: dlls/wing32/Makefile.in dlls/Makedll.rules config.status"
 ac_config_files="$ac_config_files dlls/wing32/Makefile"
 
 ALL_IMPORT_LIBS="$ALL_IMPORT_LIBS \\
-	winhttp/libwinhttp.$IMPLIBEXT"
-ALL_IMPORTLIB_RULES="$ALL_IMPORTLIB_RULES
-winhttp/libwinhttp.def winhttp/libwinhttp.a winhttp/libwinhttp.cross.a: winhttp/winhttp.spec \$(WINEBUILD)
-	@cd winhttp && \$(MAKE) \`basename \$@\`"
+	dlls/winhttp/libwinhttp.$IMPLIBEXT"
+ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS
+dlls/winhttp/libwinhttp.$IMPLIBEXT dlls/winhttp/libwinhttp.cross.a: tools/widl tools/winebuild tools/winegcc include
+dlls/winhttp/libwinhttp.$IMPLIBEXT dlls/winhttp/libwinhttp.cross.a: dlls/winhttp/winhttp.spec dlls/winhttp/Makefile
+	@cd dlls/winhttp && \$(MAKE) \`basename \$@\`"
 ALL_MAKEFILES="$ALL_MAKEFILES \\
 	dlls/winhttp/Makefile"
 test "x$enable_winhttp" != xno && ALL_DLL_DIRS="$ALL_DLL_DIRS \\
@@ -18734,10 +18859,11 @@ dlls/winhttp/tests/Makefile: dlls/winhttp/tests/Makefile.in dlls/Maketest.rules
 ac_config_files="$ac_config_files dlls/winhttp/tests/Makefile"
 
 ALL_IMPORT_LIBS="$ALL_IMPORT_LIBS \\
-	wininet/libwininet.$IMPLIBEXT"
-ALL_IMPORTLIB_RULES="$ALL_IMPORTLIB_RULES
-wininet/libwininet.def wininet/libwininet.a wininet/libwininet.cross.a: wininet/wininet.spec \$(WINEBUILD)
-	@cd wininet && \$(MAKE) \`basename \$@\`"
+	dlls/wininet/libwininet.$IMPLIBEXT"
+ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS
+dlls/wininet/libwininet.$IMPLIBEXT dlls/wininet/libwininet.cross.a: tools/widl tools/winebuild tools/winegcc include
+dlls/wininet/libwininet.$IMPLIBEXT dlls/wininet/libwininet.cross.a: dlls/wininet/wininet.spec dlls/wininet/Makefile
+	@cd dlls/wininet && \$(MAKE) \`basename \$@\`"
 ALL_MAKEFILES="$ALL_MAKEFILES \\
 	dlls/wininet/Makefile"
 test "x$enable_wininet" != xno && ALL_DLL_DIRS="$ALL_DLL_DIRS \\
@@ -18763,10 +18889,11 @@ dlls/wininet/tests/Makefile: dlls/wininet/tests/Makefile.in dlls/Maketest.rules
 ac_config_files="$ac_config_files dlls/wininet/tests/Makefile"
 
 ALL_IMPORT_LIBS="$ALL_IMPORT_LIBS \\
-	winmm/libwinmm.$IMPLIBEXT"
-ALL_IMPORTLIB_RULES="$ALL_IMPORTLIB_RULES
-winmm/libwinmm.def winmm/libwinmm.a winmm/libwinmm.cross.a: winmm/winmm.spec \$(WINEBUILD)
-	@cd winmm && \$(MAKE) \`basename \$@\`"
+	dlls/winmm/libwinmm.$IMPLIBEXT"
+ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS
+dlls/winmm/libwinmm.$IMPLIBEXT dlls/winmm/libwinmm.cross.a: tools/widl tools/winebuild tools/winegcc include
+dlls/winmm/libwinmm.$IMPLIBEXT dlls/winmm/libwinmm.cross.a: dlls/winmm/winmm.spec dlls/winmm/Makefile
+	@cd dlls/winmm && \$(MAKE) \`basename \$@\`"
 ALL_MAKEFILES="$ALL_MAKEFILES \\
 	dlls/winmm/Makefile"
 test "x$enable_winmm" != xno && ALL_DLL_DIRS="$ALL_DLL_DIRS \\
@@ -18800,10 +18927,11 @@ dlls/winnls.dll16/Makefile: dlls/winnls.dll16/Makefile.in dlls/Makedll.rules con
 ac_config_files="$ac_config_files dlls/winnls.dll16/Makefile"
 
 ALL_IMPORT_LIBS="$ALL_IMPORT_LIBS \\
-	winnls32/libwinnls32.$IMPLIBEXT"
-ALL_IMPORTLIB_RULES="$ALL_IMPORTLIB_RULES
-winnls32/libwinnls32.def winnls32/libwinnls32.a winnls32/libwinnls32.cross.a: winnls32/winnls32.spec \$(WINEBUILD)
-	@cd winnls32 && \$(MAKE) \`basename \$@\`"
+	dlls/winnls32/libwinnls32.$IMPLIBEXT"
+ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS
+dlls/winnls32/libwinnls32.$IMPLIBEXT dlls/winnls32/libwinnls32.cross.a: tools/widl tools/winebuild tools/winegcc include
+dlls/winnls32/libwinnls32.$IMPLIBEXT dlls/winnls32/libwinnls32.cross.a: dlls/winnls32/winnls32.spec dlls/winnls32/Makefile
+	@cd dlls/winnls32 && \$(MAKE) \`basename \$@\`"
 ALL_MAKEFILES="$ALL_MAKEFILES \\
 	dlls/winnls32/Makefile"
 test "x$enable_winnls32" != xno && ALL_DLL_DIRS="$ALL_DLL_DIRS \\
@@ -18813,10 +18941,11 @@ dlls/winnls32/Makefile: dlls/winnls32/Makefile.in dlls/Makedll.rules config.stat
 ac_config_files="$ac_config_files dlls/winnls32/Makefile"
 
 ALL_IMPORT_LIBS="$ALL_IMPORT_LIBS \\
-	winscard/libwinscard.$IMPLIBEXT"
-ALL_IMPORTLIB_RULES="$ALL_IMPORTLIB_RULES
-winscard/libwinscard.def winscard/libwinscard.a winscard/libwinscard.cross.a: winscard/winscard.spec \$(WINEBUILD)
-	@cd winscard && \$(MAKE) \`basename \$@\`"
+	dlls/winscard/libwinscard.$IMPLIBEXT"
+ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS
+dlls/winscard/libwinscard.$IMPLIBEXT dlls/winscard/libwinscard.cross.a: tools/widl tools/winebuild tools/winegcc include
+dlls/winscard/libwinscard.$IMPLIBEXT dlls/winscard/libwinscard.cross.a: dlls/winscard/winscard.spec dlls/winscard/Makefile
+	@cd dlls/winscard && \$(MAKE) \`basename \$@\`"
 ALL_MAKEFILES="$ALL_MAKEFILES \\
 	dlls/winscard/Makefile"
 test "x$enable_winscard" != xno && ALL_DLL_DIRS="$ALL_DLL_DIRS \\
@@ -18834,19 +18963,20 @@ dlls/winsock.dll16/Makefile: dlls/winsock.dll16/Makefile.in dlls/Makedll.rules c
 ac_config_files="$ac_config_files dlls/winsock.dll16/Makefile"
 
 ALL_IMPORT_LIBS="$ALL_IMPORT_LIBS \\
-	winspool.drv/libwinspool.$IMPLIBEXT \\
-	libwinspool.$IMPLIBEXT"
-ALL_IMPORTLIB_RULES="$ALL_IMPORTLIB_RULES
-libwinspool.a: winspool.drv/libwinspool.a
+	dlls/winspool.drv/libwinspool.$IMPLIBEXT \\
+	dlls/libwinspool.$IMPLIBEXT"
+ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS
+dlls/winspool.drv/libwinspool.$IMPLIBEXT dlls/winspool.drv/libwinspool.cross.a: tools/widl tools/winebuild tools/winegcc include
+dlls/libwinspool.a: dlls/winspool.drv/libwinspool.a
 	\$(RM) \$@ && \$(LN_S) winspool.drv/libwinspool.a \$@
-libwinspool.cross.a: winspool.drv/libwinspool.cross.a
+dlls/libwinspool.cross.a: dlls/winspool.drv/libwinspool.cross.a
 	\$(RM) \$@ && \$(LN_S) winspool.drv/libwinspool.cross.a \$@
-libwinspool.def: winspool.drv/libwinspool.def
+dlls/libwinspool.def: dlls/winspool.drv/libwinspool.def
 	\$(RM) \$@ && \$(LN_S) winspool.drv/libwinspool.def \$@
 clean::
-	\$(RM) libwinspool.def
-winspool.drv/libwinspool.def winspool.drv/libwinspool.a winspool.drv/libwinspool.cross.a: winspool.drv/winspool.drv.spec \$(WINEBUILD)
-	@cd winspool.drv && \$(MAKE) \`basename \$@\`"
+	\$(RM) dlls/libwinspool.def
+dlls/winspool.drv/libwinspool.$IMPLIBEXT dlls/winspool.drv/libwinspool.cross.a: dlls/winspool.drv/winspool.drv.spec dlls/winspool.drv/Makefile
+	@cd dlls/winspool.drv && \$(MAKE) \`basename \$@\`"
 ALL_MAKEFILES="$ALL_MAKEFILES \\
 	dlls/winspool.drv/Makefile"
 test "x$enable_winspool_drv" != xno && ALL_DLL_DIRS="$ALL_DLL_DIRS \\
@@ -18880,10 +19010,11 @@ dlls/wintab.dll16/Makefile: dlls/wintab.dll16/Makefile.in dlls/Makedll.rules con
 ac_config_files="$ac_config_files dlls/wintab.dll16/Makefile"
 
 ALL_IMPORT_LIBS="$ALL_IMPORT_LIBS \\
-	wintab32/libwintab32.$IMPLIBEXT"
-ALL_IMPORTLIB_RULES="$ALL_IMPORTLIB_RULES
-wintab32/libwintab32.def wintab32/libwintab32.a wintab32/libwintab32.cross.a: wintab32/wintab32.spec \$(WINEBUILD)
-	@cd wintab32 && \$(MAKE) \`basename \$@\`"
+	dlls/wintab32/libwintab32.$IMPLIBEXT"
+ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS
+dlls/wintab32/libwintab32.$IMPLIBEXT dlls/wintab32/libwintab32.cross.a: tools/widl tools/winebuild tools/winegcc include
+dlls/wintab32/libwintab32.$IMPLIBEXT dlls/wintab32/libwintab32.cross.a: dlls/wintab32/wintab32.spec dlls/wintab32/Makefile
+	@cd dlls/wintab32 && \$(MAKE) \`basename \$@\`"
 ALL_MAKEFILES="$ALL_MAKEFILES \\
 	dlls/wintab32/Makefile"
 test "x$enable_wintab32" != xno && ALL_DLL_DIRS="$ALL_DLL_DIRS \\
@@ -18909,10 +19040,11 @@ dlls/wintab32/tests/Makefile: dlls/wintab32/tests/Makefile.in dlls/Maketest.rule
 ac_config_files="$ac_config_files dlls/wintab32/tests/Makefile"
 
 ALL_IMPORT_LIBS="$ALL_IMPORT_LIBS \\
-	wintrust/libwintrust.$IMPLIBEXT"
-ALL_IMPORTLIB_RULES="$ALL_IMPORTLIB_RULES
-wintrust/libwintrust.def wintrust/libwintrust.a wintrust/libwintrust.cross.a: wintrust/wintrust.spec \$(WINEBUILD)
-	@cd wintrust && \$(MAKE) \`basename \$@\`"
+	dlls/wintrust/libwintrust.$IMPLIBEXT"
+ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS
+dlls/wintrust/libwintrust.$IMPLIBEXT dlls/wintrust/libwintrust.cross.a: tools/widl tools/winebuild tools/winegcc include
+dlls/wintrust/libwintrust.$IMPLIBEXT dlls/wintrust/libwintrust.cross.a: dlls/wintrust/wintrust.spec dlls/wintrust/Makefile
+	@cd dlls/wintrust && \$(MAKE) \`basename \$@\`"
 ALL_MAKEFILES="$ALL_MAKEFILES \\
 	dlls/wintrust/Makefile"
 test "x$enable_wintrust" != xno && ALL_DLL_DIRS="$ALL_DLL_DIRS \\
@@ -18938,10 +19070,11 @@ dlls/wintrust/tests/Makefile: dlls/wintrust/tests/Makefile.in dlls/Maketest.rule
 ac_config_files="$ac_config_files dlls/wintrust/tests/Makefile"
 
 ALL_IMPORT_LIBS="$ALL_IMPORT_LIBS \\
-	wldap32/libwldap32.$IMPLIBEXT"
-ALL_IMPORTLIB_RULES="$ALL_IMPORTLIB_RULES
-wldap32/libwldap32.def wldap32/libwldap32.a wldap32/libwldap32.cross.a: wldap32/wldap32.spec \$(WINEBUILD)
-	@cd wldap32 && \$(MAKE) \`basename \$@\`"
+	dlls/wldap32/libwldap32.$IMPLIBEXT"
+ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS
+dlls/wldap32/libwldap32.$IMPLIBEXT dlls/wldap32/libwldap32.cross.a: tools/widl tools/winebuild tools/winegcc include
+dlls/wldap32/libwldap32.$IMPLIBEXT dlls/wldap32/libwldap32.cross.a: dlls/wldap32/wldap32.spec dlls/wldap32/Makefile
+	@cd dlls/wldap32 && \$(MAKE) \`basename \$@\`"
 ALL_MAKEFILES="$ALL_MAKEFILES \\
 	dlls/wldap32/Makefile"
 test "x$enable_wldap32" != xno && ALL_DLL_DIRS="$ALL_DLL_DIRS \\
@@ -18983,10 +19116,11 @@ dlls/wmiutils/Makefile: dlls/wmiutils/Makefile.in dlls/Makedll.rules config.stat
 ac_config_files="$ac_config_files dlls/wmiutils/Makefile"
 
 ALL_IMPORT_LIBS="$ALL_IMPORT_LIBS \\
-	wnaspi32/libwnaspi32.$IMPLIBEXT"
-ALL_IMPORTLIB_RULES="$ALL_IMPORTLIB_RULES
-wnaspi32/libwnaspi32.def wnaspi32/libwnaspi32.a wnaspi32/libwnaspi32.cross.a: wnaspi32/wnaspi32.spec \$(WINEBUILD)
-	@cd wnaspi32 && \$(MAKE) \`basename \$@\`"
+	dlls/wnaspi32/libwnaspi32.$IMPLIBEXT"
+ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS
+dlls/wnaspi32/libwnaspi32.$IMPLIBEXT dlls/wnaspi32/libwnaspi32.cross.a: tools/widl tools/winebuild tools/winegcc include
+dlls/wnaspi32/libwnaspi32.$IMPLIBEXT dlls/wnaspi32/libwnaspi32.cross.a: dlls/wnaspi32/wnaspi32.spec dlls/wnaspi32/Makefile
+	@cd dlls/wnaspi32 && \$(MAKE) \`basename \$@\`"
 ALL_MAKEFILES="$ALL_MAKEFILES \\
 	dlls/wnaspi32/Makefile"
 test "x$enable_wnaspi32" != xno && ALL_DLL_DIRS="$ALL_DLL_DIRS \\
@@ -18996,10 +19130,11 @@ dlls/wnaspi32/Makefile: dlls/wnaspi32/Makefile.in dlls/Makedll.rules config.stat
 ac_config_files="$ac_config_files dlls/wnaspi32/Makefile"
 
 test "x$enable_win16" = xno || ALL_IMPORT_LIBS="$ALL_IMPORT_LIBS \\
-	wow32/libwow32.$IMPLIBEXT"
-ALL_IMPORTLIB_RULES="$ALL_IMPORTLIB_RULES
-wow32/libwow32.def wow32/libwow32.a wow32/libwow32.cross.a: wow32/wow32.spec \$(WINEBUILD)
-	@cd wow32 && \$(MAKE) \`basename \$@\`"
+	dlls/wow32/libwow32.$IMPLIBEXT"
+ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS
+dlls/wow32/libwow32.$IMPLIBEXT dlls/wow32/libwow32.cross.a: tools/widl tools/winebuild tools/winegcc include
+dlls/wow32/libwow32.$IMPLIBEXT dlls/wow32/libwow32.cross.a: dlls/wow32/wow32.spec dlls/wow32/Makefile
+	@cd dlls/wow32 && \$(MAKE) \`basename \$@\`"
 ALL_MAKEFILES="$ALL_MAKEFILES \\
 	dlls/wow32/Makefile"
 test "x$enable_win16" != xno && ALL_DLL_DIRS="$ALL_DLL_DIRS \\
@@ -19009,10 +19144,11 @@ dlls/wow32/Makefile: dlls/wow32/Makefile.in dlls/Makedll.rules config.status"
 ac_config_files="$ac_config_files dlls/wow32/Makefile"
 
 ALL_IMPORT_LIBS="$ALL_IMPORT_LIBS \\
-	ws2_32/libws2_32.$IMPLIBEXT"
-ALL_IMPORTLIB_RULES="$ALL_IMPORTLIB_RULES
-ws2_32/libws2_32.def ws2_32/libws2_32.a ws2_32/libws2_32.cross.a: ws2_32/ws2_32.spec \$(WINEBUILD)
-	@cd ws2_32 && \$(MAKE) \`basename \$@\`"
+	dlls/ws2_32/libws2_32.$IMPLIBEXT"
+ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS
+dlls/ws2_32/libws2_32.$IMPLIBEXT dlls/ws2_32/libws2_32.cross.a: tools/widl tools/winebuild tools/winegcc include
+dlls/ws2_32/libws2_32.$IMPLIBEXT dlls/ws2_32/libws2_32.cross.a: dlls/ws2_32/ws2_32.spec dlls/ws2_32/Makefile
+	@cd dlls/ws2_32 && \$(MAKE) \`basename \$@\`"
 ALL_MAKEFILES="$ALL_MAKEFILES \\
 	dlls/ws2_32/Makefile"
 test "x$enable_ws2_32" != xno && ALL_DLL_DIRS="$ALL_DLL_DIRS \\
@@ -19038,10 +19174,11 @@ dlls/ws2_32/tests/Makefile: dlls/ws2_32/tests/Makefile.in dlls/Maketest.rules co
 ac_config_files="$ac_config_files dlls/ws2_32/tests/Makefile"
 
 ALL_IMPORT_LIBS="$ALL_IMPORT_LIBS \\
-	wsock32/libwsock32.$IMPLIBEXT"
-ALL_IMPORTLIB_RULES="$ALL_IMPORTLIB_RULES
-wsock32/libwsock32.def wsock32/libwsock32.a wsock32/libwsock32.cross.a: wsock32/wsock32.spec \$(WINEBUILD)
-	@cd wsock32 && \$(MAKE) \`basename \$@\`"
+	dlls/wsock32/libwsock32.$IMPLIBEXT"
+ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS
+dlls/wsock32/libwsock32.$IMPLIBEXT dlls/wsock32/libwsock32.cross.a: tools/widl tools/winebuild tools/winegcc include
+dlls/wsock32/libwsock32.$IMPLIBEXT dlls/wsock32/libwsock32.cross.a: dlls/wsock32/wsock32.spec dlls/wsock32/Makefile
+	@cd dlls/wsock32 && \$(MAKE) \`basename \$@\`"
 ALL_MAKEFILES="$ALL_MAKEFILES \\
 	dlls/wsock32/Makefile"
 test "x$enable_wsock32" != xno && ALL_DLL_DIRS="$ALL_DLL_DIRS \\
@@ -19051,10 +19188,11 @@ dlls/wsock32/Makefile: dlls/wsock32/Makefile.in dlls/Makedll.rules config.status
 ac_config_files="$ac_config_files dlls/wsock32/Makefile"
 
 ALL_IMPORT_LIBS="$ALL_IMPORT_LIBS \\
-	wtsapi32/libwtsapi32.$IMPLIBEXT"
-ALL_IMPORTLIB_RULES="$ALL_IMPORTLIB_RULES
-wtsapi32/libwtsapi32.def wtsapi32/libwtsapi32.a wtsapi32/libwtsapi32.cross.a: wtsapi32/wtsapi32.spec \$(WINEBUILD)
-	@cd wtsapi32 && \$(MAKE) \`basename \$@\`"
+	dlls/wtsapi32/libwtsapi32.$IMPLIBEXT"
+ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS
+dlls/wtsapi32/libwtsapi32.$IMPLIBEXT dlls/wtsapi32/libwtsapi32.cross.a: tools/widl tools/winebuild tools/winegcc include
+dlls/wtsapi32/libwtsapi32.$IMPLIBEXT dlls/wtsapi32/libwtsapi32.cross.a: dlls/wtsapi32/wtsapi32.spec dlls/wtsapi32/Makefile
+	@cd dlls/wtsapi32 && \$(MAKE) \`basename \$@\`"
 ALL_MAKEFILES="$ALL_MAKEFILES \\
 	dlls/wtsapi32/Makefile"
 test "x$enable_wtsapi32" != xno && ALL_DLL_DIRS="$ALL_DLL_DIRS \\
@@ -19096,19 +19234,20 @@ dlls/xinput1_2/Makefile: dlls/xinput1_2/Makefile.in dlls/Makedll.rules config.st
 ac_config_files="$ac_config_files dlls/xinput1_2/Makefile"
 
 ALL_IMPORT_LIBS="$ALL_IMPORT_LIBS \\
-	xinput1_3/libxinput.$IMPLIBEXT \\
-	libxinput.$IMPLIBEXT"
-ALL_IMPORTLIB_RULES="$ALL_IMPORTLIB_RULES
-libxinput.a: xinput1_3/libxinput.a
+	dlls/xinput1_3/libxinput.$IMPLIBEXT \\
+	dlls/libxinput.$IMPLIBEXT"
+ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS
+dlls/xinput1_3/libxinput.$IMPLIBEXT dlls/xinput1_3/libxinput.cross.a: tools/widl tools/winebuild tools/winegcc include
+dlls/libxinput.a: dlls/xinput1_3/libxinput.a
 	\$(RM) \$@ && \$(LN_S) xinput1_3/libxinput.a \$@
-libxinput.cross.a: xinput1_3/libxinput.cross.a
+dlls/libxinput.cross.a: dlls/xinput1_3/libxinput.cross.a
 	\$(RM) \$@ && \$(LN_S) xinput1_3/libxinput.cross.a \$@
-libxinput.def: xinput1_3/libxinput.def
+dlls/libxinput.def: dlls/xinput1_3/libxinput.def
 	\$(RM) \$@ && \$(LN_S) xinput1_3/libxinput.def \$@
 clean::
-	\$(RM) libxinput.def
-xinput1_3/libxinput.def xinput1_3/libxinput.a xinput1_3/libxinput.cross.a: xinput1_3/xinput1_3.spec \$(WINEBUILD)
-	@cd xinput1_3 && \$(MAKE) \`basename \$@\`"
+	\$(RM) dlls/libxinput.def
+dlls/xinput1_3/libxinput.$IMPLIBEXT dlls/xinput1_3/libxinput.cross.a: dlls/xinput1_3/xinput1_3.spec dlls/xinput1_3/Makefile
+	@cd dlls/xinput1_3 && \$(MAKE) \`basename \$@\`"
 ALL_MAKEFILES="$ALL_MAKEFILES \\
 	dlls/xinput1_3/Makefile"
 test "x$enable_xinput1_3" != xno && ALL_DLL_DIRS="$ALL_DLL_DIRS \\
diff --git a/configure.ac b/configure.ac
index 274a6c0cd21..b0e6a48c13b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2106,7 +2106,6 @@ AC_SUBST(ALL_TOOL_DIRS,"")
 AC_SUBST(ALL_STATICLIB_DIRS,"")
 AC_SUBST(ALL_STATIC_LIBS,"")
 AC_SUBST(ALL_IMPORT_LIBS,"")
-AC_SUBST(ALL_IMPORTLIB_RULES,"")
 AC_SUBST(ALL_TEST_DIRS,"")
 AC_SUBST(ALL_TEST_BINARIES,"")
 AC_SUBST(ALL_PROGRAM_DIRS,"")
diff --git a/dlls/Makefile.in b/dlls/Makefile.in
index df4d7a485c7..efbab17adbf 100644
--- a/dlls/Makefile.in
+++ b/dlls/Makefile.in
@@ -18,23 +18,6 @@ DOCSUBDIRS     = $(DLLSUBDIRS)
 
 all: $(BUILDSUBDIRS)
 
-# Import libraries
-
-IMPORT_LIBS = @ALL_IMPORT_LIBS@
-
-$(TESTSUBDIRS:%=%/__crosstest__): $(IMPORT_LIBS:.def=.cross.a)
-
-implib: $(IMPORT_LIBS)
-
-testsubdirs: $(TESTSUBDIRS)
-
-.PHONY: implib testsubdirs
-
-$(BUILDSUBDIRS): $(IMPORT_LIBS)
-$(INSTALLSUBDIRS:%=%/__install__) $(INSTALLSUBDIRS:%=%/__install-lib__): $(IMPORT_LIBS)
-
-@ALL_IMPORTLIB_RULES@
-
 # Misc rules
 
 uninstall::