From 2273ab7069b83669daeb4b36515631a73b80b5ee Mon Sep 17 00:00:00 2001 From: Paul Smith Date: Sun, 25 Aug 2019 17:11:10 -0400 Subject: Update maintainer mode to support debug wait points. Make a spin() method available when compiled in maintainer mode. If a file exists in the working directory with a specific name, make will sleep until the file is deleted. Ensure that maintainer mode is enabled on Windows, using the same algorithm we use on POSIX / autoconf systems. * build_w32.bat: If maintMakefile exists, enable maintainer mode. * src/main.c (main): Replace Windows-only suspend flag with spin(). * src/makeint.h: A SPIN() macro calls spin() in maintainer mode. * src/misc.c (spin): If a spin file exists sleep until it's deleted. --- build_w32.bat | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'build_w32.bat') diff --git a/build_w32.bat b/build_w32.bat index abe66359..16aa9a44 100755 --- a/build_w32.bat +++ b/build_w32.bat @@ -38,6 +38,12 @@ set O=obj set ARCH=x64 set DEBUG=N +if exist maintMakefile ( + set MAINT=Y +) else ( + set MAINT=N +) + :ParseSW if "%1" == "--debug" goto SetDebug if "%1" == "--without-guile" goto NoGuile @@ -72,6 +78,8 @@ shift goto ParseSW :DoneSW +if "%MAINT%" == "Y" echo - Enabling maintainer mode + if "%COMPILER%" == "gcc" goto FindGcc :: Find a compiler. Visual Studio requires a lot of effort to locate :-/. @@ -151,6 +159,7 @@ set LINKOPTS= if "%DEBUG%" == "Y" set OUTDIR=.\WinDebug if "%DEBUG%" == "Y" set "OPTS=/Zi /Od /D _DEBUG" if "%DEBUG%" == "Y" set LINKOPTS=/DEBUG +if "%MAINT%" == "Y" set "OPTS=%OPTS% /D MAKE_MAINTAINER_MODE" :: Show the compiler version that we found :: Unfortunately this also shows a "usage" note; I can't find anything better. echo. @@ -162,6 +171,7 @@ set OUTDIR=.\GccRel set OPTS=-O2 if "%DEBUG%" == "Y" set OPTS=-O0 if "%DEBUG%" == "Y" set OUTDIR=.\GccDebug +if "%MAINT%" == "Y" set "OPTS=%OPTS% -DMAKE_MAINTAINER_MODE" :: Show the compiler version that we found echo. %COMPILER% --version -- cgit v1.2.1