1 # muchly stolen from m68hc1x's example.tar.gz's Makefile
4 motors.o keypad.o display.o coinmech.o helpers.o main.o \
9 CFLAGS = -O2 -Wall -m68hc11 -mshort -Wall -Wmissing-prototypes -Os -g0 \
10 -msoft-reg-count=0 -ffixed-z
12 LDFLAGS = -m68hc11 -mshort -Wl,-m,m68hc11elfb \
14 -Wl,-defsym,_io_ports=0x1000
16 OBJCOPY_FLAGS=--only-section=.text \
17 --only-section=.rodata \
18 --only-section=.vectors \
22 DEVC_PREFIX = m68hc11-
23 CC = $(DEVC_PREFIX)gcc
26 SIZE = $(DEVC_PREFIX)size
27 OBJCOPY = $(DEVC_PREFIX)objcopy
28 OBJDUMP = $(DEVC_PREFIX)objdump
31 all: rom2.b rom2.elf rom2.s19
33 rom2.elf: $(OBJS) memory.x
34 $(CC) $(LDFLAGS) -o $@ $(OBJS) $(LIBADD)
37 rm -f $(OBJS) *.elf *.s19 *.b *.a
42 # .elf is for the simulator and gdb
43 # .s19 is for some downloader and the simulator
46 .SUFFIXES: .elf .s19 .b
49 $(OBJCOPY) --output-target=srec $(OBJCOPY_FLAGS) $< $*.s19
52 $(OBJCOPY) --output-target=binary --gap-fill=255 \
53 --only-section=.data $(OBJCOPY_FLAGS) $< $*.b