More keypad fixes.
[uccvend-snackrom.git] / ROM2 / Makefile
1 # muchly stolen from m68hc1x's example.tar.gz's Makefile
2
3 OBJS = \
4         motors.o keypad.o display.o coinmech.o chime.o helpers.o main.o \
5         vectors.o
6 INCLUDES = vend.h keypad.h chime.h asm.h display.h ports.h types.h
7
8 CFLAGS = -O3 -m68hc11 -mshort -Wall -Os -g0 \
9         -msoft-reg-count=0 -ffixed-z
10
11 LDFLAGS = -m68hc11 -mshort -Wl,-m,m68hc11elfb \
12           -nostartfiles \
13           -Wl,-defsym,_io_ports=0x1000 \
14           -Wl,-defsym,_switch_input=0x1800 \
15           -Wl,-defsym,_misc_input=0x2000 \
16           -Wl,-defsym,_home_sensors=0x2800 \
17           -Wl,-defsym,_changer_output=0x3000 \
18           -Wl,-defsym,_misc_output=0x3800
19
20 OBJCOPY_FLAGS=--only-section=.text \
21               --only-section=.rodata \
22               --only-section=.vectors \
23               --only-section=.data
24
25
26 DEVC_PREFIX = m68hc11-
27 CC = $(DEVC_PREFIX)gcc
28 AS = $(DEVC_PREFIX)as
29 AR = $(DEVC_PREFIX)ar
30 SIZE = $(DEVC_PREFIX)size
31 OBJCOPY = $(DEVC_PREFIX)objcopy
32 OBJDUMP = $(DEVC_PREFIX)objdump
33 LD = $(DEVC_PREFIX)ld
34
35 all: rom2.b rom2.elf rom2.s19
36
37 rom2.elf: $(OBJS) memory.x
38         $(CC) $(LDFLAGS) -o $@ $(OBJS) $(LIBADD)
39
40 clean:
41         rm -f *.o *.elf *.s19 *.b *.a
42
43 #
44 # Some useful rules
45 #
46 dump:   rom2.elf
47         $(OBJDUMP) -d $<
48
49 size:   rom2.s19
50         $(SIZE) $<
51
52
53 #
54 # Implicit rules
55 #
56 # .elf is for the simulator and gdb
57 # .s19 is for some downloader and the simulator
58 # .b   is a binary dump
59 #
60 .SUFFIXES: .elf .s19 .b
61
62 .elf.s19:
63         $(OBJCOPY) --output-target=srec $(OBJCOPY_FLAGS) $< $*.s19
64
65 .elf.b:
66         $(OBJCOPY) --output-target=binary --gap-fill=255 \
67                    --only-section=.data $(OBJCOPY_FLAGS) $< $*.b
68                    

UCC git Repository :: git.ucc.asn.au