--- /dev/null
+#
+# For Z80 at least this should work. We will need to hack advgen to
+# do endian swapping if building on PC for 6809
+#
+
+PLATFORM = 6809
+CC = m6809-unknown-gcc
+CCOPTS = -O2
+# These are wrappers for lwasm and lwar
+ASM = m6809-unknown-as
+AR = m6809-unknown-ar
+LINKER = lwlink
+CFLAGS = -I../../Library/include -I../../Library/include/6502
+LINKER_OPT = --format=raw -L../../Library/libs -lc6809
+LIBGCCDIR = $(dir $(shell $(CC) -print-libgcc-file-name))
+LINKER_OPT += -L$(LIBGCCDIR) -lgcc
+LINKER_OPT += --script=../util/$(TARGET).link
+ASM_OPT = -o
+CRT0 = ../../Library/libs/crt0_6809.o
+
+
+SRC = advent.c adventdb.c database.c english.c itverb.c lib.c saveadv.c \
+ turn.c verb.c
+OBJ = $(SRC:.c=.o)
+
+.SUFFIXES: .c .o
+
+all: advent advent.db
+
+advent.db: advgen
+ ./advgen -x > advent.db
+
+advgen: advgen.c
+ cc advgen.c -o ./advgen
+
+.c.o:
+ $(CC) $(CFLAGS) $(CCOPTS) -c $<
+
+advent: $(OBJ)
+ $(LINKER) -o $@ $(LINKER_OPT) $(CRT0) $(OBJ)
+
+clean:
+ rm -f advent advent.db advgen *.rel *.asm *.lst core *.sym *.map *.noi *.lk *.ihx *.tmp *.bin *.o