#	This is Linux makefile for C33 sisample. 
#	All source code for Windows and Linux versions are the same except for 
#	the API functions. Windows version uses sicommon_plx.cpp while the 
#	Linux version uses silnxcommon_plx.cpp.
#

CC = gcc
INCLUDEDIR = ../common
CFLAGS = -Wall -I$(INCLUDEDIR) -DLINUX -DSIDEF_PLX_C3x -DMOD68 -DREV1

TARGET = sisampmod68.out

release:
#	1.compile all files
	$(CC) -c $(CFLAGS) ../../../../../../../../common_sihw/coffparse.c
	$(CC) -c $(CFLAGS) ../../../../common/configfpga_plx9054.c
	$(CC) -c $(CFLAGS) ../../../../../../../common/sicommon_plx_lnx.c
	$(CC) -c $(CFLAGS) ../../../common/sicommon_plxc33.c
#	$(CC) -c $(CFLAGS) ../../../../../../../../si_modules/common/common_simod.cpp
	$(CC) -c $(CFLAGS) ../../../../../../../../common_ddk/os_lnx.c
	$(CC) -c $(CFLAGS) ../../../../../../../../si_modules/mod68/mod68.c
	$(CC) -c $(CFLAGS) ../../../../../../../../si_modules/common/common_simod.c
	$(CC) -c $(CFLAGS) ../../../../common/sisample.c
	$(CC) -c $(CFLAGS) ../../../../../../../../common_sihw/cboard.c
	$(CC) -c $(CFLAGS) ../../../../../../../../common_sihw/cplxc33.c

#	2.link object files to generate executable
	$(CC) -lm -o $(TARGET) *.o

debug:
#	1.compile all files
	$(CC) -c $(CFLAGS) -g ../../../../../../../../common_sihw/coffparse.cpp
	$(CC) -c $(CFLAGS) -g ../../../../common/configfpga_plx9054.cpp
	$(CC) -c $(CFLAGS) -g ../../../../../../../common/sicommon_plx_lnx.cpp
	$(CC) -c $(CFLAGS) -g ../../../common/sicommon_plxc33.cpp
#	$(CC) -c $(CFLAGS) -g ../../../../../../../../si_modules/common/common_simod.cpp
	$(CC) -c $(CFLAGS) -g ../../../../../../../../si_modules/mod68/mod68.cpp
	$(CC) -c $(CFLAGS) -g ../../../../../../../../si_modules/common/common_simod.cpp
	$(CC) -c $(CFLAGS) -g ../../../../common/sisample.cpp
	$(CC) -c $(CFLAGS) -g ../../../../../../../../common_sihw/cboard.cpp
	$(CC) -c $(CFLAGS) -g ../../../../../../../../common_sihw/cplxc33.cpp
	
#	2.link object files to generate executable
	$(CC) -o $(TARGET) *.o
			
clean:
	rm -f *.o *~ core .depend $(TARGET)
	
	
