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

CC      = `$(SOCCERLIB_CONFIG) --cc`
CXX     = `$(SOCCERLIB_CONFIG) --c++`
MAKE_AR = `$(SOCCERLIB_CONFIG) --make-ar`
RM    = rm
PRCS  = prcs
CHDIR = cd

CFLAGS   = -g `$(SOCCERLIB_CONFIG) --cflags` \
	      $(CCXXOPTFLAGS) $(COPTFLAGS) \
	      $(CCXXADDITIONALFLAGS) $(CADDITIONALFLAGS)

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

OBJS = sserver_monitor_log_format.o monitor_view_data.o \
       monitor_supplyer.o log_supplyer.o \
       debug_client_field_recog.o \
       view_snapshot.o active_repository.o

all: libdebug_server.a

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

libdebug_server.a: $(OBJS)
	$(MAKE_AR) 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


##
sserver_monitor_log_format.o: sserver_monitor_log_format.h \
			      sserver_monitor_log_format.cc

monitor_view_data.o: monitor_view_data.h monitor_view_data.cc \
		     sserver_monitor_log_format.h

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

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

debug_client_field_recog.o: debug_client_field_recog.h \
			    debug_client_field_recog.cc \
			    $(SOCCER_INTERFACE_DIR)/field_recog_abstract.h \
			    $(SOCCER_INTERFACE_DIR)/field_recog_interface.h

view_snapshot.o: view_snapshot.h view_snapshot.cc \
		 monitor_view_data.h debug_client_field_recog.h \
		 $(SOCCER_INTERFACE_DIR)/field_recog_abstract.h \
		 $(SOCCER_INTERFACE_DIR)/field_recog_interface.h

active_repository.o: active_repository.h active_repository.cc \
		     view_snapshot.h \
		     monitor_view_data.h debug_client_field_recog.h \
		     sserver_monitor_log_format.h \
		     $(SOCCER_INTERFACE_DIR)/client_debug_view.h \
		     $(SOCCER_INTERFACE_DIR)/field_recog_abstract.h \
		     $(SOCCER_INTERFACE_DIR)/field_recog_interface.h
