Build most programs as .so files.

diff --git a/programs/avitools/Makefile.in b/programs/avitools/Makefile.in
index 1ba2e94..f80e9c0 100644
--- a/programs/avitools/Makefile.in
+++ b/programs/avitools/Makefile.in
@@ -1,11 +1,12 @@
-DEFS      = -DWINELIB
-TOPSRCDIR = @top_srcdir@
-TOPOBJDIR = ../..
-SRCDIR    = @srcdir@
-VPATH     = @srcdir@
-MODULE    = none
-PROGRAMS  = icinfo aviinfo aviplay
-IMPORTS   = msvfw32 winmm ddraw x11drv user32 gdi32 kernel32 ntdll
+DEFS       = @DLLFLAGS@
+LDDLLFLAGS = @LDDLLFLAGS@
+TOPSRCDIR  = @top_srcdir@
+TOPOBJDIR  = ../..
+SRCDIR     = @srcdir@
+VPATH      = @srcdir@
+MODULE     = none
+PROGRAMS   = icinfo aviinfo aviplay
+ALL_LIBS   = -L$(TOPOBJDIR) -lwine $(LIBS)
 
 SPEC_SRCS = \
 	icinfo.spec \
@@ -16,21 +17,47 @@
 
 @MAKE_RULES@
 
-icinfo: icinfo.o icinfo.spec.o
-	$(CC) -o icinfo icinfo.o icinfo.spec.o $(DLL_LINK) $(LIBS)
+aviinfo.spec.c: aviinfo.spec aviinfo.o $(WINEBUILD)
+	$(LDPATH) $(WINEBUILD) @DLLFLAGS@ -L $(DLLDIR) -sym aviinfo.o -o aviinfo.spec.c -spec aviinfo.spec
 
-aviinfo: aviinfo.o aviinfo.spec.o
-	$(CC) -o aviinfo aviinfo.o aviinfo.spec.o $(DLL_LINK) $(LIBS)
+aviplay.spec.c: aviplay.spec aviplay.o $(WINEBUILD)
+	$(LDPATH) $(WINEBUILD) @DLLFLAGS@ -L $(DLLDIR) -sym aviplay.o -o aviplay.spec.c -spec aviplay.spec
 
-aviplay: aviplay.o aviplay.spec.o
-	$(CC) -o aviplay aviplay.o aviplay.spec.o $(DLL_LINK) $(LIBS)
+icinfo.spec.c: icinfo.spec icinfo.o $(WINEBUILD)
+	$(LDPATH) $(WINEBUILD) @DLLFLAGS@ -L $(DLLDIR) -sym icinfo.o -o icinfo.spec.c -spec icinfo.spec
 
-install::
-	$(INSTALL_PROGRAM) icinfo $(bindir)/icinfo
-	$(INSTALL_PROGRAM) aviinfo $(bindir)/aviinfo
-	$(INSTALL_PROGRAM) aviplay $(bindir)/aviplay
+aviinfo.so: aviinfo.o aviinfo.spec.o
+	$(LDSHARED) $(LDDLLFLAGS) -o aviinfo.so aviinfo.o aviinfo.spec.o $(ALL_LIBS)
+
+aviplay.so: aviplay.o aviplay.spec.o
+	$(LDSHARED) $(LDDLLFLAGS) -o aviplay.so aviplay.o aviplay.spec.o $(ALL_LIBS)
+
+icinfo.so: icinfo.o icinfo.spec.o
+	$(LDSHARED) $(LDDLLFLAGS) -o icinfo.so icinfo.o icinfo.spec.o $(ALL_LIBS)
+
+aviinfo: aviinfo.so
+	$(RM) aviinfo && $(LN_S) $(TOPOBJDIR)/wine aviinfo
+
+aviplay: aviplay.so
+	$(RM) aviplay && $(LN_S) $(TOPOBJDIR)/wine aviplay
+
+icinfo: icinfo.so
+	$(RM) icinfo && $(LN_S) $(TOPOBJDIR)/wine icinfo
+
+install:: $(PROGRAMS:%=%.so)
+	[ -d $(bindir) ] || $(MKDIR) $(bindir)
+	$(INSTALL_PROGRAM) aviinfo.so $(bindir)/aviinfo.so
+	$(INSTALL_PROGRAM) aviplay.so $(bindir)/aviplay.so
+	$(INSTALL_PROGRAM) icinfo.so $(bindir)/icinfo.so
+	cd $(bindir) && $(LN_S) wine aviinfo && $(LN_S) wine aviplay && $(LN_S) wine icinfo
 
 uninstall::
-	$(RM) $(bindir)/aviinfo $(bindir)/icinfo $(bindir)/aviplay
+	$(RM) $(bindir)/aviinfo.so $(bindir)/aviplay.so $(bindir)/icinfo.so
+	$(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
 
 ### Dependencies:
diff --git a/programs/avitools/aviinfo.spec b/programs/avitools/aviinfo.spec
index 8e74f51..8ee93e6 100644
--- a/programs/avitools/aviinfo.spec
+++ b/programs/avitools/aviinfo.spec
@@ -1,4 +1,6 @@
 name	aviinfo
 mode	guiexe
 type	win32
-init	WinMain
+
+import	kernel32.dll
+import	ntdll.dll
diff --git a/programs/avitools/aviplay.spec b/programs/avitools/aviplay.spec
index 3f4446b..6057a04 100644
--- a/programs/avitools/aviplay.spec
+++ b/programs/avitools/aviplay.spec
@@ -1,4 +1,7 @@
 name	aviplay
 mode	guiexe
 type	win32
-init	WinMain
+
+import	ddraw.dll
+import	kernel32.dll
+import	ntdll.dll
diff --git a/programs/avitools/icinfo.spec b/programs/avitools/icinfo.spec
index c925dbd..cfb2ae8 100644
--- a/programs/avitools/icinfo.spec
+++ b/programs/avitools/icinfo.spec
@@ -1,4 +1,7 @@
 name	icinfo
 mode	guiexe
 type	win32
-init	WinMain
+
+import	msvfw32.dll
+import	kernel32.dll
+import	ntdll.dll
diff --git a/programs/clock/Makefile.in b/programs/clock/Makefile.in
index 78355d1..6e2586a 100644
--- a/programs/clock/Makefile.in
+++ b/programs/clock/Makefile.in
@@ -1,38 +1,21 @@
-DEFS      = -DWINELIB -DSTRICT
+EXTRADEFS = -DSTRICT
 TOPSRCDIR = @top_srcdir@
 TOPOBJDIR = ../..
 SRCDIR    = @srcdir@
 VPATH     = @srcdir@
-MODULE    = none
-PROGRAMS  = clock
-IMPORTS   = advapi32 comctl32 shlwapi shell32 comdlg32 ole32 rpcrt4 winspool.drv user32 gdi32 kernel32 ntdll
+MODULE    = clock
 
 LICENSELANG = En
 
 C_SRCS = \
 	language.c \
 	license.c \
-	winclock.c \
 	main.c \
+	winclock.c \
 	$(LICENSELANG:%=License_%.c)
 
-SPEC_SRCS = clock.spec
-
 RC_SRCS = rsrc.rc
 
-all: $(PROGRAMS)
-
-@MAKE_RULES@
-
-clock: $(OBJS)
-	$(CC) -o clock $(OBJS) $(DLL_LINK) $(LIBS)
-
-$(SPEC_SRCS:.spec=.spec.c): $(RC_SRCS:.rc=.res)
-
-install::
-	$(INSTALL_PROGRAM) clock $(bindir)/clock
-
-uninstall::
-	$(RM) $(bindir)/clock
+@MAKE_PROG_RULES@
 
 ### Dependencies:
diff --git a/programs/cmdlgtst/Makefile.in b/programs/cmdlgtst/Makefile.in
index 7b98415..37d0cd2 100644
--- a/programs/cmdlgtst/Makefile.in
+++ b/programs/cmdlgtst/Makefile.in
@@ -1,34 +1,16 @@
-DEFS      = -DWINELIB -DSTRICT
+EXTRADEFS = -DSTRICT
 TOPSRCDIR = @top_srcdir@
 TOPOBJDIR = ../..
 SRCDIR    = @srcdir@
 VPATH     = @srcdir@
-MODULE    = none
-PROGRAMS  = cmdlgtst
-IMPORTS   = advapi32 comctl32 comdlg32 shell32 shlwapi ole32 rpcrt4 winspool.drv user32 gdi32 kernel32 ntdll
+MODULE    = cmdlgtst
 
 C_SRCS = \
 	cmdlgtst.c
 
-SPEC_SRCS = \
-	cmdlgtst.spec
-
 RC_SRCS = \
 	cmdlgr.rc
 
-all: $(PROGRAMS)
-
-@MAKE_RULES@
-
-cmdlgtst: $(OBJS)
-	$(CC) -o cmdlgtst $(OBJS) $(DLL_LINK) $(LIBS)
-
-$(SPEC_SRCS:.spec=.spec.c): $(RC_SRCS:.rc=.res)
-
-install::
-	$(INSTALL_PROGRAM) cmdlgtst $(bindir)/cmdlgtst
-
-uninstall::
-	$(RM) $(bindir)/cmdlgtst
+@MAKE_PROG_RULES@
 
 ### Dependencies:
diff --git a/programs/control/Makefile.in b/programs/control/Makefile.in
index a43f96a..90f5343 100644
--- a/programs/control/Makefile.in
+++ b/programs/control/Makefile.in
@@ -1,27 +1,12 @@
-DEFS      = -DWINELIB -DSTRICT
+EXTRADEFS = -DSTRICT
 TOPSRCDIR = @top_srcdir@
 TOPOBJDIR = ../..
 SRCDIR    = @srcdir@
 VPATH     = @srcdir@
-MODULE    = none
-PROGRAMS  = control
-IMPORTS   = advapi32 comctl32 shlwapi shell32 ole32 rpcrt4 user32 gdi32 kernel32 ntdll
+MODULE    = control
 
 C_SRCS = control.c
 
-SPEC_SRCS = control.spec
-
-all: $(PROGRAMS)
-
-@MAKE_RULES@
-
-control: $(OBJS)
-	$(CC) -o control $(OBJS) $(DLL_LINK) $(LIBS)
-
-install::
-	$(INSTALL_PROGRAM) control $(bindir)/control
-
-uninstall::
-	$(RM) $(bindir)/control
+@MAKE_PROG_RULES@
 
 ### Dependencies:
diff --git a/programs/notepad/Makefile.in b/programs/notepad/Makefile.in
index c6c23a5..0630595 100644
--- a/programs/notepad/Makefile.in
+++ b/programs/notepad/Makefile.in
@@ -1,39 +1,22 @@
-DEFS      = -DWINELIB -DSTRICT
+EXTRADEFS = -DSTRICT
 TOPSRCDIR = @top_srcdir@
 TOPOBJDIR = ../..
 SRCDIR    = @srcdir@
 VPATH     = @srcdir@
-MODULE    = none
-PROGRAMS  = notepad
-IMPORTS   = advapi32 comctl32 shlwapi shell32 ole32 rpcrt4 comdlg32 winspool.drv user32 gdi32 kernel32 ntdll
+MODULE    = notepad
 
 LICENSELANG = En
 
 C_SRCS = \
-	license.c \
-	main.c \
 	dialog.c \
 	language.c \
+	license.c \
+	main.c \
 	search.c \
 	$(LICENSELANG:%=License_%.c)
 
-SPEC_SRCS = notepad.spec
-
 RC_SRCS = rsrc.rc
 
-all: $(PROGRAMS)
-
-@MAKE_RULES@
-
-notepad: $(OBJS)
-	$(CC) -o notepad $(OBJS) $(DLL_LINK) $(LIBS)
-
-$(SPEC_SRCS:.spec=.spec.c): $(RC_SRCS:.rc=.res)
-
-install::
-	$(INSTALL_PROGRAM) notepad $(bindir)/notepad
-
-uninstall::
-	$(RM) $(bindir)/notepad
+@MAKE_PROG_RULES@
 
 ### Dependencies:
diff --git a/programs/osversioncheck/Makefile.in b/programs/osversioncheck/Makefile.in
index db86709..7eff285 100644
--- a/programs/osversioncheck/Makefile.in
+++ b/programs/osversioncheck/Makefile.in
@@ -1,27 +1,12 @@
-DEFS      = -DWINELIB -DSTRICT
+EXTRADEFS = -DSTRICT
 TOPSRCDIR = @top_srcdir@
 TOPOBJDIR = ../..
 SRCDIR    = @srcdir@
 VPATH     = @srcdir@
-MODULE    = none
-PROGRAMS  = osversioncheck
-IMPORTS   = kernel32 ntdll
+MODULE    = osversioncheck
 
 C_SRCS = osversioncheck.c
 
-SPEC_SRCS = osversioncheck.spec
-
-all: $(PROGRAMS)
-
-@MAKE_RULES@
-
-osversioncheck: $(OBJS)
-	$(CC) -o osversioncheck $(OBJS) $(DLL_LINK) $(LIBS)
-
-install::
-	$(INSTALL_PROGRAM) osversioncheck $(bindir)/osversioncheck
-
-uninstall::
-	$(RM) $(bindir)/osversioncheck
+@MAKE_PROG_RULES@
 
 ### Dependencies:
diff --git a/programs/progman/Makefile.in b/programs/progman/Makefile.in
index e498f9b..8654177 100644
--- a/programs/progman/Makefile.in
+++ b/programs/progman/Makefile.in
@@ -38,4 +38,6 @@
 uninstall::
 	$(RM) $(bindir)/progman
 
+checklink::
+
 ### Dependencies:
diff --git a/programs/regapi/Makefile.in b/programs/regapi/Makefile.in
index a7d9a96..bb27ff9 100644
--- a/programs/regapi/Makefile.in
+++ b/programs/regapi/Makefile.in
@@ -1,29 +1,13 @@
-DEFS      = -DWINELIB -DSTRICT
+EXTRADEFS = -DSTRICT
 TOPSRCDIR = @top_srcdir@
 TOPOBJDIR = ../..
 SRCDIR    = @srcdir@
 VPATH     = @srcdir@
-MODULE    = none
-PROGRAMS  = regapi
-IMPORTS   = kernel32 ntdll
+MODULE    = regapi
 
 C_SRCS = \
 	regapi.c
 
-SPEC_SRCS = \
-	regapi.spec
-
-all: $(PROGRAMS)
-
-@MAKE_RULES@
-
-regapi: $(OBJS)
-	$(CC) -o regapi $(OBJS) $(DLL_LINK) $(LIBS)
-
-install::
-	$(INSTALL_PROGRAM) regapi $(bindir)/regapi
-
-uninstall::
-	$(RM) $(bindir)/regapi
+@MAKE_PROG_RULES@
 
 ### Dependencies:
diff --git a/programs/regtest/Makefile.in b/programs/regtest/Makefile.in
index 48fa909..90b3cd6 100644
--- a/programs/regtest/Makefile.in
+++ b/programs/regtest/Makefile.in
@@ -1,27 +1,12 @@
-DEFS      = -DWINELIB -DSTRICT
+EXTRADEFS = -DSTRICT
 TOPSRCDIR = @top_srcdir@
 TOPOBJDIR = ../..
 SRCDIR    = @srcdir@
 VPATH     = @srcdir@
-MODULE    = none
-PROGRAMS  = regtest
-IMPORTS   = kernel32 ntdll
+MODULE    = regtest
 
 C_SRCS = regtest.c
 
-SPEC_SRCS = regtest.spec
-
-all: $(PROGRAMS)
-
-@MAKE_RULES@
-
-regtest: $(OBJS)
-	$(CC) -o regtest $(OBJS) $(DLL_LINK) $(LIBS)
-
-install::
-	$(INSTALL_PROGRAM) regtest $(bindir)/regtest
-
-uninstall::
-	$(RM) $(bindir)/regtest
+@MAKE_PROG_RULES@
 
 ### Dependencies:
diff --git a/programs/uninstaller/Makefile.in b/programs/uninstaller/Makefile.in
index 5bc6be8..ab4d545 100644
--- a/programs/uninstaller/Makefile.in
+++ b/programs/uninstaller/Makefile.in
@@ -1,34 +1,15 @@
-DEFS      = -DWINELIB -DSTRICT
+EXTRADEFS = -DSTRICT
 TOPSRCDIR = @top_srcdir@
 TOPOBJDIR = ../..
 SRCDIR    = @srcdir@
 VPATH     = @srcdir@
-MODULE    = none
-PROGRAMS  = uninstaller
-IMPORTS   = user32 gdi32 kernel32 ntdll
-
-LICENSELANG = En
+MODULE    = uninstaller
 
 C_SRCS = \
 	main.c
 
-SPEC_SRCS = uninstaller.spec
-
 RC_SRCS = rsrc.rc
 
-all: $(PROGRAMS)
-
-@MAKE_RULES@
-
-uninstaller: $(OBJS)
-	$(CC) -o uninstaller $(OBJS) $(DLL_LINK) $(LIBS)
-
-$(SPEC_SRCS:.spec=.spec.c): $(RC_SRCS:.rc=.res)
-
-install::
-	$(INSTALL_PROGRAM) uninstaller $(bindir)/uninstaller
-
-uninstall::
-	$(RM) $(bindir)/uninstaller
+@MAKE_PROG_RULES@
 
 ### Dependencies:
diff --git a/programs/view/Makefile.in b/programs/view/Makefile.in
index bd45f43..be222dd 100644
--- a/programs/view/Makefile.in
+++ b/programs/view/Makefile.in
@@ -1,36 +1,18 @@
-DEFS      = -DWINELIB -DSTRICT
+EXTRADEFS = -DSTRICT
 TOPSRCDIR = @top_srcdir@
 TOPOBJDIR = ../..
 SRCDIR    = @srcdir@
 VPATH     = @srcdir@
-MODULE    = none
-PROGRAMS  = view
-IMPORTS   = advapi32 comctl32 comdlg32 shell32 shlwapi ole32 rpcrt4 winspool.drv user32 gdi32 kernel32 ntdll
+MODULE    = view
 
 C_SRCS = \
 	init.c \
 	view.c \
 	winmain.c
 
-SPEC_SRCS = \
-	view.spec
-
 RC_SRCS = \
 	viewrc.rc
 
-all: $(PROGRAMS)
-
-@MAKE_RULES@
-
-view: $(OBJS)
-	$(CC) -o view $(OBJS) $(DLL_LINK) $(LIBS)
-
-$(SPEC_SRCS:.spec=.spec.c): $(RC_SRCS:.rc=.res)
-
-install::
-	$(INSTALL_PROGRAM) view $(bindir)/view
-
-uninstall::
-	$(RM) $(bindir)/view
+@MAKE_PROG_RULES@
 
 ### Dependencies:
diff --git a/programs/wcmd/Makefile.in b/programs/wcmd/Makefile.in
index edec5b4..a000e09 100644
--- a/programs/wcmd/Makefile.in
+++ b/programs/wcmd/Makefile.in
@@ -1,11 +1,9 @@
-DEFS      = -DWINELIB -DSTRICT
+EXTRADEFS = -DSTRICT
 TOPSRCDIR = @top_srcdir@
 TOPOBJDIR = ../..
 SRCDIR    = @srcdir@
 VPATH     = @srcdir@
-MODULE    = none
-PROGRAMS  = wcmd
-IMPORTS   = shell32 user32 gdi32 kernel32 ntdll
+MODULE    = wcmd
 
 C_SRCS = \
 	batch.c \
@@ -13,25 +11,9 @@
 	directory.c \
 	wcmdmain.c
 
-SPEC_SRCS = \
-	wcmd.spec
-
 RC_SRCS = \
 	wcmdrc.rc
 
-all: $(PROGRAMS)
-
-@MAKE_RULES@
-
-$(SPEC_SRCS:.spec=.spec.c): $(RC_SRCS:.rc=.res)
-
-wcmd: $(OBJS)
-	$(CC) -o wcmd $(OBJS) $(DLL_LINK) $(LIBS)
-
-install::
-	$(INSTALL_PROGRAM) wcmd $(bindir)/wcmd
-
-uninstall::
-	$(RM) $(bindir)/wcmd
+@MAKE_PROG_RULES@
 
 ### Dependencies:
diff --git a/programs/winemine/Makefile.in b/programs/winemine/Makefile.in
index ad023f1..b177ea7 100644
--- a/programs/winemine/Makefile.in
+++ b/programs/winemine/Makefile.in
@@ -1,35 +1,16 @@
-DEFS      = -DWINELIB -DSTRICT
+EXTRADEFS = -DSTRICT
 TOPSRCDIR = @top_srcdir@
 TOPOBJDIR = ../..
 SRCDIR    = @srcdir@
 VPATH     = @srcdir@
-MODULE    = none
-PROGRAMS  = winemine
-IMPORTS   = user32 gdi32 kernel32 ntdll
-
-LICENSELANG = En
+MODULE    = winemine
 
 C_SRCS = \
-	main.c \
-        dialog.c
-
-SPEC_SRCS = winemine.spec
+        dialog.c \
+	main.c
 
 RC_SRCS = rsrc.rc
 
-all: $(PROGRAMS)
-
-@MAKE_RULES@
-
-winemine: $(OBJS)
-	$(CC) -o winemine $(OBJS) $(DLL_LINK) $(LIBS)
-
-$(SPEC_SRCS:.spec=.spec.c): $(RC_SRCS:.rc=.res)
-
-install::
-	$(INSTALL_PROGRAM) winemine $(bindir)/winemine
-
-uninstall::
-	$(RM) $(bindir)/winemine
+@MAKE_PROG_RULES@
 
 ### Dependencies:
diff --git a/programs/winhelp/Makefile.in b/programs/winhelp/Makefile.in
index 30509d9..c051324 100644
--- a/programs/winhelp/Makefile.in
+++ b/programs/winhelp/Makefile.in
@@ -1,10 +1,10 @@
-DEFS      = -DWINELIB -DSTRICT
+EXTRADEFS = -DWINELIB -DSTRICT
 TOPSRCDIR = @top_srcdir@
 TOPOBJDIR = ../..
 SRCDIR    = @srcdir@
 VPATH     = @srcdir@
-MODULE    = none
-PROGRAMS  = winhelp hlp2sgml
+MODULE    = winhelp
+PROGRAMS  = hlp2sgml
 IMPORTS   = advapi32 comctl32 shlwapi shell32 ole32 rpcrt4 comdlg32 winspool.drv user32 gdi32 kernel32 ntdll
 
 C_SRCS = \
@@ -13,31 +13,23 @@
 	macro.c \
 	string.c
 
-SPEC_SRCS = winhelp.spec
-
 EXTRA_SRCS = macro.yacc.y macro.lex.l
 EXTRA_OBJS = y.tab.o lex.yy.o
 
 RC_SRCS = rsrc.rc
 
+@MAKE_PROG_RULES@
+
 all: $(PROGRAMS)
 
-@MAKE_RULES@
-
-$(SPEC_SRCS:.spec=.spec.c): $(RC_SRCS:.rc=.res)
-
-winhelp: $(OBJS)
-	$(CC) -o winhelp $(OBJS) $(DLL_LINK) $(LIBS)
-
 hlp2sgml: hlp2sgml.o hlpfile.o
 	$(CC) -o hlp2sgml hlp2sgml.o hlpfile.o
 
 install::
-	$(INSTALL_PROGRAM) winhelp $(bindir)/winhelp
 	$(INSTALL_PROGRAM) hlp2sgml $(bindir)/hlp2sgml
 
 uninstall::
-	$(RM) $(bindir)/winhelp $(bindir)/hlp2sgml
+	$(RM) $(bindir)/hlp2sgml
 
 y.tab.c y.tab.h: macro.yacc.y
 	$(YACC) -d -t $(SRCDIR)/macro.yacc.y
diff --git a/programs/winver/Makefile.in b/programs/winver/Makefile.in
index e9bf966..e1ec4e0 100644
--- a/programs/winver/Makefile.in
+++ b/programs/winver/Makefile.in
@@ -1,27 +1,12 @@
-DEFS      = -DWINELIB -DSTRICT
+EXTRADEFS = -DSTRICT
 TOPSRCDIR = @top_srcdir@
 TOPOBJDIR = ../..
 SRCDIR    = @srcdir@
 VPATH     = @srcdir@
-MODULE    = none
-PROGRAMS  = winver
-IMPORTS   = advapi32 comctl32 shlwapi shell32 ole32 rpcrt4 user32 gdi32 kernel32 ntdll
+MODULE    = winver
 
 C_SRCS = winver.c
 
-SPEC_SRCS = winver.spec
-
-all: $(PROGRAMS)
-
-@MAKE_RULES@
-
-winver: $(OBJS)
-	$(CC) -o winver $(OBJS) $(DLL_LINK) $(LIBS)
-
-install::
-	$(INSTALL_PROGRAM) winver $(bindir)/winver
-
-uninstall::
-	$(RM) $(bindir)/winver
+@MAKE_PROG_RULES@
 
 ### Dependencies:
diff --git a/programs/winver/winver.spec b/programs/winver/winver.spec
index 7240d31..a8b0ca4 100644
--- a/programs/winver/winver.spec
+++ b/programs/winver/winver.spec
@@ -3,6 +3,5 @@
 type	win32
 
 import	shell32.dll
-import	user32.dll
 import	kernel32.dll
 import	ntdll.dll