The expiration time for new job artifacts in CI/CD pipelines is now 30 days (GitLab default). Previously generated artifacts in already completed jobs will not be affected by the change. The latest artifacts for all jobs in the latest successful pipelines will be kept. More information: https://gitlab.lrz.de/help/user/admin_area/settings/continuous_integration.html#default-artifacts-expiration

Commit 83af643a authored by Michael Ott's avatar Michael Ott
Browse files

Modify Makefile to accomodate split source trees

parent 81c6eeb6
include ../config.mk
CXXFLAGS = -O2 -g --std=c++11 -Wall -Wno-unused-local-typedefs -Wno-deprecated-declarations -Wno-unknown-warning-option -fmessage-length=0 -I$(DCDBDEPLOYPATH)/include/ -I$(DCDBBASEPATH)/include/ -DBOOST_DATE_TIME_POSIX_TIME_STD_CONFIG -I$(DCDBDEPSPATH)/cpp-netlib-0.12.0-final/deps/asio/asio/include -I$(DCDBDEPSPATH)/cpp-netlib-0.12.0-final -I$(DCDBDEPSPATH)/cpp-netlib-0.12.0-final/deps/cxxopts/src -DASIO_HEADER_ONLY -DBOOST_TEST_DYN_LINK
CXXFLAGS = -O2 -g --std=c++11 -Wall -Wno-unused-local-typedefs -Wno-deprecated-declarations -Wno-unknown-warning-option -fmessage-length=0 -I$(DCDBDEPLOYPATH)/include/ -I../include/ -DBOOST_DATE_TIME_POSIX_TIME_STD_CONFIG -I$(DCDBDEPSPATH)/cpp-netlib-0.12.0-final/deps/asio/asio/include -I$(DCDBDEPSPATH)/cpp-netlib-0.12.0-final -I$(DCDBDEPSPATH)/cpp-netlib-0.12.0-final/deps/cxxopts/src -DASIO_HEADER_ONLY -DBOOST_TEST_DYN_LINK
OBJS = collectagent.o \
sensorcache.o \
......
MAKEFILENAME := $(lastword $(MAKEFILE_LIST))
include config.mk
LIBRARIES = lib
PROJECTS = CollectAgent tools scripts
......@@ -22,13 +21,9 @@ DISTFILES = apache-cassandra-$(CASSANDRA_VERSION).tar.gz;http://archive.apache.o
libuv-v$(LIBUV_VERSION).tar.gz;http://dist.libuv.org/dist/v$(LIBUV_VERSION)/libuv-v$(LIBUV_VERSION).tar.gz \
cpp-netlib-$(CPPNET_VERSION).tar.gz;http://downloads.cpp-netlib.org/0.12.0/cpp-netlib-$(CPPNET_VERSION).tar.gz
DISTFILES_HASHES = apache-cassandra-2.2.6.tar.gz;8e2a8696ced6c4f9db06c40b2f5a7936;mosquitto-1.3.5.tar.gz;55094ad4dc7c7985377f43d4fc3d09da;boost_1_58_0.tar.gz;5a5d5614d9a07672e1ab2a250b5defc5;openssl-1.0.1u.tar.gz;130bb19745db2a5a09f22ccbbf7e69d0;cpp-driver-2.0.1.tar.gz;70bf83e1cbd0d35b7e5ed66fc4dccbb1;libuv-v0.10.36.tar.gz;8eb77b4fee4f311c114a9fee06f5a2ab;cpp-netlib-0.12.0-final.tar.gz;29b87c0e8c1a9e7fbdea5afcec947d53
DISTFILES_HASHES = apache-cassandra-2.2.6.tar.gz|8e2a8696ced6c4f9db06c40b2f5a7936;mosquitto-1.3.5.tar.gz|55094ad4dc7c7985377f43d4fc3d09da;boost_1_58_0.tar.gz|5a5d5614d9a07672e1ab2a250b5defc5;openssl-1.0.1u.tar.gz|130bb19745db2a5a09f22ccbbf7e69d0;cpp-driver-2.0.1.tar.gz|70bf83e1cbd0d35b7e5ed66fc4dccbb1;libuv-v0.10.36.tar.gz|8eb77b4fee4f311c114a9fee06f5a2ab;cpp-netlib-0.12.0-final.tar.gz|29b87c0e8c1a9e7fbdea5afcec947d53
FETCH = wget -c --no-check-certificate -O -
MD5 = $(if $(shell which md5),md5,$(if $(shell md5sum --tag Makefile 2&> /dev/null || true),md5sum --tag,openssl md5 <))
MAKETHREADS ?= $(if $(findstring $(shell uname),Darwin),$(shell sysctl machdep.cpu.thread_count | cut -b 27-),\
$(if $(findstring $(shell uname),Linux),$(shell cat /proc/cpuinfo | grep processor | wc -l),4))
include common.mk
CASSANDRA_CLUSTER_NAME = Datacenter Monitor Database
CASSANDRA_FLUSH_LARGEST_MEMTABLES_AT = 0.5
......@@ -42,36 +37,14 @@ CASSANDRA_TOMBSTONE_FAILURE_THRESHOLD = 10000000
HTTPD_PORT = 8080
DISTFILESNAMES = $(foreach f,$(DISTFILES),$(shell echo "$(f)" | sed 's/;.*//'))
DISTFILESPATHS = $(foreach f,$(DISTFILES),$(shell echo "$(f)" | sed 's/.tar.gz;.*//' | sed 's/.zip;.*//' ))
# If cross-compiling for ARM, adjust the build settings
ifeq ("$(ARCH)", "arm")
ifeq ("$(CROSS_COMPILE)", "")
$(error "If you want to cross compile for ARM, you must set the CROSS_COMPILE variable with your cross compiler prefix")
endif
CROSS_COMPILE_STRP = $(CROSS_COMPILE:-=)
CC = "$(CROSS_COMPILE)gcc"
CXX = "$(CROSS_COMPILE)g++"
CMAKE_CROSS_FLAGS = -DCMAKE_C_COMPILER=$(CC) \
-DCMAKE_CXX_COMPILER=$(CXX) \
-DCMAKE_FIND_ROOT_PATH=/usr/$(CROSS_COMPILE_STRP) \
-DCMAKE_LIBRARY_PATH=$(DCDBDEPLOYPATH)/lib \
-DCMAKE_INCLUDE_PATH=$(DCDBDEPLOYPATH)/include
AUTOCONF_CROSS_FLAGS = --host=$(CROSS_COMPILE_STRP)
SKIP_PROJECTS = IPMIPusher MontBlancPusher
OPENSSL_TARGET = "linux-generic32"
else
OPENSSL_TARGET = $(if $(findstring $(shell uname),Darwin),"darwin64-x86_64-cc","linux-x86_64")
LRT = $(if $(findstring $(shell uname),Darwin),"","-lrt")
CMAKE_CROSS_FLAGS = ""
AUTOCONF_CROSS_FLAGS = ""
SKIP_PROJECTS = ""
endif
CFLAGS += -I$(DCDBDEPLOYPATH)/include -O2 -g
CXX11FLAGS = --std=c++11 -Wno-c99-extensions -Wno-missing-field-initializers -DBOOST_DATE_TIME_POSIX_TIME_STD_CONFIG -Wno-unused-local-typedef
LDFLAGS += -L$(DCDBDEPLOYPATH)/lib -O2 -g
PUBHEADERS = pusherpqueue.h dcdbdaemon.h
.PHONY : info all clean cleanall distclean check-cross-compile $(LIBRARIES) $(PROJECTS)
......@@ -133,9 +106,10 @@ update-distfile-hashes: .md5sums
.md5sums: $(DCDBDEPSPATH)/.download-distfiles
@$(foreach f,$(DISTFILESNAMES),echo "Checksumming $(f)..." && printf "$(f);" >> .md5sums && $(MD5) $(DCDBDEPSPATH)/distfiles/$(f) | sed -e 's/.*\ //' >> .md5sums; )
all: check-cross-compile $(DCDBDEPSPATH)/.prerequesites
@make $(LIBRARIES)
@make $(PROJECTS)
all: check-cross-compile $(foreach f,$(DISTFILESPATHS),$(DCDBDEPSPATH)/$(f)/.installed) $(LIBRARIES) $(PROJECTS)
@mkdir -p $(DCDBDEPLOYPATH)/include/dcdb
cd include && install $(PUBHEADERS) $(DCDBDEPLOYPATH)/include/dcdb && cd ..
@echo DONE
check-cross-compile:
@if [ "$(ARCH)" = "arm" ]; then \
......@@ -143,140 +117,86 @@ check-cross-compile:
echo; \
fi;
$(DCDBDEPSPATH)/.prerequesites: $(DCDBDEPSPATH)/.extract-distfiles
@echo ""
@echo "Preparing patches..."
@cp -a patches $(DCDBDEPSPATH)/
$(eval S := $(shell echo "$(DISTFILESPATHS)" | sed 's/.*openssl/openssl/' | sed 's/\ .*//'))
@if [ ! -e $(DCDBDEPSPATH)/$(S)/.installed ]; then \
echo ""; \
echo "Building OpenSSL library..."; \
cd $(DCDBDEPSPATH)/$(S) && ./Configure shared --prefix=$(DCDBDEPLOYPATH) $(OPENSSL_TARGET); \
cd $(DCDBDEPSPATH)/$(S) && make && make install_sw && touch $(DCDBDEPSPATH)/$(S)/.installed; \
else \
echo "Skipping OpenSSL library (already built)..."; \
fi
$(DCDBDEPSPATH)/openssl-$(OPENSSL_VERSION)/.installed: $(DCDBDEPSPATH)/openssl-$(OPENSSL_VERSION)/.patched
@echo "Building OpenSSL library..."
cd $(@D) && ./Configure shared --prefix=$(DCDBDEPLOYPATH) $(OPENSSL_TARGET)
cd $(@D) && make && make install_sw && touch $(@)
$(eval M := $(shell echo "$(DISTFILESPATHS)" | sed 's/.*mosquitto/mosquitto/' | sed 's/\ .*//'))
@if [ ! -e $(DCDBDEPSPATH)/$(M)/.installed ]; then \
echo ""; \
echo "Building Mosquitto library..."; \
if [ -e $(DCDBDEPSPATH)/patches/$(M).patch ]; then \
echo "Patching Mosquitto..."; \
cd $(DCDBDEPSPATH)/$(M) && (patch -N -p0 < $(DCDBDEPSPATH)/patches/$(M).patch || true); \
fi; \
mkdir -p $(DCDBDEPSPATH)/mosquitto_build; \
cd $(DCDBDEPSPATH)/mosquitto_build && \
$(DCDBDEPSPATH)/mosquitto-$(MOSQUITTO_VERSION)/.installed: $(DCDBDEPSPATH)/mosquitto-$(MOSQUITTO_VERSION)/.patched
@echo "Building Mosquitto library...";
mkdir -p $(DCDBDEPSPATH)/mosquitto_build;
cd $(DCDBDEPSPATH)/mosquitto_build && \
cmake $(CMAKE_CROSS_FLAGS) \
-DOPENSSL_ROOT_DIR=$(DCDBDEPLOYPATH)/ \
-DWITH_SRV=no \
-DWITH_TLS=yes \
-DWITH_TLS_PSK=yes \
-DCMAKE_INSTALL_PREFIX:PATH=$(DCDBDEPLOYPATH)/ \
$(DCDBDEPSPATH)/$(M) && \
$(@D) && \
make -j $(MAKETHREADS) && make install && \
touch $(DCDBDEPSPATH)/$(M)/.installed; \
else \
echo "Skipping Mosquitto library (already built)..."; \
fi
$(eval B := $(shell echo "$(DISTFILESPATHS)" | sed 's/.*boost/boost/' | sed 's/\ .*//'))
@if [ ! -e $(DCDBDEPSPATH)/$(B)/.installed ]; then \
echo ""; \
echo "Building Boost..."; \
if [ -e $(DCDBDEPSPATH)/patches/$(B).patch ]; then \
echo "Patching Boost..."; \
cd $(DCDBDEPSPATH)/$(B) && (patch -N -p2 < $(DCDBDEPSPATH)/patches/$(B).patch || true); \
fi; \
if [ "$(ARCH)" = "arm" ]; then \
echo " using gcc : arm : $(CROSS_COMPILE)g++ ; " > $(DCDBDEPSPATH)/$(B)/tools/build/src/user-config.jam; \
fi; \
cd $(DCDBDEPSPATH)/$(B) && ./bootstrap.sh --prefix=$(DCDBDEPLOYPATH) \
--with-libraries=atomic,chrono,date_time,exception,filesystem,program_options,random,regex,system,thread,timer; \
cd $(DCDBDEPSPATH)/$(B) && \
./b2 -j $(MAKETHREADS) cxxflags="$(CXX11FLAGS)" install && touch $(DCDBDEPSPATH)/$(B)/.installed; \
else \
echo "Skipping Boost (already built)..."; \
fi
touch $(@)
$(eval U := $(shell echo "$(DISTFILESPATHS)" | sed 's/.*libuv/libuv/' | sed 's/\ .*//'))
@if [ ! -e $(DCDBDEPSPATH)/$(U)/.installed ]; then \
echo ""; \
echo "Building libuv..."; \
cd $(DCDBDEPSPATH)/$(U) && \
env CC="$(CC)" CFLAGS="$(CFLAGS)" make -j $(MAKETHREADS); \
echo "Installing libuv..."; \
mkdir -p $(DCDBDEPLOYPATH)/include/uv-private; \
cd $(DCDBDEPSPATH)/$(U) && install -c include/uv.h $(DCDBDEPLOYPATH)/include/; \
cd $(DCDBDEPSPATH)/$(U) && install -c include/uv-private/* $(DCDBDEPLOYPATH)/include/uv-private/; \
mkdir -p $(DCDBDEPLOYPATH)/lib/; \
if [ -e $(DCDBDEPSPATH)/$(U)/libuv.a ]; then cd $(DCDBDEPSPATH)/$(U) && install -c libuv.a $(DCDBDEPLOYPATH)/lib/; fi; \
if [ -e $(DCDBDEPSPATH)/$(U)/libuv.so ]; then cd $(DCDBDEPSPATH)/$(U) && install -c libuv.so $(DCDBDEPLOYPATH)/lib/; ln -s $(DCDBDEPLOYPATH)/lib/libuv.so $(DCDBDEPLOYPATH)/lib/libuv.so.0.10; fi; \
if [ -e $(DCDBDEPSPATH)/$(U)/libuv.dylib ]; then cd $(DCDBDEPSPATH)/$(U) && install -c libuv.dylib $(DCDBDEPLOYPATH)/lib/; fi; \
touch $(DCDBDEPSPATH)/$(U)/.installed; \
else \
echo "Skipping libuv (already built)..."; \
fi
$(eval D := $(shell echo "$(DISTFILESPATHS)" | sed 's/.*cpp-driver/cpp-driver/' | sed 's/\ .*//'))
@if [ ! -e $(DCDBDEPSPATH)/$(D)/.installed ]; then \
echo ""; \
echo "Building cpp-driver..."; \
if [ -e $(DCDBDEPSPATH)/patches/$(D).patch ]; then \
echo "Patching cpp-driver..."; \
cd $(DCDBDEPSPATH)/$(D) && (patch -N -p1 < $(DCDBDEPSPATH)/patches/$(D).patch || true); \
fi; \
mkdir -p $(DCDBDEPSPATH)/cpp-driver_build; \
cd $(DCDBDEPSPATH)/cpp-driver_build && \
cmake $(CMAKE_CROSS_FLAGS) \
-DCMAKE_CXX_FLAGS="$(CXX11FLAGS) -Wno-unused-command-line-argument -L$(DCDBDEPLOYPATH)/lib " \
-DOPENSSL_ROOT_DIR=$(DCDBDEPLOYPATH)/ \
-DLIBUV_ROOT_DIR=$(DCDBDEPLOYPATH)/ \
-DCASS_BUILD_EXAMPLES=NO \
-DCMAKE_INSTALL_LIBDIR=lib \
-DCMAKE_INSTALL_PREFIX=$(DCDBDEPLOYPATH)/ \
-DCMAKE_EXE_LINKER_FLAGS="-L$(DCDBDEPLOYPATH)/lib -lboost_random" \
-DCMAKE_SHARED_LINKER_FLAGS="-L$(DCDBDEPLOYPATH)/lib -lboost_random" \
$(DCDBDEPSPATH)/$(D) && \
make -j $(MAKETHREADS) && make install && \
touch $(DCDBDEPSPATH)/$(D)/.installed; \
else \
echo "Skipping cpp-driver (already built)..."; \
$(DCDBDEPSPATH)/boost_$(BOOST_VERSION_U)/.installed: $(DCDBDEPSPATH)/boost_$(BOOST_VERSION_U)/.patched
@echo "Building Boost..."
if [ "$(ARCH)" = "arm" ]; then \
echo " using gcc : arm : $(CROSS_COMPILE)g++ ; " > $(@D)/tools/build/src/user-config.jam; \
fi
cd $(@D) && ./bootstrap.sh --prefix=$(DCDBDEPLOYPATH) \
--with-libraries=atomic,chrono,date_time,exception,filesystem,program_options,random,regex,system,thread,timer \
cd $(@D) && ./b2 -j $(MAKETHREADS) cxxflags="$(CXX11FLAGS)" install && touch $(@)
$(DCDBDEPSPATH)/libuv-v$(LIBUV_VERSION)/.installed: $(DCDBDEPSPATH)/libuv-v$(LIBUV_VERSION)/.patched
@echo "Building libuv..."
cd $(@D) && env CC="$(CC)" CFLAGS="$(CFLAGS)" make -j $(MAKETHREADS)
@echo "Installing libuv..."
mkdir -p $(DCDBDEPLOYPATH)/include/uv-private
cd $(@D) && install -c include/uv.h $(DCDBDEPLOYPATH)/include/
cd $(@D) && install -c include/uv-private/* $(DCDBDEPLOYPATH)/include/uv-private/
mkdir -p $(DCDBDEPLOYPATH)/lib/
if [ -e $(@D)/libuv.a ]; then cd $(@D) && install -c libuv.a $(DCDBDEPLOYPATH)/lib/; fi
if [ -e $(@D)/libuv.so ]; then cd $(@D) && install -c libuv.so $(DCDBDEPLOYPATH)/lib/; ln -s $(DCDBDEPLOYPATH)/lib/libuv.so $(DCDBDEPLOYPATH)/lib/libuv.so.0.10; fi
if [ -e $(@D)/libuv.dylib ]; then cd $(@D) && install -c libuv.dylib $(DCDBDEPLOYPATH)/lib/; fi
touch $(@D)/.installed;
$(DCDBDEPSPATH)/cpp-driver-$(CPPDRV_VERSION)/.installed: $(DCDBDEPSPATH)/cpp-driver-$(CPPDRV_VERSION)/.patched
@echo "Building cpp-driver..."
mkdir -p $(DCDBDEPSPATH)/cpp-driver_build
cd $(DCDBDEPSPATH)/cpp-driver_build && \
cmake $(CMAKE_CROSS_FLAGS) \
-DCMAKE_CXX_FLAGS="$(CXX11FLAGS) -Wno-unused-command-line-argument -L$(DCDBDEPLOYPATH)/lib " \
-DOPENSSL_ROOT_DIR=$(DCDBDEPLOYPATH)/ \
-DLIBUV_ROOT_DIR=$(DCDBDEPLOYPATH)/ \
-DCASS_BUILD_EXAMPLES=NO \
-DCMAKE_INSTALL_LIBDIR=lib \
-DCMAKE_INSTALL_PREFIX=$(DCDBDEPLOYPATH)/ \
-DCMAKE_EXE_LINKER_FLAGS="-L$(DCDBDEPLOYPATH)/lib -lboost_random" \
-DCMAKE_SHARED_LINKER_FLAGS="-L$(DCDBDEPLOYPATH)/lib -lboost_random" \
$(@D) && \
make -j $(MAKETHREADS) && make install && \
touch $(@D)/.installed
$(eval N := $(shell echo "$(DISTFILESPATHS)" | sed 's/.*cpp-netlib/cpp-netlib/' | sed 's/\ .*//'))
@if [ ! -e $(DCDBDEPSPATH)/$(N)/.installed ]; then \
echo ""; \
echo "Building cpp-netlib..."; \
if [ -e $(DCDBDEPSPATH)/patches/$(N).patch ]; then \
echo "Patching cpp-netlib..."; \
cd $(DCDBDEPSPATH)/$(N) && (patch -N -p1 < $(DCDBDEPSPATH)/patches/$(N).patch || true); \
fi; \
mkdir -p $(DCDBDEPSPATH)/cpp-netlib_build; \
cd $(DCDBDEPSPATH)/cpp-netlib_build && \
cmake $(CMAKE_CROSS_FLAGS) \
-DCMAKE_CXX_FLAGS="$(CXX11FLAGS) -Wno-unused-command-line-argument -L$(DCDBDEPLOYPATH)/lib " \
-DCPP-NETLIB_ENABLE_HTTPS=off \
-DCPP-NETLIB_BUILD_TESTS=OFF \
-DCPP-NETLIB_BUILD_EXAMPLES=OFF \
-DCMAKE_INSTALL_LIBDIR=lib \
-DCMAKE_INSTALL_PREFIX=$(DCDBDEPLOYPATH)/ \
-DBOOST_LIBRARYDIR=$(DCDBDEPLOYPATH)/lib \
-DBOOST_ROOT=$(DCDBDEPSPATH)/$(B)/ \
$(DCDBDEPSPATH)/$(N) && \
make -j $(MAKETHREADS) && \
make install && \
touch $(DCDBDEPSPATH)/$(N)/.installed; \
else \
echo "Skipping cpp-netlib (already built)..."; \
fi
$(DCDBDEPSPATH)/cpp-netlib-$(CPPNET_VERSION)/.installed: $(DCDBDEPSPATH)/cpp-netlib-$(CPPNET_VERSION)/.patched
@echo "Building cpp-netlib..."
mkdir -p $(DCDBDEPSPATH)/cpp-netlib_build
cd $(DCDBDEPSPATH)/cpp-netlib_build && \
cmake $(CMAKE_CROSS_FLAGS) \
-DCMAKE_CXX_FLAGS="$(CXX11FLAGS) -Wno-unused-command-line-argument -L$(DCDBDEPLOYPATH)/lib " \
-DCPP-NETLIB_ENABLE_HTTPS=off \
-DCPP-NETLIB_BUILD_TESTS=OFF \
-DCPP-NETLIB_BUILD_EXAMPLES=OFF \
-DCMAKE_INSTALL_LIBDIR=lib \
-DCMAKE_INSTALL_PREFIX=$(DCDBDEPLOYPATH)/ \
-DBOOST_LIBRARYDIR=$(DCDBDEPLOYPATH)/lib \
-DBOOST_ROOT=$(DCDBDEPSPATH)/$(B)/ \
$(@D) && \
make -j $(MAKETHREADS) && \
make install && \
touch $(@D)/.installed
$(DCDBDEPSPATH)/apache-cassandra-$(CASSANDRA_VERSION)/.installed: $(DCDBDEPSPATH)/apache-cassandra-$(CASSANDRA_VERSION)/.patched $(DCDBDEPLOYPATH)
@echo ""
@echo "Staging and configuring Cassandra..."
@$(eval C := $(shell echo "$(DISTFILESPATHS)" | sed 's/.*apache-cassandra/apache-cassandra/' | sed 's/\ .*//'))
@rsync -rlptD $(DCDBDEPSPATH)/$(C)/ $(DCDBDEPLOYPATH)/cassandra
@rsync -rlptD $(@D)/ $(DCDBDEPLOYPATH)/cassandra
@$(eval P := $(shell echo "$(DCDBDEPLOYPATH)" | sed 's/\//\\\//g'))
@sed -i.original -e 's/\/var\/lib\/cassandra/$(P)\/var\/lib\/cassandra/g' $(DCDBDEPLOYPATH)/cassandra/conf/cassandra.yaml
@sed -i -e 's/.*cluster_name:.*/cluster_name:\ '\''$(CASSANDRA_CLUSTER_NAME)'\''/' $(DCDBDEPLOYPATH)/cassandra/conf/cassandra.yaml
......@@ -288,45 +208,9 @@ $(DCDBDEPSPATH)/.prerequesites: $(DCDBDEPSPATH)/.extract-distfiles
@sed -i -e 's/.*commitlog_segment_size_in_mb:.*/commitlog_segment_size_in_mb: $(CASSANDRA_COMMITLOG_SEGMENT_SIZE_IN_MB)/' $(DCDBDEPLOYPATH)/cassandra/conf/cassandra.yaml
@sed -i -e 's/.*tombstone_warn_threshold:.*/tombstone_warn_threshold: $(CASSANDRA_TOMBSTONE_WARN_THRESHOLD)/' $(DCDBDEPLOYPATH)/cassandra/conf/cassandra.yaml
@sed -i -e 's/.*tombstone_failure_threshold:.*/tombstone_failure_threshold: $(CASSANDRA_TOMBSTONE_FAILURE_THRESHOLD)/' $(DCDBDEPLOYPATH)/cassandra/conf/cassandra.yaml
@touch $(DCDBDEPSPATH)/.prerequesites
$(DCDBDEPSPATH)/.extract-distfiles: $(foreach f,$(DISTFILESPATHS),$(DCDBDEPSPATH)/$(f)/.dirstamp)
@touch $(DCDBDEPSPATH)/.extract-distfiles
$(DCDBDEPSPATH)/.download-distfiles: $(foreach f,$(DISTFILESNAMES),$(DCDBDEPSPATH)/distfiles/$(f))
@touch $(DCDBDEPSPATH)/.download-distfiles
$(DCDBDEPSPATH)/distfiles/%:
@mkdir -p $(DCDBDEPSPATH)/distfiles
$(eval F := $(shell echo "$@" | sed 's/.*\///'))
$(eval FF := $(shell echo "$(DISTFILES)" | sed 's/.*$(F);//' | sed 's/ .*//'))
@echo "Downloading $(FF) as $(F)..."
@cd $(DCDBDEPSPATH)/distfiles && $(FETCH) $(FF) > $(F)
@if [ "$(NOCHECK)" = "" ]; then \
printf "Verifying checksum... "; \
if [ "`echo "$(DISTFILES_HASHES)" | sed -e 's/.*$(F);//' | sed -e 's/;.*//';`" = "`$(MD5) $(DCDBDEPSPATH)/distfiles/$(F) | sed -e 's/.*\ //'`" ]; then \
echo "Checksum OK!"; \
else \
echo "Checksum FAIL!"; \
exit 2; \
fi \
else \
echo "Skipping checksum verification..."; \
fi
@echo ""
$(DCDBDEPSPATH)/%/.dirstamp: $(DCDBDEPSPATH)/.download-distfiles
$(eval F := $(shell echo "$@" | sed 's/\/.dirstamp//' | sed 's/.*\///'))
@echo "Extracting $(F)..."
@if [ "$(suffix $(shell ls $(DCDBDEPSPATH)/distfiles/$(F)*))" = ".gz" ]; then \
cd $(DCDBDEPSPATH) && tar xzf distfiles/$(F).tar.gz; \
else \
cd $(DCDBDEPSPATH) && unzip distfiles/$(F).zip > /dev/null; \
fi
@touch $@
$(LIBRARIES): $(DCDBDEPSPATH)/.prerequesites
$(LIBRARIES):
@echo ""
@echo "Building Library $@..."
@$(MAKE) -j $(MAKETHREADS) CC=$(CC) CXX=$(CXX) -C $@
......
DCDBBASEPATH ?= $(realpath $(dir $(lastword $(MAKEFILE_LIST)))/..)
DCDBDEPSPATH ?= $(DCDBBASEPATH)/deps
DCDBDEPLOYPATH ?= $(DCDBBASEPATH)/install
FETCH = wget -c --no-check-certificate -O
MD5 = $(if $(shell which md5 2>/dev/null),md5,$(if $(shell md5sum --tag Makefile 2&> /dev/null || true),md5sum --tag,openssl md5))
MAKETHREADS ?= $(if $(findstring $(shell uname),Darwin),$(shell sysctl machdep.cpu.thread_count | cut -b 27-),\
$(if $(findstring $(shell uname),Linux),$(shell cat /proc/cpuinfo | grep processor | wc -l),4))
DISTFILESNAMES = $(foreach f,$(DISTFILES),$(shell echo "$(f)" | sed 's/;.*//'))
DISTFILESPATHS = $(foreach f,$(DISTFILES),$(shell echo "$(f)" | sed 's/.tar.gz;.*//' | sed 's/.zip;.*//' ))
# If cross-compiling for ARM, adjust the build settings
ifeq ("$(ARCH)", "arm")
ifeq ("$(CROSS_COMPILE)", "")
$(error "If you want to cross compile for ARM, you must set the CROSS_COMPILE variable with your cross compiler prefix")
endif
CROSS_COMPILE_STRP = $(CROSS_COMPILE:-=)
CC = "$(CROSS_COMPILE)gcc"
CXX = "$(CROSS_COMPILE)g++"
CMAKE_CROSS_FLAGS = -DCMAKE_C_COMPILER=$(CC) \
-DCMAKE_CXX_COMPILER=$(CXX) \
-DCMAKE_FIND_ROOT_PATH=/usr/$(CROSS_COMPILE_STRP) \
-DCMAKE_LIBRARY_PATH=$(DCDBDEPLOYPATH)/lib \
-DCMAKE_INCLUDE_PATH=$(DCDBDEPLOYPATH)/include
AUTOCONF_CROSS_FLAGS = --host=$(CROSS_COMPILE_STRP)
else
LRT = $(if $(findstring $(shell uname),Darwin),"","-lrt")
CMAKE_CROSS_FLAGS = ""
AUTOCONF_CROSS_FLAGS = ""
endif
CFLAGS += -I$(DCDBDEPLOYPATH)/include -O2 -g
CXX11FLAGS = --std=c++11 -Wno-c99-extensions -Wno-missing-field-initializers -DBOOST_DATE_TIME_POSIX_TIME_STD_CONFIG -Wno-unused-local-typedef
LDFLAGS += -L$(DCDBDEPLOYPATH)/lib -O2 -g
.PHONY: all info
.PRECIOUS: $(DCDBDEPSPATH)/distfiles/% $(DCDBDEPSPATH)/%/.extracted $(DCDBDEPSPATH)/%/.patched
.SECONDEXPANSION:
getarchive = $(filter $1%,$(DISTFILESNAMES))
gethash = $(subst $(1)|,,$(filter $(1)%,$(subst ;, ,$(DISTFILES_HASHES))))
all: $(TARGET)
$(DCDBDEPSPATH):
@mkdir -p $(DCDBDEPSPATH)
$(DCDBDEPSPATH)/distfiles: $(DCDBDEPSPATH)
@mkdir -p $(DCDBDEPSPATH)/distfiles
$(DCDBDEPLOYPATH):
@mkdir -p $(DCDBDEPLOYPATH)
$(DCDBDEPSPATH)/distfiles/%: $(DCDBDEPSPATH)/distfiles
@echo "Download $(*)"
$(eval U := $(shell echo "$(DISTFILES)" | sed 's/.*$(*);//' | sed 's/ .*//'))
@if [ -e $(@) ]; then \
if [ `$(MD5) $(@)|sed -e 's/.*\ //'` = $(call gethash,$(*)) ]; then \
touch $(@); \
else \
rm $(@); \
fi; \
fi
@if [ ! -e $(@) ]; then \
$(FETCH) $(@) $(U); \
fi
$(DCDBDEPSPATH)/%/.extracted: $(DCDBDEPSPATH)/distfiles/$$(call getarchive,%)
$(eval F := $(notdir $(<)))
@if [ ! -e $(@) ]; then \
printf "Verifying checksum: $(F) "; \
if [ `$(MD5) $(<)|sed -e 's/.*\ //'` = $(call gethash,$(F)) ]; then \
echo " => OK!"; \
else \
echo " => FAIL!"; \
exit 2; \
fi; \
echo Extracting: $(F); \
if [ "$(suffix $(F))" = ".gz" ]; then \
cd $(DCDBDEPSPATH) && tar xzf distfiles/$(F); \
else \
cd $(DCDBDEPSPATH) && unzip distfiles/$(F) > /dev/null; \
fi; \
fi
@touch $@
$(DCDBDEPSPATH)/%/.patched: $(DCDBDEPSPATH)/%/.extracted
$(eval P := $(realpath patches))
@if [ ! -e $(@) && -e $(P)/$(*).patch ]; then \
echo Patching: $(*); \
cd $(@D) && (patch -N -p1 < $(P)/$(*).patch || true); \
fi
@touch $@
cleandeps:
@$(foreach f,$(DISTFILESPATHS),echo "Cleaning $(f)..." && rm -rf $(DCDBDEPSPATH)/$(f) $(DCDBDEPSPATH)/$(f)_build && echo;)
DCDBBASEPATH = $(realpath $(dir $(lastword $(MAKEFILE_LIST))))
DCDBBASEPATH ?= $(realpath $(dir $(lastword $(MAKEFILE_LIST)))/..)
DCDBDEPSPATH ?= $(DCDBBASEPATH)/deps
DCDBDEPLOYPATH ?= $(DCDBBASEPATH)/install
--- config.h 2014-10-28 18:38:17.000000000 +0100
+++ config.h 2014-10-28 18:38:27.000000000 +0100
--- mosquitto-1.3.5/config.h 2014-10-28 18:38:17.000000000 +0100
+++ mosquitto-1.3.5/config.h 2014-10-28 18:38:27.000000000 +0100
@@ -4,7 +4,7 @@
*
* Compile time options have moved to config.mk.
......
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