# Makefile for m68hc11 boot loader/s19 interpreter TARGET=m6811-elf MEMMAP=../handyboard.x CCFLAGS=-Os -mshort -fshort-double -fomit-frame-pointer -nostartfiles -T${MEMMAP} ASFLAGS=-m68hc11 -mshort -mshort-double --strict-direct-mode --print-insn-syntax -I.. LDFLAGS=-T${MEMMAP} --gc-sections -j .text -j .data # TEXT_ADDR=0x8000 # DATA_ADDR=0xC000 all: servo2.s19 servo2.o: servo2.c servo2.s Makefile @echo "*** MAKING servo2.o" ${TARGET}-as ${ASFLAGS} -I.. --defsym DEBUG=1 -als=servo2.asmlist -o servo2.o servo2.s # ${TARGET}-as ${ASFLAGS} -als=servo2.asmlist -o servo2.o servo2.s # ${TARGET}-gcc ${CCFLAGS} -c -o servo2_c.o servo2.c # ${TARGET}-ld --relocatable -o servo2.o servo2_asm.o servo2_c.o # rm servo2_asm.o servo2_c.o @echo servo2.elf: servo2.o @echo "*** MAKING servo2.elf" ${TARGET}-ld ${LDFLAGS} -o servo2.elf -e servo2_init servo2.o @echo "* servo2.elf is an ELF format linkable image" @echo servo2.bin: servo2.elf @echo '*** MAKING servo2.bin' ${TARGET}-objcopy -O binary servo2.elf servo2.bin @echo "* servo2.bin is the binary image to send to the 68hc11" @echo servo2.s19: servo2.elf @echo '*** MAKING servo2.s19' ${TARGET}-objcopy -O srec servo2.elf servo2.s19 @echo servo2.lst: servo2.elf @echo '*** MAKING servo2.lst' ${TARGET}-objdump -dsx servo2.elf > servo2.lst @echo clean: -rm -f *.{elf,bin,s19,lst,o,asmlist} *~