anchor.diff:      popd
       if /i "!CD0!" equ "src" set "GOAL=!CD1!"
     )
  -  :# If there's still no goal, maybe the makefile itself has a rule to generate the default goal name
  -  if not defined GOAL (
  -    :# Gotcha: nmake always displays on stdout: "Started parsing rules in NMakeFile." So redirect stderr.
  -    :# Gotcha: The exit code does not survive the 'sub-shell' return. So test it inside, and change the sub-shell output.
  -    :# Gotcha: Testing variables in the subshell requires three pairs of ^. So use if errorlevel 1.
  -    for /f "delims=" %%g in (
  -      '%MAKE% /nologo /s /c /f %MAKEFILE% /x - goal_name 2^>NUL ^& if errorlevel 1 echo :'
  -    ) do set "GOAL=%%g"
  -    :# ":" is an impossible goal name, flagging the absence of target "goal_name" in the makefile.
  -    if "!GOAL!"==":" set "GOAL="
  +  %ECHOVARS.D% GOAL
  +  :# If there's still no goal, use the current directory name.
  +  if not defined GOAL set "GOAL=!CD0!"
  +  %ECHOVARS.D% GOAL
  +  :# Rename %LOGFILE% after the %GOAL%, and display the build log.
  +  set LOGFILE2=!GOAL!.log
  +  if defined OUTDIR set "LOGFILE2=%OUTDIR%\!LOGFILE2!"
  +  if not "!LOGFILE2!"=="!LOGFILE!" (
  +    if exist "!LOGFILE2!" del "!LOGFILE2!"
  +    move "!LOGFILE!" "!LOGFILE2!" >nul
  +    call :Debug.SetLog "!LOGFILE2!"
     )
  -  :# If there's still no goal, give it up and keep the default log file name: make.log.
  -  if defined GOAL ( :# Rename %LOGFILE% after the %GOAL%, and display the build log.
  -    set LOGFILE2=!GOAL!.log
  -    if defined OUTDIR set "LOGFILE2=%OUTDIR%\!LOGFILE2!"
  -    if not "!LOGFILE2!"=="!LOGFILE!" (
  -      if exist "!LOGFILE2!" del "!LOGFILE2!"
  -      move "!LOGFILE!" "!LOGFILE2!" >nul
  -      call :Debug.SetLog "!LOGFILE2!"
  -    )
  -  )
  +  %ECHOVARS.D% LOGFILE
   )
   
   if %MAKEDEPTH%==0 ( :# If this is the top-level instance of make.bat, show the final result
  
positive.code: if %MAKEDEPTH%==0 if defined LOGFILE ( :# If this is the top-level instance of make.bat, show the final result
    set GOAL=
    for %%F in ("%LASTGOAL%") do set "GOAL=%%~nF"
    :# If there's no goal, use the make file name. (Provided it's not a generic makefile.)
    if not defined GOAL if /i "%MAKEFILE%" neq "nmakefile" for %%F in ("%MAKEFILE%") do set GOAL=%%~nF
    :# If there's still no goal, and the %CD% is something like ...\PROGRAM\SRC, use the word %PROGRAM%
    if not defined GOAL (
      for %%f in ("!CD!") do set "CD0=%%~nxf"
  
negative.code: :#		    or \ is assumed to be a pseudo-target not to be logged.   *
  :#		    Added options -q and -Q to set the output capture manually.
  :#   2016-12-16 JFL Updated the batch library framework.		      *
  :#   2017-02-22 JFL Look for default make files in the STINCLUDE directory.   *
  :#                  Added option -U to undefine variables.		      *
  :#   2017-02-24 JFL Renamed the special "goal_name" as "module_name".         *
  :#                  Use this module_name earlier when making the log file name.
  :#                  Default to the current directory name as the last resort. *
  :#   2017-03-01 JFL Added variable IGNORE_NMAKEFILE.                          *
  :#                                                                            *
  :#          Copyright 2016 Hewlett Packard Enterprise Development LP         *
  :# Licensed under the Apache 2.0 license  www.apache.org/licenses/LICENSE-2.0 *
  :#*****************************************************************************
  
  setlocal EnableExtensions EnableDelayedExpansion
  set "VERSION=2017-03-01"
  set "SCRIPT=%~nx0"				&:# Script name
  set "SPATH=%~dp0" & set "SPATH=!SPATH:~0,-1!"	&:# Script path, without the trailing \
  set  "ARG0=%~f0"				&:# Script full pathname
  