2006-02-12 06:16:04 +08:00
|
|
|
@echo off
|
2024-01-07 06:55:04 +08:00
|
|
|
:: Copyright (C) 1996-2024 Free Software Foundation, Inc.
|
2018-02-11 04:34:53 +08:00
|
|
|
:: This file is part of GNU Make.
|
|
|
|
::
|
|
|
|
:: GNU Make is free software; you can redistribute it and/or modify it under
|
|
|
|
:: the terms of the GNU General Public License as published by the Free
|
|
|
|
:: Software Foundation; either version 3 of the License, or (at your option)
|
|
|
|
:: any later version.
|
|
|
|
::
|
|
|
|
:: GNU Make 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 General Public License for.
|
|
|
|
:: more details.
|
|
|
|
::
|
|
|
|
:: You should have received a copy of the GNU General Public License along
|
2022-10-19 02:36:40 +08:00
|
|
|
:: with this program. If not, see <https://www.gnu.org/licenses/>.
|
2006-02-12 03:02:21 +08:00
|
|
|
|
2016-06-19 22:52:17 +08:00
|
|
|
setlocal
|
2018-02-11 04:34:53 +08:00
|
|
|
if not "%RECURSEME%"=="%~0" (
|
|
|
|
set "RECURSEME=%~0"
|
|
|
|
%ComSpec% /s /c ""%~0" %*"
|
|
|
|
goto :EOF
|
|
|
|
)
|
|
|
|
|
Extract jobserver implementation into OS-specific files.
* os.h, posixos.c, w32/w32os.c: New files implementing jobserver.
* job.c, job.h, main.c, makeint.h: Move content to new files.
* w32/include/sub_proc.h, w32/subproc/sub_proc.c: Ditto.
* Makefile.am: Build and package OS-specific files.
* build_w32.bat, make_msvc_net2003.vcproj, README.W32.template:
Update for new files, and clean up the build.
* POTFILES.in, maintMakefile, NMakefile.template: Ditto.
* w32/subproc/build.bat: Delete as unused.
2016-03-07 02:29:43 +08:00
|
|
|
call :Reset
|
|
|
|
|
|
|
|
if "%1" == "-h" goto Usage
|
|
|
|
if "%1" == "--help" goto Usage
|
|
|
|
|
2018-02-11 04:34:53 +08:00
|
|
|
echo.
|
2023-02-22 09:53:11 +08:00
|
|
|
echo Creating GNU Make for Windows 9X/NT/2K/XP/Vista/7/8/10/11
|
2018-02-11 04:34:53 +08:00
|
|
|
echo.
|
|
|
|
|
Extract jobserver implementation into OS-specific files.
* os.h, posixos.c, w32/w32os.c: New files implementing jobserver.
* job.c, job.h, main.c, makeint.h: Move content to new files.
* w32/include/sub_proc.h, w32/subproc/sub_proc.c: Ditto.
* Makefile.am: Build and package OS-specific files.
* build_w32.bat, make_msvc_net2003.vcproj, README.W32.template:
Update for new files, and clean up the build.
* POTFILES.in, maintMakefile, NMakefile.template: Ditto.
* w32/subproc/build.bat: Delete as unused.
2016-03-07 02:29:43 +08:00
|
|
|
set MAKE=gnumake
|
|
|
|
set GUILE=Y
|
2016-06-19 22:52:17 +08:00
|
|
|
set COMPILER=cl.exe
|
2023-06-19 21:51:13 +08:00
|
|
|
set RC=rc.exe
|
Rework directory structure to use GNU-recommended "src" directory.
Move the source code (other than glob) into the "src" subdirectory.
Update all scripting and recommendations to support this change.
* *.c, *.h, w32/*: Move to src/
* configure.ac, Makefile.am, maintMakefile: Locate new source files.
* Basic.mk.template, mk/*: Update for new source file locations.
* NEWS, README.DOS.template: Update for new locations.
* build.template, build_w32.bat, builddos.bat: Ditto.
* po/POTFILES.in: Ditto
* tests/run_make_tests.pl, tests/scripts/features/load*: Ditto.
* make.1: Move to doc.
* mk/VMS.mk: Add support for building on VMS (hopefully).
* makefile.vms, prepare_w32.bat: Remove.
* SCOPTIONS: Update to define HAVE_CONFIG_H
2017-11-20 02:49:26 +08:00
|
|
|
set O=obj
|
2016-06-19 22:52:17 +08:00
|
|
|
set ARCH=x64
|
|
|
|
set DEBUG=N
|
2020-01-24 16:13:12 +08:00
|
|
|
set DIRENT=Y
|
2022-08-15 03:03:40 +08:00
|
|
|
set VERBOSE=N
|
2012-01-29 04:28:31 +08:00
|
|
|
|
2019-08-26 05:11:10 +08:00
|
|
|
if exist maintMakefile (
|
|
|
|
set MAINT=Y
|
|
|
|
) else (
|
|
|
|
set MAINT=N
|
|
|
|
)
|
|
|
|
|
2013-04-26 01:41:53 +08:00
|
|
|
:ParseSW
|
2022-08-15 03:03:40 +08:00
|
|
|
if "%1" == "--verbose" goto SetVerbose
|
Extract jobserver implementation into OS-specific files.
* os.h, posixos.c, w32/w32os.c: New files implementing jobserver.
* job.c, job.h, main.c, makeint.h: Move content to new files.
* w32/include/sub_proc.h, w32/subproc/sub_proc.c: Ditto.
* Makefile.am: Build and package OS-specific files.
* build_w32.bat, make_msvc_net2003.vcproj, README.W32.template:
Update for new files, and clean up the build.
* POTFILES.in, maintMakefile, NMakefile.template: Ditto.
* w32/subproc/build.bat: Delete as unused.
2016-03-07 02:29:43 +08:00
|
|
|
if "%1" == "--debug" goto SetDebug
|
|
|
|
if "%1" == "--without-guile" goto NoGuile
|
2016-06-19 22:52:17 +08:00
|
|
|
if "%1" == "--x86" goto Set32Bit
|
Extract jobserver implementation into OS-specific files.
* os.h, posixos.c, w32/w32os.c: New files implementing jobserver.
* job.c, job.h, main.c, makeint.h: Move content to new files.
* w32/include/sub_proc.h, w32/subproc/sub_proc.c: Ditto.
* Makefile.am: Build and package OS-specific files.
* build_w32.bat, make_msvc_net2003.vcproj, README.W32.template:
Update for new files, and clean up the build.
* POTFILES.in, maintMakefile, NMakefile.template: Ditto.
* w32/subproc/build.bat: Delete as unused.
2016-03-07 02:29:43 +08:00
|
|
|
if "%1" == "gcc" goto SetCC
|
2020-01-24 16:13:12 +08:00
|
|
|
if "%1" == "tcc" goto SetTCC
|
Extract jobserver implementation into OS-specific files.
* os.h, posixos.c, w32/w32os.c: New files implementing jobserver.
* job.c, job.h, main.c, makeint.h: Move content to new files.
* w32/include/sub_proc.h, w32/subproc/sub_proc.c: Ditto.
* Makefile.am: Build and package OS-specific files.
* build_w32.bat, make_msvc_net2003.vcproj, README.W32.template:
Update for new files, and clean up the build.
* POTFILES.in, maintMakefile, NMakefile.template: Ditto.
* w32/subproc/build.bat: Delete as unused.
2016-03-07 02:29:43 +08:00
|
|
|
if "%1" == "" goto DoneSW
|
2016-06-19 22:52:17 +08:00
|
|
|
goto Usage
|
Extract jobserver implementation into OS-specific files.
* os.h, posixos.c, w32/w32os.c: New files implementing jobserver.
* job.c, job.h, main.c, makeint.h: Move content to new files.
* w32/include/sub_proc.h, w32/subproc/sub_proc.c: Ditto.
* Makefile.am: Build and package OS-specific files.
* build_w32.bat, make_msvc_net2003.vcproj, README.W32.template:
Update for new files, and clean up the build.
* POTFILES.in, maintMakefile, NMakefile.template: Ditto.
* w32/subproc/build.bat: Delete as unused.
2016-03-07 02:29:43 +08:00
|
|
|
|
2022-08-15 03:03:40 +08:00
|
|
|
:SetVerbose
|
|
|
|
set VERBOSE=Y
|
|
|
|
shift
|
|
|
|
goto ParseSW
|
|
|
|
|
Extract jobserver implementation into OS-specific files.
* os.h, posixos.c, w32/w32os.c: New files implementing jobserver.
* job.c, job.h, main.c, makeint.h: Move content to new files.
* w32/include/sub_proc.h, w32/subproc/sub_proc.c: Ditto.
* Makefile.am: Build and package OS-specific files.
* build_w32.bat, make_msvc_net2003.vcproj, README.W32.template:
Update for new files, and clean up the build.
* POTFILES.in, maintMakefile, NMakefile.template: Ditto.
* w32/subproc/build.bat: Delete as unused.
2016-03-07 02:29:43 +08:00
|
|
|
:SetDebug
|
|
|
|
set DEBUG=Y
|
2018-02-11 04:34:53 +08:00
|
|
|
echo - Building without compiler optimizations
|
2013-04-26 01:41:53 +08:00
|
|
|
shift
|
Extract jobserver implementation into OS-specific files.
* os.h, posixos.c, w32/w32os.c: New files implementing jobserver.
* job.c, job.h, main.c, makeint.h: Move content to new files.
* w32/include/sub_proc.h, w32/subproc/sub_proc.c: Ditto.
* Makefile.am: Build and package OS-specific files.
* build_w32.bat, make_msvc_net2003.vcproj, README.W32.template:
Update for new files, and clean up the build.
* POTFILES.in, maintMakefile, NMakefile.template: Ditto.
* w32/subproc/build.bat: Delete as unused.
2016-03-07 02:29:43 +08:00
|
|
|
goto ParseSW
|
|
|
|
|
2013-04-26 01:41:53 +08:00
|
|
|
:NoGuile
|
Extract jobserver implementation into OS-specific files.
* os.h, posixos.c, w32/w32os.c: New files implementing jobserver.
* job.c, job.h, main.c, makeint.h: Move content to new files.
* w32/include/sub_proc.h, w32/subproc/sub_proc.c: Ditto.
* Makefile.am: Build and package OS-specific files.
* build_w32.bat, make_msvc_net2003.vcproj, README.W32.template:
Update for new files, and clean up the build.
* POTFILES.in, maintMakefile, NMakefile.template: Ditto.
* w32/subproc/build.bat: Delete as unused.
2016-03-07 02:29:43 +08:00
|
|
|
set GUILE=N
|
2018-02-11 04:34:53 +08:00
|
|
|
echo - Building without Guile
|
2013-04-26 01:41:53 +08:00
|
|
|
shift
|
Extract jobserver implementation into OS-specific files.
* os.h, posixos.c, w32/w32os.c: New files implementing jobserver.
* job.c, job.h, main.c, makeint.h: Move content to new files.
* w32/include/sub_proc.h, w32/subproc/sub_proc.c: Ditto.
* Makefile.am: Build and package OS-specific files.
* build_w32.bat, make_msvc_net2003.vcproj, README.W32.template:
Update for new files, and clean up the build.
* POTFILES.in, maintMakefile, NMakefile.template: Ditto.
* w32/subproc/build.bat: Delete as unused.
2016-03-07 02:29:43 +08:00
|
|
|
goto ParseSW
|
|
|
|
|
2016-06-19 22:52:17 +08:00
|
|
|
:Set32Bit
|
|
|
|
set ARCH=x86
|
2018-02-11 04:34:53 +08:00
|
|
|
echo - Building 32bit GNU Make
|
2016-06-19 22:52:17 +08:00
|
|
|
shift
|
|
|
|
goto ParseSW
|
|
|
|
|
2013-04-26 01:41:53 +08:00
|
|
|
:SetCC
|
|
|
|
set COMPILER=gcc
|
2023-06-19 21:51:13 +08:00
|
|
|
set RC=windres
|
Rework directory structure to use GNU-recommended "src" directory.
Move the source code (other than glob) into the "src" subdirectory.
Update all scripting and recommendations to support this change.
* *.c, *.h, w32/*: Move to src/
* configure.ac, Makefile.am, maintMakefile: Locate new source files.
* Basic.mk.template, mk/*: Update for new source file locations.
* NEWS, README.DOS.template: Update for new locations.
* build.template, build_w32.bat, builddos.bat: Ditto.
* po/POTFILES.in: Ditto
* tests/run_make_tests.pl, tests/scripts/features/load*: Ditto.
* make.1: Move to doc.
* mk/VMS.mk: Add support for building on VMS (hopefully).
* makefile.vms, prepare_w32.bat: Remove.
* SCOPTIONS: Update to define HAVE_CONFIG_H
2017-11-20 02:49:26 +08:00
|
|
|
set O=o
|
2018-02-11 04:34:53 +08:00
|
|
|
echo - Building with GCC
|
2013-04-26 01:41:53 +08:00
|
|
|
shift
|
Extract jobserver implementation into OS-specific files.
* os.h, posixos.c, w32/w32os.c: New files implementing jobserver.
* job.c, job.h, main.c, makeint.h: Move content to new files.
* w32/include/sub_proc.h, w32/subproc/sub_proc.c: Ditto.
* Makefile.am: Build and package OS-specific files.
* build_w32.bat, make_msvc_net2003.vcproj, README.W32.template:
Update for new files, and clean up the build.
* POTFILES.in, maintMakefile, NMakefile.template: Ditto.
* w32/subproc/build.bat: Delete as unused.
2016-03-07 02:29:43 +08:00
|
|
|
goto ParseSW
|
|
|
|
|
2020-01-24 16:13:12 +08:00
|
|
|
:SetTCC
|
|
|
|
set COMPILER=tcc
|
2023-06-19 21:51:13 +08:00
|
|
|
set RC=windres
|
2020-01-24 16:13:12 +08:00
|
|
|
set O=o
|
|
|
|
echo - Building with TinyC
|
|
|
|
shift
|
|
|
|
goto ParseSW
|
|
|
|
|
Extract jobserver implementation into OS-specific files.
* os.h, posixos.c, w32/w32os.c: New files implementing jobserver.
* job.c, job.h, main.c, makeint.h: Move content to new files.
* w32/include/sub_proc.h, w32/subproc/sub_proc.c: Ditto.
* Makefile.am: Build and package OS-specific files.
* build_w32.bat, make_msvc_net2003.vcproj, README.W32.template:
Update for new files, and clean up the build.
* POTFILES.in, maintMakefile, NMakefile.template: Ditto.
* w32/subproc/build.bat: Delete as unused.
2016-03-07 02:29:43 +08:00
|
|
|
:DoneSW
|
2019-08-26 05:11:10 +08:00
|
|
|
if "%MAINT%" == "Y" echo - Enabling maintainer mode
|
|
|
|
|
2018-02-11 04:34:53 +08:00
|
|
|
if "%COMPILER%" == "gcc" goto FindGcc
|
2020-01-24 16:13:12 +08:00
|
|
|
if "%COMPILER%" == "tcc" goto FindTcc
|
Extract jobserver implementation into OS-specific files.
* os.h, posixos.c, w32/w32os.c: New files implementing jobserver.
* job.c, job.h, main.c, makeint.h: Move content to new files.
* w32/include/sub_proc.h, w32/subproc/sub_proc.c: Ditto.
* Makefile.am: Build and package OS-specific files.
* build_w32.bat, make_msvc_net2003.vcproj, README.W32.template:
Update for new files, and clean up the build.
* POTFILES.in, maintMakefile, NMakefile.template: Ditto.
* w32/subproc/build.bat: Delete as unused.
2016-03-07 02:29:43 +08:00
|
|
|
|
2018-02-11 04:34:53 +08:00
|
|
|
:: Find a compiler. Visual Studio requires a lot of effort to locate :-/.
|
2022-06-19 04:42:11 +08:00
|
|
|
call %COMPILER% >nul 2>&1
|
2016-06-19 22:52:17 +08:00
|
|
|
if not ERRORLEVEL 1 goto FoundMSVC
|
|
|
|
|
2023-06-19 21:51:13 +08:00
|
|
|
:: Visual Studio 15 2017 and above provides the "vswhere" tool
|
2018-02-11 04:34:53 +08:00
|
|
|
call :FindVswhere
|
|
|
|
if ERRORLEVEL 1 goto LegacyVS
|
|
|
|
|
2021-09-06 09:07:14 +08:00
|
|
|
for /f "tokens=* usebackq" %%i in (`"%VSWHERE%" -latest -property installationPath`) do (
|
2018-02-11 04:34:53 +08:00
|
|
|
set InstallPath=%%i
|
|
|
|
)
|
|
|
|
set "VSVARS=%InstallPath%\VC\Auxiliary\Build\vcvarsall.bat"
|
|
|
|
call :CheckMSVC
|
|
|
|
if not ERRORLEVEL 1 goto FoundMSVC
|
|
|
|
|
|
|
|
:: No "vswhere" or it can't find a compiler. Go old-school.
|
|
|
|
:LegacyVS
|
|
|
|
set "VSVARS=%VS150COMNTOOLS%\..\..\VC\vcvarsall.bat"
|
|
|
|
call :CheckMSVC
|
|
|
|
if not ERRORLEVEL 1 goto FoundMSVC
|
|
|
|
|
2016-06-19 22:52:17 +08:00
|
|
|
set "VSVARS=%VS140COMNTOOLS%\..\..\VC\vcvarsall.bat"
|
|
|
|
call :CheckMSVC
|
|
|
|
if not ERRORLEVEL 1 goto FoundMSVC
|
|
|
|
|
|
|
|
set "VSVARS=%VS120COMNTOOLS%\..\..\VC\vcvarsall.bat"
|
|
|
|
call :CheckMSVC
|
|
|
|
if not ERRORLEVEL 1 goto FoundMSVC
|
|
|
|
|
|
|
|
set "VSVARS=%VS110COMNTOOLS%\..\..\VC\vcvarsall.bat"
|
|
|
|
call :CheckMSVC
|
|
|
|
if not ERRORLEVEL 1 goto FoundMSVC
|
|
|
|
|
|
|
|
set "VSVARS=%VS100COMNTOOLS%\..\..\VC\vcvarsall.bat"
|
|
|
|
call :CheckMSVC
|
|
|
|
if not ERRORLEVEL 1 goto FoundMSVC
|
|
|
|
|
|
|
|
set "VSVARS=%VS90COMNTOOLS%\..\..\VC\vcvarsall.bat"
|
|
|
|
call :CheckMSVC
|
|
|
|
if not ERRORLEVEL 1 goto FoundMSVC
|
|
|
|
|
|
|
|
set "VSVARS=%VS80COMNTOOLS%\..\..\VC\vcvarsall.bat"
|
|
|
|
call :CheckMSVC
|
|
|
|
if not ERRORLEVEL 1 goto FoundMSVC
|
|
|
|
|
|
|
|
set "VSVARS=%VS71COMNTOOLS%\..\..\VC\vcvarsall.bat"
|
|
|
|
call :CheckMSVC
|
|
|
|
if not ERRORLEVEL 1 goto FoundMSVC
|
|
|
|
|
|
|
|
set "VSVARS=%VS70COMNTOOLS%\..\..\VC\vcvarsall.bat"
|
|
|
|
call :CheckMSVC
|
|
|
|
if not ERRORLEVEL 1 goto FoundMSVC
|
|
|
|
|
|
|
|
set "VSVARS=%V6TOOLS%\VC98\Bin\vcvars32.bat"
|
|
|
|
call :CheckMSVC
|
|
|
|
if not ERRORLEVEL 1 goto FoundMSVC
|
|
|
|
|
|
|
|
set "VSVARS=%V6TOOLS%\VC97\Bin\vcvars32.bat"
|
|
|
|
call :CheckMSVC
|
|
|
|
if not ERRORLEVEL 1 goto FoundMSVC
|
|
|
|
|
|
|
|
set "VSVARS=%V5TOOLS%\VC\Bin\vcvars32.bat"
|
|
|
|
call :CheckMSVC
|
|
|
|
if not ERRORLEVEL 1 goto FoundMSVC
|
|
|
|
|
2018-02-11 04:34:53 +08:00
|
|
|
:: We did not find anything--fail
|
2016-06-19 22:52:17 +08:00
|
|
|
echo No MSVC compiler available.
|
|
|
|
echo Please run vcvarsall.bat and/or configure your Path.
|
2018-02-11 04:34:53 +08:00
|
|
|
exit 1
|
2016-06-19 22:52:17 +08:00
|
|
|
|
|
|
|
:FoundMSVC
|
Extract jobserver implementation into OS-specific files.
* os.h, posixos.c, w32/w32os.c: New files implementing jobserver.
* job.c, job.h, main.c, makeint.h: Move content to new files.
* w32/include/sub_proc.h, w32/subproc/sub_proc.c: Ditto.
* Makefile.am: Build and package OS-specific files.
* build_w32.bat, make_msvc_net2003.vcproj, README.W32.template:
Update for new files, and clean up the build.
* POTFILES.in, maintMakefile, NMakefile.template: Ditto.
* w32/subproc/build.bat: Delete as unused.
2016-03-07 02:29:43 +08:00
|
|
|
set OUTDIR=.\WinRel
|
2019-08-28 22:45:49 +08:00
|
|
|
set LNKOUT=./WinRel
|
Extract jobserver implementation into OS-specific files.
* os.h, posixos.c, w32/w32os.c: New files implementing jobserver.
* job.c, job.h, main.c, makeint.h: Move content to new files.
* w32/include/sub_proc.h, w32/subproc/sub_proc.c: Ditto.
* Makefile.am: Build and package OS-specific files.
* build_w32.bat, make_msvc_net2003.vcproj, README.W32.template:
Update for new files, and clean up the build.
* POTFILES.in, maintMakefile, NMakefile.template: Ditto.
* w32/subproc/build.bat: Delete as unused.
2016-03-07 02:29:43 +08:00
|
|
|
set "OPTS=/O2 /D NDEBUG"
|
|
|
|
set LINKOPTS=
|
|
|
|
if "%DEBUG%" == "Y" set OUTDIR=.\WinDebug
|
2019-08-28 22:45:49 +08:00
|
|
|
if "%DEBUG%" == "Y" set LNKOUT=./WinDebug
|
Extract jobserver implementation into OS-specific files.
* os.h, posixos.c, w32/w32os.c: New files implementing jobserver.
* job.c, job.h, main.c, makeint.h: Move content to new files.
* w32/include/sub_proc.h, w32/subproc/sub_proc.c: Ditto.
* Makefile.am: Build and package OS-specific files.
* build_w32.bat, make_msvc_net2003.vcproj, README.W32.template:
Update for new files, and clean up the build.
* POTFILES.in, maintMakefile, NMakefile.template: Ditto.
* w32/subproc/build.bat: Delete as unused.
2016-03-07 02:29:43 +08:00
|
|
|
if "%DEBUG%" == "Y" set "OPTS=/Zi /Od /D _DEBUG"
|
|
|
|
if "%DEBUG%" == "Y" set LINKOPTS=/DEBUG
|
2019-08-26 05:11:10 +08:00
|
|
|
if "%MAINT%" == "Y" set "OPTS=%OPTS% /D MAKE_MAINTAINER_MODE"
|
2018-02-11 04:34:53 +08:00
|
|
|
:: Show the compiler version that we found
|
|
|
|
:: Unfortunately this also shows a "usage" note; I can't find anything better.
|
|
|
|
echo.
|
2022-06-19 04:42:11 +08:00
|
|
|
call %COMPILER%
|
2023-06-19 21:51:13 +08:00
|
|
|
goto FindRC
|
Extract jobserver implementation into OS-specific files.
* os.h, posixos.c, w32/w32os.c: New files implementing jobserver.
* job.c, job.h, main.c, makeint.h: Move content to new files.
* w32/include/sub_proc.h, w32/subproc/sub_proc.c: Ditto.
* Makefile.am: Build and package OS-specific files.
* build_w32.bat, make_msvc_net2003.vcproj, README.W32.template:
Update for new files, and clean up the build.
* POTFILES.in, maintMakefile, NMakefile.template: Ditto.
* w32/subproc/build.bat: Delete as unused.
2016-03-07 02:29:43 +08:00
|
|
|
|
2018-02-11 04:34:53 +08:00
|
|
|
:FindGcc
|
Extract jobserver implementation into OS-specific files.
* os.h, posixos.c, w32/w32os.c: New files implementing jobserver.
* job.c, job.h, main.c, makeint.h: Move content to new files.
* w32/include/sub_proc.h, w32/subproc/sub_proc.c: Ditto.
* Makefile.am: Build and package OS-specific files.
* build_w32.bat, make_msvc_net2003.vcproj, README.W32.template:
Update for new files, and clean up the build.
* POTFILES.in, maintMakefile, NMakefile.template: Ditto.
* w32/subproc/build.bat: Delete as unused.
2016-03-07 02:29:43 +08:00
|
|
|
set OUTDIR=.\GccRel
|
2019-08-28 22:45:49 +08:00
|
|
|
set LNKOUT=./GccRel
|
Extract jobserver implementation into OS-specific files.
* os.h, posixos.c, w32/w32os.c: New files implementing jobserver.
* job.c, job.h, main.c, makeint.h: Move content to new files.
* w32/include/sub_proc.h, w32/subproc/sub_proc.c: Ditto.
* Makefile.am: Build and package OS-specific files.
* build_w32.bat, make_msvc_net2003.vcproj, README.W32.template:
Update for new files, and clean up the build.
* POTFILES.in, maintMakefile, NMakefile.template: Ditto.
* w32/subproc/build.bat: Delete as unused.
2016-03-07 02:29:43 +08:00
|
|
|
set OPTS=-O2
|
2020-01-24 16:13:12 +08:00
|
|
|
set DIRENT=N
|
Extract jobserver implementation into OS-specific files.
* os.h, posixos.c, w32/w32os.c: New files implementing jobserver.
* job.c, job.h, main.c, makeint.h: Move content to new files.
* w32/include/sub_proc.h, w32/subproc/sub_proc.c: Ditto.
* Makefile.am: Build and package OS-specific files.
* build_w32.bat, make_msvc_net2003.vcproj, README.W32.template:
Update for new files, and clean up the build.
* POTFILES.in, maintMakefile, NMakefile.template: Ditto.
* w32/subproc/build.bat: Delete as unused.
2016-03-07 02:29:43 +08:00
|
|
|
if "%DEBUG%" == "Y" set OPTS=-O0
|
|
|
|
if "%DEBUG%" == "Y" set OUTDIR=.\GccDebug
|
2019-08-28 22:45:49 +08:00
|
|
|
if "%DEBUG%" == "Y" set LNKOUT=./GccDebug
|
2019-08-26 05:11:10 +08:00
|
|
|
if "%MAINT%" == "Y" set "OPTS=%OPTS% -DMAKE_MAINTAINER_MODE"
|
2018-02-11 04:34:53 +08:00
|
|
|
:: Show the compiler version that we found
|
|
|
|
echo.
|
2022-06-19 04:42:11 +08:00
|
|
|
call %COMPILER% --version
|
2023-06-19 21:51:13 +08:00
|
|
|
if not ERRORLEVEL 1 goto FindRC
|
2018-02-11 04:34:53 +08:00
|
|
|
echo No %COMPILER% found.
|
|
|
|
exit 1
|
Extract jobserver implementation into OS-specific files.
* os.h, posixos.c, w32/w32os.c: New files implementing jobserver.
* job.c, job.h, main.c, makeint.h: Move content to new files.
* w32/include/sub_proc.h, w32/subproc/sub_proc.c: Ditto.
* Makefile.am: Build and package OS-specific files.
* build_w32.bat, make_msvc_net2003.vcproj, README.W32.template:
Update for new files, and clean up the build.
* POTFILES.in, maintMakefile, NMakefile.template: Ditto.
* w32/subproc/build.bat: Delete as unused.
2016-03-07 02:29:43 +08:00
|
|
|
|
2020-01-24 16:13:12 +08:00
|
|
|
:FindTcc
|
|
|
|
set OUTDIR=.\TccRel
|
|
|
|
set LNKOUT=./TccRel
|
|
|
|
set OPTS=-O2
|
|
|
|
if "%DEBUG%" == "Y" set OPTS=-O0
|
|
|
|
if "%DEBUG%" == "Y" set OUTDIR=.\TccDebug
|
|
|
|
if "%DEBUG%" == "Y" set LNKOUT=./TccDebug
|
|
|
|
if "%MAINT%" == "Y" set "OPTS=%OPTS% -DMAKE_MAINTAINER_MODE"
|
|
|
|
:: Show the compiler version that we found
|
|
|
|
echo.
|
2022-06-19 04:42:11 +08:00
|
|
|
call %COMPILER% -v
|
2023-06-19 21:51:13 +08:00
|
|
|
if not ERRORLEVEL 1 goto FindRC
|
2020-01-24 16:13:12 +08:00
|
|
|
echo No %COMPILER% found.
|
|
|
|
exit 1
|
|
|
|
|
2023-06-19 21:51:13 +08:00
|
|
|
:FindRC
|
|
|
|
set HAVE_RC=Y
|
|
|
|
call where %RC% >nul 2>&1
|
|
|
|
if not ERRORLEVEL 1 goto Build
|
|
|
|
echo.
|
|
|
|
echo %RC% was not found. Building without UTF-8 resource.
|
|
|
|
set HAVE_RC=N
|
|
|
|
|
Extract jobserver implementation into OS-specific files.
* os.h, posixos.c, w32/w32os.c: New files implementing jobserver.
* job.c, job.h, main.c, makeint.h: Move content to new files.
* w32/include/sub_proc.h, w32/subproc/sub_proc.c: Ditto.
* Makefile.am: Build and package OS-specific files.
* build_w32.bat, make_msvc_net2003.vcproj, README.W32.template:
Update for new files, and clean up the build.
* POTFILES.in, maintMakefile, NMakefile.template: Ditto.
* w32/subproc/build.bat: Delete as unused.
2016-03-07 02:29:43 +08:00
|
|
|
:Build
|
2023-06-19 21:51:13 +08:00
|
|
|
echo.
|
Extract jobserver implementation into OS-specific files.
* os.h, posixos.c, w32/w32os.c: New files implementing jobserver.
* job.c, job.h, main.c, makeint.h: Move content to new files.
* w32/include/sub_proc.h, w32/subproc/sub_proc.c: Ditto.
* Makefile.am: Build and package OS-specific files.
* build_w32.bat, make_msvc_net2003.vcproj, README.W32.template:
Update for new files, and clean up the build.
* POTFILES.in, maintMakefile, NMakefile.template: Ditto.
* w32/subproc/build.bat: Delete as unused.
2016-03-07 02:29:43 +08:00
|
|
|
:: Clean the directory if it exists
|
|
|
|
if exist %OUTDIR%\nul rmdir /S /Q %OUTDIR%
|
|
|
|
|
|
|
|
:: Recreate it
|
|
|
|
mkdir %OUTDIR%
|
Rework directory structure to use GNU-recommended "src" directory.
Move the source code (other than glob) into the "src" subdirectory.
Update all scripting and recommendations to support this change.
* *.c, *.h, w32/*: Move to src/
* configure.ac, Makefile.am, maintMakefile: Locate new source files.
* Basic.mk.template, mk/*: Update for new source file locations.
* NEWS, README.DOS.template: Update for new locations.
* build.template, build_w32.bat, builddos.bat: Ditto.
* po/POTFILES.in: Ditto
* tests/run_make_tests.pl, tests/scripts/features/load*: Ditto.
* make.1: Move to doc.
* mk/VMS.mk: Add support for building on VMS (hopefully).
* makefile.vms, prepare_w32.bat: Remove.
* SCOPTIONS: Update to define HAVE_CONFIG_H
2017-11-20 02:49:26 +08:00
|
|
|
mkdir %OUTDIR%\src
|
|
|
|
mkdir %OUTDIR%\src\w32
|
|
|
|
mkdir %OUTDIR%\src\w32\compat
|
|
|
|
mkdir %OUTDIR%\src\w32\subproc
|
2018-07-02 00:28:25 +08:00
|
|
|
mkdir %OUTDIR%\lib
|
Extract jobserver implementation into OS-specific files.
* os.h, posixos.c, w32/w32os.c: New files implementing jobserver.
* job.c, job.h, main.c, makeint.h: Move content to new files.
* w32/include/sub_proc.h, w32/subproc/sub_proc.c: Ditto.
* Makefile.am: Build and package OS-specific files.
* build_w32.bat, make_msvc_net2003.vcproj, README.W32.template:
Update for new files, and clean up the build.
* POTFILES.in, maintMakefile, NMakefile.template: Ditto.
* w32/subproc/build.bat: Delete as unused.
2016-03-07 02:29:43 +08:00
|
|
|
|
|
|
|
if "%GUILE%" == "Y" call :ChkGuile
|
2006-02-12 06:16:04 +08:00
|
|
|
|
2022-08-15 03:03:40 +08:00
|
|
|
if not exist src\config.h.W32 goto NotConfig
|
|
|
|
|
2013-04-26 01:41:53 +08:00
|
|
|
echo.
|
Extract jobserver implementation into OS-specific files.
* os.h, posixos.c, w32/w32os.c: New files implementing jobserver.
* job.c, job.h, main.c, makeint.h: Move content to new files.
* w32/include/sub_proc.h, w32/subproc/sub_proc.c: Ditto.
* Makefile.am: Build and package OS-specific files.
* build_w32.bat, make_msvc_net2003.vcproj, README.W32.template:
Update for new files, and clean up the build.
* POTFILES.in, maintMakefile, NMakefile.template: Ditto.
* w32/subproc/build.bat: Delete as unused.
2016-03-07 02:29:43 +08:00
|
|
|
echo Compiling %OUTDIR% version
|
|
|
|
|
Rework directory structure to use GNU-recommended "src" directory.
Move the source code (other than glob) into the "src" subdirectory.
Update all scripting and recommendations to support this change.
* *.c, *.h, w32/*: Move to src/
* configure.ac, Makefile.am, maintMakefile: Locate new source files.
* Basic.mk.template, mk/*: Update for new source file locations.
* NEWS, README.DOS.template: Update for new locations.
* build.template, build_w32.bat, builddos.bat: Ditto.
* po/POTFILES.in: Ditto
* tests/run_make_tests.pl, tests/scripts/features/load*: Ditto.
* make.1: Move to doc.
* mk/VMS.mk: Add support for building on VMS (hopefully).
* makefile.vms, prepare_w32.bat: Remove.
* SCOPTIONS: Update to define HAVE_CONFIG_H
2017-11-20 02:49:26 +08:00
|
|
|
copy src\config.h.W32 %OUTDIR%\src\config.h
|
|
|
|
|
2018-07-02 00:28:25 +08:00
|
|
|
copy lib\glob.in.h %OUTDIR%\lib\glob.h
|
|
|
|
copy lib\fnmatch.in.h %OUTDIR%\lib\fnmatch.h
|
|
|
|
|
Rework directory structure to use GNU-recommended "src" directory.
Move the source code (other than glob) into the "src" subdirectory.
Update all scripting and recommendations to support this change.
* *.c, *.h, w32/*: Move to src/
* configure.ac, Makefile.am, maintMakefile: Locate new source files.
* Basic.mk.template, mk/*: Update for new source file locations.
* NEWS, README.DOS.template: Update for new locations.
* build.template, build_w32.bat, builddos.bat: Ditto.
* po/POTFILES.in: Ditto
* tests/run_make_tests.pl, tests/scripts/features/load*: Ditto.
* make.1: Move to doc.
* mk/VMS.mk: Add support for building on VMS (hopefully).
* makefile.vms, prepare_w32.bat: Remove.
* SCOPTIONS: Update to define HAVE_CONFIG_H
2017-11-20 02:49:26 +08:00
|
|
|
if exist %OUTDIR%\link.sc del %OUTDIR%\link.sc
|
|
|
|
|
2019-08-28 22:45:49 +08:00
|
|
|
call :Compile src/ar
|
|
|
|
call :Compile src/arscan
|
|
|
|
call :Compile src/commands
|
|
|
|
call :Compile src/default
|
|
|
|
call :Compile src/dir
|
|
|
|
call :Compile src/expand
|
|
|
|
call :Compile src/file
|
|
|
|
call :Compile src/function
|
|
|
|
call :Compile src/getopt
|
|
|
|
call :Compile src/getopt1
|
|
|
|
call :Compile src/guile GUILE
|
|
|
|
call :Compile src/hash
|
|
|
|
call :Compile src/implicit
|
|
|
|
call :Compile src/job
|
|
|
|
call :Compile src/load
|
|
|
|
call :Compile src/loadapi
|
|
|
|
call :Compile src/main GUILE
|
|
|
|
call :Compile src/misc
|
|
|
|
call :Compile src/output
|
|
|
|
call :Compile src/read
|
|
|
|
call :Compile src/remake
|
|
|
|
call :Compile src/remote-stub
|
|
|
|
call :Compile src/rule
|
2022-06-05 03:48:01 +08:00
|
|
|
call :Compile src/shuffle
|
2019-08-28 22:45:49 +08:00
|
|
|
call :Compile src/signame
|
|
|
|
call :Compile src/strcache
|
|
|
|
call :Compile src/variable
|
|
|
|
call :Compile src/version
|
|
|
|
call :Compile src/vpath
|
2023-03-19 05:24:45 +08:00
|
|
|
call :Compile src/warning
|
2019-08-28 22:45:49 +08:00
|
|
|
call :Compile src/w32/pathstuff
|
|
|
|
call :Compile src/w32/w32os
|
|
|
|
call :Compile src/w32/compat/posixfcn
|
|
|
|
call :Compile src/w32/subproc/misc
|
|
|
|
call :Compile src/w32/subproc/sub_proc
|
|
|
|
call :Compile src/w32/subproc/w32err
|
|
|
|
call :Compile lib/fnmatch
|
|
|
|
call :Compile lib/glob
|
|
|
|
call :Compile lib/getloadavg
|
Rework directory structure to use GNU-recommended "src" directory.
Move the source code (other than glob) into the "src" subdirectory.
Update all scripting and recommendations to support this change.
* *.c, *.h, w32/*: Move to src/
* configure.ac, Makefile.am, maintMakefile: Locate new source files.
* Basic.mk.template, mk/*: Update for new source file locations.
* NEWS, README.DOS.template: Update for new locations.
* build.template, build_w32.bat, builddos.bat: Ditto.
* po/POTFILES.in: Ditto
* tests/run_make_tests.pl, tests/scripts/features/load*: Ditto.
* make.1: Move to doc.
* mk/VMS.mk: Add support for building on VMS (hopefully).
* makefile.vms, prepare_w32.bat: Remove.
* SCOPTIONS: Update to define HAVE_CONFIG_H
2017-11-20 02:49:26 +08:00
|
|
|
|
2020-01-24 16:13:12 +08:00
|
|
|
:: Compile dirent unless it is supported by compiler library (like with gcc).
|
|
|
|
if "%DIRENT%" == "Y" call :Compile src\w32\compat\dirent
|
Extract jobserver implementation into OS-specific files.
* os.h, posixos.c, w32/w32os.c: New files implementing jobserver.
* job.c, job.h, main.c, makeint.h: Move content to new files.
* w32/include/sub_proc.h, w32/subproc/sub_proc.c: Ditto.
* Makefile.am: Build and package OS-specific files.
* build_w32.bat, make_msvc_net2003.vcproj, README.W32.template:
Update for new files, and clean up the build.
* POTFILES.in, maintMakefile, NMakefile.template: Ditto.
* w32/subproc/build.bat: Delete as unused.
2016-03-07 02:29:43 +08:00
|
|
|
|
2023-06-19 21:51:13 +08:00
|
|
|
:: Compile UTF-8 resource if a resource compiler is available.
|
|
|
|
if "%HAVE_RC%" == "Y" call :ResourceCompile src/w32/utf8
|
|
|
|
|
Extract jobserver implementation into OS-specific files.
* os.h, posixos.c, w32/w32os.c: New files implementing jobserver.
* job.c, job.h, main.c, makeint.h: Move content to new files.
* w32/include/sub_proc.h, w32/subproc/sub_proc.c: Ditto.
* Makefile.am: Build and package OS-specific files.
* build_w32.bat, make_msvc_net2003.vcproj, README.W32.template:
Update for new files, and clean up the build.
* POTFILES.in, maintMakefile, NMakefile.template: Ditto.
* w32/subproc/build.bat: Delete as unused.
2016-03-07 02:29:43 +08:00
|
|
|
call :Link
|
|
|
|
|
|
|
|
echo.
|
2018-02-11 04:34:53 +08:00
|
|
|
if exist %OUTDIR%\%MAKE%.exe goto Success
|
|
|
|
echo %OUTDIR% build FAILED!
|
|
|
|
exit 1
|
|
|
|
|
|
|
|
:Success
|
|
|
|
echo %OUTDIR% build succeeded.
|
|
|
|
if exist Basic.mk copy /Y Basic.mk Makefile
|
2019-10-06 02:26:52 +08:00
|
|
|
if not exist tests\config-flags.pm copy /Y tests\config-flags.pm.W32 tests\config-flags.pm
|
2018-02-11 04:34:53 +08:00
|
|
|
call :Reset
|
Extract jobserver implementation into OS-specific files.
* os.h, posixos.c, w32/w32os.c: New files implementing jobserver.
* job.c, job.h, main.c, makeint.h: Move content to new files.
* w32/include/sub_proc.h, w32/subproc/sub_proc.c: Ditto.
* Makefile.am: Build and package OS-specific files.
* build_w32.bat, make_msvc_net2003.vcproj, README.W32.template:
Update for new files, and clean up the build.
* POTFILES.in, maintMakefile, NMakefile.template: Ditto.
* w32/subproc/build.bat: Delete as unused.
2016-03-07 02:29:43 +08:00
|
|
|
goto :EOF
|
|
|
|
|
2018-02-11 04:34:53 +08:00
|
|
|
::
|
|
|
|
:: Subroutines
|
|
|
|
::
|
|
|
|
|
Extract jobserver implementation into OS-specific files.
* os.h, posixos.c, w32/w32os.c: New files implementing jobserver.
* job.c, job.h, main.c, makeint.h: Move content to new files.
* w32/include/sub_proc.h, w32/subproc/sub_proc.c: Ditto.
* Makefile.am: Build and package OS-specific files.
* build_w32.bat, make_msvc_net2003.vcproj, README.W32.template:
Update for new files, and clean up the build.
* POTFILES.in, maintMakefile, NMakefile.template: Ditto.
* w32/subproc/build.bat: Delete as unused.
2016-03-07 02:29:43 +08:00
|
|
|
:Compile
|
2022-08-15 03:03:40 +08:00
|
|
|
if "%VERBOSE%" == "N" echo - Compiling %1.c
|
2019-08-28 22:45:49 +08:00
|
|
|
echo %LNKOUT%/%1.%O% >>%OUTDIR%\link.sc
|
Extract jobserver implementation into OS-specific files.
* os.h, posixos.c, w32/w32os.c: New files implementing jobserver.
* job.c, job.h, main.c, makeint.h: Move content to new files.
* w32/include/sub_proc.h, w32/subproc/sub_proc.c: Ditto.
* Makefile.am: Build and package OS-specific files.
* build_w32.bat, make_msvc_net2003.vcproj, README.W32.template:
Update for new files, and clean up the build.
* POTFILES.in, maintMakefile, NMakefile.template: Ditto.
* w32/subproc/build.bat: Delete as unused.
2016-03-07 02:29:43 +08:00
|
|
|
set EXTRAS=
|
|
|
|
if "%2" == "GUILE" set "EXTRAS=%GUILECFLAGS%"
|
2018-02-11 04:34:53 +08:00
|
|
|
if exist "%OUTDIR%\%1.%O%" del "%OUTDIR%\%1.%O%"
|
Extract jobserver implementation into OS-specific files.
* os.h, posixos.c, w32/w32os.c: New files implementing jobserver.
* job.c, job.h, main.c, makeint.h: Move content to new files.
* w32/include/sub_proc.h, w32/subproc/sub_proc.c: Ditto.
* Makefile.am: Build and package OS-specific files.
* build_w32.bat, make_msvc_net2003.vcproj, README.W32.template:
Update for new files, and clean up the build.
* POTFILES.in, maintMakefile, NMakefile.template: Ditto.
* w32/subproc/build.bat: Delete as unused.
2016-03-07 02:29:43 +08:00
|
|
|
if "%COMPILER%" == "gcc" goto GccCompile
|
2020-01-24 16:13:12 +08:00
|
|
|
if "%COMPILER%" == "tcc" goto TccCompile
|
Extract jobserver implementation into OS-specific files.
* os.h, posixos.c, w32/w32os.c: New files implementing jobserver.
* job.c, job.h, main.c, makeint.h: Move content to new files.
* w32/include/sub_proc.h, w32/subproc/sub_proc.c: Ditto.
* Makefile.am: Build and package OS-specific files.
* build_w32.bat, make_msvc_net2003.vcproj, README.W32.template:
Update for new files, and clean up the build.
* POTFILES.in, maintMakefile, NMakefile.template: Ditto.
* w32/subproc/build.bat: Delete as unused.
2016-03-07 02:29:43 +08:00
|
|
|
|
|
|
|
:: MSVC Compile
|
2022-08-15 03:03:40 +08:00
|
|
|
if "%VERBOSE%" == "Y" echo on
|
2022-10-18 05:56:18 +08:00
|
|
|
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
|
Extract jobserver implementation into OS-specific files.
* os.h, posixos.c, w32/w32os.c: New files implementing jobserver.
* job.c, job.h, main.c, makeint.h: Move content to new files.
* w32/include/sub_proc.h, w32/subproc/sub_proc.c: Ditto.
* Makefile.am: Build and package OS-specific files.
* build_w32.bat, make_msvc_net2003.vcproj, README.W32.template:
Update for new files, and clean up the build.
* POTFILES.in, maintMakefile, NMakefile.template: Ditto.
* w32/subproc/build.bat: Delete as unused.
2016-03-07 02:29:43 +08:00
|
|
|
@echo off
|
2018-02-11 04:34:53 +08:00
|
|
|
goto CompileDone
|
Extract jobserver implementation into OS-specific files.
* os.h, posixos.c, w32/w32os.c: New files implementing jobserver.
* job.c, job.h, main.c, makeint.h: Move content to new files.
* w32/include/sub_proc.h, w32/subproc/sub_proc.c: Ditto.
* Makefile.am: Build and package OS-specific files.
* build_w32.bat, make_msvc_net2003.vcproj, README.W32.template:
Update for new files, and clean up the build.
* POTFILES.in, maintMakefile, NMakefile.template: Ditto.
* w32/subproc/build.bat: Delete as unused.
2016-03-07 02:29:43 +08:00
|
|
|
|
|
|
|
:GccCompile
|
|
|
|
:: GCC Compile
|
2022-08-15 03:03:40 +08:00
|
|
|
if "%VERBOSE%" == "Y" echo on
|
2022-10-18 05:56:18 +08:00
|
|
|
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
|
Extract jobserver implementation into OS-specific files.
* os.h, posixos.c, w32/w32os.c: New files implementing jobserver.
* job.c, job.h, main.c, makeint.h: Move content to new files.
* w32/include/sub_proc.h, w32/subproc/sub_proc.c: Ditto.
* Makefile.am: Build and package OS-specific files.
* build_w32.bat, make_msvc_net2003.vcproj, README.W32.template:
Update for new files, and clean up the build.
* POTFILES.in, maintMakefile, NMakefile.template: Ditto.
* w32/subproc/build.bat: Delete as unused.
2016-03-07 02:29:43 +08:00
|
|
|
@echo off
|
2020-01-24 16:13:12 +08:00
|
|
|
goto CompileDone
|
|
|
|
|
|
|
|
:TccCompile
|
|
|
|
:: TCC Compile
|
2022-08-15 03:03:40 +08:00
|
|
|
if "%VERBOSE%" == "Y" echo on
|
2022-10-18 05:56:18 +08:00
|
|
|
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
|
2020-01-24 16:13:12 +08:00
|
|
|
@echo off
|
|
|
|
goto CompileDone
|
2018-02-11 04:34:53 +08:00
|
|
|
|
2023-06-19 21:51:13 +08:00
|
|
|
:ResourceCompile
|
|
|
|
if "%VERBOSE%" == "N" echo - Compiling %1.rc
|
|
|
|
echo %LNKOUT%/%1.%O% >>%OUTDIR%\link.sc
|
|
|
|
if exist "%OUTDIR%\%1.%O%" del "%OUTDIR%\%1.%O%"
|
|
|
|
if "%COMPILER%" == "gcc" goto GccResourceCompile
|
|
|
|
if "%COMPILER%" == "tcc" goto TccResourceCompile
|
|
|
|
|
|
|
|
:: MSVC Resource Compile
|
|
|
|
if "%VERBOSE%" == "Y" echo on
|
|
|
|
call %RC% /fo %OUTDIR%\%1.%O% %1.rc
|
|
|
|
@echo off
|
|
|
|
goto CompileDone
|
|
|
|
|
|
|
|
:GccResourceCompile
|
|
|
|
:: GCC Resource Compile
|
|
|
|
if "%VERBOSE%" == "Y" echo on
|
|
|
|
call %RC% -o %OUTDIR%/%1.%O% -i %1.rc
|
|
|
|
@echo off
|
|
|
|
goto CompileDone
|
|
|
|
|
|
|
|
:TccResourceCompile
|
|
|
|
:: TCC Resource Compile
|
|
|
|
goto GccResourceCompile
|
|
|
|
|
2018-02-11 04:34:53 +08:00
|
|
|
:CompileDone
|
|
|
|
if not exist "%OUTDIR%\%1.%O%" exit 1
|
Extract jobserver implementation into OS-specific files.
* os.h, posixos.c, w32/w32os.c: New files implementing jobserver.
* job.c, job.h, main.c, makeint.h: Move content to new files.
* w32/include/sub_proc.h, w32/subproc/sub_proc.c: Ditto.
* Makefile.am: Build and package OS-specific files.
* build_w32.bat, make_msvc_net2003.vcproj, README.W32.template:
Update for new files, and clean up the build.
* POTFILES.in, maintMakefile, NMakefile.template: Ditto.
* w32/subproc/build.bat: Delete as unused.
2016-03-07 02:29:43 +08:00
|
|
|
goto :EOF
|
|
|
|
|
|
|
|
:Link
|
2019-08-28 22:45:49 +08:00
|
|
|
echo.
|
2022-08-15 03:03:40 +08:00
|
|
|
echo - Linking %LNKOUT%/%MAKE%.exe
|
Extract jobserver implementation into OS-specific files.
* os.h, posixos.c, w32/w32os.c: New files implementing jobserver.
* job.c, job.h, main.c, makeint.h: Move content to new files.
* w32/include/sub_proc.h, w32/subproc/sub_proc.c: Ditto.
* Makefile.am: Build and package OS-specific files.
* build_w32.bat, make_msvc_net2003.vcproj, README.W32.template:
Update for new files, and clean up the build.
* POTFILES.in, maintMakefile, NMakefile.template: Ditto.
* w32/subproc/build.bat: Delete as unused.
2016-03-07 02:29:43 +08:00
|
|
|
if "%COMPILER%" == "gcc" goto GccLink
|
2020-01-24 16:13:12 +08:00
|
|
|
if "%COMPILER%" == "tcc" goto TccLink
|
Extract jobserver implementation into OS-specific files.
* os.h, posixos.c, w32/w32os.c: New files implementing jobserver.
* job.c, job.h, main.c, makeint.h: Move content to new files.
* w32/include/sub_proc.h, w32/subproc/sub_proc.c: Ditto.
* Makefile.am: Build and package OS-specific files.
* build_w32.bat, make_msvc_net2003.vcproj, README.W32.template:
Update for new files, and clean up the build.
* POTFILES.in, maintMakefile, NMakefile.template: Ditto.
* w32/subproc/build.bat: Delete as unused.
2016-03-07 02:29:43 +08:00
|
|
|
|
|
|
|
:: MSVC Link
|
|
|
|
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
|
2022-08-15 03:03:40 +08:00
|
|
|
if "%VERBOSE%" == "Y" echo on
|
2022-06-19 04:42:11 +08:00
|
|
|
call link.exe /NOLOGO /SUBSYSTEM:console /PDB:%LNKOUT%\%MAKE%.pdb %LINKOPTS% /OUT:%LNKOUT%\%MAKE%.exe @%LNKOUT%\link.sc
|
Extract jobserver implementation into OS-specific files.
* os.h, posixos.c, w32/w32os.c: New files implementing jobserver.
* job.c, job.h, main.c, makeint.h: Move content to new files.
* w32/include/sub_proc.h, w32/subproc/sub_proc.c: Ditto.
* Makefile.am: Build and package OS-specific files.
* build_w32.bat, make_msvc_net2003.vcproj, README.W32.template:
Update for new files, and clean up the build.
* POTFILES.in, maintMakefile, NMakefile.template: Ditto.
* w32/subproc/build.bat: Delete as unused.
2016-03-07 02:29:43 +08:00
|
|
|
@echo off
|
|
|
|
goto :EOF
|
|
|
|
|
|
|
|
:GccLink
|
|
|
|
:: GCC Link
|
2022-08-15 03:03:40 +08:00
|
|
|
if "%VERBOSE%" == "Y" echo on
|
Rework directory structure to use GNU-recommended "src" directory.
Move the source code (other than glob) into the "src" subdirectory.
Update all scripting and recommendations to support this change.
* *.c, *.h, w32/*: Move to src/
* configure.ac, Makefile.am, maintMakefile: Locate new source files.
* Basic.mk.template, mk/*: Update for new source file locations.
* NEWS, README.DOS.template: Update for new locations.
* build.template, build_w32.bat, builddos.bat: Ditto.
* po/POTFILES.in: Ditto
* tests/run_make_tests.pl, tests/scripts/features/load*: Ditto.
* make.1: Move to doc.
* mk/VMS.mk: Add support for building on VMS (hopefully).
* makefile.vms, prepare_w32.bat: Remove.
* SCOPTIONS: Update to define HAVE_CONFIG_H
2017-11-20 02:49:26 +08:00
|
|
|
echo %GUILELIBS% -lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -luuid -lodbc32 -lodbccp32 >>%OUTDIR%\link.sc
|
2022-06-19 04:42:11 +08:00
|
|
|
call %COMPILER% -mthreads -gdwarf-2 -g3 %OPTS% -o %LNKOUT%/%MAKE%.exe @%LNKOUT%/link.sc -Wl,--out-implib=%LNKOUT%/libgnumake-1.dll.a
|
2013-06-22 22:32:46 +08:00
|
|
|
@echo off
|
Extract jobserver implementation into OS-specific files.
* os.h, posixos.c, w32/w32os.c: New files implementing jobserver.
* job.c, job.h, main.c, makeint.h: Move content to new files.
* w32/include/sub_proc.h, w32/subproc/sub_proc.c: Ditto.
* Makefile.am: Build and package OS-specific files.
* build_w32.bat, make_msvc_net2003.vcproj, README.W32.template:
Update for new files, and clean up the build.
* POTFILES.in, maintMakefile, NMakefile.template: Ditto.
* w32/subproc/build.bat: Delete as unused.
2016-03-07 02:29:43 +08:00
|
|
|
goto :EOF
|
|
|
|
|
2020-01-24 16:13:12 +08:00
|
|
|
:TccLink
|
|
|
|
:: TCC Link
|
2022-08-15 03:03:40 +08:00
|
|
|
if "%VERBOSE%" == "Y" echo on
|
2020-01-24 16:13:12 +08:00
|
|
|
echo %GUILELIBS% -lkernel32 -luser32 -lgdi32 -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -lodbc32 -lodbccp32 >>%OUTDIR%\link.sc
|
2022-06-19 04:42:11 +08:00
|
|
|
call %COMPILER% -mthreads %OPTS% -o %LNKOUT%/%MAKE%.exe @%LNKOUT%/link.sc
|
2020-01-24 16:13:12 +08:00
|
|
|
@echo off
|
|
|
|
goto :EOF
|
|
|
|
|
Extract jobserver implementation into OS-specific files.
* os.h, posixos.c, w32/w32os.c: New files implementing jobserver.
* job.c, job.h, main.c, makeint.h: Move content to new files.
* w32/include/sub_proc.h, w32/subproc/sub_proc.c: Ditto.
* Makefile.am: Build and package OS-specific files.
* build_w32.bat, make_msvc_net2003.vcproj, README.W32.template:
Update for new files, and clean up the build.
* POTFILES.in, maintMakefile, NMakefile.template: Ditto.
* w32/subproc/build.bat: Delete as unused.
2016-03-07 02:29:43 +08:00
|
|
|
:ChkGuile
|
2018-02-11 04:34:53 +08:00
|
|
|
:: Build with Guile is supported only on NT and later versions
|
Extract jobserver implementation into OS-specific files.
* os.h, posixos.c, w32/w32os.c: New files implementing jobserver.
* job.c, job.h, main.c, makeint.h: Move content to new files.
* w32/include/sub_proc.h, w32/subproc/sub_proc.c: Ditto.
* Makefile.am: Build and package OS-specific files.
* build_w32.bat, make_msvc_net2003.vcproj, README.W32.template:
Update for new files, and clean up the build.
* POTFILES.in, maintMakefile, NMakefile.template: Ditto.
* w32/subproc/build.bat: Delete as unused.
2016-03-07 02:29:43 +08:00
|
|
|
if not "%OS%" == "Windows_NT" goto NoGuile
|
2022-06-19 04:42:11 +08:00
|
|
|
call pkg-config --help > %OUTDIR%\guile.tmp 2> NUL
|
Extract jobserver implementation into OS-specific files.
* os.h, posixos.c, w32/w32os.c: New files implementing jobserver.
* job.c, job.h, main.c, makeint.h: Move content to new files.
* w32/include/sub_proc.h, w32/subproc/sub_proc.c: Ditto.
* Makefile.am: Build and package OS-specific files.
* build_w32.bat, make_msvc_net2003.vcproj, README.W32.template:
Update for new files, and clean up the build.
* POTFILES.in, maintMakefile, NMakefile.template: Ditto.
* w32/subproc/build.bat: Delete as unused.
2016-03-07 02:29:43 +08:00
|
|
|
if ERRORLEVEL 1 goto NoPkgCfg
|
|
|
|
|
2022-06-19 04:42:11 +08:00
|
|
|
set PKGMSC=
|
Extract jobserver implementation into OS-specific files.
* os.h, posixos.c, w32/w32os.c: New files implementing jobserver.
* job.c, job.h, main.c, makeint.h: Move content to new files.
* w32/include/sub_proc.h, w32/subproc/sub_proc.c: Ditto.
* Makefile.am: Build and package OS-specific files.
* build_w32.bat, make_msvc_net2003.vcproj, README.W32.template:
Update for new files, and clean up the build.
* POTFILES.in, maintMakefile, NMakefile.template: Ditto.
* w32/subproc/build.bat: Delete as unused.
2016-03-07 02:29:43 +08:00
|
|
|
if not "%COMPILER%" == "gcc" set PKGMSC=--msvc-syntax
|
|
|
|
|
2022-06-19 04:42:11 +08:00
|
|
|
echo Checking for Guile 2.0
|
|
|
|
call pkg-config --cflags --short-errors "guile-2.0" > %OUTDIR%\gl-c2.tmp 2> NUL
|
|
|
|
if not ERRORLEVEL 1 set /P GUILECFLAGS= < %OUTDIR%\gl-c2.tmp
|
|
|
|
|
|
|
|
call pkg-config --libs --static --short-errors %PKGMSC% "guile-2.0" > %OUTDIR%\gl-l2.tmp 2> NUL
|
|
|
|
if not ERRORLEVEL 1 set /P GUILELIBS= < %OUTDIR%\gl-l2.tmp
|
Extract jobserver implementation into OS-specific files.
* os.h, posixos.c, w32/w32os.c: New files implementing jobserver.
* job.c, job.h, main.c, makeint.h: Move content to new files.
* w32/include/sub_proc.h, w32/subproc/sub_proc.c: Ditto.
* Makefile.am: Build and package OS-specific files.
* build_w32.bat, make_msvc_net2003.vcproj, README.W32.template:
Update for new files, and clean up the build.
* POTFILES.in, maintMakefile, NMakefile.template: Ditto.
* w32/subproc/build.bat: Delete as unused.
2016-03-07 02:29:43 +08:00
|
|
|
|
|
|
|
if not "%GUILECFLAGS%" == "" goto GuileDone
|
|
|
|
|
|
|
|
echo Checking for Guile 1.8
|
2022-06-19 04:42:11 +08:00
|
|
|
call pkg-config --cflags --short-errors "guile-1.8" > %OUTDIR%\gl-c18.tmp 2> NUL
|
|
|
|
if not ERRORLEVEL 1 set /P GUILECFLAGS= < %OUTDIR%\gl-c18.tmp
|
Extract jobserver implementation into OS-specific files.
* os.h, posixos.c, w32/w32os.c: New files implementing jobserver.
* job.c, job.h, main.c, makeint.h: Move content to new files.
* w32/include/sub_proc.h, w32/subproc/sub_proc.c: Ditto.
* Makefile.am: Build and package OS-specific files.
* build_w32.bat, make_msvc_net2003.vcproj, README.W32.template:
Update for new files, and clean up the build.
* POTFILES.in, maintMakefile, NMakefile.template: Ditto.
* w32/subproc/build.bat: Delete as unused.
2016-03-07 02:29:43 +08:00
|
|
|
|
2022-06-19 04:42:11 +08:00
|
|
|
call pkg-config --libs --static --short-errors %PKGMSC% "guile-1.8" > %OUTDIR%\gl-l18.tmp 2> NUL
|
|
|
|
if not ERRORLEVEL 1 set /P GUILELIBS= < %OUTDIR%\gl-l18.tmp
|
Extract jobserver implementation into OS-specific files.
* os.h, posixos.c, w32/w32os.c: New files implementing jobserver.
* job.c, job.h, main.c, makeint.h: Move content to new files.
* w32/include/sub_proc.h, w32/subproc/sub_proc.c: Ditto.
* Makefile.am: Build and package OS-specific files.
* build_w32.bat, make_msvc_net2003.vcproj, README.W32.template:
Update for new files, and clean up the build.
* POTFILES.in, maintMakefile, NMakefile.template: Ditto.
* w32/subproc/build.bat: Delete as unused.
2016-03-07 02:29:43 +08:00
|
|
|
|
|
|
|
if not "%GUILECFLAGS%" == "" goto GuileDone
|
|
|
|
|
2018-02-11 04:34:53 +08:00
|
|
|
echo - No Guile found, building without Guile
|
Extract jobserver implementation into OS-specific files.
* os.h, posixos.c, w32/w32os.c: New files implementing jobserver.
* job.c, job.h, main.c, makeint.h: Move content to new files.
* w32/include/sub_proc.h, w32/subproc/sub_proc.c: Ditto.
* Makefile.am: Build and package OS-specific files.
* build_w32.bat, make_msvc_net2003.vcproj, README.W32.template:
Update for new files, and clean up the build.
* POTFILES.in, maintMakefile, NMakefile.template: Ditto.
* w32/subproc/build.bat: Delete as unused.
2016-03-07 02:29:43 +08:00
|
|
|
goto GuileDone
|
|
|
|
|
|
|
|
:NoPkgCfg
|
2018-02-11 04:34:53 +08:00
|
|
|
echo - pkg-config not found, building without Guile
|
Extract jobserver implementation into OS-specific files.
* os.h, posixos.c, w32/w32os.c: New files implementing jobserver.
* job.c, job.h, main.c, makeint.h: Move content to new files.
* w32/include/sub_proc.h, w32/subproc/sub_proc.c: Ditto.
* Makefile.am: Build and package OS-specific files.
* build_w32.bat, make_msvc_net2003.vcproj, README.W32.template:
Update for new files, and clean up the build.
* POTFILES.in, maintMakefile, NMakefile.template: Ditto.
* w32/subproc/build.bat: Delete as unused.
2016-03-07 02:29:43 +08:00
|
|
|
|
|
|
|
:GuileDone
|
|
|
|
if "%GUILECFLAGS%" == "" goto :EOF
|
|
|
|
|
2018-02-11 04:34:53 +08:00
|
|
|
echo - Guile found: building with Guile
|
Extract jobserver implementation into OS-specific files.
* os.h, posixos.c, w32/w32os.c: New files implementing jobserver.
* job.c, job.h, main.c, makeint.h: Move content to new files.
* w32/include/sub_proc.h, w32/subproc/sub_proc.c: Ditto.
* Makefile.am: Build and package OS-specific files.
* build_w32.bat, make_msvc_net2003.vcproj, README.W32.template:
Update for new files, and clean up the build.
* POTFILES.in, maintMakefile, NMakefile.template: Ditto.
* w32/subproc/build.bat: Delete as unused.
2016-03-07 02:29:43 +08:00
|
|
|
set "GUILECFLAGS=%GUILECFLAGS% -DHAVE_GUILE"
|
|
|
|
goto :EOF
|
|
|
|
|
2018-02-11 04:34:53 +08:00
|
|
|
:FindVswhere
|
|
|
|
set VSWHERE=vswhere
|
2022-06-19 04:42:11 +08:00
|
|
|
call "%VSWHERE%" -help >nul 2>&1
|
2018-02-11 04:34:53 +08:00
|
|
|
if not ERRORLEVEL 1 exit /b 0
|
|
|
|
set "VSWHERE=C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere"
|
2022-06-19 04:42:11 +08:00
|
|
|
call "%VSWHERE%" -help >nul 2>&1
|
2018-02-11 04:34:53 +08:00
|
|
|
if ERRORLEVEL 1 exit /b 1
|
|
|
|
goto :EOF
|
|
|
|
|
2016-06-19 22:52:17 +08:00
|
|
|
:CheckMSVC
|
|
|
|
if not exist "%VSVARS%" exit /b 1
|
|
|
|
call "%VSVARS%" %ARCH%
|
|
|
|
if ERRORLEVEL 1 exit /b 1
|
2022-06-19 04:42:11 +08:00
|
|
|
call %COMPILER% >nul 2>&1
|
2016-06-19 22:52:17 +08:00
|
|
|
if ERRORLEVEL 1 exit /b 1
|
|
|
|
goto :EOF
|
|
|
|
|
2022-08-15 03:03:40 +08:00
|
|
|
:NotConfig
|
|
|
|
echo.
|
|
|
|
echo *** This workspace is not configured.
|
|
|
|
echo Either retrieve the configured source in the release tarball
|
|
|
|
echo or, if building from Git, run the .\bootstrap.bat script first.
|
|
|
|
exit /b 1
|
|
|
|
|
2013-04-26 01:41:53 +08:00
|
|
|
:Usage
|
2020-01-24 16:13:12 +08:00
|
|
|
echo Usage: %0 [options] [gcc] OR [tcc]
|
2013-04-26 01:41:53 +08:00
|
|
|
echo Options:
|
|
|
|
echo. --without-guile Do not compile Guile support even if found
|
2016-06-19 22:52:17 +08:00
|
|
|
echo. --debug Make a Debug build--default is Release
|
|
|
|
echo. --x86 Make a 32bit binary--default is 64bit
|
2013-04-26 01:41:53 +08:00
|
|
|
echo. --help Display these instructions and exit
|
2020-01-24 16:13:12 +08:00
|
|
|
echo.
|
|
|
|
echo. "gcc" means compile with GCC, "tcc" means compile with Tiny C's TCC
|
Extract jobserver implementation into OS-specific files.
* os.h, posixos.c, w32/w32os.c: New files implementing jobserver.
* job.c, job.h, main.c, makeint.h: Move content to new files.
* w32/include/sub_proc.h, w32/subproc/sub_proc.c: Ditto.
* Makefile.am: Build and package OS-specific files.
* build_w32.bat, make_msvc_net2003.vcproj, README.W32.template:
Update for new files, and clean up the build.
* POTFILES.in, maintMakefile, NMakefile.template: Ditto.
* w32/subproc/build.bat: Delete as unused.
2016-03-07 02:29:43 +08:00
|
|
|
goto :EOF
|
|
|
|
|
|
|
|
:Reset
|
2016-06-19 22:52:17 +08:00
|
|
|
set ARCH=
|
2013-04-26 01:41:53 +08:00
|
|
|
set COMPILER=
|
Extract jobserver implementation into OS-specific files.
* os.h, posixos.c, w32/w32os.c: New files implementing jobserver.
* job.c, job.h, main.c, makeint.h: Move content to new files.
* w32/include/sub_proc.h, w32/subproc/sub_proc.c: Ditto.
* Makefile.am: Build and package OS-specific files.
* build_w32.bat, make_msvc_net2003.vcproj, README.W32.template:
Update for new files, and clean up the build.
* POTFILES.in, maintMakefile, NMakefile.template: Ditto.
* w32/subproc/build.bat: Delete as unused.
2016-03-07 02:29:43 +08:00
|
|
|
set DEBUG=
|
|
|
|
set GUILE=
|
|
|
|
set GUILECFLAGS=
|
|
|
|
set GUILELIBS=
|
|
|
|
set LINKOPTS=
|
|
|
|
set MAKE=
|
2013-04-26 01:41:53 +08:00
|
|
|
set NOGUILE=
|
Rework directory structure to use GNU-recommended "src" directory.
Move the source code (other than glob) into the "src" subdirectory.
Update all scripting and recommendations to support this change.
* *.c, *.h, w32/*: Move to src/
* configure.ac, Makefile.am, maintMakefile: Locate new source files.
* Basic.mk.template, mk/*: Update for new source file locations.
* NEWS, README.DOS.template: Update for new locations.
* build.template, build_w32.bat, builddos.bat: Ditto.
* po/POTFILES.in: Ditto
* tests/run_make_tests.pl, tests/scripts/features/load*: Ditto.
* make.1: Move to doc.
* mk/VMS.mk: Add support for building on VMS (hopefully).
* makefile.vms, prepare_w32.bat: Remove.
* SCOPTIONS: Update to define HAVE_CONFIG_H
2017-11-20 02:49:26 +08:00
|
|
|
set O=
|
Extract jobserver implementation into OS-specific files.
* os.h, posixos.c, w32/w32os.c: New files implementing jobserver.
* job.c, job.h, main.c, makeint.h: Move content to new files.
* w32/include/sub_proc.h, w32/subproc/sub_proc.c: Ditto.
* Makefile.am: Build and package OS-specific files.
* build_w32.bat, make_msvc_net2003.vcproj, README.W32.template:
Update for new files, and clean up the build.
* POTFILES.in, maintMakefile, NMakefile.template: Ditto.
* w32/subproc/build.bat: Delete as unused.
2016-03-07 02:29:43 +08:00
|
|
|
set OPTS=
|
|
|
|
set OUTDIR=
|
2019-08-28 22:45:49 +08:00
|
|
|
set LNKOUT=
|
Extract jobserver implementation into OS-specific files.
* os.h, posixos.c, w32/w32os.c: New files implementing jobserver.
* job.c, job.h, main.c, makeint.h: Move content to new files.
* w32/include/sub_proc.h, w32/subproc/sub_proc.c: Ditto.
* Makefile.am: Build and package OS-specific files.
* build_w32.bat, make_msvc_net2003.vcproj, README.W32.template:
Update for new files, and clean up the build.
* POTFILES.in, maintMakefile, NMakefile.template: Ditto.
* w32/subproc/build.bat: Delete as unused.
2016-03-07 02:29:43 +08:00
|
|
|
set PKGMSC=
|
2016-06-19 22:52:17 +08:00
|
|
|
set VSVARS=
|
Extract jobserver implementation into OS-specific files.
* os.h, posixos.c, w32/w32os.c: New files implementing jobserver.
* job.c, job.h, main.c, makeint.h: Move content to new files.
* w32/include/sub_proc.h, w32/subproc/sub_proc.c: Ditto.
* Makefile.am: Build and package OS-specific files.
* build_w32.bat, make_msvc_net2003.vcproj, README.W32.template:
Update for new files, and clean up the build.
* POTFILES.in, maintMakefile, NMakefile.template: Ditto.
* w32/subproc/build.bat: Delete as unused.
2016-03-07 02:29:43 +08:00
|
|
|
goto :EOF
|