#	This is Linux makefile for C33 sisamplib
#	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.
#
INCLUDEDIR = ../common
CC=gcc
LD=gcc

CFLAGS = -Wall -I$(INCLUDEDIR) -DLINUX 
TARGET = sisamplib.dll

all:
#	1. compile all files
	$(CC) -fPIC -g -c $(CFLAGS) ../../../../../../../common_sihw/coffparse.c
	$(CC) -fPIC -g -c $(CFLAGS) ../../../common/configfpga_plx9054.c
	$(CC) -fPIC -g -c $(CFLAGS) ../../../../../../common/sicommon_plx_lnx.c
	$(CC) -fPIC -g -c $(CFLAGS) ../../common/sicommon_plxc33.c
	$(CC) -fPIC -g -c $(CFLAGS) ../../../../../../../common_ddk/os_lnx.c
	$(CC) -fPIC -g -c $(CFLAGS) ../../../../../../../common_ddk/sierrors.c
	$(CC) -fPIC -g -c $(CFLAGS) -DSIDEF_PLX_C3x ../../../common/sisamplib.c
	$(CC) -fPIC -g -c $(CFLAGS) ../../../../../../../common_sihw/cboard.c
	$(CC) -fPIC -g -c $(CFLAGS) -DSIDEF_PLX_C3x ../../../../../../../common_sihw/cplxc33.c
	
#	2. link object files to generate executable
#	ld -shared -soname $(TARGET) -o $(TARGET) -lc *.o
	$(LD) -shared -o $(TARGET) -lc *.o

clean:
	rm -f *.o *.so *.dll *~ core .depend $(TARGET)

