2024-06-28 12:20:42 +00:00
|
|
|
|
|
|
|
MB_SDCC_FLAG_CPU ?= -mz80
|
|
|
|
MB_SDCC_FLAG_LD ?= --nostdinc
|
2024-06-28 12:26:48 +00:00
|
|
|
MB_SDCC_ASZ80_FLAGS ?= -g -l -c -o
|
2024-06-28 12:20:42 +00:00
|
|
|
MB_SDCC_CC_FLAGS ?=
|
|
|
|
MB_SDCC_AR_FLAGS ?= -rc
|
|
|
|
MB_SDCC_CC_CMD ?= $(PATH_SDCC)/sdcc
|
2024-06-28 12:26:48 +00:00
|
|
|
MB_SDCC_ASZ80_CMD ?= $(PATH_SDCC)/sdasz80
|
2024-06-28 12:20:42 +00:00
|
|
|
MB_SDCC_AR_CMD ?= $(PATH_SDCC)/sdar
|
|
|
|
MB_SDCC_OBJCOPY_CMD ?= $(PATH_SDCC)/sdobjcopy
|
|
|
|
|
|
|
|
# TODO: Add C + mixed support;
|
|
|
|
#$(MB_SDASM) -I$(MB_LIBASM_SRC)/include
|
|
|
|
#-l$(LIBASM_LINK)
|
|
|
|
|
|
|
|
define mb_sdcc_compile_asm
|
|
|
|
@echo === Compile module asm.
|
2024-06-28 12:26:48 +00:00
|
|
|
$(MB_SDCC_ASZ80_CMD) $(MB_SDCC_ASZ80_FLAGS) $(1) $(2)
|
2024-06-28 12:20:42 +00:00
|
|
|
endef
|
|
|
|
|
|
|
|
define mb_sdcc_link_asm_lib
|
|
|
|
@echo === Link module asm lib.
|
|
|
|
$(MB_SDCC_AR_CMD) $(MB_SDCC_AR_FLAGS) $(1) $(2)
|
|
|
|
endef
|
|
|
|
|
|
|
|
define mb_sdcc_link_asm
|
|
|
|
@echo === Link asm module at $(3)
|
|
|
|
$(MB_SDCC_CC_CMD) $(MB_SDCC_FLAG_CPU) $(MB_SDCC_CC_FLAGS) --no-std-crt0 --code-loc $(3) -o $(1) $(2)
|
|
|
|
endef
|
|
|
|
define mb_sdcc_link_asm_0000
|
|
|
|
$(call mb_sdcc_link_asm,$(1),$(2),0x0000)
|
|
|
|
endef
|
|
|
|
define mb_sdcc_link_asm_0100
|
|
|
|
$(call mb_sdcc_link_asm,$(1),$(2),0x0100)
|
|
|
|
endef
|
|
|
|
define mb_sdcc_link_asm_1000
|
|
|
|
$(call mb_sdcc_link_asm,$(1),$(2),0x1000)
|
|
|
|
endef
|
|
|
|
define mb_sdcc_link_asm_4000
|
|
|
|
$(call mb_sdcc_link_asm,$(1),$(2),0x4000)
|
|
|
|
endef
|
|
|
|
define mb_sdcc_link_asm_8000
|
|
|
|
$(call mb_sdcc_link_asm,$(1),$(2),0x8000)
|
|
|
|
endef
|
|
|
|
define mb_sdcc_link_asm_C000
|
|
|
|
$(call mb_sdcc_link_asm,$(1),$(2),0xC000)
|
|
|
|
endef
|
|
|
|
define mb_sdcc_link_asm_dos
|
|
|
|
$(call mb_sdcc_link_asm_0100,$(1),$(2))
|
|
|
|
endef
|
|
|
|
|
|
|
|
define mb_sdcc_hex2bin
|
|
|
|
$(MB_SDCC_OBJCOPY_CMD) -I ihex --output-target=binary $(1) $(2)
|
|
|
|
endef
|