# Makefile for m68hc11 boot loader/s19 interpreter TARGET=m6811-elf ASTAGS=-m68hc11 -mshort -mshort-double --strict-direct-mode --print-insn-syntax -I.. .PHONY: all all: s19_interpreter_bootstrap.dump s19_interpreter_bootstrap.s19 s19_interpreter_bootstrap.lst @echo "*******************************************************************************" @echo "* s19_interpreter_bootstrap.bin is the (NOP padded) 256 byte binary image to send to the 68hc11" @echo "* s19_interpreter_bootstrap.dump is the same image with an 0xFF prepended for easy sending" @echo "* s19_interpreter_bootstrap.elf is an ELF format linkable image" @echo "*******************************************************************************" s19_interpreter.o: s19_interpreter_includable.s s19_interpreter_core.s ${TARGET}-as ${ASTAGS} -al=s19_interpreter.asmlist -o s19_interpreter.o s19_interpreter_includable.s s19_interpreter_bootstrap.o: s19_interpreter_bootstrap.asm Makefile @echo '*** MAKING s19_interpreter_bootstrap.o' ${TARGET}-as ${ASTAGS} -al=s19_interpreter_bootstrap.asmlist -o s19_interpreter_bootstrap.o s19_interpreter_bootstrap.asm # ${TARGET}-as ${ASTAGS} --defsym ENABLE_RELOCATE=1 -al=s19_interpreter_bootstrap.asmlist -o s19_interpreter_bootstrap.o s19_interpreter_bootstrap.asm # ${TARGET}-as ${ASTAGS} --defsym DEBUG_STYLE=1 -al=s19_interpreter_bootstrap.asmlist -o s19_interpreter_bootstrap.o s19_interpreter_bootstrap.asm # ${TARGET}-as ${ASTAGS} --defsym ENABLE_RELOCATE=1 --defsym DEBUG_STYLE=1 -al=s19_interpreter_bootstrap.asmlist -o s19_interpreter_bootstrap.o s19_interpreter_bootstrap.asm # ${TARGET}-as ${ASTAGS} --defsym DEBUG_STYLE=2 -al=s19_interpreter_bootstrap.asmlist -o s19_interpreter_bootstrap.o s19_interpreter_bootstrap.asm # ${TARGET}-as ${ASTAGS} --defsym ENABLE_RELOCATE=1 --defsym DEBUG_STYLE=2 -al=s19_interpreter_bootstrap.asmlist -o s19_interpreter_bootstrap.o s19_interpreter_bootstrap.asm @echo s19_interpreter_bootstrap.elf: s19_interpreter_bootstrap.o @echo '*** MAKING s19_interpreter_bootstrap.elf' ${TARGET}-ld --gc-sections -j .page0 -o s19_interpreter_bootstrap.elf -T ../handyboard.x s19_interpreter_bootstrap.o @echo s19_interpreter_bootstrap.bin: s19_interpreter_bootstrap.elf @echo '*** MAKING s19_interpreter_bootstrap.bin' ${TARGET}-objcopy -O binary -j .page0 --gap-fill 0x01 --pad-to 0x100 s19_interpreter_bootstrap.elf s19_interpreter_bootstrap.bin @[[ `stat -c '%s' s19_interpreter_bootstrap.bin` < 257 ]] || { \ echo " *** FATAL ERROR: bootstrap will not fit into zero page ram!!"; \ echo " *** s19_interpreter_bootstrap.bin: `stat -c '%s' s19_interpreter_bootstrap.bin` bytes, max: 256 bytes"; \ false; \ } @echo s19_interpreter_bootstrap.dump: s19_interpreter_bootstrap.bin @echo '*** MAKING s19_interpreter_bootstrap.dump' echo -ne '\xFF' > s19_interpreter_bootstrap.dump cat s19_interpreter_bootstrap.bin >> s19_interpreter_bootstrap.dump @echo s19_interpreter_bootstrap.s19: s19_interpreter_bootstrap.elf @echo '*** MAKING s19_interpreter_bootstrap.s19' ${TARGET}-objcopy -j .page0 -O srec s19_interpreter_bootstrap.elf s19_interpreter_bootstrap.s19 @echo s19_interpreter_bootstrap.lst: s19_interpreter_bootstrap.elf @echo '*** MAKING s19_interpreter_bootstrap.lst' ${TARGET}-objdump -Dsx -j .page0 s19_interpreter_bootstrap.elf > s19_interpreter_bootstrap.lst @echo .PHONY: clean clean: -rm s19_interpreter_bootstrap.{elf,bin,dump,s19,lst,o,asmlist} *~