2014-10-23 21:39:15 +00:00
|
|
|
PLATFORM := $(shell uname -s)
|
2014-11-06 11:15:26 +00:00
|
|
|
MAKE = make
|
2014-10-23 21:39:15 +00:00
|
|
|
ifeq ($(PLATFORM),Darwin)
|
2014-10-29 10:38:21 +00:00
|
|
|
BUILD_DIR=darwin
|
2014-11-06 08:16:28 +00:00
|
|
|
else ifeq ($(PLATFORM),FreeBSD)
|
|
|
|
BUILD_DIR=freebsd
|
2014-11-06 11:15:26 +00:00
|
|
|
MAKE = gmake
|
2014-10-23 21:39:15 +00:00
|
|
|
else
|
2014-10-29 10:38:21 +00:00
|
|
|
DISTRO := $(shell if [ -f "/etc/redhat-release" ]; then echo "Centos"; fi)
|
|
|
|
ifeq ($(DISTRO),Centos)
|
|
|
|
BUILD_DIR=centos
|
|
|
|
else
|
|
|
|
BUILD_DIR=ubuntu
|
|
|
|
endif
|
2014-10-23 21:39:15 +00:00
|
|
|
endif
|
|
|
|
|
2014-11-09 00:55:19 +00:00
|
|
|
all: .setup
|
2014-11-09 10:07:49 +00:00
|
|
|
cd build/$(BUILD_DIR) && cmake -DCMAKE_BUILD_TYPE= ../.. && \
|
2014-11-12 20:52:04 +00:00
|
|
|
$(MAKE) --no-print-directory $(MAKEFLAGS)
|
2014-09-24 03:23:03 +00:00
|
|
|
|
2014-11-09 00:55:19 +00:00
|
|
|
debug: .setup
|
2014-10-29 10:38:21 +00:00
|
|
|
cd build/$(BUILD_DIR) && cmake -DCMAKE_BUILD_TYPE=Debug ../../ && \
|
2014-11-12 20:52:04 +00:00
|
|
|
$(MAKE) --no-print-directory $(MAKEFLAGS)
|
2014-10-27 16:34:13 +00:00
|
|
|
|
2014-11-09 00:55:19 +00:00
|
|
|
deps: .setup
|
|
|
|
./tools/provision.sh build build/$(BUILD_DIR)
|
2014-09-24 03:23:03 +00:00
|
|
|
|
|
|
|
distclean:
|
2014-10-29 10:38:21 +00:00
|
|
|
rm -rf .sources build/$(BUILD_DIR) doxygen/html doxygen/latex
|
2014-11-09 00:55:19 +00:00
|
|
|
ifeq ($(PLATFORM),Linux)
|
|
|
|
rm -rf build/linux
|
|
|
|
endif
|
2014-09-24 03:23:03 +00:00
|
|
|
|
2014-11-09 00:55:19 +00:00
|
|
|
.setup:
|
2014-10-29 10:38:21 +00:00
|
|
|
mkdir -p build/$(BUILD_DIR)
|
2014-11-09 00:55:19 +00:00
|
|
|
ifeq ($(PLATFORM),Linux)
|
|
|
|
ln -snf $(BUILD_DIR) build/linux
|
|
|
|
endif
|
|
|
|
|
|
|
|
%::
|
2014-11-12 20:52:04 +00:00
|
|
|
cd build/$(BUILD_DIR) && cmake ../.. && $(MAKE) --no-print-directory $@
|