CXXFLAGS = -O0 -g -Wall -fmessage-length=0 -I../../thrift/lib/cpp/src/ -I/opt/local/include/ -I../../mosquitto-1.1/lib/ OBJS = CollectAgent.o cassandra/Cassandra.o cassandra/cassandra_constants.o cassandra/cassandra_types.o LIBS = -L../../thrift/lib/cpp/.libs/ -lthrift -L../../mosquitto-1.1/lib/ -lmosquitto -lssl -lcrypto -lpthread TARGET = CollectAgent SUBTARGETS = cassandra-lib check-thrift-env P = $(shell cd ../../thrift/lib/cpp/.libs/;pwd) Q = $(shell cd ../../mosquitto-1.1/lib/;pwd) U = $(shell uname) $(TARGET): $(SUBTARGETS) $(OBJS) $(CXX) -o $(TARGET) $(OBJS) $(LIBS) all: $(TARGET) check-thrift-env: @if [ "$U" = "Darwin" ]; then \ R=`echo $$DYLD_LIBRARY_PATH | grep $P`; \ if [ "$$R" = "" ]; then \ echo "******************************************"; echo "Please type the following line before running: "; echo ' export DYLD_LIBRARY_PATH=$$DYLD_LIBRARY_PATH:$P'; echo "******************************************"; \ fi; \ fi @if [ "$U" = "Linux" ]; then \ R=`echo $$LD_LIBRARY_PATH | grep $P`; \ if [ "$$R" = "" ]; then \ echo "******************************************"; echo "Please type the following line before running: "; echo ' export LD_LIBRARY_PATH=$$LD_LIBRARY_PATH:$P:$Q'; echo "******************************************"; \ fi; \ fi cassandra-lib: cassandra-headers @if [ "$U" = "Linux" ]; then \ echo -n "Fixing Thrift includes... "; \ sed -i '1i#include ' cassandra/cassandra_types.h; \ sed -i '1i#include ' cassandra/Cassandra.h; \ echo "Done."; \ fi cassandra-headers: @if [ ! -e cassandra ]; then \ printf "Building Thrift interface headers... "; \ ../../thrift/compiler/cpp/thrift --gen cpp ../../cassandra/interface/cassandra.thrift; \ mv gen-cpp cassandra; \ echo "Done."; \ fi clean: clean-cassandra-headers rm -f $(OBJS) $(TARGET) clean-cassandra-headers: rm -rf cassandra