ARCH           = OS
SHOBJ          = YES

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

APPNAME        = CDEV Reactor Library
OBJS           = $(OBJDIR)/cdevAddr.o\
                 $(OBJDIR)/cdevEventHandler.o\
                 $(OBJDIR)/cdevHandleSet.o\
                 $(OBJDIR)/cdevReactor.o\
                 $(OBJDIR)/cdevSocket.o\
                 $(OBJDIR)/cdevSocketAcceptor.o\
                 $(OBJDIR)/cdevSocketConnector.o\
                 $(OBJDIR)/cdevSocketDatagram.o\
                 $(OBJDIR)/cdevSocketStream.o\
                 $(OBJDIR)/cdevStreamNode.o\
                 $(OBJDIR)/cdevStreamQueue.o\
                 $(OBJDIR)/cdevTime.o

# ******************************************************************************
# * The BINARIES definition names all of the binary files that should be deleted
# * whenever "make clean" is executed.
# ******************************************************************************
BINARIES    = $(BASELIB)/libcdevReactor.$(SHARED_EXT) \
              $(BASELIB)/libcdevReactor.a

# ******************************************************************************
# * The TARGETS variable is used to specify the name of the library to build. 
# ******************************************************************************
ifeq ($(SHOBJ),YES)
       TARGETS = $(BASELIB)/libcdevReactor.$(SHARED_EXT)
else
       TARGETS = $(BASELIB)/libcdevReactor.a
endif

targets : $(TARGETS)
	
$(BASELIB)/libcdevReactor.a : $(OBJS)
	$(LINK.a) $@ $^
	@$(RANLIB) $@ > /dev/null
	@mkdir -p $(CDEVLIB)
	@cp $@ $(CDEVLIB)	

$(BASELIB)/libcdevReactor.$(SHARED_EXT) : $(OBJS)
	$(LINK.so) -o $@ $^ $(NETLIBS)
	@mkdir -p $(CDEVLIB)
	@cp $@ $(CDEVLIB)
	
