## Makefile for daq_test.c

include /usr/src/rtlinux/rtl.mk

RTL_INCLUDE     = $(INCLUDE) -I/opt/comedi/include

RTL_SOURCE	=	daq_test.c
RTL_TARGET	=	daq_test.o

$(RTL_TARGET): $(RTL_SOURCE)
	$(CC) $(RTL_INCLUDE) $(CFLAGS) $(RTL_DEFS) \
	-c $(RTL_SOURCE) -o $(RTL_TARGET)

test: $(RTL_TARGET)
	@echo ""
	@echo "This reads the AI0 channel and mimics the values on the"
	@echo "  AO0 channel, minus discretization error."
	@echo "Hit <return> to insert real time modules"
	@read junk
	(cd /usr/src/rtlinux; scripts/insrtl)
	-modprobe kcomedilib
	-modprobe ni_pcimio
	-/usr/sbin/comedi_config /dev/comedi0 ni_pcimio
	@echo "Dependencies are loaded - begin DAQ test"
	@echo "Hit <return> to insert daq_test.o"
	@read junk
	-insmod daq_test.o
	@echo "Real time process inserted. Allow to run for a while-"
	@echo "Supply signal to AI0 and observe AO0 - they should match"
	@echo "When you are ready, hit <return> to end test"
	@read junk
	-rmmod daq_test
	-modprobe -r ni_pcimio
	-modprobe -r kcomedilib
	(cd /usr/src/rtlinux; scripts/rmrtl)
	@echo "(ignore rmmod errors listed above)"
	@echo "Test has ended..."
	@echo ""

clean:
	rm -f *.o
	rm -f *~
	rm -f \#*
	@echo "Directory has been swept clean."






