Bump to 4.4
[platform/upstream/make.git] / build_w32.bat
index de758b0..30ca0b2 100644 (file)
 @echo off\r
-rem Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,\r
-rem 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.\r
-rem This file is part of GNU Make.\r
-rem\r
-rem GNU Make is free software; you can redistribute it and/or modify it under\r
-rem the terms of the GNU General Public License as published by the Free\r
-rem Software Foundation; either version 3 of the License, or (at your option)\r
-rem any later version.\r
-rem\r
-rem GNU Make is distributed in the hope that it will be useful, but WITHOUT\r
-rem ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or\r
-rem FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for.\r
-rem more details.\r
-rem\r
-rem You should have received a copy of the GNU General Public License along\r
-rem with this program.  If not, see <http://www.gnu.org/licenses/>.\r
-\r
-if exist config.h.W32 GoTo NotCVS\r
-sed -n "s/^AC_INIT(\[GNU make\],\[\([^]]\+\)\].*/s,%%VERSION%%,\1,g/p" configure.in > config.h.W32.sed\r
-echo s,%%PACKAGE%%,make,g >> config.h.W32.sed\r
-sed -f config.h.W32.sed config.h.W32.template > config.h.W32\r
-:NotCVS\r
-if not exist config.h copy config.h.W32 config.h\r
-cd w32\subproc\r
-echo "Creating the subproc library"\r
-%ComSpec% /c build.bat %1\r
-cd ..\..\r
-\r
-if exist link.dbg del link.dbg\r
-if exist link.rel del link.rel\r
-echo "Creating GNU Make for Windows 9X/NT/2K/XP"\r
-if "%1" == "gcc" GoTo GCCBuild\r
-set make=gnumake\r
-echo on\r
-if not exist .\WinDebug\nul mkdir .\WinDebug\r
-cl.exe /nologo /MT /W4 /GX /Zi /YX /Od /I . /I glob /I w32/include /D TIVOLI /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c variable.c\r
-echo WinDebug\variable.obj >>link.dbg\r
-cl.exe /nologo /MT /W4 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c rule.c\r
-echo WinDebug\rule.obj >>link.dbg\r
-cl.exe /nologo /MT /W4 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c remote-stub.c\r
-echo WinDebug\remote-stub.obj >>link.dbg\r
-cl.exe /nologo /MT /W4 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c commands.c\r
-echo WinDebug\commands.obj >>link.dbg\r
-cl.exe /nologo /MT /W4 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c file.c\r
-echo WinDebug\file.obj >>link.dbg\r
-cl.exe /nologo /MT /W4 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c getloadavg.c\r
-echo WinDebug\getloadavg.obj >>link.dbg\r
-cl.exe /nologo /MT /W4 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c default.c\r
-echo WinDebug\default.obj >>link.dbg\r
-cl.exe /nologo /MT /W4 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c signame.c\r
-echo WinDebug\signame.obj >>link.dbg\r
-cl.exe /nologo /MT /W4 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c expand.c\r
-echo WinDebug\expand.obj >>link.dbg\r
-cl.exe /nologo /MT /W4 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c dir.c\r
-echo WinDebug\dir.obj >>link.dbg\r
-cl.exe /nologo /MT /W4 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c main.c\r
-echo WinDebug\main.obj >>link.dbg\r
-cl.exe /nologo /MT /W4 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c getopt1.c\r
-echo WinDebug\getopt1.obj >>link.dbg\r
-cl.exe /nologo /MT /W4 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c job.c\r
-echo WinDebug\job.obj >>link.dbg\r
-cl.exe /nologo /MT /W4 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c read.c\r
-echo WinDebug\read.obj >>link.dbg\r
-cl.exe /nologo /MT /W4 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c version.c\r
-echo WinDebug\version.obj >>link.dbg\r
-cl.exe /nologo /MT /W4 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c getopt.c\r
-echo WinDebug\getopt.obj >>link.dbg\r
-cl.exe /nologo /MT /W4 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c arscan.c\r
-echo WinDebug\arscan.obj >>link.dbg\r
-cl.exe /nologo /MT /W4 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c hash.c\r
-echo WinDebug\hash.obj >>link.dbg\r
-cl.exe /nologo /MT /W4 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c strcache.c\r
-echo WinDebug\strcache.obj >>link.dbg\r
-cl.exe /nologo /MT /W4 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c remake.c\r
-echo WinDebug\remake.obj >>link.dbg\r
-cl.exe /nologo /MT /W4 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c misc.c\r
-echo WinDebug\misc.obj >>link.dbg\r
-cl.exe /nologo /MT /W4 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c ar.c\r
-echo WinDebug\ar.obj >>link.dbg\r
-cl.exe /nologo /MT /W4 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c function.c\r
-echo WinDebug\function.obj >>link.dbg\r
-cl.exe /nologo /MT /W4 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c vpath.c\r
-echo WinDebug\vpath.obj >>link.dbg\r
-cl.exe /nologo /MT /W4 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c implicit.c\r
-echo WinDebug\implicit.obj >>link.dbg\r
-cl.exe /nologo /MT /W4 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c  .\w32\compat\dirent.c\r
-echo WinDebug\dirent.obj >>link.dbg\r
-cl.exe /nologo /MT /W4 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c  .\glob\glob.c\r
-echo WinDebug\glob.obj >>link.dbg\r
-cl.exe /nologo /MT /W4 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c  .\glob\fnmatch.c\r
-echo WinDebug\fnmatch.obj >>link.dbg\r
-cl.exe /nologo /MT /W4 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c  .\w32\pathstuff.c\r
-echo WinDebug\pathstuff.obj >>link.dbg\r
-echo off\r
-echo "Linking WinDebug/%make%.exe"\r
-rem link.exe kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib w32\subproc\windebug\subproc.lib /NOLOGO /SUBSYSTEM:console /INCREMENTAL:yes /PDB:.\WinDebug/%make%.pdb /DEBUG /OUT:.\WinDebug/%make%.exe .\WinDebug/variable.obj  .\WinDebug/rule.obj  .\WinDebug/remote-stub.obj  .\WinDebug/commands.obj  .\WinDebug/file.obj  .\WinDebug/getloadavg.obj  .\WinDebug/default.obj  .\WinDebug/signame.obj  .\WinDebug/expand.obj  .\WinDebug/dir.obj  .\WinDebug/main.obj  .\WinDebug/getopt1.obj  .\WinDebug/job.obj  .\WinDebug/read.obj  .\WinDebug/version.obj  .\WinDebug/getopt.obj  .\WinDebug/arscan.obj  .\WinDebug/remake.obj  .\WinDebug/hash.obj  .\WinDebug/strcache.obj  .\WinDebug/misc.obj  .\WinDebug/ar.obj  .\WinDebug/function.obj  .\WinDebug/vpath.obj  .\WinDebug/implicit.obj  .\WinDebug/dirent.obj  .\WinDebug/glob.obj  .\WinDebug/fnmatch.obj  .\WinDebug/pathstuff.obj\r
-echo kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib w32\subproc\windebug\subproc.lib >>link.dbg\r
-link.exe /NOLOGO /SUBSYSTEM:console /INCREMENTAL:yes /PDB:.\WinDebug/%make%.pdb /DEBUG /OUT:.\WinDebug/%make%.exe @link.dbg\r
-if not exist .\WinDebug/%make%.exe echo "WinDebug build failed"\r
-if exist .\WinDebug/%make%.exe echo "WinDebug build succeeded!"\r
-if not exist .\WinRel\nul mkdir .\WinRel\r
-echo on\r
-cl.exe /nologo /MT /W4 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D TIVOLI /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c variable.c\r
-echo WinRel\variable.obj >>link.rel\r
-cl.exe /nologo /MT /W4 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c rule.c\r
-echo WinRel\rule.obj >>link.rel\r
-cl.exe /nologo /MT /W4 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c remote-stub.c\r
-echo WinRel\remote-stub.obj >>link.rel\r
-cl.exe /nologo /MT /W4 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c commands.c\r
-echo WinRel\commands.obj >>link.rel\r
-cl.exe /nologo /MT /W4 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c file.c\r
-echo WinRel\file.obj >>link.rel\r
-cl.exe /nologo /MT /W4 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c getloadavg.c\r
-echo WinRel\getloadavg.obj >>link.rel\r
-cl.exe /nologo /MT /W4 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c default.c\r
-echo WinRel\default.obj >>link.rel\r
-cl.exe /nologo /MT /W4 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c signame.c\r
-echo WinRel\signame.obj >>link.rel\r
-cl.exe /nologo /MT /W4 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c expand.c\r
-echo WinRel\expand.obj >>link.rel\r
-cl.exe /nologo /MT /W4 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c dir.c\r
-echo WinRel\dir.obj >>link.rel\r
-cl.exe /nologo /MT /W4 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c main.c\r
-echo WinRel\main.obj >>link.rel\r
-cl.exe /nologo /MT /W4 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c getopt1.c\r
-echo WinRel\getopt1.obj >>link.rel\r
-cl.exe /nologo /MT /W4 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c job.c\r
-echo WinRel\job.obj >>link.rel\r
-cl.exe /nologo /MT /W4 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c read.c\r
-echo WinRel\read.obj >>link.rel\r
-cl.exe /nologo /MT /W4 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c version.c\r
-echo WinRel\version.obj >>link.rel\r
-cl.exe /nologo /MT /W4 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c getopt.c\r
-echo WinRel\getopt.obj >>link.rel\r
-cl.exe /nologo /MT /W4 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c arscan.c\r
-echo WinRel\arscan.obj >>link.rel\r
-cl.exe /nologo /MT /W4 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c remake.c\r
-echo WinRel\remake.obj >>link.rel\r
-cl.exe /nologo /MT /W4 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c hash.c\r
-echo WinRel\hash.obj >>link.rel\r
-cl.exe /nologo /MT /W4 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c strcache.c\r
-echo WinRel\strcache.obj >>link.rel\r
-cl.exe /nologo /MT /W4 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c misc.c\r
-echo WinRel\misc.obj >>link.rel\r
-cl.exe /nologo /MT /W4 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c ar.c\r
-echo WinRel\ar.obj >>link.rel\r
-cl.exe /nologo /MT /W4 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c function.c\r
-echo WinRel\function.obj >>link.rel\r
-cl.exe /nologo /MT /W4 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c vpath.c\r
-echo WinRel\vpath.obj >>link.rel\r
-cl.exe /nologo /MT /W4 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c implicit.c\r
-echo WinRel\implicit.obj >>link.rel\r
-cl.exe /nologo /MT /W4 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c  .\w32\compat\dirent.c\r
-echo WinRel\dirent.obj >>link.rel\r
-cl.exe /nologo /MT /W4 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c  .\glob\glob.c\r
-echo WinRel\glob.obj >>link.rel\r
-cl.exe /nologo /MT /W4 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c  .\glob\fnmatch.c\r
-echo WinRel\fnmatch.obj >>link.rel\r
-cl.exe /nologo /MT /W4 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c  .\w32\pathstuff.c\r
-echo WinRel\pathstuff.obj >>link.rel\r
-echo off\r
-echo "Linking WinRel/%make%.exe"\r
-rem link.exe kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib w32\subproc\winrel\subproc.lib /NOLOGO /SUBSYSTEM:console /INCREMENTAL:no /PDB:.\WinRel/%make%.pdb /OUT:.\WinRel/%make%.exe .\WinRel/variable.obj  .\WinRel/rule.obj  .\WinRel/remote-stub.obj  .\WinRel/commands.obj  .\WinRel/file.obj  .\WinRel/getloadavg.obj  .\WinRel/default.obj  .\WinRel/signame.obj  .\WinRel/expand.obj  .\WinRel/dir.obj  .\WinRel/main.obj  .\WinRel/getopt1.obj  .\WinRel/job.obj  .\WinRel/read.obj  .\WinRel/version.obj  .\WinRel/getopt.obj  .\WinRel/arscan.obj  .\WinRel/remake.obj  .\WinRel/misc.obj  .\WinRel/hash.obj  .\WinRel/strcache.obj  .\WinRel/ar.obj  .\WinRel/function.obj  .\WinRel/vpath.obj  .\WinRel/implicit.obj  .\WinRel/dirent.obj  .\WinRel/glob.obj  .\WinRel/fnmatch.obj  .\WinRel/pathstuff.obj\r
-echo kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib w32\subproc\winrel\subproc.lib >>link.rel\r
-link.exe /NOLOGO /SUBSYSTEM:console /INCREMENTAL:no /PDB:.\WinRel/%make%.pdb /OUT:.\WinRel/%make%.exe @link.rel\r
-if not exist .\WinRel/%make%.exe echo "WinRel build failed"\r
-if exist .\WinRel/%make%.exe echo "WinRel build succeeded!"\r
-set make=\r
-GoTo BuildEnd\r
-:GCCBuild\r
-echo on\r
-gcc -mthreads -Wall -gdwarf-2 -g3 -O2 -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c variable.c\r
-gcc -mthreads -Wall -gdwarf-2 -g3 -O2 -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c rule.c\r
-gcc -mthreads -Wall -gdwarf-2 -g3 -O2 -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c remote-stub.c\r
-gcc -mthreads -Wall -gdwarf-2 -g3 -O2 -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c commands.c\r
-gcc -mthreads -Wall -gdwarf-2 -g3 -O2 -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c file.c\r
-gcc -mthreads -Wall -gdwarf-2 -g3 -O2 -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c getloadavg.c\r
-gcc -mthreads -Wall -gdwarf-2 -g3 -O2 -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c default.c\r
-gcc -mthreads -Wall -gdwarf-2 -g3 -O2 -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c signame.c\r
-gcc -mthreads -Wall -gdwarf-2 -g3 -O2 -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c expand.c\r
-gcc -mthreads -Wall -gdwarf-2 -g3 -O2 -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c dir.c\r
-gcc -mthreads -Wall -gdwarf-2 -g3 -O2 -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c main.c\r
-gcc -mthreads -Wall -gdwarf-2 -g3 -O2 -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c getopt1.c\r
-gcc -mthreads -Wall -gdwarf-2 -g3 -O2 -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c job.c\r
-gcc -mthreads -Wall -gdwarf-2 -g3 -O2 -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c read.c\r
-gcc -mthreads -Wall -gdwarf-2 -g3 -O2 -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c version.c\r
-gcc -mthreads -Wall -gdwarf-2 -g3 -O2 -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c getopt.c\r
-gcc -mthreads -Wall -gdwarf-2 -g3 -O2 -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c arscan.c\r
-gcc -mthreads -Wall -gdwarf-2 -g3 -O2 -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c remake.c\r
-gcc -mthreads -Wall -gdwarf-2 -g3 -O2 -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c hash.c\r
-gcc -mthreads -Wall -gdwarf-2 -g3 -O2 -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c strcache.c\r
-gcc -mthreads -Wall -gdwarf-2 -g3 -O2 -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c misc.c\r
-gcc -mthreads -Wall -gdwarf-2 -g3 -O2 -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c ar.c\r
-gcc -mthreads -Wall -gdwarf-2 -g3 -O2 -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c function.c\r
-gcc -mthreads -Wall -gdwarf-2 -g3 -O2 -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c vpath.c\r
-gcc -mthreads -Wall -gdwarf-2 -g3 -O2 -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c implicit.c\r
-gcc -mthreads -Wall -gdwarf-2 -g3 -O2 -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c ./glob/glob.c -o glob.o\r
-gcc -mthreads -Wall -gdwarf-2 -g3 -O2 -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c ./glob/fnmatch.c -o fnmatch.o\r
-gcc -mthreads -Wall -gdwarf-2 -g3 -O2 -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c ./w32/pathstuff.c -o pathstuff.o\r
-gcc -mthreads -gdwarf-2 -g3 -o gnumake.exe variable.o rule.o remote-stub.o commands.o file.o getloadavg.o default.o signame.o expand.o dir.o main.o getopt1.o job.o read.o version.o getopt.o arscan.o remake.o misc.o hash.o strcache.o ar.o function.o vpath.o implicit.o glob.o fnmatch.o pathstuff.o w32_misc.o sub_proc.o w32err.o -lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -luuid -lodbc32 -lodbccp32\r
-:BuildEnd\r
-echo on\r
+:: Copyright (C) 1996-2022 Free Software Foundation, Inc.\r
+:: This file is part of GNU Make.\r
+::\r
+:: GNU Make is free software; you can redistribute it and/or modify it under\r
+:: the terms of the GNU General Public License as published by the Free\r
+:: Software Foundation; either version 3 of the License, or (at your option)\r
+:: any later version.\r
+::\r
+:: GNU Make is distributed in the hope that it will be useful, but WITHOUT\r
+:: ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or\r
+:: FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for.\r
+:: more details.\r
+::\r
+:: You should have received a copy of the GNU General Public License along\r
+:: with this program.  If not, see <https://www.gnu.org/licenses/>.\r
+\r
+setlocal\r
+if not "%RECURSEME%"=="%~0" (\r
+    set "RECURSEME=%~0"\r
+    %ComSpec% /s /c ""%~0" %*"\r
+    goto :EOF\r
+)\r
+\r
+call :Reset\r
+\r
+if "%1" == "-h" goto Usage\r
+if "%1" == "--help" goto Usage\r
+\r
+echo.\r
+echo Creating GNU Make for Windows 9X/NT/2K/XP/Vista/7/8/10\r
+echo.\r
+\r
+set MAKE=gnumake\r
+set GUILE=Y\r
+set COMPILER=cl.exe\r
+set O=obj\r
+set ARCH=x64\r
+set DEBUG=N\r
+set DIRENT=Y\r
+set VERBOSE=N\r
+\r
+if exist maintMakefile (\r
+    set MAINT=Y\r
+) else (\r
+    set MAINT=N\r
+)\r
+\r
+:ParseSW\r
+if "%1" == "--verbose" goto SetVerbose\r
+if "%1" == "--debug" goto SetDebug\r
+if "%1" == "--without-guile" goto NoGuile\r
+if "%1" == "--x86" goto Set32Bit\r
+if "%1" == "gcc" goto SetCC\r
+if "%1" == "tcc" goto SetTCC\r
+if "%1" == "" goto DoneSW\r
+goto Usage\r
+\r
+:SetVerbose\r
+set VERBOSE=Y\r
+shift\r
+goto ParseSW\r
+\r
+:SetDebug\r
+set DEBUG=Y\r
+echo - Building without compiler optimizations\r
+shift\r
+goto ParseSW\r
+\r
+:NoGuile\r
+set GUILE=N\r
+echo - Building without Guile\r
+shift\r
+goto ParseSW\r
+\r
+:Set32Bit\r
+set ARCH=x86\r
+echo - Building 32bit GNU Make\r
+shift\r
+goto ParseSW\r
+\r
+:SetCC\r
+set COMPILER=gcc\r
+set O=o\r
+echo - Building with GCC\r
+shift\r
+goto ParseSW\r
+\r
+:SetTCC\r
+set COMPILER=tcc\r
+set O=o\r
+echo - Building with TinyC\r
+shift\r
+goto ParseSW\r
+\r
+:DoneSW\r
+if "%MAINT%" == "Y" echo - Enabling maintainer mode\r
+\r
+if "%COMPILER%" == "gcc" goto FindGcc\r
+if "%COMPILER%" == "tcc" goto FindTcc\r
+\r
+:: Find a compiler.  Visual Studio requires a lot of effort to locate :-/.\r
+call %COMPILER% >nul 2>&1\r
+if not ERRORLEVEL 1 goto FoundMSVC\r
+\r
+:: Visual Studio 17 and above provides the "vswhere" tool\r
+call :FindVswhere\r
+if ERRORLEVEL 1 goto LegacyVS\r
+\r
+for /f "tokens=* usebackq" %%i in (`"%VSWHERE%" -latest -property installationPath`) do (\r
+    set InstallPath=%%i\r
+)\r
+set "VSVARS=%InstallPath%\VC\Auxiliary\Build\vcvarsall.bat"\r
+call :CheckMSVC\r
+if not ERRORLEVEL 1 goto FoundMSVC\r
+\r
+:: No "vswhere" or it can't find a compiler.  Go old-school.\r
+:LegacyVS\r
+set "VSVARS=%VS150COMNTOOLS%\..\..\VC\vcvarsall.bat"\r
+call :CheckMSVC\r
+if not ERRORLEVEL 1 goto FoundMSVC\r
+\r
+set "VSVARS=%VS140COMNTOOLS%\..\..\VC\vcvarsall.bat"\r
+call :CheckMSVC\r
+if not ERRORLEVEL 1 goto FoundMSVC\r
+\r
+set "VSVARS=%VS120COMNTOOLS%\..\..\VC\vcvarsall.bat"\r
+call :CheckMSVC\r
+if not ERRORLEVEL 1 goto FoundMSVC\r
+\r
+set "VSVARS=%VS110COMNTOOLS%\..\..\VC\vcvarsall.bat"\r
+call :CheckMSVC\r
+if not ERRORLEVEL 1 goto FoundMSVC\r
+\r
+set "VSVARS=%VS100COMNTOOLS%\..\..\VC\vcvarsall.bat"\r
+call :CheckMSVC\r
+if not ERRORLEVEL 1 goto FoundMSVC\r
+\r
+set "VSVARS=%VS90COMNTOOLS%\..\..\VC\vcvarsall.bat"\r
+call :CheckMSVC\r
+if not ERRORLEVEL 1 goto FoundMSVC\r
+\r
+set "VSVARS=%VS80COMNTOOLS%\..\..\VC\vcvarsall.bat"\r
+call :CheckMSVC\r
+if not ERRORLEVEL 1 goto FoundMSVC\r
+\r
+set "VSVARS=%VS71COMNTOOLS%\..\..\VC\vcvarsall.bat"\r
+call :CheckMSVC\r
+if not ERRORLEVEL 1 goto FoundMSVC\r
+\r
+set "VSVARS=%VS70COMNTOOLS%\..\..\VC\vcvarsall.bat"\r
+call :CheckMSVC\r
+if not ERRORLEVEL 1 goto FoundMSVC\r
+\r
+set "VSVARS=%V6TOOLS%\VC98\Bin\vcvars32.bat"\r
+call :CheckMSVC\r
+if not ERRORLEVEL 1 goto FoundMSVC\r
+\r
+set "VSVARS=%V6TOOLS%\VC97\Bin\vcvars32.bat"\r
+call :CheckMSVC\r
+if not ERRORLEVEL 1 goto FoundMSVC\r
+\r
+set "VSVARS=%V5TOOLS%\VC\Bin\vcvars32.bat"\r
+call :CheckMSVC\r
+if not ERRORLEVEL 1 goto FoundMSVC\r
+\r
+:: We did not find anything--fail\r
+echo No MSVC compiler available.\r
+echo Please run vcvarsall.bat and/or configure your Path.\r
+exit 1\r
+\r
+:FoundMSVC\r
+set OUTDIR=.\WinRel\r
+set LNKOUT=./WinRel\r
+set "OPTS=/O2 /D NDEBUG"\r
+set LINKOPTS=\r
+if "%DEBUG%" == "Y" set OUTDIR=.\WinDebug\r
+if "%DEBUG%" == "Y" set LNKOUT=./WinDebug\r
+if "%DEBUG%" == "Y" set "OPTS=/Zi /Od /D _DEBUG"\r
+if "%DEBUG%" == "Y" set LINKOPTS=/DEBUG\r
+if "%MAINT%" == "Y" set "OPTS=%OPTS% /D MAKE_MAINTAINER_MODE"\r
+:: Show the compiler version that we found\r
+:: Unfortunately this also shows a "usage" note; I can't find anything better.\r
+echo.\r
+call %COMPILER%\r
+goto Build\r
+\r
+:FindGcc\r
+set OUTDIR=.\GccRel\r
+set LNKOUT=./GccRel\r
+set OPTS=-O2\r
+set DIRENT=N\r
+if "%DEBUG%" == "Y" set OPTS=-O0\r
+if "%DEBUG%" == "Y" set OUTDIR=.\GccDebug\r
+if "%DEBUG%" == "Y" set LNKOUT=./GccDebug\r
+if "%MAINT%" == "Y" set "OPTS=%OPTS% -DMAKE_MAINTAINER_MODE"\r
+:: Show the compiler version that we found\r
+echo.\r
+call %COMPILER% --version\r
+if not ERRORLEVEL 1 goto Build\r
+echo No %COMPILER% found.\r
+exit 1\r
+\r
+:FindTcc\r
+set OUTDIR=.\TccRel\r
+set LNKOUT=./TccRel\r
+set OPTS=-O2\r
+if "%DEBUG%" == "Y" set OPTS=-O0\r
+if "%DEBUG%" == "Y" set OUTDIR=.\TccDebug\r
+if "%DEBUG%" == "Y" set LNKOUT=./TccDebug\r
+if "%MAINT%" == "Y" set "OPTS=%OPTS% -DMAKE_MAINTAINER_MODE"\r
+:: Show the compiler version that we found\r
+echo.\r
+call %COMPILER% -v\r
+if not ERRORLEVEL 1 goto Build\r
+echo No %COMPILER% found.\r
+exit 1\r
+\r
+:Build\r
+:: Clean the directory if it exists\r
+if exist %OUTDIR%\nul rmdir /S /Q %OUTDIR%\r
+\r
+:: Recreate it\r
+mkdir %OUTDIR%\r
+mkdir %OUTDIR%\src\r
+mkdir %OUTDIR%\src\w32\r
+mkdir %OUTDIR%\src\w32\compat\r
+mkdir %OUTDIR%\src\w32\subproc\r
+mkdir %OUTDIR%\lib\r
+\r
+if "%GUILE%" == "Y" call :ChkGuile\r
+\r
+if not exist src\config.h.W32 goto NotConfig\r
+\r
+echo.\r
+echo Compiling %OUTDIR% version\r
+\r
+copy src\config.h.W32 %OUTDIR%\src\config.h\r
+\r
+copy lib\glob.in.h %OUTDIR%\lib\glob.h\r
+copy lib\fnmatch.in.h %OUTDIR%\lib\fnmatch.h\r
+\r
+if exist %OUTDIR%\link.sc del %OUTDIR%\link.sc\r
+\r
+call :Compile src/ar\r
+call :Compile src/arscan\r
+call :Compile src/commands\r
+call :Compile src/default\r
+call :Compile src/dir\r
+call :Compile src/expand\r
+call :Compile src/file\r
+call :Compile src/function\r
+call :Compile src/getopt\r
+call :Compile src/getopt1\r
+call :Compile src/guile GUILE\r
+call :Compile src/hash\r
+call :Compile src/implicit\r
+call :Compile src/job\r
+call :Compile src/load\r
+call :Compile src/loadapi\r
+call :Compile src/main GUILE\r
+call :Compile src/misc\r
+call :Compile src/output\r
+call :Compile src/read\r
+call :Compile src/remake\r
+call :Compile src/remote-stub\r
+call :Compile src/rule\r
+call :Compile src/shuffle\r
+call :Compile src/signame\r
+call :Compile src/strcache\r
+call :Compile src/variable\r
+call :Compile src/version\r
+call :Compile src/vpath\r
+call :Compile src/w32/pathstuff\r
+call :Compile src/w32/w32os\r
+call :Compile src/w32/compat/posixfcn\r
+call :Compile src/w32/subproc/misc\r
+call :Compile src/w32/subproc/sub_proc\r
+call :Compile src/w32/subproc/w32err\r
+call :Compile lib/fnmatch\r
+call :Compile lib/glob\r
+call :Compile lib/getloadavg\r
+\r
+:: Compile dirent unless it is supported by compiler library (like with gcc).\r
+if "%DIRENT%" == "Y" call :Compile src\w32\compat\dirent\r
+\r
+call :Link\r
+\r
+echo.\r
+if exist %OUTDIR%\%MAKE%.exe goto Success\r
+echo %OUTDIR% build FAILED!\r
+exit 1\r
+\r
+:Success\r
+echo %OUTDIR% build succeeded.\r
+if exist Basic.mk copy /Y Basic.mk Makefile\r
+if not exist tests\config-flags.pm copy /Y tests\config-flags.pm.W32 tests\config-flags.pm\r
+call :Reset\r
+goto :EOF\r
+\r
+::\r
+:: Subroutines\r
+::\r
+\r
+:Compile\r
+if "%VERBOSE%" == "N" echo - Compiling %1.c\r
+echo %LNKOUT%/%1.%O% >>%OUTDIR%\link.sc\r
+set EXTRAS=\r
+if "%2" == "GUILE" set "EXTRAS=%GUILECFLAGS%"\r
+if exist "%OUTDIR%\%1.%O%" del "%OUTDIR%\%1.%O%"\r
+if "%COMPILER%" == "gcc" goto GccCompile\r
+if "%COMPILER%" == "tcc" goto TccCompile\r
+\r
+:: MSVC Compile\r
+if "%VERBOSE%" == "Y" echo on\r
+call %COMPILER% /nologo /MT /W4 /EHsc %OPTS% /I %OUTDIR%/src /I src /I %OUTDIR%/lib /I lib /I src/w32/include /D _CONSOLE /D HAVE_CONFIG_H /FR%OUTDIR% /Fp%OUTDIR%\%MAKE%.pch /Fo%OUTDIR%\%1.%O% /Fd%OUTDIR%\%MAKE%.pdb %EXTRAS% /c %1.c\r
+@echo off\r
+goto CompileDone\r
+\r
+:GccCompile\r
+:: GCC Compile\r
+if "%VERBOSE%" == "Y" echo on\r
+call %COMPILER% -mthreads -Wall -std=gnu99 -gdwarf-2 -g3 %OPTS% -I%OUTDIR%/src -I./src -I%OUTDIR%/lib -I./lib -I./src/w32/include -DHAVE_CONFIG_H %EXTRAS% -o %OUTDIR%/%1.%O% -c %1.c\r
+@echo off\r
+goto CompileDone\r
+\r
+:TccCompile\r
+:: TCC Compile\r
+if "%VERBOSE%" == "Y" echo on\r
+call %COMPILER% -mthreads -Wall -std=c11 %OPTS% -I%OUTDIR%/src -I./src -I%OUTDIR%/lib -I./lib -I./src/w32/include -D_cdecl= -D_MSC_VER -DHAVE_CONFIG_H %EXTRAS% -o %OUTDIR%/%1.%O% -c %1.c\r
+@echo off\r
+goto CompileDone\r
+\r
+:CompileDone\r
+if not exist "%OUTDIR%\%1.%O%" exit 1\r
+goto :EOF\r
+\r
+:Link\r
+echo.\r
+echo - Linking %LNKOUT%/%MAKE%.exe\r
+if "%COMPILER%" == "gcc" goto GccLink\r
+if "%COMPILER%" == "tcc" goto TccLink\r
+\r
+:: MSVC Link\r
+echo %GUILELIBS% kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib >>%OUTDIR%\link.sc\r
+if "%VERBOSE%" == "Y" echo on\r
+call link.exe /NOLOGO /SUBSYSTEM:console /PDB:%LNKOUT%\%MAKE%.pdb %LINKOPTS% /OUT:%LNKOUT%\%MAKE%.exe @%LNKOUT%\link.sc\r
+@echo off\r
+goto :EOF\r
+\r
+:GccLink\r
+:: GCC Link\r
+if "%VERBOSE%" == "Y" echo on\r
+echo %GUILELIBS% -lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -luuid -lodbc32 -lodbccp32 >>%OUTDIR%\link.sc\r
+call %COMPILER% -mthreads -gdwarf-2 -g3 %OPTS% -o %LNKOUT%/%MAKE%.exe @%LNKOUT%/link.sc -Wl,--out-implib=%LNKOUT%/libgnumake-1.dll.a\r
+@echo off\r
+goto :EOF\r
+\r
+:TccLink\r
+:: TCC Link\r
+if "%VERBOSE%" == "Y" echo on\r
+echo %GUILELIBS% -lkernel32 -luser32 -lgdi32 -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -lodbc32 -lodbccp32 >>%OUTDIR%\link.sc\r
+call %COMPILER% -mthreads %OPTS% -o %LNKOUT%/%MAKE%.exe @%LNKOUT%/link.sc \r
+@echo off\r
+goto :EOF\r
+\r
+:ChkGuile\r
+:: Build with Guile is supported only on NT and later versions\r
+if not "%OS%" == "Windows_NT" goto NoGuile\r
+call pkg-config --help > %OUTDIR%\guile.tmp 2> NUL\r
+if ERRORLEVEL 1 goto NoPkgCfg\r
+\r
+set PKGMSC=\r
+if not "%COMPILER%" == "gcc" set PKGMSC=--msvc-syntax\r
+\r
+echo Checking for Guile 2.0\r
+call pkg-config --cflags --short-errors "guile-2.0" > %OUTDIR%\gl-c2.tmp 2> NUL\r
+if not ERRORLEVEL 1 set /P GUILECFLAGS= < %OUTDIR%\gl-c2.tmp\r
+\r
+call pkg-config --libs --static --short-errors %PKGMSC% "guile-2.0" > %OUTDIR%\gl-l2.tmp 2> NUL\r
+if not ERRORLEVEL 1 set /P GUILELIBS= < %OUTDIR%\gl-l2.tmp\r
+\r
+if not "%GUILECFLAGS%" == "" goto GuileDone\r
+\r
+echo Checking for Guile 1.8\r
+call pkg-config --cflags --short-errors "guile-1.8" > %OUTDIR%\gl-c18.tmp 2> NUL\r
+if not ERRORLEVEL 1 set /P GUILECFLAGS= < %OUTDIR%\gl-c18.tmp\r
+\r
+call pkg-config --libs --static --short-errors %PKGMSC% "guile-1.8" > %OUTDIR%\gl-l18.tmp 2> NUL\r
+if not ERRORLEVEL 1 set /P GUILELIBS= < %OUTDIR%\gl-l18.tmp\r
+\r
+if not "%GUILECFLAGS%" == "" goto GuileDone\r
+\r
+echo - No Guile found, building without Guile\r
+goto GuileDone\r
+\r
+:NoPkgCfg\r
+echo - pkg-config not found, building without Guile\r
+\r
+:GuileDone\r
+if "%GUILECFLAGS%" == "" goto :EOF\r
+\r
+echo - Guile found: building with Guile\r
+set "GUILECFLAGS=%GUILECFLAGS% -DHAVE_GUILE"\r
+goto :EOF\r
+\r
+:FindVswhere\r
+set VSWHERE=vswhere\r
+call "%VSWHERE%" -help >nul 2>&1\r
+if not ERRORLEVEL 1 exit /b 0\r
+set "VSWHERE=C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere"\r
+call "%VSWHERE%" -help >nul 2>&1\r
+if ERRORLEVEL 1 exit /b 1\r
+goto :EOF\r
+\r
+:CheckMSVC\r
+if not exist "%VSVARS%" exit /b 1\r
+call "%VSVARS%" %ARCH%\r
+if ERRORLEVEL 1 exit /b 1\r
+call %COMPILER% >nul 2>&1\r
+if ERRORLEVEL 1 exit /b 1\r
+goto :EOF\r
+\r
+:NotConfig\r
+echo.\r
+echo *** This workspace is not configured.\r
+echo Either retrieve the configured source in the release tarball\r
+echo or, if building from Git, run the .\bootstrap.bat script first.\r
+exit /b 1\r
+\r
+:Usage\r
+echo Usage: %0 [options] [gcc] OR [tcc]\r
+echo Options:\r
+echo.  --without-guile   Do not compile Guile support even if found\r
+echo.  --debug           Make a Debug build--default is Release\r
+echo.  --x86             Make a 32bit binary--default is 64bit\r
+echo.  --help            Display these instructions and exit\r
+echo.\r
+echo. "gcc" means compile with GCC, "tcc" means compile with Tiny C's TCC\r
+goto :EOF\r
+\r
+:Reset\r
+set ARCH=\r
+set COMPILER=\r
+set DEBUG=\r
+set GUILE=\r
+set GUILECFLAGS=\r
+set GUILELIBS=\r
+set LINKOPTS=\r
+set MAKE=\r
+set NOGUILE=\r
+set O=\r
+set OPTS=\r
+set OUTDIR=\r
+set LNKOUT=\r
+set PKGMSC=\r
+set VSVARS=\r
+goto :EOF\r