ARCH        = OS
SHOBJ       = YES

include ../../include/makeinclude/Makefile.$(ARCH)

APPNAME     = "Client/Server Monitor Test"
CXXINCLUDES = -I./
SERVER_LIBS = -L$(CDEVLIB) -lcdevGenericServer $(CDEVLIBS) $(OSLIBS)

ifeq ($(SHOBJ), YES)
   LIBS    = -L$(CDEVLIB) -lcdevGenericServer $(CDEVLIBS) $(OSLIBS)
   TARGETS = $(BASELIB)/MonitorTestService.so $(BASEBIN)/MonitorTestServer $(BASEBIN)/MonitorTest $(BASEBIN)/MonitorReader $(BASEBIN)/MonitorOffTest $(BASEBIN)/MonitorWriter  $(BASEBIN)/DefaultServerTest
else
   LIBS    = -L$(CDEVLIB) -lcdevGenericServer $(CDEVLIBS) $(OSLIBS)
   TARGETS = $(BASELIB)/libMonitorTestService.a $(BASEBIN)/MonitorTestServer $(BASEBIN)/MonitorTest $(BASEBIN)/MonitorReader $(BASEBIN)/MonitorOffTest $(BASEBIN)/MonitorWriter $(BASEBIN)/DefaultServerTest
endif


targets : $(TARGETS)

$(BASEBIN)/MonitorTestServer : $(OBJDIR)/MonitorTestServer.o $(OBJDIR)/MonitorTestAttrib.o
	$(LINK.cc) $^ $(SERVER_LIBS) -o $@

$(BASELIB)/MonitorTestService.so : $(OBJDIR)/MonitorTestService.o 
	$(LINK.so) -o $@ $^ -L$(CDEVLIB) -lcdevGenericServer $(OSLIBS)
	@mkdir -p $(CDEVSHOBJ)/$(CDEVVERSION)
	@cp $@ $(CDEVSHOBJ)/$(CDEVVERSION)/$(@F)

$(BASELIB)/libMonitorTestService.a : $(OBJDIR)/MonitorTestService.o 
	$(LINK.a) $@ $^ 
	@$(RANLIB) $@ > /dev/null

$(BASEBIN)/MonitorTest : $(OBJDIR)/MonitorTest.o 
	$(LINK.cc) $^ -o $@ $(LIBS) 
	
$(BASEBIN)/DefaultServerTest : $(OBJDIR)/DefaultServerTest.o 
	$(LINK.cc) $^ -o $@ $(LIBS) 

$(BASEBIN)/MonitorReader : $(OBJDIR)/MonitorReader.o 
	$(LINK.cc) $^ -o $@ $(LIBS) 

$(BASEBIN)/MonitorOffTest : $(OBJDIR)/MonitorOffTest.o 
	$(LINK.cc) $^ -o $@ $(LIBS) 
	
$(BASEBIN)/MonitorWriter : $(OBJDIR)/MonitorWriter.o 
	$(LINK.cc) $^ -o $@ $(LIBS) 

