
CROSS = arm-linux-

CC = $(CROSS)gcc
LD = $(CROSS)ld
OC = $(CROSS)objcopy

TOPDIR = $(shell pwd)
INCLUDE = -nostdinc -I. -I$(TOPDIR)/include

CFLAGS = $(INCLUDE) -nostdinc -Wall -W -O3 -march=armv4 \
	 -mtune=arm9tdmi -fno-builtin -msoft-float

OCFLAGS = -O binary -R .note -R .comment -S

SRCS = start.S led.S clksetup.S memsetup.S
OBJS = start.o led.o clksetup.o memsetup.o

%.o : %.S
	$(CC) $(CFLAGS) -c $<

all : $(OBJS)
	$(LD) $(OBJS) -o theBlueBoot.o -Ttext 0x00000000 -N
	$(OC) theBlueBoot.o theBlueBoot $(OCFLAGS)

clean :
	rm -f *.o
	rm -f theBlueBoot
