#
# Makefile designed to compile a example consisting of a single .c file
#

# Define the location the TI-DaVinci kerenel
DAVINCI_ROOT = /home/user/dm355/dvsdk_1_30_00_40/arm_toolchain/montavista/pro/devkit/lsp/ti-davinci

# Define the prefix used for the cross compiler
CROSS_COMPILE = arm_v5t_le-

# Define the location of the target
ARM_ROOT = /home/user/dm355/dvsdk_1_30_00_40/arm_toolchain/montavista/pro/devkit/arm/v5t_le/target

# List locations that have include files we need
INC = $(DAVINCI_ROOT)/include ../../include $(ARM_ROOT)/usr/include

# List defines that are global to all examples
DEFINES += -DUSE_DIRECTFB=0

# Don't modify anything below this point

OBJECT := $(patsubst %.c,%.o,$(wildcard *.c))
EXEC := $(patsubst %.c,%,$(wildcard *.c))

CFLAGS = -g -s $(INC:%=-I %) -static $(DEFINES)

all: $(OBJECT)
	$(CROSS_COMPILE)gcc $(CFLAGS) $(OBJECT) -o $(EXEC)

clean:
	rm -f $(OBJECT)

distclean: clean
	rm -f $(EXEC) *.~

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

