Willem Cazander
567f91be78
All checks were successful
Run test asserts / Test-Asserts (push) Successful in 2s
17 lines
921 B
Makefile
17 lines
921 B
Makefile
|
|
MB_MSXHUB_API ?= https://msxhub.com/api
|
|
MB_MSXHUB_CACHE ?= $(MB_CACHE)/msxbuild/msxhub
|
|
|
|
define _mb_msxhub_file_fetch
|
|
@echo === Fetch msxhub file
|
|
$(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))),,wget -O $(MB_MSXHUB_CACHE)/$(subst $(MB_MSXHUB_API)/,,$(1)) $(1))
|
|
endef
|
|
|
|
# NOTE: with HDD import/export we get duplicate files after openMSX run, so force to lowercase.
|
|
define mb_msxhub_file
|
|
$(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
|