Moved all file convert function to namespace.
All checks were successful
Run test asserts / Test-Asserts (push) Successful in 0s

This commit is contained in:
Willem Cazander 2024-07-06 01:09:59 +02:00
parent fd59abc810
commit 8a18cb494d
5 changed files with 20 additions and 17 deletions

13
lib/make/mb_conv.mk Normal file
View file

@ -0,0 +1,13 @@
define mb_conv_unix2dos
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
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

@ -18,6 +18,7 @@ include $(PATH_MSXBUILD)/lib/make/mb_msxhub.mk
include $(PATH_MSXBUILD)/lib/make/mb_msxpipe.mk include $(PATH_MSXBUILD)/lib/make/mb_msxpipe.mk
include $(PATH_MSXBUILD)/lib/make/mb_openmsx.mk include $(PATH_MSXBUILD)/lib/make/mb_openmsx.mk
include $(PATH_MSXBUILD)/lib/make/mb_autoexec.mk include $(PATH_MSXBUILD)/lib/make/mb_autoexec.mk
include $(PATH_MSXBUILD)/lib/make/mb_conv.mk
include $(PATH_MSXBUILD)/lib/make/mb_os.mk include $(PATH_MSXBUILD)/lib/make/mb_os.mk
# Below mb_doc.mk for white space... # Below mb_doc.mk for white space...
@ -52,17 +53,6 @@ endef
MB_DOC_FIRE_FUNCTION += $(call mb_make_call,mb_doc_function,mb_copy,"Copy an file.","<in> <out>") MB_DOC_FIRE_FUNCTION += $(call mb_make_call,mb_doc_function,mb_copy,"Copy an file.","<in> <out>")
define mb_unix2dos
unix2dos -q -n $(1) $(2)
endef
MB_DOC_FIRE_FUNCTION += $(call mb_make_call,mb_doc_function,mb_unix2dos,"Converts an unix file to dos.","<in> <out>")
define mb_dos2unix
dos2unix -q -n $(1) $(2)
endef
MB_DOC_FIRE_FUNCTION += $(call mb_make_call,mb_doc_function,mb_dos2unix,"Converts an dos file to unix.","<in> <out>")
define mb_create_dist define mb_create_dist
$(call mb_make_call,mb_make_echo_good,Creating distribution archive $(2)) $(call mb_make_call,mb_make_echo_good,Creating distribution archive $(2))

View file

@ -17,7 +17,7 @@ $(2): | $(1)
MB_DOC_FIRE_TARGET_DEEP += $$(call mb_make_call,mb_doc_target_deep,$(2)) MB_DOC_FIRE_TARGET_DEEP += $$(call mb_make_call,mb_doc_target_deep,$(2))
$(2)/$(4).mac: $(3)/$(4).mac | $(2) $(2)/$(4).mac: $(3)/$(4).mac | $(2)
$$(call mb_make_call,mb_unix2dos,$(3)/$(4).mac,$(2)/$(4).mac) $$(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) MB_DOC_FIRE_TARGET_DEEP += $$(call mb_make_call,mb_doc_target_deep,$(2)/$(4).mac)
$(2)/$(4).rel: $(2)/$(4).mac $(2)/$(4).rel: $(2)/$(4).mac
@ -63,7 +63,7 @@ $(AHELLO_M80_BIN): | $(PATH_BIN)/@prepare
$(call mb_msxhub_get_z80asmuk,$(AHELLO_M80_BIN)/utils) $(call mb_msxhub_get_z80asmuk,$(AHELLO_M80_BIN)/utils)
$(AHELLO_M80_BIN)/%.mac: $(AHELLO_M80_SRC)/%.mac | $(AHELLO_M80_BIN) $(AHELLO_M80_BIN)/%.mac: $(AHELLO_M80_SRC)/%.mac | $(AHELLO_M80_BIN)
$(call mb_unix2dos,$<,$@) $(call mb_conv_unix2dos,$<,$@)
$(AHELLO_M80_BIN)/ahello.rel: $(AHELLO_M80_BIN)/ahello.mac $(AHELLO_M80_BIN)/ahello.rel: $(AHELLO_M80_BIN)/ahello.mac
$(call mb_msxpipe_safe_cmd,$(AHELLO_M80_BIN),m80 =ahello/Z) $(call mb_msxpipe_safe_cmd,$(AHELLO_M80_BIN),m80 =ahello/Z)

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

@ -9,7 +9,7 @@ $(DIST_BIN): | $(PATH_BIN)/@prepare
$(call mb_mkdir,$(DIST_BIN)) $(call mb_mkdir,$(DIST_BIN))
$(DIST_BIN)/readme.txt: $(DIST_SRC)/readme.txt | $(DIST_BIN) $(DIST_BIN)/readme.txt: $(DIST_SRC)/readme.txt | $(DIST_BIN)
$(call mb_unix2dos,$<,$@) $(call mb_conv_unix2dos,$<,$@)
$(DIST_BIN)/ahello1.com: bin/ahello-m80/ahello.com | $(DIST_BIN) $(DIST_BIN)/ahello1.com: bin/ahello-m80/ahello.com | $(DIST_BIN)
$(call mb_copy,$<,$@) $(call mb_copy,$<,$@)

View file

@ -14,17 +14,17 @@ MB_DOC_FIRE_TARGET_DEEP += $(call mb_make_call,mb_doc_target_deep,$(MAKE_ON_MSX_
$(MAKE_ON_MSX_BIN)/nfbsshot.mac: $(MAKE_ON_MSX_SRC)/nfbsshot.mac | $(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_unix2dos,$<,$@) $(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_DOC_FIRE_TARGET_DEEP += $(call mb_make_call,mb_doc_target_deep,$(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_unix2dos,$<,$@) $(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_DOC_FIRE_TARGET_DEEP += $(call mb_make_call,mb_doc_target_deep,$(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_unix2dos,$<,$@) $(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_DOC_FIRE_TARGET_DEEP += $(call mb_make_call,mb_doc_target_deep,$(MAKE_ON_MSX_BIN)/build.bat)