Added project phases and flow generators.
All checks were successful
Run test asserts / Test-Asserts (push) Successful in -1s

This commit is contained in:
Willem Cazander 2024-07-07 04:33:03 +02:00
parent 51a3276e39
commit f7324721c2
29 changed files with 606 additions and 287 deletions

View file

@ -16,4 +16,4 @@ jobs:
- name: Check out
uses: actions/checkout@v3
- name: Run asserts
run: make -j1 bin/@assert-all
run: make -j1 @package-qa

1
.gitignore vendored
View file

@ -1,6 +1,7 @@
syntax: glob
# Project ignores
Makelocal.mk
bin
bin/**

View file

@ -1,6 +1,9 @@
#
# Module based project makefile for msxbuild.
#
# Configure make
.SUFFIXES:
.PHONY: Makefile
ifndef VERBOSE
@ -10,10 +13,31 @@ ifeq ($(.DEFAULT_GOAL),)
.DEFAULT_GOAL := @help
endif
# Configure project
-include Makelocal.mk
PATH_BIN := bin
PATH_SRC := src
PATH_MSXBUILD ?= .
# Generate project flow
include $(PATH_MSXBUILD)/lib/make/msxbuild.mk
$(call mb_make_call_eval,mb_doc_flow_help,MSXBUILD-Example)
$(call mb_make_call_eval,mb_make_flow_0module,$(PATH_SRC))
$(call mb_make_call_eval,mb_proj_flow_setup,$(PATH_BIN))
$(call mb_make_call_eval,mb_proj_flow_flight_video,$(PATH_BIN))
# Add japanese support
ifdef LANG_JP
MB_MAKE_ECHO_CRAYON = "©Δ∞ 仙上主天"
MB_PROJ_META_NAME = "メッカシステム拡大建てる"
MB_PROJ_STEP_BEFORE_PREFIX = "フェーズ前 "
MB_PROJ_STEP_AFTER_PREFIX = "フェーズ後 "
MB_PROJ_STEP_DONE_PREFIX = "プライムパイターゲットの実行を終了しました "
MB_OPENMSX_LOG_PREFIX = "オープンメッカシステム拡張を開始しましょう!のために"
MB_AUTOEXEC_LOG_PREFIX = "自動実行の書き込み"
$(call mb_make_call_eval,mb_proj_flow_setup_jp)
endif

View file

@ -84,27 +84,27 @@ Running: `make`
When you want to see whats happening do a debug run;
normal run;
time make bin/@assert-all
time make @package-qa
real 0m3.223s
debug run at 11 Mhz;
time VERBOSE=on MB_OPENMSX_HEADLESS=off MB_OPENMSX_THROTTLE=on make bin/@assert-all
time VERBOSE=on MB_OPENMSX_HEADLESS=off MB_OPENMSX_THROTTLE=on make @package-qa
real 1m4.856s
debug run real msx speed;
time VERBOSE=on MB_OPENMSX_HEADLESS=off MB_OPENMSX_THROTTLE=on MB_OPENMSX_SPEED=100 make bin/@assert-all
time VERBOSE=on MB_OPENMSX_HEADLESS=off MB_OPENMSX_THROTTLE=on MB_OPENMSX_SPEED=100 make @package-qa
real 2m37.379s
record run with screenshot on exit; (black screens without throttle)
time MB_OPENMSX_HEADLESS=off MB_OPENMSX_THROTTLE=on MB_FLIGHT_SCREEN=on make bin/@assert-all
time MB_OPENMSX_HEADLESS=off MB_OPENMSX_THROTTLE=on MB_FLIGHT_SCREEN=on make @package-qa
real 1m14.043s
record run with video per session and merge to one video file;
time MB_OPENMSX_HEADLESS=off MB_FLIGHT_VIDEO=on make bin/@assert-all
time make @package-qa-video
real 0m7.136s
build parallel;
time make -j4 bin/@assert-all
time make -j4 @package-qa
real 0m1.817s
manual test msxhub on machine;

26
lib/make/mb_assert.mk Normal file
View file

@ -0,0 +1,26 @@
define mb_assert_flow_grep_binary
$(1)/@assert-$(2): $(1)/@build
grep -q -U $(4) $(1)/$(3)
$$(call mb_make_call,mb_make_echo_assert,Assert succes @assert-$(2))
MB_DOC_FIRE_TARGET += $$(call mb_doc_target,$(1)/@assert-$(2),"Asserts that $(3) output matches.")
MB_PROJ_PHASE_TEST_DEPS += $(1)/@assert-$(2)
.PHONY: $(1)/@assert-$(2)
endef
MB_DOC_FIRE_FUNCTION_FLOW += $(call mb_make_call,mb_doc_function_flow,mb_assert_flow_grep_binary,"Prints flow of single binary grep assert.","<build-dir> <test-id> <file> <grep-match>")
#$$(call mb_delete,$(1)/$(3).out)
define mb_assert_flow_bdos_grep
$(1)-test-$(2)/@assert: $(1)/@build
$$(call mb_mkdir,$(1)-test-$(2))
$$(call mb_copy,$(1)/$(3).com,$(1)-test-$(2))
$$(call mb_msxpipe_safe_test,$(1)-test-$(2),$(3) > $(3).out)
grep -q $(4) $(1)-test-$(2)/$(3).out
$$(call mb_make_call,mb_make_echo_assert,Assert succes $(1)-test-$(2)/@assert)
MB_DOC_FIRE_TARGET += $$(call mb_doc_target,$(1)-test-$(2)/@assert,"Asserts that $(3) output matches.")
MB_PROJ_PHASE_TEST_DEPS += $(1)-test-$(2)/@assert
.PHONY: $(1)-test-$(2)/@assert
endef
MB_DOC_FIRE_FUNCTION_FLOW += $(call mb_make_call,mb_doc_function_flow,mb_assert_flow_bdos_grep,"Prints flow of single grep assert.","<build-dir> <test-id> <cmd-name> <grep-match>")

View file

@ -1,4 +1,5 @@
MB_AUTOEXEC_SHOW_VERSION ?= off
MB_DOC_FIRE_VARIABLE += $(call mb_make_call,mb_doc_variable,MB_AUTOEXEC_SHOW_VERSION,"Print OS version on boot.")
@ -65,6 +66,9 @@ MB_DOC_FIRE_VARIABLE += $(call mb_make_call,mb_doc_variable,MB_AUTOEXEC_PROMPT_F
MB_AUTOEXEC_PROMPT_SPACE ?= on
MB_DOC_FIRE_VARIABLE += $(call mb_make_call,mb_doc_variable,MB_AUTOEXEC_PROMPT_SPACE,"When on adds an white space after the prompt format.")
MB_AUTOEXEC_LOG_PREFIX ?= "Write autoexec for "
MB_DOC_FIRE_VARIABLE_DEEP += $(call mb_make_call,mb_doc_variable_deep,MB_AUTOEXEC_LOG_PREFIX,"Prefix of message to log when writing a default autoexec.")
define mb_autoexec_append_cmd
echo "$(2)\r" >> $(1)/autoexec.bat
@ -155,7 +159,7 @@ endef
define mb_autoexec_write_default
$(call mb_make_call,mb_make_echo_good,Write autoexec for $@)
$(call mb_make_call,mb_make_echo_command,$(MB_AUTOEXEC_LOG_PREFIX)$@)
@echo -n "" > $(1)/autoexec.bat
$(if $(wildcard $(1)/utils),$(call _mb_autoexec_write_preboot,$(1),utils\,$(2),$(3)),$(call _mb_autoexec_write_preboot,$(1),,$(2),$(3)))
$(if $(MB_AUTOEXEC_STARTUP_NOTE),$(call mb_autoexec_append_echo,$(1),mb::note $(MB_AUTOEXEC_STARTUP_NOTE)))

View file

@ -1,12 +1,14 @@
define mb_conv_unix2dos
$(call mb_make_call,mb_make_echo_command,Convert to dos-EOL $(2))
unix2dos -q -n $(1) $(2)
endef
MB_DOC_FIRE_FUNCTION += $(call mb_make_call,mb_doc_function,mb_conv_unix2dos,"Converts an unix file to dos.","<in> <out>")
define mb_conv_dos2unix
$(call mb_make_call,mb_make_echo_command,Convert to nix-EOL $(2))
dos2unix -q -n $(1) $(2)
endef
MB_DOC_FIRE_FUNCTION += $(call mb_make_call,mb_doc_function,mb_conv_dos2unix,"Converts an dos file to unix.","<in> <out>")

View file

@ -1,4 +1,5 @@
MB_MAKE_COMMA := ,
MB_DOC_FIRE_VARIABLE_ROCK += $(call mb_make_call,mb_doc_variable_rock,MB_MAKE_COMMA,"Expanded special char; comma.")
@ -66,6 +67,12 @@ endef
MB_DOC_FIRE_FUNCTION_DEEP += $(call mb_make_call,mb_doc_function_deep,mb_make_lowercase,"Converts ascii string to lowercase.","<string>")
define mb_make_uppercase
$(subst a,A,$(subst b,B,$(subst c,C,$(subst d,D,$(subst e,E,$(subst f,F,$(subst g,G,$(subst h,H,$(subst i,I,$(subst j,J,$(subst k,K,$(subst l,L,$(subst m,M,$(subst n,N,$(subst o,O,$(subst p,P,$(subst q,Q,$(subst r,R,$(subst s,S,$(subst t,T,$(subst u,U,$(subst v,V,$(subst w,W,$(subst x,X,$(subst y,Y,$(subst z,Z,$(1)))))))))))))))))))))))))))
endef
MB_DOC_FIRE_FUNCTION_DEEP += $(call mb_make_call,mb_doc_function_deep,mb_make_uppercase,"Converts ascii string to uppercase.","<string>")
define mb_make_xml_open
$(MB_MAKE_LT)$(1)$(if $(2), $(2)=\"$(3)\")$(if $(4), $(4)=\"$(5)\")$(MB_MAKE_GT)
endef
@ -90,6 +97,12 @@ endef
MB_DOC_FIRE_FUNCTION_DEEP += $(call mb_make_call,mb_doc_function_deep,mb_make_xml_tag_value,"Print xml tag with value inside.","<tag> [value]")
define mb_make_flow_0module
include $$(call mb_make_call,mb_make_rwildcard,$(1),*/0module.mk)
endef
MB_DOC_FIRE_FUNCTION_FLOW += $(call mb_make_call,mb_doc_function_flow,mb_make_flow_0module,"Prints flow of recursive 0module.mk include.","<dir>")
define mb_make_echo_good
$(if $(filter -1,$(MB_OS_COLORS)),@echo $(MB_MAKE_ECHO_CRAYON) $(1),$(MB_OS_ECHO) -e "\x1B[32m$(MB_MAKE_ECHO_CRAYON)$$1\x1B[39m $(1)")
endef
@ -102,10 +115,20 @@ endef
MB_DOC_FIRE_FUNCTION_DEEP += $(call mb_make_call,mb_doc_function_deep,mb_make_echo_fail,"Echo's an message to stdout with 'red' crayon.","<message>")
define mb_make_flow_0module
include $$(call mb_make_call,mb_make_rwildcard,$(1),*/0module.mk)
define mb_make_echo_command
$(if $(filter -1,$(MB_OS_COLORS)),@echo $(MB_MAKE_ECHO_CRAYON) $(1),$(MB_OS_ECHO) -e "\x1B[34m$(MB_MAKE_ECHO_CRAYON)$$1\x1B[39m $(1)")
endef
MB_DOC_FIRE_FUNCTION_FLOW += $(call mb_make_call,mb_doc_function_flow,mb_make_flow_0module,"Prints flow of recursive 0module.mk include.","<dir>")
MB_DOC_FIRE_FUNCTION_DEEP += $(call mb_make_call,mb_doc_function_deep,mb_make_echo_command,"Echo's an message to stdout with 'blue' crayon.","<message>")
define mb_make_echo_phase
$(if $(filter -1,$(MB_OS_COLORS)),@echo $(MB_MAKE_ECHO_CRAYON) $(1),$(MB_OS_ECHO) -e "\x1B[35m$(MB_MAKE_ECHO_CRAYON)$$1\x1B[39m $(1)")
endef
MB_DOC_FIRE_FUNCTION_DEEP += $(call mb_make_call,mb_doc_function_deep,mb_make_echo_phase,"Echo's an message to stdout with 'magenta' crayon.","<message>")
define mb_make_echo_assert
$(if $(filter -1,$(MB_OS_COLORS)),@echo $(MB_MAKE_ECHO_CRAYON) $(1),$(MB_OS_ECHO) -e "\x1B[33m$(MB_MAKE_ECHO_CRAYON)$$1\x1B[39m $(1)")
endef
MB_DOC_FIRE_FUNCTION_DEEP += $(call mb_make_call,mb_doc_function_deep,mb_make_echo_phase,"Echo's an message to stdout with 'yellow' crayon.","<message>")

View file

@ -1,4 +1,5 @@
MB_OPENMSX_BOOT_TIMEOUT ?= 25
MB_DOC_FIRE_VARIABLE += $(call mb_make_call,mb_doc_variable,MB_OPENMSX_BOOT_TIMEOUT,"Timeout in seconds to guard for boot failures.")
@ -32,6 +33,13 @@ MB_DOC_FIRE_VARIABLE += $(call mb_make_call,mb_doc_variable,MB_OPENMSX_HEADLESS,
MB_OPENMSX_RENDERER ?= SDLGL-PP
MB_DOC_FIRE_VARIABLE += $(call mb_make_call,mb_doc_variable,MB_OPENMSX_RENDERER,"The gui renderer used to display the window head with.")
MB_OPENMSX_LOG_PREFIX ?= "Start openMSX! for "
MB_DOC_FIRE_VARIABLE_DEEP += $(call mb_make_call,mb_doc_variable_deep,MB_OPENMSX_LOG_PREFIX,"Prefix of startup message of openMSX.")
# Kills valuable info on build server, thus keep off until issues openMSX are solved, rm this variale ASP;
MB_OPENMSX_STDOUT_NULL ?= off
#MB_DOC_FIRE_VARIABLE_DEEP += $(call mb_make_call,mb_doc_variable_deep,MB_OPENMSX_STDOUT_NULL,"Pipes openMSX stdout to null for silence messages.")
define mb_openmsx_setup
$(if $(wildcard $(1)-omsx),,$(call mb_mkdir,$(1)-omsx))
@ -55,7 +63,7 @@ MB_DOC_FIRE_FUNCTION_DEEP += $(call mb_make_call,mb_doc_function_deep,mb_openmsx
define _mb_openmsx_run
$(call mb_make_call,mb_make_echo_good,Start openMSX! for $@ on $(2))
$(call mb_make_call,mb_make_echo_command,$(MB_OPENMSX_LOG_PREFIX)$@ on $(2))
$(if $(wildcard $(1)-omsx/persistent/fire-hdd/untitled1/sync),,$(call mb_make_call,mb_mkdir,$(1)-omsx/persistent/fire-hdd/untitled1/sync))
BOOT_WATCHDOG=$(MB_OPENMSX_BOOT_TIMEOUT) \
FIRE_HDD_PATH="$(1)" \
@ -82,7 +90,7 @@ define _mb_openmsx_run
$(if $(filter ram4mb,$(3)),-ext ram2mb) \
$(if $(filter ram4mb,$(3)),-ext ram4mb) \
$(MB_OPENMSX_ARGS) \
-control stdio < $(1)-omsx/stdio.xml
-control stdio < $(1)-omsx/stdio.xml $(if $(filter on,$(MB_OPENMSX_STDOUT_NULL)),> /dev/null)
rsync --checksum --recursive "$(1)-omsx/persistent/fire-hdd/untitled1/sync/" "$(1)/"
endef
@ -103,3 +111,4 @@ define mb_openmsx_dosctl
$(call mb_make_call,_mb_openmsx_run,$(1),$(if $(2),$(2),$(MB_OPENMSX_MACHINE)),$(if $(3),$(3),$(MB_OPENMSX_MACHINE_RAM)))
endef
MB_DOC_FIRE_FUNCTION += $(call mb_make_call,mb_doc_function,mb_openmsx_dosctl,"Starts openMSX with dos controller.","<dir> [machine] [mem-ext]")

301
lib/make/mb_proj.mk Normal file
View file

@ -0,0 +1,301 @@
MB_PROJ_META_NAME ?= MSXBUILD
MB_DOC_FIRE_VARIABLE += $(call mb_make_call,mb_doc_variable,MB_PROJ_META_NAME,"The project name.")
MB_PROJ_META_DESCRIPTION ?=
MB_DOC_FIRE_VARIABLE += $(call mb_make_call,mb_doc_variable,MB_PROJ_META_DESCRIPTION,"The project description.")
MB_PROJ_META_WEBSITE ?=
MB_DOC_FIRE_VARIABLE += $(call mb_make_call,mb_doc_variable,MB_PROJ_META_WEBSITE,"The project website location.")
MB_PROJ_STEP_BEFORE_PREFIX ?= "Before -- "
MB_DOC_FIRE_VARIABLE_DEEP += $(call mb_make_call,mb_doc_variable_deep,MB_PROJ_STEP_BEFORE_PREFIX,"Prefix for begin phase message.")
MB_PROJ_STEP_AFTER_PREFIX ?= "After ---- "
MB_DOC_FIRE_VARIABLE_DEEP += $(call mb_make_call,mb_doc_variable_deep,MB_PROJ_STEP_AFTER_PREFIX,"Prefix for af phase message.")
MB_PROJ_STEP_DONE_PREFIX ?= "Finished executing prime pi target "
MB_DOC_FIRE_VARIABLE_DEEP += $(call mb_make_call,mb_doc_variable_deep,MB_PROJ_STEP_DONE_PREFIX,"Prefix for af phase message.")
MB_PROJ_PHASE_PROCESS_DEPS ?=
MB_DOC_FIRE_VARIABLE_FLOW += $(call mb_make_call,mb_doc_variable_flow,MB_PROJ_PHASE_PROCESS_DEPS,"The targets to trigger by project @process target.")
MB_PROJ_PHASE_COMPILE_DEPS ?=
MB_DOC_FIRE_VARIABLE_FLOW += $(call mb_make_call,mb_doc_variable_flow,MB_PROJ_PHASE_COMPILE_DEPS,"The targets to trigger by project @compile target.")
MB_PROJ_PHASE_LINK_DEPS ?=
MB_DOC_FIRE_VARIABLE_FLOW += $(call mb_make_call,mb_doc_variable_flow,MB_PROJ_PHASE_LINK_DEPS,"The targets to trigger by project @link target.")
MB_PROJ_PHASE_BUILD_DEPS ?=
MB_DOC_FIRE_VARIABLE_FLOW += $(call mb_make_call,mb_doc_variable_flow,MB_PROJ_PHASE_BUILD_DEPS,"The targets to trigger by project @build target.")
MB_PROJ_PHASE_TEST_DEPS ?=
MB_DOC_FIRE_VARIABLE_FLOW += $(call mb_make_call,mb_doc_variable_flow,MB_PROJ_PHASE_TEST_DEPS,"The targets to trigger by project @test target.")
MB_PROJ_PHASE_PACKAGE_DEPS ?=
MB_DOC_FIRE_VARIABLE_FLOW += $(call mb_make_call,mb_doc_variable_flow,MB_PROJ_PHASE_PACKAGE_DEPS,"The targets to trigger by project @package target.")
MB_PROJ_PHASE_PACKAGE_QA_DEPS ?=
MB_DOC_FIRE_VARIABLE_FLOW += $(call mb_make_call,mb_doc_variable_flow,MB_PROJ_PHASE_PACKAGE_QA_DEPS,"The targets to trigger by project @package-qa target.")
MB_PROJ_PHASE_PACKAGE_DEPLOY_DEPS ?=
MB_DOC_FIRE_VARIABLE_FLOW += $(call mb_make_call,mb_doc_variable_flow,MB_PROJ_PHASE_PACKAGE_QA_DEPLOY,"The targets to trigger by project @package-deploy target.")
MB_PROJ_PHASE_RUN_DEPS ?=
MB_DOC_FIRE_VARIABLE_FLOW += $(call mb_make_call,mb_doc_variable_flow,MB_PROJ_PHASE_QA_DEPS,"The targets to trigger by project @run target.")
define mb_proj_module_path_src
$(1)/$(subst /,,$(subst $(1),,$(dir $(lastword $(MAKEFILE_LIST)))))
endef
MB_DOC_FIRE_FUNCTION_DEEP += $(call mb_make_call,mb_doc_function_deep,mb_proj_module_path_src,"Convert include location folder as src folder.","<path-src>")
define mb_proj_module_path_bin
$(2)/$(subst /,,$(subst $(1),,$(dir $(lastword $(MAKEFILE_LIST)))))
endef
MB_DOC_FIRE_FUNCTION_DEEP += $(call mb_make_call,mb_doc_function_deep,mb_proj_module_path_src,"Convert include location folder as bin folder.","<path-src> <path-bin>")
define mb_proj_module_local_deps
$(foreach dep,$(2),$(1)/$(notdir $(dep)))
endef
MB_DOC_FIRE_FUNCTION_DEEP += $(call mb_make_call,mb_doc_function_deep,mb_proj_module_deps,"Convert other files to local deps.","<mod-bin> <deps>")
define _mb_proj_flow_step_before
$(call mb_make_call,mb_make_echo_phase,$(MB_PROJ_STEP_BEFORE_PREFIX)$@)
endef
define _mb_proj_flow_step_done
$(call mb_make_call,mb_make_echo_phase,$(MB_PROJ_STEP_AFTER_PREFIX)$@)
$(if $(filter $@,$(MAKECMDGOALS)),$(call mb_make_call,mb_make_echo_good,$(MB_PROJ_STEP_DONE_PREFIX)$@))
endef
define _mb_proj_run_clean
$(foreach folder,$(1),$(if $(wildcard $(folder)),$(call mb_make_call,mb_make_echo_command,Removing folder $(folder));))
$(foreach folder,$(1),$(if $(wildcard $(folder)),$(call mb_make_call,mb_clean,$(folder))))
endef
define _mb_proj_run_init
$(foreach folder,$(1),$(if $(wildcard $(folder)),,$(call mb_make_call,mb_make_echo_command,Creating folder $(folder));))
$(foreach folder,$(1),$(if $(wildcard $(folder)),,$(call mb_make_call,mb_mkdir,$(folder))))
endef
define _mb_proj_run_selector
@$(MB_OS_ECHO) -e -n "Please run one of the following targets;\n\n "
@$(MB_OS_ECHO) -e $(subst bin,"* bin",$(subst @run,@run\\\n,$(MB_PROJ_PHASE_RUN_DEPS)))
endef
define mb_proj_flow_setup
@@clean:
$$(call mb_make_call,_mb_proj_flow_step_before)
.PHONY: @@clean
@clean: @@clean
$$(call mb_make_call,_mb_proj_run_clean,$(1))
$$(call mb_make_call,_mb_proj_flow_step_done)
MB_DOC_FIRE_HELP += $$(call mb_make_call,mb_doc_target_help,@clean,"Clean's the project build folders.")
.PHONY: @clean
@@init:
$$(call mb_make_call,_mb_proj_flow_step_before)
.PHONY: @@init
@init: @@init
$$(call mb_make_call,_mb_proj_run_init,$(1))
$$(call mb_make_call,_mb_proj_flow_step_done)
MB_DOC_FIRE_HELP += $$(call mb_make_call,mb_doc_target_help,@init,"Setup and project output folder.")
.PHONY: @init
@@process: @init
$$(call mb_make_call,_mb_proj_flow_step_before)
.PHONY: @@process
@process: @@process $$(MB_PROJ_PHASE_PROCESS_DEPS)
$$(call mb_make_call,_mb_proj_flow_step_done)
MB_DOC_FIRE_HELP += $$(call mb_make_call,mb_doc_target_help,@process,"Process sources before compiling.")
.PHONY: @process
@@compile: @process
$$(call mb_make_call,_mb_proj_flow_step_before)
.PHONY: @@compile
@compile: @@compile $$(MB_PROJ_PHASE_COMPILE_DEPS)
$$(call mb_make_call,_mb_proj_flow_step_done)
MB_DOC_FIRE_HELP += $$(call mb_make_call,mb_doc_target_help,@compile,"Compiles all project sources.")
.PHONY: @compile
@@link: @compile
$$(call mb_make_call,_mb_proj_flow_step_before)
.PHONY: @@link
@link: @@link $$(MB_PROJ_PHASE_LINK_DEPS)
$$(call mb_make_call,_mb_proj_flow_step_done)
MB_DOC_FIRE_HELP += $$(call mb_make_call,mb_doc_target_help,@link,"Link all project intermediate files.")
.PHONY: @link
@@build: @link
$$(call mb_make_call,_mb_proj_flow_step_before)
.PHONY: @@build
@build: @@build $$(MB_PROJ_PHASE_BUILD_DEPS)
$$(call mb_make_call,_mb_proj_flow_step_done)
MB_DOC_FIRE_HELP += $$(call mb_make_call,mb_doc_target_help,@build,"Build all project artifacts.")
.PHONY: @build
@@test: @build
$$(call mb_make_call,_mb_proj_flow_step_before)
.PHONY: @@test
@test: @@test $$(MB_PROJ_PHASE_TEST_DEPS)
$$(call mb_make_call,_mb_proj_flow_step_done)
MB_DOC_FIRE_HELP += $$(call mb_make_call,mb_doc_target_help,@test,"Run all assertion tests.")
.PHONY: @test
@@package: @test
$$(call mb_make_call,_mb_proj_flow_step_before)
.PHONY: @@package
@package: @@package $$(MB_PROJ_PHASE_PACKAGE_DEPS)
$$(call mb_make_call,_mb_proj_flow_step_done)
MB_DOC_FIRE_HELP += $$(call mb_make_call,mb_doc_target_help,@package,"Create package/packages of project.")
.PHONY: @package
@@package-qa: @package
$$(call mb_make_call,_mb_proj_flow_step_before)
.PHONY: @@package-qa
@package-qa: @@package-qa $$(MB_PROJ_PHASE_PACKAGE_QA_DEPS)
$$(call mb_make_call,_mb_proj_flow_step_done)
MB_DOC_FIRE_HELP += $$(call mb_make_call,mb_doc_target_help,@package-qa,"Run all package QA of project.")
.PHONY: @package-qa
@@package-deploy: @package-qa
$$(call mb_make_call,_mb_proj_flow_step_before)
.PHONY: @@package-deploy
@package-deploy: @@package-deploy $$(MB_PROJ_PHASE_PACKAGE_DEPLOY_DEPS)
$$(call mb_make_call,_mb_proj_flow_step_done)
MB_DOC_FIRE_HELP += $$(call mb_make_call,mb_doc_target_help,@package-deploy,"Deploy the package/packages.")
.PHONY: @package-deploy
@@run:
$$(call mb_make_call,_mb_proj_flow_step_before)
.PHONY: @@run
@run: @@run
$$(call mb_make_call,_mb_proj_run_selector)
$$(call mb_make_call,_mb_proj_flow_step_done)
MB_DOC_FIRE_HELP += $$(call mb_make_call,mb_doc_target_help,@run,"Run one or more artifacts.")
.PHONY: @run
endef
MB_DOC_FIRE_FUNCTION_FLOW += $(call mb_make_call,mb_doc_function_flow,mb_proj_flow_setup,"Prints flow of abstract project build cycle.","<build-dirs>")
define mb_proj_flow_setup_jp
@クリーン: @clean
$$(call mb_make_call,_mb_proj_flow_step_done)
MB_DOC_FIRE_HELP += $$(call mb_make_call,mb_doc_target_help,@クリーン,"プロジェクトのビルドフォルダーをクリーンアップします。")
.PHONY: @クリーン
@初期化する: @init
$$(call mb_make_call,_mb_proj_flow_step_done)
MB_DOC_FIRE_HELP += $$(call mb_make_call,mb_doc_target_help,@初期化する,"モジュール出力フォルダーをセットアップして検証します。")
.PHONY: @@初期化する
@プロセス: @初期化する @process
$$(call mb_make_call,_mb_proj_flow_step_done)
MB_DOC_FIRE_HELP += $$(call mb_make_call,mb_doc_target_help,@プロセス,"コンパイル前にソースを処理します。")
.PHONY: @プロセス
@コンパイル: @プロセス @compile
$$(call mb_make_call,_mb_proj_flow_step_done)
MB_DOC_FIRE_HELP += $$(call mb_make_call,mb_doc_target_help,@コンパイル,"すべてのプロジェクト ソースをコンパイルします。")
.PHONY: @コンパイル
@リンク: @コンパイル @link
$$(call mb_make_call,_mb_proj_flow_step_done)
MB_DOC_FIRE_HELP += $$(call mb_make_call,mb_doc_target_help,@リンク,"すべてのプロジェクト中間ファイルをリンクします。")
.PHONY: @リンク
@建てる: @リンク @build
$$(call mb_make_call,_mb_proj_flow_step_done)
MB_DOC_FIRE_HELP += $$(call mb_make_call,mb_doc_target_help,@建てる,"すべてのプロジェクト成果物をビルドします。")
.PHONY: @建てる
@テスト: @建てる @test
$$(call mb_make_call,_mb_proj_flow_step_done)
MB_DOC_FIRE_HELP += $$(call mb_make_call,mb_doc_target_help,@テスト,"すべてのアサーション テストを実行します。")
.PHONY: @テスト
@パッケージ: @テスト @package
$$(call mb_make_call,_mb_proj_flow_step_done)
MB_DOC_FIRE_HELP += $$(call mb_make_call,mb_doc_target_help,@パッケージ,"プロジェクトのパッケージを作成します。")
.PHONY: @パッケージ
@パッケージの品質保証: @パッケージ @package-qa
$$(call mb_make_call,_mb_proj_flow_step_done)
MB_DOC_FIRE_HELP += $$(call mb_make_call,mb_doc_target_help,@パッケージの品質保証,"すべてのパッケージを実行します。プロジェクトの品質保証。")
.PHONY: @パッケージの品質保証
@パッケージのデプロイ: @パッケージの品質保証 @package-deploy
$$(call mb_make_call,_mb_proj_flow_step_done)
MB_DOC_FIRE_HELP += $$(call mb_make_call,mb_doc_target_help,@パッケージのデプロイ,"パッケージをデプロイします。")
.PHONY: @パッケージのデプロイ
@走る: @run
$$(call mb_make_call,_mb_proj_flow_step_done)
MB_DOC_FIRE_HELP += $$(call mb_make_call,mb_doc_target_help,@走る,"1 つ以上のアーティファクトを実行します。")
.PHONY: @走る
endef
MB_DOC_FIRE_FUNCTION_FLOW += $(call mb_make_call,mb_doc_function_flow,mb_proj_flow_setup_jp,"Prints flow for japanese wrapper of project build cycle.")
define mb_proj_flow_flight_video
@@test-video: @test
$$(if $$(filter on,$$(MB_FLIGHT_VIDEO)),$$(call mb_make_call,mb_flight_video_merge,$(1)))
@test-video: @clean
$$(call mb_make_call,_mb_proj_flow_step_before)
MB_OPENMSX_HEADLESS=off MB_FLIGHT_VIDEO=on $$(MAKE) @@test-video
$$(call mb_make_call,_mb_proj_flow_step_done)
MB_DOC_FIRE_HELP += $(call mb_make_call,mb_doc_target_help,@test-video,"Runs @test with video recorder and merges flight videos to one.")
.PHONY: @test-video
@@package-qa-video: @package-qa
$$(if $$(filter on,$$(MB_FLIGHT_VIDEO)),$$(call mb_make_call,mb_flight_video_merge,$(1)))
@package-qa-video: @clean
$$(call mb_make_call,_mb_proj_flow_step_before)
MB_OPENMSX_HEADLESS=off MB_FLIGHT_VIDEO=on $$(MAKE) @@package-qa-video
$$(call mb_make_call,_mb_proj_flow_step_done)
MB_DOC_FIRE_HELP += $(call mb_make_call,mb_doc_target_help,@package-qa-video,"Runs @package-qa with video recorder and merges flight videos to one.")
.PHONY: @test-video
endef
MB_DOC_FIRE_FUNCTION_FLOW += $(call mb_make_call,mb_doc_function_flow,mb_proj_flow_flight_video,"Prints flow for adding video targets in project build cycle.","<path-bin>")

View file

@ -1,4 +1,5 @@
MB_SDCC_FLAG_CPU ?= -mz80
MB_DOC_FIRE_VARIABLE += $(call mb_make_call,mb_doc_variable,MB_SDCC_FLAG_CPU,"The SDCC cpu target option.")
@ -21,28 +22,28 @@ MB_DOC_FIRE_VARIABLE += $(call mb_make_call,mb_doc_variable,MB_SDCC_AR_FLAGS,"Th
define mb_sdcc_compile_asm
$(call mb_make_call,mb_make_echo_good,SDCC Compile module asm for $(2))
$(call mb_make_call,mb_make_echo_command,SDCC Compile super $(2) from ASM)
$(PATH_SDCC)/sdasz80 $(MB_SDCC_ASZ80_FLAGS) $(2) $(1)
endef
MB_DOC_FIRE_FUNCTION += $(call mb_make_call,mb_doc_function,mb_sdcc_compile_asm,"Compiles asm source code.","<in> <out>")
define mb_sdcc_link_asm_lib
$(call mb_make_call,mb_make_echo_good,SDCC Link module asm lib for $(2))
$(call mb_make_call,mb_make_echo_command,SDCC Link ASM lib $(2))
$(PATH_SDCC)/sdar $(MB_SDCC_AR_FLAGS) $(1) $(2)
endef
MB_DOC_FIRE_FUNCTION += $(call mb_make_call,mb_doc_function,mb_sdcc_link_asm_lib,"Link asm lib module.","<in> <out>")
define mb_sdcc_link_asm
$(call mb_make_call,mb_make_echo_good,SDCC Link asm module at $(3) for $(2))
$(call mb_make_call,mb_make_echo_command,SDCC Link megaocto $(2) at $(3))
$(PATH_SDCC)/sdcc $(MB_SDCC_FLAG_CPU) $(MB_SDCC_CC_FLAGS) --no-std-crt0 --code-loc $(3) -o $(2) $(1)
endef
MB_DOC_FIRE_FUNCTION += $(call mb_make_call,mb_doc_function,mb_sdcc_link_asm,"Links asm to custom code location.","<in> <out> <code-loc>")
define mb_sdcc_link_asm_0000
$(call mb_sdcc_link_asm,$(1),$(2),0x0000)
$(call mb_sdcc_link_asm,$(1),$(2),0x0000)rule
endef
MB_DOC_FIRE_FUNCTION += $(call mb_make_call,mb_doc_function,mb_sdcc_link_asm_0000,"Links asm to 0x0000.","<in> <out>")
@ -84,7 +85,8 @@ MB_DOC_FIRE_FUNCTION += $(call mb_make_call,mb_doc_function,mb_sdcc_link_asm_bdo
define mb_sdcc_hex2bin
$(call mb_make_call,mb_make_echo_good,SDCC hex2bin for $(2))
$(call mb_make_call,mb_make_echo_command,SDCC sdobjcopy for $(2))
$(PATH_SDCC)/sdobjcopy -I ihex --output-target=binary $(1) $(2)
endef
MB_DOC_FIRE_FUNCTION += $(call mb_make_call,mb_doc_function,mb_sdcc_hex2bin,"Converts an hex file to binary.","<in> <out>")

88
lib/make/mb_tool.mk Normal file
View file

@ -0,0 +1,88 @@
define mb_tool_m80_flow_bdos_mono
$(1): | @init
$$(call mb_make_call,mb_mkdir,$(1))
$$(call mb_make_call,mb_mkdir,$(1)/utils)
$$(call mb_make_call,mb_msxhub_get_macro80,$(1)/utils)
$$(call mb_make_call,mb_msxhub_get_z80asmuk,$(1)/utils)
MB_DOC_FIRE_TARGET_DEEP += $$(call mb_make_call,mb_doc_target_deep,$(1))
.PHONY: $(1)
$(1)/$(3).mac: $(2)/$(3).mac | $(1)
$$(call mb_make_call,mb_conv_unix2dos,$(2)/$(3).mac,$(1)/$(3).mac)
MB_DOC_FIRE_TARGET_DEEP += $$(call mb_make_call,mb_doc_target_deep,$(1)/$(3).mac)
MB_PROJ_PHASE_PROCESS_DEPS += $(1)/$(3).mac
$(1)/$(3).rel: $(1)/$(3).mac
$$(call mb_make_call,mb_msxpipe_safe_cmd,$(1),m80 $$(MB_MAKE_EQUALS)$(3)/Z)
MB_DOC_FIRE_TARGET_DEEP += $$(call mb_make_call,mb_doc_target_deep,$(1)/$(3).rel)
MB_PROJ_PHASE_COMPILE_DEPS += $(1)/$(3).rel
$(1)/$(3).hex: $(1)/$(3).rel
$$(call mb_make_call,mb_msxpipe_safe_cmd,$(1),l80 $(3)$$(MB_MAKE_COMMA)$(3)/N/X/Y/E)
MB_DOC_FIRE_TARGET_DEEP += $$(call mb_make_call,mb_doc_target_deep,$(1)/$(3).hex)
MB_PROJ_PHASE_LINK_DEPS += $(1)/$(3).hex
$(1)/$(3).com: $(1)/$(3).hex
$$(call mb_make_call,mb_msxpipe_safe_cmd,$(1),hextocom $(3))
MB_DOC_FIRE_TARGET_DEEP += $$(call mb_make_call,mb_doc_target_deep,$(1)/$(3).com)
MB_PROJ_PHASE_BUILD_DEPS += $(1)/$(3).com
$(1)/@build: $(1)/$(3).com
MB_DOC_FIRE_TARGET += $$(call mb_make_call,mb_doc_target,$(1)/@build,"Builds the $(1) module.")
.PHONY: $(1)/@build
$(1)/@run: $(1)/@build
$$(call mb_make_call,mb_msxpipe_run_gui,$(1))
MB_DOC_FIRE_TARGET += $$(call mb_make_call,mb_doc_target,$(1)/@run,"Run $(3).com manually with gui.")
MB_PROJ_PHASE_RUN_DEPS += $(1)/@run
.PHONY: $(1)/@run
endef
MB_DOC_FIRE_FUNCTION_FLOW += $(call mb_make_call,mb_doc_function_flow,mb_tool_m80_flow_bdos_mono,"Prints flow of m80 toolchain bdos mono file module.","<bin-dir> <src-dir> <objname>")
define mb_tool_sdcc_flow_bdos_mono
$(1): | @init
$$(call mb_make_call,mb_mkdir,$(1))
MB_DOC_FIRE_TARGET_DEEP += $$(call mb_make_call,mb_doc_target_deep,$(1))
.PHONY: $(1)
$(1)/$(3).rel: $(2)/$(3).asm | $(1)
$$(call mb_sdcc_compile_asm,$$<,$$@)
MB_DOC_FIRE_TARGET_DEEP += $$(call mb_make_call,mb_doc_target_deep,$(1)/$(3).rel)
MB_PROJ_PHASE_COMPILE_DEPS += $(1)/$(3).rel
$(1)/$(3).hex: $(1)/$(3).rel
$$(call mb_sdcc_link_asm_bdos,$$<,$$@)
MB_DOC_FIRE_TARGET_DEEP += $$(call mb_make_call,mb_doc_target_deep,$(1)/$(3).hex)
MB_PROJ_PHASE_LINK_DEPS += $(1)/$(3).hex
$(1)/$(3).com: $(1)/$(3).hex
$$(call mb_sdcc_hex2bin,$$<,$$@)
MB_DOC_FIRE_TARGET_DEEP += $$(call mb_make_call,mb_doc_target_deep,$(1)/$(3).com)
MB_PROJ_PHASE_BUILD_DEPS += $(1)/$(3).com
$(1)/@build: $(1)/$(3).com
MB_DOC_FIRE_TARGET += $$(call mb_make_call,mb_doc_target,$(1)/@build,"Builds the $(1) module.")
.PHONY: $(1)/@build
$(1)/@run: $(1)/@build
$$(call mb_make_call,mb_msxpipe_run_gui,$(1))
MB_DOC_FIRE_TARGET += $$(call mb_make_call,mb_doc_target,$(1)/@run,"Run $(3).com manually with gui.")
MB_PROJ_PHASE_RUN_DEPS += $(1)/@run
.PHONY: $(1)/@run
endef
MB_DOC_FIRE_FUNCTION_FLOW += $(call mb_make_call,mb_doc_function_flow,mb_tool_sdcc_flow_bdos_mono,"Prints flow of sdcc toolchain bdos mono file module.","<bin-dir> <src-dir> <objname>")

View file

@ -2,15 +2,18 @@
# msxbuild.mk - Makefile helper to use with msx projects.
#
# Setup default tools paths
PATH_SDCC ?= /usr/bin
PATH_OPENMSX ?= /usr/bin
PATH_MSXBUILD ?= $(dir $(lastword $(MAKEFILE_LIST)))../..
PATH_MSXBUILD_REAL := $(if $(realpath $(PATH_MSXBUILD)),$(realpath $(PATH_MSXBUILD)),$(PATH_MSXBUILD))
# Include extra features
include $(PATH_MSXBUILD)/lib/make/mb_doc.mk
include $(PATH_MSXBUILD)/lib/make/mb_make.mk
include $(PATH_MSXBUILD)/lib/make/mb_conv.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
@ -18,9 +21,12 @@ include $(PATH_MSXBUILD)/lib/make/mb_msxhub.mk
include $(PATH_MSXBUILD)/lib/make/mb_msxpipe.mk
include $(PATH_MSXBUILD)/lib/make/mb_openmsx.mk
include $(PATH_MSXBUILD)/lib/make/mb_autoexec.mk
include $(PATH_MSXBUILD)/lib/make/mb_conv.mk
include $(PATH_MSXBUILD)/lib/make/mb_assert.mk
include $(PATH_MSXBUILD)/lib/make/mb_tool.mk
include $(PATH_MSXBUILD)/lib/make/mb_proj.mk
include $(PATH_MSXBUILD)/lib/make/mb_os.mk
# Below mb_doc.mk for white space...
MB_DOC_FIRE_VARIABLE_DEEP += $(call mb_make_call,mb_doc_variable_deep,PATH_SDCC,"Path where SDCC binaries are located.")
MB_DOC_FIRE_VARIABLE_DEEP += $(call mb_make_call,mb_doc_variable_deep,PATH_OPENMSX,"Path where openMSX binary is located.")
@ -29,7 +35,6 @@ MB_DOC_FIRE_VARIABLE_ROCK += $(call mb_make_call,mb_doc_variable_rock,PATH_MSXBU
define mb_clean
$(call mb_make_call,mb_make_echo_good,Cleaning build folder $(1))
$(MB_OS_RMDIR) $(1)
endef
MB_DOC_FIRE_FUNCTION += $(call mb_make_call,mb_doc_function,mb_clean,"Removed the full folder.","<dir>")
@ -53,9 +58,9 @@ endef
MB_DOC_FIRE_FUNCTION += $(call mb_make_call,mb_doc_function,mb_copy,"Copy an file.","<in> <out>")
define mb_create_dist
$(call mb_make_call,mb_make_echo_good,Creating distribution archive $(2))
$(call mb_make_call,mb_make_echo_command,Creating distribution archive $(2))
tar -czf $(2) -C $(1) `ls $(1)`
endef
MB_DOC_FIRE_FUNCTION += $(call mb_make_call,mb_doc_function,mb_create_dist,"Create an distribution archive.","<dir> <artifact>")

View file

@ -1,3 +0,0 @@
$(PATH_BIN):
$(call mb_mkdir,$(PATH_BIN))

View file

@ -1,17 +0,0 @@
ASSERT_ALL_DEPS := \
bin/ahello-m80-test/@assert \
bin/ahello-sdcc-test/@assert \
bin/dist-qa-dos1/@assert \
bin/dist-qa-dos2/@assert \
bin/dist-qa-msx1/@assert \
bin/dist-qa-msxhub/@assert \
bin/make-on-msx/@assert \
bin/mbboot80-test/@assert
$(PATH_BIN)/@assert-all: | $(ASSERT_ALL_DEPS)
@echo === All assertions completed
@echo === All $(MB_DEP_ALL_ASSERT)
$(if $(filter on,$(MB_FLIGHT_VIDEO)),$(call mb_make_call,mb_flight_video_merge,$(PATH_BIN)))
MB_DOC_FIRE_TARGET += $(call mb_make_call,mb_doc_target,$(PATH_BIN)/@assert-all,"Asserts all assertions tests.")
.PHONY: $(PATH_BIN)/@assert-all

View file

@ -1,5 +0,0 @@
$(PATH_BIN)/@clean:
$(call mb_make_call,mb_clean,$(PATH_BIN))
MB_DOC_FIRE_TARGET += $(call mb_make_call,mb_doc_target,$(PATH_BIN)/@clean,"Clean's the build folder.")
.PHONY: $(PATH_BIN)/@clean

View file

@ -1,5 +0,0 @@
$(PATH_BIN)/@prepare: | $(PATH_BIN)
@echo === .PHONY: $(PATH_BIN)/@prepare
MB_DOC_FIRE_TARGET += $(call mb_make_call,mb_doc_target,$(PATH_BIN)/@prepare,"Virtual prepare phase of binary folder.")
.PHONY: $(PATH_BIN)/@prepare

View file

@ -1,23 +0,0 @@
AHELLO_M80_TEST_MOD := ahello-m80-test
AHELLO_M80_TEST_SRC := $(PATH_SRC)/$(AHELLO_M80_TEST_MOD)
AHELLO_M80_TEST_BIN := $(PATH_BIN)/$(AHELLO_M80_TEST_MOD)
$(AHELLO_M80_TEST_BIN): | $(PATH_BIN)/@prepare
$(call mb_mkdir,$(AHELLO_M80_TEST_BIN))
$(AHELLO_M80_TEST_BIN)/ahello.com: $(AHELLO_M80_BIN)/ahello.com | $(AHELLO_M80_TEST_BIN)
$(call mb_copy,$<,$@)
$(AHELLO_M80_TEST_BIN)/@run: | $(AHELLO_M80_TEST_BIN)/ahello.com
$(call mb_msxpipe_run_gui,$(AHELLO_M80_TEST_BIN))
MB_DOC_HELP_TARGET += $(call mb_doc_target,$(AHELLO_M80_TEST_BIN)/@run,"Run binaries from ahello-m80.")
.PHONY: $(AHELLO_M80_TEST_BIN)/@run
$(AHELLO_M80_TEST_BIN)/@assert: | $(AHELLO_M80_TEST_BIN)/ahello.com
$(call mb_delete,$(AHELLO_M80_TEST_BIN)/ahello.out)
$(call mb_msxpipe_safe_test,$(AHELLO_M80_TEST_BIN),ahello > ahello.out)
grep "M80: Hello world..." $(AHELLO_M80_TEST_BIN)/ahello.out
MB_DOC_HELP_TARGET += $(call mb_doc_target,$(AHELLO_M80_TEST_BIN)/@assert,"Assert binaries from ahello-m80.")
MB_DEP_ALL_ASSERT += $(AHELLO_M80_TEST_BIN)/@assert
.PHONY: $(AHELLO_M80_TEST_BIN)/@assert

View file

@ -1,85 +1,10 @@
AHELLO_M80_MOD := ahello-m80
AHELLO_M80_SRC := $(PATH_SRC)/$(AHELLO_M80_MOD)
AHELLO_M80_BIN := $(PATH_BIN)/$(AHELLO_M80_MOD)
#PROJECT_ROOT = $(dir $(abspath $(lastword $(MAKEFILE_LIST))))
#PROJECT_ROOT = $(dir $(lastword $(MAKEFILE_LIST)))
# src/ahello-m80/0module.mk
define mb_flow_m80_mono_com
$(2): | $(1)
$$(call mb_make_call,mb_mkdir,$(2))
$$(call mb_make_call,mb_mkdir,$(2)/utils)
$$(call mb_make_call,mb_msxhub_get_macro80,$(2)/utils)
$$(call mb_make_call,mb_msxhub_get_z80asmuk,$(2)/utils)
MB_DOC_FIRE_TARGET_DEEP += $$(call mb_make_call,mb_doc_target_deep,$(2))
$(2)/$(4).mac: $(3)/$(4).mac | $(2)
$$(call mb_make_call,mb_conv_unix2dos,$(3)/$(4).mac,$(2)/$(4).mac)
MB_DOC_FIRE_TARGET_DEEP += $$(call mb_make_call,mb_doc_target_deep,$(2)/$(4).mac)
$(2)/$(4).rel: $(2)/$(4).mac
$$(call mb_make_call,mb_msxpipe_safe_cmd,$(2),m80 $$(MB_MAKE_EQUALS)$(4)/Z)
MB_DOC_FIRE_TARGET_DEEP += $$(call mb_make_call,mb_doc_target_deep,$(2)/$(4).rel)
$(2)/$(4).hex: $(2)/$(4).rel
$$(call mb_make_call,mb_msxpipe_safe_cmd,$(2),l80 $(4)$$(MB_MAKE_COMMA)$(4)/N/X/Y/E)
MB_DOC_FIRE_TARGET_DEEP += $$(call mb_make_call,mb_doc_target_deep,$(2)/$(4).hex)
$(2)/$(4).com: $(2)/$(4).hex
$$(call mb_make_call,mb_msxpipe_safe_cmd,$(2),hextocom $(4))
MB_DOC_FIRE_TARGET_DEEP += $$(call mb_make_call,mb_doc_target_deep,$(2)/$(4).com)
$(2)/@build: $(2)/$(4).com
MB_DOC_FIRE_TARGET += $$(call mb_make_call,mb_doc_target,$(2)/@build,"Builds the $(2) module.")
MB_DEP_ALL_COMPILE += $(2)/@build
.PHONY: $(2)/@build
$(2)/@run: $(2)/@build
$$(call mb_make_call,mb_msxpipe_run_gui,$(2))
MB_DOC_FIRE_TARGET += $$(call mb_make_call,mb_doc_target,$(2)/@run,"Run $(4).com manually with gui.")
.PHONY: $(2)/@run
endef
#$(eval $(call mb_make_call,mb_m80_flow_bdos_mono,$(PATH_BIN)/@prepare,bin/foobar,$(AHELLO_M80_SRC),ahello))
$(eval $(call mb_make_call,mb_flow_m80_mono_com,$(PATH_BIN)/@prepare,bin/foobar2,$(AHELLO_M80_SRC),ahello))
AHELLO_M80_SRC := $(call mb_make_call,mb_proj_module_path_src,$(PATH_SRC))
AHELLO_M80_BIN := $(call mb_make_call,mb_proj_module_path_bin,$(PATH_SRC),$(PATH_BIN))
bin/foobar2/@assert: bin/foobar2/@build
$(call mb_delete,bin/foobar2/ahello.out)
$(call mb_msxpipe_safe_test,bin/foobar2,ahello > ahello.out)
grep "M80: Hello world..." bin/foobar2/ahello.out
MB_DOC_FIRE_TARGET += $(call mb_doc_target,bin/foobar2/@assert,"Assert binaries from ahello-m80.")
MB_DEP_ALL_ASSERT += bin/foobar2/@assert
.PHONY: bin/foobar2/@assert
$(call mb_make_call_eval,mb_tool_m80_flow_bdos_mono,$(AHELLO_M80_BIN),$(AHELLO_M80_SRC),ahello)
$(call mb_make_call_eval,mb_assert_flow_bdos_grep,$(AHELLO_M80_BIN),check-m80,ahello,M80)
$(call mb_make_call_eval,mb_assert_flow_bdos_grep,$(AHELLO_M80_BIN),check-txt,ahello,"o world...")
$(AHELLO_M80_BIN): | $(PATH_BIN)/@prepare
$(call mb_mkdir,$(AHELLO_M80_BIN))
$(call mb_mkdir,$(AHELLO_M80_BIN)/utils)
$(call mb_msxhub_get_macro80,$(AHELLO_M80_BIN)/utils)
$(call mb_msxhub_get_z80asmuk,$(AHELLO_M80_BIN)/utils)
$(AHELLO_M80_BIN)/%.mac: $(AHELLO_M80_SRC)/%.mac | $(AHELLO_M80_BIN)
$(call mb_conv_unix2dos,$<,$@)
$(AHELLO_M80_BIN)/ahello.rel: $(AHELLO_M80_BIN)/ahello.mac
$(call mb_msxpipe_safe_cmd,$(AHELLO_M80_BIN),m80 =ahello/Z)
$(AHELLO_M80_BIN)/ahello.hex: $(AHELLO_M80_BIN)/ahello.rel
$(call mb_msxpipe_safe_cmd,$(AHELLO_M80_BIN),l80 ahello$(MB_MAKE_COMMA)ahello/N/X/Y/E)
$(AHELLO_M80_BIN)/ahello.com: $(AHELLO_M80_BIN)/ahello.hex
$(call mb_msxpipe_safe_cmd,$(AHELLO_M80_BIN),hextocom ahello)
MB_DOC_FIRE_TARGET += $(call mb_doc_target,$(AHELLO_M80_BIN)/ahello.com,"Compiles hello world with macro80.")
MB_DEP_ALL_COMPILE += $(AHELLO_M80_BIN)/ahello.com
$(AHELLO_M80_BIN)/@build: $(AHELLO_M80_BIN)/ahello.com
.PHONY: $(AHELLO_M80_BIN)/@build
$(AHELLO_M80_BIN)/@run: $(AHELLO_M80_BIN)/ahello.com
$(call mb_make_call,mb_msxpipe_run_gui,$(AHELLO_M80_BIN))
MB_DOC_FIRE_TARGET += $(call mb_doc_target,$(AHELLO_M80_BIN)/@run,"Run the compiled hello world from macro80.")
.PHONY: $(AHELLO_M80_BIN)/@run

View file

@ -1,22 +0,0 @@
AHELLO_SDCC_TEST_MOD := ahello-sdcc-test
AHELLO_SDCC_TEST_SRC := $(PATH_SRC)/$(AHELLO_SDCC_TEST_MOD)
AHELLO_SDCC_TEST_BIN := $(PATH_BIN)/$(AHELLO_SDCC_TEST_MOD)
$(AHELLO_SDCC_TEST_BIN): | $(PATH_BIN)/@prepare
$(call mb_mkdir,$(AHELLO_SDCC_TEST_BIN))
$(AHELLO_SDCC_TEST_BIN)/ahello.com: $(AHELLO_SDCC_BIN)/ahello.com | $(AHELLO_SDCC_TEST_BIN)
$(call mb_copy,$<,$@)
$(AHELLO_SDCC_TEST_BIN)/@run: | $(AHELLO_SDCC_TEST_BIN)/ahello.com
$(call mb_msxpipe_run_gui,$(AHELLO_SDCC_TEST_BIN))
MB_DOC_FIRE_TARGET += $(call mb_doc_target,$(AHELLO_SDCC_TEST_BIN)/@run,"Run binaries from ahello-sdcc.")
.PHONY: $(AHELLO_SDCC_TEST_BIN)/@run
$(AHELLO_SDCC_TEST_BIN)/@assert: | $(AHELLO_SDCC_TEST_BIN)/ahello.com
$(call mb_delete,$(AHELLO_SDCC_TEST_BIN)/ahello.out)
$(call mb_msxpipe_safe_test,$(AHELLO_SDCC_TEST_BIN),ahello > ahello.out)
grep "SDCC: Hello world..." $(AHELLO_SDCC_TEST_BIN)/ahello.out
MB_DOC_FIRE_TARGET += $(call mb_doc_target,$(AHELLO_SDCC_TEST_BIN)/@assert,"Assert binaries from ahello-sdcc.")
.PHONY: $(AHELLO_SDCC_TEST_BIN)/@assert

View file

@ -1,22 +1,10 @@
AHELLO_SDCC_MOD := ahello-sdcc
AHELLO_SDCC_SRC := $(PATH_SRC)/$(AHELLO_SDCC_MOD)
AHELLO_SDCC_BIN := $(PATH_BIN)/$(AHELLO_SDCC_MOD)
$(AHELLO_SDCC_BIN): | $(PATH_BIN)/@prepare
$(call mb_mkdir,$(AHELLO_SDCC_BIN))
AHELLO_SDCC_SRC := $(call mb_make_call,mb_proj_module_path_src,$(PATH_SRC))
AHELLO_SDCC_BIN := $(call mb_make_call,mb_proj_module_path_bin,$(PATH_SRC),$(PATH_BIN))
$(AHELLO_SDCC_BIN)/%.rel: $(AHELLO_SDCC_SRC)/%.asm | $(AHELLO_SDCC_BIN)
$(call mb_sdcc_compile_asm,$<,$@)
$(AHELLO_SDCC_BIN)/ahello.hex: $(AHELLO_SDCC_BIN)/ahello.rel
$(call mb_sdcc_link_asm_bdos,$<,$@)
$(call mb_make_call_eval,mb_tool_sdcc_flow_bdos_mono,$(AHELLO_SDCC_BIN),$(AHELLO_SDCC_SRC),ahello)
$(call mb_make_call_eval,mb_assert_flow_bdos_grep,$(AHELLO_SDCC_BIN),check-sdcc,ahello,SDCC)
$(call mb_make_call_eval,mb_assert_flow_bdos_grep,$(AHELLO_SDCC_BIN),check-hell,ahello,Hell)
$(AHELLO_SDCC_BIN)/ahello.com: $(AHELLO_SDCC_BIN)/ahello.hex
$(call mb_sdcc_hex2bin,$<,$@)
MB_DOC_FIRE_TARGET += $(call mb_doc_target,$(AHELLO_SDCC_BIN)/ahello.com,"Compiles hello world with sdcc.")
$(AHELLO_SDCC_BIN)/@run: | $(AHELLO_SDCC_BIN)/ahello.com
$(call mb_msxpipe_run_gui,$(AHELLO_SDCC_BIN))
MB_DOC_FIRE_TARGET += $(call mb_doc_target,$(AHELLO_SDCC_BIN)/@run,"Run the compiled hello world from sdcc.")
.PHONY: $(AHELLO_SDCC_BIN)/@run

View file

@ -1,26 +1,34 @@
DIST_QA_DOS1_MOD := dist-qa-dos1
DIST_QA_DOS1_SRC := $(PATH_SRC)/$(DIST_QA_DOS1_MOD)
DIST_QA_DOS1_BIN := $(PATH_BIN)/$(DIST_QA_DOS1_MOD)
DIST_QA_DOS1_DEPS := $(subst dist,$(DIST_QA_DOS1_MOD),$(DIST_DEPS))
$(DIST_QA_DOS1_BIN): | $(PATH_BIN)/@prepare
DIST_QA_DOS1_SRC := $(call mb_make_call,mb_proj_module_path_src,$(PATH_SRC))
DIST_QA_DOS1_BIN := $(call mb_make_call,mb_proj_module_path_bin,$(PATH_SRC),$(PATH_BIN))
DIST_QA_DOS1_DEPS := $(call mb_make_call,mb_proj_module_local_deps,$(DIST_QA_DOS1_BIN),$(DIST_DEPS))
$(DIST_QA_DOS1_BIN): | @init
$(call mb_mkdir,$(DIST_QA_DOS1_BIN))
$(call mb_msxhub_get_msxdos1_boot,$(DIST_QA_DOS1_BIN))
$(DIST_QA_DOS1_BIN)/%: $(DIST_BIN)/% | $(DIST_QA_DOS1_BIN) $(DIST_DEPS)
$(call mb_copy,$<,$@)
$(DIST_QA_DOS1_BIN)/@run: | $(DIST_QA_DOS1_DEPS)
$(call mb_msxpipe_run_gui,$(DIST_QA_DOS1_BIN))
MB_DOC_FIRE_TARGET += $(call mb_doc_target,$(DIST_QA_DOS1_BIN)/@run,"Run binaries on msxdos1 machine.")
MB_PROJ_PHASE_RUN_DEPS += $(DIST_QA_DOS1_BIN)/@run
.PHONY: $(DIST_QA_DOS1_BIN)/@run
$(DIST_QA_DOS1_BIN)/@assert: | $(DIST_QA_DOS1_DEPS)
$(call mb_autoexec_write_default,$(DIST_QA_DOS1_BIN))
$(call mb_autoexec_append_safe_test,$(DIST_QA_DOS1_BIN),ahello1)
$(call mb_autoexec_append_safe_test,$(DIST_QA_DOS1_BIN),ahello2)
$(call mb_autoexec_append_exit,$(DIST_QA_DOS1_BIN))
$(call mb_openmsx_dosctl,$(DIST_QA_DOS1_BIN))
$(call mb_make_call,mb_make_echo_assert,Assert succes $(DIST_QA_DOS1_BIN)/@assert)
MB_DOC_FIRE_TARGET += $(call mb_doc_target,$(DIST_QA_DOS1_BIN)/@assert,"Assert binaries on msxdos1.")
MB_PROJ_PHASE_PACKAGE_QA_DEPS += $(DIST_QA_DOS1_BIN)/@assert
.PHONY: $(DIST_QA_DOS1_BIN)/@assert

View file

@ -1,21 +1,26 @@
DIST_QA_DOS2_MOD := dist-qa-dos2
DIST_QA_DOS2_SRC := $(PATH_SRC)/$(DIST_QA_DOS2_MOD)
DIST_QA_DOS2_BIN := $(PATH_BIN)/$(DIST_QA_DOS2_MOD)
DIST_QA_DOS2_DEPS := $(subst dist,$(DIST_QA_DOS2_MOD),$(DIST_DEPS))
$(DIST_QA_DOS2_BIN): | $(PATH_BIN)/@prepare
DIST_QA_DOS2_SRC := $(call mb_make_call,mb_proj_module_path_src,$(PATH_SRC))
DIST_QA_DOS2_BIN := $(call mb_make_call,mb_proj_module_path_bin,$(PATH_SRC),$(PATH_BIN))
DIST_QA_DOS2_DEPS := $(call mb_make_call,mb_proj_module_local_deps,$(DIST_QA_DOS2_BIN),$(DIST_DEPS))
$(DIST_QA_DOS2_BIN): | @init
$(call mb_mkdir,$(DIST_QA_DOS2_BIN))
$(call mb_msxhub_get_msxdos2_boot,$(DIST_QA_DOS2_BIN))
$(DIST_QA_DOS2_BIN)/%: $(DIST_BIN)/% | $(DIST_QA_DOS2_BIN) $(DIST_DEPS)
$(call mb_copy,$<,$@)
$(DIST_QA_DOS2_BIN)/@run: | $(DIST_QA_DOS2_DEPS)
$(call mb_msxpipe_run_gui,$(DIST_QA_DOS2_BIN))
MB_DOC_FIRE_TARGET += $(call mb_doc_target,$(DIST_QA_DOS2_BIN)/@run,"Run binaries on msxdos2 machine.")
MB_PROJ_PHASE_RUN_DEPS += $(DIST_QA_DOS2_BIN)/@run
.PHONY: $(DIST_QA_DOS2_BIN)/@run
$(DIST_QA_DOS2_BIN)/@assert: | $(DIST_QA_DOS2_DEPS)
$(call mb_delete,$(DIST_QA_DOS2_BIN)/ahello1.out)
$(call mb_delete,$(DIST_QA_DOS2_BIN)/ahello2.out)
@ -24,7 +29,10 @@ $(DIST_QA_DOS2_BIN)/@assert: | $(DIST_QA_DOS2_DEPS)
$(call mb_autoexec_append_safe_test,$(DIST_QA_DOS2_BIN),ahello2 > ahello2.out)
$(call mb_autoexec_append_exit,$(DIST_QA_DOS2_BIN))
$(call mb_openmsx_dosctl,$(DIST_QA_DOS2_BIN))
grep "M80: Hello world..." $(DIST_QA_DOS2_BIN)/ahello1.out
grep "SDCC: Hello world..." $(DIST_QA_DOS2_BIN)/ahello2.out
grep -q "M80: Hello world..." $(DIST_QA_DOS2_BIN)/ahello1.out
grep -q "SDCC: Hello world..." $(DIST_QA_DOS2_BIN)/ahello2.out
$(call mb_make_call,mb_make_echo_assert,Assert succes $(DIST_QA_DOS2_BIN)/@assert)
MB_DOC_FIRE_TARGET += $(call mb_doc_target,$(DIST_QA_DOS2_BIN)/@assert,"Assert binaries on msxdos2.")
MB_PROJ_PHASE_PACKAGE_QA_DEPS += $(DIST_QA_DOS2_BIN)/@assert
.PHONY: $(DIST_QA_DOS2_BIN)/@assert

View file

@ -1,23 +1,28 @@
DIST_QA_MSX1_MACHINE ?= Canon_V-20
MB_DOC_FIRE_VARIABLE += $(call mb_make_call,mb_doc_variable,DIST_QA_MSX1_MACHINE,"The machine to run the $(DIST_QA_MSX1_MOD) module.")
DIST_QA_MSX1_MOD := dist-qa-msx1
DIST_QA_MSX1_SRC := $(PATH_SRC)/$(DIST_QA_MSX1_MOD)
DIST_QA_MSX1_BIN := $(PATH_BIN)/$(DIST_QA_MSX1_MOD)
DIST_QA_MSX1_DEPS := $(subst dist,$(DIST_QA_MSX1_MOD),$(DIST_DEPS))
DIST_QA_MSX1_SRC := $(call mb_make_call,mb_proj_module_path_src,$(PATH_SRC))
DIST_QA_MSX1_BIN := $(call mb_make_call,mb_proj_module_path_bin,$(PATH_SRC),$(PATH_BIN))
DIST_QA_MSX1_DEPS := $(call mb_make_call,mb_proj_module_local_deps,$(DIST_QA_MSX1_BIN),$(DIST_DEPS))
$(DIST_QA_MSX1_BIN): | $(PATH_BIN)/@prepare
$(DIST_QA_MSX1_BIN): | @init
$(call mb_make_call,mb_mkdir,$(DIST_QA_MSX1_BIN))
$(DIST_QA_MSX1_BIN)/%: $(DIST_BIN)/% | $(DIST_QA_MSX1_BIN) $(DIST_DEPS)
$(call mb_make_call,mb_copy,$<,$@)
$(DIST_QA_MSX1_BIN)/@run: | $(DIST_QA_MSX1_DEPS)
$(call mb_make_call,mb_msxpipe_run_gui,$(DIST_QA_MSX1_BIN),,$(DIST_QA_MSX1_MACHINE))
MB_DOC_FIRE_TARGET += $(call mb_make_call,mb_doc_target,$(DIST_QA_MSX1_BIN)/@run,"Run binaries on MSX1 machine.")
MB_PROJ_PHASE_RUN_DEPS += $(DIST_QA_MSX1_BIN)/@run
.PHONY: $(DIST_QA_MSX1_BIN)/@run
$(DIST_QA_MSX1_BIN)/@assert: | $(DIST_QA_MSX1_DEPS)
$(call mb_make_call,mb_delete,$(DIST_QA_MSX1_BIN)/ahello1.out)
$(call mb_make_call,mb_delete,$(DIST_QA_MSX1_BIN)/ahello2.out)
@ -26,7 +31,10 @@ $(DIST_QA_MSX1_BIN)/@assert: | $(DIST_QA_MSX1_DEPS)
$(call mb_make_call,mb_autoexec_append_safe_test,$(DIST_QA_MSX1_BIN),ahello2 > ahello2.out,66,99)
$(call mb_make_call,mb_autoexec_append_exit,$(DIST_QA_MSX1_BIN))
$(call mb_make_call,mb_openmsx_dosctl,$(DIST_QA_MSX1_BIN),$(DIST_QA_MSX1_MACHINE))
grep "M80: Hello world..." $(DIST_QA_MSX1_BIN)/ahello1.out
grep "SDCC: Hello world..." $(DIST_QA_MSX1_BIN)/ahello2.out
grep -q "M80: Hello world..." $(DIST_QA_MSX1_BIN)/ahello1.out
grep -q "SDCC: Hello world..." $(DIST_QA_MSX1_BIN)/ahello2.out
$(call mb_make_call,mb_make_echo_assert,Assert succes $(DIST_QA_MSX1_BIN)/@assert)
MB_DOC_FIRE_TARGET += $(call mb_make_call,mb_doc_target,$(DIST_QA_MSX1_BIN)/@assert,"Assert binaries on MSX1 machine.")
MB_PROJ_PHASE_PACKAGE_QA_DEPS += $(DIST_QA_MSX1_BIN)/@assert
.PHONY: $(DIST_QA_MSX1_BIN)/@assert

View file

@ -1,13 +1,14 @@
DIST_QA_MSXHUB_MACHINE ?= Boosted_MSX2+_JP
MB_DOC_FIRE_VARIABLE += $(call mb_make_call,mb_doc_variable,DIST_QA_MSXHUB_MACHINE,"The machine to run the $(DIST_QA_MSXHUB_MOD) module.")
DIST_QA_MSXHUB_MOD := dist-qa-msxhub
DIST_QA_MSXHUB_SRC := $(PATH_SRC)/$(DIST_QA_MSXHUB_MOD)
DIST_QA_MSXHUB_BIN := $(PATH_BIN)/$(DIST_QA_MSXHUB_MOD)
DIST_QA_MSXHUB_DEPS := $(subst dist,$(DIST_QA_MSXHUB_MOD),$(DIST_DEPS))
DIST_QA_MSXHUB_SRC := $(call mb_make_call,mb_proj_module_path_src,$(PATH_SRC))
DIST_QA_MSXHUB_BIN := $(call mb_make_call,mb_proj_module_path_bin,$(PATH_SRC),$(PATH_BIN))
DIST_QA_MSXHUB_DEPS := $(call mb_make_call,mb_proj_module_local_deps,$(DIST_QA_MSXHUB_BIN),$(DIST_DEPS))
$(DIST_QA_MSXHUB_BIN): | $(PATH_BIN)/@prepare
$(DIST_QA_MSXHUB_BIN): | @init
$(call mb_make_call,mb_mkdir,$(DIST_QA_MSXHUB_BIN))
$(call mb_make_call,mb_mkdir,$(DIST_QA_MSXHUB_BIN)/utils)
$(call mb_make_call,mb_msxhub_get_msxdos2_utils,$(DIST_QA_MSXHUB_BIN)/utils)
@ -32,14 +33,18 @@ $(DIST_QA_MSXHUB_BIN): | $(PATH_BIN)/@prepare
$(call mb_make_call,mb_msxhub_get_msxdos2t,$(DIST_QA_MSXHUB_BIN)/utils)
$(call mb_make_call,mb_msxhub_get_gfxage,$(DIST_QA_MSXHUB_BIN)/utils)
$(DIST_QA_MSXHUB_BIN)/%: $(DIST_BIN)/% | $(DIST_QA_MSXHUB_BIN) $(DIST_DEPS)
$(call mb_make_call,mb_copy,$<,$@)
$(DIST_QA_MSXHUB_BIN)/@run: | $(DIST_QA_MSXHUB_DEPS)
$(call mb_make_call,mb_msxpipe_run_gui,$(DIST_QA_MSXHUB_BIN),,$(DIST_QA_MSXHUB_MACHINE))
MB_DOC_FIRE_TARGET += $(call mb_make_call,mb_doc_target,$(DIST_QA_MSXHUB_BIN)/@run,"Run the dist with all msxhub packages.")
MB_PROJ_PHASE_RUN_DEPS += $(DIST_QA_MSXHUB_BIN)/@run
.PHONY: $(DIST_QA_MSXHUB_BIN)/@run
$(DIST_QA_MSXHUB_BIN)/@assert: | $(DIST_QA_MSXHUB_DEPS)
$(call mb_make_call,mb_delete,$(DIST_QA_MSXHUB_BIN)/ahello1.out)
$(call mb_make_call,mb_delete,$(DIST_QA_MSXHUB_BIN)/ahello2.out)
@ -50,9 +55,12 @@ $(DIST_QA_MSXHUB_BIN)/@assert: | $(DIST_QA_MSXHUB_DEPS)
$(call mb_make_call,mb_autoexec_append_safe_test,$(DIST_QA_MSXHUB_BIN),dir utils > utils.out)
$(call mb_make_call,mb_autoexec_append_exit,$(DIST_QA_MSXHUB_BIN))
$(call mb_make_call,mb_openmsx_dosctl,$(DIST_QA_MSXHUB_BIN),$(DIST_QA_MSXHUB_MACHINE))
grep "M80: Hello world..." $(DIST_QA_MSXHUB_BIN)/ahello1.out
grep "SDCC: Hello world..." $(DIST_QA_MSXHUB_BIN)/ahello2.out
grep "KONPASS COM" $(DIST_QA_MSXHUB_BIN)/utils.out
grep "MAKE COM" $(DIST_QA_MSXHUB_BIN)/utils.out
grep -q "M80: Hello world..." $(DIST_QA_MSXHUB_BIN)/ahello1.out
grep -q "SDCC: Hello world..." $(DIST_QA_MSXHUB_BIN)/ahello2.out
grep -q "KONPASS COM" $(DIST_QA_MSXHUB_BIN)/utils.out
grep -q "MAKE COM" $(DIST_QA_MSXHUB_BIN)/utils.out
$(call mb_make_call,mb_make_echo_assert,Assert succes $(DIST_QA_MSXHUB_BIN)/@assert)
MB_DOC_FIRE_TARGET += $(call mb_make_call,mb_doc_target,$(DIST_QA_MSXHUB_BIN)/@assert,"Asserts that all dist artifacts execute results.")
MB_PROJ_PHASE_TEST_DEPS += $(DIST_QA_MSXHUB_BIN)/@assert
.PHONY: $(DIST_QA_MSXHUB_BIN)/@assert

3
src/dist/0module.mk vendored
View file

@ -5,7 +5,7 @@ DIST_BIN := $(PATH_BIN)/$(DIST_MOD)
DIST_OUT := $(PATH_BIN)/$(DIST_MOD).tar.gz
DIST_DEPS := $(DIST_BIN)/readme.txt $(DIST_BIN)/ahello1.com $(DIST_BIN)/ahello2.com
$(DIST_BIN): | $(PATH_BIN)/@prepare
$(DIST_BIN): | @init
$(call mb_mkdir,$(DIST_BIN))
$(DIST_BIN)/readme.txt: $(DIST_SRC)/readme.txt | $(DIST_BIN)
@ -24,3 +24,4 @@ MB_DOC_FIRE_TARGET += $(call mb_doc_target,$(DIST_BIN)/@prepare,"Prepare folder
$(DIST_OUT): | $(DIST_BIN)/@prepare
$(call mb_create_dist,$(DIST_BIN),$@)
MB_DOC_FIRE_TARGET += $(call mb_doc_target,$(DIST_OUT),"Build archive distribution artifact.")
MB_PROJ_PHASE_PACKAGE_DEPS += $(DIST_OUT)

View file

@ -1,31 +1,34 @@
MAKE_ON_MSX_MOD := make-on-msx
MAKE_ON_MSX_SRC := $(PATH_SRC)/$(MAKE_ON_MSX_MOD)
MAKE_ON_MSX_BIN := $(PATH_BIN)/$(MAKE_ON_MSX_MOD)
MAKE_ON_MSX_SRC := $(call mb_make_call,mb_proj_module_path_src,$(PATH_SRC))
MAKE_ON_MSX_BIN := $(call mb_make_call,mb_proj_module_path_bin,$(PATH_SRC),$(PATH_BIN))
$(MAKE_ON_MSX_BIN): | $(PATH_BIN)/@prepare
$(MAKE_ON_MSX_BIN): | @init
$(call mb_make_call,mb_mkdir,$(MAKE_ON_MSX_BIN))
$(call mb_make_call,mb_mkdir,$(MAKE_ON_MSX_BIN)/utils)
$(call mb_make_call,mb_msxhub_get_make,$(MAKE_ON_MSX_BIN)/utils)
$(call mb_make_call,mb_msxhub_get_macro80,$(MAKE_ON_MSX_BIN)/utils)
$(call mb_make_call,mb_msxhub_get_z80asmuk,$(MAKE_ON_MSX_BIN)/utils)
MB_DOC_FIRE_TARGET_DEEP += $(call mb_make_call,mb_doc_target_deep,$(MAKE_ON_MSX_BIN))
.PHONY: $(MAKE_ON_MSX_BIN)
$(MAKE_ON_MSX_BIN)/nfbsshot.mac: $(MAKE_ON_MSX_SRC)/nfbsshot.mac | $(MAKE_ON_MSX_BIN)
$(call mb_make_call,mb_conv_unix2dos,$<,$@)
MB_DOC_FIRE_TARGET_DEEP += $(call mb_make_call,mb_doc_target_deep,$(MAKE_ON_MSX_BIN)/nfbsshot.mac)
MB_PROJ_PHASE_PROCESS_DEPS += $(MAKE_ON_MSX_BIN)/nfbsshot.mac
$(MAKE_ON_MSX_BIN)/nfbsshot.mf: $(MAKE_ON_MSX_SRC)/nfbsshot.mf | $(MAKE_ON_MSX_BIN)/nfbsshot.mac
$(MAKE_ON_MSX_BIN)/nfbsshot.mf: $(MAKE_ON_MSX_SRC)/nfbsshot.mf $(MAKE_ON_MSX_BIN)/nfbsshot.mac
$(call mb_make_call,mb_conv_unix2dos,$<,$@)
MB_DOC_FIRE_TARGET_DEEP += $(call mb_make_call,mb_doc_target_deep,$(MAKE_ON_MSX_BIN)/nfbsshot.mf)
MB_PROJ_PHASE_PROCESS_DEPS += $(MAKE_ON_MSX_BIN)/nfbsshot.mf
$(MAKE_ON_MSX_BIN)/build.bat: $(MAKE_ON_MSX_SRC)/build.bat | $(MAKE_ON_MSX_BIN)/nfbsshot.mf
$(MAKE_ON_MSX_BIN)/build.bat: $(MAKE_ON_MSX_SRC)/build.bat $(MAKE_ON_MSX_BIN)/nfbsshot.mf
$(call mb_make_call,mb_conv_unix2dos,$<,$@)
MB_DOC_FIRE_TARGET_DEEP += $(call mb_make_call,mb_doc_target_deep,$(MAKE_ON_MSX_BIN)/build.bat)
MB_PROJ_PHASE_PROCESS_DEPS += $(MAKE_ON_MSX_BIN)/build.bat
$(MAKE_ON_MSX_BIN)/nfbsshot.bin: $(MAKE_ON_MSX_BIN)/build.bat
@ -35,17 +38,21 @@ MB_DOC_FIRE_TARGET_DEEP += $(call mb_make_call,mb_doc_target_deep,$(MAKE_ON_MSX_
$(MAKE_ON_MSX_BIN)/@build: $(MAKE_ON_MSX_BIN)/nfbsshot.bin
MB_DOC_FIRE_TARGET += $(call mb_make_call,mb_doc_target,$(MAKE_ON_MSX_BIN)/@build,"Compiles binary with make on msx.")
MB_PROJ_PHASE_BUILD_DEPS +=$(MAKE_ON_MSX_BIN)/@build
.PHONY: $(MAKE_ON_MSX_BIN)/@build
$(MAKE_ON_MSX_BIN)/@run: $(MAKE_ON_MSX_BIN)/@build
$(call mb_make_call,mb_msxpipe_run_gui,$(MAKE_ON_MSX_BIN))
MB_DOC_FIRE_TARGET += $(call mb_make_call,mb_doc_target,$(MAKE_ON_MSX_BIN)/@run,"Run the make build manually.")
MB_PROJ_PHASE_RUN_DEPS += $(MAKE_ON_MSX_BIN)/@run
.PHONY: $(MAKE_ON_MSX_BIN)/@run
$(MAKE_ON_MSX_BIN)/@assert: $(MAKE_ON_MSX_BIN)/@build
grep -U "screenshot" $(MAKE_ON_MSX_BIN)/nfbsshot.bin
MB_DOC_FIRE_TARGET += $(call mb_make_call,mb_doc_target,$(MAKE_ON_MSX_BIN)/@assert,"Asserts that binary contains screenshot string.")
MB_DEP_ALL_ASSERT += $(MAKE_ON_MSX_BIN)/@assert
.PHONY: $(MAKE_ON_MSX_BIN)/@assert
$(call mb_make_call_eval,mb_assert_flow_grep_binary,$(MAKE_ON_MSX_BIN),check-bin,nfbsshot.bin,screenshot)
#$(MAKE_ON_MSX_BIN)/@assert-check-bin: $(MAKE_ON_MSX_BIN)/@build
# grep -U "screenshot" $(MAKE_ON_MSX_BIN)/nfbsshot.bin
#MB_DOC_FIRE_TARGET += $(call mb_make_call,mb_doc_target,$(MAKE_ON_MSX_BIN)/@assert-check-bin,"Asserts that binary contains screenshot string.")
#MB_PROJ_PHASE_TEST_DEPS += $(MAKE_ON_MSX_BIN)/@assert-check-bin
#.PHONY: $(MAKE_ON_MSX_BIN)/@assert-check-bin

View file

@ -1,22 +0,0 @@
MBBOOT80_TEST_MOD := mbboot80-test
MBBOOT80_TEST_SRC := $(PATH_SRC)/$(MBBOOT80_TEST_MOD)
MBBOOT80_TEST_BIN := $(PATH_BIN)/$(MBBOOT80_TEST_MOD)
$(MBBOOT80_TEST_BIN): | $(PATH_BIN)/@prepare
$(call mb_mkdir,$(MBBOOT80_TEST_BIN))
$(MBBOOT80_TEST_BIN)/mbboot80.com: $(MBBOOT80_BIN)/mbboot80.com | $(MBBOOT80_TEST_BIN)
$(call mb_copy,$<,$@)
$(MBBOOT80_TEST_BIN)/@run: | $(MBBOOT80_TEST_BIN)/mbboot80.com
$(call mb_msxpipe_run_gui,$(MBBOOT80_TEST_BIN))
MB_DOC_FIRE_TARGET += $(call mb_doc_target,$(MBBOOT80_TEST_BIN)/@run,"Run binaries from mbboot80.")
.PHONY: $(MBBOOT80_TEST_BIN)/@run
$(MBBOOT80_TEST_BIN)/@assert: | $(MBBOOT80_TEST_BIN)/mbboot80.com
$(call mb_delete,$(MBBOOT80_TEST_BIN)/ahello.out)
$(call mb_msxpipe_safe_test,$(MBBOOT80_TEST_BIN),mbboot80 > mbboot80.out)
grep "mb::boot mode 80" $(MBBOOT80_TEST_BIN)/mbboot80.out
MB_DOC_FIRE_TARGET += $(call mb_doc_target,$(MBBOOT80_TEST_BIN)/@assert,"Assert binaries from mbboot80.")
.PHONY: $(MBBOOT80_TEST_BIN)/@assert

View file

@ -1,37 +1,15 @@
MBBOOT80_MOD := mbboot80
MBBOOT80_SRC := $(PATH_SRC)/$(MBBOOT80_MOD)
MBBOOT80_BIN := $(PATH_BIN)/$(MBBOOT80_MOD)
$(MBBOOT80_BIN): | $(PATH_BIN)/@prepare
$(call mb_mkdir,$(MBBOOT80_BIN))
$(MBBOOT80_BIN)/%.rel: $(MBBOOT80_SRC)/%.asm | $(MBBOOT80_BIN)
$(call mb_sdcc_compile_asm,$<,$@)
$(MBBOOT80_BIN)/mbboot80.hex: $(MBBOOT80_BIN)/mbboot80.rel
$(call mb_sdcc_link_asm_bdos,$<,$@)
$(MBBOOT80_BIN)/mbboot80.com: $(MBBOOT80_BIN)/mbboot80.hex
$(call mb_sdcc_hex2bin,$<,$@)
MB_DOC_FIRE_TARGET += $(call mb_doc_target,$(MBBOOT80_BIN)/mbboot80.com,"Compiles mbboot80.")
$(MBBOOT80_BIN)/@run: | $(MBBOOT80_BIN)/mbboot80.com
$(call mb_msxpipe_run_gui,$(MBBOOT80_BIN))
MB_DOC_FIRE_TARGET += $(call mb_doc_target,$(MBBOOT80_BIN)/@run,"Run the compiled mbboot80.")
.PHONY: $(MBBOOT80_BIN)/@run
#$(eval $(call mb_make_call,mb_flow_sdcc_asm_bdos_mono,$(PATH_BIN)/@prepare,$(MBBOOT80_BIN),$(MBBOOT80_SRC),$(MBBOOT80_MOD)))
MBBOOT80_SRC := $(call mb_make_call,mb_proj_module_path_src,$(PATH_SRC))
MBBOOT80_BIN := $(call mb_make_call,mb_proj_module_path_bin,$(PATH_SRC),$(PATH_BIN))
$(MBBOOT80_BIN)/@assert: | $(MBBOOT80_BIN)/$(MBBOOT80_MOD).com
$(call mb_delete,$(MBBOOT80_BIN)/$(MBBOOT80_MOD).out)
$(call mb_msxpipe_safe_test,$(MBBOOT80_BIN),$(MBBOOT80_MOD) > $(MBBOOT80_MOD).out)
grep "mb::boot mode 80" $(MBBOOT80_BIN)/$(MBBOOT80_MOD).out
MB_DOC_FIRE_TARGET += $(call mb_make_call,mb_doc_target,$(MBBOOT80_BIN)/@assert,"Assert binaries from mbboot80.")
.PHONY: $(MBBOOT80_BIN)/@assert
$(MBBOOT80_BIN)/@release-local: | $(MBBOOT80_BIN)/@assert
$(call mb_make_call_eval,mb_tool_sdcc_flow_bdos_mono,$(MBBOOT80_BIN),$(MBBOOT80_SRC),mbboot80)
$(call mb_make_call_eval,mb_assert_flow_bdos_grep,$(MBBOOT80_BIN),check-boot80,mbboot80,"mb::boot mode 80")
$(MBBOOT80_BIN)/@release-local: | $(MBBOOT80_BIN)/@build
$(call mb_copy,$(MBBOOT80_BIN)/mbboot80.com,lib/emuctl/mbboot80.com)
MB_DOC_HELP_TARGET += $(call mb_make_call,mb_doc_target,$(MBBOOT80_BIN)/@release-local,"Updates binary copy in lib/emuctl folder.")
.PHONY: $(MBBOOT80_BIN)/@release-local