這裏顯示兩個版本的差異處。
下次修改 | 前次修改 | ||
calculation_bios_build_time [2024/07/09 08:27] don 建立 |
calculation_bios_build_time [2024/09/11 12:36] (目前版本) don |
||
---|---|---|---|
行 1: | 行 1: | ||
====== Calculation BIOS Build Time ====== | ====== Calculation BIOS Build Time ====== | ||
+ | makefile | ||
+ | < | ||
+ | target: target1 target2 | ||
+ | < | ||
+ | </ | ||
+ | |||
+ | |||
+ | Step1 : Add two variables before .XXXXX | ||
+ | < | ||
+ | START_TIME := $(shell echo %time%) | ||
+ | END_TIME := $(shell echo %time%) | ||
+ | </ | ||
+ | |||
+ | Step2 : Add two targets | ||
+ | < | ||
+ | start_time: | ||
+ | @echo Start Time: $(START_TIME) | ||
+ | |||
+ | end_time: | ||
+ | $(eval END_TIME := $(shell echo %time%)) | ||
+ | @echo Start Time: $(START_TIME) | ||
+ | @echo End Time: $(END_TIME) | ||
+ | @echo. | ||
+ | @echo Calculate time... | ||
+ | @powershell -Command " | ||
+ | </ | ||
+ | |||
+ | Step3 : Add " | ||
+ | < | ||
+ | .PHONY : all clean rebuild run RunAmiSdl AptioV sdl Prologue start_time end_time | ||
+ | </ | ||
+ | |||
+ | Step4 : Add the target to start location and end location\\ | ||
+ | |||
+ | all: <color # | ||
+ | |||
+ | |||
+ | Completion makefile | ||
+ | |||
+ | < | ||
+ | export CONFIGURATION_DIR: | ||
+ | export UTILITIES_MAK: | ||
+ | include $(UTILITIES_MAK) | ||
+ | ifeq ($(wildcard $(TOOLS_DIR)/ | ||
+ | include $(TOOLS_DIR)/ | ||
+ | else | ||
+ | export BUILD_TOOLS_VERSION=0 | ||
+ | endif | ||
+ | |||
+ | export MAIN_MAK: | ||
+ | export TOKEN_MAK: | ||
+ | export MODULE_MAK: | ||
+ | export APTIO_MAKE: | ||
+ | |||
+ | # Script that runs AmiSdl and other AMI preprocessing tools can be either part of the build tools (higher priority) | ||
+ | # or part of the project (lower priority). | ||
+ | ifeq ($(wildcard $(TOOLS_DIR)/ | ||
+ | RUN_AMI_TOOLS_MAK: | ||
+ | else | ||
+ | RUN_AMI_TOOLS_MAK: | ||
+ | endif | ||
+ | |||
+ | START_TIME := $(shell echo %time%) | ||
+ | END_TIME := $(shell echo %time%) | ||
+ | |||
+ | .PHONY : all clean rebuild run RunAmiSdl AptioV sdl Prologue start_time end_time | ||
+ | |||
+ | all: start_time Prologue $(BUILD_DIR) RunAmiSdl AptioV end_time | ||
+ | |||
+ | # Print build information | ||
+ | Prologue: | ||
+ | $(ECHO) Build Tools: $(BUILD_TOOLS_VERSION). | ||
+ | |||
+ | # Clean out the old files | ||
+ | clean: | ||
+ | @$(ECHO) Deleting temporary files... | ||
+ | ifeq ($(wildcard $(BUILD_DIR)), | ||
+ | -$(RMDIR) $(BUILD_DIR) | ||
+ | endif | ||
+ | ifeq ($(wildcard Conf), Conf) | ||
+ | -$(RMDIR) Conf | ||
+ | endif | ||
+ | @$(APTIO_MAKE) -s -f $(RUN_AMI_TOOLS_MAK) clean | ||
+ | @$(ECHO) Done. | ||
+ | |||
+ | rebuild: clean all | ||
+ | |||
+ | run: | ||
+ | $(APTIO_MAKE) -f $(MAIN_MAK) run | ||
+ | |||
+ | sdl: $(BUILD_DIR) RunAmiSdl | ||
+ | |||
+ | # Check if Build exists, if not, then make it | ||
+ | $(BUILD_DIR): | ||
+ | mkdir $(BUILD_DIR) | ||
+ | |||
+ | RunAmiSdl: | ||
+ | @$(APTIO_MAKE) -f $(RUN_AMI_TOOLS_MAK) all | ||
+ | |||
+ | # If TODAY/NOW are not defined on the command line, generate them automatically. | ||
+ | # These auto-generated values may be overridden with TODAY/NOW SDL tokens. | ||
+ | # TODAY/NOW defined on the command line have the highest priority (SDL tokens do not override them). | ||
+ | # TODAY format: mm/ | ||
+ | # NOW format: hh:mm:ss | ||
+ | ifeq ($(TODAY), | ||
+ | export TODAY := $(shell $(DATE) +' | ||
+ | endif | ||
+ | ifeq ($(NOW), | ||
+ | export NOW := $(shell $(DATE) +%T) | ||
+ | endif | ||
+ | |||
+ | AptioV: | ||
+ | $(APTIO_MAKE) -f $(MAIN_MAK) $(target) | ||
+ | ifeq ($(call __ge, $(BUILD_TOOLS_VERSION), | ||
+ | @$(APTIO_MAKE) -s -f $(RUN_AMI_TOOLS_MAK) End | ||
+ | endif | ||
+ | $ GBT_ME_Build.bat | ||
+ | |||
+ | start_time: | ||
+ | @echo Start Time: $(START_TIME) | ||
+ | |||
+ | end_time: | ||
+ | $(eval END_TIME := $(shell echo %time%)) | ||
+ | @echo Start Time: $(START_TIME) | ||
+ | @echo End Time: $(END_TIME) | ||
+ | @echo. | ||
+ | @echo Calculate time... | ||
+ | @powershell -Command " | ||
+ | |||
+ | </ |