CCC=g++

INC_PATH=-I../include -I../include/libevent2
CFLAGS=-Wall -g $(INC_PATH) 

LIBS = -lMESA_handle_logger -lMESA_prof_load -lWiredLB
LIBS += -lssl -lcrypto
LIBS += ../lib/libtango_cache_client.a
LIBS += ./lib/libcurl.a ./lib/libevent.a ./lib/libxml2.a ./lib/libhiredis.a ./lib/libhiredis.a

OBJS = tango_cache_test.o
OBJS_EVBASE=cache_evbase_test.o
OBJS_EVBASE_THREADS=cache_evbase_test_threads.o

TARGET_EXE=tango_cache_test
TARGET_EXE_EVBASE=cache_evbase_test
TARGET_EXE_EVBASE_THREAD=cache_evbase_test_threads

ALL:$(TARGET_EXE) $(TARGET_EXE_EVBASE) $(TARGET_EXE_EVBASE_THREAD)

$(TARGET_EXE):$(OBJS)
	$(CCC) $(LDFLAGS) $^ -o $@ $(LIBS)

$(TARGET_EXE_EVBASE):$(OBJS_EVBASE)
	$(CCC) $(LDFLAGS) $^ -o $@ $(LIBS) -lpthread

$(TARGET_EXE_EVBASE_THREAD):$(OBJS_EVBASE_THREADS)
	$(CCC) $(LDFLAGS) $^ -o $@ $(LIBS) -lpthread

.c.o:
	$(CCC) $(CFLAGS) -c $<
.cpp.o:
	$(CCC) $(CFLAGS) -c $<

-include $(DEPS)

clean:
	rm -rf $(OBJS) $(TARGET_EXE) $(OBJS_EVBASE) $(TARGET_EXE_EVBASE) $(OBJS_EVBASE_THREADS) $(TARGET_EXE_EVBASE_THREAD)

