diff --git a/Make.rules.in b/Make.rules.in
index 33365bc68237b6a7fb0bf97950653531e1fa84f3..b2c8e7a49d1d7cae4fddb257adbe1c312f1d69bc 100644
--- a/Make.rules.in
+++ b/Make.rules.in
@@ -16,6 +16,8 @@
 # GLUE         : C sources for which glue code needs to be generated
 # EXTRA_SRCS   : extra source files for make depend
 # EXTRA_OBJS   : extra object files
+# IMPORTS      : dlls to import
+# DELAYIMPORTS : dlls to import in delayed mode
 # SUBDIRS      : subdirectories that contain a Makefile
 # EXTRASUBDIRS : subdirectories that do not contain a Makefile
 # PLTESTS      : Perl test scripts
@@ -162,7 +164,7 @@ $(MODULE).tmp.o: $(OBJS) Makefile.in
 # Rule for main module spec file
 
 $(MAINSPEC).c: $(MAINSPEC) $(RC_SRCS:.rc=.res) $(SYMBOLFILE) $(WINEBUILD)
-	$(LDPATH) $(WINEBUILD) @DLLFLAGS@ -L$(DLLDIR) $(SYMBOLFILE:%=-sym %) -o $@ -spec $(SRCDIR)/$(MAINSPEC)
+	$(LDPATH) $(WINEBUILD) @DLLFLAGS@ $(SYMBOLFILE:%=-sym %) -o $@ -spec $(SRCDIR)/$(MAINSPEC) -L$(DLLDIR) $(DELAYIMPORTS:%=-dl%) $(IMPORTS:%=-l%)
 
 # Rule to rebuild the resource compiler
 
@@ -282,7 +284,7 @@ $(TESTPROGRAM).tmp.o: $(TESTOBJS)
 	-strip --strip-unneeded $@
 
 $(TESTPROGRAM).spec.c: $(TESTPROGRAM).spec $(TESTPROGRAM).tmp.o $(WINEBUILD)
-	$(LDPATH) $(WINEBUILD) @DLLFLAGS@ -L$(DLLDIR) -sym $(TESTPROGRAM).tmp.o -o $@ -spec $(SRCDIR)/$(TESTPROGRAM).spec
+	$(LDPATH) $(WINEBUILD) @DLLFLAGS@ -sym $(TESTPROGRAM).tmp.o -o $@ -spec $(SRCDIR)/$(TESTPROGRAM).spec -L$(DLLDIR) $(TESTIMPORTS:%=-l%)
 
 # Misc. rules
 
diff --git a/Makefile.in b/Makefile.in
index 2d3302b4cecdcc3a513ed0c71eff4be87d799e03..7aa0bd3c8e69906e37f60f4ad54f6af105cf43d5 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -21,7 +21,7 @@ VPATH     = @srcdir@
 LIBEXT    = @LIBEXT@
 LDCONFIG  = @LDCONFIG@
 MODULE    = wine
-IMPORTS   = ntdll.dll
+LDIMPORTS = ntdll.dll
 
 # Stand-alone programs
 PROGRAMS = \
@@ -89,8 +89,8 @@ Make.rules: Make.rules.in configure
 	@echo $? is newer than 'Make.rules', please rerun ./configure!
 	@exit 1
 
-wine: $(EMUOBJS) $(IMPORTS:%=lib%.$(LIBEXT)) library/libwine.$(LIBEXT) unicode/libwine_unicode.$(LIBEXT)
-	$(CC) -o wine $(EMUOBJS) -L. $(IMPORTS:%=-l%) $(LIBWINE) $(LIBUNICODE) $(LIBS) $(LDFLAGS)
+wine: $(EMUOBJS) $(LDIMPORTS:%=lib%.$(LIBEXT)) library/libwine.$(LIBEXT) unicode/libwine_unicode.$(LIBEXT)
+	$(CC) -o wine $(EMUOBJS) -L. $(LDIMPORTS:%=-l%) $(LIBWINE) $(LIBUNICODE) $(LIBS) $(LDFLAGS)
 
 install_wine: dummy
 	[ -d $(bindir) ] || $(MKDIR) $(bindir)
@@ -146,7 +146,7 @@ server tools: $(LIBRARIES)
 dlls: tools $(LIBRARIES)
 
 checklink::
-	$(CC) -o checklink $(TOPSRCDIR)/library/checklink.c $(LIBWINE) $(LIBS) && $(RM) checklink
+	$(CC) -o checklink $(TOPSRCDIR)/library/checklink.c && $(RM) checklink
 
 checklink::
 	@cd dlls && $(MAKE) checklink
diff --git a/debugger/Makefile.in b/debugger/Makefile.in
index a746da4347a647157b9d1584e24f008bf9f5f0ce..154fac4885c15f8ca21bb35e901f88cd95def205 100644
--- a/debugger/Makefile.in
+++ b/debugger/Makefile.in
@@ -4,6 +4,8 @@ TOPOBJDIR = ..
 SRCDIR    = @srcdir@
 VPATH     = @srcdir@
 MODULE    = winedbg
+IMPORTS   = advapi32.dll kernel32.dll ntdll.dll
+DELAYIMPORTS = user32.dll
 
 C_SRCS = \
 	break.c \
diff --git a/debugger/winedbg.spec b/debugger/winedbg.spec
index e125fb0b2a28a68df13c9e185ccadd51b03a9054..7c926867338f80d313ad34d2ef02bf96100b5dcf 100644
--- a/debugger/winedbg.spec
+++ b/debugger/winedbg.spec
@@ -2,8 +2,3 @@ name	winedbg
 mode	cuiexe
 type	win32
 init	DEBUG_main
-
-import -delay user32.dll
-import	advapi32.dll
-import	kernel32.dll
-import	ntdll.dll
diff --git a/dlls/Makedll.rules.in b/dlls/Makedll.rules.in
index ff2293d90da5fbd48259b76ffa704471d10063ad..aaf62c963ffae278567e35a5c82d80b6bdbf4dcc 100644
--- a/dlls/Makedll.rules.in
+++ b/dlls/Makedll.rules.in
@@ -3,18 +3,19 @@
 # Each individual makefile should define the following variables:
 # MODULE       : name of the main module being built
 # ALTNAMES     : alternate names for this dll (optional)
-# IMPORTS      : dlls to import (optional)
 # EXTRALIBS    : extra libraries to link in (optional)
 #
 # plus all variables required by the global Make.rules.in
 #
 
-DEFS       = @DLLFLAGS@ -D__WINE__ $(EXTRADEFS)
-DLLEXT     = @DLLEXT@
-ALTSPECS   = $(ALTNAMES:%.dll=%)
-SPEC_SRCS  = $(ALTSPECS:%=%.spec)
-ALL_OBJS   = $(MODULE:%.dll=%).spec.o $(OBJS)
-ALL_LIBS   = $(LIBWINE) $(EXTRALIBS) $(LIBS)
+DEFS        = @DLLFLAGS@ -D__WINE__ $(EXTRADEFS)
+DLLEXT      = @DLLEXT@
+ALTSPECS    = $(ALTNAMES:%.dll=%)
+SPEC_SRCS   = $(ALTSPECS:%=%.spec)
+ALL_OBJS    = $(MODULE:%.dll=%).spec.o $(OBJS)
+ALL_LIBS    = $(LIBWINE) $(EXTRALIBS) $(LIBS)
+SPEC_DEF    = $(MODULE:%.dll=%).spec.def
+TESTIMPORTS = $(MODULE) $(DELAYIMPORTS) $(IMPORTS)
 
 all: $(MODULE)$(DLLEXT)
 
@@ -23,17 +24,17 @@ all: $(MODULE)$(DLLEXT)
 # Rules for .so files
 
 $(MODULE).so: $(ALL_OBJS) Makefile.in
-	$(LDSHARED) $(LDDLLFLAGS) $(ALL_OBJS) -o $@ -L$(DLLDIR) $(IMPORTS:%=-l%) $(ALL_LIBS)
+	$(LDSHARED) $(LDDLLFLAGS) $(ALL_OBJS) -o $@ -L$(DLLDIR) $(LDIMPORTS:%=-l%) $(ALL_LIBS)
 
 # Rules for .dll files
 
-$(MODULE): $(ALL_OBJS) Makefile.in
-	$(DLLWRAP) $(DLLWRAPFLAGS) --implib $(MODULE:.dll=.a) -o $(MODULE) $(ALL_OBJS) -L$(DLLDIR) $(IMPORTS:%=-l%) $(ALL_LIBS)
+$(MODULE): $(ALL_OBJS) $(SPEC_DEF) Makefile.in
+	$(DLLWRAP) $(DLLWRAPFLAGS) --def $(SPEC_DEF) --implib $(MODULE:.dll=.a) -o $(MODULE) $(ALL_OBJS) -L$(DLLDIR) $(LDIMPORTS:%=-l%) $(ALL_LIBS)
 
 # Rules for checking that no imports are missing
 
 checklink:: $(MODULE)$(DLLEXT)
-	$(CC) -o checklink $(TOPSRCDIR)/library/checklink.c $(MODULE)$(DLLEXT) $(ALL_LIBS) && $(RM) checklink
+	$(CC) -o checklink $(TOPSRCDIR)/library/checklink.c $(MODULE)$(DLLEXT) && $(RM) checklink
 
 # Rules for testing
 
diff --git a/dlls/advapi32/Makefile.in b/dlls/advapi32/Makefile.in
index 2dcd55018b9a5be31e7bca89aa9f33959f071eb4..b50443a89e5a1447ee534003f12226fe4807fe67 100644
--- a/dlls/advapi32/Makefile.in
+++ b/dlls/advapi32/Makefile.in
@@ -4,6 +4,7 @@ TOPOBJDIR = ../..
 SRCDIR    = @srcdir@
 VPATH     = @srcdir@
 MODULE    = advapi32.dll
+IMPORTS   = kernel32.dll ntdll.dll
 
 LDDLLFLAGS = @LDDLLFLAGS@
 SYMBOLFILE = $(MODULE).tmp.o
diff --git a/dlls/advapi32/advapi32.spec b/dlls/advapi32/advapi32.spec
index 1ee6cd7802d1fab6b6cfbe2f408c69fe10e2da01..f7327cfdfec6edc76711879fe3273a1a6005492e 100644
--- a/dlls/advapi32/advapi32.spec
+++ b/dlls/advapi32/advapi32.spec
@@ -1,9 +1,6 @@
 name	advapi32
 type	win32
 
-import	kernel32.dll
-import	ntdll.dll
-
 debug_channels (advapi crypt reg)
 
 @ stdcall AbortSystemShutdownA(ptr) AbortSystemShutdownA
diff --git a/dlls/avicap32/Makefile.in b/dlls/avicap32/Makefile.in
index e5e69c8fc4febc5373048368d4bdce69b720714f..317c527139d777871e19152ce037924ed43adc84 100644
--- a/dlls/avicap32/Makefile.in
+++ b/dlls/avicap32/Makefile.in
@@ -3,6 +3,7 @@ TOPOBJDIR = ../..
 SRCDIR    = @srcdir@
 VPATH     = @srcdir@
 MODULE    = avicap32.dll
+IMPORTS   = ntdll.dll
 
 LDDLLFLAGS = @LDDLLFLAGS@
 SYMBOLFILE = $(MODULE).tmp.o
diff --git a/dlls/avicap32/avicap32.spec b/dlls/avicap32/avicap32.spec
index 7d5efd851ed22180aee0cb7d88794983237fb97d..7145dbb85181c8c50c5611fa09a87fd66dd3c0f7 100644
--- a/dlls/avicap32/avicap32.spec
+++ b/dlls/avicap32/avicap32.spec
@@ -1,6 +1,4 @@
 name avicap32
 type win32
 
-import ntdll.dll
-
 debug_channels ()
diff --git a/dlls/avifil32/Makefile.in b/dlls/avifil32/Makefile.in
index 5d2ecdfb1aa5a86d6437af70eabb80c4d9b6ff09..032dedaa9c0163dc848ca6b4b5cbc4b3aade6d16 100644
--- a/dlls/avifil32/Makefile.in
+++ b/dlls/avifil32/Makefile.in
@@ -3,6 +3,7 @@ TOPOBJDIR = ../..
 SRCDIR    = @srcdir@
 VPATH     = @srcdir@
 MODULE    = avifil32.dll
+IMPORTS   = msvfw32.dll kernel32.dll ntdll.dll
 ALTNAMES  = avifile.dll
 EXTRALIBS = $(LIBUUID)
 
diff --git a/dlls/avifil32/avifil32.spec b/dlls/avifil32/avifil32.spec
index d19a396242252347e647950494d1f10d7cb7c49c..4d74ecfb7011fbedfdcb9a838021d6a817907049 100644
--- a/dlls/avifil32/avifil32.spec
+++ b/dlls/avifil32/avifil32.spec
@@ -1,10 +1,6 @@
 name	avifil32
 type	win32
 
-import msvfw32.dll
-import kernel32.dll
-import ntdll.dll
-
 debug_channels (avifile)
 
 @ stub    AVIBuildFilter
diff --git a/dlls/comctl32/Makefile.in b/dlls/comctl32/Makefile.in
index 92a83ae6cbc486d1b167a4f3e8213732d1d03952..b05c94d6493769359560be18ba5ce79af79afd15 100644
--- a/dlls/comctl32/Makefile.in
+++ b/dlls/comctl32/Makefile.in
@@ -4,6 +4,8 @@ TOPOBJDIR = ../..
 SRCDIR    = @srcdir@
 VPATH     = @srcdir@
 MODULE    = comctl32.dll
+IMPORTS   = user32.dll gdi32.dll advapi32.dll kernel32.dll ntdll.dll
+DELAYIMPORTS = winmm.dll
 EXTRALIBS = $(LIBUNICODE)
 
 LDDLLFLAGS = @LDDLLFLAGS@
diff --git a/dlls/comctl32/comctl32.spec b/dlls/comctl32/comctl32.spec
index d0b5e48e329e025480a00e7f53022797b68c84ac..df980ec1f6860ff6e825ebc9aa276c9308ecc469 100644
--- a/dlls/comctl32/comctl32.spec
+++ b/dlls/comctl32/comctl32.spec
@@ -3,13 +3,6 @@ type	win32
 init	COMCTL32_LibMain
 rsrc	rsrc.res
 
-import -delay winmm.dll
-import	user32.dll
-import	gdi32.dll
-import	advapi32.dll
-import	kernel32.dll
-import	ntdll.dll
-
 debug_channels (animate comboex commctrl datetime header hotkey imagelist ipaddress
                 listview message monthcal nativefont pager progress propsheet
                 rebar statusbar tab toolbar tooltips trackbar treeview updown)
diff --git a/dlls/commdlg/Makefile.in b/dlls/commdlg/Makefile.in
index 2a2aa4a30f33714dfb4690a9605b91a43564a245..82ae9d1d722e78e06ef6182744042714a0f71142 100644
--- a/dlls/commdlg/Makefile.in
+++ b/dlls/commdlg/Makefile.in
@@ -3,6 +3,7 @@ TOPOBJDIR = ../..
 SRCDIR    = @srcdir@
 VPATH     = @srcdir@
 MODULE    = comdlg32.dll
+IMPORTS   = shell32.dll shlwapi.dll comctl32.dll winspool.drv user32.dll gdi32.dll kernel32.dll ntdll.dll
 ALTNAMES  = commdlg.dll
 EXTRALIBS = $(LIBUUID)
 
diff --git a/dlls/commdlg/comdlg32.spec b/dlls/commdlg/comdlg32.spec
index 72f0ddf7315569a332c280acf60a1fa577cec9f2..1aa8c0fa2456ca1688d97769bc9664d168b66178 100644
--- a/dlls/commdlg/comdlg32.spec
+++ b/dlls/commdlg/comdlg32.spec
@@ -3,15 +3,6 @@ type	win32
 init	COMDLG32_DllEntryPoint
 rsrc	rsrc.res
 
-import shell32.dll
-import shlwapi.dll
-import comctl32.dll
-import winspool.drv
-import user32.dll
-import gdi32.dll
-import kernel32.dll
-import ntdll.dll
-
 debug_channels (commdlg)
 
 @ stdcall ChooseColorA(ptr) ChooseColorA
diff --git a/dlls/crtdll/Makefile.in b/dlls/crtdll/Makefile.in
index 6098756f0d8ac3e28533ed412ffe79f33ea51672..d9ceea309d8918a113dbed7642734b6db052c400 100644
--- a/dlls/crtdll/Makefile.in
+++ b/dlls/crtdll/Makefile.in
@@ -3,6 +3,7 @@ TOPOBJDIR = ../..
 SRCDIR    = @srcdir@
 VPATH     = @srcdir@
 MODULE    = crtdll.dll
+IMPORTS   = msvcrt.dll kernel32.dll ntdll.dll
 EXTRALIBS = $(LIBUNICODE)
 
 LDDLLFLAGS = @LDDLLFLAGS@
diff --git a/dlls/crtdll/crtdll.spec b/dlls/crtdll/crtdll.spec
index 87bf5baac4a285f141f543569246e3633313c86e..ff5c6c2a753904ae54cb33149526c1fae2f8e35d 100644
--- a/dlls/crtdll/crtdll.spec
+++ b/dlls/crtdll/crtdll.spec
@@ -3,10 +3,6 @@ name    crtdll
 type    win32
 init    CRTDLL_Init
 
-import msvcrt.dll
-import kernel32.dll
-import ntdll.dll
-
 debug_channels (crtdll)
 
 @ forward ??2@YAPAXI@Z msvcrt.??2@YAPAXI@Z
diff --git a/dlls/crypt32/Makefile.in b/dlls/crypt32/Makefile.in
index fc7d74e3cbba10f63efe33c6ba4cea535e375458..1af3f76ada68bafd348eae39c72936a02f5a2013 100644
--- a/dlls/crypt32/Makefile.in
+++ b/dlls/crypt32/Makefile.in
@@ -4,6 +4,7 @@ TOPOBJDIR = ../..
 SRCDIR    = @srcdir@
 VPATH     = @srcdir@
 MODULE    = crypt32.dll
+IMPORTS   = advapi32.dll kernel32.dll ntdll.dll
 
 LDDLLFLAGS = @LDDLLFLAGS@
 SYMBOLFILE = $(MODULE).tmp.o
diff --git a/dlls/crypt32/crypt32.spec b/dlls/crypt32/crypt32.spec
index edb9c938347590d4e9c2a0004faebea7e105caa0..469c1214dc170f992194896268bc9d6a624d67dd 100644
--- a/dlls/crypt32/crypt32.spec
+++ b/dlls/crypt32/crypt32.spec
@@ -1,10 +1,6 @@
 name crypt32
 type win32
 
-import advapi32.dll
-import kernel32.dll
-import ntdll.dll
-
 debug_channels ()
 
 @ stub CertAddCRLContextToStore
diff --git a/dlls/dciman32/Makefile.in b/dlls/dciman32/Makefile.in
index 437eab916e5264dd3e633022b24005df7a5839f1..c89d0b75242d4e1376c8263f73c87fbb120cf808 100644
--- a/dlls/dciman32/Makefile.in
+++ b/dlls/dciman32/Makefile.in
@@ -3,6 +3,7 @@ TOPOBJDIR = ../..
 SRCDIR    = @srcdir@
 VPATH     = @srcdir@
 MODULE    = dciman32.dll
+IMPORTS   = kernel32.dll ntdll.dll
 
 LDDLLFLAGS = @LDDLLFLAGS@
 SYMBOLFILE = $(MODULE).tmp.o
diff --git a/dlls/dciman32/dciman32.spec b/dlls/dciman32/dciman32.spec
index b91bcfa5a58a7869e405cdd1386e8fa45d191022..b19b9026fe7c7faf57268e5c74dc609f8f90f558 100644
--- a/dlls/dciman32/dciman32.spec
+++ b/dlls/dciman32/dciman32.spec
@@ -1,9 +1,6 @@
 name	dciman32
 type	win32
 
-import	kernel32.dll
-import	ntdll.dll
-
 @ stub    DCIBeginAccess
 @ stdcall DCICloseProvider(long) DCICloseProvider
 @ stub    DCICreateOffscreen
diff --git a/dlls/ddraw/Makefile.in b/dlls/ddraw/Makefile.in
index 0a107f4e58f2a9a887b987a00d21e0200282b72b..2262ddccc635cba08e8fd3bf0874160cf9428ad7 100644
--- a/dlls/ddraw/Makefile.in
+++ b/dlls/ddraw/Makefile.in
@@ -3,8 +3,9 @@ TOPOBJDIR = ../..
 SRCDIR    = @srcdir@
 VPATH     = @srcdir@
 MODULE    = ddraw.dll
-EXTRALIBS = $(LIBUUID) $(LIBTSX11) $(X_LIBS) $(XLIB)
 IMPORTS   = user32.dll gdi32.dll kernel32.dll ntdll.dll
+EXTRALIBS = $(LIBUUID) $(LIBTSX11) $(X_LIBS) $(XLIB)
+LDIMPORTS = user32.dll gdi32.dll kernel32.dll ntdll.dll
 
 OPENGLFILES = \
 	d3dcommon.c \
diff --git a/dlls/ddraw/ddraw.spec b/dlls/ddraw/ddraw.spec
index b9cbdb093799f325959228f5c94f4e844a1c7af9..ea4d46d7042786589fbf44c82a215673a80a42a3 100644
--- a/dlls/ddraw/ddraw.spec
+++ b/dlls/ddraw/ddraw.spec
@@ -3,11 +3,6 @@ type win32
 init DDRAW_DllMain
 rsrc version.res
 
-import user32.dll
-import gdi32.dll
-import kernel32.dll
-import ntdll.dll
-
 debug_channels (ddraw)
 
 @ stub DDHAL32_VidMemAlloc
diff --git a/dlls/devenum/Makefile.in b/dlls/devenum/Makefile.in
index 7637becbff7be5b22dd92be268c62e5ab102fbe0..c0bb04a1453b89a073cfa9b9b18a2ba68b7842e2 100644
--- a/dlls/devenum/Makefile.in
+++ b/dlls/devenum/Makefile.in
@@ -3,6 +3,7 @@ TOPOBJDIR = ../..
 SRCDIR    = @srcdir@
 VPATH     = @srcdir@
 MODULE    = devenum.dll
+IMPORTS   = ntdll.dll
 
 LDDLLFLAGS = @LDDLLFLAGS@
 SYMBOLFILE = $(MODULE).tmp.o
diff --git a/dlls/devenum/devenum.spec b/dlls/devenum/devenum.spec
index 15cd9ae47bbcc4c22d0195674c680596fb1e272b..d0b3e7dbcc3532389cc253348a5b8e5450c23e87 100644
--- a/dlls/devenum/devenum.spec
+++ b/dlls/devenum/devenum.spec
@@ -1,8 +1,6 @@
 name devenum
 type win32
 
-import ntdll.dll
-
 debug_channels()
 
 @ stub DllCanUnloadNow
diff --git a/dlls/dinput/Makefile.in b/dlls/dinput/Makefile.in
index fae2dc2daf9c0335c1966ececabcb922055634f1..fe24beccc9737f0b4879dde1793e7c0dddf85bc4 100644
--- a/dlls/dinput/Makefile.in
+++ b/dlls/dinput/Makefile.in
@@ -3,6 +3,7 @@ TOPOBJDIR = ../..
 SRCDIR    = @srcdir@
 VPATH     = @srcdir@
 MODULE    = dinput.dll
+IMPORTS   = user32.dll kernel32.dll ntdll.dll
 EXTRALIBS = $(LIBUUID)
 
 LDDLLFLAGS = @LDDLLFLAGS@
diff --git a/dlls/dinput/dinput.spec b/dlls/dinput/dinput.spec
index 628bfae95e3325a8137291144a78f92e75f09163..74288c648af21582feeb7acf688ed6a96243d35a 100644
--- a/dlls/dinput/dinput.spec
+++ b/dlls/dinput/dinput.spec
@@ -1,10 +1,6 @@
 name dinput
 type win32
 
-import user32.dll
-import kernel32.dll
-import ntdll.dll
-
 debug_channels (dinput)
 
 @ stdcall DirectInputCreateA(long long ptr ptr) DirectInputCreateA
diff --git a/dlls/dplay/Makefile.in b/dlls/dplay/Makefile.in
index 2cc81787149dfa1f4653fc5fe8644b28ccdf9c04..f13efb1feabb4f1b62c280b6c19f3969a569ecb8 100644
--- a/dlls/dplay/Makefile.in
+++ b/dlls/dplay/Makefile.in
@@ -3,6 +3,7 @@ TOPOBJDIR = ../..
 SRCDIR    = @srcdir@
 VPATH     = @srcdir@
 MODULE    = dplay.dll
+IMPORTS   = dplayx.dll
 
 LDDLLFLAGS = @LDDLLFLAGS@
 SYMBOLFILE = $(MODULE).tmp.o
diff --git a/dlls/dplay/dplay.spec b/dlls/dplay/dplay.spec
index b05a832b8e51728e1d78e2a346b84b67f866866a..1979d4c8c76f7ac34c22edf7c0eb0382ad1456b7 100644
--- a/dlls/dplay/dplay.spec
+++ b/dlls/dplay/dplay.spec
@@ -2,7 +2,5 @@
 name dplay
 type win32
 
-import dplayx.dll
-
 @ forward DirectPlayCreate dplayx.DirectPlayCreate
 @ forward DirectPlayEnumerate dplayx.DirectPlayEnumerate
diff --git a/dlls/dplayx/Makefile.in b/dlls/dplayx/Makefile.in
index 2c36e88915659212fd0eccc95d8a85675faa991d..447fec9d40b1fe64aae425ee48b156f22761e00d 100644
--- a/dlls/dplayx/Makefile.in
+++ b/dlls/dplayx/Makefile.in
@@ -3,6 +3,7 @@ TOPOBJDIR = ../..
 SRCDIR    = @srcdir@
 VPATH     = @srcdir@
 MODULE    = dplayx.dll
+IMPORTS   = winmm.dll ole32.dll user32.dll advapi32.dll kernel32.dll ntdll.dll
 EXTRALIBS = $(LIBUUID)
 
 LDDLLFLAGS = @LDDLLFLAGS@
diff --git a/dlls/dplayx/dplayx.spec b/dlls/dplayx/dplayx.spec
index 12735ba13df4c942fc0052cba1c3a77349f98f16..06754c16522eb7db88e1c451063f52ba93bf44fe 100644
--- a/dlls/dplayx/dplayx.spec
+++ b/dlls/dplayx/dplayx.spec
@@ -3,13 +3,6 @@ type win32
 init DPLAYX_LibMain
 rsrc version.res
 
-import winmm.dll
-import ole32.dll
-import user32.dll
-import advapi32.dll
-import kernel32.dll
-import ntdll.dll
-
 debug_channels (dplay)
 
   1 stdcall DirectPlayCreate(ptr ptr ptr) DirectPlayCreate
diff --git a/dlls/dsound/Makefile.in b/dlls/dsound/Makefile.in
index e2181ab6b26ab41c4f110496a24eea07557ac9f0..60a09e97f985a03b78b4838be55a4070e473673c 100644
--- a/dlls/dsound/Makefile.in
+++ b/dlls/dsound/Makefile.in
@@ -3,6 +3,7 @@ TOPOBJDIR = ../..
 SRCDIR    = @srcdir@
 VPATH     = @srcdir@
 MODULE    = dsound.dll
+IMPORTS   = winmm.dll kernel32.dll ntdll.dll
 EXTRALIBS = $(LIBUUID)
 
 LDDLLFLAGS = @LDDLLFLAGS@
diff --git a/dlls/dsound/dsound.spec b/dlls/dsound/dsound.spec
index 4594181693d33c65198e8f45b94c39bba764b082..8cb2f9c3d9fd457fb1f56702f6e650acd8c32510 100644
--- a/dlls/dsound/dsound.spec
+++ b/dlls/dsound/dsound.spec
@@ -1,10 +1,6 @@
 name dsound
 type win32
 
-import winmm.dll
-import kernel32.dll
-import ntdll.dll
-
 debug_channels (dsound)
 
 0 stub DirectSoundUnknown
diff --git a/dlls/gdi/Makefile.in b/dlls/gdi/Makefile.in
index 7a41922a36bf8c20d1c38d497ef0ace7aa1ea878..64783b4faa8d97cdb26597348905882f669494cf 100644
--- a/dlls/gdi/Makefile.in
+++ b/dlls/gdi/Makefile.in
@@ -4,8 +4,9 @@ TOPOBJDIR = ../..
 SRCDIR    = @srcdir@
 VPATH     = @srcdir@
 MODULE    = gdi32.dll
+IMPORTS   = advapi32.dll kernel32.dll ntdll.dll
 ALTNAMES  = gdi.exe dispdib.dll wing.dll
-IMPORTS   = kernel32.dll ntdll.dll
+LDIMPORTS = kernel32.dll ntdll.dll
 EXTRAINCL = @FREETYPEINCL@
 
 C_SRCS = \
diff --git a/dlls/gdi/gdi32.spec b/dlls/gdi/gdi32.spec
index 426fff29e46a57be9c7033c7cfa8e9c837eeece5..98c5ab5999c3060c9eff919d21fee9319f48df13 100644
--- a/dlls/gdi/gdi32.spec
+++ b/dlls/gdi/gdi32.spec
@@ -3,10 +3,6 @@ type    win32
 init    MAIN_GdiInit
 rsrc    version.res
 
-import	advapi32.dll
-import	kernel32.dll
-import	ntdll.dll
-
 debug_channels (bitblt bitmap clipping dc ddraw driver enhmetafile font gdi
                 metafile palette print region text win16drv wing)
 
diff --git a/dlls/icmp/Makefile.in b/dlls/icmp/Makefile.in
index 741987d81a10422dd87e46e40f7fcef7fae8cff7..6bc157bec84237640f24e7e11538b9cfe15d7f32 100644
--- a/dlls/icmp/Makefile.in
+++ b/dlls/icmp/Makefile.in
@@ -3,6 +3,7 @@ TOPOBJDIR = ../..
 SRCDIR    = @srcdir@
 VPATH     = @srcdir@
 MODULE    = icmp.dll
+IMPORTS   = kernel32.dll ntdll.dll
 
 LDDLLFLAGS = @LDDLLFLAGS@
 SYMBOLFILE = $(MODULE).tmp.o
diff --git a/dlls/icmp/icmp.spec b/dlls/icmp/icmp.spec
index 2ecf2189d5554fd77fb6c4fc640c2c32423d9941..731c1fc36c5b803991d7e49cbecd54e0aa5876e4 100644
--- a/dlls/icmp/icmp.spec
+++ b/dlls/icmp/icmp.spec
@@ -1,9 +1,6 @@
 name icmp
 type win32
 
-import kernel32.dll
-import ntdll.dll
-
 debug_channels (icmp)
 
 @ stdcall IcmpCloseHandle(ptr) IcmpCloseHandle
diff --git a/dlls/imagehlp/Makefile.in b/dlls/imagehlp/Makefile.in
index 7a8f269ce72b9fbbf7528b1d79014be2d8565c05..a5e4577564973394791dd891d7acb9018fa9bb39 100644
--- a/dlls/imagehlp/Makefile.in
+++ b/dlls/imagehlp/Makefile.in
@@ -4,6 +4,7 @@ TOPOBJDIR = ../..
 SRCDIR    = @srcdir@
 VPATH     = @srcdir@
 MODULE    = imagehlp.dll
+IMPORTS   = kernel32.dll ntdll.dll
 
 LDDLLFLAGS = @LDDLLFLAGS@
 SYMBOLFILE = $(MODULE).tmp.o
diff --git a/dlls/imagehlp/imagehlp.spec b/dlls/imagehlp/imagehlp.spec
index ee9d35ab3ec31df58e40a990e4f3bea6ef0356a6..b9531d295ca306d00f587adf89e0ae569f46d349 100644
--- a/dlls/imagehlp/imagehlp.spec
+++ b/dlls/imagehlp/imagehlp.spec
@@ -2,9 +2,6 @@ name	imagehlp
 type	win32
 init	IMAGEHLP_LibMain
 
-import	kernel32.dll
-import	ntdll.dll
-
 debug_channels (imagehlp)
 
 @ stdcall BindImage(str str str) BindImage
diff --git a/dlls/imm32/Makefile.in b/dlls/imm32/Makefile.in
index a2cb2611322ac368d300fbfee63b39d5aae70968..783f47b21b2eae7d3c7868918c45cd2cb6cd128d 100644
--- a/dlls/imm32/Makefile.in
+++ b/dlls/imm32/Makefile.in
@@ -3,6 +3,7 @@ TOPOBJDIR = ../..
 SRCDIR    = @srcdir@
 VPATH     = @srcdir@
 MODULE    = imm32.dll
+IMPORTS   = kernel32.dll ntdll.dll
 ALTNAMES  = imm.dll
 
 LDDLLFLAGS = @LDDLLFLAGS@
diff --git a/dlls/imm32/imm32.spec b/dlls/imm32/imm32.spec
index a87e52689a3f80edee81b1fed068f847ba7790e4..3347812b6137a7a986b22985031c324b577ba4a5 100644
--- a/dlls/imm32/imm32.spec
+++ b/dlls/imm32/imm32.spec
@@ -1,9 +1,6 @@
 name	imm32
 type	win32
 
-import	kernel32.dll
-import	ntdll.dll
-
 debug_channels (imm)
 
 @ stdcall ImmAssociateContext(long long) ImmAssociateContext
diff --git a/dlls/kernel/Makefile.in b/dlls/kernel/Makefile.in
index 832d8a76cc274cec33c414adb980675615d68903..05cd32bc5ea57e4ae27050893ed7763549ff3632 100644
--- a/dlls/kernel/Makefile.in
+++ b/dlls/kernel/Makefile.in
@@ -3,8 +3,9 @@ TOPOBJDIR = ../..
 SRCDIR    = @srcdir@
 VPATH     = @srcdir@
 MODULE    = kernel32.dll
-ALTNAMES  = krnl386.exe comm.dll stress.dll system.dll toolhelp.dll windebug.dll win87em.dll wprocs.dll
 IMPORTS   = ntdll.dll
+ALTNAMES  = krnl386.exe comm.dll stress.dll system.dll toolhelp.dll windebug.dll win87em.dll wprocs.dll
+LDIMPORTS = ntdll.dll
 
 C_SRCS = \
 	comm.c \
diff --git a/dlls/kernel/kernel32.spec b/dlls/kernel/kernel32.spec
index 48dc90794c2f9bbbd0ec6d0fb9139ffb4ec87159..ea29fbe9319a528a70c0daf8ea4636816aa37a30 100644
--- a/dlls/kernel/kernel32.spec
+++ b/dlls/kernel/kernel32.spec
@@ -3,8 +3,6 @@ type	win32
 init	MAIN_KernelInit
 rsrc	kernel.res
 
-import  ntdll.dll
-
 debug_channels (comm console debugstr dll int resource stress thunk toolhelp
                 win32)
 
diff --git a/dlls/kernel/tests/kernel32_test.spec b/dlls/kernel/tests/kernel32_test.spec
index ba8dcd0d2484a59d94e7500e5346e9472957405b..99d0a50e950af226cc6157195f5a14f360e799b5 100644
--- a/dlls/kernel/tests/kernel32_test.spec
+++ b/dlls/kernel/tests/kernel32_test.spec
@@ -1,5 +1,3 @@
 name	kernel32_test
 type	win32
 mode	cuiexe
-
-import kernel32.dll
diff --git a/dlls/lzexpand/Makefile.in b/dlls/lzexpand/Makefile.in
index 633a0cd0890d55905cd94a3cb5ca0042f5556535..d365e4ecaaf1c3f733e426c04d2befdd2ddf21bc 100644
--- a/dlls/lzexpand/Makefile.in
+++ b/dlls/lzexpand/Makefile.in
@@ -3,6 +3,7 @@ TOPOBJDIR = ../..
 SRCDIR    = @srcdir@
 VPATH     = @srcdir@
 MODULE    = lz32.dll
+IMPORTS   = kernel32.dll ntdll.dll
 ALTNAMES  = lzexpand.dll
 EXTRALIBS = $(LIBUNICODE)
 
diff --git a/dlls/lzexpand/lz32.spec b/dlls/lzexpand/lz32.spec
index 172079dce2e3a3462e399c9c680cd11b88bbb461..7b158b2f5cc9df936d29fd63464d4871362d839f 100644
--- a/dlls/lzexpand/lz32.spec
+++ b/dlls/lzexpand/lz32.spec
@@ -1,9 +1,6 @@
 name	lz32
 type	win32
 
-import	kernel32.dll
-import	ntdll.dll
-
 debug_channels (file)
 
 @ stdcall CopyLZFile(long long) CopyLZFile
diff --git a/dlls/mapi32/Makefile.in b/dlls/mapi32/Makefile.in
index d21fdfbdc6327efece802917edf9113857c618ad..0ba88031a9d991509c8175dcd43402a1cd7911f4 100644
--- a/dlls/mapi32/Makefile.in
+++ b/dlls/mapi32/Makefile.in
@@ -3,6 +3,7 @@ TOPOBJDIR = ../..
 SRCDIR    = @srcdir@
 VPATH     = @srcdir@
 MODULE    = mapi32.dll
+IMPORTS   = ntdll.dll
 
 LDDLLFLAGS = @LDDLLFLAGS@
 SYMBOLFILE = $(MODULE).tmp.o
diff --git a/dlls/mapi32/mapi32.spec b/dlls/mapi32/mapi32.spec
index e2c4fbb23103fe7fb8bb0bbf04d963579f6e7902..d682641ce401dcc65912a1beeeda05e08dc2f5e8 100644
--- a/dlls/mapi32/mapi32.spec
+++ b/dlls/mapi32/mapi32.spec
@@ -1,8 +1,6 @@
 name mapi32
 type win32
 
-import ntdll.dll
-
 debug_channels (mapi)
 
 @ stub BMAPIAddress
diff --git a/dlls/mpr/Makefile.in b/dlls/mpr/Makefile.in
index 9051e1c4d3e4c241f19586c7a5e1cdd88817cec4..5eb3974b0b98614dee5bc7d0afb2eb97c2f3daeb 100644
--- a/dlls/mpr/Makefile.in
+++ b/dlls/mpr/Makefile.in
@@ -3,6 +3,7 @@ TOPOBJDIR = ../..
 SRCDIR    = @srcdir@
 VPATH     = @srcdir@
 MODULE    = mpr.dll
+IMPORTS   = kernel32.dll ntdll.dll
 
 LDDLLFLAGS = @LDDLLFLAGS@
 SYMBOLFILE = $(MODULE).tmp.o
diff --git a/dlls/mpr/mpr.spec b/dlls/mpr/mpr.spec
index e2ea0ce6418909e1c585376e92df8898b3779f61..e20e614a22b98d8818b15295659ba36a0489215f 100644
--- a/dlls/mpr/mpr.spec
+++ b/dlls/mpr/mpr.spec
@@ -1,9 +1,6 @@
 name mpr
 type win32
 
-import kernel32.dll
-import ntdll.dll
-
 debug_channels (mpr)
 
 # ordinal exports
diff --git a/dlls/msacm/Makefile.in b/dlls/msacm/Makefile.in
index 748c6344f8a3b5782f7b371b472e1ebdb1e40bf0..b2db1fcf5f5d5b0964b1d0e9747ac0ae98bfdfdc 100644
--- a/dlls/msacm/Makefile.in
+++ b/dlls/msacm/Makefile.in
@@ -3,6 +3,7 @@ TOPOBJDIR = ../..
 SRCDIR    = @srcdir@
 VPATH     = @srcdir@
 MODULE    = msacm32.dll
+IMPORTS   = winmm.dll user32.dll advapi32.dll kernel32.dll ntdll.dll
 ALTNAMES  = msacm.dll
 
 LDDLLFLAGS = @LDDLLFLAGS@
diff --git a/dlls/msacm/imaadp32/Makefile.in b/dlls/msacm/imaadp32/Makefile.in
index 0e60c8c1428c0631ba2dcb15f0b8a1e6db99000b..7ee045070bd34ffbc9f7310d51b38c3a6859c6c1 100644
--- a/dlls/msacm/imaadp32/Makefile.in
+++ b/dlls/msacm/imaadp32/Makefile.in
@@ -3,6 +3,7 @@ TOPOBJDIR = ../../..
 SRCDIR    = @srcdir@
 VPATH     = @srcdir@
 MODULE    = imaadp32.acm
+IMPORTS   = ntdll.dll
 
 LDDLLFLAGS = @LDDLLFLAGS@
 SYMBOLFILE = $(MODULE).tmp.o
diff --git a/dlls/msacm/imaadp32/imaadp32.acm.spec b/dlls/msacm/imaadp32/imaadp32.acm.spec
index 137c121c3e8461c0668eaecb8f31fcb247202013..9bcb035236b156f29aabfc33ac8b583a902dd398 100644
--- a/dlls/msacm/imaadp32/imaadp32.acm.spec
+++ b/dlls/msacm/imaadp32/imaadp32.acm.spec
@@ -2,8 +2,6 @@ name imaadp32
 file imaadp32.acm
 type win32
 
-import ntdll.dll
-
 debug_channels ()
 
 @ stub DriverProc #(long long long long long)
diff --git a/dlls/msacm/msacm32.spec b/dlls/msacm/msacm32.spec
index 48820a851f78d3376a1c51f293669d4211574fad..8e207764f9efd8c9fe43a20ebca20a6660d5489f 100644
--- a/dlls/msacm/msacm32.spec
+++ b/dlls/msacm/msacm32.spec
@@ -3,12 +3,6 @@ type win32
 init MSACM32_LibMain
 rsrc msacm.res
 
-import winmm.dll
-import user32.dll
-import advapi32.dll
-import kernel32.dll
-import ntdll.dll
-
 debug_channels (msacm)
 
 @ stdcall acmDriverAddA(ptr long long long long) acmDriverAddA
diff --git a/dlls/msacm/msg711/Makefile.in b/dlls/msacm/msg711/Makefile.in
index c6495f73c6113d2e31e2fab3bfdf1e8947fd6eca..f444c24de8088880dd97b6dad0c032c5cf3562ef 100644
--- a/dlls/msacm/msg711/Makefile.in
+++ b/dlls/msacm/msg711/Makefile.in
@@ -3,6 +3,7 @@ TOPOBJDIR = ../../..
 SRCDIR    = @srcdir@
 VPATH     = @srcdir@
 MODULE    = msg711.drv
+IMPORTS   = ntdll.dll
 
 LDDLLFLAGS = @LDDLLFLAGS@
 SYMBOLFILE = $(MODULE).tmp.o
diff --git a/dlls/msacm/msg711/msg711.drv.spec b/dlls/msacm/msg711/msg711.drv.spec
index c746865b0a84aabf7e32608bb3e70a503cc28d8c..3df1a2871193cb335fc9b04ea35701ecf91c6e45 100644
--- a/dlls/msacm/msg711/msg711.drv.spec
+++ b/dlls/msacm/msg711/msg711.drv.spec
@@ -2,8 +2,6 @@ name msg711
 file msg711.drv
 type win32
 
-import ntdll.dll
-
 debug_channels ()
 
 @ stub DriverProc #(long long long long long)
diff --git a/dlls/msdmo/Makefile.in b/dlls/msdmo/Makefile.in
index d6034bfe342e32ccd79dd169ecfc8434d63242fc..7a9c6e81bb9bef1bd57d8120ff2b88429aec25fb 100644
--- a/dlls/msdmo/Makefile.in
+++ b/dlls/msdmo/Makefile.in
@@ -3,6 +3,7 @@ TOPOBJDIR = ../..
 SRCDIR    = @srcdir@
 VPATH     = @srcdir@
 MODULE    = msdmo.dll
+IMPORTS   = ntdll.dll
 
 LDDLLFLAGS = @LDDLLFLAGS@
 SYMBOLFILE = $(MODULE).tmp.o
diff --git a/dlls/msdmo/msdmo.spec b/dlls/msdmo/msdmo.spec
index 6ea33bef770b7a7a317fd24cffc1e405124c3c0b..9e962d3b0b6e0584caec80c3684341e69c145d03 100644
--- a/dlls/msdmo/msdmo.spec
+++ b/dlls/msdmo/msdmo.spec
@@ -1,8 +1,6 @@
 name msdmo
 type win32
 
-import ntdll.dll
-
 debug_channels ()
 
 @ stub DMOEnum
diff --git a/dlls/msimg32/Makefile.in b/dlls/msimg32/Makefile.in
index c829618f55e4d90b51ab47d7f6cae8f8f5ccfa61..0db384291cfecdb559c7e45c7b00661fe4d9c39a 100644
--- a/dlls/msimg32/Makefile.in
+++ b/dlls/msimg32/Makefile.in
@@ -3,6 +3,7 @@ TOPOBJDIR = ../..
 SRCDIR    = @srcdir@
 VPATH     = @srcdir@
 MODULE    = msimg32.dll
+IMPORTS   = ntdll.dll
 
 LDDLLFLAGS = @LDDLLFLAGS@
 SYMBOLFILE = $(MODULE).tmp.o
diff --git a/dlls/msimg32/msimg32.spec b/dlls/msimg32/msimg32.spec
index 580532935e8baf0b1199b6705d083fe92b81c92b..748c8c99a4283b6943bcf4d46e04a96016987f7b 100644
--- a/dlls/msimg32/msimg32.spec
+++ b/dlls/msimg32/msimg32.spec
@@ -1,8 +1,6 @@
 name msimg32
 type win32
 
-import ntdll.dll
-
 debug_channels (msimg32)
 
 @ stdcall AlphaBlend(long long long long long long long long long long long) AlphaBlend
diff --git a/dlls/msisys/Makefile.in b/dlls/msisys/Makefile.in
index 2433508ccf0d182c946bb25f1f7613443626785e..acaf1f943315a5b98d5c3756057fcce96cce49dd 100644
--- a/dlls/msisys/Makefile.in
+++ b/dlls/msisys/Makefile.in
@@ -3,6 +3,7 @@ TOPOBJDIR = ../..
 SRCDIR    = @srcdir@
 VPATH     = @srcdir@
 MODULE    = msisys.ocx
+IMPORTS   = ntdll.dll
 EXTRALIBS = $(LIBUUID)
 
 LDDLLFLAGS = @LDDLLFLAGS@
diff --git a/dlls/msisys/msisys.ocx.spec b/dlls/msisys/msisys.ocx.spec
index 628efb9d5c5e56681faa3861286835ac0e4f2e95..6c6ae61967db17572450cba7cc75d275c37adca7 100644
--- a/dlls/msisys/msisys.ocx.spec
+++ b/dlls/msisys/msisys.ocx.spec
@@ -3,8 +3,6 @@ file	msisys.ocx
 type	win32
 init	MSISYS_DllMain
 
-import ntdll.dll
-
 debug_channels (msisys)
 
 @ stdcall DllCanUnloadNow() MSISYS_DllCanUnloadNow
diff --git a/dlls/msnet32/Makefile.in b/dlls/msnet32/Makefile.in
index b0daaa8830502fe3ba0af1acae060629549f9eec..a46ef65851e68bbebba88431243818e445287f24 100644
--- a/dlls/msnet32/Makefile.in
+++ b/dlls/msnet32/Makefile.in
@@ -3,6 +3,7 @@ TOPOBJDIR = ../..
 SRCDIR    = @srcdir@
 VPATH     = @srcdir@
 MODULE    = msnet32.dll
+IMPORTS   = ntdll.dll
 
 LDDLLFLAGS = @LDDLLFLAGS@
 SYMBOLFILE = $(MODULE).tmp.o
diff --git a/dlls/msnet32/msnet32.spec b/dlls/msnet32/msnet32.spec
index aade69a954642b13801764380dc207e7ec7a2063..07dbe95c82eac324da5d0e44bf28b1b8d4e15ea3 100644
--- a/dlls/msnet32/msnet32.spec
+++ b/dlls/msnet32/msnet32.spec
@@ -1,8 +1,6 @@
 name msnet32
 type win32
 
-import ntdll.dll
-
   1 stub @
   2 stub @
   3 stub @
diff --git a/dlls/msrle32/Makefile.in b/dlls/msrle32/Makefile.in
index 0717476c57b04757c3ff1d5e40f66663c9e99a97..350060678a0afd4c1e3a469d6496124f6526d204 100644
--- a/dlls/msrle32/Makefile.in
+++ b/dlls/msrle32/Makefile.in
@@ -3,6 +3,7 @@ TOPOBJDIR = ../..
 SRCDIR    = @srcdir@
 VPATH     = @srcdir@
 MODULE    = msrle32.dll
+IMPORTS   = ntdll.dll
 
 LDDLLFLAGS = @LDDLLFLAGS@
 SYMBOLFILE = $(MODULE).tmp.o
diff --git a/dlls/msrle32/msrle32.spec b/dlls/msrle32/msrle32.spec
index d9c4dec9ea4b2a8b219a38b147acb1d2270e3e22..f64d3df90fdbaa53ca6a7711f82d6b8883cc078b 100644
--- a/dlls/msrle32/msrle32.spec
+++ b/dlls/msrle32/msrle32.spec
@@ -1,8 +1,6 @@
 name msrle32
 type win32
 
-import ntdll.dll
-
 debug_channels()
 
 @ stub DriverProc #(long long long long long)
diff --git a/dlls/msvcrt/Makefile.in b/dlls/msvcrt/Makefile.in
index 56c06b505b640f055141e4eea198a9beacb0845e..3440c0f982bade5602def30268dce001a942b5f7 100644
--- a/dlls/msvcrt/Makefile.in
+++ b/dlls/msvcrt/Makefile.in
@@ -4,6 +4,7 @@ TOPOBJDIR = ../..
 SRCDIR    = @srcdir@
 VPATH     = @srcdir@
 MODULE    = msvcrt.dll
+IMPORTS   = kernel32.dll ntdll.dll
 EXTRALIBS = $(LIBUNICODE)
 
 LDDLLFLAGS = @LDDLLFLAGS@
diff --git a/dlls/msvcrt/msvcrt.spec b/dlls/msvcrt/msvcrt.spec
index 30e56e0390939cbd020b5a04cdaec7d8cce97cb9..2f3475d8dfea2b9f379fa8de59a2072ba703e55f 100644
--- a/dlls/msvcrt/msvcrt.spec
+++ b/dlls/msvcrt/msvcrt.spec
@@ -3,9 +3,6 @@ name    msvcrt
 type    win32
 init    MSVCRT_Init
 
-import kernel32.dll
-import ntdll.dll
-
 debug_channels (msvcrt)
 
 @ cdecl $I10_OUTPUT() MSVCRT_I10_OUTPUT
diff --git a/dlls/msvcrt20/Makefile.in b/dlls/msvcrt20/Makefile.in
index 3e37644fc970d9fe3fe23d1f1621b33dd11d7362..dd887e918f89a331b64ce1b96b4ec31aa45ede28 100644
--- a/dlls/msvcrt20/Makefile.in
+++ b/dlls/msvcrt20/Makefile.in
@@ -4,6 +4,7 @@ TOPOBJDIR = ../..
 SRCDIR    = @srcdir@
 VPATH     = @srcdir@
 MODULE    = msvcrt20.dll
+IMPORTS   = msvcrt.dll ntdll.dll
 EXTRALIBS = $(LIBUNICODE)
 
 LDDLLFLAGS = @LDDLLFLAGS@
diff --git a/dlls/msvcrt20/msvcrt20.spec b/dlls/msvcrt20/msvcrt20.spec
index e725dd64488c184b51de7aa31bc681cb1f95d147..f22911cdc5aebc9c443523f64a1999d6b12f4d94 100644
--- a/dlls/msvcrt20/msvcrt20.spec
+++ b/dlls/msvcrt20/msvcrt20.spec
@@ -2,9 +2,6 @@
 name    msvcrt20
 type    win32
 
-import msvcrt.dll
-import ntdll.dll
-
 debug_channels (msvcrt) 
 
 @ stub ??0Iostream_init@@QAE@AAVios@@H@Z  #
diff --git a/dlls/msvideo/Makefile.in b/dlls/msvideo/Makefile.in
index fc57a746ba83180e5138c488f8573b8056ba73e2..1839fe245a2a8318b8943a4cd0da4560445dfa54 100644
--- a/dlls/msvideo/Makefile.in
+++ b/dlls/msvideo/Makefile.in
@@ -3,6 +3,7 @@ TOPOBJDIR = ../..
 SRCDIR    = @srcdir@
 VPATH     = @srcdir@
 MODULE    = msvfw32.dll
+IMPORTS   = winmm.dll comctl32.dll version.dll user32.dll gdi32.dll kernel32.dll ntdll.dll
 ALTNAMES  = msvideo.dll
 
 LDDLLFLAGS = @LDDLLFLAGS@
diff --git a/dlls/msvideo/msvfw32.spec b/dlls/msvideo/msvfw32.spec
index 05a39247bfebf972f8200c7f8a89e4467467c5cc..501c064208d6dd92afe0ed63f1bcf5a0564749bc 100644
--- a/dlls/msvideo/msvfw32.spec
+++ b/dlls/msvideo/msvfw32.spec
@@ -1,14 +1,6 @@
 name	msvfw32
 type	win32
 
-import winmm.dll
-import comctl32.dll
-import version.dll
-import user32.dll
-import gdi32.dll
-import kernel32.dll
-import ntdll.dll
-
 debug_channels (mci msvideo)
 
 # Yes, ICCompress,ICDecompress,MCIWnd* and ICDraw* are cdecl (VFWAPIV).
diff --git a/dlls/netapi32/Makefile.in b/dlls/netapi32/Makefile.in
index 9bce845df6da33c745d745a84485e6a34823eb92..af978ec5c8b8ae476d5558b034ff8dfbe3d70df5 100644
--- a/dlls/netapi32/Makefile.in
+++ b/dlls/netapi32/Makefile.in
@@ -4,6 +4,7 @@ TOPOBJDIR = ../..
 SRCDIR    = @srcdir@
 VPATH     = @srcdir@
 MODULE    = netapi32.dll
+IMPORTS   = ntdll.dll
 
 LDDLLFLAGS = @LDDLLFLAGS@
 SYMBOLFILE = $(MODULE).tmp.o
diff --git a/dlls/netapi32/netapi32.spec b/dlls/netapi32/netapi32.spec
index 077211cdc721cc5a7b2c815b5b1cc47c68e70119..a321c858f6a69fa515b1acc3df841f102658b1a2 100644
--- a/dlls/netapi32/netapi32.spec
+++ b/dlls/netapi32/netapi32.spec
@@ -2,11 +2,6 @@ name	netapi32
 type    win32
 init	NETAPI32_LibMain
 
-#import	user32.dll
-#import	advapi32.dll
-#import	kernel32.dll
-import	ntdll.dll
-
 debug_channels (netbios)
 
 1 stdcall Netbios(ptr) Netbios
diff --git a/dlls/odbc32/Makefile.in b/dlls/odbc32/Makefile.in
index 346e37ce083147a1aaa7c476aef4c09da9701a0a..1a1615a6de9b171bcd44348c33354fdd5330249c 100644
--- a/dlls/odbc32/Makefile.in
+++ b/dlls/odbc32/Makefile.in
@@ -3,6 +3,7 @@ TOPOBJDIR = ../..
 SRCDIR    = @srcdir@
 VPATH     = @srcdir@
 MODULE    = odbc32.dll
+IMPORTS   = ntdll.dll
 
 LDDLLFLAGS = @LDDLLFLAGS@
 SYMBOLFILE = $(MODULE).tmp.o
diff --git a/dlls/odbc32/odbc32.spec b/dlls/odbc32/odbc32.spec
index 02503340b2e5d7e6675b982ab6b926e0716cb4dc..bfa1c9ce575d9d003787064748606b0c304e1b06 100644
--- a/dlls/odbc32/odbc32.spec
+++ b/dlls/odbc32/odbc32.spec
@@ -2,8 +2,6 @@ name	odbc32
 type	win32
 init    MAIN_OdbcInit
 
-import	ntdll.dll
-
 debug_channels (odbc)
 
 001 stdcall SQLAllocConnect(long ptr) SQLAllocConnect
diff --git a/dlls/ole32/Makefile.in b/dlls/ole32/Makefile.in
index d3e9a7921a2cc32e6c03d7e7ea790ca2bc92f911..8b68cc8d784e1ddb0ccd3ef2f6ca1f13dcef5ed2 100644
--- a/dlls/ole32/Makefile.in
+++ b/dlls/ole32/Makefile.in
@@ -4,6 +4,7 @@ TOPOBJDIR = ../..
 SRCDIR    = @srcdir@
 VPATH     = @srcdir@
 MODULE    = ole32.dll
+IMPORTS   = advapi32.dll user32.dll gdi32.dll rpcrt4.dll kernel32.dll ntdll.dll
 ALTNAMES  = ole2.dll ole2nls.dll ole2conv.dll ole2prox.dll ole2thk.dll storage.dll compobj.dll
 EXTRALIBS = $(LIBUUID)
 
diff --git a/dlls/ole32/ole32.spec b/dlls/ole32/ole32.spec
index 657604f8248b0080bf1030ccecf02151ef8042f8..179b04ccda71c6bdee892d5a3abf9d6e99d78c09 100644
--- a/dlls/ole32/ole32.spec
+++ b/dlls/ole32/ole32.spec
@@ -3,13 +3,6 @@ type	win32
 init	OLE32_DllEntryPoint
 rsrc	ole32res.res
 
-import advapi32.dll
-import user32.dll
-import gdi32.dll
-import rpcrt4.dll
-import kernel32.dll
-import ntdll.dll
-
 debug_channels (accel ole relay storage)
 
   1 stub BindMoniker                # stdcall (ptr long ptr ptr) return 0,ERR_NOTIMPLEMENTED
diff --git a/dlls/oleaut32/Makefile.in b/dlls/oleaut32/Makefile.in
index 2fc0cf1dbd3f45a8ec9e60dd9a770947effacc52..35c13e26763cde7387e91046f8ceed024ed4905f 100644
--- a/dlls/oleaut32/Makefile.in
+++ b/dlls/oleaut32/Makefile.in
@@ -3,6 +3,8 @@ TOPOBJDIR = ../..
 SRCDIR    = @srcdir@
 VPATH     = @srcdir@
 MODULE    = oleaut32.dll
+IMPORTS   = ole32.dll user32.dll gdi32.dll advapi32.dll kernel32.dll ntdll.dll
+DELAYIMPORTS = comctl32.dll
 ALTNAMES  = ole2disp.dll typelib.dll
 EXTRALIBS = $(LIBUUID) @JPEGLIB@
 
diff --git a/dlls/oleaut32/oleaut32.spec b/dlls/oleaut32/oleaut32.spec
index 737c54df531da5e94cf2eb3bd6544d80e1d7d55a..995c5b62f9fd73b3fefd17909af420e72cdddc16 100644
--- a/dlls/oleaut32/oleaut32.spec
+++ b/dlls/oleaut32/oleaut32.spec
@@ -2,14 +2,6 @@ name oleaut32
 type win32
 rsrc version.res
 
-import -delay comctl32.dll
-import ole32.dll
-import user32.dll
-import gdi32.dll
-import advapi32.dll
-import kernel32.dll
-import ntdll.dll
-
 debug_channels (ole olerelay typelib)
 
 1 stdcall DllGetClassObject(ptr ptr ptr) OLEAUT32_DllGetClassObject
diff --git a/dlls/oleaut32/tests/oleaut32_test.spec b/dlls/oleaut32/tests/oleaut32_test.spec
index 35f7b6430f0af6287117eaebfcc338d2ca902b97..1a0374b41730ceac069f520f781fef86c97263a6 100644
--- a/dlls/oleaut32/tests/oleaut32_test.spec
+++ b/dlls/oleaut32/tests/oleaut32_test.spec
@@ -1,8 +1,3 @@
 name	oleaut32_tests
 mode	cuiexe
 type	win32
-
-import	oleaut32.dll
-import	gdi32.dll
-import	kernel32.dll
-import	ntdll.dll
diff --git a/dlls/olecli/Makefile.in b/dlls/olecli/Makefile.in
index e4086e696e28b120cafd25717accca126c93e58b..2daf62c815f292f44a7aa071948ecdb5f389524b 100644
--- a/dlls/olecli/Makefile.in
+++ b/dlls/olecli/Makefile.in
@@ -3,6 +3,7 @@ TOPOBJDIR = ../..
 SRCDIR    = @srcdir@
 VPATH     = @srcdir@
 MODULE    = olecli32.dll
+IMPORTS   = ole32.dll gdi32.dll kernel32.dll ntdll.dll
 ALTNAMES  = olecli.dll
 
 LDDLLFLAGS = @LDDLLFLAGS@
diff --git a/dlls/olecli/olecli32.spec b/dlls/olecli/olecli32.spec
index e0582058bb57ca67775f61d5b6162a43f28cf6a4..e50bcf5b52cf3e6d46a9083eb6fd44fc0a8a9f61 100644
--- a/dlls/olecli/olecli32.spec
+++ b/dlls/olecli/olecli32.spec
@@ -1,11 +1,6 @@
 name olecli32
 type win32
 
-import ole32.dll
-import gdi32.dll
-import kernel32.dll
-import ntdll.dll
-
 debug_channels (ole)
 
    1 stub WEP
diff --git a/dlls/oledlg/Makefile.in b/dlls/oledlg/Makefile.in
index 95d03500bc033258b4c767c874cd721986f67583..3a993fdcba3ed9d524812a96c69e88ec9c50ac3a 100644
--- a/dlls/oledlg/Makefile.in
+++ b/dlls/oledlg/Makefile.in
@@ -3,6 +3,7 @@ TOPOBJDIR = ../..
 SRCDIR    = @srcdir@
 VPATH     = @srcdir@
 MODULE    = oledlg.dll
+IMPORTS   = kernel32.dll ntdll.dll
 
 LDDLLFLAGS = @LDDLLFLAGS@
 SYMBOLFILE = $(MODULE).tmp.o
diff --git a/dlls/oledlg/oledlg.spec b/dlls/oledlg/oledlg.spec
index 28137ba492c75a9e03cc8c97218fe99a2bfcab6a..207bf0ae28bac29fe497d8452263ff72e8ee49e1 100644
--- a/dlls/oledlg/oledlg.spec
+++ b/dlls/oledlg/oledlg.spec
@@ -1,9 +1,6 @@
 name	oledlg
 type	win32
 
-import	kernel32.dll
-import	ntdll.dll
-
 debug_channels (ole)
 
   1 stdcall OleUIAddVerbMenuA(ptr str long long long long long long ptr) OleUIAddVerbMenuA
diff --git a/dlls/olepro32/Makefile.in b/dlls/olepro32/Makefile.in
index b1d66f93311062149446cd7a461810632604bd77..38446efebe3424e89bd8e75659af2ff686d1d93b 100644
--- a/dlls/olepro32/Makefile.in
+++ b/dlls/olepro32/Makefile.in
@@ -3,6 +3,7 @@ TOPOBJDIR = ../..
 SRCDIR    = @srcdir@
 VPATH     = @srcdir@
 MODULE    = olepro32.dll
+IMPORTS   = oleaut32.dll ntdll.dll
 
 LDDLLFLAGS = @LDDLLFLAGS@
 SYMBOLFILE = $(MODULE).tmp.o
diff --git a/dlls/olepro32/olepro32.spec b/dlls/olepro32/olepro32.spec
index 52f6e80ebfb4aea82d4aca54b08f3a5a8deecaa0..fd434dda2c09fe4ec73d794a7b514efa8ff08e06 100644
--- a/dlls/olepro32/olepro32.spec
+++ b/dlls/olepro32/olepro32.spec
@@ -1,9 +1,6 @@
 name olepro32
 type win32
 
-import oleaut32.dll
-import ntdll.dll
-
 debug_channels (ole)
 
 248 forward OleIconToCursor OLEAUT32.OleIconToCursor
diff --git a/dlls/olesvr/Makefile.in b/dlls/olesvr/Makefile.in
index fc7f0e73299d9645c621f68c01e6ff692775a54b..75c62d24cc5feb668c41c248edef8bb04cb96584 100644
--- a/dlls/olesvr/Makefile.in
+++ b/dlls/olesvr/Makefile.in
@@ -3,6 +3,7 @@ TOPOBJDIR = ../..
 SRCDIR    = @srcdir@
 VPATH     = @srcdir@
 MODULE    = olesvr32.dll
+IMPORTS   = kernel32.dll ntdll.dll
 ALTNAMES  = olesvr.dll
 
 LDDLLFLAGS = @LDDLLFLAGS@
diff --git a/dlls/olesvr/olesvr32.spec b/dlls/olesvr/olesvr32.spec
index 07525466b56083084a96cd8859268c91468882ee..bfce0af77b8fd291185c86de7fef9ef9d34a7e09 100644
--- a/dlls/olesvr/olesvr32.spec
+++ b/dlls/olesvr/olesvr32.spec
@@ -1,9 +1,6 @@
 name	olesvr32
 type	win32
 
-import	kernel32.dll
-import	ntdll.dll
-
 debug_channels (ole)
 
  1 stub WEP
diff --git a/dlls/opengl32/Makefile.in b/dlls/opengl32/Makefile.in
index dcbedc63e4c16fcea6668caf665109d3b447da44..34dff133dda7ae8449e2208eb6b9563cb354295b 100644
--- a/dlls/opengl32/Makefile.in
+++ b/dlls/opengl32/Makefile.in
@@ -3,6 +3,7 @@ TOPOBJDIR = ../..
 SRCDIR    = @srcdir@
 VPATH     = @srcdir@
 MODULE    = opengl32.dll
+IMPORTS   = user32.dll gdi32.dll kernel32.dll ntdll.dll
 EXTRALIBS = $(LIBTSX11) $(X_LIBS) $(XLIB)
 
 LDDLLFLAGS = @LDDLLFLAGS@
diff --git a/dlls/opengl32/opengl32.spec b/dlls/opengl32/opengl32.spec
index 5d715eabb2125413632722a26c30d8d44c90efcc..35c03bff70482d9e2eccf6ddbca9c0d80b197e6e 100644
--- a/dlls/opengl32/opengl32.spec
+++ b/dlls/opengl32/opengl32.spec
@@ -2,11 +2,6 @@ name opengl32
 type win32
 init OpenGL32_Init
 
-import user32.dll
-import gdi32.dll
-import kernel32.dll
-import ntdll.dll
-
 debug_channels (opengl)
 
 @  stdcall wglCreateContext(long) wglCreateContext
diff --git a/dlls/psapi/Makefile.in b/dlls/psapi/Makefile.in
index 85b2898d5eb2670f7d4d536efe78126c2aac1112..af28ed3b8d3f90f6e24a2dbcf35ecf6740508125 100644
--- a/dlls/psapi/Makefile.in
+++ b/dlls/psapi/Makefile.in
@@ -3,6 +3,7 @@ TOPOBJDIR = ../..
 SRCDIR    = @srcdir@
 VPATH     = @srcdir@
 MODULE    = psapi.dll
+IMPORTS   = kernel32.dll ntdll.dll
 
 LDDLLFLAGS = @LDDLLFLAGS@
 SYMBOLFILE = $(MODULE).tmp.o
diff --git a/dlls/psapi/psapi.spec b/dlls/psapi/psapi.spec
index 7d01cba3598faee4e24cfa9e6580a220061a2479..d0acd048e2c69abc9f96f12a8f10f86e35f651a1 100644
--- a/dlls/psapi/psapi.spec
+++ b/dlls/psapi/psapi.spec
@@ -1,9 +1,6 @@
 name    psapi
 type    win32
 
-import	kernel32.dll
-import	ntdll.dll
-
 debug_channels (psapi)
 
 @ stdcall EmptyWorkingSet(long) EmptyWorkingSet
diff --git a/dlls/qcap/Makefile.in b/dlls/qcap/Makefile.in
index 132dd2c7e0d2d420bcd1a09bb807325f9a15b4f7..1015a0aa37e177a28bd858a3087f2ad9ff2f4661 100644
--- a/dlls/qcap/Makefile.in
+++ b/dlls/qcap/Makefile.in
@@ -3,6 +3,7 @@ TOPOBJDIR = ../..
 SRCDIR    = @srcdir@
 VPATH     = @srcdir@
 MODULE    = qcap.dll
+IMPORTS   = ntdll.dll
 
 LDDLLFLAGS = @LDDLLFLAGS@
 SYMBOLFILE = $(MODULE).tmp.o
diff --git a/dlls/qcap/qcap.spec b/dlls/qcap/qcap.spec
index b8e62e93b43d25cafff9e25df60fc2386544eff2..2ef3d9fad15f18b8d177a59a7b000f2bbfd667f7 100644
--- a/dlls/qcap/qcap.spec
+++ b/dlls/qcap/qcap.spec
@@ -1,8 +1,6 @@
 name qcap
 type win32
 
-import ntdll.dll
-
 debug_channels()
 
 @ stub DllCanUnloadNow
diff --git a/dlls/quartz/Makefile.in b/dlls/quartz/Makefile.in
index 3e51f7103c80e0f1477453c83d345f5061b103cf..5e14022300a1f15dd524ab5bf73fec589322af28 100644
--- a/dlls/quartz/Makefile.in
+++ b/dlls/quartz/Makefile.in
@@ -3,6 +3,7 @@ TOPOBJDIR = ../..
 SRCDIR    = @srcdir@
 VPATH     = @srcdir@
 MODULE    = quartz.dll
+IMPORTS   = ntdll.dll
 
 LDDLLFLAGS = @LDDLLFLAGS@
 SYMBOLFILE = $(MODULE).tmp.o
diff --git a/dlls/quartz/quartz.spec b/dlls/quartz/quartz.spec
index b8c333f1baca604c52cdd1df294fd1b4f2b0edb7..375ea8d04c3a232390ed6bf2ea0d474db2e9d2ef 100644
--- a/dlls/quartz/quartz.spec
+++ b/dlls/quartz/quartz.spec
@@ -1,8 +1,6 @@
 name	quartz
 type	win32
 
-import ntdll.dll
-
 debug_channels (quartz)
 
 @ stub AMGetErrorTextA
diff --git a/dlls/rasapi32/Makefile.in b/dlls/rasapi32/Makefile.in
index 161e4de54f18b3efa257cdd5a31cee296c5e0113..a8625ef382289ce546a375d87cde3fb33da29b9f 100644
--- a/dlls/rasapi32/Makefile.in
+++ b/dlls/rasapi32/Makefile.in
@@ -3,6 +3,7 @@ TOPOBJDIR = ../..
 SRCDIR    = @srcdir@
 VPATH     = @srcdir@
 MODULE    = rasapi32.dll
+IMPORTS   = kernel32.dll ntdll.dll
 ALTNAMES  = rasapi16.dll
 
 LDDLLFLAGS = @LDDLLFLAGS@
diff --git a/dlls/rasapi32/rasapi32.spec b/dlls/rasapi32/rasapi32.spec
index 2a11655e430d84bedc90d650382f30067ce11bc6..fb8501ceb733a86d11907d84bfd8aec86e2914de 100644
--- a/dlls/rasapi32/rasapi32.spec
+++ b/dlls/rasapi32/rasapi32.spec
@@ -1,9 +1,6 @@
 name	rasapi32
 type	win32
 
-import	kernel32.dll
-import	ntdll.dll
-
 debug_channels (ras)
 
  1  stub RasAutodialAddressToNetwork
diff --git a/dlls/richedit/Makefile.in b/dlls/richedit/Makefile.in
index ea0f651d84a9f65f91b2ac2376e0600c8aa62652..145116333954692133abb698be48cb0e24db9077 100644
--- a/dlls/richedit/Makefile.in
+++ b/dlls/richedit/Makefile.in
@@ -3,6 +3,7 @@ TOPOBJDIR = ../..
 SRCDIR    = @srcdir@
 VPATH     = @srcdir@
 MODULE    = riched32.dll
+IMPORTS   = user32.dll kernel32.dll ntdll.dll
 
 LDDLLFLAGS = @LDDLLFLAGS@
 SYMBOLFILE = $(MODULE).tmp.o
diff --git a/dlls/richedit/riched32.spec b/dlls/richedit/riched32.spec
index 98532608c9c856552c60ca62d97c5ec848345943..8010c66517392e8dd8f73f06151a9ac7375f06d6 100644
--- a/dlls/richedit/riched32.spec
+++ b/dlls/richedit/riched32.spec
@@ -2,10 +2,6 @@ name	riched32
 type	win32
 init	RICHED32_LibMain
 
-import	user32.dll
-import	kernel32.dll
-import	ntdll.dll
-
 debug_channels (richedit)
 
 2 stdcall DllGetVersion (ptr) RICHED32_DllGetVersion
diff --git a/dlls/rpcrt4/Makefile.in b/dlls/rpcrt4/Makefile.in
index e64507ea44655282a8a4570f90e0763fd81e5672..2674482c785237d108fce5546bd4322149c47fcc 100644
--- a/dlls/rpcrt4/Makefile.in
+++ b/dlls/rpcrt4/Makefile.in
@@ -4,6 +4,7 @@ TOPOBJDIR = ../..
 SRCDIR    = @srcdir@
 VPATH     = @srcdir@
 MODULE    = rpcrt4.dll
+IMPORTS   = kernel32.dll ntdll.dll
 
 LDDLLFLAGS = @LDDLLFLAGS@
 SYMBOLFILE = $(MODULE).tmp.o
diff --git a/dlls/rpcrt4/rpcrt4.spec b/dlls/rpcrt4/rpcrt4.spec
index 029319518bbf56e33ac02931fcbf75f8b15476e5..8f3857c7fe7580411230a39f2a515d6861b1308e 100644
--- a/dlls/rpcrt4/rpcrt4.spec
+++ b/dlls/rpcrt4/rpcrt4.spec
@@ -2,9 +2,6 @@ name	rpcrt4
 type	win32
 init	RPCRT4_LibMain
 
-import	kernel32.dll
-import	ntdll.dll
-
 debug_channels (ole)
 
 @ stub DceErrorInqTextA
diff --git a/dlls/serialui/Makefile.in b/dlls/serialui/Makefile.in
index ba8dfa54ef4abdb39d212f4fb6970a516312379d..9cf48533577136d30672333ede7a8f9c6f5fe022 100644
--- a/dlls/serialui/Makefile.in
+++ b/dlls/serialui/Makefile.in
@@ -3,6 +3,7 @@ TOPOBJDIR = ../..
 SRCDIR    = @srcdir@
 VPATH     = @srcdir@
 MODULE    = serialui.dll
+IMPORTS   = user32.dll advapi32.dll kernel32.dll ntdll.dll
 
 LDDLLFLAGS = @LDDLLFLAGS@
 SYMBOLFILE = $(MODULE).tmp.o
diff --git a/dlls/serialui/serialui.spec b/dlls/serialui/serialui.spec
index 60d20a8b4827e76de2c4dbef2e83a18f9330de04..4c85e55ad60c56cb16358a5d974b1134981b5fc2 100644
--- a/dlls/serialui/serialui.spec
+++ b/dlls/serialui/serialui.spec
@@ -3,11 +3,6 @@ type	win32
 init	SERIALUI_LibMain
 rsrc	serialui_rc.res
 
-import	user32.dll
-import	advapi32.dll
-import	kernel32.dll
-import	ntdll.dll
-
 debug_channels (comm)
 
 2 stdcall EnumPropPages(ptr ptr ptr) SERIALUI_EnumPropPages
diff --git a/dlls/setupapi/Makefile.in b/dlls/setupapi/Makefile.in
index 262fd42daae95d9424bc2661699874fc752eeb20..12b14d1265afaf56869a17cd829b04aa426ea487 100644
--- a/dlls/setupapi/Makefile.in
+++ b/dlls/setupapi/Makefile.in
@@ -4,6 +4,7 @@ TOPOBJDIR = ../..
 SRCDIR    = @srcdir@
 VPATH     = @srcdir@
 MODULE    = setupapi.dll
+IMPORTS   = user32.dll advapi32.dll kernel32.dll ntdll.dll
 ALTNAMES  = setupx.dll
 EXTRALIBS = $(LIBUNICODE)
 
diff --git a/dlls/setupapi/setupapi.spec b/dlls/setupapi/setupapi.spec
index 83147147b7f9c1a5790740047d244032bd35f823..82e6487bec13244faacf0a20bca861335265b676 100644
--- a/dlls/setupapi/setupapi.spec
+++ b/dlls/setupapi/setupapi.spec
@@ -2,11 +2,6 @@ name setupapi
 type win32
 rsrc setupapi.res
 
-import user32.dll
-import advapi32.dll
-import kernel32.dll
-import ntdll.dll
-
 debug_channels (setupapi)
 
 @ stub AddMiniIconToList
diff --git a/dlls/shdocvw/Makefile.in b/dlls/shdocvw/Makefile.in
index 26063384555b446abcff3d63d47fde8fa32a8aa3..d505c67b6b7f8877ad8f91b0b65779c2a858671c 100644
--- a/dlls/shdocvw/Makefile.in
+++ b/dlls/shdocvw/Makefile.in
@@ -4,6 +4,7 @@ TOPOBJDIR = ../..
 SRCDIR    = @srcdir@
 VPATH     = @srcdir@
 MODULE    = shdocvw.dll
+IMPORTS   = ole32.dll kernel32.dll ntdll.dll
 
 LDDLLFLAGS = @LDDLLFLAGS@
 SYMBOLFILE = $(MODULE).tmp.o
diff --git a/dlls/shdocvw/shdocvw.spec b/dlls/shdocvw/shdocvw.spec
index c48107974bf87946d4441e73a0ac69869ca5cca2..47eb9f43e81ebfd13f37b6c97e2d2a6bf2f67193 100644
--- a/dlls/shdocvw/shdocvw.spec
+++ b/dlls/shdocvw/shdocvw.spec
@@ -1,10 +1,6 @@
 name	shdocvw
 type	win32
 
-import	ole32.dll
-import	kernel32.dll
-import	ntdll.dll
-
 debug_channels (comimpl shdocvw)
 
 # ordinal exports
diff --git a/dlls/shell32/Makefile.in b/dlls/shell32/Makefile.in
index cdd4cb51acdcf0a697264d204b4f729755aa3a63..a3661c9c373473003be4d2d1569b29a600f724a3 100644
--- a/dlls/shell32/Makefile.in
+++ b/dlls/shell32/Makefile.in
@@ -4,6 +4,8 @@ TOPOBJDIR = ../..
 SRCDIR    = @srcdir@
 VPATH     = @srcdir@
 MODULE    = shell32.dll
+# fixme: avoid ole32.dll import
+IMPORTS   = ole32.dll shlwapi.dll comctl32.dll user32.dll gdi32.dll advapi32.dll kernel32.dll ntdll.dll
 ALTNAMES  = shell.dll
 EXTRALIBS = $(LIBUUID) $(LIBUNICODE)
 
diff --git a/dlls/shell32/shell32.spec b/dlls/shell32/shell32.spec
index 4df33ee65d2be559f10ffec7ff100f0c1f0878fb..105b00c6d7251c9c141d33f3b1e03b677dccbb41 100644
--- a/dlls/shell32/shell32.spec
+++ b/dlls/shell32/shell32.spec
@@ -3,17 +3,6 @@ type	win32
 init	Shell32LibMain
 rsrc	shres.res
 
-# fixme: avoid this import
-import ole32.dll
-
-import shlwapi.dll
-import comctl32.dll
-import user32.dll
-import gdi32.dll
-import advapi32.dll
-import kernel32.dll
-import ntdll.dll
-
 debug_channels (exec pidl shell shlctrl)
 
 # Functions exported by the Win95 shell32.dll 
diff --git a/dlls/shfolder/Makefile.in b/dlls/shfolder/Makefile.in
index d03d3504417c1e66ef15c3fa0b1de91166e2a7cd..277cbe95e8e3a8c74d20f515b338d8ba96087ca8 100644
--- a/dlls/shfolder/Makefile.in
+++ b/dlls/shfolder/Makefile.in
@@ -3,6 +3,7 @@ TOPOBJDIR = ../..
 SRCDIR    = @srcdir@
 VPATH     = @srcdir@
 MODULE    = shfolder.dll
+IMPORTS   = shell32.dll
 
 LDDLLFLAGS = @LDDLLFLAGS@
 SYMBOLFILE = $(MODULE).tmp.o
diff --git a/dlls/shfolder/shfolder.spec b/dlls/shfolder/shfolder.spec
index f1d3a244bad988e92992f7b65859c99e8ab4f3be..0d97004456c52b3c05c6a4896f9497961392ab3c 100644
--- a/dlls/shfolder/shfolder.spec
+++ b/dlls/shfolder/shfolder.spec
@@ -1,7 +1,5 @@
 name shfolder
 type win32
 
-import shell32.dll
-
 @ forward SHGetFolderPathA shell32.SHGetFolderPathA
 @ forward SHGetFolderPathW shell32.SHGetFolderPathW
diff --git a/dlls/shlwapi/Makefile.in b/dlls/shlwapi/Makefile.in
index 448b1cb4c0c569a5098bfe2b34ece15ea9020d65..57387a432da7f6153af9f8a57749dd9eb0ed962b 100644
--- a/dlls/shlwapi/Makefile.in
+++ b/dlls/shlwapi/Makefile.in
@@ -4,6 +4,7 @@ TOPOBJDIR = ../..
 SRCDIR    = @srcdir@
 VPATH     = @srcdir@
 MODULE    = shlwapi.dll
+IMPORTS   = user32.dll gdi32.dll advapi32.dll kernel32.dll ntdll.dll
 EXTRALIBS = $(LIBUUID) $(LIBUNICODE)
 
 LDDLLFLAGS = @LDDLLFLAGS@
diff --git a/dlls/shlwapi/shlwapi.spec b/dlls/shlwapi/shlwapi.spec
index 489f03eeeaf584123f0a3d86d5ec5a5091cc459e..66ef7d6135030b580bc2d497a8fe89c4dfe3edbe 100644
--- a/dlls/shlwapi/shlwapi.spec
+++ b/dlls/shlwapi/shlwapi.spec
@@ -2,12 +2,6 @@ name shlwapi
 type win32
 init SHLWAPI_LibMain
 
-import advapi32.dll
-import user32.dll
-import gdi32.dll
-import kernel32.dll
-import ntdll.dll
-
 debug_channels (shell)
 
 1   stdcall @(str ptr) SHLWAPI_1
diff --git a/dlls/snmpapi/Makefile.in b/dlls/snmpapi/Makefile.in
index 4c6dee25c7df8d96bad389d0521a141df720cac1..689955cb5333943e671899f85b7490c8c76fea70 100644
--- a/dlls/snmpapi/Makefile.in
+++ b/dlls/snmpapi/Makefile.in
@@ -3,6 +3,7 @@ TOPOBJDIR = ../..
 SRCDIR    = @srcdir@
 VPATH     = @srcdir@
 MODULE    = snmpapi.dll
+IMPORTS   = ntdll.dll
 
 LDDLLFLAGS = @LDDLLFLAGS@
 SYMBOLFILE = $(MODULE).tmp.o
diff --git a/dlls/snmpapi/snmpapi.spec b/dlls/snmpapi/snmpapi.spec
index 7803ec8f2352e64365d1ae90c88f970649aef5b8..6c86eb4b02e84dde8f3ec3f68b11d21fb28f1dbe 100644
--- a/dlls/snmpapi/snmpapi.spec
+++ b/dlls/snmpapi/snmpapi.spec
@@ -2,8 +2,6 @@ name    snmpapi
 type    win32
 init    SNMPAPI_DllMain
 
-import ntdll.dll
-
 debug_channels (snmpapi)
 
 @ stub SnmpSvcAddrIsIpx
diff --git a/dlls/sti/Makefile.in b/dlls/sti/Makefile.in
index e2054d4e39b46872a3eb66c252919f9629e85200..ea8baea34654e308bd5c0a837d12f11e27a3af43 100644
--- a/dlls/sti/Makefile.in
+++ b/dlls/sti/Makefile.in
@@ -3,6 +3,7 @@ TOPOBJDIR = ../..
 SRCDIR    = @srcdir@
 VPATH     = @srcdir@
 MODULE    = sti.dll
+IMPORTS   = ntdll.dll
 
 LDDLLFLAGS = @LDDLLFLAGS@
 SYMBOLFILE = $(MODULE).tmp.o
diff --git a/dlls/sti/sti.spec b/dlls/sti/sti.spec
index 1b8adbedc2d85fa932ed39e732666480f91ab623..f4716d47465a7f0d591b18a5adbe3c47bff83f0d 100644
--- a/dlls/sti/sti.spec
+++ b/dlls/sti/sti.spec
@@ -1,8 +1,6 @@
 name sti
 type win32
 
-import ntdll.dll
-
 debug_channels()
 
 @ stub DllCanUnloadNow
diff --git a/dlls/tapi32/Makefile.in b/dlls/tapi32/Makefile.in
index ed298a869effbe33c820dea84e3aa18e0bc152c8..2ddf6195326edfcdc42f01dd0d59589177db3f2a 100644
--- a/dlls/tapi32/Makefile.in
+++ b/dlls/tapi32/Makefile.in
@@ -3,6 +3,7 @@ TOPOBJDIR = ../..
 SRCDIR    = @srcdir@
 VPATH     = @srcdir@
 MODULE    = tapi32.dll
+IMPORTS   = kernel32.dll ntdll.dll
 
 LDDLLFLAGS = @LDDLLFLAGS@
 SYMBOLFILE = $(MODULE).tmp.o
diff --git a/dlls/tapi32/tapi32.spec b/dlls/tapi32/tapi32.spec
index 030740dd0c2ffa564b84ade0be9b6e0924ea41ae..32402ee2341fe9bfe7582357c5de7d84b94122b1 100644
--- a/dlls/tapi32/tapi32.spec
+++ b/dlls/tapi32/tapi32.spec
@@ -1,9 +1,6 @@
 name	tapi32
 type	win32
 
-import	kernel32.dll
-import	ntdll.dll
-
 debug_channels (tapi)
 
 @ stdcall lineAccept(long str long) lineAccept
diff --git a/dlls/ttydrv/Makefile.in b/dlls/ttydrv/Makefile.in
index 65f7c070d6173122cabcc62a3ab2802d58731429..f41680b0cba621e616e71cb7f33236c9a287b0aa 100644
--- a/dlls/ttydrv/Makefile.in
+++ b/dlls/ttydrv/Makefile.in
@@ -4,6 +4,7 @@ SRCDIR    = @srcdir@
 VPATH     = @srcdir@
 MODULE    = ttydrv.dll
 IMPORTS   = user32.dll gdi32.dll kernel32.dll ntdll.dll
+LDIMPORTS = user32.dll gdi32.dll kernel32.dll ntdll.dll
 EXTRALIBS = @CURSESLIBS@
 
 LDDLLFLAGS = @LDDLLFLAGS@
diff --git a/dlls/ttydrv/ttydrv.spec b/dlls/ttydrv/ttydrv.spec
index c48448f67ab80b084cc843296c60d4cabf11aa60..b8d5aa3e9a351bbbf6d63db09981b0b6c4ef886d 100644
--- a/dlls/ttydrv/ttydrv.spec
+++ b/dlls/ttydrv/ttydrv.spec
@@ -2,11 +2,6 @@ name	ttydrv
 type	win32
 init	TTYDRV_Init
 
-import	user32.dll
-import	gdi32.dll
-import	kernel32.dll
-import	ntdll.dll
-
 debug_channels (ttydrv)
 
 # GDI driver
diff --git a/dlls/twain/Makefile.in b/dlls/twain/Makefile.in
index 273e128703313ff3c4891aed36291b22582bf6f9..d53d1a26d8350ecf9e8ef02fb5f4e15af73378d0 100644
--- a/dlls/twain/Makefile.in
+++ b/dlls/twain/Makefile.in
@@ -3,6 +3,7 @@ TOPOBJDIR = ../..
 SRCDIR    = @srcdir@
 VPATH     = @srcdir@
 MODULE    = twain_32.dll
+IMPORTS   = user32.dll gdi32.dll kernel32.dll ntdll.dll
 EXTRALIBS = @SANELIBS@
 EXTRAINCL = @SANEINCL@
 
diff --git a/dlls/twain/twain_32.spec b/dlls/twain/twain_32.spec
index cb0a8b3cee0f12e3b10d3fcd7d72ef15f2bfea2d..d337782ed068444d10db8fe3a442a4c03c353708 100644
--- a/dlls/twain/twain_32.spec
+++ b/dlls/twain/twain_32.spec
@@ -2,11 +2,6 @@ name	twain_32
 type	win32
 init	TWAIN_LibMain
 
-import  user32.dll
-import  gdi32.dll
-import  kernel32.dll
-import  ntdll.dll
-
 debug_channels (twain)
 
 @ stdcall DSM_Entry(ptr ptr long long long ptr) DSM_Entry
diff --git a/dlls/url/Makefile.in b/dlls/url/Makefile.in
index 4ada341f12ea06c58dbd5f49bc52dfbff57b2b4e..ebf200725a425aa2950c526fdfbb9312f3178085 100644
--- a/dlls/url/Makefile.in
+++ b/dlls/url/Makefile.in
@@ -3,6 +3,7 @@ TOPOBJDIR = ../..
 SRCDIR    = @srcdir@
 VPATH     = @srcdir@
 MODULE    = url.dll
+IMPORTS   = ntdll.dll
 
 LDDLLFLAGS = @LDDLLFLAGS@
 SYMBOLFILE = $(MODULE).tmp.o
diff --git a/dlls/url/url.spec b/dlls/url/url.spec
index 2d06f196b68c500dddd248bf30a886c7b18e9034..d9805c0d4129e698de05f052a36a3020f6e683a3 100644
--- a/dlls/url/url.spec
+++ b/dlls/url/url.spec
@@ -1,8 +1,6 @@
 name url
 type win32
 
-import ntdll.dll
-
 debug_channels()
 
 @ stub AddMIMEFileTypesPS
diff --git a/dlls/urlmon/Makefile.in b/dlls/urlmon/Makefile.in
index 7827f1b3de7f1ae700ac159e18adfabf20025265..c7b4c544f77ba0612ae59332cc0e174554a563d6 100644
--- a/dlls/urlmon/Makefile.in
+++ b/dlls/urlmon/Makefile.in
@@ -3,6 +3,7 @@ TOPOBJDIR = ../..
 SRCDIR    = @srcdir@
 VPATH     = @srcdir@
 MODULE    = urlmon.dll
+IMPORTS   = ole32.dll ntdll.dll
 
 LDDLLFLAGS = @LDDLLFLAGS@
 SYMBOLFILE = $(MODULE).tmp.o
diff --git a/dlls/urlmon/urlmon.spec b/dlls/urlmon/urlmon.spec
index f40bb667e0a7e98ad0af28fd11dbb90f1554e33d..9f05a76a8b1dbc54b290b96624b0e7ce2ca56139 100644
--- a/dlls/urlmon/urlmon.spec
+++ b/dlls/urlmon/urlmon.spec
@@ -1,9 +1,6 @@
 name    urlmon
 type    win32
 
-import	ole32.dll
-import	ntdll.dll
-
 debug_channels (urlmon win32)
 
 1 stub CDLGetLongPathNameA
diff --git a/dlls/user/Makefile.in b/dlls/user/Makefile.in
index a9f5f0af41260ea81f6f721540e27b92b910d538..7bb922542c34040cae503bdd63d2fdc771e1b837 100644
--- a/dlls/user/Makefile.in
+++ b/dlls/user/Makefile.in
@@ -4,8 +4,9 @@ TOPOBJDIR = ../..
 SRCDIR    = @srcdir@
 VPATH     = @srcdir@
 MODULE    = user32.dll
+IMPORTS   = gdi32.dll advapi32.dll kernel32.dll ntdll.dll
 ALTNAMES  = user.exe keyboard.dll ddeml.dll display.dll mouse.dll
-IMPORTS   = gdi32.dll kernel32.dll ntdll.dll
+LDIMPORTS = gdi32.dll kernel32.dll ntdll.dll
 
 C_SRCS = \
 	bidi16.c \
diff --git a/dlls/user/tests/user32_test.spec b/dlls/user/tests/user32_test.spec
index 1f5b801e36daf4da31d10c82bc8dc0008bc62515..9afd03f177080054c0e5ce44a791ce44ee208127 100644
--- a/dlls/user/tests/user32_test.spec
+++ b/dlls/user/tests/user32_test.spec
@@ -1,9 +1,3 @@
 name    user32_test
 type    win32
 mode    cuiexe
-
-import user32.dll
-import gdi32.dll
-import advapi32.dll
-import kernel32.dll
-import ntdll.dll
diff --git a/dlls/user/user32.spec b/dlls/user/user32.spec
index e9edfb7879ed036ef7dba170f627d25cd4c8053c..3f1dab1f87f919dd28af19bd43ad837f8d848327 100644
--- a/dlls/user/user32.spec
+++ b/dlls/user/user32.spec
@@ -3,11 +3,6 @@ type	win32
 init	UserClientDllInitialize
 rsrc	resources/user32.res
 
-import	gdi32.dll
-import	advapi32.dll
-import	kernel32.dll
-import	ntdll.dll
-
 debug_channels (accel caret class clipboard combo comm cursor dc ddeml dialog
                 driver edit event graphics hook icon key keyboard listbox local
                 mdi menu message msg nonclient relay resource scroll shell static
diff --git a/dlls/version/Makefile.in b/dlls/version/Makefile.in
index 8c1129ee319f4a83fad8a430c91da246d927d937..37eda9e63e8d05f13ed71a3cff36e2acf050f25b 100644
--- a/dlls/version/Makefile.in
+++ b/dlls/version/Makefile.in
@@ -3,6 +3,7 @@ TOPOBJDIR = ../..
 SRCDIR    = @srcdir@
 VPATH     = @srcdir@
 MODULE    = version.dll
+IMPORTS   = lz32.dll kernel32.dll ntdll.dll
 ALTNAMES  = ver.dll
 EXTRALIBS = $(LIBUNICODE)
 
diff --git a/dlls/version/version.spec b/dlls/version/version.spec
index 7c4ab7959752b8da86ef02686320d76d91af1289..0853d9cacfc7ee9b6f7affab5cb342ee1a2d5335 100644
--- a/dlls/version/version.spec
+++ b/dlls/version/version.spec
@@ -1,10 +1,6 @@
 name version
 type win32
 
-import lz32.dll
-import kernel32.dll
-import ntdll.dll
-
 debug_channels (ver)
 
 @ stdcall GetFileVersionInfoA(str long long ptr) GetFileVersionInfoA
diff --git a/dlls/win32s/Makefile.in b/dlls/win32s/Makefile.in
index 444f6e74d37d23f6b0dee0b43627625c6c317f2d..aab0abb737cc35cace9b079d439b27ec0902d3e5 100644
--- a/dlls/win32s/Makefile.in
+++ b/dlls/win32s/Makefile.in
@@ -3,6 +3,7 @@ TOPOBJDIR = ../..
 SRCDIR    = @srcdir@
 VPATH     = @srcdir@
 MODULE    = w32skrnl.dll
+IMPORTS   = kernel32.dll ntdll.dll
 ALTNAMES  = w32sys.dll win32s16.dll
 
 LDDLLFLAGS = @LDDLLFLAGS@
diff --git a/dlls/win32s/w32skrnl.spec b/dlls/win32s/w32skrnl.spec
index 5c1ca53af97ae4658b95a44daedb371e360bc568..7fa7897f5d703bc51e4e7a315483296c74ed7696 100644
--- a/dlls/win32s/w32skrnl.spec
+++ b/dlls/win32s/w32skrnl.spec
@@ -1,9 +1,6 @@
 name	w32skrnl
 type	win32
 
-import	kernel32.dll
-import	ntdll.dll
-
 debug_channels (dll)
 
 1 stub _kSetEnvironmentVariable@8
diff --git a/dlls/winaspi/Makefile.in b/dlls/winaspi/Makefile.in
index af06db7a4ca0ffd380c4b7ab46da0b4924721873..31d3f701975abe872290c2d6023eb292804f70e6 100644
--- a/dlls/winaspi/Makefile.in
+++ b/dlls/winaspi/Makefile.in
@@ -3,6 +3,7 @@ TOPOBJDIR = ../..
 SRCDIR    = @srcdir@
 VPATH     = @srcdir@
 MODULE    = wnaspi32.dll
+IMPORTS   = advapi32.dll kernel32.dll ntdll.dll
 ALTNAMES  = winaspi.dll
 
 LDDLLFLAGS = @LDDLLFLAGS@
diff --git a/dlls/winaspi/wnaspi32.spec b/dlls/winaspi/wnaspi32.spec
index 289e1554f65570c24efcfa41faabb8cd1058608c..8c9303ba11f678fe817e8d8c649ddb3dcc20c302 100644
--- a/dlls/winaspi/wnaspi32.spec
+++ b/dlls/winaspi/wnaspi32.spec
@@ -2,10 +2,6 @@ name	wnaspi32
 type	win32
 init	WNASPI32_LibMain
 
-import	advapi32.dll
-import	kernel32.dll
-import	ntdll.dll
-
 debug_channels (aspi)
 
 # we have several ordinal clashes here, it seems...
diff --git a/dlls/winedos/Makefile.in b/dlls/winedos/Makefile.in
index 168e76b13c54ee4c0f0d15c3db4a3c3c7804d161..04e3959b9ea756e65bae6354ca3950e32249cc5d 100644
--- a/dlls/winedos/Makefile.in
+++ b/dlls/winedos/Makefile.in
@@ -4,6 +4,7 @@ SRCDIR    = @srcdir@
 VPATH     = @srcdir@
 MODULE    = winedos.dll
 IMPORTS   = user32.dll kernel32.dll ntdll.dll
+LDIMPORTS = user32.dll kernel32.dll ntdll.dll
 
 C_SRCS = \
 	dosaspi.c \
diff --git a/dlls/winedos/winedos.spec b/dlls/winedos/winedos.spec
index a494defcb104d30f0566389430c55fa642163af8..10dd26621c9875a58995483e4f7ba79dedb38dd5 100644
--- a/dlls/winedos/winedos.spec
+++ b/dlls/winedos/winedos.spec
@@ -2,10 +2,6 @@ name winedos
 type win32
 init DOSVM_Init
 
-import user32.dll
-import kernel32.dll
-import ntdll.dll
-
 debug_channels (aspi console ddraw int int21 int31 module relay)
 
 @ stdcall LoadDosExe(str long) MZ_LoadImage
diff --git a/dlls/wineps/Makefile.in b/dlls/wineps/Makefile.in
index 77c3a4bca238fbad8007a18553d10c00e1c1faf7..ddbdb2ee0be3e35521847bb43205f78fa1a51446 100644
--- a/dlls/wineps/Makefile.in
+++ b/dlls/wineps/Makefile.in
@@ -3,6 +3,7 @@ TOPOBJDIR = ../..
 SRCDIR    = @srcdir@
 VPATH     = @srcdir@
 MODULE    = wineps.dll
+IMPORTS   = user32.dll gdi32.dll winspool.drv advapi32.dll kernel32.dll ntdll.dll
 ALTNAMES  = wineps16.dll
 EXTRALIBS = @CUPSLIBS@
 EXTRAINCL = @FREETYPEINCL@
diff --git a/dlls/wineps/wineps.spec b/dlls/wineps/wineps.spec
index 6a8e41ed44724d6ac74d248ecd74e6b4faddce91..38715310e565040829994106522ce00ace313c42 100644
--- a/dlls/wineps/wineps.spec
+++ b/dlls/wineps/wineps.spec
@@ -3,13 +3,6 @@ type	win32
 init	PSDRV_Init
 rsrc	rsrc.res
 
-import	user32.dll
-import	gdi32.dll
-import	winspool.drv
-import	advapi32.dll
-import	kernel32.dll
-import	ntdll.dll
-
 debug_channels (psdrv)
 
 # GDI driver
diff --git a/dlls/wininet/Makefile.in b/dlls/wininet/Makefile.in
index f93ea96590204522bc2ea8311c2b0bffdd942483..7105c08131e3ca4da5c49bd52bb2e8731345d5b4 100644
--- a/dlls/wininet/Makefile.in
+++ b/dlls/wininet/Makefile.in
@@ -4,6 +4,7 @@ TOPOBJDIR = ../..
 SRCDIR    = @srcdir@
 VPATH     = @srcdir@
 MODULE    = wininet.dll
+IMPORTS   = shlwapi.dll user32.dll kernel32.dll ntdll.dll
 
 LDDLLFLAGS = @LDDLLFLAGS@
 SYMBOLFILE = $(MODULE).tmp.o
diff --git a/dlls/wininet/wininet.spec b/dlls/wininet/wininet.spec
index 1189d7af6c292f3b3d685c2aab02312c36016efe..87faaacb237ff55eca3708091f6310c6897e3a03 100644
--- a/dlls/wininet/wininet.spec
+++ b/dlls/wininet/wininet.spec
@@ -2,11 +2,6 @@ name    wininet
 type    win32
 init    WININET_LibMain
 
-import	shlwapi.dll
-import	user32.dll
-import	kernel32.dll
-import	ntdll.dll
-
 debug_channels (wininet)
 
 @ stub InternetInitializeAutoProxyDll
diff --git a/dlls/winmm/Makefile.in b/dlls/winmm/Makefile.in
index a9ec514edd34194e222bf65427694aa970c818db..e51ba7024f14acd87c7081ad9bee8f0c4adfa754 100644
--- a/dlls/winmm/Makefile.in
+++ b/dlls/winmm/Makefile.in
@@ -4,6 +4,7 @@ TOPOBJDIR = ../..
 SRCDIR    = @srcdir@
 VPATH     = @srcdir@
 MODULE    = winmm.dll
+IMPORTS   = user32.dll advapi32.dll kernel32.dll ntdll.dll
 ALTNAMES  = mmsystem.dll sound.dll
 
 LDDLLFLAGS = @LDDLLFLAGS@
diff --git a/dlls/winmm/joystick/Makefile.in b/dlls/winmm/joystick/Makefile.in
index 0f967f24fb75832a3a9dac6035130eefd6aea020..d1b7107370fb9619dad5480b45b627150e1d225f 100644
--- a/dlls/winmm/joystick/Makefile.in
+++ b/dlls/winmm/joystick/Makefile.in
@@ -3,6 +3,7 @@ TOPOBJDIR = ../../..
 SRCDIR    = @srcdir@
 VPATH     = @srcdir@
 MODULE    = joystick.drv
+IMPORTS   = winmm.dll user32.dll ntdll.dll
 
 LDDLLFLAGS = @LDDLLFLAGS@
 SYMBOLFILE = $(MODULE).tmp.o
diff --git a/dlls/winmm/joystick/joystick.drv.spec b/dlls/winmm/joystick/joystick.drv.spec
index 11be05e3d26408a3202537f283c67bc2e07af874..655886a6473ae4413aad78c895c74dca1c53911e 100644
--- a/dlls/winmm/joystick/joystick.drv.spec
+++ b/dlls/winmm/joystick/joystick.drv.spec
@@ -2,10 +2,6 @@ name joystick
 file joystick.drv
 type win32
 
-import winmm.dll
-import user32.dll
-import ntdll.dll
-
 debug_channels (joystick)
 
 @ stdcall DriverProc(long long long long long) JSTCK_DriverProc
diff --git a/dlls/winmm/mcianim/Makefile.in b/dlls/winmm/mcianim/Makefile.in
index b328e80484700a1081974b2f61bd777499ebb055..a1e8e39ff6d1c8f0328b9337f70cc4317adb5c1f 100644
--- a/dlls/winmm/mcianim/Makefile.in
+++ b/dlls/winmm/mcianim/Makefile.in
@@ -3,6 +3,7 @@ TOPOBJDIR = ../../..
 SRCDIR    = @srcdir@
 VPATH     = @srcdir@
 MODULE    = mcianim.drv
+IMPORTS   = winmm.dll user32.dll kernel32.dll ntdll.dll
 
 LDDLLFLAGS = @LDDLLFLAGS@
 SYMBOLFILE = $(MODULE).tmp.o
diff --git a/dlls/winmm/mcianim/mcianim.drv.spec b/dlls/winmm/mcianim/mcianim.drv.spec
index 902d935b2dea7c24dc152d48a0a5c4e03252819b..9d28dab7ee78e19a1d60fb3556f110ac9a9807ea 100644
--- a/dlls/winmm/mcianim/mcianim.drv.spec
+++ b/dlls/winmm/mcianim/mcianim.drv.spec
@@ -2,11 +2,6 @@ name mcianim
 file mcianim.drv
 type win32
 
-import winmm.dll
-import user32.dll
-import kernel32.dll
-import	ntdll.dll
-
 debug_channels (mcianim)
 
 @ stdcall DriverProc(long long long long long) MCIANIM_DriverProc
diff --git a/dlls/winmm/mciavi/Makefile.in b/dlls/winmm/mciavi/Makefile.in
index 54cfefa095c99f089be953b77885d5f132276671..e5c49f4069c71208fddaf6e8d8043e2de0f2fedd 100644
--- a/dlls/winmm/mciavi/Makefile.in
+++ b/dlls/winmm/mciavi/Makefile.in
@@ -3,6 +3,7 @@ TOPOBJDIR = ../../..
 SRCDIR    = @srcdir@
 VPATH     = @srcdir@
 MODULE    = mciavi.drv
+IMPORTS   = msvfw32.dll winmm.dll user32.dll gdi32.dll kernel32.dll ntdll.dll
 
 LDDLLFLAGS = @LDDLLFLAGS@
 SYMBOLFILE = $(MODULE).tmp.o
diff --git a/dlls/winmm/mciavi/mciavi.drv.spec b/dlls/winmm/mciavi/mciavi.drv.spec
index b9178066b37d594a9f672ecb2f4bbf5cf69fb32a..2f35fe356ec5a4987f7da17ae8d74151e48557b9 100644
--- a/dlls/winmm/mciavi/mciavi.drv.spec
+++ b/dlls/winmm/mciavi/mciavi.drv.spec
@@ -4,13 +4,6 @@ type win32
 init MCIAVI_LibMain
 rsrc mciavi_res.res
 
-import msvfw32.dll
-import winmm.dll
-import user32.dll
-import gdi32.dll
-import kernel32.dll
-import ntdll.dll
-
 debug_channels (mciavi)
 
 @ stdcall DriverProc(long long long long long) MCIAVI_DriverProc
diff --git a/dlls/winmm/mcicda/Makefile.in b/dlls/winmm/mcicda/Makefile.in
index 9b1cb25b164ee013849635a5219769cd29c04eb7..2a38a5dc5de63b32a95fb2de382eff3f2ccdca85 100644
--- a/dlls/winmm/mcicda/Makefile.in
+++ b/dlls/winmm/mcicda/Makefile.in
@@ -3,6 +3,8 @@ TOPOBJDIR = ../../..
 SRCDIR    = @srcdir@
 VPATH     = @srcdir@
 MODULE    = mcicda.drv
+IMPORTS   = winmm.dll kernel32.dll ntdll.dll
+DELAYIMPORTS = user32.dll
 
 LDDLLFLAGS = @LDDLLFLAGS@
 SYMBOLFILE = $(MODULE).tmp.o
diff --git a/dlls/winmm/mcicda/mcicda.drv.spec b/dlls/winmm/mcicda/mcicda.drv.spec
index a615106e7f25a0543c7e83c4683280f948d54d79..529453719d8c244f6612346a3ea346e6db7b869d 100644
--- a/dlls/winmm/mcicda/mcicda.drv.spec
+++ b/dlls/winmm/mcicda/mcicda.drv.spec
@@ -2,11 +2,6 @@ name mcicda
 file mcicda.drv
 type win32
 
-import winmm.dll
-import -delay user32.dll
-import kernel32.dll
-import ntdll.dll
-
 debug_channels (mcicda)
 
 @ stdcall DriverProc(long long long long long) MCICDA_DriverProc
diff --git a/dlls/winmm/mciseq/Makefile.in b/dlls/winmm/mciseq/Makefile.in
index e55a1e7e2ad69335e4f6ea9bc4b313237800737d..f5cb6e4bb6476908fecd1ee59f636bd09e458c23 100644
--- a/dlls/winmm/mciseq/Makefile.in
+++ b/dlls/winmm/mciseq/Makefile.in
@@ -3,6 +3,8 @@ TOPOBJDIR = ../../..
 SRCDIR    = @srcdir@
 VPATH     = @srcdir@
 MODULE    = mciseq.drv
+IMPORTS   = winmm.dll kernel32.dll ntdll.dll
+DELAYIMPORTS = user32.dll
 
 LDDLLFLAGS = @LDDLLFLAGS@
 SYMBOLFILE = $(MODULE).tmp.o
diff --git a/dlls/winmm/mciseq/mciseq.drv.spec b/dlls/winmm/mciseq/mciseq.drv.spec
index 8150e25fc594faca5bf3b35441f61a127325e7d2..3377010b2db9b13efa5e53a76200262d85a1b904 100644
--- a/dlls/winmm/mciseq/mciseq.drv.spec
+++ b/dlls/winmm/mciseq/mciseq.drv.spec
@@ -2,11 +2,6 @@ name mciseq
 file mciseq.drv
 type win32
 
-import winmm.dll
-import -delay user32.dll
-import kernel32.dll
-import ntdll.dll
-
 debug_channels (mcimidi)
 
 @ stdcall DriverProc(long long long long long) MCIMIDI_DriverProc
diff --git a/dlls/winmm/mciwave/Makefile.in b/dlls/winmm/mciwave/Makefile.in
index 2fd61487d87fb918858273139fc00893102fe14f..fd09d6e590ea177ea6ccfd5b4feb205d17eed5ce 100644
--- a/dlls/winmm/mciwave/Makefile.in
+++ b/dlls/winmm/mciwave/Makefile.in
@@ -3,6 +3,8 @@ TOPOBJDIR = ../../..
 SRCDIR    = @srcdir@
 VPATH     = @srcdir@
 MODULE    = mciwave.drv
+IMPORTS   = winmm.dll kernel32.dll ntdll.dll
+DELAYIMPORTS = user32.dll
 
 LDDLLFLAGS = @LDDLLFLAGS@
 SYMBOLFILE = $(MODULE).tmp.o
diff --git a/dlls/winmm/mciwave/mciwave.drv.spec b/dlls/winmm/mciwave/mciwave.drv.spec
index 8ca402e387904bc12353728fda7d7b6898e4f9b2..7b3147d21c1f1c29edcd8ee9e8f263329c4b1dd6 100644
--- a/dlls/winmm/mciwave/mciwave.drv.spec
+++ b/dlls/winmm/mciwave/mciwave.drv.spec
@@ -2,11 +2,6 @@ name mciwave
 file mciwave.drv
 type win32
 
-import winmm.dll
-import -delay user32.dll
-import kernel32.dll
-import ntdll.dll
-
 debug_channels (mciwave)
 
 @ stdcall DriverProc(long long long long long) MCIWAVE_DriverProc
diff --git a/dlls/winmm/midimap/Makefile.in b/dlls/winmm/midimap/Makefile.in
index 292e59d675b4f36899aa12a6834143a18e426a14..301d73023b73bcd82c0dd089420a15a6ef11bf56 100644
--- a/dlls/winmm/midimap/Makefile.in
+++ b/dlls/winmm/midimap/Makefile.in
@@ -3,6 +3,7 @@ TOPOBJDIR = ../../..
 SRCDIR    = @srcdir@
 VPATH     = @srcdir@
 MODULE    = midimap.drv
+IMPORTS   = winmm.dll user32.dll advapi32.dll kernel32.dll ntdll.dll
 
 LDDLLFLAGS = @LDDLLFLAGS@
 SYMBOLFILE = $(MODULE).tmp.o
diff --git a/dlls/winmm/midimap/midimap.drv.spec b/dlls/winmm/midimap/midimap.drv.spec
index 9749fb898440c0452e155d30317f6c72fa1a9ae3..454e032b80dc39113b946e7bae53810d362a3e4b 100644
--- a/dlls/winmm/midimap/midimap.drv.spec
+++ b/dlls/winmm/midimap/midimap.drv.spec
@@ -2,12 +2,6 @@ name midimap
 file midimap.drv
 type win32
 
-import winmm.dll
-import user32.dll
-import advapi32.dll
-import kernel32.dll
-import	ntdll.dll
-
 debug_channels (msacm)
 
 @ stdcall DriverProc(long long long long long) MIDIMAP_DriverProc
diff --git a/dlls/winmm/wavemap/Makefile.in b/dlls/winmm/wavemap/Makefile.in
index 727b6e2a8206c0a1cf4107f7b50afa650959e9e1..8511dbb29baec8c9e9013c366a77ca76fb50032a 100644
--- a/dlls/winmm/wavemap/Makefile.in
+++ b/dlls/winmm/wavemap/Makefile.in
@@ -3,6 +3,7 @@ TOPOBJDIR = ../../..
 SRCDIR    = @srcdir@
 VPATH     = @srcdir@
 MODULE    = msacm.drv
+IMPORTS   = msacm32.dll winmm.dll user32.dll kernel32.dll ntdll.dll
 
 LDDLLFLAGS = @LDDLLFLAGS@
 SYMBOLFILE = $(MODULE).tmp.o
diff --git a/dlls/winmm/wavemap/msacm.drv.spec b/dlls/winmm/wavemap/msacm.drv.spec
index 8d918711fe8ddc8bf8d805711f86630fd865ad6f..c573e40313d47a29d009fbf9c263b891e8d3b3fd 100644
--- a/dlls/winmm/wavemap/msacm.drv.spec
+++ b/dlls/winmm/wavemap/msacm.drv.spec
@@ -2,12 +2,6 @@ name msacmmap
 file msacm.drv
 type win32
 
-import msacm32.dll
-import winmm.dll
-import user32.dll
-import kernel32.dll
-import ntdll.dll
-
 debug_channels (msacm)
 
 @ stdcall DriverProc(long long long long long) WAVEMAP_DriverProc
diff --git a/dlls/winmm/winearts/Makefile.in b/dlls/winmm/winearts/Makefile.in
index 1f1538ca7d8ad8432c8720b1550db65098156dee..c6650411ab872fa92062040b17382838edab93df 100644
--- a/dlls/winmm/winearts/Makefile.in
+++ b/dlls/winmm/winearts/Makefile.in
@@ -3,6 +3,7 @@ TOPOBJDIR = ../../..
 SRCDIR    = @srcdir@
 VPATH     = @srcdir@
 MODULE    = winearts.drv
+IMPORTS   = winmm.dll user32.dll kernel32.dll ntdll.dll
 EXTRADEFS = @ARTSINCL@
 EXTRALIBS = @ARTSLIBS@
 
diff --git a/dlls/winmm/winearts/winearts.drv.spec b/dlls/winmm/winearts/winearts.drv.spec
index 80ffa582b64af7b46bd29c3ee928754eb941eb83..b89c8fad36d163344c59fbbf0a3d290eb7c2083c 100644
--- a/dlls/winmm/winearts/winearts.drv.spec
+++ b/dlls/winmm/winearts/winearts.drv.spec
@@ -2,11 +2,6 @@ name winearts
 file winearts.drv
 type win32
 
-import winmm.dll
-import user32.dll
-import kernel32.dll
-import ntdll.dll
-
 debug_channels (wave)
 
 @ stdcall DriverProc(long long long long long) ARTS_DriverProc
diff --git a/dlls/winmm/wineoss/Makefile.in b/dlls/winmm/wineoss/Makefile.in
index 05969da6b95c0748a2fe046acc7000b1b15def4a..c501135532bfa9d3ef13b0f0eca2c39a62ffef91 100644
--- a/dlls/winmm/wineoss/Makefile.in
+++ b/dlls/winmm/wineoss/Makefile.in
@@ -3,6 +3,7 @@ TOPOBJDIR = ../../..
 SRCDIR    = @srcdir@
 VPATH     = @srcdir@
 MODULE    = wineoss.drv
+IMPORTS   = winmm.dll user32.dll kernel32.dll ntdll.dll
 
 LDDLLFLAGS = @LDDLLFLAGS@
 SYMBOLFILE = $(MODULE).tmp.o
diff --git a/dlls/winmm/wineoss/wineoss.drv.spec b/dlls/winmm/wineoss/wineoss.drv.spec
index 935f55298d9401a85445b782d48ebdff6bb4653d..2171e02f88c8873086a21795bc3194ab7e5490dc 100644
--- a/dlls/winmm/wineoss/wineoss.drv.spec
+++ b/dlls/winmm/wineoss/wineoss.drv.spec
@@ -2,11 +2,6 @@ name wineoss
 file wineoss.drv
 type win32
 
-import winmm.dll
-import user32.dll
-import kernel32.dll
-import	ntdll.dll
-
 debug_channels (midi mmaux wave)
 
   1 stdcall DriverProc(long long long long long) OSS_DriverProc
diff --git a/dlls/winmm/winmm.spec b/dlls/winmm/winmm.spec
index 30a7f54df6f635d2fe39e155f832c56c755aaed9..8771ac6bfae78bd078087f639bb5c0309904222f 100644
--- a/dlls/winmm/winmm.spec
+++ b/dlls/winmm/winmm.spec
@@ -3,11 +3,6 @@ type win32
 init WINMM_LibMain
 rsrc winmm_res.res
 
-import user32.dll
-import advapi32.dll
-import kernel32.dll
-import ntdll.dll
-
 debug_channels (driver mci mmio mmsys mmtime sound)
 
 # ordinal exports
diff --git a/dlls/winnls/Makefile.in b/dlls/winnls/Makefile.in
index d99fe41140f653aec4b909d70cc5e6d066c336b8..be6ff09a913c674d4998bba428e93fe1126fff1d 100644
--- a/dlls/winnls/Makefile.in
+++ b/dlls/winnls/Makefile.in
@@ -3,6 +3,7 @@ TOPOBJDIR = ../..
 SRCDIR    = @srcdir@
 VPATH     = @srcdir@
 MODULE    = winnls32.dll
+IMPORTS   = kernel32.dll ntdll.dll
 ALTNAMES  = winnls.dll
 
 LDDLLFLAGS = @LDDLLFLAGS@
diff --git a/dlls/winnls/winnls32.spec b/dlls/winnls/winnls32.spec
index e5302fc539dc1efedd74aca153078032e65bc4d7..b452a054fc58d46a5461867224be043e0b837a06 100644
--- a/dlls/winnls/winnls32.spec
+++ b/dlls/winnls/winnls32.spec
@@ -1,9 +1,6 @@
 name	winnls32
 type	win32
 
-import	kernel32.dll
-import	ntdll.dll
-
 1  stub WINNLS32EnableIME
 2  stub WINNLS32GetEnableStatus
 3  stub WINNLS32GetIMEHotKey
diff --git a/dlls/winsock/Makefile.in b/dlls/winsock/Makefile.in
index 037d87c4b33c0b20dd01fbfa9e8bc4898ef17301..5017d89e517e94d73b088cb3e4c87fe297a1d16f 100644
--- a/dlls/winsock/Makefile.in
+++ b/dlls/winsock/Makefile.in
@@ -4,6 +4,7 @@ TOPOBJDIR = ../..
 SRCDIR    = @srcdir@
 VPATH     = @srcdir@
 MODULE    = ws2_32.dll
+IMPORTS   = user32.dll kernel32.dll ntdll.dll
 ALTNAMES  = winsock.dll
 
 LDDLLFLAGS = @LDDLLFLAGS@
diff --git a/dlls/winsock/tests/ws2_32_test.spec b/dlls/winsock/tests/ws2_32_test.spec
index efd7bdc5404d51862134665e8d56982ed9eace63..91051180fb27f4579a30e84b1884e9cd3b86e42e 100644
--- a/dlls/winsock/tests/ws2_32_test.spec
+++ b/dlls/winsock/tests/ws2_32_test.spec
@@ -1,7 +1,3 @@
 name	ws2_32_test
 type	win32
 mode	cuiexe
-
-import ws2_32.dll
-import kernel32.dll
-import ntdll.dll
diff --git a/dlls/winsock/ws2_32.spec b/dlls/winsock/ws2_32.spec
index bf6e5132e84995eb8ce9093512e967a29f7c8448..ca2713701d860c6ab4fb34e67104892402261bae 100644
--- a/dlls/winsock/ws2_32.spec
+++ b/dlls/winsock/ws2_32.spec
@@ -6,10 +6,6 @@ name ws2_32
 type win32
 init WS_LibMain
 
-import user32.dll
-import kernel32.dll
-import ntdll.dll
-
 debug_channels (winsock)
 
 #  EXPORTS ***********
diff --git a/dlls/winspool/Makefile.in b/dlls/winspool/Makefile.in
index 5bcace2056c8af55a540eaa343f860f168d0355d..c0448f45b51814cc545050064b8801dcd6f1f025 100644
--- a/dlls/winspool/Makefile.in
+++ b/dlls/winspool/Makefile.in
@@ -4,6 +4,7 @@ TOPOBJDIR = ../..
 SRCDIR    = @srcdir@
 VPATH     = @srcdir@
 MODULE    = winspool.drv
+IMPORTS   = advapi32.dll kernel32.dll ntdll.dll
 EXTRALIBS = @CUPSLIBS@
 
 LDDLLFLAGS = @LDDLLFLAGS@
diff --git a/dlls/winspool/winspool.drv.spec b/dlls/winspool/winspool.drv.spec
index 50322a2ff73219ec3bb27b250c37191c5e153039..e20f8b9df7fc3c3ac97defaa4b2eb94cebb4d030 100644
--- a/dlls/winspool/winspool.drv.spec
+++ b/dlls/winspool/winspool.drv.spec
@@ -3,10 +3,6 @@ type	win32
 file	winspool.drv
 init	WINSPOOL_EntryPoint
 
-import	advapi32.dll
-import	kernel32.dll
-import	ntdll.dll
-
 debug_channels (winspool)
 
 100 stub @
diff --git a/dlls/wintrust/Makefile.in b/dlls/wintrust/Makefile.in
index 384a5f3253cb4c0b363233871356971e15efa6b8..7bf48d7e1c9e285d071e6449f0e074e811b91c90 100644
--- a/dlls/wintrust/Makefile.in
+++ b/dlls/wintrust/Makefile.in
@@ -3,6 +3,7 @@ TOPOBJDIR = ../..
 SRCDIR    = @srcdir@
 VPATH     = @srcdir@
 MODULE    = wintrust.dll
+IMPORTS   = ntdll.dll
 
 LDDLLFLAGS = @LDDLLFLAGS@
 SYMBOLFILE = $(MODULE).tmp.o
diff --git a/dlls/wintrust/wintrust.spec b/dlls/wintrust/wintrust.spec
index 781efd998d2461711ea3fc8c1af01491c2425bdc..cdf11e0cd71f07fd7f71f6961b3b3f41187d32b4 100644
--- a/dlls/wintrust/wintrust.spec
+++ b/dlls/wintrust/wintrust.spec
@@ -1,8 +1,6 @@
 name	wintrust
 type	win32
 
-import ntdll.dll
-
 debug_channels (win32)
 
 @ stdcall WinVerifyTrust(long ptr ptr) WinVerifyTrust
diff --git a/dlls/wow32/Makefile.in b/dlls/wow32/Makefile.in
index f68bcdc6d7e4efc2ce8a21400018bea28bad20a7..1347ec96ba1195ebdcdad77d03928ce5956b7405 100644
--- a/dlls/wow32/Makefile.in
+++ b/dlls/wow32/Makefile.in
@@ -3,6 +3,7 @@ TOPOBJDIR = ../..
 SRCDIR    = @srcdir@
 VPATH     = @srcdir@
 MODULE    = wow32.dll
+IMPORTS   = kernel32.dll
 
 LDDLLFLAGS = @LDDLLFLAGS@
 SYMBOLFILE = $(MODULE).tmp.o
diff --git a/dlls/wow32/wow32.spec b/dlls/wow32/wow32.spec
index 7a89059db0a1a91fe0b05695d2a1d9d366ae0eeb..e3012665ac85a6365f2a15ce09f1019274d83c9e 100644
--- a/dlls/wow32/wow32.spec
+++ b/dlls/wow32/wow32.spec
@@ -1,8 +1,6 @@
 name	wow32
 type	win32
 
-import kernel32.dll
-
 # ordinal exports
 1 forward WOWGetDescriptor kernel32.K32WOWGetDescriptor
 
diff --git a/dlls/wsock32/Makefile.in b/dlls/wsock32/Makefile.in
index c8accb8ae5745ad3aae20b2ef51d8bcbe9d40891..60874df2da233e25947d01db8f27631426c56161 100644
--- a/dlls/wsock32/Makefile.in
+++ b/dlls/wsock32/Makefile.in
@@ -3,6 +3,7 @@ TOPOBJDIR = ../..
 SRCDIR    = @srcdir@
 VPATH     = @srcdir@
 MODULE    = wsock32.dll
+IMPORTS   = ws2_32.dll kernel32.dll ntdll.dll
 
 LDDLLFLAGS = @LDDLLFLAGS@
 SYMBOLFILE = $(MODULE).tmp.o
diff --git a/dlls/wsock32/wsock32.spec b/dlls/wsock32/wsock32.spec
index 08c00ad7e9bc0592444c2056ee6e76096e19f626..308c7dfdc4a3697340c4556817a6be251df7938f 100644
--- a/dlls/wsock32/wsock32.spec
+++ b/dlls/wsock32/wsock32.spec
@@ -1,10 +1,6 @@
 name	wsock32
 type	win32
 
-import	ws2_32.dll
-import	kernel32.dll
-import	ntdll.dll
-
 debug_channels (winsock)
 
   1 forward accept ws2_32.accept
diff --git a/dlls/x11drv/Makefile.in b/dlls/x11drv/Makefile.in
index a3659ee0fff417f903494191195531227b62b63e..0d502a884a86bef328c4792a6191a99cfd2f05b2 100644
--- a/dlls/x11drv/Makefile.in
+++ b/dlls/x11drv/Makefile.in
@@ -4,8 +4,9 @@ TOPOBJDIR = ../..
 SRCDIR    = @srcdir@
 VPATH     = @srcdir@
 MODULE    = x11drv.dll
+IMPORTS   = user32.dll gdi32.dll advapi32.dll kernel32.dll ntdll.dll
 EXTRALIBS = $(LIBTSX11) $(X_LIBS) $(XLIB)
-IMPORTS   = user32.dll gdi32.dll kernel32.dll
+LDIMPORTS = user32.dll gdi32.dll kernel32.dll
 
 C_SRCS = \
 	desktop.c \
diff --git a/dlls/x11drv/x11drv.spec b/dlls/x11drv/x11drv.spec
index 06d99217734eecf7dd0fe04c520b06b160b3a592..34a24336a685d5627a18985d1af2240cfbdd7da9 100644
--- a/dlls/x11drv/x11drv.spec
+++ b/dlls/x11drv/x11drv.spec
@@ -2,12 +2,6 @@ name	x11drv
 type	win32
 init	X11DRV_Init
 
-import	user32.dll
-import	gdi32.dll
-import	advapi32.dll
-import	kernel32.dll
-import	ntdll.dll
-
 debug_channels (bitblt bitmap clipboard cursor dinput event font gdi graphics
                 key keyboard opengl palette text win x11drv xrender)
 
diff --git a/libtest/Makefile.in b/libtest/Makefile.in
index 97366aadc4ae3bff609f0277fa919d28f06d2bf4..2a41a255b9380a2bcb0f6e3e290c5dcf8d5e2439 100644
--- a/libtest/Makefile.in
+++ b/libtest/Makefile.in
@@ -38,47 +38,47 @@ all: $(PROGRAMS) $(PROGRAMS:%=%.so)
 @MAKE_RULES@
 
 expand.spec.c: expand.spec expand.o $(WINEBUILD)
-	$(LDPATH) $(WINEBUILD) @DLLFLAGS@ -L $(DLLDIR) -sym expand.o -o expand.spec.c -spec expand.spec
+	$(LDPATH) $(WINEBUILD) @DLLFLAGS@ -sym expand.o -o expand.spec.c -spec expand.spec -L$(DLLDIR) -llz32.dll -lkernel32.dll -lntdll.dll
 expand.so: expand.o expand.spec.o
 	$(LDSHARED) $(LDDLLFLAGS) -o expand.so $+ $(ALL_LIBS)
 
 hello.spec.c: hello.spec hello.o $(WINEBUILD)
-	$(LDPATH) $(WINEBUILD) @DLLFLAGS@ -L $(DLLDIR) -sym hello.o -o hello.spec.c -spec hello.spec
+	$(LDPATH) $(WINEBUILD) @DLLFLAGS@ -sym hello.o -o hello.spec.c -spec hello.spec -L$(DLLDIR) -luser32.dll -lgdi32.dll -lkernel32.dll -lntdll.dll
 hello.so: hello.o hello.spec.o
 	$(LDSHARED) $(LDDLLFLAGS) -o hello.so $+ $(ALL_LIBS)
 
 hello2.spec.c: hello2.spec hello2.o $(WINEBUILD)
-	$(LDPATH) $(WINEBUILD) @DLLFLAGS@ -L $(DLLDIR) -sym hello2.o -o hello2.spec.c -spec hello2.spec
+	$(LDPATH) $(WINEBUILD) @DLLFLAGS@ -sym hello2.o -o hello2.spec.c -spec hello2.spec -L$(DLLDIR) -luser32.dll -lkernel32.dll -lntdll.dll
 hello2.so: hello2.o hello2.spec.o
 	$(LDSHARED) $(LDDLLFLAGS) -o hello2.so $+ $(ALL_LIBS)
 
 hello3.spec.c: hello3.spec hello3.o hello3res.res $(WINEBUILD)
-	$(LDPATH) $(WINEBUILD) @DLLFLAGS@ -L $(DLLDIR) -sym hello3.o -o hello3.spec.c -spec hello3.spec
+	$(LDPATH) $(WINEBUILD) @DLLFLAGS@ -sym hello3.o -o hello3.spec.c -spec hello3.spec -L$(DLLDIR) -lcomdlg32.dll -luser32.dll -lgdi32.dll -lkernel32.dll -lntdll.dll
 hello3.so: hello3.o hello3.spec.o
 	$(LDSHARED) $(LDDLLFLAGS) -o hello3.so $+ $(ALL_LIBS)
 
 hello4.spec.c: hello4.spec hello4.o $(WINEBUILD)
-	$(LDPATH) $(WINEBUILD) @DLLFLAGS@ -L $(DLLDIR) -sym hello4.o -o hello4.spec.c -spec hello4.spec
+	$(LDPATH) $(WINEBUILD) @DLLFLAGS@ -sym hello4.o -o hello4.spec.c -spec hello4.spec -L$(DLLDIR) -luser32.dll -lgdi32.dll -lkernel32.dll -lntdll.dll
 hello4.so: hello4.o hello4.spec.o
 	$(LDSHARED) $(LDDLLFLAGS) -o hello4.so $+ $(ALL_LIBS)
 
 hello5.spec.c: hello5.spec hello5.o $(WINEBUILD)
-	$(LDPATH) $(WINEBUILD) @DLLFLAGS@ -L $(DLLDIR) -sym hello5.o -o hello5.spec.c -spec hello5.spec
+	$(LDPATH) $(WINEBUILD) @DLLFLAGS@ -sym hello5.o -o hello5.spec.c -spec hello5.spec -L$(DLLDIR) -lkernel32.dll -lntdll.dll
 hello5.so: hello5.o hello5.spec.o
 	$(LDSHARED) $(LDDLLFLAGS) -o hello5.so $+ $(ALL_LIBS)
 
 new.spec.c: new.spec new.o $(WINEBUILD)
-	$(LDPATH) $(WINEBUILD) @DLLFLAGS@ -L $(DLLDIR) -sym new.o -o new.spec.c -spec new.spec
+	$(LDPATH) $(WINEBUILD) @DLLFLAGS@ -sym new.o -o new.spec.c -spec new.spec -L$(DLLDIR) -luser32.dll -lgdi32.dll -lkernel32.dll -lntdll.dll
 new.so: new.o new.spec.o
 	$(LDSHARED) $(LDDLLFLAGS) -o new.so $+ $(ALL_LIBS)
 
 rolex.spec.c: rolex.spec rolex.o $(WINEBUILD)
-	$(LDPATH) $(WINEBUILD) @DLLFLAGS@ -L $(DLLDIR) -sym rolex.o -o rolex.spec.c -spec rolex.spec
+	$(LDPATH) $(WINEBUILD) @DLLFLAGS@ -sym rolex.o -o rolex.spec.c -spec rolex.spec -L$(DLLDIR) -luser32.dll -lgdi32.dll -lkernel32.dll -lntdll.dll
 rolex.so: rolex.o rolex.spec.o
 	$(LDSHARED) $(LDDLLFLAGS) -o rolex.so $+ $(ALL_LIBS)
 
 volinfo.spec.c: volinfo.spec volinfo.o $(WINEBUILD)
-	$(LDPATH) $(WINEBUILD) @DLLFLAGS@ -L $(DLLDIR) -sym volinfo.o -o volinfo.spec.c -spec volinfo.spec
+	$(LDPATH) $(WINEBUILD) @DLLFLAGS@ -sym volinfo.o -o volinfo.spec.c -spec volinfo.spec -L$(DLLDIR) -lkernel32.dll -lntdll.dll
 volinfo.so: volinfo.o volinfo.spec.o
 	$(LDSHARED) $(LDDLLFLAGS) -o volinfo.so $+ $(ALL_LIBS)
 
@@ -86,7 +86,7 @@ $(PROGRAMS):
 	$(LN_S) $(TOPOBJDIR)/wine $@
 
 $(PROGRAMS:%=%.so/_checklink_): $(PROGRAMS:%=%.so)
-	$(CC) -o checklink $(TOPSRCDIR)/library/checklink.c `dirname $@` $(ALL_LIBS) && $(RM) checklink
+	$(CC) -o checklink $(TOPSRCDIR)/library/checklink.c `dirname $@` && $(RM) checklink
 
 checklink:: $(PROGRAMS:%=%.so/_checklink_)
 
diff --git a/libtest/expand.spec b/libtest/expand.spec
index a9f4513a10d4ddac20823de2982c903e171df44d..a0c73c0094da18320b713359457aea7ef14b60a2 100644
--- a/libtest/expand.spec
+++ b/libtest/expand.spec
@@ -1,7 +1,3 @@
 name	expand
 mode	guiexe
 type	win32
-
-import	lz32.dll
-import	kernel32.dll
-import	ntdll.dll
diff --git a/libtest/hello.spec b/libtest/hello.spec
index a42049cd8f7264dd8817d2c9f43196663d574d38..fcda0d7a4e7eb792898ad5bbbb6a54e031d5cf96 100644
--- a/libtest/hello.spec
+++ b/libtest/hello.spec
@@ -1,8 +1,3 @@
 name	hello
 mode	guiexe
 type	win32
-
-import	user32.dll
-import	gdi32.dll
-import	kernel32.dll
-import	ntdll.dll
diff --git a/libtest/hello2.spec b/libtest/hello2.spec
index 56568eec8fdcd8f615ca70bdd4aa6f85841c641e..aaecc3ede37a22257715b0a0f39d15db3a7008fe 100644
--- a/libtest/hello2.spec
+++ b/libtest/hello2.spec
@@ -1,7 +1,3 @@
 name	hello2
 mode	guiexe
 type	win32
-
-import	user32.dll
-import	kernel32.dll
-import	ntdll.dll
diff --git a/libtest/hello3.spec b/libtest/hello3.spec
index 38546b48f2c5761740b42029bbfe42d3798f8904..272ba4f1093f8d86de242169d15891ee817bfc20 100644
--- a/libtest/hello3.spec
+++ b/libtest/hello3.spec
@@ -2,9 +2,3 @@ name	hello3
 mode	guiexe
 type	win32
 rsrc	hello3res.res
-
-import	comdlg32.dll
-import	user32.dll
-import	gdi32.dll
-import	kernel32.dll
-import	ntdll.dll
diff --git a/libtest/hello4.spec b/libtest/hello4.spec
index 9c34f0031035461705d8e7a4143e2403a177b5a4..b19a9be117e316c3ce937a7ed65de0a9898eda79 100644
--- a/libtest/hello4.spec
+++ b/libtest/hello4.spec
@@ -1,8 +1,3 @@
 name	hello4
 mode	guiexe
 type	win32
-
-import	user32.dll
-import	gdi32.dll
-import	kernel32.dll
-import	ntdll.dll
diff --git a/libtest/hello5.spec b/libtest/hello5.spec
index 620b887f9e64bd25e46e29c1b6354b085b4f4b15..04c83790e90799609bb69aeeb4404fef1273d633 100644
--- a/libtest/hello5.spec
+++ b/libtest/hello5.spec
@@ -1,7 +1,3 @@
 name	hello5
 mode	guiexe
 type	win32
-
-import	kernel32.dll
-import	ntdll.dll
-
diff --git a/libtest/new.spec b/libtest/new.spec
index caa2d2eb50d6085889e4288dd01b78ee7615978b..36e492c7dd76adcb83a814ef602ab0f2e938c1d4 100644
--- a/libtest/new.spec
+++ b/libtest/new.spec
@@ -1,8 +1,3 @@
 name	new
 mode	guiexe
 type	win32
-
-import	user32.dll
-import	gdi32.dll
-import	kernel32.dll
-import	ntdll.dll
diff --git a/libtest/rolex.spec b/libtest/rolex.spec
index 00d6fce61cc0935c760e2324648b50b5d4fe3e69..85adaefc5ea85e127053471ebc0014d6890841e1 100644
--- a/libtest/rolex.spec
+++ b/libtest/rolex.spec
@@ -1,8 +1,3 @@
 name	rolex
 mode	guiexe
 type	win32
-
-import	user32.dll
-import	gdi32.dll
-import	kernel32.dll
-import	ntdll.dll
diff --git a/libtest/volinfo.spec b/libtest/volinfo.spec
index eaba29d3a08493bff3b07fddd192033ab18e5c78..50c1d631e95b38b94af573325f34cfdd624fa666 100644
--- a/libtest/volinfo.spec
+++ b/libtest/volinfo.spec
@@ -1,6 +1,3 @@
 name	volinfo
 mode	guiexe
 type	win32
-
-import	kernel32.dll
-import	ntdll.dll
diff --git a/miscemu/Makefile.in b/miscemu/Makefile.in
index 3096d41679d18850446337bc65c530652f5d2524..0afb8f397bfe681bb25f8a5a4d921a65e1d22454 100644
--- a/miscemu/Makefile.in
+++ b/miscemu/Makefile.in
@@ -4,6 +4,7 @@ TOPOBJDIR = ..
 SRCDIR    = @srcdir@
 VPATH     = @srcdir@
 MODULE    = miscemu
+IMPORTS   = ntdll.dll
 
 SPEC_SRCS = wine.spec
 
diff --git a/miscemu/wine.spec b/miscemu/wine.spec
index a6ded8576eb9a2038d51564141f008e7251565e7..52555b7ac85b415154e41fbedca1aeb6e6cc8b4b 100644
--- a/miscemu/wine.spec
+++ b/miscemu/wine.spec
@@ -2,5 +2,3 @@ name	wine
 mode	guiexe
 type	win32
 init	wine_initial_task
-
-import	ntdll.dll
diff --git a/programs/Makeprog.rules.in b/programs/Makeprog.rules.in
index 1dc0465dd19b3c6263b8372811026571b077a93a..c8f2651d2b76576a311d21155c67a412f0e4092c 100644
--- a/programs/Makeprog.rules.in
+++ b/programs/Makeprog.rules.in
@@ -8,11 +8,12 @@
 # plus all variables required by the global Make.rules.in
 #
 
-DEFS       = @DLLFLAGS@ -DSTRICT -DNONAMELESSUNION -DNONAMELESSSTRUCT $(EXTRADEFS)
-LDDLLFLAGS = @LDDLLFLAGS@
-ALL_OBJS   = $(MODULE).spec.o $(OBJS)
-ALL_LIBS   = $(LIBWINE) $(EXTRALIBS) $(LIBS)
-SYMBOLFILE = $(MODULE).tmp.o
+DEFS        = @DLLFLAGS@ -DSTRICT -DNONAMELESSUNION -DNONAMELESSSTRUCT $(EXTRADEFS)
+LDDLLFLAGS  = @LDDLLFLAGS@
+ALL_OBJS    = $(MODULE).spec.o $(OBJS)
+ALL_LIBS    = $(LIBWINE) $(EXTRALIBS) $(LIBS)
+SYMBOLFILE  = $(MODULE).tmp.o
+TESTIMPORTS = $(DELAYIMPORTS) $(IMPORTS)
 
 all: $(MODULE)
 
@@ -29,7 +30,7 @@ $(MODULE): $(MODULE).so
 # Rules for checking that no imports are missing
 
 checklink:: $(MODULE).so
-	$(CC) -o checklink $(TOPSRCDIR)/library/checklink.c $(MODULE).so $(ALL_LIBS) && $(RM) checklink
+	$(CC) -o checklink $(TOPSRCDIR)/library/checklink.c $(MODULE).so && $(RM) checklink
 
 # Rules for testing
 
diff --git a/programs/avitools/Makefile.in b/programs/avitools/Makefile.in
index c96f24c9d5b0db948e9017569b93610f1a29a47d..628b1fcf9de9adfb3bfb9954465a420cd6b3b247 100644
--- a/programs/avitools/Makefile.in
+++ b/programs/avitools/Makefile.in
@@ -18,13 +18,13 @@ all: $(PROGRAMS)
 @MAKE_RULES@
 
 aviinfo.spec.c: aviinfo.spec aviinfo.o $(WINEBUILD)
-	$(LDPATH) $(WINEBUILD) @DLLFLAGS@ -L $(DLLDIR) -sym aviinfo.o -o aviinfo.spec.c -spec $(SRCDIR)/aviinfo.spec
+	$(LDPATH) $(WINEBUILD) @DLLFLAGS@ -sym aviinfo.o -o aviinfo.spec.c -spec $(SRCDIR)/aviinfo.spec -L$(DLLDIR) -lkernel32.dll -lntdll.dll
 
 aviplay.spec.c: aviplay.spec aviplay.o $(WINEBUILD)
-	$(LDPATH) $(WINEBUILD) @DLLFLAGS@ -L $(DLLDIR) -sym aviplay.o -o aviplay.spec.c -spec $(SRCDIR)/aviplay.spec
+	$(LDPATH) $(WINEBUILD) @DLLFLAGS@ -sym aviplay.o -o aviplay.spec.c -spec $(SRCDIR)/aviplay.spec -L$(DLLDIR) -lddraw.dll -lkernel32.dll -lntdll.dll
 
 icinfo.spec.c: icinfo.spec icinfo.o $(WINEBUILD)
-	$(LDPATH) $(WINEBUILD) @DLLFLAGS@ -L $(DLLDIR) -sym icinfo.o -o icinfo.spec.c -spec $(SRCDIR)/icinfo.spec
+	$(LDPATH) $(WINEBUILD) @DLLFLAGS@ -sym icinfo.o -o icinfo.spec.c -spec $(SRCDIR)/icinfo.spec -L$(DLLDIR) -lmsvfw32.dll -lkernel32.dll -lntdll.dll
 
 aviinfo.so: aviinfo.o aviinfo.spec.o
 	$(LDSHARED) $(LDDLLFLAGS) -o aviinfo.so aviinfo.o aviinfo.spec.o $(ALL_LIBS)
@@ -56,8 +56,8 @@ uninstall::
 	$(RM) $(bindir)/aviinfo $(bindir)/aviplay $(bindir)/icinfo
 
 checklink:: $(PROGRAMS:%=%.so)
-	$(CC) -o checklink $(TOPSRCDIR)/library/checklink.c aviinfo.so $(ALL_LIBS) && $(RM) checklink
-	$(CC) -o checklink $(TOPSRCDIR)/library/checklink.c aviplay.so $(ALL_LIBS) && $(RM) checklink
-	$(CC) -o checklink $(TOPSRCDIR)/library/checklink.c icinfo.so $(ALL_LIBS) && $(RM) checklink
+	$(CC) -o checklink $(TOPSRCDIR)/library/checklink.c aviinfo.so && $(RM) checklink
+	$(CC) -o checklink $(TOPSRCDIR)/library/checklink.c aviplay.so && $(RM) checklink
+	$(CC) -o checklink $(TOPSRCDIR)/library/checklink.c icinfo.so && $(RM) checklink
 
 ### Dependencies:
diff --git a/programs/avitools/aviinfo.spec b/programs/avitools/aviinfo.spec
index 8ee93e6c514420385610fc9ed32375de9875665c..1730af69fc9d3d8dc94326ad8f957e4869c6855c 100644
--- a/programs/avitools/aviinfo.spec
+++ b/programs/avitools/aviinfo.spec
@@ -1,6 +1,3 @@
 name	aviinfo
 mode	guiexe
 type	win32
-
-import	kernel32.dll
-import	ntdll.dll
diff --git a/programs/avitools/aviplay.spec b/programs/avitools/aviplay.spec
index 6057a04384646ec4d18f9adb264eabae9f8955e0..9a1a3e1e59da77a43fde52f4f44fd006a6e7d455 100644
--- a/programs/avitools/aviplay.spec
+++ b/programs/avitools/aviplay.spec
@@ -1,7 +1,3 @@
 name	aviplay
 mode	guiexe
 type	win32
-
-import	ddraw.dll
-import	kernel32.dll
-import	ntdll.dll
diff --git a/programs/avitools/icinfo.spec b/programs/avitools/icinfo.spec
index cfb2ae86d730fcd1b37140d7f8714122ffa02147..ffe307c99f577a0ac48026f989528e08d63d612b 100644
--- a/programs/avitools/icinfo.spec
+++ b/programs/avitools/icinfo.spec
@@ -1,7 +1,3 @@
 name	icinfo
 mode	guiexe
 type	win32
-
-import	msvfw32.dll
-import	kernel32.dll
-import	ntdll.dll
diff --git a/programs/clock/Makefile.in b/programs/clock/Makefile.in
index 409c357fa71b65c29698d93e9821a1e0abab87a5..915835e14d57f54f06b43bef53eced71423e715c 100644
--- a/programs/clock/Makefile.in
+++ b/programs/clock/Makefile.in
@@ -3,6 +3,7 @@ TOPOBJDIR = ../..
 SRCDIR    = @srcdir@
 VPATH     = @srcdir@
 MODULE    = clock
+IMPORTS   = comdlg32.dll shell32.dll user32.dll gdi32.dll kernel32.dll ntdll.dll
 
 LICENSELANG = En
 
diff --git a/programs/clock/clock.spec b/programs/clock/clock.spec
index 8212eeba91563ce40455e4dbc901dd2e8da5bd88..f5e1a38ab795ad36b45f1427e78244fb42fb341c 100644
--- a/programs/clock/clock.spec
+++ b/programs/clock/clock.spec
@@ -3,9 +3,3 @@ mode	guiexe
 type	win32
 rsrc	rsrc.res
 
-import	comdlg32.dll
-import	shell32.dll
-import	user32.dll
-import	gdi32.dll
-import	kernel32.dll
-import	ntdll.dll
diff --git a/programs/cmdlgtst/Makefile.in b/programs/cmdlgtst/Makefile.in
index 4f362a8a1dba5f33015d94cbcaedd552e2b59249..589771d1a51fa1d0708a3dc5ae1a746d00f31f3b 100644
--- a/programs/cmdlgtst/Makefile.in
+++ b/programs/cmdlgtst/Makefile.in
@@ -3,6 +3,7 @@ TOPOBJDIR = ../..
 SRCDIR    = @srcdir@
 VPATH     = @srcdir@
 MODULE    = cmdlgtst
+IMPORTS   = comdlg32.dll user32.dll gdi32.dll kernel32.dll ntdll.dll
 
 C_SRCS = \
 	cmdlgtst.c
diff --git a/programs/cmdlgtst/cmdlgtst.spec b/programs/cmdlgtst/cmdlgtst.spec
index 7e948ed46a2e7d8aa6d20cc11d909988d1ab4bbb..e100d40d4f89ee701270eeed7254858590c0b706 100644
--- a/programs/cmdlgtst/cmdlgtst.spec
+++ b/programs/cmdlgtst/cmdlgtst.spec
@@ -3,8 +3,3 @@ mode	guiexe
 type	win32
 rsrc	cmdlgr.res
 
-import	comdlg32.dll
-import	user32.dll
-import	gdi32.dll
-import	kernel32.dll
-import	ntdll.dll
diff --git a/programs/control/Makefile.in b/programs/control/Makefile.in
index 8158e7d0e7f86f72ed8f338bfb881ff316db7a3a..68d78dcfde3e5b540618c0eef55fe7aa181f3ac8 100644
--- a/programs/control/Makefile.in
+++ b/programs/control/Makefile.in
@@ -3,6 +3,7 @@ TOPOBJDIR = ../..
 SRCDIR    = @srcdir@
 VPATH     = @srcdir@
 MODULE    = control
+IMPORTS   = shell32.dll user32.dll kernel32.dll ntdll.dll
 
 C_SRCS = control.c
 
diff --git a/programs/control/control.spec b/programs/control/control.spec
index 4af82552976b100a08c0e0287b33b4d46dee4f2c..c902d8ba43bdf977093c2cce390b6a6fffa11246 100644
--- a/programs/control/control.spec
+++ b/programs/control/control.spec
@@ -2,7 +2,3 @@ name	control
 mode	guiexe
 type	win32
 
-import	shell32.dll
-import	user32.dll
-import	kernel32.dll
-import	ntdll.dll
diff --git a/programs/notepad/Makefile.in b/programs/notepad/Makefile.in
index e757de17a8ff5982b2083a2509e8b493f27109d5..2a31a44e15bf89acd1215f2802d5164ee7aad274 100644
--- a/programs/notepad/Makefile.in
+++ b/programs/notepad/Makefile.in
@@ -3,6 +3,7 @@ TOPOBJDIR = ../..
 SRCDIR    = @srcdir@
 VPATH     = @srcdir@
 MODULE    = notepad
+IMPORTS   = comdlg32.dll shell32.dll user32.dll gdi32.dll kernel32.dll ntdll.dll
 
 LICENSELANG = En
 
diff --git a/programs/notepad/notepad.spec b/programs/notepad/notepad.spec
index a655b12342da4f4cb29e39a43674cd52023f9703..1d647ba56085b269606124578c935f52286c5c37 100644
--- a/programs/notepad/notepad.spec
+++ b/programs/notepad/notepad.spec
@@ -3,9 +3,3 @@ mode	guiexe
 type	win32
 rsrc	rsrc.res
 
-import	comdlg32.dll
-import	shell32.dll
-import	user32.dll
-import	gdi32.dll
-import	kernel32.dll
-import	ntdll.dll
diff --git a/programs/osversioncheck/Makefile.in b/programs/osversioncheck/Makefile.in
index e725115a5f1f32eee5d583b462dad95e3a04a317..8016fc958baec43953f0c472f94709a3ad8d8892 100644
--- a/programs/osversioncheck/Makefile.in
+++ b/programs/osversioncheck/Makefile.in
@@ -3,6 +3,7 @@ TOPOBJDIR = ../..
 SRCDIR    = @srcdir@
 VPATH     = @srcdir@
 MODULE    = osversioncheck
+IMPORTS   = kernel32.dll ntdll.dll
 
 C_SRCS = osversioncheck.c
 
diff --git a/programs/osversioncheck/osversioncheck.spec b/programs/osversioncheck/osversioncheck.spec
index c149f815a9a9d8107d30f7ee41810cee4265812e..a59ffeed22263e1bfda45c9aebd4ab0d37666580 100644
--- a/programs/osversioncheck/osversioncheck.spec
+++ b/programs/osversioncheck/osversioncheck.spec
@@ -3,5 +3,3 @@ mode    cuiexe
 type	win32
 init	main
 
-import	kernel32.dll
-import	ntdll.dll
diff --git a/programs/progman/Makefile.in b/programs/progman/Makefile.in
index deb8c67ca50ccf944e4b0c814b034fcff0effcaf..ba09ea82c42c059518fb5f00128a3bfd1558be10 100644
--- a/programs/progman/Makefile.in
+++ b/programs/progman/Makefile.in
@@ -3,6 +3,7 @@ TOPOBJDIR = ../..
 SRCDIR    = @srcdir@
 VPATH     = @srcdir@
 MODULE    = progman
+IMPORTS   = shell32.dll comdlg32.dll user32.dll gdi32.dll kernel32.dll ntdll.dll
 
 LICENSELANG = En
 
diff --git a/programs/progman/progman.spec b/programs/progman/progman.spec
index be7940827e20e9b5287c09071bb21c49174e1502..f33dfa88f5298f28040acd3c1f731e64d1e332ff 100644
--- a/programs/progman/progman.spec
+++ b/programs/progman/progman.spec
@@ -3,9 +3,3 @@ mode	guiexe
 type	win32
 rsrc	rsrc.res
 
-import	shell32.dll
-import	comdlg32.dll
-import	user32.dll
-import	gdi32.dll
-import	kernel32.dll
-import	ntdll.dll
diff --git a/programs/regapi/Makefile.in b/programs/regapi/Makefile.in
index 7b122672e1f9ec850f36c95388f1aed0e87daaf8..3eb8a66784f29268bbafd2acafc6b9752712021a 100644
--- a/programs/regapi/Makefile.in
+++ b/programs/regapi/Makefile.in
@@ -3,6 +3,7 @@ TOPOBJDIR = ../..
 SRCDIR    = @srcdir@
 VPATH     = @srcdir@
 MODULE    = regapi
+IMPORTS   = advapi32.dll kernel32.dll ntdll.dll
 
 C_SRCS = \
 	regapi.c
diff --git a/programs/regapi/regapi.spec b/programs/regapi/regapi.spec
index 86ef42d62b90d3064c4c7362fe1415601f54e9a2..0d1754693b424d9fc20c422b1461c6d578938a56 100644
--- a/programs/regapi/regapi.spec
+++ b/programs/regapi/regapi.spec
@@ -2,6 +2,3 @@ name	regapi
 mode	guiexe
 type	win32
 
-import	advapi32.dll
-import	kernel32.dll
-import	ntdll.dll
diff --git a/programs/regedit/Makefile.in b/programs/regedit/Makefile.in
index c4d9c4dda3a20607951883c498ae8fcbf5b5b327..c44a3386a38817af3d988a8d32b3dac410e8ecf7 100644
--- a/programs/regedit/Makefile.in
+++ b/programs/regedit/Makefile.in
@@ -3,6 +3,7 @@ TOPOBJDIR = ../..
 SRCDIR    = @srcdir@
 VPATH     = @srcdir@
 MODULE    = regedit
+IMPORTS   = msvcrt.dll advapi32.dll kernel32.dll ntdll.dll
 
 C_SRCS = \
 	regedit.c \
diff --git a/programs/regedit/regedit.spec b/programs/regedit/regedit.spec
index 09691ee8646529387aa722258efeb0306a40ea2b..5b1fcc6811004f991d90a9b1da906acc4bf3f889 100644
--- a/programs/regedit/regedit.spec
+++ b/programs/regedit/regedit.spec
@@ -3,7 +3,3 @@ type    win32
 mode    guiexe
 init    WinMain
 
-import msvcrt.dll
-import advapi32.dll
-import kernel32.dll
-import ntdll.dll
diff --git a/programs/regsvr32/Makefile.in b/programs/regsvr32/Makefile.in
index 21364d65325583a0800a2f6c873e78f3005f3f9d..f8792eb605e91efd315078d5781b7686fc2f86f2 100644
--- a/programs/regsvr32/Makefile.in
+++ b/programs/regsvr32/Makefile.in
@@ -4,6 +4,7 @@ TOPOBJDIR = ../..
 SRCDIR    = @srcdir@
 VPATH     = @srcdir@
 MODULE    = regsvr32
+IMPORTS   = msvcrt.dll kernel32.dll ntdll.dll
 
 C_SRCS = \
 	regsvr32.c
diff --git a/programs/regsvr32/regsvr32.spec b/programs/regsvr32/regsvr32.spec
index 4296e9fea8cca2411ddb936088d9b2aff4ccabfa..d0f75c17a86a97665518104df2d1e73e6cf39abc 100644
--- a/programs/regsvr32/regsvr32.spec
+++ b/programs/regsvr32/regsvr32.spec
@@ -3,6 +3,3 @@ type    win32
 mode    cuiexe
 init    main
 
-import msvcrt.dll
-import kernel32.dll
-import ntdll.dll
diff --git a/programs/regtest/Makefile.in b/programs/regtest/Makefile.in
index f296f5cea1e695cf2456696cc563455812ac7a15..5a739b9a435785cab643189f9c1e2da1e6d8afb0 100644
--- a/programs/regtest/Makefile.in
+++ b/programs/regtest/Makefile.in
@@ -3,6 +3,7 @@ TOPOBJDIR = ../..
 SRCDIR    = @srcdir@
 VPATH     = @srcdir@
 MODULE    = regtest
+IMPORTS   = advapi32.dll kernel32.dll ntdll.dll
 
 C_SRCS = regtest.c
 
diff --git a/programs/regtest/regtest.spec b/programs/regtest/regtest.spec
index ccf39f3d46f028bc11a14fc6a0d0ed9cb54ae90a..13047360ff54fe6093f43861db252aa61fb5a67f 100644
--- a/programs/regtest/regtest.spec
+++ b/programs/regtest/regtest.spec
@@ -2,6 +2,3 @@ name	regtest
 mode	guiexe
 type	win32
 
-import	advapi32.dll
-import	kernel32.dll
-import	ntdll.dll
diff --git a/programs/uninstaller/Makefile.in b/programs/uninstaller/Makefile.in
index 7b6e08c70151d1227316115ebab58c0c254db343..433cd268109008415fa1d2b0470d7cbdc74d687f 100644
--- a/programs/uninstaller/Makefile.in
+++ b/programs/uninstaller/Makefile.in
@@ -3,6 +3,7 @@ TOPOBJDIR = ../..
 SRCDIR    = @srcdir@
 VPATH     = @srcdir@
 MODULE    = uninstaller
+IMPORTS   = user32.dll gdi32.dll advapi32.dll kernel32.dll ntdll.dll
 
 C_SRCS = \
 	main.c
diff --git a/programs/uninstaller/uninstaller.spec b/programs/uninstaller/uninstaller.spec
index 0768707eb25c8df3f64c5c86851298d89ecf6b73..6496a262dfc0faa8b1bcdc540a5d3399a956bcc7 100644
--- a/programs/uninstaller/uninstaller.spec
+++ b/programs/uninstaller/uninstaller.spec
@@ -3,8 +3,3 @@ mode	guiexe
 type	win32
 rsrc	rsrc.res
 
-import	user32.dll
-import	gdi32.dll
-import	advapi32.dll
-import	kernel32.dll
-import	ntdll.dll
diff --git a/programs/view/Makefile.in b/programs/view/Makefile.in
index 393f0f3c35df3fe32bd47c4654e535e85f776805..39db49a29d1b25a8b8ffe12b72ca99ceba91f3d1 100644
--- a/programs/view/Makefile.in
+++ b/programs/view/Makefile.in
@@ -3,6 +3,7 @@ TOPOBJDIR = ../..
 SRCDIR    = @srcdir@
 VPATH     = @srcdir@
 MODULE    = view
+IMPORTS   = comdlg32.dll user32.dll gdi32.dll kernel32.dll ntdll.dll
 
 C_SRCS = \
 	init.c \
diff --git a/programs/view/view.spec b/programs/view/view.spec
index be0fde02cca1db44c82a0ea8fd42b2be706d5fef..8c0b03ca10b14a2ca2d721f1f3220d684494450c 100644
--- a/programs/view/view.spec
+++ b/programs/view/view.spec
@@ -3,8 +3,3 @@ mode	guiexe
 type	win32
 rsrc	viewrc.res
 
-import	comdlg32.dll
-import	user32.dll
-import	gdi32.dll
-import	kernel32.dll
-import	ntdll.dll
diff --git a/programs/wcmd/Makefile.in b/programs/wcmd/Makefile.in
index 6f221e8c8c386c304e32431af9a306392e7641d3..ae267f960abdf3f7661d84de751d429699607970 100644
--- a/programs/wcmd/Makefile.in
+++ b/programs/wcmd/Makefile.in
@@ -3,6 +3,7 @@ TOPOBJDIR = ../..
 SRCDIR    = @srcdir@
 VPATH     = @srcdir@
 MODULE    = wcmd
+IMPORTS   = shell32.dll user32.dll kernel32.dll ntdll.dll
 
 C_SRCS = \
 	batch.c \
diff --git a/programs/wcmd/wcmd.spec b/programs/wcmd/wcmd.spec
index 1b5731b5d4d4204eb0e1c1d6ee8d3d2eddd40ded..2b657c3746e7a3202b49229ec68ff12409d7ff2e 100644
--- a/programs/wcmd/wcmd.spec
+++ b/programs/wcmd/wcmd.spec
@@ -4,7 +4,3 @@ type	win32
 init	main
 rsrc	wcmdrc.res
 
-import	shell32.dll
-import	user32.dll
-import	kernel32.dll
-import	ntdll.dll
diff --git a/programs/wineconsole/Makefile.in b/programs/wineconsole/Makefile.in
index 99a2d70cbcb886cdcfa8b572213496853f71f611..1fce20993482a86c4ea1fdbab6c0d69763212433 100644
--- a/programs/wineconsole/Makefile.in
+++ b/programs/wineconsole/Makefile.in
@@ -4,6 +4,8 @@ TOPOBJDIR = ../..
 SRCDIR    = @srcdir@
 VPATH     = @srcdir@
 MODULE    = wineconsole
+IMPORTS   = gdi32.dll user32.dll advapi32.dll kernel32.dll ntdll.dll
+DELAYIMPORTS = comctl32
 
 C_SRCS = \
 	dialog.c \
diff --git a/programs/wineconsole/wineconsole.spec b/programs/wineconsole/wineconsole.spec
index 871d1479973fb3f11fb549ef969675a3441cc08b..804fce9dfc00e82b57f00123a151320bf968f284 100644
--- a/programs/wineconsole/wineconsole.spec
+++ b/programs/wineconsole/wineconsole.spec
@@ -4,9 +4,3 @@ type	win32
 init	WINECON_WinMain
 rsrc    wineconsole_res.res                                                                                                                                                                  
 
-import -delay comctl32
-import  gdi32.dll
-import  user32.dll
-import	advapi32.dll
-import	kernel32.dll
-import	ntdll.dll
diff --git a/programs/winemine/Makefile.in b/programs/winemine/Makefile.in
index 1eee283973c03c1cf0c11416f63f3ba081733ad1..5fe2854440fa15479d11178cd70ead59459b9f8e 100644
--- a/programs/winemine/Makefile.in
+++ b/programs/winemine/Makefile.in
@@ -3,6 +3,7 @@ TOPOBJDIR = ../..
 SRCDIR    = @srcdir@
 VPATH     = @srcdir@
 MODULE    = winemine
+IMPORTS   = user32.dll gdi32.dll advapi32.dll kernel32.dll ntdll.dll
 
 C_SRCS = \
         dialog.c \
diff --git a/programs/winemine/winemine.spec b/programs/winemine/winemine.spec
index 902bb7dbd3d0e1347a36ca335c58f980725a9ead..85c29061fda6df8eecdf9c62db0e53cc2f266826 100644
--- a/programs/winemine/winemine.spec
+++ b/programs/winemine/winemine.spec
@@ -3,8 +3,3 @@ mode	guiexe
 type	win32
 rsrc	rsrc.res
 
-import	user32.dll
-import	gdi32.dll
-import	advapi32.dll
-import	kernel32.dll
-import	ntdll.dll
diff --git a/programs/winepath/Makefile.in b/programs/winepath/Makefile.in
index f82442b6542ac6dc94f0c5b8cdf04e9fbac87e94..7d9d30d3b2fc7596b6a9c358dd38706954de3904 100644
--- a/programs/winepath/Makefile.in
+++ b/programs/winepath/Makefile.in
@@ -3,6 +3,7 @@ TOPOBJDIR = ../..
 SRCDIR    = @srcdir@
 VPATH     = @srcdir@
 MODULE    = winepath
+IMPORTS   = kernel32.dll ntdll.dll
 
 C_SRCS = winepath.c
 
diff --git a/programs/winepath/winepath.spec b/programs/winepath/winepath.spec
index 8639561b2e70b5a1bb7e1592eed9e4cb5cfce5cf..b73bfd35e686f68a1e328fdb0088c9ec94dbf5f4 100644
--- a/programs/winepath/winepath.spec
+++ b/programs/winepath/winepath.spec
@@ -2,5 +2,3 @@ name	winepath
 mode	cuiexe
 type	win32
 
-import	kernel32.dll
-import	ntdll.dll
diff --git a/programs/winetest/Makefile.in b/programs/winetest/Makefile.in
index 6b031e28705d1d533d2b75ef656ae704507686ae..19f458fd43308c06919f3d9f1aa950909a8fa86a 100644
--- a/programs/winetest/Makefile.in
+++ b/programs/winetest/Makefile.in
@@ -7,6 +7,7 @@ TOPOBJDIR = ../..
 SRCDIR    = @srcdir@
 VPATH     = @srcdir@
 MODULE    = winetest
+IMPORTS   = kernel32.dll ntdll.dll
 
 C_SRCS = winetest.c
 
diff --git a/programs/winetest/winetest.spec b/programs/winetest/winetest.spec
index 3b294b11d74f9e218b52f5bb737ce36db20a8131..fa8f8e3e66b65168b0814faf8b53f77e975414d1 100644
--- a/programs/winetest/winetest.spec
+++ b/programs/winetest/winetest.spec
@@ -2,5 +2,3 @@ name	winetest
 mode	cuiexe
 type	win32
 
-import	kernel32.dll
-import	ntdll.dll
diff --git a/programs/winhelp/Makefile.in b/programs/winhelp/Makefile.in
index 391da0b520b6e7241dc806b9734979640936c8b0..d7cf6c7880c8b85e92ff1f7f6f1f67d91b0b0135 100644
--- a/programs/winhelp/Makefile.in
+++ b/programs/winhelp/Makefile.in
@@ -3,8 +3,8 @@ TOPOBJDIR = ../..
 SRCDIR    = @srcdir@
 VPATH     = @srcdir@
 MODULE    = winhelp
+IMPORTS   = comdlg32.dll shell32.dll user32.dll gdi32.dll kernel32.dll ntdll.dll
 PROGRAMS  = hlp2sgml
-IMPORTS   = advapi32 comctl32 shlwapi shell32 ole32 rpcrt4 comdlg32 winspool.drv user32 gdi32 kernel32 ntdll
 
 C_SRCS = \
 	winhelp.c \
diff --git a/programs/winhelp/winhelp.spec b/programs/winhelp/winhelp.spec
index 689bac9b6a376aaae49a8a5e2ed95df9aa5083ed..2d819da5c247e95e861107386212f5b1a0df5642 100644
--- a/programs/winhelp/winhelp.spec
+++ b/programs/winhelp/winhelp.spec
@@ -4,9 +4,3 @@ type	win32
 init	WinMain
 rsrc	rsrc.res
 
-import	comdlg32.dll
-import	shell32.dll
-import	user32.dll
-import	gdi32.dll
-import	kernel32.dll
-import	ntdll.dll
diff --git a/programs/winver/Makefile.in b/programs/winver/Makefile.in
index bbedff708034bde103b56830ca450cabf7cace88..b8e18354ab3e91f505b317ed85fdf284d5c1a287 100644
--- a/programs/winver/Makefile.in
+++ b/programs/winver/Makefile.in
@@ -3,6 +3,7 @@ TOPOBJDIR = ../..
 SRCDIR    = @srcdir@
 VPATH     = @srcdir@
 MODULE    = winver
+IMPORTS   = shell32.dll kernel32.dll ntdll.dll
 
 C_SRCS = winver.c
 
diff --git a/programs/winver/winver.spec b/programs/winver/winver.spec
index a8b0ca4f4111ab15fe3fa1c8023f8bc6367bfa59..c7c18bd12948fa6f195714c3a09a83592d053202 100644
--- a/programs/winver/winver.spec
+++ b/programs/winver/winver.spec
@@ -2,6 +2,3 @@ name	winver
 mode	guiexe
 type	win32
 
-import	shell32.dll
-import	kernel32.dll
-import	ntdll.dll
diff --git a/tools/winebuild/import.c b/tools/winebuild/import.c
index c16d6f2108e830197a69c8e623ecf0376ad17e68..686f93136f21e4a99c15a6c4fd306711b9304b40 100644
--- a/tools/winebuild/import.c
+++ b/tools/winebuild/import.c
@@ -161,7 +161,14 @@ static void read_exported_symbols( const char *name, struct import *imp )
 /* add a dll to the list of imports */
 void add_import_dll( const char *name, int delay )
 {
-    struct import *imp = xmalloc( sizeof(*imp) );
+    struct import *imp;
+    int i;
+
+    /* check if we already imported it */
+    for (i = 0; i < nb_imports; i++)
+        if (!strcmp( dll_imports[i]->dll, name )) return;
+
+    imp = xmalloc( sizeof(*imp) );
     imp->dll        = xstrdup( name );
     imp->delay      = delay;
     imp->imports    = NULL;
diff --git a/tools/winebuild/main.c b/tools/winebuild/main.c
index 01d63197517284a49ef60d7ca0d954fabedf64b3..13c27d92bb7fd3b1f9b2dda83e025200987f9b04 100644
--- a/tools/winebuild/main.c
+++ b/tools/winebuild/main.c
@@ -120,6 +120,8 @@ static void do_relay16(void);
 static void do_relay32(void);
 static void do_sym( const char *arg );
 static void do_lib( const char *arg );
+static void do_import( const char *arg );
+static void do_dimport( const char *arg );
 
 static const struct option_descr option_table[] =
 {
@@ -127,6 +129,8 @@ static const struct option_descr option_table[] =
     { "-h",       0, do_usage,   "-h               Display this help message" },
     { "-w",       0, do_warnings,"-w               Turn on warnings" },
     { "-L",       1, do_lib,     "-L directory     Look for imports libraries in 'directory'" },
+    { "-l",       1, do_import,  "-l lib.dll       Import the specified library" },
+    { "-dl",      1, do_dimport, "-dl lib.dll      Delay-import the specified library" },
     { "-o",       1, do_output,  "-o name          Set the output file name (default: stdout)" },
     { "-sym",     1, do_sym,     "-sym file.o      Read the list of undefined symbols from 'file.o'" },
     { "-spec",    1, do_spec,    "-spec file.spec  Build a .c file from a spec file" },
@@ -218,6 +222,16 @@ static void do_lib( const char *arg )
     lib_path[nb_lib_paths++] = xstrdup( arg );
 }
 
+static void do_import( const char *arg )
+{
+    add_import_dll( arg, 0 );
+}
+
+static void do_dimport( const char *arg )
+{
+    add_import_dll( arg, 1 );
+}
+
 /* parse options from the argv array and remove all the recognized ones */
 static void parse_options( char *argv[] )
 {