From 1ca25bf8fdc17143c5a97c2b459fa91a2eae1374 Mon Sep 17 00:00:00 2001 From: Bernard Blackham Date: Tue, 5 Aug 2003 15:46:34 +0000 Subject: [PATCH] Introduce linking information from m68hc1x's example file. --- ROM2/Makefile | 55 +++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 49 insertions(+), 6 deletions(-) diff --git a/ROM2/Makefile b/ROM2/Makefile index efec0a7..7995df9 100644 --- a/ROM2/Makefile +++ b/ROM2/Makefile @@ -1,11 +1,54 @@ -CFLAGS = -g -O2 -Wall -CC = m68hc11-gcc +# muchly stolen from m68hc1x's example.tar.gz's Makefile -OBJS = motors.o keypad.o display.o coinmech.o helpers.o +OBJS = \ + motors.o keypad.o display.o coinmech.o helpers.o main.o \ + vectors.o +INCLUDES = vend.h -all: rom -rom: $(OBJS) +CFLAGS = -O2 -Wall -m68hc11 -mshort -Wall -Wmissing-prototypes -Os -g0 \ + -msoft-reg-count=0 -ffixed-z + +LDFLAGS = -m68hc11 -mshort -Wl,-m,m68hc11elfb \ + -nostartfiles \ + -Wl,-defsym,_io_ports=0x1000 + +OBJCOPY_FLAGS=--only-section=.text \ + --only-section=.rodata \ + --only-section=.vectors \ + --only-section=.data + + +DEVC_PREFIX = m68hc11- +CC = $(DEVC_PREFIX)gcc +AS = $(DEVC_PREFIX)as +AR = $(DEVC_PREFIX)ar +SIZE = $(DEVC_PREFIX)size +OBJCOPY = $(DEVC_PREFIX)objcopy +OBJDUMP = $(DEVC_PREFIX)objdump +LD = $(DEVC_PREFIX)ld + +all: rom2.b rom2.elf rom2.s19 + +rom2.elf: $(OBJS) memory.x + $(CC) $(LDFLAGS) -o $@ $(OBJS) $(LIBADD) clean: - rm -f $(OBJS) + rm -f $(OBJS) *.elf *.s19 *.b *.a + +# +# Implicit rules +# +# .elf is for the simulator and gdb +# .s19 is for some downloader and the simulator +# .b is a binary dump +# +.SUFFIXES: .elf .s19 .b + +.elf.s19: + $(OBJCOPY) --output-target=srec $(OBJCOPY_FLAGS) $< $*.s19 + +.elf.b: + $(OBJCOPY) --output-target=binary --gap-fill=255 \ + --only-section=.data $(OBJCOPY_FLAGS) $< $*.b + -- 2.20.1