###############################################################################
## Makefile example for compiling DSP Hello World ARM side code
###############################################################################

# Set the compiler being used.
CC = arm-angstrom-linux-gnueabi-g++

# Setup reference to MDK
ifndef MDK
MDK = ${HOME}/MDK_2012-08-10
endif 

# Includes needed for proper compilation
INCLUDES = -I${MDK}/sw/ARM/linux/libdsp -I${MDK}/sw/ARM/linux/libdaq
# Libraries needed for linking
LDFLAGS = ${MDK}/lib/ARM/Release/dsplink.lib -L${MDK}/lib/ARM/Release -ldsp -lpthread -lrt -ldaq

# Set Compiler Flags
CFLAGS =-g -c -Wall $(INCLUDES) -std=gnu++0x

# List of source to be compiled
SOURCES = arm_main.cpp 

OBJECTS = $(SOURCES:.cpp=.o)
EXECUTABLE = HelloWorld

all: $(SOURCES) $(EXECUTABLE)

$(EXECUTABLE): $(OBJECTS)
	$(CC)  $(OBJECTS) -o $@ $(LDFLAGS)

.cpp.o:
	$(CC) $(CFLAGS) $< -o $@

clean:
	rm -rf $(OBJECTS) $(EXECUTABLE)
