Fixed make install target to work even when nothing has been compiled
yet.
Added install-lib and install-dev targets to allow partial
installations; moved winemaker.man and winelauncher.in to better fit
in the new install categories.

diff --git a/tools/.cvsignore b/tools/.cvsignore
index a98a6c6..3d055f7 100644
--- a/tools/.cvsignore
+++ b/tools/.cvsignore
@@ -2,4 +2,3 @@
 bin2res
 fnt2bdf
 makedep
-winelauncher
diff --git a/tools/Makefile.in b/tools/Makefile.in
index 34dd48f..2fdd45b 100644
--- a/tools/Makefile.in
+++ b/tools/Makefile.in
@@ -4,7 +4,7 @@
 SRCDIR    = @srcdir@
 VPATH     = @srcdir@
 
-PROGRAMS = makedep fnt2bdf bin2res winelauncher
+PROGRAMS = makedep fnt2bdf bin2res
 MODULE   = none
 
 C_SRCS = makedep.c fnt2bdf.c bin2res.c
@@ -15,11 +15,7 @@
 	wmc \
 	wrc
 
-INSTALLSUBDIRS = \
-	winebuild \
-	winedump \
-	wmc \
-	wrc
+INSTALLSUBDIRS = $(SUBDIRS)
 
 EXTRASUBDIRS = \
 	winapi_check \
@@ -27,7 +23,7 @@
 	winapi_check/win32 \
 	wineconf.libs
 
-all: $(PROGRAMS) winebuild winedump wmc wrc
+all: $(PROGRAMS) $(SUBDIRS)
 
 @MAKE_RULES@
 
@@ -40,17 +36,12 @@
 bin2res: bin2res.o
 	$(CC) $(CFLAGS) -o bin2res bin2res.o
 
-winelauncher: winelauncher.in
-	sed -e 's,@bindir\@,$(bindir),g' -e 's,@libdir\@,$(libdir),g' -e 's,@dlldir\@,$(dlldir),g' $(SRCDIR)/winelauncher.in >$@ || $(RM) $@
-
-install:: $(PROGRAMS) $(INSTALLSUBDIRS:%=%/__install__)
-	$(MKINSTALLDIRS) $(bindir)
-	$(INSTALL_PROGRAM) fnt2bdf $(bindir)/fnt2bdf
-	$(INSTALL_SCRIPT) winelauncher $(bindir)/winelauncher
+install::
+	$(MKINSTALLDIRS) $(bindir) $(mandir)/man$(prog_manext)
 	$(INSTALL_SCRIPT) $(SRCDIR)/winemaker $(bindir)/winemaker
-	$(INSTALL_SCRIPT) $(SRCDIR)/wineshelllink $(bindir)/wineshelllink
+	$(INSTALL_DATA) $(SRCDIR)/winemaker.man $(mandir)/man$(prog_manext)/winemaker.$(prog_manext)
 
-uninstall:: $(INSTALLSUBDIRS:%=%/__uninstall__)
-	$(RM) $(bindir)/fnt2bdf $(bindir)/winelauncher $(bindir)/winemaker $(bindir)/wineshelllink
+uninstall::
+	$(RM) $(bindir)/winemaker $(mandir)/man$(prog_manext)/winemaker.$(prog_manext)
 
 ### Dependencies:
diff --git a/tools/winapi/Makefile.in b/tools/winapi/Makefile.in
index ae552fa..86870b8 100644
--- a/tools/winapi/Makefile.in
+++ b/tools/winapi/Makefile.in
@@ -3,15 +3,11 @@
 TOPOBJDIR = ../..
 SRCDIR    = @srcdir@
 VPATH     = @srcdir@
-
-PROGRAMS =
-MODULE   = none
-
-all: $(PROGRAMS)
+MODULE    = none
 
 @MAKE_RULES@
 
-install:: $(PROGRAMS)
+install::
 	$(MKINSTALLDIRS) $(bindir)
 	$(INSTALL_SCRIPT) $(SRCDIR)/trampoline $(bindir)/make_filter
 	$(INSTALL_SCRIPT) $(SRCDIR)/trampoline $(bindir)/winapi_check
diff --git a/tools/winebuild/Makefile.in b/tools/winebuild/Makefile.in
index bbe098f..af89daf 100644
--- a/tools/winebuild/Makefile.in
+++ b/tools/winebuild/Makefile.in
@@ -4,7 +4,7 @@
 SRCDIR    = @srcdir@
 VPATH     = @srcdir@
 
-PROGRAMS = winebuild
+PROGRAMS = winebuild$(EXEEXT)
 MODULE   = none
 
 C_SRCS = \
@@ -22,14 +22,14 @@
 
 @MAKE_RULES@
 
-winebuild: $(OBJS)
-	$(CC) $(CFLAGS) -o winebuild $(OBJS) $(LIBWINE) $(LIBUNICODE) $(LDFLAGS)
+winebuild$(EXEEXT): $(OBJS)
+	$(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBWINE) $(LIBUNICODE) $(LDFLAGS)
 
 install:: $(PROGRAMS)
 	$(MKINSTALLDIRS) $(bindir)
-	$(INSTALL_PROGRAM) winebuild $(bindir)/winebuild
+	$(INSTALL_PROGRAM) winebuild$(EXEEXT) $(bindir)/winebuild$(EXEEXT)
 
 uninstall::
-	$(RM) $(bindir)/winebuild
+	$(RM) $(bindir)/winebuild$(EXEEXT)
 
 ### Dependencies:
diff --git a/tools/winelauncher.in b/tools/winelauncher.in
deleted file mode 100755
index a4ce82d..0000000
--- a/tools/winelauncher.in
+++ /dev/null
@@ -1,552 +0,0 @@
-#!/bin/sh
-#------------------------------------------------------------------------------
-#   Winelauncher
-#       This shell script attempts to intelligently manage the process
-#   of launching a program with Wine.  It adds some level of
-#   visual feedback to an end user.
-#
-#   Usage:
-#       winelauncher [options]  "<windows program> [program arguments]"
-#
-#       This script is meant to be installed to /usr/bin/wine, and
-#   to be used to invoke a Windows executable.
-#       The options are passed through directly to Wine, and are
-#   documented in the Wine man page.
-#
-#   Copyright (c) 2000 by Jeremy White for CodeWeavers
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-#------------------------------------------------------------------------------
-
-#------------------------------------------------------------------------------
-#  Primary configuration area - change this if you installed Wine to
-#    a different location
-#------------------------------------------------------------------------------
-WINEBIN=@bindir@
-WINELIB=@libdir@
-WINESERVER=
-WINEDLLPATH=@dlldir@
-
-#------------------------------------------------------------------------------
-#  Establish Color Scheme
-#------------------------------------------------------------------------------
-COLOR=' -xrm *.Command.background:darkgrey
--xrm *.Command.foreground:black
--xrm *.Text.background:black
--xrm *.Text.foreground:green
--xrm *.Form.background:grey
--xrm *.Form.foreground:green
--xrm *.foreground:green
--xrm *.background:black'
-
-
-#------------------------------------------------------------------------------
-#  Locate either xmessage or gmessage, if we can.
-#------------------------------------------------------------------------------
-type xmessage >/dev/null 2>/dev/null
-if [ $? -ne 0 ] ; then
-    echo "
-Warning:
-   The Wine launcher is unable to find xmessage.
-
-   This launcher script relies heavily on finding this tool,
-   and without it, it will behave poorly.
-
-   Most Linux distributions have one or the other of these
-   tools.
-
-   We strongly recommend that you use your distribution's
-   software methods to locate xmessage."
-
-else
-    XMESSAGE="xmessage $COLOR"
-fi
-
-
-#------------------------------------------------------------------------------
-#  We're going to do a lot of fancy footwork below.
-#    Before we get started, it would be nice to know the argv0
-#    of the actual script we're running (and lets remove at least
-#    one level of symlinking).
-#------------------------------------------------------------------------------
-argv0_path=`which $0`
-if [ -z $argv0_path ] ; then
-    argv0_path=$0
-fi
-
-real_name=`find $argv0_path -type l -printf "%l\n"`
-if [ ! $real_name ]; then
-    real_name=$argv0_path
-elif [ ! -x $real_name ]; then
-    real_name=`find $argv0_path -printf "%h\n"`/$real_name
-fi
-
-argv0_dir=`find $real_name -printf "%h\n"`
-
-if [ -z $argv0_dir ] ; then
-    argv0_dir=.
-fi
-
-#------------------------------------------------------------------------------
-#  Okay, now all that junk above was established at configure time.
-#   However, if this is an RPM install, they may have chosen
-#   to relocate this installation.  If so, that stuff above
-#   is all broken and we should rejigger it.
-#------------------------------------------------------------------------------
-WINE_BIN_NAME=wine.bin
-if [ ! -x $WINEBIN/$WINE_BIN_NAME ] ; then
-    WINEBIN=`find $argv0_dir -maxdepth 1 -perm +0111 -type f -name "$WINE_BIN_NAME" -printf "%h\n" | head -1`
-fi
-
-if [ ! -x $WINEBIN/$WINE_BIN_NAME ] ; then
-    WINEBIN=`find $argv0_dir/../ -maxdepth 1 -perm +0111 -type f -name "$WINE_BIN_NAME" -printf "%h\n" | head -1`
-fi
-
-if [ ! -x $WINEBIN/$WINE_BIN_NAME ] ; then
-    WINE_BIN_NAME=wine
-    if [ ! -x $WINEBIN/$WINE_BIN_NAME ] ; then
-        WINEBIN=`find $argv0_dir -maxdepth 1 -perm +0111 -type f -name "$WINE_BIN_NAME" -printf "%h\n" | head -1`
-    fi
-
-    if [ ! -x $WINEBIN/$WINE_BIN_NAME ] ; then
-        WINEBIN=`find $argv0_dir/../ -maxdepth 1 -perm +0111 -type f -name "$WINE_BIN_NAME" -printf "%h\n" | head -1`
-    fi
-fi
-
-if [ ! -r $WINELIB/libwine.so ] ; then
-    WINELIB=`find $argv0_dir -maxdepth 2 -name 'libwine.so' -printf "%h\n" | head -1`
-fi
-
-if [ ! -r $WINELIB/libwine.so ] ; then
-    WINELIB=`find $argv0_dir/../ -maxdepth 2 -name 'libwine.so' -printf "%h\n" | head -1`
-fi
-
-if [ -x $WINEBIN/wineserver ] ; then
-    WINESERVER=$WINEBIN/wineserver
-fi
-
-#------------------------------------------------------------------------------
-#  Hey, if we built Wine from source, let's add a little extra fun to
-#   mix it up a bit
-#------------------------------------------------------------------------------
-if [ -x $WINEBIN/server/wineserver ] ; then
-    WINESERVER=$WINEBIN/server/wineserver
-fi
-
-if [ -r $WINELIB/dlls/ntdll.dll.so ] ; then
-    WINEDLLPATH=$WINELIB/dlls
-fi
-
-
-#------------------------------------------------------------------------------
-#  Okay, set the paths and move on.
-#------------------------------------------------------------------------------
-export LD_LIBRARY_PATH=$WINELIB:$LD_LIBRARY_PATH
-export PATH=$WINEBIN:$PATH
-export WINELOADER=$WINEBIN/$WINE_BIN_NAME
-export WINEDLLPATH
-export WINESERVER
-
-info_flag=~/.wine/.no_prelaunch_window_flag
-debug_flag=~/.wine/.no_debug_window_flag
-debug_options="-debugmsg warn+all"
-
-if [ -f $info_flag ] ; then
-    use_info_message=0
-else
-    use_info_message=1
-fi
-
-if [ -f $debug_flag ] ; then
-    use_debug_message=0
-else
-    use_debug_message=1
-fi
-
-
-#------------------------------------------------------------------------------
-#  Handle winelib apps going through here
-#------------------------------------------------------------------------------
-winelib=0
-if [ -f $argv0_path.so ] ; then
-    winelib=1
-    export WINEPRELOAD=$argv0_path.so
-fi
-
-
-#------------------------------------------------------------------------------
-#  No arguments?  Help 'em out
-#------------------------------------------------------------------------------
-always_see_output=0
-no_args=0
-if [ $# -eq 0 ] ; then
-    no_args=1
-fi
-
-if [ $# -eq 1 -a "$1" = "" ] ; then
-    no_args=1
-fi
-
-if [ $winelib -eq 1 ] ; then
-    no_args=0
-fi
-
-if [ $no_args -eq 1 ] ; then
-    echo "Wine called with no arguments."
-    echo "Invoking $WINEBIN/$WINE_BIN_NAME $@ ..."
-    $XMESSAGE -buttons "    Okay    ":0," See the Wine Usage Statement ":1,"  Configure Wine  ":2 \
-        -title "Welcome to Wine" \
-        "
-
-        You have started Wine without specifying any arguments.
-
-        Wine requires a least one argument - the name of the Windows
-        application you would like to run.
-
-        If you have launched this through the KDE menu system,
-        you can use the KDE file browser to select a Windows
-        exectuable and then click on it to launch Wine with
-        that application.
-
-        You can similarly use the GNOME file manager to
-        select a Windows executable and double click on it.
-
-        If you would like to see the command line arguments
-        for Wine, select the second option, below.
-
-        "
-    welcome_rc=$?
-    if [ $welcome_rc -eq 0 ] ; then
-        exit
-    fi
-
-    if [ $welcome_rc -eq 2 ] ; then
-        which winesetup
-        if [ $? -eq 0 ] ; then
-            winesetup
-        else
-            if [ -x /opt/wine/bin/winesetup ] ; then
-                /opt/wine/bin/winesetup
-            else
-                $XMESSAGE -title "Error" "Error:  Unable to find winesetup in your PATH or in /opt/wine/bin"
-            fi
-        fi
-        exit
-    fi
-
-    use_info_message=0
-    always_see_output=1
-fi
-
-#------------------------------------------------------------------------------
-#  No config file?  Offer to help 'em out...
-#------------------------------------------------------------------------------
-conf=0
-
-while [ $conf -eq 0 ] ; do
-
-    if [ -f ~/.winerc ] ; then
-        conf=1
-    fi
-    if [ -f ~/.wine/config ] ; then
-        conf=2
-    fi
-    if [ -f /etc/wine.conf ] ; then
-        conf=3
-    fi
-
-    if [ $conf -ne 0 ] ; then
-        break;
-    fi
-
-    echo "No configuration file detected."
-    $XMESSAGE -buttons "    Cancel    ":0,"  Proceed   ":1,"  Configure Wine  ":2 \
-        -title "Welcome to Wine" \
-        "
-
-        You have started Wine but we cannot find a Wine
-        configuration file.
-
-        This is normal if you have never run Wine before.
-        If this is the case, select the 'Configure Wine'
-        option, below, to create a configuration file.
-
-        "
-    init_rc=$?
-    if [ $init_rc -eq 0 ] ; then
-        exit
-    fi
-
-    if [ $init_rc -eq 1 ] ; then
-        break
-    fi
-
-    if [ $init_rc -eq 2 ] ; then
-        which winesetup
-        if [ $? -eq 0 ] ; then
-            winesetup
-        else
-            if [ -x /opt/wine/bin/winesetup ] ; then
-                /opt/wine/bin/winesetup
-            else
-                $XMESSAGE -title "Error" "Error:  Unable to find winesetup in your PATH or in /opt/wine/bin"
-            fi
-        fi
-    fi
-
-done
-
-#------------------------------------------------------------------------------
-#  Optionally Warn the user we're going to be launching Wine...
-#------------------------------------------------------------------------------
-if [ $use_info_message -ne 0 ] ; then
-    echo "Invoking $WINEBIN/$WINE_BIN_NAME $@ ..."
-    $XMESSAGE -timeout 30 -buttons "    Dismiss    ":0," Never display this message again ":3 \
-        -title "Wine Launch Window" \
-        "Invoking $WINEBIN/$WINE_BIN_NAME $@ ...
-
-        This dialog box is a temporary status dialog to let you know
-        that Wine is attempting to launch your application.
-
-        Since Wine is still very much in a development stage, many
-        applications will fail silently.  This dialog box is your indication
-        that we're *trying* to run your application.
-
-        This dialog box will automatically disappear after 30 seconds,
-        or after your application finishes.
-
-        You can permanently disable this dialog by selecting the option below.
-        " &
-    info_message_pid=$!
-fi
-
-#------------------------------------------------------------------------------
-#  Here's a little function to clean up after that dialog...
-#------------------------------------------------------------------------------
-clean_up_info_message ()
-{
-    if [ $use_info_message -ne 0 ] ; then
-
-        #------------------------------------------------------------------------------
-        #  Okay, make sure that the notice window is dead (and kill it if it ain't)
-        #------------------------------------------------------------------------------
-        ps $info_message_pid >/dev/null 2>&1
-        if [ $? -ne 0 ] ; then
-            wait $info_message_pid
-            info_return=$?
-        else
-            info_return=0
-            kill $info_message_pid
-        fi
-
-        #------------------------------------------------------------------------------
-        #  If they didn't like the warning window, turn it off
-        #------------------------------------------------------------------------------
-        if [ $info_return -eq 3 ] ; then
-            $XMESSAGE -title "Wine Prelaunch Control" \
-            "Wine will now disable the prelaunch Window you just saw.
-            You will no longer be notified when Wine is attempting
-            to start a Windows application.
-
-            You can reenable this Window by removing the $info_flag file." -buttons "  Okay  ":0," Cancel ":1
-            if [ $? -eq 0 ] ; then
-                touch $info_flag
-            fi
-        fi
-    fi
-
-    use_info_message=0
-}
-#------------------------------------------------------------------------------
-#  Generate a temporary log file name
-#------------------------------------------------------------------------------
-if [ -n "$TMP" ] ; then
-  log_dir="$TMP"
-else
-  log_dir="/tmp"
-fi
-use_log_name=0
-log_name=`mktemp "$log_dir/wine.log.XXXXXX"`
-if [ $? -eq 0 ] ; then
-    use_log_name=1
-fi
-use_status_name=0
-status_name=`mktemp "$log_dir/wine.status.XXXXXX"`
-if [ $? -eq 0 ] ; then
-    use_status_name=1
-fi
-
-#------------------------------------------------------------------------------
-#  Okay, really launch Wine...
-#------------------------------------------------------------------------------
-if [ $use_log_name -ne 0 -a $use_status_name -ne 0 ] ; then
-    ( $WINEBIN/$WINE_BIN_NAME "$@"; echo $? >$status_name ) 2>&1 | tee "$log_name"
-    wine_return=`cat $status_name`
-else
-    $WINEBIN/$WINE_BIN_NAME "$@"
-    wine_return=$?
-fi
-if [ $use_status_name -ne 0 ] ; then
-    rm -f $status_name
-fi
-
-#------------------------------------------------------------------------------
-#  Test the return code, and see if it fails
-#------------------------------------------------------------------------------
-if [ $always_see_output -eq 0 -a $wine_return -eq 0 ] ; then
-    echo "Wine exited with a successful status"
-    if [ $use_log_name -ne 0 ] ; then
-        rm -f "$log_name"
-    fi
-else
-    if [ $always_see_output -eq 0 ] ; then
-        echo "Wine failed with return code $wine_return"
-    fi
-
-    #------------------------------------------------------------------------------
-    #  Gracefully display a debug message if they like...
-    #------------------------------------------------------------------------------
-    while [ $use_debug_message -gt 0 ] ; do
-
-        #------------------------------------------------------------------------------
-        #  Build up the menu of choices they can make...
-        #------------------------------------------------------------------------------
-        BUTTONS='    Okay    :0'
-        if [ $use_log_name -ne 0 ] ; then
-            BUTTONS="$BUTTONS"', View Log :1'
-        fi
-
-        BUTTONS="$BUTTONS"',  Debug  :2'
-        BUTTONS="$BUTTONS"',  Configure :4'
-        BUTTONS="$BUTTONS"',  Disable :3'
-
-        #------------------------------------------------------------------------------
-        #  Build an error message
-        #------------------------------------------------------------------------------
-        MESSAGE="
-Wine has exited with a failure status of $wine_return.
-
-Wine is still development software, so there can be many
-explanations for this problem.
-
-You can choose to run Wine again with a higher level
-of debug messages (the debug option, below).
-
-You can attempt to reconfigure Wine to make it work better.
-Note that one change you can make that will dramatically
-effect Wine's behaviour is to change whether or not
-Wine uses a true Windows partition, mounted under Linux,
-or whether it uses an empty Windows directory.
-The Wine Configuration program can assist you in making
-those changes (select Configure, below, for more).
-
-You can disable this message entirely by selecting the
-Disable option below."
-
-        if [ $always_see_output -ne 0 -a $wine_return -eq 0 ] ; then
-            MESSAGE="
-Wine has exited with a failure status of $wine_return.
-
-You can disable this message entirely by selecting the
-Disable option below."
-
-        fi
-
-        if [ $use_log_name -ne 0 ] ; then
-            MESSAGE="$MESSAGE
-
-Wine has captured a log of the Wine output in the file $log_name.
-You may view this file by selecting View Log, below."
-        fi
-
-        #------------------------------------------------------------------------------
-        #  Display the message
-        #------------------------------------------------------------------------------
-        $XMESSAGE -title "Wine Finished With Error" -buttons "$BUTTONS" "$MESSAGE"
-        debug_return=$?
-
-        #------------------------------------------------------------------------------
-        #  Dismiss the other window...
-        #------------------------------------------------------------------------------
-        clean_up_info_message
-
-        #------------------------------------------------------------------------------
-        #  Process a configure instruction
-        #------------------------------------------------------------------------------
-        if [ $debug_return -eq 4 ] ; then
-            which winesetup
-            if [ $? -eq 0 ] ; then
-                winesetup
-            else
-                if [ -x /opt/wine/bin/winesetup ] ; then
-                    /opt/wine/bin/winesetup
-                else
-                    $XMESSAGE -title "Error" "Error:  Unable to find winesetup in your PATH or in /opt/wine/bin"
-                fi
-            fi
-            continue;
-        fi
-
-        #------------------------------------------------------------------------------
-        #  Process a view instruction
-        #------------------------------------------------------------------------------
-        if [ $debug_return -eq 1 ] ; then
-            $XMESSAGE -title "View Wine Log" -file "$log_name" -buttons "  Okay  ":0,"Delete $log_name":1
-            if [ $? -eq 1 ] ; then
-                echo "Deleting $log_name"
-                rm -f "$log_name"
-                use_log_name=0
-            fi
-        else
-            use_debug_message=0
-        fi
-
-        #------------------------------------------------------------------------------
-        #  If they didn't like the warning window, turn it off
-        #------------------------------------------------------------------------------
-        if [ $debug_return -eq 3 ] ; then
-            $XMESSAGE -title "Wine Debug Log Control" \
-            "Wine will now disable the Wine debug output control window you just saw.
-            You will no longer be notified when Wine fails to start a
-            Windows application.
-
-            You can reenable this Window by removing the $debug_flag file." -buttons "  Okay  ":0," Cancel ":1
-
-            if [ $? -eq 0 ] ; then
-                touch $debug_flag
-            fi
-
-        fi
-
-        #------------------------------------------------------------------------------
-        #  If they want to retry with debug, let 'em.
-        #------------------------------------------------------------------------------
-        if [ $debug_return -eq 2 ] ; then
-            echo "Rerunning $0 $debug_options $@"
-            exec $0 $debug_options "$@"
-        fi
-    done
-fi
-
-
-clean_up_info_message
-
-# killed by signal?
-if [ $wine_return -ge 128 ]; then
-	# try to kill myself with the same signal
-	kill -$[wine_return - 128] $$
-	# if we get here the kill didn't work
-	exit 1
-fi
diff --git a/tools/winemaker.man b/tools/winemaker.man
new file mode 100644
index 0000000..787b07c
--- /dev/null
+++ b/tools/winemaker.man
@@ -0,0 +1,254 @@
+.\" -*- nroff -*-
+.TH WINEMAKER 1 "September 27, 2001" "Version 0.5.8" "Windows On Unix"
+.SH NAME
+winemaker \- generate a build infrastructure for compiling Windows programs on Unix
+.SH SYNOPSIS
+.B "winemaker "
+[
+.IR               "--nobanner " "] [ " "--backup " "| " "--nobackup " "] [ "--nosource-fix "
+]
+.br
+  [
+.IR               "--lower-none " "| " "--lower-all " "| " "--lower-uppercase "
+]
+.br
+  [
+.IR               "--lower-include " "| " "--nolower-include "
+]
+.br
+  [
+.IR               "--guiexe " "| " "--windows " "| " "--cuiexe " "| " "--console " "| " "--dll "
+]
+.br
+  [
+.IR               "--wrap " "| " "--nowrap " "] [ " "--mfc " "| " "--nomfc "
+]
+.br
+  [
+.IR               "-Dmacro[=defn] " "] [ " "-Idir " "] [ " "-Ldir " "] [ " "-idll" "] [ " "-llibrary "
+]
+.br
+  [
+.IR               "--interactive " "] [ " "--single-target name "
+]
+.br
+  [
+.IR               "--generated-files " "] [ " "--nogenerated-files " "] [ " "--nogenerated-specs "
+]
+
+.SH DESCRIPTION
+.PP
+.B winemaker
+is a perl script designed to help you bootstrap the 
+process of converting your Windows sources to Winelib programs.
+.PP
+In order to do this winemaker can perform the following operations:
+.PP
+- rename your source files and directories to lowercase in the event they 
+got all uppercased during the transfer.
+.PP
+- perform Dos to Unix (CRLF to LF) conversions.
+.PP
+- scan the include statements and resource file references to replace the 
+backslashes with forward slashes.
+.PP
+- during the above step winemaker will also perform a case insensitive search 
+of the referenced file in the include path and rewrite the include statement 
+with the right case if necessary.
+.PP
+- winemaker will also check other more exotic issues like '#pragma pack' 
+usage, use of "afxres.h" in non MFC projects, and more. Whenever it 
+encounters something out of the ordinary, winemaker will warn you about it.
+.PP
+- winemaker can also scan a complete directory tree at once, guess what are 
+the executables and libraries you are trying to build, match them with 
+source files, and generate the corresponding Makefile.in files.
+.PP
+- finally winemaker will generate a global Makefile.in file calling out to all 
+the others, and a configure script customized for use with Winelib.
+.PP
+- winemaker knows about MFC-based project and will generate customized files.
+.PP
+.SH OPTIONS
+.TP
+.I --nobanner
+Disables the printing of the banner.
+.TP
+.I --backup
+Directs winemaker to perform a backup of all the source files in which it 
+makes changes. This is the default.
+.TP
+.I --nobackup
+Tells winemaker not to backup modified source files.
+.TP
+.I --nosource-fix
+Directs winemaker not to try fixing the source files (e.g. Dos to Unix
+conversion). This prevents complaints if the files are readonly.
+.TP
+.I --lower-all
+Tells winemaker to rename all files and directories to lowercase.
+.TP
+.I --lower-uppercase
+Tells winemaker to only rename files and directories that have an all 
+uppercase name. 
+So "HELLO.C" would be renamed but not "World.c".
+.TP
+.I --lower-none
+Tells winemaker not to rename files and directories to lower case. Note 
+that this does not prevent the renaming of a file if its extension cannot 
+be handled as is, e.g. ".Cxx". This is the default.
+.TP
+.I "--lower-include "
+Tells winemaker that if it does not find the file corresponding to an 
+include statement (or other form of file reference for resource files), 
+then it should convert that filename to lowercase. This is the default.
+.TP
+.I "--nolower-include "
+Tells winemaker not to modify the include statement if it cannot find the 
+referenced file.
+.TP
+.IR "--guiexe " "| " "--windows"
+Specifies that whenever winemaker finds an executable target, or a target of 
+unknown type, it should assume that it is a graphical application.
+This is the default.
+.TP
+.IR "--cuiexe " "| " "--console"
+Specifies that whenever winemaker finds an executable target, or a target of 
+unknown type, it should assume that it is a console application.
+.TP
+.I --dll
+This option tells winemaker that whenever it finds a target of unknown type, 
+i.e. for which it does not know whether it is an executable or a library, 
+it should assume it is a library.
+.TP
+.I --wrap
+Specifies that executable targets should be built as libraries and a small 
+executable wrapper generated for them. This technique is sometimes required 
+to solve initialization problems occuring on the application startup.
+.TP
+.I --nowrap
+Specifies that no wrapper should be generated for executable targets. This is 
+the default.
+.TP
+.I --mfc
+Specifies that the targets are MFC based. In such a case winemaker generates a 
+configure script with MFC specific options, modifies the include and 
+library paths accordingly, links the target with the MFC library and 
+generates wrappers for these targets that are executables.
+.TP
+.I --nomfc
+Specifies that targets are not MFC-based. This is the default.
+.TP
+.I -Dmacro[=defn]
+Adds the specified macro definition to the global list of macro definitions. 
+.TP
+.I -Idir
+Appends the specified directory to the global include path.
+.TP
+.I -Ldir
+Appends the specified directory to the global library path.
+.TP
+.I -idll
+Adds the Winelib library to the global list of Winelib libraries to import 
+in the spec file.
+.TP
+.I -llibrary
+Adds the specified library to the global list of libraries to link with.
+.TP
+.I --interactive
+Puts winemaker in interactive mode. In this mode winemaker will ask you to 
+confirm each directory's list of targets, and then to provide directory and 
+target specific options.
+.TP
+.I --single-target name
+Specifies that there is only one target, and that it is called "name".
+.TP
+.I --generated-files
+Tells winemaker to generate the build infrastructure files, i.e. the spec 
+files, the wrapper files, the Makefile.in files, the Make.rules.in file, the 
+configure.in file and the configure script. This is the default.
+.TP
+.I --nogenerated-files
+Tells winemaker not to generate any of the above files.
+.TP
+.I --nogenerated-specs
+Tells winemaker not to generate the spec files when generating files.  This is
+particularly useful when using winemaker to generate a build environment and
+you already have a spec file.
+
+.SH EXAMPLES
+.PP
+Here is a typical winemaker use:
+.PP
+$ winemaker --lower-uppercase -DSTRICT
+.PP
+The above tells winemaker to scan the current directory and its 
+subdirectories for source files. Whenever if finds a file or directory which 
+name is all uppercase, it should rename it to lowercase. It should then fix 
+all these source files for compilation with Winelib and generate Makefiles. 
+The '-DSTRICT' specifies that the STRICT macro must be set when compiling 
+these sources. Finally winemaker will create a global Makefile.in and 
+configure.in, and run autoconf to generate the configure script.
+.PP
+The next step would be:
+.PP
+$ ./configure --with-wine=/usr/local/opt/wine
+.PP
+This generates the makefiles from the Makefile.in files. The generated 
+makefiles will fetch the Winelib headers and libraries from the Wine 
+installation located in /usr/local/opt/wine.
+.PP
+And finally:
+.PP
+$ make
+.PP
+If at this point you get compilation errors (which is quite likely for a 
+reasonably sized project) then you should consult the Winelib User Guide to 
+find tips on how to resolve them.
+.PP
+For an MFC-based project one would have run the following commands instead:
+.PP
+$ winemaker --lower-uppercase --mfc
+.br
+$ ./configure --with-wine=/usr/local/opt/wine \\
+.br
+              --with-mfc=/usr/local/opt/mfc
+.br
+$ make
+.PP
+
+.SH TODO / BUGS
+.PP
+Winemaker should support the Visual Studio project files (.dsp for newer 
+versions and .mak for some older versions). This would allow it to be much 
+more accurate, especially for the macro, include and library path 
+settings.
+.PP
+Assuming that the windows executable/library is available, we could 
+use a pedump-like tool to determine what kind of executable it is (graphical 
+or console), which libraries it is linked with, and which functions it 
+exports (for libraries). We could then restore all these settings for the 
+corresponding Winelib target. The problem is that we should have such a tool 
+available under the Wine license first.
+.PP
+The wrapper code should be generic, i.e. you should be able to have just one 
+wrapper and specify which library to load using an option.
+.PP
+Furthermore it is not very good at finding the library containing the 
+executable: it must either be in the current directory or in the 
+.IR LD_LIBRARY_PATH .
+.PP
+Winemaker does not support message files and the message compiler yet.
+.PP
+
+.SH SEE ALSO
+.PP
+The Winelib User Guide:
+.PP
+http://wine.codeweavers.com/docs/winelib-user/
+.PP
+.BR wine (1)
+.PP
+
+.SH AUTHOR
+Francois Gouget <fgouget@codeweavers.com> for CodeWeavers
diff --git a/tools/wmc/Makefile.in b/tools/wmc/Makefile.in
index 3fc6557..0d65de8 100644
--- a/tools/wmc/Makefile.in
+++ b/tools/wmc/Makefile.in
@@ -40,9 +40,9 @@
 install:: $(PROGRAMS)
 	$(MKINSTALLDIRS) $(bindir) $(mandir)/man$(prog_manext)
 	$(INSTALL_DATA) $(SRCDIR)/wmc.man $(mandir)/man$(prog_manext)/wmc.$(prog_manext)
-	$(INSTALL_PROGRAM) wmc $(bindir)/wmc
+	$(INSTALL_PROGRAM) wmc$(EXEEXT) $(bindir)/wmc$(EXEEXT)
 
 uninstall::
-	$(RM) $(bindir)/wmc $(mandir)/man$(prog_manext)/wmc.$(prog_manext)
+	$(RM) $(bindir)/wmc$(EXEEXT) $(mandir)/man$(prog_manext)/wmc.$(prog_manext)
 
 ### Dependencies:
diff --git a/tools/wrc/Makefile.in b/tools/wrc/Makefile.in
index a4baae6..a101e78 100644
--- a/tools/wrc/Makefile.in
+++ b/tools/wrc/Makefile.in
@@ -52,9 +52,9 @@
 install:: $(PROGRAMS)
 	$(MKINSTALLDIRS) $(bindir) $(mandir)/man$(prog_manext)
 	$(INSTALL_DATA) $(SRCDIR)/wrc.man $(mandir)/man$(prog_manext)/wrc.$(prog_manext)
-	$(INSTALL_PROGRAM) wrc $(bindir)/wrc
+	$(INSTALL_PROGRAM) wrc$(EXEEXT) $(bindir)/wrc$(EXEEXT)
 
 uninstall::
-	$(RM) $(bindir)/wrc $(mandir)/man$(prog_manext)/wrc.$(prog_manext)
+	$(RM) $(bindir)/wrc$(EXEEXT) $(mandir)/man$(prog_manext)/wrc.$(prog_manext)
 
 ### Dependencies: