# DEBUG messages:
# BE CAREFULL: when debug messages are enabled the program will be slowed down!!
# You can define the following debug messages:
#
# - DEBUG_TIMERS : prints TIMER related messages
# - DEBUG_NET_MSGS: Warning: this can generate lots of data! prints sent/received packages related messages
# - DEBUG_CACHE : prints cache related messages
# - DEBUG_EVENTS: prints event list handler messages
# - DEBUG_SHOW : Warning: this can generate lots of data!: Shows part of program stuctures content (cache, event list, etc).
# - DEBUG_CACHE_CONTENTS : Warning: this can generate lots of data! DEBUG_SHOW must be enable. Shows the full content of the cache structure. 
# - DSHOW_MSG_CONTENTS : Warning: this can generate lots of data! DEBUG_SHOW must be enable. Shows the full content of the message structure.
# - DEBUG_PCKT : prints mount/unmount package info
# - DEBUG_MSG_QUEUE : prints message queue info
# - DEBUG_TCP: tcp connection debug (see rmtcp.c)
# - REFRESH : enables refresh messages
# - SUPPORT_FOR_NEW_USERS : enables support for new users
# - DONT_SEND_NACK_AGAIN_IMMEDIATLY : a second NAK is sent only when the first one was received by the user himself who sent the NAK
# - SINGLE_NACK : only one nack event will be launched for a group of packets at a time
# - DSINGLE_NACK : enables single nack debug messages
# - DWINDOW_MASK : enables window mask related debug messages
# - DMUTEX : enable lock and unlock mutex tracing ( shows when cache and event list access is locked or unlocked)
# - RANDOM_TIMERS : uses random timers instead of static deterministic timers
# - DSHOW_COMPLETE_MASK_IN_LOG : shows, in the log file, the nack mask in binary mode

OBJECTS = rmevent.o rmcache.o rmmsgpckt.o rminternals.o rmmsg.o rmcast.o rmtcp.o rmwinmask.o

LIBDIR= 
LIBS= -lpthread -lm

CC	= gcc
LDFLAGS =
CFLAGS	= -Wall -g
INCDIR  =
DEFINES = -DSINGLE_NACK -D_REENTRANT -DMALLOC_CHECK_ -DREFRESH -D_POSIX_PTHREAD_SEMANTICS -DSUPPORT_FOR_NEW_USERS -DRANDOM_TIMERS

#If you want to enable debug messages uncomment the following line. WARNING: This will generate a lot of messages!!
# DEFINES += -DDSINGLE_NACK  -DDEBUG_EVENTS -DDEBUG_CACHE -DEBUG_SHOW
# -DMUTEX -DDEBUG_NET_MSGS -DDEBUG_PCKT -DCACHE_CONTENTS -DSHOW_MSG_CONTENTS
# -DDSHOW_COMPLETE_MASK_IN_LOG

.SUFFIXES: .o .c


all: librmcast.a


solaris:
	make -f Makefile.solaris
       
.c.o:
	$(CC) $(DEFINES) $(CFLAGS) $(INCDIR) -c -o $@ $<


librmcast.a: $(OBJECTS)
	ar -rcv $@ $(OBJECTS)
	ranlib $@


clean:
	\rm -f $(OBJECTS) *core *~ *.bak *% rmcast *.o *.a server client
  

