PLATFORM = 6809
CC = m6809-unknown-gcc
-# These are wrappers for lwasm and lwar
ASM = m6809-unknown-as
AR = m6809-unknown-ar
-LINKER = lwlink
+LINKER = m6809-unknown-ld
CFLAGS = -I../../Library/include -I../../Library/include/6809
COPT = -Os -fomit-frame-pointer
-LINKER_OPT = --format=raw -L../../Library/libs -lc6809
+# Workaround for gcc6809 bug - register copy propagation issue
+COPT += -fno-cprop-registers
+LINKER_OPT = --oformat=raw -L../../Library/libs -lc6809
LIBGCCDIR = $(dir $(shell $(CC) -print-libgcc-file-name))
LINKER_OPT += -L$(LIBGCCDIR) -lgcc
LINKER_OPT += --script=../util/$(TARGET).link