ifndef ROOT
	ROOT = ../..
endif

include         $(ROOT)/config.mak

INCLDIR		= $(ROOT)/INCLUDE
LIBDIR		= $(ROOT)/LIB
BINS		= sima mig-agents
HEADERS		= sim-parameters.h utils.h user_event_handlers.h msg_definition.h entity_definition.h
#------------------------------------------------------------------------------

CFLAGS		+= $(OPTFLAGS) -I. -I$(INCLDIR) `pkg-config --cflags glib-2.0`
LDFLAGS		= -L$(LIBDIR)
LIBS		= -lartis_static -lpthread -lm `pkg-config --libs glib-2.0`
LDFLAGS		+= $(LIBS)
#------------------------------------------------------------------------------

all:	$(BINS) 

mig-agents:	mig-agents.o utils.o user_event_handlers.o $(HEADERS)
	$(CC) -o $@ $(CFLAGS) mig-agents.o utils.o user_event_handlers.o $(LDFLAGS)

.c:
	$(CC) -o $@ $(CFLAGS) $< $(LDFLAGS) 

#------------------------------------------------------------------------------

clean :
	rm -f  $(BINS) *.o *~ 
	rm -f  *.out *.err  

cleanall : clean 
	rm -f  Migrazioni.txt *.res 
#------------------------------------------------------------------------------
