CC				=	gcc
CFLAGS			+=  -Wall    -DEIGERD    -DPCCOMPILE -DSTOP_SERVER  #-DVERBOSE 
CFLAGS			+= -DVIRTUAL -DVIRTUAL_9M
MASTERFLAG		+= -DVIRTUAL_MASTER
LDLIBS			+= 	-lm  -lstdc++ -pthread

DESTDIR			?= 	bin

SRC_CLNT		=	communication_funcs.c slsDetectorServer.c slsDetectorServer_funcs.c  slsDetectorFunctionList.c 



all: clean master slave

	
master: $(SRC_CLNT)
	mkdir -p $(DESTDIR) 
	$(CC)  -o eigerDetectorServer_virtualMaster $(SRC_CLNT) $(CFLAGS) $(MASTERFLAG) $(LDLIBS) 	
	mv eigerDetectorServer_virtualMaster $(DESTDIR)
	
slave: $(SRC_CLNT)
	mkdir -p $(DESTDIR) 
	$(CC)  -o eigerDetectorServer_virtualSlave $(SRC_CLNT) $(CFLAGS) $(LDLIBS) 	
	mv eigerDetectorServer_virtualSlave $(DESTDIR)

clean:
	rm -rf $(DESTDIR)/eigerDetectorServer_virtualMaster $(DESTDIR)/eigerDetectorServer_virtualSlave *.o
	