diff --git a/build_w32.bat b/build_w32.bat
index 9d75258..5fcf0ab 100755
--- a/build_w32.bat
+++ b/build_w32.bat
@@ -15,6 +15,8 @@ rem
 rem You should have received a copy of the GNU General Public License along
 rem with this program.  If not, see <http://www.gnu.org/licenses/>.
 
+set GCC_FLAG=-DINCLUDEDIR="\".\",\"C:/mydevel/mybin/makelib\""
+
 call :Reset
 
 if "%1" == "-h" goto Usage
@@ -28,6 +30,7 @@ set COMPILER=msvc
 if "%1" == "--debug" goto SetDebug
 if "%1" == "--without-guile" goto NoGuile
 if "%1" == "gcc" goto SetCC
+if "%1" == "MinGW" goto SetMinGW
 if "%1" == "" goto DoneSW
 
 :SetDebug
@@ -43,14 +46,23 @@ goto ParseSW
 
 :SetCC
 set COMPILER=gcc
+set GCC=gcc
 echo Building with GCC
 shift
 goto ParseSW
 
+:SetMinGW
+set COMPILER=gcc
+set GCC=mingw32-gcc
+echo Building with MinGW
+shift
+goto ParseSW
+
+
 rem Build with Guile is supported only on NT and later versions
 :DoneSW
 echo.
-echo Creating GNU Make for Windows 9X/NT/2K/XP/Vista/7/8
+echo Creating GNU Make for Windows 9X/NT/2K/XP/Vista/7/8/10
 if "%DEBUG%" == "Y" echo Building without compiler optimizations
 
 if "%COMPILER%" == "gcc" goto GccBuild
@@ -67,8 +79,10 @@ goto Done
 :GccBuild
 set OUTDIR=.\GccRel
 set OPTS=-O2
+set GCC_LFLAGS=-s
 if "%DEBUG%" == "Y" set OPTS=-O0
 if "%DEBUG%" == "Y" set OUTDIR=.\GccDebug
+if "%DEBUG%" == "Y" set GCC_LFLAGS=
 call :Build
 goto Done
 
@@ -157,7 +171,7 @@ goto :EOF
 :GccCompile
 :: GCC Compile
 echo on
-gcc -mthreads -Wall -std=gnu99 -gdwarf-2 -g3 %OPTS% -I%OUTDIR% -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H %EXTRAS% -o %OUTDIR%\%1.o -c %1.c
+%GCC% %GCC_FLAG% -mthreads -Wall -std=gnu99 -gdwarf-2 -g3 %OPTS% -I%OUTDIR% -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H %EXTRAS% -o %OUTDIR%\%1.o -c %1.c
 @echo off
 goto :EOF
 
@@ -175,7 +189,7 @@ goto :EOF
 :GccLink
 :: GCC Link
 echo on
-gcc -mthreads -gdwarf-2 -g3 -o %OUTDIR%\%MAKE%.exe %OUTDIR%\variable.o %OUTDIR%\rule.o %OUTDIR%\remote-stub.o %OUTDIR%\commands.o %OUTDIR%\file.o %OUTDIR%\getloadavg.o %OUTDIR%\default.o %OUTDIR%\signame.o %OUTDIR%\expand.o %OUTDIR%\dir.o %OUTDIR%\main.o %OUTDIR%\getopt1.o %OUTDIR%\guile.o %OUTDIR%\job.o %OUTDIR%\output.o %OUTDIR%\read.o %OUTDIR%\version.o %OUTDIR%\getopt.o %OUTDIR%\arscan.o %OUTDIR%\remake.o %OUTDIR%\misc.o %OUTDIR%\hash.o %OUTDIR%\strcache.o %OUTDIR%\ar.o %OUTDIR%\function.o %OUTDIR%\vpath.o %OUTDIR%\implicit.o %OUTDIR%\loadapi.o %OUTDIR%\load.o %OUTDIR%\glob\glob.o %OUTDIR%\glob\fnmatch.o %OUTDIR%\w32\pathstuff.o %OUTDIR%\w32\compat\posixfcn.o %OUTDIR%\w32\w32os.o %OUTDIR%\w32\subproc\misc.o %OUTDIR%\w32\subproc\sub_proc.o %OUTDIR%\w32\subproc\w32err.o %GUILELIBS% -lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -luuid -lodbc32 -lodbccp32 -Wl,--out-implib=%OUTDIR%\libgnumake-1.dll.a
+%GCC% %GCC_LFLAGS% -o %OUTDIR%\%MAKE%.exe %OUTDIR%\variable.o %OUTDIR%\rule.o %OUTDIR%\remote-stub.o %OUTDIR%\commands.o %OUTDIR%\file.o %OUTDIR%\getloadavg.o %OUTDIR%\default.o %OUTDIR%\signame.o %OUTDIR%\expand.o %OUTDIR%\dir.o %OUTDIR%\main.o %OUTDIR%\getopt1.o %OUTDIR%\guile.o %OUTDIR%\job.o %OUTDIR%\output.o %OUTDIR%\read.o %OUTDIR%\version.o %OUTDIR%\getopt.o %OUTDIR%\arscan.o %OUTDIR%\remake.o %OUTDIR%\misc.o %OUTDIR%\hash.o %OUTDIR%\strcache.o %OUTDIR%\ar.o %OUTDIR%\function.o %OUTDIR%\vpath.o %OUTDIR%\implicit.o %OUTDIR%\loadapi.o %OUTDIR%\load.o %OUTDIR%\glob\glob.o %OUTDIR%\glob\fnmatch.o %OUTDIR%\w32\pathstuff.o %OUTDIR%\w32\compat\posixfcn.o %OUTDIR%\w32\w32os.o %OUTDIR%\w32\subproc\misc.o %OUTDIR%\w32\subproc\sub_proc.o %OUTDIR%\w32\subproc\w32err.o %GUILELIBS% -lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -luuid -lodbc32 -lodbccp32 -Wl,--out-implib=%OUTDIR%\libgnumake-1.dll.a
 @echo off
 goto :EOF
 
@@ -227,7 +241,7 @@ set "GUILECFLAGS=%GUILECFLAGS% -DHAVE_GUILE"
 goto :EOF
 
 :Usage
-echo Usage: %0 [options] [gcc]
+echo Usage: %0 [options] [gcc^|MinGW]
 echo Options:
 echo.  --debug           For GCC only, make a debug build
 echo.                    (MSVC build always makes both debug and release)
@@ -242,6 +256,7 @@ set GUILE=
 set GUILECFLAGS=
 set GUILELIBS=
 set LINKOPTS=
+set GCC_LFLAGS=
 set MAKE=
 set NOGUILE=
 set OPTS=
