# /* LICENSE:
#   =========================================================================
#     CMPack'03 Source Code Release for OPEN-R SDK v1.0
#     Copyright (C) 2003 Multirobot Lab [Project Head: Manuela Veloso]
#     School of Computer Science, Carnegie Mellon University
#     All rights reserved.
#   ========================================================================= */

C++ := g++

LFLAGS := 

CFLAGS := -g -DPLATFORM_LINUX -Wall

SUBDIRS := 

SRCS := \
	main.cc \
	LogExtractor.cc \
	FieldExtractor.cc \
	../shared/LogReader.cc \
	../shared/VisionRLEPacketDecoder.cc \
	../shared/VisionRawPacketDecoder.cc \
	../shared/PacketDecoder.cc \

OBJS := $(SRCS:.cc=.o)
DEPENDS := $(SRCS:%.cc=%.dep)

TARGET := logextract

all: $(SUBDIRS) $(TARGET)
	(cd ../../bin;\rm -rf $(TARGET);ln -s ../log_processing/log_extractor/$(TARGET))

.PHONY: $(SUBDIRS)

$(TARGET): $(OBJS)
	$(C++) -o $@ $(CFLAGS) $^ $(LFLAGS)

clean:
	rm -f $(OBJS)
	rm -f $(TARGET)
	rm -f ../../bin/$(TARGET)

depend:
	rm $(DEPENDS)

include $(DEPENDS)

%.o: %.cc
	$(C++) -c -o $@ $< $(CFLAGS)

%.dep: %.cc
	@echo "Generating dependencies for: " $<
	@$(CC) -M $(CFLAGS) $< > $@.tmp
	@echo -n "$@ " >$@
	@cat $@.tmp >>$@
	@rm $@.tmp
