msxbuild/lib/make/mb_flight.mk
Willem Cazander 05da6ba318
All checks were successful
Run test asserts / Test-Asserts (push) Successful in 7s
Fixed missed renames.
2024-07-17 01:33:54 +02:00

89 lines
4.4 KiB
Makefile
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

MB_FLIGHT_SCREEN ?= off
$(call mb-make-call,mb-doc-variable,MB_FLIGHT_SCREEN,Creates screenshots on exit of openMSX.)
MB_FLIGHT_VIDEO ?= off
$(call mb-make-call,mb-doc-variable,MB_FLIGHT_VIDEO,Create video of every build pipe session.)
MB_FLIGHT_PREFIX ?= msxbuild
$(call mb-make-call,mb-doc-variable,MB_FLIGHT_PREFIX,Prefix for video and screenshot flight files.)
MB_FLIGHT_SEPERATOR ?= -
$(call mb-make-call,mb-doc-variable,MB_FLIGHT_SEPERATOR,File and index number seperator for flight files.)
MB_FLIGHT_RECORD_FLAG ?= -doublesize
$(call mb-make-call,mb-doc-variable,MB_FLIGHT_RECORD_FLAG,Command parameter flag of the video recorder.)
MB_FLIGHT_VIDEO_NAME ?= night-flight
$(call mb-make-call,mb-doc-variable,MB_FLIGHT_VIDEO_NAME,Video file name of the final result merged video.)
define mb-flight-video-merge
$(MB_   )$(call mb-make-call,mb-make-check-arg1,$(0),$(1))
$(MB_   )$(call mb-make-call,mb-os-echo-command,Indexing flight videos)
$(MB_   )find $(1) -type f -name '*.avi' -printf '%T@ %Tc %p\n' | sort -n | awk -F "$(1)/" -v s="file '" -v e="'" '{print s$$2e}' > $(1)/$(MB_FLIGHT_VIDEO_NAME).lst
$(MB_   )ffmpeg -v quiet -y -f concat -safe 0 -i $(1)/$(MB_FLIGHT_VIDEO_NAME).lst -c copy $(1)/$(MB_FLIGHT_VIDEO_NAME).avi
$(MB_   )$(call mb-make-call,mb-os-echo-remark,Flight video completed)
endef
$(call mb-make-call,mb-doc-function-deep,mb-flight-video-merge,Merged all flight videos to one.,<dir>)
define __mb-flight-proj-flow-video
.RECIPEPREFIX := $(MB_@RECIPE)
@@flight-video-build: @build
$(MB_@RECIPE)$$(if $$(filter on,$$(MB_FLIGHT_VIDEO)),$$(call mb-make-call,mb-flight-video-merge,$(1)))
@flight-video-build: @clean
$(MB_@RECIPE)$$(call mb-make-call,_mb-proj-flow-step-before)
$(MB_@RECIPE)MB_OPENMSX_HEADLESS$(MB_MAKE_EQUALS)off MB_FLIGHT_VIDEO$(MB_MAKE_EQUALS)on $$(MAKE) -s @@flight-video-build
$(MB_@RECIPE)$$(call mb-make-call,_mb-proj-flow-step-done)
$(MB_   )$$(call mb-make-call,mb-doc-target-help,@flight-video-build,Runs @clean and @build with recorder and merges flight videos to one.)
$(MB_   )$$(call mb-make-call,mb-make-target-phony,@flight-video-build)
@@flight-video-test: @test
$(MB_@RECIPE)$$(if $$(filter on,$$(MB_FLIGHT_VIDEO)),$$(call mb-make-call,mb-flight-video-merge,$(1)))
@flight-video-test: @clean
$(MB_@RECIPE)$$(call mb-make-call,_mb-proj-flow-step-before)
$(MB_@RECIPE)MB_OPENMSX_HEADLESS$(MB_MAKE_EQUALS)off MB_FLIGHT_VIDEO$(MB_MAKE_EQUALS)on $$(MAKE) @@flight-video-test
$(MB_@RECIPE)$$(call mb-make-call,_mb-proj-flow-step-done)
$(MB_   )$$(call mb-make-call,mb-doc-target-help,@flight-video-test,Runs @clean and @test with recorder and merges flight videos to one.)
$(MB_   )$$(call mb-make-call,mb-make-target-phony,@flight-video-test)
@@flight-video-package-qa: @package-qa
$(MB_@RECIPE)$$(if $$(filter on,$$(MB_FLIGHT_VIDEO)),$$(call mb-make-call,mb-flight-video-merge,$(1)))
@flight-video-package-qa: @clean
$(MB_@RECIPE)$$(call mb-make-call,_mb-proj-flow-step-before)
$(MB_@RECIPE)MB_OPENMSX_HEADLESS$(MB_MAKE_EQUALS)off MB_FLIGHT_VIDEO$(MB_MAKE_EQUALS)on $$(MAKE) @@flight-video-package-qa
$(MB_@RECIPE)$$(call mb-make-call,_mb-proj-flow-step-done)
$(MB_   )$$(call mb-make-call,mb-doc-target-help,@flight-video-package-qa,Runs @clean and @package-qa with recorder and merges flight videos to one.)
$(MB_   )$$(call mb-make-call,mb-make-target-phony,@flight-video-package-qa)
@@flight-video-all: @all
$(MB_@RECIPE)$$(if $$(filter on,$$(MB_FLIGHT_VIDEO)),$$(call mb-make-call,mb-flight-video-merge,$(1)))
@flight-video-all: @clean
$(MB_@RECIPE)$$(call mb-make-call,_mb-proj-flow-step-before)
$(MB_@RECIPE)MB_OPENMSX_HEADLESS$(MB_MAKE_EQUALS)off MB_FLIGHT_VIDEO$(MB_MAKE_EQUALS)on $$(MAKE) @@flight-video-all
$(MB_@RECIPE)$$(call mb-make-call,_mb-proj-flow-step-done)
$(MB_   )$$(call mb-make-call,mb-doc-target-help,@flight-video-all,Runs @clean and @all with recorder and merges flight videos to one.)
$(MB_   )$$(call mb-make-call,mb-make-target-phony,@flight-video-all)
.RECIPEPREFIX := $(MB_@RECIPEPREFIX)
endef
define mb-flight-proj-flow-video
$(MB_   )$(call mb-make-call,mb-make-check-arg1,$(0),$(1))
$(MB_   )$(eval $(call mb-make-call,__$(0),$(1)))
endef
$(call mb-make-call,mb-doc-function-flow,mb-flight-proj-flow-video,Prints flow for adding flight video targets in project build cycle.,<path-bin>)