2024-06-28 12:20:42 +00:00
|
|
|
|
|
2024-07-10 18:48:32 +00:00
|
|
|
|
MB_SDCC_PATH ?=
|
2024-07-16 17:32:08 +00:00
|
|
|
|
$(call mb-make-call,mb-doc-variable,MB_SDCC_PATH,Optional path where SDCC binaries are located.)
|
2024-07-10 12:05:38 +00:00
|
|
|
|
|
2024-07-02 02:11:13 +00:00
|
|
|
|
MB_SDCC_FLAG_CPU ?= -mz80
|
2024-07-16 17:32:08 +00:00
|
|
|
|
$(call mb-make-call,mb-doc-variable-deep,MB_SDCC_FLAG_CPU,The SDCC cpu target option.)
|
2024-07-02 01:27:14 +00:00
|
|
|
|
|
2024-07-02 02:11:13 +00:00
|
|
|
|
MB_SDCC_FLAG_LD ?= --nostdinc
|
2024-07-16 17:32:08 +00:00
|
|
|
|
$(call mb-make-call,mb-doc-variable-deep,MB_SDCC_FLAG_LD,The SDCC linker option.)
|
2024-07-02 01:27:14 +00:00
|
|
|
|
|
2024-07-02 02:11:13 +00:00
|
|
|
|
MB_SDCC_ASZ80_FLAGS ?= -g -l -c -o
|
2024-07-16 17:32:08 +00:00
|
|
|
|
$(call mb-make-call,mb-doc-variable-deep,MB_SDCC_ASZ80_FLAGS,The SDCC z80 asm compiler flags.)
|
2024-07-02 01:27:14 +00:00
|
|
|
|
|
2024-07-02 02:11:13 +00:00
|
|
|
|
MB_SDCC_CC_FLAGS ?=
|
2024-07-16 17:32:08 +00:00
|
|
|
|
$(call mb-make-call,mb-doc-variable-deep,MB_SDCC_CC_FLAGS,The SDCC C compiler flags.)
|
2024-07-02 01:27:14 +00:00
|
|
|
|
|
2024-07-02 02:11:13 +00:00
|
|
|
|
MB_SDCC_AR_FLAGS ?= -rc
|
2024-07-16 17:32:08 +00:00
|
|
|
|
$(call mb-make-call,mb-doc-variable-deep,MB_SDCC_AR_FLAGS,The SDCC module archive flags.)
|
2024-07-02 01:27:14 +00:00
|
|
|
|
|
2024-06-28 12:20:42 +00:00
|
|
|
|
|
|
|
|
|
# TODO: Add C + mixed support;
|
|
|
|
|
#$(MB_SDASM) -I$(MB_LIBASM_SRC)/include
|
|
|
|
|
#-l$(LIBASM_LINK)
|
|
|
|
|
|
2024-07-02 01:27:14 +00:00
|
|
|
|
|
2024-07-16 14:45:37 +00:00
|
|
|
|
define _mb-sdcc-path
|
2024-07-12 15:59:26 +00:00
|
|
|
|
$(MB_ᕽᕽᕽ )$(if $(MB_SDCC_PATH),$(MB_SDCC_PATH)/$(1),$(1))
|
2024-07-10 18:48:32 +00:00
|
|
|
|
endef
|
|
|
|
|
|
|
|
|
|
|
2024-07-16 14:45:37 +00:00
|
|
|
|
define mb-sdcc-compile-asm
|
|
|
|
|
$(MB_ᕽᕽᕽ )$(call mb-make-call,mb-os-echo-command,$(MB_I18N_SDCC_COMPILE) $(2) - ASM)
|
|
|
|
|
$(MB_ᕽᕽᕽ )$(call mb-make-call,_mb-sdcc-path,sdasz80) $(MB_SDCC_ASZ80_FLAGS) $(2) $(1)
|
2024-06-28 12:20:42 +00:00
|
|
|
|
endef
|
2024-07-16 17:32:08 +00:00
|
|
|
|
$(call mb-make-call,mb-doc-function,mb-sdcc-compile-asm,Compiles asm source code.,<in> <out>)
|
2024-06-28 12:20:42 +00:00
|
|
|
|
|
2024-07-02 21:18:20 +00:00
|
|
|
|
|
2024-07-16 14:45:37 +00:00
|
|
|
|
define mb-sdcc-arlib-asm
|
|
|
|
|
$(MB_ᕽᕽᕽ )$(call mb-make-call,mb-os-echo-command,$(MB_I18N_SDCC_ARLIB) $(2))
|
|
|
|
|
$(MB_ᕽᕽᕽ )$(call mb-make-call,_mb-sdcc-path,sdar) $(MB_SDCC_AR_FLAGS) $(1) $(2)
|
2024-06-28 12:20:42 +00:00
|
|
|
|
endef
|
2024-07-16 17:32:08 +00:00
|
|
|
|
$(call mb-make-call,mb-doc-function,mb-sdcc-arlib-asm,Link asm lib module.,<in> <out>)
|
2024-06-28 12:20:42 +00:00
|
|
|
|
|
2024-07-02 21:18:20 +00:00
|
|
|
|
|
2024-07-16 14:45:37 +00:00
|
|
|
|
define mb-sdcc-link-asm
|
|
|
|
|
$(MB_ᕽᕽᕽ )$(call mb-make-call,mb-os-echo-command,$(MB_I18N_SDCC_LINK) $(2) - ASM @ $(3))
|
|
|
|
|
$(MB_ᕽᕽᕽ )$(call mb-make-call,_mb-sdcc-path,sdcc) $(MB_SDCC_FLAG_CPU) $(MB_SDCC_CC_FLAGS) --no-std-crt0 --code-loc $(3) -o $(2) $(1)
|
2024-06-28 12:20:42 +00:00
|
|
|
|
endef
|
2024-07-16 17:32:08 +00:00
|
|
|
|
$(call mb-make-call,mb-doc-function,mb-sdcc-link-asm,Links asm to custom code location.,<in> <out> <code-loc>)
|
2024-07-02 01:27:14 +00:00
|
|
|
|
|
2024-07-02 21:18:20 +00:00
|
|
|
|
|
2024-07-16 14:45:37 +00:00
|
|
|
|
define mb-sdcc-link-asm-0000
|
|
|
|
|
$(MB_ᕽᕽᕽ )$(call mb-make-call,mb-sdcc-link-asm,$(1),$(2),0x0000)
|
2024-06-28 12:20:42 +00:00
|
|
|
|
endef
|
2024-07-16 17:32:08 +00:00
|
|
|
|
$(call mb-make-call,mb-doc-function,mb-sdcc-link-asm-0000,Links asm to 0x0000.,<in> <out>)
|
2024-07-02 01:27:14 +00:00
|
|
|
|
|
2024-07-02 21:18:20 +00:00
|
|
|
|
|
2024-07-16 14:45:37 +00:00
|
|
|
|
define mb-sdcc-link-asm-0100
|
|
|
|
|
$(MB_ᕽᕽᕽ )$(call mb-make-call,mb-sdcc-link-asm,$(1),$(2),0x0100)
|
2024-06-28 12:20:42 +00:00
|
|
|
|
endef
|
2024-07-16 17:32:08 +00:00
|
|
|
|
$(call mb-make-call,mb-doc-function,mb-sdcc-link-asm-0100,Links asm to 0x0100.,<in> <out>)
|
2024-07-02 01:27:14 +00:00
|
|
|
|
|
2024-07-02 21:18:20 +00:00
|
|
|
|
|
2024-07-16 14:45:37 +00:00
|
|
|
|
define mb-sdcc-link-asm-1000
|
|
|
|
|
$(MB_ᕽᕽᕽ )$(call mb-make-call,mb-sdcc-link-asm,$(1),$(2),0x1000)
|
2024-06-28 12:20:42 +00:00
|
|
|
|
endef
|
2024-07-16 17:32:08 +00:00
|
|
|
|
$(call mb-make-call,mb-doc-function,mb-sdcc-link-asm-1000,Links asm to 0x1000.,<in> <out>)
|
2024-07-02 01:27:14 +00:00
|
|
|
|
|
2024-07-02 21:18:20 +00:00
|
|
|
|
|
2024-07-16 14:45:37 +00:00
|
|
|
|
define mb-sdcc-link-asm-4000
|
|
|
|
|
$(MB_ᕽᕽᕽ )$(call mb-make-call,mb-sdcc-link-asm,$(1),$(2),0x4000)
|
2024-06-28 12:20:42 +00:00
|
|
|
|
endef
|
2024-07-16 17:32:08 +00:00
|
|
|
|
$(call mb-make-call,mb-doc-function,mb-sdcc-link-asm-4000,Links asm to 0x4000.,<in> <out>)
|
2024-07-02 01:27:14 +00:00
|
|
|
|
|
2024-07-02 21:18:20 +00:00
|
|
|
|
|
2024-07-16 14:45:37 +00:00
|
|
|
|
define mb-sdcc-link-asm-8000
|
|
|
|
|
$(MB_ᕽᕽᕽ )$(call mb-make-call,mb-sdcc-link-asm,$(1),$(2),0x8000)
|
2024-06-28 12:20:42 +00:00
|
|
|
|
endef
|
2024-07-16 17:32:08 +00:00
|
|
|
|
$(call mb-make-call,mb-doc-function,mb-sdcc-link-asm-8000,Links asm to 0x8000.,<in> <out>)
|
2024-07-02 01:27:14 +00:00
|
|
|
|
|
2024-07-02 21:18:20 +00:00
|
|
|
|
|
2024-07-16 14:45:37 +00:00
|
|
|
|
define mb-sdcc-link-asm-C000
|
|
|
|
|
$(MB_ᕽᕽᕽ )$(call mb-make-call,mb-sdcc-link-asm,$(1),$(2),0xC000)
|
2024-06-28 12:20:42 +00:00
|
|
|
|
endef
|
2024-07-16 17:32:08 +00:00
|
|
|
|
$(call mb-make-call,mb-doc-function,mb-sdcc-link-asm-C000,Links asm to 0xC000.,<in> <out>)
|
2024-07-02 01:27:14 +00:00
|
|
|
|
|
2024-07-02 21:18:20 +00:00
|
|
|
|
|
2024-07-16 14:45:37 +00:00
|
|
|
|
define mb-sdcc-link-asm-bdos
|
|
|
|
|
$(MB_ᕽᕽᕽ )$(call mb-make-call,mb-sdcc-link-asm-0100,$(1),$(2))
|
2024-06-28 12:20:42 +00:00
|
|
|
|
endef
|
2024-07-16 17:32:08 +00:00
|
|
|
|
$(call mb-make-call,mb-doc-function,mb-sdcc-link-asm-bdos,Links asm to BDOS.,<in> <out>)
|
2024-06-28 12:20:42 +00:00
|
|
|
|
|
2024-07-02 21:18:20 +00:00
|
|
|
|
|
2024-07-16 14:45:37 +00:00
|
|
|
|
define mb-sdcc-objcopy
|
|
|
|
|
$(MB_ᕽᕽᕽ )$(call mb-make-call,mb-os-echo-command,$(MB_I18N_SDCC_OBJCOPY) $(2))
|
|
|
|
|
$(MB_ᕽᕽᕽ )$(call mb-make-call,_mb-sdcc-path,sdobjcopy) -I ihex --output-target$(MB_MAKE_EQUALS)binary $(1) $(2)
|
2024-06-28 12:20:42 +00:00
|
|
|
|
endef
|
2024-07-16 17:32:08 +00:00
|
|
|
|
$(call mb-make-call,mb-doc-function,mb-sdcc-objcopy,Converts an hex file to binary.,<in> <out>)
|
2024-07-07 02:33:03 +00:00
|
|
|
|
|