SOCCER_LIB_DIR=../soccer_library
SOCCERLIB_CONFIG=$(SOCCER_LIB_DIR)/soccerlib-config --prefix=$(SOCCER_LIB_DIR)

CXX          = `$(SOCCERLIB_CONFIG) --c++`
MAKE_ARCHIVE = `$(SOCCERLIB_CONFIG) --make-archive`
RM    = rm
PRCS  = prcs
CHDIR = cd

CXXFLAGS = -g `$(SOCCERLIB_CONFIG) --cflags` \
	      $(CCXXOPTFLAGS) $(CXXOPTFLAGS) \
	      $(CCXXADDITIONALFLAGS) $(CXXADDITIONALFLAGS)

OBJS = monitor_supplyer.o log_supplyer.o client_log_debug_message_supplyer.o \
       debug_client_field_recog.o \
       view_snapshot.o active_repository.o file_reader.o

all: libdebug_server.a

library: libdebug_server.a
library-only: library
	$(RM) -f *.o

libdebug_server.a: $(OBJS)
	$(MAKE_ARCHIVE) libdebug_server.a $(OBJS)

clean:
	$(RM) -f *.o libdebug_server.a


#
# Revision Control
#
diff:
	@($(CHDIR) .. && $(PRCS) diff || true)

populate:
	@($(CHDIR) .. && $(PRCS) populate)

checkin:
	@($(CHDIR) .. && $(PRCS) checkin && $(RM) -f .*.prcs_aux)

.PHONY: all library library-only clean diff populate checkin


##
monitor_supplyer.o: monitor_supplyer.h monitor_supplyer.cc \
		    monitor_view_supplyer.h

log_supplyer.o: log_supplyer.h log_supplyer.cc \
		file_reader.h monitor_view_supplyer.h

client_log_debug_message_supplyer.o: client_log_debug_message_supplyer.h \
				     client_log_debug_message_supplyer.cc \
				     file_reader.h

debug_client_field_recog.o: debug_client_field_recog.h \
			    debug_client_field_recog.cc

view_snapshot.o: view_snapshot.h view_snapshot.cc \
		 debug_client_field_recog.h

active_repository.o: active_repository.h active_repository.cc \
		     monitor_supplyer.h log_supplyer.h \
		     client_log_debug_message_supplyer.h \
		     view_snapshot.h debug_client_field_recog.h \
		     file_reader.h

file_reader.o: file_reader.h file_reader.cc
