########################################################################
#           Makefile for shared object
########################################################################
CDEVROOT = $(CDEV)
include $(CDEVROOT)/examples/Makefile.common

CXXEXTRA = $(CLASS_INCLUDES) $(EPICSINCLUDES)

LIBS = 	-L$(CDEVLIB) -lcdev -lEpicsCa \
	-L$(EPICSLIB) -lca -lDb -lCom -lm -ly -ll

TARGETS = ascii2Bin bin2Ascii cdevDirectoryTest Gillies

targets: $(TARGETS)

ascii2Bin : ascii2Bin.o
	@rm -f $@
	@echo "=> $(CXX) -o $@ $<"
	@$(PROOF) $(CXX) $(CXXFLAGS) $(CXXEXTRA) $< $(CDEVLIB)/libcdev.a $(LIBS) -o $@
	@rm -rf ptrepository  
	
bin2Ascii : bin2Ascii.o
	@rm -f $@
	@echo "=> $(CXX) -o $@ $<"
	@$(PROOF) $(CXX) $(CXXFLAGS) $(CXXEXTRA) $< $(CDEVLIB)/libcdev.a $(LIBS) -o $@
	@rm -rf ptrepository  

cdevDirectoryTest : cdevDirectoryTest.o
	@rm -f $@
	@echo "=> $(CXX) -o $@ $<"
	@$(CXX) $(CXXFLAGS) $(CXXEXTRA) $^ -L$(CDEVLIB) -lcdev -lm -ll -ly -o $@
	@rm -rf ptrepository  

Gillies : Gillies.o
	@rm -f $@
	@echo "=> $(CXX) -o $@ $<"
	@$(CXX) $(CXXFLAGS) $(CXXEXTRA) $^ -L$(CDEVLIB) -lcdev -lm -ll -ly -o $@
	@rm -rf ptrepository  

SpaceTest : SpaceTest.o
	@rm -f $@
	@echo "=> $(CXX) -o $@ $<"
	@$(CXX) $(CXXFLAGS) $(CXXEXTRA) $^ -L$(CDEVLIB) -lcdev -lm -ll -ly -o $@
	@rm -rf ptrepository  

implementTest : implementTest.o
	@rm -f $@
	@echo "=> $(CXX) -o $@ $<"
	@$(CXX) $(CXXFLAGS) $(CXXEXTRA) $^ -L$(CDEVLIB) -lcdev -lm -ll -ly -o $@
	@rm -rf ptrepository  

queryTest : queryTest.o
	@rm -f $@
	@echo "=> $(CXX) -o $@ $<"
	@$(CXX) $(CXXFLAGS) $(CXXEXTRA) $^ -L$(CDEVLIB) -lcdev -lm -ll -ly -o $@
	@rm -rf ptrepository  

clean:
	@rm -rf $(TARGETS) *.o *.a *~ core ptrepository
	
