Last active
February 28, 2021 05:17
-
-
Save DeviousMalcontent/8b957b948a309c4064f8ec0fdef7f038 to your computer and use it in GitHub Desktop.
The build script that I use to build my MASM32 based projects that does not require me to build the application on the same hard drive that the SDK is installed to. – I also do not need to specify the include, macros, and lib file paths.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
Rem Marks trademark super awesome MASM32 build script. | |
Rem Find MASM32 install path | |
IF EXIST "A:\masm32\bin\ml.exe" (set masmpath=A:\masm32) | |
IF EXIST "B:\masm32\bin\ml.exe" (set masmpath=B:\masm32) | |
IF EXIST "C:\masm32\bin\ml.exe" (set masmpath=C:\masm32) | |
IF EXIST "D:\masm32\bin\ml.exe" (set masmpath=D:\masm32) | |
IF EXIST "E:\masm32\bin\ml.exe" (set masmpath=E:\masm32) | |
IF EXIST "F:\masm32\bin\ml.exe" (set masmpath=F:\masm32) | |
IF EXIST "G:\masm32\bin\ml.exe" (set masmpath=G:\masm32) | |
IF EXIST "H:\masm32\bin\ml.exe" (set masmpath=H:\masm32) | |
IF EXIST "I:\masm32\bin\ml.exe" (set masmpath=I:\masm32) | |
IF EXIST "J:\masm32\bin\ml.exe" (set masmpath=J:\masm32) | |
IF EXIST "K:\masm32\bin\ml.exe" (set masmpath=K:\masm32) | |
IF EXIST "L:\masm32\bin\ml.exe" (set masmpath=L:\masm32) | |
IF EXIST "M:\masm32\bin\ml.exe" (set masmpath=M:\masm32) | |
IF EXIST "N:\masm32\bin\ml.exe" (set masmpath=N:\masm32) | |
IF EXIST "O:\masm32\bin\ml.exe" (set masmpath=O:\masm32) | |
IF EXIST "P:\masm32\bin\ml.exe" (set masmpath=P:\masm32) | |
IF EXIST "Q:\masm32\bin\ml.exe" (set masmpath=Q:\masm32) | |
IF EXIST "R:\masm32\bin\ml.exe" (set masmpath=R:\masm32) | |
IF EXIST "S:\masm32\bin\ml.exe" (set masmpath=S:\masm32) | |
IF EXIST "T:\masm32\bin\ml.exe" (set masmpath=T:\masm32) | |
IF EXIST "U:\masm32\bin\ml.exe" (set masmpath=U:\masm32) | |
IF EXIST "V:\masm32\bin\ml.exe" (set masmpath=V:\masm32) | |
IF EXIST "W:\masm32\bin\ml.exe" (set masmpath=W:\masm32) | |
IF EXIST "X:\masm32\bin\ml.exe" (set masmpath=X:\masm32) | |
IF EXIST "Y:\masm32\bin\ml.exe" (set masmpath=Y:\masm32) | |
IF EXIST "Z:\masm32\bin\ml.exe" (set masmpath=Z:\masm32) | |
IF "%masmpath%"=="" ( | |
ECHO Masm32 install path was not found. | |
ECHO Looking in each drive letter under :\masm32\bin\ml.exe | |
ECHO. | |
ECHO You might have to edit this script or download and install masm32 SDK from https://www.masm32.com/ | |
ECHO. | |
PAUSE | |
EXIT | |
) ELSE ( | |
ECHO Masm32 install path was found. | |
) | |
Rem Build the MyProject Executable | |
if not exist MyProject.rc goto over1 | |
%masmpath%\bin\rc /v MyProject.rc | |
%masmpath%\bin\cvtres /machine:ix86 "MyProject.res" | |
:over1 | |
if exist "MyProject.obj" del "MyProject.obj" | |
if exist "MyProject.exe" del "MyProject.exe" | |
%masmpath%\bin\ml /c /coff /I "%masmpath%\include" /I "%masmpath%\macros" "MyProject.asm" | |
if errorlevel 1 goto errasm | |
if not exist MyProject.obj goto nores | |
%masmpath%\bin\Link /SUBSYSTEM:WINDOWS /LIBPATH:%masmpath%\lib "MyProject.obj" "MyProject.res" | |
if errorlevel 1 goto errlink | |
dir "MyProject.*" | |
goto TheEnd | |
:nores | |
%masmpath%\bin\Link /SUBSYSTEM:WINDOWS /LIBPATH:%masmpath%\lib "MyProject.obj" | |
if errorlevel 1 goto errlink | |
dir "MyProject.*" | |
goto TheEnd | |
:errlink | |
echo _ | |
echo Link error | |
pause | |
goto TheEnd | |
:errasm | |
echo _ | |
echo Assembly Error | |
pause | |
goto TheEnd | |
:TheEnd | |
pause |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment