# Makefile for building with the OE cross tools 
#
# OVEROTOP is normally ${HOME}/overo-oe 
#
# OETMP is the same as TMPDIR as defined in ${OVEROTOP}/build/conf/site.conf
#

OETMP = ${OVEROTOP}/tmp

# There were some OE toolchain path changes recently
   
# OE prior to around 30July2010 
# TOOLDIR = ${OETMP}/cross/armv7a/bin
# STAGEDIR = ${OETMP}/staging/armv7a-angstrom-linux-gnueabi/usr
   
# OE after 30July2010
TOOLDIR = ${OETMP}/sysroots/`uname -m`-linux/usr/armv7a/bin
STAGEDIR = ${OETMP}/sysroots/armv7a-angstrom-linux-gnueabi/usr

CC = ${TOOLDIR}/arm-angstrom-linux-gnueabi-gcc

# for DEBUG
#CFLAGS = -Wall -lm -lpthread -DDEBUG_FILE_MIN -DDEBUG_FILE_MIN_PERIOD=1

CFLAGS = -Wall -lm -lpthread

LIBDIR = ${STAGEDIR}/lib

INCDIR = ${STAGEDIR}/include      

TARGET = scilog

OBJS = scilog.o spi.o thread_rcv.o ring.o ad_ring.o thread_rec.o sts.o ad_file.o conf.o lcd.o thread_disp.o

HDRS		= mes_print.h debug_print.h spi.h my_thread.h ring.h ad_ring.h thread_rec.h sts.h ad_file.h conf.h lcd.h

${TARGET} : $(OBJS) $(HDRS) 
	${CC} ${CFLAGS} ${OBJS} -L ${LIBDIR} -o ${TARGET}

#meas.o: meas.c 
#	${CC} ${CFLAGS} -I ${INCDIR} -c meas.c  

clean:
	rm -f ${TARGET} ${OBJS} *~
