msxbuild/lib/make/mb_msxhub.mk

112 lines
3.9 KiB
Makefile
Raw Normal View History

2021-07-04 00:12:48 +00:00
MB_MSXHUB_API ?= https://msxhub.com/api
MB_MSXHUB_CACHE ?= $(MB_CACHE)/msxbuild/msxhub
2024-06-20 22:06:06 +00:00
define _mb_msxhub_file_fetch
2021-07-04 00:12:48 +00:00
@echo === Fetch msxhub file
2024-06-20 22:06:06 +00:00
$(if $(wildcard $(dir $(MB_MSXHUB_CACHE)/$(subst $(MB_MSXHUB_API)/,,$(1)))),,$(call mb_mkdir,$(dir $(MB_MSXHUB_CACHE)/$(subst $(MB_MSXHUB_API)/,,$(1)))))
2024-06-25 13:57:13 +00:00
$(if $(wildcard $(MB_MSXHUB_CACHE)/$(subst $(MB_MSXHUB_API)/,,$(1))),,wget -O $(MB_MSXHUB_CACHE)/$(subst $(MB_MSXHUB_API)/,,$(1)) $(1))
2021-07-04 00:12:48 +00:00
endef
# NOTE: with HDD import/export we get duplicate files after openMSX run, so force to lowercase.
2021-07-04 00:12:48 +00:00
define mb_msxhub_file
2024-06-20 22:06:06 +00:00
$(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)))))
2021-07-04 00:12:48 +00:00
endef
#
# Operating System
#
define mb_msxhub_get_dos1
$(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/2.20-1/get/MSXDOS2/MSXDOS2.SYS)
$(call mb_msxhub_file,$(1),MSXDOS2/2.20-1/get/MSXDOS2/COMMAND2.COM)
endef
define mb_msxhub_get_nextor
$(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/COMMAND2.COM)
endef
#
# Compilers
#
define mb_msxhub_get_macro80
$(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)
$(call mb_msxhub_file,$(1),Z80ASMUK/3.4-1/get/Z80ASMUK/HEXTOCOM.COM)
$(call mb_msxhub_file,$(1),Z80ASMUK/3.4-1/get/Z80ASMUK/HEXTOBIN.COM)
endef
define mb_msxhub_get_z80asmuk
$(call mb_msxhub_file,$(1),Z80ASMUK/3.4-1/get/Z80ASMUK/BINTOASM.COM)
$(call mb_msxhub_file,$(1),Z80ASMUK/3.4-1/get/Z80ASMUK/DUMP.COM)
$(call mb_msxhub_file,$(1),Z80ASMUK/3.4-1/get/Z80ASMUK/HEXTOCOM.COM)
$(call mb_msxhub_file,$(1),Z80ASMUK/3.4-1/get/Z80ASMUK/PRL.COM)
$(call mb_msxhub_file,$(1),Z80ASMUK/3.4-1/get/Z80ASMUK/PRNTOSYM.COM)
$(call mb_msxhub_file,$(1),Z80ASMUK/3.4-1/get/Z80ASMUK/RSX.COM)
$(call mb_msxhub_file,$(1),Z80ASMUK/3.4-1/get/Z80ASMUK/ZSM.COM)
$(call mb_msxhub_file,$(1),Z80ASMUK/3.4-1/get/Z80ASMUK/ZSMPP.COM)
$(call mb_msxhub_file,$(1),Z80ASMUK/3.4-1/get/Z80ASMUK/HEXTOBIN.COM)
endef
#
# Compressors
#
define mb_msxhub_get_pmarc
$(call mb_msxhub_file,$(1),PMARC/2.0-1/get/PMARC/PMARC.COM)
$(call mb_msxhub_file,$(1),PMARC/2.0-1/get/PMARC/PMCAT.COM)
$(call mb_msxhub_file,$(1),PMARC/2.0-1/get/PMARC/PMEXE2.COM)
$(call mb_msxhub_file,$(1),PMARC/2.0-1/get/PMARC/PMEXT.COM)
$(call mb_msxhub_file,$(1),PMARC/2.0-1/get/PMARC/PMSET.COM)
$(call mb_msxhub_file,$(1),PMARC/2.0-1/get/PMARC/PMSFX2.COM)
endef
define mb_msxhub_get_lhpack
$(call mb_msxhub_file,$(1),LHPACK/1.00-1/get/LHPACK/lhpack.com)
endef
define mb_msxhub_get_lhext
$(call mb_msxhub_file,$(1),LHEXT/1.34-2/get/LHEXT/lhext.com)
endef
define mb_msxhub_get_gunzip
$(call mb_msxhub_file,$(1),GUNZIP/1.1-1/get/GUNZIP/gunzip.com)
endef
define mb_msxhub_get_tunzip
$(call mb_msxhub_file,$(1),TUNZIP/0.91-1/get/TUNZIP/tunzip.com)
endef
define mb_msxhub_get_popcom
$(call mb_msxhub_file,$(1),POPCOM/1.00-2/get/POPCOM/popcom.com)
endef
#
# Tools
#
define mb_msxhub_get_turbo
$(call mb_msxhub_file,$(1),TURBO/2.1-1/get/TURBO/turbo.com)
endef
define mb_msxhub_get_baskom
$(call mb_msxhub_file,$(1),BASKOM/1.0-1/get/BASKOM/baskom.com)
endef
define mb_msxhub_get_binldr
$(call mb_msxhub_file,$(1),BINLDR/1.0.2-1/get/BINLDR/BINLDR.COM)
endef
define mb_msxhub_get_dmphex
$(call mb_msxhub_file,$(1),DMPHEX/1.00-1/get/DMPHEX/dmphex.com)
endef
#
# Graphics editors
#
define mb_msxhub_get_gfxage
$(call mb_msxhub_file,$(1),GFXAGE/0.99-1/get/GFXAGE/gfxage.com)
endef