git.ucc.asn.au
/
uccvend-snackrom.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
A different way of storing the ROM image.
[uccvend-snackrom.git]
/
ROM2
/
Makefile
diff --git
a/ROM2/Makefile
b/ROM2/Makefile
index
7995df9
..
38780bf
100644
(file)
--- a/
ROM2/Makefile
+++ b/
ROM2/Makefile
@@
-1,17
+1,23
@@
# muchly stolen from m68hc1x's example.tar.gz's Makefile
OBJS = \
# muchly stolen from m68hc1x's example.tar.gz's Makefile
OBJS = \
- motors.o keypad.o display
.o coinmech.o helpers.o main
.o \
- vectors.o
-INCLUDES = vend.h
-
-
-CFLAGS = -
O2 -Wall -m68hc11 -mshort -Wall -Wmissing-prototypes -Os -g0
\
- -msoft-reg-count=0 -ffixed-z
+ motors.o keypad.o display
_basic.o coinmech.o chime
.o \
+ helpers.o main_basic.o sci.o \
+ vectors.o start.o romsrc.o xmodem.o
+INCLUDES = vend.h keypad.h chime.h asm.h display_basic.h ports.h types.h
+# debugging doesn't get compiled into the ROM image
+CFLAGS = -
m68hc11 -mshort -Wall -O1
\
+ -msoft-reg-count=0 -ffixed-z
-g -fomit-frame-pointer
LDFLAGS = -m68hc11 -mshort -Wl,-m,m68hc11elfb \
-nostartfiles \
LDFLAGS = -m68hc11 -mshort -Wl,-m,m68hc11elfb \
-nostartfiles \
- -Wl,-defsym,_io_ports=0x1000
+ -Wl,-defsym,_io_ports=0x1000 \
+ -Wl,-defsym,_switch_input=0x1800 \
+ -Wl,-defsym,_misc_input=0x2000 \
+ -Wl,-defsym,_home_sensors=0x2800 \
+ -Wl,-defsym,_changer_output=0x3000 \
+ -Wl,-defsym,_misc_output=0x3800 \
+ -Wl,-defsym,_uart_regs=0x4000
OBJCOPY_FLAGS=--only-section=.text \
--only-section=.rodata \
OBJCOPY_FLAGS=--only-section=.text \
--only-section=.rodata \
@@
-32,9
+38,34
@@
all: rom2.b rom2.elf rom2.s19
rom2.elf: $(OBJS) memory.x
$(CC) $(LDFLAGS) -o $@ $(OBJS) $(LIBADD)
rom2.elf: $(OBJS) memory.x
$(CC) $(LDFLAGS) -o $@ $(OBJS) $(LIBADD)
+ $(SIZE) $@
clean:
clean:
- rm -f $(OBJS) *.elf *.s19 *.b *.a
+ rm -f *.o *.elf *.s19 *.b *.a rom.tar.bz2 romsrc.s crctab.h m68hc11-gdb gencrctab
+
+#
+# Some useful rules
+#
+dump: rom2.elf
+ $(OBJDUMP) -d $<
+
+size: rom2.s19
+ $(SIZE) $<
+
+rom.tar.bz2:
+ rm -f romsrc.s crctab.h
+ tar cjf rom.tar.bz2 README Makefile gdbsimrc *.pl *.c *.h *.s *.x
+
+romsrc.s: rom.tar.bz2 src2asm.pl
+ perl -w src2asm.pl < $< > $@
+
+xmodem.c: crctab.h
+
+gencrctab: gencrctab.c
+ gcc -o $@ $<
+
+crctab.h: gencrctab
+ ./gencrctab > $@
#
# Implicit rules
#
# Implicit rules
@@
-50,5
+81,12
@@
clean:
.elf.b:
$(OBJCOPY) --output-target=binary --gap-fill=255 \
.elf.b:
$(OBJCOPY) --output-target=binary --gap-fill=255 \
- --only-section=.data $(OBJCOPY_FLAGS) $< $*.b
-
+ $(OBJCOPY_FLAGS) $< $*.b
+ @perl -e '$$sum = 0;while(read STDIN, $$a, 1){$$sum += ord($$a); $$sum = $$sum&0xffff;} printf "Checksum is \%x\n", $$sum' < $@
+
+m68hc11-gdb: /usr/bin/m68hc11-gdb
+ sed -e 's|m68hc11eepr/reg 0xb000 512|m68hc11eepr/reg 0x4000 1 |' < $< > $@
+ chmod 755 $@
+
+sim: m68hc11-gdb rom2.elf
+ ./m68hc11-gdb -x gdbsimrc rom2.elf
UCC
git Repository :: git.ucc.asn.au