ARCH    = Linux
APPNAME = TCL/TK CDEV Interface

T_A=Linux
CDEVVERSION=1.7.2
#CDEVINCLUDE = /tools/include

CXXFLAGS = -DUNIX -D$(T_A) -DTCLCDEV_VERSION=\"1.1sls\" -I . -I $(CDEVINCLUDE)
LDFLAGS = -L$(CDEVLIB) -ldl -lm -lc -lcdev -ltcl $(CDEVSHOBJ)/$(CDEVVERSION)/caService.so


targets: libtclcdev.so libtclcdev80.so libtclcdevcollections.so libtclvector.so
########################################################################3


libtclcdev.so: tcl_cdev.o
	g++ -shared  -olibtclcdev.so tcl_cdev.o  $(LDFLAGS)

libtclcdev80.so: tcl_cdev80.o
	g++ -shared  -olibtclcdev80.so tcl_cdev80.o  $(LDFLAGS)

#tcl_cdev.o -L$(CDEVLIB) -L$(EPICSLIB) -ldl -lCom -lca -lm -lc -lcdev -lg++ -ltcl caService.so

tcltest.o : tcltest.cc
	g++ -c -DTCLCDEV_VERSION=\"1.1\" -I../../include tcltest.cc -o tcltest.o

libtcltest.so: tcltest.o
	rm -f $@
	g++ -shared -o $@ tcltest.o -L$(CDEVLIB) -L$(EPICSLIB) -ldl -lCom -lca -lm -lc -lcdev -lg++ -ltcl caService.so


libtclcdevcollections.so: tcl_cdevcollections.o
	rm -f $@
#	ld -b -o $@ tcl_cdevcollections.o  -ll -ly
	g++ -shared -o $@ tcl_cdevcollections.o  

libtclvector.so: tcl_cdevvector.o
	rm -f $@
#	ld -b -o $@ tcl_cdevvector.o  -ll -ly
	g++ -shared -o $@ tcl_cdevvector.o 

install: libtclcdev.so
	mv libtclcdev.so  $(CDEVLIB)
#	cat pkgIndex.tcl >> ../../../lib/itcl/pkgIndex.tcl

clean:
	@rm -rf *.o *.a *.so *~ core ish


breakit: breakit.o
		$(CC) -o $@ breakit.o -L$(CDEV)/lib/$(TARGETDIR) -lcdev -ll -ly -lm
