advent: add makefile for 6809
authorBrett Gordon <beretta42@gmail.com>
Thu, 17 Mar 2016 15:22:09 +0000 (11:22 -0400)
committerBrett Gordon <beretta42@gmail.com>
Thu, 17 Mar 2016 15:22:09 +0000 (11:22 -0400)
Applications/cave/Makefile.6809 [new file with mode: 0644]

diff --git a/Applications/cave/Makefile.6809 b/Applications/cave/Makefile.6809
new file mode 100644 (file)
index 0000000..62c708f
--- /dev/null
@@ -0,0 +1,43 @@
+#
+#      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