ignore ovmf vars, improve build script
This commit is contained in:
1 parent
9019fe706e
commit
f66b6a86fb
3 files changed
+43
-5
No files matched your search
+3
-2
@@ -1,3 +1,4 @@
|
|||||||
*.obj
|
obj/
|
||||||
fatroot/
|
fatroot/
|
||||||
*.efi
|
BootX64.efi
|
||||||
|
OVMF/OVMF_VARS_4M.fd
|
||||||
Binary file not shown.
@@ -1,5 +1,42 @@
|
|||||||
@echo off
|
@echo off
|
||||||
cl /c /GS- /GR- /Oi /EHs-c- /nologo /Zc:threadSafeInit- /I include /Fo:main.obj main.cpp || pause && exit /b
|
setlocal enabledelayedexpansion
|
||||||
echo linking..
|
|
||||||
link /NODEFAULTLIB /ENTRY:efi_main /NOLOGO /SUBSYSTEM:EFI_APPLICATION /OUT:BootX64.efi main.obj efilib.lib || pause && exit /b
|
rem === Input files ===
|
||||||
|
set cfiles=
|
||||||
|
set afiles=
|
||||||
|
|
||||||
|
rem === Flags ===
|
||||||
|
set cflags=/c /GS- /GR- /Oi /EHs-c- /nologo /Zc:threadSafeInit- /I include /Fo:obj\
|
||||||
|
set lflags=/NODEFAULTLIB /ENTRY:efi_main /NOLOGO /SUBSYSTEM:EFI_APPLICATION /LIBPATH:obj /OUT:BootX64.efi efilib.lib
|
||||||
|
|
||||||
|
rem === Ensure obj\ directory exists ===
|
||||||
|
if not exist "obj\" (
|
||||||
|
mkdir "obj"
|
||||||
|
)
|
||||||
|
|
||||||
|
rem === Dynamically generate object list ===
|
||||||
|
set objects=
|
||||||
|
|
||||||
|
for %%f in (%cfiles%) do (
|
||||||
|
set "base=%%~nf"
|
||||||
|
set "objects=!objects!!base!.obj "
|
||||||
|
)
|
||||||
|
|
||||||
|
for %%f in (%afiles%) do (
|
||||||
|
set "base=%%~nf"
|
||||||
|
set "objects=!objects!!base!.obj "
|
||||||
|
)
|
||||||
|
|
||||||
|
rem === Assemble all .asm files ===
|
||||||
|
for %%f in (%afiles%) do (
|
||||||
|
ml64 /c /nologo /Foobj\%%~nf.obj %%f || pause && exit /b
|
||||||
|
)
|
||||||
|
|
||||||
|
rem === Compile all .cpp files ===
|
||||||
|
cl %cflags% %cfiles% || pause && exit /b
|
||||||
|
|
||||||
|
rem === Link all objects ===
|
||||||
|
link %lflags% !objects! || pause && exit /b
|
||||||
|
|
||||||
|
rem === Copy output to EFI folder ===
|
||||||
copy /B /Y BootX64.efi fatroot\EFI\Boot\
|
copy /B /Y BootX64.efi fatroot\EFI\Boot\
|
||||||
Reference in new issue
Block a user