Since this took me a lot longer than I expected as I haven't programmed in C++ in so very long, and less so in Visual Studios.
I had version 2010 installed and I was targeting that version in my config.
the dang thing was not finding "nmake" from the command line option in VS2010, which seems to be an issue with what I had installed.
this command opens what I needed:
Code: Select all
"C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\vcvarsall.bat" x86_amd64
or if you are targeting 32 bit:
Code: Select all
"C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\vcvarsall.bat" x86
After opening this, I could run nmake and everything was happy!
I am posting this for anyone else who spent the better part of 5 hours trying to get nmake to work, I am unsure if this is an issue with VS2019 or not...part of it was a dumb mistake on my end.
Either way, your post was so handy!
Edit (adding my build method):
I also improved upon the process listed above, I downloaded win-bash (a portable bash) and put it in the folder where my source is.
my folder structure looks like this:
Code: Select all
extras/
setup/
shell32/
src/
buildTool.bat
COPYING.txt
README.txt
shell32 has the portable bash extracted to it, then I made the batch file to clean up and re-build minivmac with the script:
Code: Select all
@echo off
REM Delete old build script, minivmac, makefile, bld folder and cfg folder
IF EXIST build.sh DEL /F build.sh
IF EXIST tool.exe DEL /F tool.exe
IF EXIST MAKEFILE DEL /F MAKEFILE
IF EXIST minivmac.exe DEL /F minivmac.exe
IF EXIST .\bld rmdir .\bld /q /s
IF EXIST .\cfg rmdir .\cfg /q /s
REM Create tool.exe remove obj after compilation.
cl setup\tool.c
IF EXIST tool.obj DEL /F tool.obj
REM Generate build bash script using the flags you want to build with
set flags=%1
set flags=%flags:"=%
tool.exe %flags% >> build.sh
REM Use win-bash to run the script
shell32\bash.exe -c ./build.sh
REM run makefile
nmake
to kick of the process you simply open the command line of visual studios like above, then navigate to the project folder and run the following:
you can put all of your flags in there and it will pass it to the tool it builds as part of the process.
Thanks!