Updated to new fetch api

This commit is contained in:
Willem Cazander 2024-06-21 00:06:06 +02:00
parent 2583b34f1c
commit d7f56563bf
3 changed files with 24 additions and 20 deletions

1
.gitignore vendored
View file

@ -3,6 +3,7 @@ syntax: glob
# Project ignores
bin
bin/**
lib/openmsx/omsxctl.tcl
# Makefile ignores
Makelocal.mk

View file

@ -9,38 +9,41 @@ define _mb_lowercase
$(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
define _mb_msxhub_fetch_file
define _mb_msxhub_file_fetch
@echo === Fetch msxhub file
$(call mb_mkdir,$(dir $(MB_MSXHUB_CACHE)/$(subst $(MB_MSXHUB_API)/,,$(1))))
test -f $(MB_MSXHUB_CACHE)/$(subst $(MB_MSXHUB_API)/,,$(1)) || $(MB_MSXHUB_WGET) -O $(MB_MSXHUB_CACHE)/$(subst $(MB_MSXHUB_API)/,,$(1)) $(1)
$(if $(wildcard $(dir $(MB_MSXHUB_CACHE)/$(subst $(MB_MSXHUB_API)/,,$(1)))),,$(call mb_mkdir,$(dir $(MB_MSXHUB_CACHE)/$(subst $(MB_MSXHUB_API)/,,$(1)))))
$(if $(wildcard $(MB_MSXHUB_CACHE)/$(subst $(MB_MSXHUB_API)/,,$(1))),,$(MB_MSXHUB_WGET) -O $(MB_MSXHUB_CACHE)/$(subst $(MB_MSXHUB_API)/,,$(1)) $(1))
endef
define mb_msxhub_file
$(if $(wildcard $(MB_MSXHUB_CACHE)/$(subst $(MB_MSXHUB_API)/,,$(2))),,$(call _mb_msxhub_fetch_file,$(2)))
$(if $(wildcard $(dir $(1))$(call _mb_lowercase,$(notdir $(1)))),,$(call mb_copy,$(MB_MSXHUB_CACHE)/$(subst $(MB_MSXHUB_API)/,,$(2)),$(dir $(1))$(call _mb_lowercase,$(notdir $(1)))))
$(if $(wildcard $(MB_MSXHUB_CACHE)/$(2)),,$(call _mb_msxhub_file_fetch,$(MB_MSXHUB_API)/$(2)))
$(if $(wildcard $(1)/$(call _mb_lowercase,$(notdir $(2)))),,$(call mb_copy,$(MB_MSXHUB_CACHE)/$(2),$(1)/$(call _mb_lowercase,$(notdir $(2)))))
$(if $(filter true,$(3)),$(call mb_copy,$(MB_MSXHUB_CACHE)/$(2),$(1)/$(call _mb_lowercase,$(notdir $(2)))))
endef
define mb_msxhub_get_dos1
$(call mb_msxhub_file,$(1)/MSXDOS.SYS,$(MB_MSXHUB_API)/MSXDOS1/1.03-1/get/MSXDOS1/msxdos.sys)
$(call mb_msxhub_file,$(1)/COMMAND.COM,$(MB_MSXHUB_API)/MSXDOS1/1.03-1/get/MSXDOS1/command.com)
$(call mb_msxhub_file,$(1),MSXDOS1/1.03-2/get/MSXDOS1/MSXDOS.SYS)
$(call mb_msxhub_file,$(1),MSXDOS1/1.03-2/get/MSXDOS1/COMMAND.COM)
endef
define mb_msxhub_get_dos2
$(call mb_msxhub_file,$(1)/MSXDOS2.SYS,$(MB_MSXHUB_API)/MSXDOS2/2.20-1/get/MSXDOS2/MSXDOS2.SYS)
$(call mb_msxhub_file,$(1)/COMMAND2.COM,$(MB_MSXHUB_API)/MSXDOS2/2.20-1/get/MSXDOS2/COMMAND2.COM)
$(call mb_msxhub_file,$(1),MSXDOS2/2.20-1/get/MSXDOS2/MSXDOS2.SYS)
#$(call mb_msxhub_file,$(1),MSXDOS2/2.20-1/get/MSXDOS2/COMMAND2.COM)
$(call mb_msxhub_file,$(1),NEXTOR/2.1.0-1/get/NEXTOR/COMMAND2.COM)
endef
define mb_msxhub_get_nextor
$(call mb_msxhub_file,$(1)/MSXDOS2.SYS,$(MB_MSXHUB_API)/MSXDOS2/2.20-1/get/MSXDOS2/MSXDOS2.SYS)
$(call mb_msxhub_file,$(1)/COMMAND2.COM,$(MB_MSXHUB_API)/MSXDOS2/2.20-1/get/MSXDOS2/COMMAND2.COM)
$(call mb_msxhub_file,$(1)/NEXTOR.SYS,$(MB_MSXHUB_API)/NEXTOR/2.1.0-1/get/NEXTOR/NEXTOR.SYS)
$(call mb_msxhub_file,$(1)/NSYSVER.COM,$(MB_MSXHUB_API)/NEXTOR/2.1.0-1/get/NEXTOR/NSYSVER.COM)
$(call mb_msxhub_file,$(1),MSXDOS2/2.20-1/get/MSXDOS2/MSXDOS2.SYS)
#$(call mb_msxhub_file,$(1),MSXDOS2/2.20-1/get/MSXDOS2/COMMAND2.COM)
$(call mb_msxhub_file,$(1),NEXTOR/2.1.0-1/get/NEXTOR/COMMAND2.COM)
$(call mb_msxhub_file,$(1),NEXTOR/2.1.0-1/get/NEXTOR/NEXTOR.SYS)
$(call mb_msxhub_file,$(1),NEXTOR/2.1.0-1/get/NEXTOR/NSYSVER.COM)
endef
define mb_msxhub_get_macro80
$(call mb_msxhub_file,$(1)/CREF80.COM,$(MB_MSXHUB_API)/MACRO80/2.0-1/get/MACRO80/CREF80.COM)
$(call mb_msxhub_file,$(1)/L80.COM,$(MB_MSXHUB_API)/MACRO80/2.0-1/get/MACRO80/L80.COM)
$(call mb_msxhub_file,$(1)/LIB80.COM,$(MB_MSXHUB_API)/MACRO80/2.0-1/get/MACRO80/LIB80.COM)
$(call mb_msxhub_file,$(1)/M80.COM,$(MB_MSXHUB_API)/MACRO80/2.0-1/get/MACRO80/M80.COM)
$(call mb_msxhub_file,$(1),MACRO80/2.0-1/get/MACRO80/CREF80.COM)
$(call mb_msxhub_file,$(1),MACRO80/2.0-1/get/MACRO80/L80.COM)
$(call mb_msxhub_file,$(1),MACRO80/2.0-1/get/MACRO80/LIB80.COM)
$(call mb_msxhub_file,$(1),MACRO80/2.0-1/get/MACRO80/M80.COM)
endef

View file

@ -13,7 +13,7 @@ MB_OPENMSX_ARGS = \
-script $(PATH_MSXBUILD_REAL)/lib/openmsx/boot_env.tcl \
-script $(PATH_MSXBUILD_REAL)/lib/openmsx/boot_hdd.tcl \
-script $(PATH_MSXBUILD_REAL)/lib/openmsx/fail_after.tcl \
-script $(MB_MSXHUB_CACHE)/OMSXCTL/1.0-1/get/OMSXCTL/omsxctl.tcl
-script $(PATH_MSXBUILD_REAL)/lib/openmsx/omsxctl.tcl
# TODO: add run flag to disable xml output like "-control stdio-boot-only"
ifeq ($(OS),Windows_NT)
@ -23,7 +23,7 @@ else
endif
define _mb_openmsx_run
@echo === Running openMSX
$(if $(wildcard $(MB_MSXHUB_CACHE)/OMSXCTL/1.0-1/get/OMSXCTL/omsxctl.tcl),,$(call _mb_msxhub_fetch_file,$(MB_MSXHUB_API)/OMSXCTL/1.0-1/get/OMSXCTL/omsxctl.tcl))
$(call mb_msxhub_file,$(PATH_MSXBUILD_REAL)/lib/openmsx,OMSXCTL/1.0-1/get/OMSXCTL/omsxctl.tcl)
FAIL_AFTER_BOOT=$(MB_OPENMSX_BOOT_TIMEOUT) \
FAIL_AFTER_PATH=bin \
BOOT_HDD_PATH="$(1)" \
@ -34,7 +34,7 @@ define _mb_openmsx_run
endef
define _mb_openmsx_run_dos
$(call mb_msxhub_file,$(1)/omsxctl.com,$(MB_MSXHUB_API)/OMSXCTL/1.0-1/get/OMSXCTL/omsxctl.com)
$(call mb_msxhub_file,$(1),OMSXCTL/1.0-1/get/OMSXCTL/omsxctl.com)
$(call _mb_openmsx_run,$(1))
endef