Commit 943110ef authored by Axel Auweter's avatar Axel Auweter
Browse files

Second half of build system rework.

parent 1bd046cb
CXXFLAGS = -O0 -g -Wall -fmessage-length=0 -I../../thrift/lib/cpp/src/ -I/opt/local/include/ -I../../mosquitto-1.1/lib/
DCDBBUILDPATH ?= $(PWD)/build/
DCDBDEPLOYPATH ?= $(DCDBBUILDPATH)/deploy/
CXXFLAGS = -O0 -g -Wall -fmessage-length=0 -I$(DCDBDEPLOYPATH)/include/
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
LIBS = -L$(DCDBDEPLOYPATH)/lib/ -lthrift -lmosquitto -lssl -lcrypto -lpthread
TARGET = CollectAgent
SUBTARGETS = cassandra-lib check-thrift-env
SUBTARGETS = cassandra-lib
P = $(shell cd ../../thrift/lib/cpp/.libs/;pwd)
Q = $(shell cd ../../mosquitto-1.1/lib/;pwd)
P = $(shell cd $(DCDBDEPLOYPATH)/lib/ && pwd)
U = $(shell uname)
$(TARGET): $(SUBTARGETS) $(OBJS)
......@@ -27,12 +26,12 @@ check-thrift-env:
@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 "******************************************"; \
echo "******************************************"; echo "Please type the following line before running: "; echo ' export LD_LIBRARY_PATH=$$LD_LIBRARY_PATH:$P'; echo "******************************************"; \
fi; \
fi
cassandra-lib: cassandra-headers
cassandra-lib: cassandra
@if [ "$U" = "Linux" ]; then \
echo -n "Fixing Thrift includes... "; \
sed -i '1i#include <stdint.h>' cassandra/cassandra_types.h; \
......@@ -40,10 +39,10 @@ cassandra-lib: cassandra-headers
echo "Done."; \
fi
cassandra-headers:
cassandra:
@if [ ! -e cassandra ]; then \
printf "Building Thrift interface headers... "; \
../../thrift/compiler/cpp/thrift --gen cpp ../../cassandra/interface/cassandra.thrift; \
$(DCDBDEPLOYPATH)/bin/thrift --gen cpp $(DCDBBUILDPATH)/apache-cassandra-1.2.3/interface/cassandra.thrift; \
mv gen-cpp cassandra; \
echo "Done."; \
fi
......@@ -53,3 +52,6 @@ clean: clean-cassandra-headers
clean-cassandra-headers:
rm -rf cassandra
install: $(TARGET) check-thrift-env
install $(TARGET) $(DCDBDEPLOYPATH)/bin/
CXXFLAGS = -O2 -g -Wall -Werror -fmessage-length=0 -I../../mosquitto-1.1/lib/
DCDBBUILDPATH ?= $(PWD)/build/
DCDBDEPLOYPATH ?= $(DCDBBUILDPATH)/deploy/
CXXFLAGS = -O2 -g -Wall -Werror -fmessage-length=0 -I$(DCDBDEPLOYPATH)/include/
OBJS = FileSpewer.o Settings.o
LIBS = -L../../mosquitto-1.1/lib/ -lmosquitto -lssl -lcrypto -lpthread
LIBS = -L$(DCDBDEPLOYPATH)/lib/ -lmosquitto -lssl -lcrypto -lpthread
TARGET = FileSpewer
.PHONY : all clean install
$(TARGET): $(OBJS)
$(CXX) -o $(TARGET) $(OBJS) $(LIBS)
......@@ -13,3 +15,6 @@ all: $(TARGET)
clean:
rm -f $(OBJS) $(TARGET)
install: $(TARGET)
install $(TARGET) $(DCDBDEPLOYPATH)/bin/
CXXFLAGS = -O2 -g -Wall -Werror -I../include
DCDBBUILDPATH ?= $(PWD)/build/
DCDBDEPLOYPATH ?= $(DCDBBUILDPATH)/deploy/
CXXFLAGS = -O2 -g -Wall -Werror -I$(DCDBDEPLOYPATH)/include
OBJS = sysfsagent.o helper.o
LIBS = -L../lib -lrudeconfig -lmosquitto -lssl -lcrypto -lpthread
LIBS = -L$(DCDBDEPLOYPATH)/lib -lrudeconfig -lmosquitto -lssl -lcrypto -lpthread
TARGET = sysfsagent
$(TARGET): $(OBJS)
......@@ -13,3 +13,6 @@ all: $(TARGET)
clean:
rm -f $(OBJS) $(TARGET)
install: $(TARGET)
install $(TARGET) $(DCDBDEPLOYPATH)/bin/
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment