CROSS=arm-eabi-
CFLAGS=-g

all: test.elf

#test.bin: test.elf
#	$(CROSS)objcopy -O binary $< $@

test.elf: test.o init.o irq.o vectors.o
	$(CROSS)ld -o $@ -T kernel_samba.ld $^ -Map test.map

test.o: test.c
	$(CROSS)gcc -c -o $@ $< $(CFLAGS)

irq.o: ../ravenscar/irq.s
	$(CROSS)gcc -c -o $@ $<

vectors.o: ../ravenscar/vectors.s
	$(CROSS)gcc -c -o $@ $<

.s.o:
	$(CROSS)gcc -c -o $@ $<

clean:
	$(RM) -f *.o *.elf