<commit_before>###############################################################################
#									      #
#   File name	    NMakefile						      #
#									      #
#   Description     An NMake file for making all MsvcLibX library versions    #
#									      #
#   Notes	    make.bat looks for a default nmake file called nmakefile. #
#									      #
#   History								      #
#    2012-10-21 JFL Initial version                                           #
#    2014-03-05 JFL Generate the DOS version only if DOS tools are present.   #
#    2014-04-22 JFL Fixed the clean target to work even without 16-bits tools.#
#    2014-05-30 JFL Moved the OBJECTS macro definition to Files.mak.          #
#    2014-12-03 JFL Fixed the zip target creation.                            #
#    2015-11-06 JFL Added support for a Win95 version.                        #
#    2016-01-11 JFL Added a rule to create the common ..\lib directory.       #
#    2016-07-05 JFL Fixed a typo preventing the build of DOS S Debug version. #
#    2016-09-26 JFL Added macro LIBDIR, depending on OUTDIR.                  #
#		    Copy the include files to $(OUTDIR).		      #
#									      #
#          Copyright 2016 Hewlett Packard Enterprise Development LP          #
# Licensed under the Apache 2.0 license - www.apache.org/licenses/LICENSE-2.0 #
###############################################################################

!IF DEFINED(OUTDIR)
OD=$(OUTDIR)^\
LIBDIR=$(OUTDIR)\lib
!ELSE
OD=
LIBDIR=..\lib
!ENDIF

MSG=>con echo		# Command for writing a progress message on the console
HEADLINE=$(MSG).&$(MSG)	# Output a blank line, then a message

# Default goal: Generate all versions
all: \
!IF DEFINED(DOS_CC)
     $(OD)DOS\MsvcLibX.lib \
!ENDIF
!IF DEFINED(WIN95_CC)
     $(OD)WIN95\MsvcLibX.lib \
!ENDIF
!IF DEFINED(WIN32_CC)
     $(OD)WIN32\MsvcLibX.lib \
!ENDIF
!IF DEFINED(WIN64_CC)
     $(OD)WIN64\MsvcLibX.lib \
!ENDIF
!IF DEFINED(DOS_CC)
     $(OD)DOS\DEBUG\MsvcLibX.lib \
!ENDIF
!IF DEFINED(WIN95_CC)
     $(OD)WIN95\DEBUG\MsvcLibX.lib \
!ENDIF
!IF DEFINED(WIN32_CC)
     $(OD)WIN32\DEBUG\MsvcLibX.lib \
!ENDIF
!IF DEFINED(WIN64_CC)
     $(OD)WIN64\DEBUG\MsvcLibX.lib \
!ENDIF

# Define the OBJECTS macro = the list of object files to include in the library
!INCLUDE "Files.mak"

# Create the common libs directory
$(LIBDIR):
    $(MSG) Creating directory $(LIBDIR)
    md $(LIBDIR)

# Copy the include files to $(OUTDIR)
INCDIR:
!IF DEFINED(OUTDIR)
    :# Update the include files from ..\include to $(OUTDIR)\include
    xcopy /C /D /E /Y ..\include\* $(OUTDIR)\include\ &:# Make sure this line does not end with a backslash
    :# Then remove the files there that have been deleted from ..\include
    for %%i in (include include\sys) do @for %%h in ("$(OUTDIR)\%%i\*") do @if not exist "..\%%i\%%~nxh" echo Deleting "$(OUTDIR)\%%i\%%~nxh" & del "$(OUTDIR)\%%i\%%~nxh"
!else
    rem :# No need to copy anything when using the default output directories
!ENDIF

# Rules for building specific versions of the MsvcLibX library
$(OD)DOS\MsvcLibX.lib: $(OD)DOS\BIN\T\MsvcLibX.lib $(OD)DOS\BIN\S\MsvcLibX.lib $(OD)DOS\BIN\L\MsvcLibX.lib
    @echo Done building all DOS release libraries

$(OD)DOS\DEBUG\MsvcLibX.lib: $(OD)DOS\DEBUG\BIN\T\MsvcLibX.lib $(OD)DOS\DEBUG\BIN\S\MsvcLibX.lib $(OD)DOS\DEBUG\BIN\L\MsvcLibX.lib
    @echo Done building all DOS debug libraries

$(OD)DOS\BIN\T\MsvcLibX.lib: $(LIBDIR) INCDIR NUL
    $(HEADLINE) Building MsvcLibX library DOS tiny release version
    set OBJECTS=$(OBJECTS)
    $(MAKE) /$(MAKEFLAGS) /f DOS.mak "DEBUG=0" "PROGRAM=MsvcLibX" "OBJECTS=%OBJECTS:+=+$(OD)DOS\OBJ\T\%" "MEM=T" dirs $@
    if exist $@ copy $@ $(LIBDIR)\MsvcLibXdt.lib

$(OD)DOS\BIN\S\MsvcLibX.lib: $(LIBDIR) INCDIR NUL
    $(HEADLINE) Building MsvcLibX library DOS small release version
    set OBJECTS=$(OBJECTS)
    $(MAKE) /$(MAKEFLAGS) /f DOS.mak "DEBUG=0" "PROGRAM=MsvcLibX" "OBJECTS=%OBJECTS:+=+$(OD)DOS\OBJ\S\%" "MEM=S" dirs $@
    if exist $@ copy $@ $(LIBDIR)\MsvcLibXds.lib

$(OD)DOS\BIN\L\MsvcLibX.lib: $(LIBDIR) INCDIR NUL
    $(HEADLINE) Building MsvcLibX library DOS large release version
    set OBJECTS=$(OBJECTS)
    $(MAKE) /$(MAKEFLAGS) /f DOS.mak "DEBUG=0" "PROGRAM=MsvcLibX" "OBJECTS=%OBJECTS:+=+$(OD)DOS\OBJ\L\%" "MEM=L" dirs $@
    if exist $@ copy $@ $(LIBDIR)\MsvcLibXdl.lib

$(OD)WIN95\MsvcLibX.lib: $(LIBDIR) INCDIR NUL
    $(HEADLINE) Building MsvcLibX library WIN95 release version
    set OBJECTS=$(OBJECTS) $(WIN32_OBJECTS)
    $(MAKE) /$(MAKEFLAGS) /f WIN95.mak "DEBUG=0" "PROGRAM=MsvcLibX" "OBJECTS=%OBJECTS:+=+$(OD)WIN95\OBJ\%" dirs $@
    if exist $@ copy $@ $(LIBDIR)\MsvcLibXw95.lib

$(OD)WIN32\MsvcLibX.lib: $(LIBDIR) INCDIR NUL
    $(HEADLINE) Building MsvcLibX library WIN32 release version
    set OBJECTS=$(OBJECTS) $(WIN32_OBJECTS)
    set OD=$(OD)
    $(MAKE) /$(MAKEFLAGS) /f WIN32.mak "DEBUG=0" "PROGRAM=MsvcLibX" "OBJECTS=%OBJECTS:+=+$(OD)WIN32\OBJ\%" dirs $@
    if exist $@ copy $@ $(LIBDIR)\MsvcLibXw32.lib

$(OD)WIN64\MsvcLibX.lib: $(LIBDIR) INCDIR NUL
    $(HEADLINE) Building MsvcLibX library WIN64 release version
    set OBJECTS=$(OBJECTS) $(WIN32_OBJECTS)
    $(MAKE) /$(MAKEFLAGS) /f WIN64.mak "DEBUG=0" "PROGRAM=MsvcLibX" "OBJECTS=%OBJECTS:+=+$(OD)WIN64\OBJ\%" dirs $@
    if exist $@ copy $@ $(LIBDIR)\MsvcLibXw64.lib

$(OD)DOS\DEBUG\BIN\T\MsvcLibX.lib: $(LIBDIR) INCDIR NUL
    $(HEADLINE) Building MsvcLibX library DOS tiny debug version
    set OBJECTS=$(OBJECTS)
    $(MAKE) /$(MAKEFLAGS) /f DOS.mak "DEBUG=1" "PROGRAM=MsvcLibX" "OBJECTS=%OBJECTS:+=+$(OD)DOS\DEBUG\OBJ\T\%" "MEM=T" dirs $@
    if exist $@ copy $@ $(LIBDIR)\MsvcLibXdtd.lib

$(OD)DOS\DEBUG\BIN\S\MsvcLibX.lib: $(LIBDIR) INCDIR NUL
    $(HEADLINE) Building MsvcLibX library DOS small debug version
    set OBJECTS=$(OBJECTS)
    $(MAKE) /$(MAKEFLAGS) /f DOS.mak "DEBUG=1" "PROGRAM=MsvcLibX" "OBJECTS=%OBJECTS:+=+$(OD)DOS\DEBUG\OBJ\S\%" "MEM=S" dirs $@
    if exist $@ copy $@ $(LIBDIR)\MsvcLibXdsd.lib

$(OD)DOS\DEBUG\BIN\L\MsvcLibX.lib: $(LIBDIR) INCDIR NUL
    $(HEADLINE) Building MsvcLibX library DOS large debug version
    set OBJECTS=$(OBJECTS)
    $(MAKE) /$(MAKEFLAGS) /f DOS.mak "DEBUG=1" "PROGRAM=MsvcLibX" "OBJECTS=%OBJECTS:+=+$(OD)DOS\DEBUG\OBJ\L\%" "MEM=L" dirs $@
    if exist $@ copy $@ $(LIBDIR)\MsvcLibXdld.lib

$(OD)WIN95\DEBUG\MsvcLibX.lib: $(LIBDIR) INCDIR NUL
    $(HEADLINE) Building MsvcLibX library WIN95 debug version
    set OBJECTS=$(OBJECTS) $(WIN32_OBJECTS)
    $(MAKE) /$(MAKEFLAGS) /f WIN95.mak "DEBUG=1" "PROGRAM=MsvcLibX" "OBJECTS=%OBJECTS:+=+$(OD)WIN95\DEBUG\OBJ\%" dirs $@
    if exist $@ copy $@ $(LIBDIR)\MsvcLibXw95d.lib

$(OD)WIN32\DEBUG\MsvcLibX.lib: $(LIBDIR) INCDIR NUL
    $(HEADLINE) Building MsvcLibX library WIN32 debug version
    set OBJECTS=$(OBJECTS) $(WIN32_OBJECTS)
    $(MAKE) /$(MAKEFLAGS) /f WIN32.mak "DEBUG=1" "PROGRAM=MsvcLibX" "OBJECTS=%OBJECTS:+=+$(OD)WIN32\DEBUG\OBJ\%" dirs $@
    if exist $@ copy $@ $(LIBDIR)\MsvcLibXw32d.lib

$(OD)WIN64\DEBUG\MsvcLibX.lib: $(LIBDIR) INCDIR NUL
    $(HEADLINE) Building MsvcLibX library WIN64 debug version
    set OBJECTS=$(OBJECTS) $(WIN32_OBJECTS)
    $(MAKE) /$(MAKEFLAGS) /f WIN64.mak "DEBUG=1" "PROGRAM=MsvcLibX" "OBJECTS=%OBJECTS:+=+$(OD)WIN64\DEBUG\OBJ\%" dirs $@
    if exist $@ copy $@ $(LIBDIR)\MsvcLibXw64d.lib

# Dummy target, to display a help screen
help:
    @echo Targets:
    @echo.
    @echo "  all       Rebuild all library versions (Default)"
    @echo "  clean     Delete all build files"
    @echo "  zip       Build a source archive in ..\MsvcLibX.zip. Requires 7-zip."

# Dummy target, to delete all files built by these make files
clean:
    rem # Delete temporary files 
    -for /f "delims=" %f in ('dir /b /s ..\*~ ..\*.bak 2^>NUL') do del "%f"
    rem # Delete files built by this nmakefile
    -for /f "delims=" %f in ('dir /b /s ..\*.zip ..\*.log 2^>NUL') do del "%f"
    rem # Delete files built by the DOS.mak, WIN32.mak, WIN64.mak make files
    rem # But make DOS.mak will fail if 16-bit tools are missing. Workaround:
    -$(MAKE) /$(MAKEFLAGS) /f DOS.mak clean
    if exist $(OD)DOS rd /s /q $(OD)DOS
    rem # No such problem with the others, but just in case, do the same.
    -$(MAKE) /$(MAKEFLAGS) /f WIN95.mak clean
    if exist $(OD)WIN95 rd /s /q $(OD)WIN95
    -$(MAKE) /$(MAKEFLAGS) /f WIN32.mak clean
    if exist $(OD)WIN32 rd /s /q $(OD)WIN32
    -$(MAKE) /$(MAKEFLAGS) /f WIN64.mak clean
    if exist $(OD)WIN64 rd /s /q $(OD)WIN64
!IF DEFINED(OUTDIR)
    -rd /S /Q $(OUTDIR)	>NUL 2>&1
!ENDIF

# Dummy target, to build a source archive
zip:
    $(MSG) Building ..\MsvcLibX.zip
    cd ..
    if exist MsvcLibX.zip del MsvcLibX.zip
    set PATH=$(PATH);C:\Program Files\7-zip
    7z.exe a MsvcLibX.zip *.txt src\*.bat src\*.mak src\nmakefile src\exe src\*.c -r include\*.h lib\
    rem # Delete files that got dragged in by wild cards, but that we don't want in the source zip.
    7z.exe d MsvcLibX.zip src\config.bat lib\*.lib
    cd src
<commit_msg>Make sure nothing is displayed when doing a make clean. Display build messages only if variable MESSAGES is defined.<commit_after>###############################################################################
#									      #
#   File name	    NMakefile						      #
#									      #
#   Description     An NMake file for making all MsvcLibX library versions    #
#									      #
#   Notes	    make.bat looks for a default nmake file called nmakefile. #
#									      #
#   History								      #
#    2012-10-21 JFL Initial version                                           #
#    2014-03-05 JFL Generate the DOS version only if DOS tools are present.   #
#    2014-04-22 JFL Fixed the clean target to work even without 16-bits tools.#
#    2014-05-30 JFL Moved the OBJECTS macro definition to Files.mak.          #
#    2014-12-03 JFL Fixed the zip target creation.                            #
#    2015-11-06 JFL Added support for a Win95 version.                        #
#    2016-01-11 JFL Added a rule to create the common ..\lib directory.       #
#    2016-07-05 JFL Fixed a typo preventing the build of DOS S Debug version. #
#    2016-09-26 JFL Added macro LIBDIR, depending on OUTDIR.                  #
#		    Copy the include files to $(OUTDIR).		      #
#    2016-10-04 JFL Make sure nothing is displayed when doing a make clean.   #
#									      #
#          Copyright 2016 <NAME> Development LP          #
# Licensed under the Apache 2.0 license - www.apache.org/licenses/LICENSE-2.0 #
###############################################################################

!IF DEFINED(MESSAGES)
!MESSAGE "Started NMakefile"	# Display this file name, or the caller's name
!ENDIF

!IF DEFINED(OUTDIR)
OD=$(OUTDIR)^\
LIBDIR=$(OUTDIR)\lib
!ELSE
OD=
LIBDIR=..\lib
!ENDIF

MSG=>con echo		# Command for writing a progress message on the console
HEADLINE=$(MSG).&$(MSG)	# Output a blank line, then a message

# Default goal: Generate all versions
all: \
!IF DEFINED(DOS_CC)
     $(OD)DOS\MsvcLibX.lib \
!ENDIF
!IF DEFINED(WIN95_CC)
     $(OD)WIN95\MsvcLibX.lib \
!ENDIF
!IF DEFINED(WIN32_CC)
     $(OD)WIN32\MsvcLibX.lib \
!ENDIF
!IF DEFINED(WIN64_CC)
     $(OD)WIN64\MsvcLibX.lib \
!ENDIF
!IF DEFINED(DOS_CC)
     $(OD)DOS\DEBUG\MsvcLibX.lib \
!ENDIF
!IF DEFINED(WIN95_CC)
     $(OD)WIN95\DEBUG\MsvcLibX.lib \
!ENDIF
!IF DEFINED(WIN32_CC)
     $(OD)WIN32\DEBUG\MsvcLibX.lib \
!ENDIF
!IF DEFINED(WIN64_CC)
     $(OD)WIN64\DEBUG\MsvcLibX.lib \
!ENDIF

# Define the OBJECTS macro = the list of object files to include in the library
!INCLUDE "Files.mak"

# Create the common libs directory
$(LIBDIR):
    $(MSG) Creating directory $(LIBDIR)
    md $(LIBDIR)

# Copy the include files to $(OUTDIR)
INCDIR:
!IF DEFINED(OUTDIR)
    :# Update the include files from ..\include to $(OUTDIR)\include
    xcopy /C /D /E /Y ..\include\* $(OUTDIR)\include\ &:# Make sure this line does not end with a backslash
    :# Then remove the files there that have been deleted from ..\include
    for %%i in (include include\sys) do @for %%h in ("$(OUTDIR)\%%i\*") do @if not exist "..\%%i\%%~nxh" echo Deleting "$(OUTDIR)\%%i\%%~nxh" & del "$(OUTDIR)\%%i\%%~nxh"
!else
    rem :# No need to copy anything when using the default output directories
!ENDIF

# Rules for building specific versions of the MsvcLibX library
$(OD)DOS\MsvcLibX.lib: $(OD)DOS\BIN\T\MsvcLibX.lib $(OD)DOS\BIN\S\MsvcLibX.lib $(OD)DOS\BIN\L\MsvcLibX.lib
    @echo Done building all DOS release libraries

$(OD)DOS\DEBUG\MsvcLibX.lib: $(OD)DOS\DEBUG\BIN\T\MsvcLibX.lib $(OD)DOS\DEBUG\BIN\S\MsvcLibX.lib $(OD)DOS\DEBUG\BIN\L\MsvcLibX.lib
    @echo Done building all DOS debug libraries

$(OD)DOS\BIN\T\MsvcLibX.lib: $(LIBDIR) INCDIR NUL
    $(HEADLINE) Building MsvcLibX library DOS tiny release version
    set OBJECTS=$(OBJECTS)
    $(MAKE) /$(MAKEFLAGS) /f DOS.mak "DEBUG=0" "PROGRAM=MsvcLibX" "OBJECTS=%OBJECTS:+=+$(OD)DOS\OBJ\T\%" "MEM=T" dirs $@
    if exist $@ copy $@ $(LIBDIR)\MsvcLibXdt.lib

$(OD)DOS\BIN\S\MsvcLibX.lib: $(LIBDIR) INCDIR NUL
    $(HEADLINE) Building MsvcLibX library DOS small release version
    set OBJECTS=$(OBJECTS)
    $(MAKE) /$(MAKEFLAGS) /f DOS.mak "DEBUG=0" "PROGRAM=MsvcLibX" "OBJECTS=%OBJECTS:+=+$(OD)DOS\OBJ\S\%" "MEM=S" dirs $@
    if exist $@ copy $@ $(LIBDIR)\MsvcLibXds.lib

$(OD)DOS\BIN\L\MsvcLibX.lib: $(LIBDIR) INCDIR NUL
    $(HEADLINE) Building MsvcLibX library DOS large release version
    set OBJECTS=$(OBJECTS)
    $(MAKE) /$(MAKEFLAGS) /f DOS.mak "DEBUG=0" "PROGRAM=MsvcLibX" "OBJECTS=%OBJECTS:+=+$(OD)DOS\OBJ\L\%" "MEM=L" dirs $@
    if exist $@ copy $@ $(LIBDIR)\MsvcLibXdl.lib

$(OD)WIN95\MsvcLibX.lib: $(LIBDIR) INCDIR NUL
    $(HEADLINE) Building MsvcLibX library WIN95 release version
    set OBJECTS=$(OBJECTS) $(WIN32_OBJECTS)
    $(MAKE) /$(MAKEFLAGS) /f WIN95.mak "DEBUG=0" "PROGRAM=MsvcLibX" "OBJECTS=%OBJECTS:+=+$(OD)WIN95\OBJ\%" dirs $@
    if exist $@ copy $@ $(LIBDIR)\MsvcLibXw95.lib

$(OD)WIN32\MsvcLibX.lib: $(LIBDIR) INCDIR NUL
    $(HEADLINE) Building MsvcLibX library WIN32 release version
    set OBJECTS=$(OBJECTS) $(WIN32_OBJECTS)
    set OD=$(OD)
    $(MAKE) /$(MAKEFLAGS) /f WIN32.mak "DEBUG=0" "PROGRAM=MsvcLibX" "OBJECTS=%OBJECTS:+=+$(OD)WIN32\OBJ\%" dirs $@
    if exist $@ copy $@ $(LIBDIR)\MsvcLibXw32.lib

$(OD)WIN64\MsvcLibX.lib: $(LIBDIR) INCDIR NUL
    $(HEADLINE) Building MsvcLibX library WIN64 release version
    set OBJECTS=$(OBJECTS) $(WIN32_OBJECTS)
    $(MAKE) /$(MAKEFLAGS) /f WIN64.mak "DEBUG=0" "PROGRAM=MsvcLibX" "OBJECTS=%OBJECTS:+=+$(OD)WIN64\OBJ\%" dirs $@
    if exist $@ copy $@ $(LIBDIR)\MsvcLibXw64.lib

$(OD)DOS\DEBUG\BIN\T\MsvcLibX.lib: $(LIBDIR) INCDIR NUL
    $(HEADLINE) Building MsvcLibX library DOS tiny debug version
    set OBJECTS=$(OBJECTS)
    $(MAKE) /$(MAKEFLAGS) /f DOS.mak "DEBUG=1" "PROGRAM=MsvcLibX" "OBJECTS=%OBJECTS:+=+$(OD)DOS\DEBUG\OBJ\T\%" "MEM=T" dirs $@
    if exist $@ copy $@ $(LIBDIR)\MsvcLibXdtd.lib

$(OD)DOS\DEBUG\BIN\S\MsvcLibX.lib: $(LIBDIR) INCDIR NUL
    $(HEADLINE) Building MsvcLibX library DOS small debug version
    set OBJECTS=$(OBJECTS)
    $(MAKE) /$(MAKEFLAGS) /f DOS.mak "DEBUG=1" "PROGRAM=MsvcLibX" "OBJECTS=%OBJECTS:+=+$(OD)DOS\DEBUG\OBJ\S\%" "MEM=S" dirs $@
    if exist $@ copy $@ $(LIBDIR)\MsvcLibXdsd.lib

$(OD)DOS\DEBUG\BIN\L\MsvcLibX.lib: $(LIBDIR) INCDIR NUL
    $(HEADLINE) Building MsvcLibX library DOS large debug version
    set OBJECTS=$(OBJECTS)
    $(MAKE) /$(MAKEFLAGS) /f DOS.mak "DEBUG=1" "PROGRAM=MsvcLibX" "OBJECTS=%OBJECTS:+=+$(OD)DOS\DEBUG\OBJ\L\%" "MEM=L" dirs $@
    if exist $@ copy $@ $(LIBDIR)\MsvcLibXdld.lib

$(OD)WIN95\DEBUG\MsvcLibX.lib: $(LIBDIR) INCDIR NUL
    $(HEADLINE) Building MsvcLibX library WIN95 debug version
    set OBJECTS=$(OBJECTS) $(WIN32_OBJECTS)
    $(MAKE) /$(MAKEFLAGS) /f WIN95.mak "DEBUG=1" "PROGRAM=MsvcLibX" "OBJECTS=%OBJECTS:+=+$(OD)WIN95\DEBUG\OBJ\%" dirs $@
    if exist $@ copy $@ $(LIBDIR)\MsvcLibXw95d.lib

$(OD)WIN32\DEBUG\MsvcLibX.lib: $(LIBDIR) INCDIR NUL
    $(HEADLINE) Building MsvcLibX library WIN32 debug version
    set OBJECTS=$(OBJECTS) $(WIN32_OBJECTS)
    $(MAKE) /$(MAKEFLAGS) /f WIN32.mak "DEBUG=1" "PROGRAM=MsvcLibX" "OBJECTS=%OBJECTS:+=+$(OD)WIN32\DEBUG\OBJ\%" dirs $@
    if exist $@ copy $@ $(LIBDIR)\MsvcLibXw32d.lib

$(OD)WIN64\DEBUG\MsvcLibX.lib: $(LIBDIR) INCDIR NUL
    $(HEADLINE) Building MsvcLibX library WIN64 debug version
    set OBJECTS=$(OBJECTS) $(WIN32_OBJECTS)
    $(MAKE) /$(MAKEFLAGS) /f WIN64.mak "DEBUG=1" "PROGRAM=MsvcLibX" "OBJECTS=%OBJECTS:+=+$(OD)WIN64\DEBUG\OBJ\%" dirs $@
    if exist $@ copy $@ $(LIBDIR)\MsvcLibXw64d.lib

# Dummy target, to display a help screen
help:
    type <<
Targets:
  all       Rebuild all library versions (Default)
  clean     Delete all build files
  zip       Build a source archive in ..\MsvcLibX.zip. Requires 7-zip.
<<NOKEEP

# Dummy target, to delete all files built by these make files
clean:
    rem # Delete temporary files 
    -for /f "delims=" %f in ('dir /b /s ..\*~ ..\*.bak 2^>NUL') do @del "%f"
    rem # Delete files built by this nmakefile
    -for /f "delims=" %f in ('dir /b /s ..\*.zip ..\*.log 2^>NUL') do @del "%f"
    rem # Delete files built by the DOS.mak, WIN32.mak, WIN64.mak make files
    rem # But make DOS.mak will fail if 16-bit tools are missing. Workaround:
    -$(MAKE) /$(MAKEFLAGS) /f DOS.mak clean
    if exist $(OD)DOS rd /s /q $(OD)DOS
    rem # No such problem with the others, but just in case, do the same.
    -$(MAKE) /$(MAKEFLAGS) /f WIN95.mak clean
    if exist $(OD)WIN95 rd /s /q $(OD)WIN95
    -$(MAKE) /$(MAKEFLAGS) /f WIN32.mak clean
    if exist $(OD)WIN32 rd /s /q $(OD)WIN32
    -$(MAKE) /$(MAKEFLAGS) /f WIN64.mak clean
    if exist $(OD)WIN64 rd /s /q $(OD)WIN64
!IF DEFINED(OUTDIR)
    -rd /S /Q $(OUTDIR)	>NUL 2>&1
!ENDIF

# Dummy target, to build a source archive
zip:
    $(MSG) Building ..\MsvcLibX.zip
    cd ..
    if exist MsvcLibX.zip del MsvcLibX.zip
    set PATH=$(PATH);C:\Program Files\7-zip
    7z.exe a MsvcLibX.zip *.txt src\*.bat src\*.mak src\nmakefile src\exe src\*.c -r include\*.h lib\
    rem # Delete files that got dragged in by wild cards, but that we don't want in the source zip.
    7z.exe d MsvcLibX.zip src\config.*.bat lib\*.lib
    cd src

{'fraction_non_alphanumeric': 0.16996745186738016, 'fraction_numerical': 0.025155844872289956, 'mean_word_length': 3.2583979328165373, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 14, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '83596', 'n_tokens_mistral': 7523, 'n_tokens_neox': 6784, 'n_words': 1815}