edk2/BaseTools/Source/C/Makefiles/ms.app
Kun Qin ef23e3c9e7 BaseTools: Enable control flow guard for Windows builds
Certain environments require Control Flow Guard (CFG) to be enabled at
build time as part of their security hardening requirements.

This change adds the necessary compiler and linker flags to enable CFG
support.

Signed-off-by: Kun Qin <kun.qin@microsoft.com>
2026-03-26 02:28:23 +00:00

28 lines
703 B
Erlang

## @file
# Makefile
#
# Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.<BR>
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
APPLICATION = $(BIN_PATH)\$(APPNAME).exe
all: $(APPLICATION)
$(APPLICATION) : $(OBJECTS)
-@if not exist $(BIN_PATH) mkdir $(BIN_PATH)
$(LD) /nologo /debug /DYNAMICBASE /guard:cf /OPT:REF /OPT:ICF=10 /incremental:no /nodefaultlib:libc.lib /out:$@ $(LIBS) $**
$(OBJECTS) : $(SOURCE_PATH)\Include\Common\BuildVersion.h
.PHONY:clean
.PHONY:cleanall
clean:
del /f /q $(OBJECTS) *.pdb > nul
cleanall:
del /f /q $(OBJECTS) $(APPLICATION) *.pdb $(BIN_PATH)\$(APPNAME).pdb > nul
!INCLUDE $(SOURCE_PATH)\Makefiles\ms.rule