117 lines
4.8 KiB
Plaintext
117 lines
4.8 KiB
Plaintext
## @file
|
|
# Common Makefile for project build
|
|
#
|
|
#******************************************************************************
|
|
#* Copyright (c) 2015, Insyde Software Corp. All Rights Reserved.
|
|
#*
|
|
#* You may not reproduce, distribute, publish, display, perform, modify, adapt,
|
|
#* transmit, broadcast, present, recite, release, license or otherwise exploit
|
|
#* any part of this publication in any form, by any means, without the prior
|
|
#* written permission of Insyde Software Corporation.
|
|
#*
|
|
#******************************************************************************
|
|
|
|
#
|
|
# Build options for build targets
|
|
#
|
|
DDT_BUILD = "-D INSYDE_DEBUGGER=YES"
|
|
EFI_DEBUG = "-D EFI_DEBUG=YES"
|
|
DDT_DEBUG = "-D INSYDE_DEBUGGER=YES -D EFI_DEBUG=YES"
|
|
EFI_DEBUG_DDT = "-D INSYDE_DEBUGGER=YES -D EFI_DEBUG=YES"
|
|
PERF_BUILD = "-D SYMBOLIC_DEBUG=YES -D INSYDE_DEBUGGER=NO -D EFI_DEBUG=NO -D FIRMWARE_PERFORMANCE=YES"
|
|
EFI_DEBUG_USB = "-D EFI_DEBUG=YES -D USB_DEBUG_SUPPORT=YES"
|
|
CBT_DEBUG = "-D SYMBOLIC_DEBUG=YES -D H2OCBT_SUPPORT=YES"
|
|
|
|
ifndef BUILD_MODE
|
|
#
|
|
# Available build modes
|
|
# -q: Quiet mode - disable all messages except fatal errors, module based messages
|
|
# -s: Silent mode - file based messages
|
|
# -v: Turn on verbose output with informational messages printed
|
|
#
|
|
BUILD_MODE = -q --Dynamic-to-DynamicEx
|
|
endif
|
|
|
|
ifndef BUILD_REPORT
|
|
BUILD_REPORT = -Y PCD -Y DEPEX -Y LIBRARY -y $(WORKSPACE)/Build/$(PROJECT_PKG)/BuildReport.txt
|
|
endif
|
|
|
|
## @BuildTarget "AARCH64", RELEASE, Release build for ARM 64-bit CPU Arch.
|
|
arm:
|
|
$(MAKE) release BUILD_TARGET=$@
|
|
|
|
## @BuildTarget "AARCH64", RELEASE, Release build for ARM 64-bit CPU Arch.
|
|
arm64:
|
|
@$(MAKE) debug BUILD_TARGET=$@ BUILD_TARGET_OPTIONS=$(EFI_DEBUG)
|
|
|
|
## @BuildTarget "AARCH64", RELEASE, Release build for ARM 64-bit CPU Arch.
|
|
aarch64:
|
|
$(MAKE) release BUILD_TARGET=$@
|
|
|
|
## @BuildTarget "AARCH64", RELEASE, Release build for ARM 64-bit CPU Arch.
|
|
aarch64dbg:
|
|
@$(MAKE) debug BUILD_TARGET=$@ BUILD_TARGET_OPTIONS=$(EFI_DEBUG)
|
|
|
|
## @BuildTarget "Common", RELEASE, Release package build for InsydeModulePkg package
|
|
kernel: cleancache
|
|
set PROJECT_PKG=InsydeModulePkg
|
|
nmake genfont
|
|
nmake genlayout
|
|
set PROJECT_PKG=
|
|
@build -p InsydeModulePkg\InsydeModulePkg.dsc -N -s -b RELEASE --Dynamic-to-DynamicEx
|
|
|
|
cleancache:
|
|
@if exist $(WORKSPACE)\Conf\.cache rmdir $(WORKSPACE)\Conf\.cache /s /q
|
|
|
|
clean: cleancache
|
|
@if exist $(WORKSPACE)\Build rmdir $(WORKSPACE)\Build /s /q
|
|
|
|
release: cleancache gen_release_target genfont genlayout
|
|
ifeq ("$(PROJECT_PKG)","")
|
|
@GetProjectEnv PROJECT_PKG > NUL
|
|
@for /f %%i in ('GetProjectEnv PROJECT_PKG') do $(MAKE) $@ %i
|
|
else
|
|
if exist ProjectPreBuild.bat call ProjectPreBuild.bat $(BUILD_TARGET)
|
|
build -N $(BUILD_MODE) $(BUILD_TARGET_OPTIONS) $(BUILD_REPORT) $(PROJECT_BUILD_OPTIONS)
|
|
if exist ProjectPostBuild.bat call ProjectPostBuild.bat $(BUILD_TARGET)
|
|
endif
|
|
|
|
debug: cleancache gen_debug_target genfont genlayout
|
|
ifeq ("$(PROJECT_PKG)","")
|
|
@GetProjectEnv PROJECT_PKG > NUL
|
|
@for /f %%i in ('GetProjectEnv PROJECT_PKG') do $(MAKE) $@ %i
|
|
else
|
|
if exist ProjectPreBuild.bat call ProjectPreBuild.bat $(BUILD_TARGET)
|
|
build -N $(BUILD_MODE) $(BUILD_TARGET_OPTIONS) $(BUILD_REPORT) $(PROJECT_BUILD_OPTIONS)
|
|
if exist ProjectPostBuild.bat call ProjectPostBuild.bat $(BUILD_TARGET)
|
|
endif
|
|
|
|
genfont:
|
|
ifneq ("$(PROJECT_PKG)","")
|
|
@create_temporary_font_hpk.bat
|
|
endif
|
|
|
|
genlayout:
|
|
ifneq ("$(PROJECT_PKG)","")
|
|
@create_temporary_layout_hpk.bat
|
|
endif
|
|
|
|
gen_release_target:
|
|
@echo ACTIVE_PLATFORM = Build\$(PROJECT_PKG)\Project.dsc > $(WORKSPACE)\Conf\target.txt
|
|
@echo TARGET_ARCH = $(ARCH) >> $(WORKSPACE)\Conf\target.txt
|
|
@echo TARGET = RELEASE >> $(WORKSPACE)\Conf\target.txt
|
|
@echo TOOL_CHAIN_CONF = Conf\tools_def.txt >> $(WORKSPACE)\Conf\target.txt
|
|
@echo TOOL_CHAIN_TAG = $(TOOL_CHAIN) >> $(WORKSPACE)\Conf\target.txt
|
|
@echo MAX_CONCURRENT_THREAD_NUMBER = $(NUMBER_OF_PROCESSORS) >> $(WORKSPACE)\Conf\target.txt
|
|
@echo BUILD_RULE_CONF = Conf\build_rule.txt >> $(WORKSPACE)\Conf\target.txt
|
|
|
|
gen_debug_target:
|
|
@echo ACTIVE_PLATFORM = Build\$(PROJECT_PKG)\Project.dsc > $(WORKSPACE)\Conf\target.txt
|
|
@echo TARGET_ARCH = $(ARCH) >> $(WORKSPACE)\Conf\target.txt
|
|
@echo TARGET = DEBUG >> $(WORKSPACE)\Conf\target.txt
|
|
@echo TOOL_CHAIN_CONF = Conf\tools_def.txt >> $(WORKSPACE)\Conf\target.txt
|
|
@echo TOOL_CHAIN_TAG = $(TOOL_CHAIN) >> $(WORKSPACE)\Conf\target.txt
|
|
@echo MAX_CONCURRENT_THREAD_NUMBER = $(NUMBER_OF_PROCESSORS) >> $(WORKSPACE)\Conf\target.txt
|
|
@echo BUILD_RULE_CONF = Conf\build_rule.txt >> $(WORKSPACE)\Conf\target.txt
|
|
|