msxbuild/lib/make/mb_flight.mk

77 lines
3.8 KiB
Makefile
Raw Normal View History

MB_FLIGHT_SCREEN ?= off
2024-07-07 18:53:06 +00:00
$(call mb_make_call,mb_doc_variable,MB_FLIGHT_SCREEN,"Creates screenshots on exit of openMSX.")
MB_FLIGHT_VIDEO ?= off
2024-07-07 18:53:06 +00:00
$(call mb_make_call,mb_doc_variable,MB_FLIGHT_VIDEO,"Create video of every build pipe session.")
MB_FLIGHT_PREFIX ?= msxbuild
2024-07-07 18:53:06 +00:00
$(call mb_make_call,mb_doc_variable,MB_FLIGHT_PREFIX,"Prefix for video and screenshot flight files.")
MB_FLIGHT_SEPERATOR ?= -
2024-07-07 18:53:06 +00:00
$(call mb_make_call,mb_doc_variable,MB_FLIGHT_SEPERATOR,"File and index number seperator for flight files.")
MB_FLIGHT_RECORD_FLAG ?= -doublesize
2024-07-07 18:53:06 +00:00
$(call mb_make_call,mb_doc_variable,MB_FLIGHT_RECORD_FLAG,"Command parameter flag of the video recorder.")
MB_FLIGHT_VIDEO_NAME ?= night-flight
2024-07-07 18:53:06 +00:00
$(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
2024-07-12 15:59:26 +00:00
$(MB_   )$(call mb_make_call,mb_make_check_arg1,mb_flight_video_merge,$(1))
$(MB_   )$(call mb_make_call,mb_os_echo_good,Indexing flight videos)
$(MB_   )ls -1tr $(1)/*-omsx/videos/*.avi | awk -F "$(1)/" -v s="file '" -v e="'" '{print s$$2e}' > $(1)/$(MB_FLIGHT_VIDEO_NAME).lst
$(MB_   )ffmpeg -v quiet -y -f concat -i $(1)/$(MB_FLIGHT_VIDEO_NAME).lst -c copy $(1)/$(MB_FLIGHT_VIDEO_NAME).avi
$(MB_   )$(call mb_make_call,mb_os_echo_good,Flight video completed)
endef
2024-07-07 18:53:06 +00:00
$(call mb_make_call,mb_doc_function,mb_flight_video_merge,"Merged all flight videos to one.","<dir>")
2024-07-07 16:13:48 +00:00
define __mb_flight_proj_flow_video
2024-07-12 15:59:26 +00:00
.RECIPEPREFIX := $(MB_@RECIPE)
2024-07-07 16:13:48 +00:00
@@flight-video-build: @build
2024-07-12 15:59:26 +00:00
$(MB_@RECIPE)$$(if $$(filter on,$$(MB_FLIGHT_VIDEO)),$$(call mb_make_call,mb_flight_video_merge,$(1)))
2024-07-07 16:13:48 +00:00
@flight-video-build: @clean
2024-07-12 15:59:26 +00:00
$(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)
2024-07-07 16:13:48 +00:00
@@flight-video-test: @test
2024-07-12 15:59:26 +00:00
$(MB_@RECIPE)$$(if $$(filter on,$$(MB_FLIGHT_VIDEO)),$$(call mb_make_call,mb_flight_video_merge,$(1)))
2024-07-07 16:13:48 +00:00
@flight-video-test: @clean
2024-07-12 15:59:26 +00:00
$(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-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)
2024-07-07 16:13:48 +00:00
@@flight-video-package-qa: @package-qa
2024-07-12 15:59:26 +00:00
$(MB_@RECIPE)$$(if $$(filter on,$$(MB_FLIGHT_VIDEO)),$$(call mb_make_call,mb_flight_video_merge,$(1)))
2024-07-07 16:13:48 +00:00
@flight-video-package-qa: @clean
2024-07-12 15:59:26 +00:00
$(MB_@RECIPE)$$(call mb_make_call,_mb_proj_flow_step_before)
$(MB_@RECIPE)MB_OPENMSX_HEADLESS$(MB_MAKE_EQUALS)ff MB_FLIGHT_VIDEO$(MB_MAKE_EQUALS)on $$(MAKE) -s @@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)
2024-07-12 15:59:26 +00:00
.RECIPEPREFIX := $(MB_@RECIPEPREFIX)
2024-07-07 16:13:48 +00:00
endef
define mb_flight_proj_flow_video
2024-07-12 15:59:26 +00:00
$(MB_   )$(call mb_make_call,mb_make_check_arg1,$(0),$(1))
$(MB_   )$(eval $(call mb_make_call,__$(0),$(1)))
endef
2024-07-07 18:53:06 +00:00
$(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>")
2024-07-07 16:13:48 +00:00