
include $(TOPDIR)/rules.mk

# compiler settings

CFLAGS = -msoft-float -Wa,-EL,-mfpu=softfpa
DBGFLAGS = -g
OPTFLAGS = -O0
INCFLAGS = -I$(TOPDIR)/include \
           -I$(TOPDIR)/include/asm \
           -I$(TOPDIR)/drivers \
           -I$(shell pwd) \
           -fno-builtin -ffreestanding -nostdinc -isystem $(GCCINC)

# ar settings

ARFLAGS = crv

OBJS := $(shell ls *.c | sed -e 's/\.c/.o/')

LIBS = fbcon.a

all: $(OBJS) $(LIBS)

%.o:	%.c
	$(CC) $(DBGFLAGS) $(OPTFLAGS) $(CFLAGS) $(INCFLAGS) -c -o $@ $<

fbcon.a:	$(OBJS)
	$(AR) $(ARFLAGS) $@ $(OBJS)

# create dependancies

.depend:	*.c
	$(CC) -M $(DBGFLAGS) $(OPTFLAGS) $(CFLAGS) $(INCFLAGS) $(shell ls *.c) > .depend

sinclude .depend
