# Makefile for PA
# make clean && make test
# make run is for remote system
# Stephen Dew, Jan 2012.
# modified Dec 2011


DIR =  
#Intrinsic_Test_Frame/Source/

# header files
HEADERS = portTItoPA.h

# compiler optimization level
COPTS = -O3 -g  -save-temps 
#-malitvec

#if commented, then will not compile or link yet.

include makefile.inc.pa


CC2 = $(CC) -D_OPT_ -DPA_TEST -UCONSOLE_OUTPUT $(COPTS) 

test:$(HEADERS) $(OBJ) 
	$(CC2) -static -o test $(OBJ) 

.SUFFIXES : .o .c

test_harness.c: $(HEADERS) 
	$(CC2) -c test_harness.c

.c.o: $(HEADERS) makefile
	${CC2} -c $*.c

clean:
	/bin/rm -r -f *~ test *.o *.i *.s 

run:    test
	rm -f results_PA.txt
	scp -q test b07422@perf3board8:/home/b07422/remoterun/ 
	/usr/bin/ssh -o "BatchMode yes" -l b07422 perf3board8 "cd remoterun && ./test > out"
	scp  b07422@perf3board8:/home/b07422/remoterun/out .
	scp  b07422@perf3board8:/home/b07422/remoterun/results_PA.txt .
	/bin/mv results_PA.txt /mnt/hgfs/shared/work/
	diff -b /mnt/hgfs/shared/work/results_PA.txt /mnt/hgfs/shared/work/repos/build_gnu/extras/portC6xtoPA/Test_Frame_TI_CCS5/Release/results_TI64xSim.txt 

