.SUFFIXES:
.SUFFIXES: .elf .o .bin .s .c .h
.PRECIOUS: %.o
#DEBUG=
DEBUG= -g
ARMGNU?=arm-none-eabi

#COPS = -Wall  -Os -nostdlib -nostartfiles -ffreestanding -save-temps
AOPS = --warn --fatal-warnings

all : myfirst.elf simple.elf

.s.o : 
	$(ARMGNU)-as $(DEBUG)  -al -o $@ $< >$*.lst

.o.elf:
	$(ARMGNU)-ld  $(DEBUG)  -e Reset -o $@ -T memmap $<
	$(ARMGNU)-objdump -D $@ > $*.list
	$(ARMGNU)-objcopy $@ $*.bin -O binary
	cp $@ firmware.elf

clean:
	rm -f *.bin *.o *.list *.lst *.elf 
