White space and added doc for autoexec.
All checks were successful
Run test asserts / Test-Asserts (push) Successful in 3s

This commit is contained in:
Willem Cazander 2024-07-02 04:11:13 +02:00
parent 65b40a74cb
commit da35583307
8 changed files with 93 additions and 68 deletions

View file

@ -1,11 +1,36 @@
MB_AUTOEXEC_VERSION ?= on
MB_AUTOEXEC_SHOW_VERSION ?= on
MB_DOC_HELP_VARIABLE += $(call mb_doc_variable,MB_AUTOEXEC_SHOW_VERSION,"Print OS version on boot.",$(MB_AUTOEXEC_SHOW_VERSION))
MB_AUTOEXEC_SHOW_PATH ?= on
MB_DOC_HELP_VARIABLE += $(call mb_doc_variable,MB_AUTOEXEC_SHOW_PATH,"Print search path on boot.",$(MB_AUTOEXEC_SHOW_PATH))
MB_AUTOEXEC_SHOW_CONFIG ?= on
MB_DOC_HELP_VARIABLE += $(call mb_doc_variable,MB_AUTOEXEC_SHOW_CONFIG,"Print host config on boot.",$(MB_AUTOEXEC_SHOW_CONFIG))
MB_AUTOEXEC_SHOW_FOLDER ?= on
MB_DOC_HELP_VARIABLE += $(call mb_doc_variable,MB_AUTOEXEC_SHOW_FOLDER,"Print host folder on boot.",$(MB_AUTOEXEC_SHOW_FOLDER))
MB_AUTOEXEC_SHOW_TARGET ?= on
MB_DOC_HELP_VARIABLE += $(call mb_doc_variable,MB_AUTOEXEC_SHOW_TARGET,"Print host target on boot.",$(MB_AUTOEXEC_SHOW_TARGET))
MB_AUTOEXEC_STARTUP_TIMEOUT ?= 60
MB_DOC_HELP_VARIABLE += $(call mb_doc_variable,MB_AUTOEXEC_STARTUP_TIMEOUT,"Startup failure timeout of autoexec.",$(MB_AUTOEXEC_STARTUP_TIMEOUT))
MB_AUTOEXEC_STARTUP_EXITCODE ?= 124
MB_AUTOEXEC_TEST_TIMEOUT ?= 120
MB_AUTOEXEC_TEST_EXITCODE ?= 1
MB_AUTOEXEC_CMD_TIMEOUT ?= 300
MB_AUTOEXEC_CMD_EXITCODE ?= 1
MB_DOC_HELP_VARIABLE += $(call mb_doc_variable,MB_AUTOEXEC_STARTUP_EXITCODE,"Startup failure exit code of autoexec.",$(MB_AUTOEXEC_STARTUP_EXITCODE))
MB_AUTOEXEC_SAFE_TEST_TIMEOUT ?= 120
MB_DOC_HELP_VARIABLE += $(call mb_doc_variable,MB_AUTOEXEC_SAFE_TEST_TIMEOUT,"Safe test execution failure timeout.",$(MB_AUTOEXEC_SAFE_TEST_TIMEOUT))
MB_AUTOEXEC_SAFE_TEST_EXITCODE ?= 1
MB_DOC_HELP_VARIABLE += $(call mb_doc_variable,MB_AUTOEXEC_SAFE_TEST_EXITCODE,"Safe test execution failure exit code.",$(MB_AUTOEXEC_SAFE_TEST_EXITCODE))
MB_AUTOEXEC_SAFE_CMD_TIMEOUT ?= 300
MB_DOC_HELP_VARIABLE += $(call mb_doc_variable,MB_AUTOEXEC_SAFE_CMD_TIMEOUT,"Safe command execution failure timeout.",$(MB_AUTOEXEC_SAFE_CMD_TIMEOUT))
MB_AUTOEXEC_SAFE_CMD_EXITCODE ?= 1
MB_DOC_HELP_VARIABLE += $(call mb_doc_variable,MB_AUTOEXEC_SAFE_CMD_EXITCODE,"Safe command execution failure exit code.",$(MB_AUTOEXEC_SAFE_CMD_EXITCODE))
define mb_autoexec_append_cmd
echo "$(2)\r" >> $(1)/autoexec.bat
@ -54,14 +79,14 @@ endef
MB_DOC_HELP_FUNCTION += $(call mb_doc_function,mb_autoexec_append_save_video,"Appends save video command.","<dir> [prefix]")
define mb_autoexec_append_safe_test
$(call mb_autoexec_append_cmd,$(1),omsxctl fail_after $(if $(3),$(3),$(MB_AUTOEXEC_TEST_TIMEOUT)) seconds failed_test $(if $(4),$(4),$(MB_AUTOEXEC_TEST_EXITCODE)))
$(call mb_autoexec_append_cmd,$(1),omsxctl fail_after $(if $(3),$(3),$(MB_AUTOEXEC_SAFE_TEST_TIMEOUT)) seconds failed_test $(if $(4),$(4),$(MB_AUTOEXEC_SAFE_TEST_EXITCODE)))
$(call mb_autoexec_append_echo,$(1),Running test: $(2))
$(call mb_autoexec_append_cmd,$(1),$(2))
endef
MB_DOC_HELP_FUNCTION += $(call mb_doc_function,mb_autoexec_append_safe_test,"Appends running a safe test.","<dir> <cmd> [timeout] [exit-code]")
define mb_autoexec_append_safe_cmd
$(call mb_autoexec_append_cmd,$(1),omsxctl fail_after $(if $(3),$(3),$(MB_AUTOEXEC_CMD_TIMEOUT)) seconds failed_cmd $(if $(4),$(4),$(MB_AUTOEXEC_CMD_EXITCODE)))
$(call mb_autoexec_append_cmd,$(1),omsxctl fail_after $(if $(3),$(3),$(MB_AUTOEXEC_SAFE_CMD_TIMEOUT)) seconds failed_cmd $(if $(4),$(4),$(MB_AUTOEXEC_SAFE_CMD_EXITCODE)))
$(call mb_autoexec_append_echo,$(1),Running command: $(2))
$(call mb_autoexec_append_cmd,$(1),$(2))
endef
@ -76,12 +101,12 @@ define mb_autoexec_write_default
$(call mb_autoexec_append_cmd,$(1),omsxctl boot_exec_color_vdp)
$(if $(filter on,$(MB_FLIGHT_VIDEO)),$(call mb_autoexec_append_save_video,$(1)))
$(call mb_autoexec_append_cmd,$(1),omsxctl fail_after $(MB_AUTOEXEC_STARTUP_TIMEOUT) seconds failed_exec $(MB_AUTOEXEC_STARTUP_EXITCODE))
$(if $(filter on,$(MB_AUTOEXEC_VERSION)),$(call mb_autoexec_append_cmd,$(1),ver))
$(if $(filter on,$(MB_AUTOEXEC_SHOW_VERSION)),$(call mb_autoexec_append_cmd,$(1),ver))
$(if $(wildcard $(1)/utils),$(call mb_autoexec_append_cmd,$(1),PATH + A:\; A:\UTILS))
$(if $(wildcard $(1)/utils),$(call mb_autoexec_append_cmd,$(1),PATH))
$(if $(filter on,$(MB_AUTOEXEC_VERSION)),$(call mb_autoexec_append_cmd,$(1),omsxctl boot_exec_config_info))
$(call mb_autoexec_append_echo,$(1),Run folder $(1))
$(call mb_autoexec_append_echo,$(1),Run target $@)
$(if $(filter on,$(MB_AUTOEXEC_SHOW_PATH)),$(call mb_autoexec_append_cmd,$(1),PATH))
$(if $(filter on,$(MB_AUTOEXEC_SHOW_CONFIG)),$(call mb_autoexec_append_cmd,$(1),omsxctl boot_exec_config_info))
$(if $(filter on,$(MB_AUTOEXEC_SHOW_FOLDER)),$(call mb_autoexec_append_echo,$(1),Run folder $(1)))
$(if $(filter on,$(MB_AUTOEXEC_SHOW_TARGET)),$(call mb_autoexec_append_echo,$(1),Run target $@))
endef
MB_DOC_HELP_FUNCTION += $(call mb_doc_function,mb_autoexec_write_default,"Write a default autoexec.bat file.","<dir> [text-mode]")

View file

@ -8,6 +8,7 @@ MB_DOC_TXT_BUILD_PROJECT := "Welcome to the MSXBUILD help system.\\n\\nFor deta
MB_DOC_TXT_BUILD_TARGET := "Build one of the following make targets;\\n"
MB_DOC_TXT_BUILD_VARIABLE := "Documention of the MSXBUILD variables;\\n"
MB_DOC_TXT_BUILD_FUNCTION := "Documention of the MSXBUILD functions;\\n"
MB_DOC_FORMAT ?= txt
MB_DOC_HELP_VARIABLE += $(call mb_doc_variable,MB_DOC_FORMAT,"Output format of documention$(MB_CHAR_COMMA) only 'txt' is supported currently.",$(MB_DOC_FORMAT))

View file

@ -10,7 +10,6 @@ PATH_MSXBUILD_REAL := $(if $(realpath $(PATH_MSXBUILD)),$(realpath $(PATH_MSXBUI
# Include extra features
include $(PATH_MSXBUILD)/lib/make/mb_doc.mk
include $(PATH_MSXBUILD)/lib/make/mb_sdcc.mk
include $(PATH_MSXBUILD)/lib/make/mb_flight.mk
include $(PATH_MSXBUILD)/lib/make/mb_msxrom.mk