1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-01-19 04:52:12 +01:00

Merged in amorale/LP-64_ccache_install (pull request #7)

LP-64 ccache install
This commit is contained in:
alessio morale 2015-07-31 14:36:10 +02:00
commit c86f035d2e
3 changed files with 59 additions and 15 deletions

3
.gitignore vendored
View File

@ -77,3 +77,6 @@ RemoteSystemsTempFiles
*.rej
*.orig
*.diff~
# ignore ccache storage
.ccache

View File

@ -1,5 +1,6 @@
#
# Top level Makefile for the OpenPilot project build system.
# Top level Makefile for the LibrePilot project build system.
# Copyright (c) 2015, The LibrePilot Project, http://www.librepilot.org
# Copyright (c) 2010-2013, The OpenPilot Team, http://www.openpilot.org
# Use 'make help' for instructions.
#
@ -912,6 +913,7 @@ help:
@$(ECHO) " uncrustify_install - Install the Uncrustify source code beautifier"
@$(ECHO) " doxygen_install - Install the Doxygen documentation generator"
@$(ECHO) " gtest_install - Install the GoogleTest framework"
@$(ECHO) " ccache_install - Install ccache"
@$(ECHO) " These targets are not updated yet and are probably broken:"
@$(ECHO) " openocd_install - Install the OpenOCD JTAG daemon"
@$(ECHO) " stm32flash_install - Install the stm32flash tool for unbricking F1-based boards"

View File

@ -1,5 +1,6 @@
#
# Installers for tools required by the OpenPilot build system.
# Copyright (c) 2015, The LibrePilot Project, http://www.librepilot.org
# Copyright (c) 2010-2013, The OpenPilot Team, http://www.openpilot.org
#
# NOTE: install targets are not tied to the default goals and must
@ -16,6 +17,7 @@
# uncrustify_install
# doxygen_install
# gtest_install
# ccache_install
#
# TODO:
# openocd_install
@ -100,12 +102,15 @@ else ifeq ($(UNAME), Windows)
endif
GTEST_URL := http://librepilot.github.io/tools/gtest-1.6.0.zip
CCACHE_URL := http://samba.org/ftp/ccache/ccache-3.2.2.tar.bz2
CCACHE_MD5_URL := http://librepilot.github.io/tools/ccache-3.2.2.tar.bz2.md5
ARM_SDK_DIR := $(TOOLS_DIR)/gcc-arm-none-eabi-4_9-2014q4
QT_SDK_DIR := $(TOOLS_DIR)/qt-5.4.1
UNCRUSTIFY_DIR := $(TOOLS_DIR)/uncrustify-0.60
DOXYGEN_DIR := $(TOOLS_DIR)/doxygen-1.8.3.1
GTEST_DIR := $(TOOLS_DIR)/gtest-1.6.0
CCACHE_DIR := $(TOOLS_DIR)/ccache
ifeq ($(UNAME), Linux)
else ifeq ($(UNAME), Darwin)
@ -132,7 +137,7 @@ QT_SDK_PREFIX := $(QT_SDK_DIR)
BUILD_SDK_TARGETS := arm_sdk qt_sdk
ifeq ($(UNAME), Windows)
BUILD_SDK_TARGETS += sdl nsis mesawin openssl
BUILD_SDK_TARGETS += sdl nsis mesawin openssl ccache
endif
ALL_SDK_TARGETS := $(BUILD_SDK_TARGETS) gtest uncrustify doxygen
@ -969,9 +974,43 @@ msys_version:
endif
##############################
#
# CCACHE
#
##############################
CCACHE_BUILD_DIR := $(BUILD_DIR)/ccache-3.2.2
define CCACHE_BUILD_TEMPLATE
$(V1) ( \
$(ECHO) $(MSG_CONFIGURING) $(call toprel, $(CCACHE_BUILD_DIR)) && \
cd $(CCACHE_BUILD_DIR) && \
./configure --prefix="$(CCACHE_DIR)" && \
$(ECHO) $(MSG_BUILDING) $(call toprel, $(CCACHE_BUILD_DIR)) && \
$(MAKE) $(MAKE_SILENT) && \
$(ECHO) $(MSG_INSTALLING) $(call toprel, $(CCACHE_DIR)) && \
$(MAKE) $(MAKE_SILENT) install \
)
@$(ECHO) $(MSG_CLEANING) $(call toprel, $(CCACHE_BUILD_DIR))
-$(V1) [ ! -d "$(CCACHE_BUILD_DIR)" ] || $(RM) -rf "$(CCACHE_BUILD_DIR)"
@$(ECHO)
@$(ECHO) "Setting up CCACHE configuration:"
$(V1) [ -d "$(ROOT_DIR)/.ccache" ] || mkdir $(ROOT_DIR)/.ccache
$(V1) [ -d "$(CCACHE_DIR)/etc" ] || mkdir $(CCACHE_DIR)/etc
$(V1) $(ECHO) $(QUOTE)cache_dir = $(ROOT_DIR)/.ccache $(QUOTE) > $(CCACHE_DIR)/etc/ccache.conf
$(V1) $(ECHO) $(QUOTE)max_size = 250M$(QUOTE) >> $(CCACHE_DIR)/etc/ccache.conf
$(V1) $(CAT) $(CCACHE_DIR)/etc/ccache.conf
endef
define CCACHE_CLEAN_TEMPLATE
-$(V1) [ ! -d "$(CCACHE_DIR)" ] || $(RM) -rf "$(CCACHE_DIR)"
endef
$(eval $(call TOOL_INSTALL_TEMPLATE,ccache,$(CCACHE_BUILD_DIR),$(CCACHE_URL),$(CCACHE_MD5_URL),$(notdir $(CCACHE_URL)),$(CCACHE_BUILD_TEMPLATE),$(CCACHE_CLEAN_TEMPLATE)))
##############################
#