Files
2023-03-13 08:36:51 +00:00

68 lines
2.6 KiB
Makefile

ifeq ($(MCU),JK1) # 1.5KFlash, 128 Byte RAM
CODE_LOC = --code-loc 0xF600
DATA_LOC = --data-loc 0x80
STACK_LOC = --stack-loc 0xFF
else ifeq ($(MCU),JL3) # 4KFlash, 128 Byte RAM
CODE_LOC = --code-loc 0xEC00
DATA_LOC = --data-loc 0x80
STACK_LOC = --stack-loc 0xFF
else ifeq ($(MCU),JL16) # 16KFlash, 512 Byte RAM
CODE_LOC = --code-loc 0xBC00
DATA_LOC = --data-loc 0x60
STACK_LOC = --stack-loc 0x025F
else ifeq ($(MCU),JB16) # 16KFlash, 384 Byte RAM
CODE_LOC = --code-loc 0xBA00
DATA_LOC = --data-loc 0x80
STACK_LOC = --stack-loc 0x01FF
else ifeq ($(MCU),GR8) # 8KFlash, 384 Byte RAM
CODE_LOC = --code-loc 0xE000
DATA_LOC = --data-loc 0x40
STACK_LOC = --stack-loc 0x01BF
else ifeq ($(MCU),EY16) # 16KFlash, 512 Byte RAM
CODE_LOC = --code-loc 0xC000
DATA_LOC = --data-loc 0x40
STACK_LOC = --stack-loc 0x023F
else
.PHONY: nochip
nochip:
@echo '============= ERROR ==============='
@echo 'No known target chip specified.'
@echo
@echo 'Please edit the Makefile.'
@exit 1
endif
build:
@echo --- Compiling ---
sdcc -mhc08 --model-small $(CODE_LOC) $(DATA_LOC) $(STACK_LOC) --stack-auto --out-fmt-s19 $(TARGET).c
#@cp $(TARGET).s37 $(TARGET).s19
@echo --- Memory Usage ---
@size -A -x $(TARGET).s19
program: build
monitor-68HC08 -z $(BUS_SPEED) -c 908$(MCU) -d /dev/ttyUSB0 -r 9600 -e -VV -f -s ../pgm_script
#CLEANEXT = .asm .cdb .lk .lst .map .rel .rst .s19 .s37 .sym
#CLEANPRG = $(foreach p,$(TARGET),$(patsubst %,$p%,$(CLEANEXT)))
clean:
@echo --- Cleaning ---
# -rm $(CLEANPRG)
-rm -f *.asm *.cdb *.lk *.lst *.map *.rel *.rst *.s19 *.s37 *.sym
all: clean build
#-mmcs51 Generate code for the Intel MCS51 family of processors. This is the default processor target.
#-mds390 Generate code for the Dallas DS80C390 processor.
#-mds400 Generate code for the Dallas DS80C400 processor.
#-mhc08 Generate code for the Freescale/Motorola HC08 (aka 68HC08) family of processors.
#-ms08 Generate code for the Freescale/Motorola S08 (aka 68HCS08, HCS08, CS08) family of processors.
#-mz80 Generate code for the Zilog Z80 family of processors.
#-mz180 Generate code for the Zilog Z180 family of processors.
#-mr2k Generate code for the Rabbit 2000 / Rabbit 3000 family of processors.
#-mr3ka Generate code for the Rabbit 3000A family of processors.
#-mgbz80 Generate code for the LR35902 GameBoy Z80 processor.
#-mstm8 Generate code for the STMicroelectronics STM8 family of processors.
#-mpic14 Generate code for the Microchip PIC 14-bit processors (p16f84 and variants. In development, not complete).
#-mpic16 Generate code for the Microchip PIC 16-bit processors (p18f452 and variants. In development, not complete).