Willem Cazander
da35583307
All checks were successful
Run test asserts / Test-Asserts (push) Successful in 3s
81 lines
3.1 KiB
Makefile
81 lines
3.1 KiB
Makefile
|
|
MB_SDCC_FLAG_CPU ?= -mz80
|
|
MB_DOC_HELP_VARIABLE += $(call mb_doc_variable,MB_SDCC_FLAG_CPU,"The SDCC cpu target option.",$(MB_SDCC_FLAG_CPU))
|
|
|
|
MB_SDCC_FLAG_LD ?= --nostdinc
|
|
MB_DOC_HELP_VARIABLE += $(call mb_doc_variable,MB_SDCC_FLAG_LD,"The SDCC linker option.",$(MB_SDCC_FLAG_LD))
|
|
|
|
MB_SDCC_ASZ80_FLAGS ?= -g -l -c -o
|
|
MB_DOC_HELP_VARIABLE += $(call mb_doc_variable,MB_SDCC_ASZ80_FLAGS,"The SDCC z80 asm compiler flags.",$(MB_SDCC_ASZ80_FLAGS))
|
|
|
|
MB_SDCC_CC_FLAGS ?=
|
|
MB_DOC_HELP_VARIABLE += $(call mb_doc_variable,MB_SDCC_CC_FLAGS,"The SDCC C compiler flags.",$(MB_SDCC_CC_FLAGS))
|
|
|
|
MB_SDCC_AR_FLAGS ?= -rc
|
|
MB_DOC_HELP_VARIABLE += $(call mb_doc_variable,MB_SDCC_AR_FLAGS,"The SDCC module archive flags.",$(MB_SDCC_AR_FLAGS))
|
|
|
|
|
|
# TODO: Add C + mixed support;
|
|
#$(MB_SDASM) -I$(MB_LIBASM_SRC)/include
|
|
#-l$(LIBASM_LINK)
|
|
|
|
|
|
define mb_sdcc_compile_asm
|
|
@echo === SDCC Compile module asm for $(2)
|
|
$(PATH_SDCC)/sdasz80 $(MB_SDCC_ASZ80_FLAGS) $(2) $(1)
|
|
endef
|
|
MB_DOC_HELP_FUNCTION += $(call mb_doc_function,mb_sdcc_compile_asm,"Compiles asm source code.","<in> <out>")
|
|
|
|
define mb_sdcc_link_asm_lib
|
|
@echo === SDCC Link module asm lib for $(2)
|
|
$(PATH_SDCC)/sdar $(MB_SDCC_AR_FLAGS) $(1) $(2)
|
|
endef
|
|
MB_DOC_HELP_FUNCTION += $(call mb_doc_function,mb_sdcc_link_asm_lib,"Link asm lib module.","<in> <out>")
|
|
|
|
define mb_sdcc_link_asm
|
|
@echo === SDCC Link asm module at $(3) for $(2)
|
|
$(PATH_SDCC)/sdcc $(MB_SDCC_FLAG_CPU) $(MB_SDCC_CC_FLAGS) --no-std-crt0 --code-loc $(3) -o $(2) $(1)
|
|
endef
|
|
MB_DOC_HELP_FUNCTION += $(call mb_doc_function,mb_sdcc_link_asm,"Links asm to custom code location.","<in> <out> <code-loc>")
|
|
|
|
define mb_sdcc_link_asm_0000
|
|
$(call mb_sdcc_link_asm,$(1),$(2),0x0000)
|
|
endef
|
|
MB_DOC_HELP_FUNCTION += $(call mb_doc_function,mb_sdcc_link_asm_0000,"Links asm to 0x0000.","<in> <out>")
|
|
|
|
define mb_sdcc_link_asm_0100
|
|
$(call mb_sdcc_link_asm,$(1),$(2),0x0100)
|
|
endef
|
|
MB_DOC_HELP_FUNCTION += $(call mb_doc_function,mb_sdcc_link_asm_0100,"Links asm to 0x0100.","<in> <out>")
|
|
|
|
define mb_sdcc_link_asm_1000
|
|
$(call mb_sdcc_link_asm,$(1),$(2),0x1000)
|
|
endef
|
|
MB_DOC_HELP_FUNCTION += $(call mb_doc_function,mb_sdcc_link_asm_1000,"Links asm to 0x1000.","<in> <out>")
|
|
|
|
define mb_sdcc_link_asm_4000
|
|
$(call mb_sdcc_link_asm,$(1),$(2),0x4000)
|
|
endef
|
|
MB_DOC_HELP_FUNCTION += $(call mb_doc_function,mb_sdcc_link_asm_4000,"Links asm to 0x4000.","<in> <out>")
|
|
|
|
define mb_sdcc_link_asm_8000
|
|
$(call mb_sdcc_link_asm,$(1),$(2),0x8000)
|
|
endef
|
|
MB_DOC_HELP_FUNCTION += $(call mb_doc_function,mb_sdcc_link_asm_8000,"Links asm to 0x8000.","<in> <out>")
|
|
|
|
define mb_sdcc_link_asm_C000
|
|
$(call mb_sdcc_link_asm,$(1),$(2),0xC000)
|
|
endef
|
|
MB_DOC_HELP_FUNCTION += $(call mb_doc_function,mb_sdcc_link_asm_C000,"Links asm to 0xC000.","<in> <out>")
|
|
|
|
define mb_sdcc_link_asm_bdos
|
|
$(call mb_sdcc_link_asm_0100,$(1),$(2))
|
|
endef
|
|
MB_DOC_HELP_FUNCTION += $(call mb_doc_function,mb_sdcc_link_asm_bdos,"Links asm to BDOS.","<in> <out>")
|
|
|
|
define mb_sdcc_hex2bin
|
|
@echo === SDCC hex2bin for $(2)
|
|
$(PATH_SDCC)/sdobjcopy -I ihex --output-target=binary $(1) $(2)
|
|
endef
|
|
MB_DOC_HELP_FUNCTION += $(call mb_doc_function,mb_sdcc_hex2bin,"Converts an hex file to binary.","<in> <out>")
|