2006-02-11 22:16:04 +00:00
|
|
|
@echo off
|
2017-07-10 01:52:28 +00:00
|
|
|
rem Copyright (C) 1996-2017 Free Software Foundation, Inc.
|
2006-02-11 22:16:04 +00:00
|
|
|
rem This file is part of GNU Make.
|
2007-07-04 19:35:15 +00:00
|
|
|
rem
|
|
|
|
rem GNU Make is free software; you can redistribute it and/or modify it under
|
|
|
|
rem the terms of the GNU General Public License as published by the Free
|
|
|
|
rem Software Foundation; either version 3 of the License, or (at your option)
|
|
|
|
rem any later version.
|
|
|
|
rem
|
|
|
|
rem GNU Make is distributed in the hope that it will be useful, but WITHOUT
|
|
|
|
rem ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
|
|
rem FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for.
|
|
|
|
rem more details.
|
|
|
|
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/>.
|
2006-02-11 19:02:21 +00:00
|
|
|
|
2016-06-19 14:52:17 +00:00
|
|
|
setlocal
|
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-06 18:29:43 +00:00
|
|
|
call :Reset
|
|
|
|
|
|
|
|
if "%1" == "-h" goto Usage
|
|
|
|
if "%1" == "--help" goto Usage
|
|
|
|
|
|
|
|
set MAKE=gnumake
|
|
|
|
set GUILE=Y
|
2016-06-19 14:52:17 +00:00
|
|
|
set COMPILER=cl.exe
|
|
|
|
set ARCH=x64
|
|
|
|
set DEBUG=N
|
2012-01-28 20:28:31 +00:00
|
|
|
|
2013-04-25 17:41:53 +00:00
|
|
|
: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-06 18:29:43 +00:00
|
|
|
if "%1" == "--debug" goto SetDebug
|
|
|
|
if "%1" == "--without-guile" goto NoGuile
|
2016-06-19 14:52:17 +00: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-06 18:29:43 +00:00
|
|
|
if "%1" == "gcc" goto SetCC
|
|
|
|
if "%1" == "" goto DoneSW
|
2016-06-19 14:52:17 +00: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-06 18:29:43 +00:00
|
|
|
|
|
|
|
:SetDebug
|
|
|
|
set DEBUG=Y
|
2013-04-25 17:41:53 +00: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-06 18:29:43 +00:00
|
|
|
goto ParseSW
|
|
|
|
|
2013-04-25 17:41:53 +00: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-06 18:29:43 +00:00
|
|
|
set GUILE=N
|
|
|
|
echo Building without Guile
|
2013-04-25 17:41:53 +00: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-06 18:29:43 +00:00
|
|
|
goto ParseSW
|
|
|
|
|
2016-06-19 14:52:17 +00:00
|
|
|
:Set32Bit
|
|
|
|
set ARCH=x86
|
|
|
|
shift
|
|
|
|
goto ParseSW
|
|
|
|
|
2013-04-25 17:41:53 +00:00
|
|
|
:SetCC
|
|
|
|
set COMPILER=gcc
|
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-06 18:29:43 +00:00
|
|
|
echo Building with GCC
|
2013-04-25 17:41:53 +00: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-06 18:29:43 +00:00
|
|
|
goto ParseSW
|
|
|
|
|
2012-01-28 20:28:31 +00:00
|
|
|
rem 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-06 18:29:43 +00:00
|
|
|
:DoneSW
|
2013-04-25 17:41:53 +00:00
|
|
|
echo.
|
2016-06-19 14:52:17 +00:00
|
|
|
echo Creating GNU Make for Windows 9X/NT/2K/XP/Vista/7/8/10
|
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-06 18:29:43 +00:00
|
|
|
if "%DEBUG%" == "Y" echo Building without compiler optimizations
|
|
|
|
|
|
|
|
if "%COMPILER%" == "gcc" goto GccBuild
|
|
|
|
|
2016-06-19 14:52:17 +00:00
|
|
|
rem Make sure we can find a compiler
|
|
|
|
%COMPILER% >nul 2>&1
|
|
|
|
if not ERRORLEVEL 1 goto FoundMSVC
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
|
rem We did not find anything--fail
|
|
|
|
echo No MSVC compiler available.
|
|
|
|
echo Please run vcvarsall.bat and/or configure your Path.
|
|
|
|
exit /b 1
|
|
|
|
|
|
|
|
: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-06 18:29:43 +00:00
|
|
|
set OUTDIR=.\WinRel
|
|
|
|
set "OPTS=/O2 /D NDEBUG"
|
|
|
|
set LINKOPTS=
|
|
|
|
if "%DEBUG%" == "Y" set OUTDIR=.\WinDebug
|
|
|
|
if "%DEBUG%" == "Y" set "OPTS=/Zi /Od /D _DEBUG"
|
|
|
|
if "%DEBUG%" == "Y" set LINKOPTS=/DEBUG
|
|
|
|
call :Build
|
|
|
|
goto Done
|
|
|
|
|
|
|
|
:GccBuild
|
|
|
|
set OUTDIR=.\GccRel
|
|
|
|
set OPTS=-O2
|
|
|
|
if "%DEBUG%" == "Y" set OPTS=-O0
|
|
|
|
if "%DEBUG%" == "Y" set OUTDIR=.\GccDebug
|
|
|
|
call :Build
|
|
|
|
goto Done
|
|
|
|
|
|
|
|
:Done
|
|
|
|
call :Reset
|
|
|
|
goto :EOF
|
|
|
|
|
|
|
|
:Build
|
|
|
|
:: Clean the directory if it exists
|
|
|
|
if exist %OUTDIR%\nul rmdir /S /Q %OUTDIR%
|
|
|
|
|
|
|
|
:: Recreate it
|
|
|
|
mkdir %OUTDIR%
|
|
|
|
mkdir %OUTDIR%\glob
|
|
|
|
mkdir %OUTDIR%\w32
|
|
|
|
mkdir %OUTDIR%\w32\compat
|
|
|
|
mkdir %OUTDIR%\w32\subproc
|
|
|
|
|
|
|
|
if "%GUILE%" == "Y" call :ChkGuile
|
2006-02-11 22:16:04 +00:00
|
|
|
|
2013-04-25 17:41:53 +00: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-06 18:29:43 +00:00
|
|
|
echo Compiling %OUTDIR% version
|
|
|
|
|
|
|
|
if exist config.h.W32.template call :ConfigSCM
|
|
|
|
copy config.h.W32 %OUTDIR%\config.h
|
|
|
|
|
|
|
|
call :Compile ar
|
|
|
|
call :Compile arscan
|
|
|
|
call :Compile commands
|
|
|
|
call :Compile default
|
|
|
|
call :Compile dir
|
|
|
|
call :Compile expand
|
|
|
|
call :Compile file
|
|
|
|
call :Compile function
|
|
|
|
call :Compile getloadavg
|
|
|
|
call :Compile getopt
|
|
|
|
call :Compile getopt1
|
|
|
|
call :Compile glob\fnmatch
|
|
|
|
call :Compile glob\glob
|
|
|
|
call :Compile guile GUILE
|
|
|
|
call :Compile hash
|
|
|
|
call :Compile implicit
|
|
|
|
call :Compile job
|
|
|
|
call :Compile load
|
|
|
|
call :Compile loadapi
|
|
|
|
call :Compile main GUILE
|
|
|
|
call :Compile misc
|
|
|
|
call :Compile output
|
|
|
|
call :Compile read
|
|
|
|
call :Compile remake
|
|
|
|
call :Compile remote-stub
|
|
|
|
call :Compile rule
|
|
|
|
call :Compile signame
|
|
|
|
call :Compile strcache
|
|
|
|
call :Compile variable
|
|
|
|
call :Compile version
|
|
|
|
call :Compile vpath
|
|
|
|
call :Compile w32\pathstuff
|
Remove unsupported build facilities.
Over time the non-standard build and install systems (nmake files,
smake files, Visual Studio project files, etc.) have atrophied and
maintaining them is not worth the effort, for such a simple utility
as make. Remove all the non-standard build tool support and unify
OS-specific build rules under a basic set of (GNU make) makefiles.
Preserve the existing bootstrapping scripts (for POSIX, Windows,
and MS-DOS). Also the existing VMS build scripts are left unchanged:
I don't have enough experience with VMS to venture into this area.
Perhaps one of the VMS maintainers might like to determine whether
conversion would be appropriate.
Rather than create libraries for w32 and glob (non-POSIX), simply
link the object files directly to remove the complexity.
* NEWS: Update with user-facing notes.
* Makefile.am: Clean up to use the latest automake best practices.
Build Windows code directly from the root makefile to avoid recursion.
* README.Amiga, README.DOS.template, README.W32.template: Updated.
* INSTALL: Point readers at the README.git file.
* maintMakefile: Remove obsolete files. Create Basic.mk file.
* Basic.mk.template, mk/*.mk: Create basic GNU make-based makefiles.
* build_w32.bat: Copy Basic.mk to Makefile
* configure.ac: We no longer need AM_PROG_AR.
* dosbuild.bat: Rename to builddos.bat. Incorporate configure.bat.
* Makefile.DOS.template: Remove.
* NMakefile.template, w32/subproc/NMakefile: Remove.
* SMakefile.template, glob/SMakefile, glob/SCOPTIONS, make.lnk: Remove.
* configure.bat, glob/configure.bat: Remove.
* w32/Makefile.am: Remove.
* make_msvc_net2003.sln, make_msvc_net2003.vcproj: Remove.
2017-11-12 22:44:38 +00:00
|
|
|
call :Compile w32\w32os
|
|
|
|
call :Compile w32\compat\posixfcn
|
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-06 18:29:43 +00:00
|
|
|
call :Compile w32\subproc\misc
|
|
|
|
call :Compile w32\subproc\sub_proc
|
|
|
|
call :Compile w32\subproc\w32err
|
|
|
|
|
|
|
|
if not "%COMPILER%" == "gcc" call :Compile w32\compat\dirent
|
|
|
|
|
|
|
|
call :Link
|
|
|
|
|
|
|
|
echo.
|
|
|
|
if not exist %OUTDIR%\%MAKE%.exe echo %OUTDIR% build FAILED!
|
|
|
|
if exist %OUTDIR%\%MAKE%.exe echo %OUTDIR% build succeeded.
|
Remove unsupported build facilities.
Over time the non-standard build and install systems (nmake files,
smake files, Visual Studio project files, etc.) have atrophied and
maintaining them is not worth the effort, for such a simple utility
as make. Remove all the non-standard build tool support and unify
OS-specific build rules under a basic set of (GNU make) makefiles.
Preserve the existing bootstrapping scripts (for POSIX, Windows,
and MS-DOS). Also the existing VMS build scripts are left unchanged:
I don't have enough experience with VMS to venture into this area.
Perhaps one of the VMS maintainers might like to determine whether
conversion would be appropriate.
Rather than create libraries for w32 and glob (non-POSIX), simply
link the object files directly to remove the complexity.
* NEWS: Update with user-facing notes.
* Makefile.am: Clean up to use the latest automake best practices.
Build Windows code directly from the root makefile to avoid recursion.
* README.Amiga, README.DOS.template, README.W32.template: Updated.
* INSTALL: Point readers at the README.git file.
* maintMakefile: Remove obsolete files. Create Basic.mk file.
* Basic.mk.template, mk/*.mk: Create basic GNU make-based makefiles.
* build_w32.bat: Copy Basic.mk to Makefile
* configure.ac: We no longer need AM_PROG_AR.
* dosbuild.bat: Rename to builddos.bat. Incorporate configure.bat.
* Makefile.DOS.template: Remove.
* NMakefile.template, w32/subproc/NMakefile: Remove.
* SMakefile.template, glob/SMakefile, glob/SCOPTIONS, make.lnk: Remove.
* configure.bat, glob/configure.bat: Remove.
* w32/Makefile.am: Remove.
* make_msvc_net2003.sln, make_msvc_net2003.vcproj: Remove.
2017-11-12 22:44:38 +00:00
|
|
|
if exist %OUTDIR%\%MAKE%.exe copy /Y Basic.mk Makefile
|
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-06 18:29:43 +00:00
|
|
|
goto :EOF
|
|
|
|
|
|
|
|
:Compile
|
|
|
|
set EXTRAS=
|
|
|
|
if "%2" == "GUILE" set "EXTRAS=%GUILECFLAGS%"
|
|
|
|
if "%COMPILER%" == "gcc" goto GccCompile
|
|
|
|
|
|
|
|
:: MSVC Compile
|
|
|
|
echo on
|
2016-06-19 14:52:17 +00:00
|
|
|
%COMPILER% /nologo /MT /W4 /EHsc %OPTS% /I %OUTDIR% /I . /I glob /I w32/include /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR%OUTDIR% /Fp%OUTDIR%\%MAKE%.pch /Fo%OUTDIR%\%1.obj /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-06 18:29:43 +00:00
|
|
|
@echo off
|
|
|
|
echo %OUTDIR%\%1.obj >>%OUTDIR%\link.sc
|
|
|
|
goto :EOF
|
|
|
|
|
|
|
|
:GccCompile
|
|
|
|
:: GCC Compile
|
1996-07-19 21:43:36 +00:00
|
|
|
echo on
|
2016-04-24 06:53:38 +00:00
|
|
|
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
|
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-06 18:29:43 +00:00
|
|
|
@echo off
|
|
|
|
goto :EOF
|
|
|
|
|
|
|
|
:Link
|
|
|
|
echo Linking %OUTDIR%/%MAKE%.exe
|
|
|
|
if "%COMPILER%" == "gcc" goto GccLink
|
|
|
|
|
|
|
|
:: 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
|
1996-07-19 21:43:36 +00:00
|
|
|
echo on
|
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-06 18:29:43 +00:00
|
|
|
link.exe /NOLOGO /SUBSYSTEM:console /PDB:%OUTDIR%\%MAKE%.pdb %LINKOPTS% /OUT:%OUTDIR%\%MAKE%.exe @%OUTDIR%\link.sc
|
|
|
|
@echo off
|
|
|
|
goto :EOF
|
|
|
|
|
|
|
|
:GccLink
|
|
|
|
:: GCC Link
|
2005-08-08 05:08:00 +00:00
|
|
|
echo on
|
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-06 18:29:43 +00:00
|
|
|
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
|
2013-06-22 14:32:46 +00: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-06 18:29:43 +00:00
|
|
|
goto :EOF
|
|
|
|
|
|
|
|
:ConfigSCM
|
|
|
|
echo Generating config from SCM templates
|
|
|
|
sed -n "s/^AC_INIT(\[GNU make\],\[\([^]]\+\)\].*/s,%%VERSION%%,\1,g/p" configure.ac > %OUTDIR%\config.h.W32.sed
|
|
|
|
echo s,%%PACKAGE%%,make,g >> %OUTDIR%\config.h.W32.sed
|
|
|
|
sed -f %OUTDIR%\config.h.W32.sed config.h.W32.template > config.h.W32
|
|
|
|
echo static const char *const GUILE_module_defn = ^" \> gmk-default.h
|
|
|
|
sed -e "s/;.*//" -e "/^[ \t]*$/d" -e "s/\"/\\\\\"/g" -e "s/$/ \\\/" gmk-default.scm >> gmk-default.h
|
|
|
|
echo ^";>> gmk-default.h
|
|
|
|
goto :EOF
|
|
|
|
|
|
|
|
:ChkGuile
|
|
|
|
if not "%OS%" == "Windows_NT" goto NoGuile
|
|
|
|
pkg-config --help > %OUTDIR%\guile.tmp 2> NUL
|
|
|
|
if ERRORLEVEL 1 goto NoPkgCfg
|
|
|
|
|
|
|
|
echo Checking for Guile 2.0
|
|
|
|
if not "%COMPILER%" == "gcc" set PKGMSC=--msvc-syntax
|
|
|
|
pkg-config --cflags --short-errors "guile-2.0" > %OUTDIR%\guile.tmp
|
|
|
|
if not ERRORLEVEL 1 set /P GUILECFLAGS= < %OUTDIR%\guile.tmp
|
|
|
|
|
|
|
|
pkg-config --libs --static --short-errors %PKGMSC% "guile-2.0" > %OUTDIR%\guile.tmp
|
|
|
|
if not ERRORLEVEL 1 set /P GUILELIBS= < %OUTDIR%\guile.tmp
|
|
|
|
|
|
|
|
if not "%GUILECFLAGS%" == "" goto GuileDone
|
|
|
|
|
|
|
|
echo Checking for Guile 1.8
|
|
|
|
pkg-config --cflags --short-errors "guile-1.8" > %OUTDIR%\guile.tmp
|
|
|
|
if not ERRORLEVEL 1 set /P GUILECFLAGS= < %OUTDIR%\guile.tmp
|
|
|
|
|
|
|
|
pkg-config --libs --static --short-errors %PKGMSC% "guile-1.8" > %OUTDIR%\guile.tmp
|
|
|
|
if not ERRORLEVEL 1 set /P GUILELIBS= < %OUTDIR%\guile.tmp
|
|
|
|
|
|
|
|
if not "%GUILECFLAGS%" == "" goto GuileDone
|
|
|
|
|
|
|
|
echo No Guile found, building without Guile
|
|
|
|
goto GuileDone
|
|
|
|
|
|
|
|
:NoPkgCfg
|
|
|
|
echo pkg-config not found, building without Guile
|
|
|
|
|
|
|
|
:GuileDone
|
|
|
|
if "%GUILECFLAGS%" == "" goto :EOF
|
|
|
|
|
|
|
|
echo Guile found, building with Guile
|
|
|
|
set "GUILECFLAGS=%GUILECFLAGS% -DHAVE_GUILE"
|
|
|
|
goto :EOF
|
|
|
|
|
2016-06-19 14:52:17 +00:00
|
|
|
:CheckMSVC
|
|
|
|
if not exist "%VSVARS%" exit /b 1
|
|
|
|
call "%VSVARS%" %ARCH%
|
|
|
|
if ERRORLEVEL 1 exit /b 1
|
|
|
|
%COMPILER% >nul 2>&1
|
|
|
|
if ERRORLEVEL 1 exit /b 1
|
|
|
|
goto :EOF
|
|
|
|
|
2013-04-25 17:41:53 +00:00
|
|
|
:Usage
|
|
|
|
echo Usage: %0 [options] [gcc]
|
|
|
|
echo Options:
|
|
|
|
echo. --without-guile Do not compile Guile support even if found
|
2016-06-19 14:52:17 +00:00
|
|
|
echo. --debug Make a Debug build--default is Release
|
|
|
|
echo. --x86 Make a 32bit binary--default is 64bit
|
2013-04-25 17:41:53 +00:00
|
|
|
echo. --help Display these instructions and exit
|
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-06 18:29:43 +00:00
|
|
|
goto :EOF
|
|
|
|
|
|
|
|
:Reset
|
2016-06-19 14:52:17 +00:00
|
|
|
set ARCH=
|
2013-04-25 17:41:53 +00: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-06 18:29:43 +00:00
|
|
|
set DEBUG=
|
|
|
|
set GUILE=
|
|
|
|
set GUILECFLAGS=
|
|
|
|
set GUILELIBS=
|
|
|
|
set LINKOPTS=
|
|
|
|
set MAKE=
|
2013-04-25 17:41:53 +00:00
|
|
|
set 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-06 18:29:43 +00:00
|
|
|
set OPTS=
|
|
|
|
set OUTDIR=
|
|
|
|
set PKGMSC=
|
2016-06-19 14:52:17 +00: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-06 18:29:43 +00:00
|
|
|
goto :EOF
|