mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-02-20 10:54:14 +01:00
Merge branch 'amorale/OP-835_linux_sdk_installer' into next
This commit is contained in:
commit
d2355c665d
142
make/tools.mk
142
make/tools.mk
@ -57,10 +57,14 @@ endif
|
||||
ifeq ($(UNAME), Linux)
|
||||
ifeq ($(ARCH), x86_64)
|
||||
ARM_SDK_URL := http://wiki.openpilot.org/download/attachments/18612236/gcc-arm-none-eabi-4_7-2013q1-20130313-linux-amd64.tar.bz2
|
||||
QT_SDK_URL := "Please install native Qt 5.1.x SDK using package manager"
|
||||
QT_SDK_URL := http://download.qt-project.org/official_releases/qt/5.1/5.1.1/qt-linux-opensource-5.1.1-x86_64-offline.run
|
||||
QT_SDK_MD5_URL := http://www.alessiomorale.com/download/qt-linux-opensource-5.1.1-x86_64-offline.run.md5
|
||||
QT_SDK_ARCH := gcc_64
|
||||
else
|
||||
ARM_SDK_URL := http://wiki.openpilot.org/download/attachments/18612236/gcc-arm-none-eabi-4_7-2013q1-20130313-linux-i686.tar.bz2
|
||||
QT_SDK_URL := "Please install native Qt 5.1.x SDK using package manager"
|
||||
QT_SDK_URL := http://download.qt-project.org/official_releases/qt/5.1/5.1.1/qt-linux-opensource-5.1.1-x86-offline.run
|
||||
QT_SDK_MD5_URL := http://www.alessiomorale.com/download/qt-linux-opensource-5.1.1-x86-offline.run.md5
|
||||
QT_SDK_ARCH := gcc
|
||||
endif
|
||||
UNCRUSTIFY_URL := http://wiki.openpilot.org/download/attachments/18612236/uncrustify-0.60.tar.gz
|
||||
DOXYGEN_URL := http://wiki.openpilot.org/download/attachments/18612236/doxygen-1.8.3.1.src.tar.gz
|
||||
@ -89,6 +93,7 @@ UNCRUSTIFY_DIR := $(TOOLS_DIR)/uncrustify-0.60
|
||||
DOXYGEN_DIR := $(TOOLS_DIR)/doxygen-1.8.3.1
|
||||
GTEST_DIR := $(TOOLS_DIR)/gtest-1.6.0
|
||||
|
||||
QT_SDK_PREFIX := $(QT_SDK_DIR)
|
||||
##############################
|
||||
#
|
||||
# Build only and all toolchains available for the platform
|
||||
@ -128,15 +133,17 @@ export CUT := cut
|
||||
export SED := sed
|
||||
|
||||
# Used only by this Makefile
|
||||
GIT := git
|
||||
GIT := git
|
||||
CURL := curl
|
||||
TAR := tar
|
||||
TAR := tar
|
||||
UNZIP := unzip
|
||||
OPENSSL := openssl
|
||||
ANT := ant
|
||||
ANT := ant
|
||||
JAVAC := javac
|
||||
JAR := jar
|
||||
|
||||
JAR := jar
|
||||
SEVENZIP := 7z
|
||||
CD := cd
|
||||
GREP := grep
|
||||
# Echo in recipes is a bit tricky in a Windows Git Bash window in some cases.
|
||||
# It does not work if make started under msysGit installed into a path with spaces.
|
||||
ifneq ($(UNAME), Windows)
|
||||
@ -186,9 +193,9 @@ endif
|
||||
|
||||
# Batch mode
|
||||
ifeq ($(BATCH), 1)
|
||||
CURL_OPTIONS := --silent
|
||||
CURL_OPTIONS := --silent -L
|
||||
else
|
||||
CURL_OPTIONS :=
|
||||
CURL_OPTIONS := -L
|
||||
endif
|
||||
|
||||
# MSYS tar workaround
|
||||
@ -220,6 +227,30 @@ define MD5_CHECK_TEMPLATE
|
||||
"`test -f \"$(1)\" && $(OPENSSL) dgst -md5 \"$(1)\" | $(CUT) -f2 -d' '`" $(2) "`$(CUT) -f1 -d' ' < \"$(1).md5\"`"
|
||||
endef
|
||||
|
||||
##############################
|
||||
#
|
||||
# Cross platform download template
|
||||
# $(1) = Package URL
|
||||
# $(2) = Package file
|
||||
# $(3) = URL for .md5 file to be tested against Package
|
||||
#
|
||||
##############################
|
||||
|
||||
define DOWNLOAD_TEMPLATE
|
||||
@$(ECHO) $(MSG_VERIFYING) $$(call toprel, $(DL_DIR)/$(2))
|
||||
$(V1) ( \
|
||||
cd "$(DL_DIR)" && \
|
||||
$(CURL) $(CURL_OPTIONS) --silent -o "$(DL_DIR)/$(2).md5" "$(3)" && \
|
||||
if [ $(call MD5_CHECK_TEMPLATE,$(DL_DIR)/$(2),!=) ]; then \
|
||||
$(ECHO) $(MSG_DOWNLOADING) $(1) && \
|
||||
$(CURL) $(CURL_OPTIONS) -o "$(DL_DIR)/$(2)" "$(1)" && \
|
||||
$(ECHO) $(MSG_CHECKSUMMING) $$(call toprel, $(DL_DIR)/$(2)) && \
|
||||
[ $(call MD5_CHECK_TEMPLATE,$(DL_DIR)/$(2),=) ]; \
|
||||
fi; \
|
||||
)
|
||||
endef
|
||||
|
||||
|
||||
##############################
|
||||
#
|
||||
# Common tool install template
|
||||
@ -237,17 +268,8 @@ define TOOL_INSTALL_TEMPLATE
|
||||
.PHONY: $(addprefix $(1)_, install clean distclean)
|
||||
|
||||
$(1)_install: $(1)_clean | $(DL_DIR) $(TOOLS_DIR)
|
||||
@$(ECHO) $(MSG_VERIFYING) $$(call toprel, $(DL_DIR)/$(4))
|
||||
$(V1) ( \
|
||||
cd "$(DL_DIR)" && \
|
||||
$(CURL) $(CURL_OPTIONS) --silent -o "$(DL_DIR)/$(4).md5" "$(3).md5" && \
|
||||
if [ $(call MD5_CHECK_TEMPLATE,$(DL_DIR)/$(4),!=) ]; then \
|
||||
$(ECHO) $(MSG_DOWNLOADING) $(3) && \
|
||||
$(CURL) $(CURL_OPTIONS) -o "$(DL_DIR)/$(4)" "$(3)" && \
|
||||
$(ECHO) $(MSG_CHECKSUMMING) $$(call toprel, $(DL_DIR)/$(4)) && \
|
||||
[ $(call MD5_CHECK_TEMPLATE,$(DL_DIR)/$(4),=) ]; \
|
||||
fi; \
|
||||
)
|
||||
|
||||
$(call DOWNLOAD_TEMPLATE,$(3),$(4),"$(3).md5")
|
||||
|
||||
@$(ECHO) $(MSG_EXTRACTING) $$(call toprel, $(2))
|
||||
$(V1) $(MKDIR) -p $$(call toprel, $(dir $(2)))
|
||||
@ -271,6 +293,73 @@ $(1)_distclean:
|
||||
|
||||
endef
|
||||
|
||||
##############################
|
||||
#
|
||||
# Linux QT install template
|
||||
# $(1) = tool temp extract/build directory
|
||||
# $(2) = tool install directory
|
||||
# $(3) = tool distribution URL
|
||||
# $(4) = tool distribution .md5 URL
|
||||
# $(5) = tool distribution file
|
||||
# $(6) = QT architecture
|
||||
# $(7) = optional extra build recipes template
|
||||
# $(8) = optional extra clean recipes template
|
||||
#
|
||||
##############################
|
||||
|
||||
define LINUX_QT_INSTALL_TEMPLATE
|
||||
|
||||
.PHONY: $(addprefix qt_sdk_, install clean distclean)
|
||||
|
||||
qt_sdk_install: qt_sdk_clean | $(DL_DIR) $(TOOLS_DIR)
|
||||
|
||||
$(call DOWNLOAD_TEMPLATE,$(3),$(5),"$(4)")
|
||||
# Explode .run file into install packages
|
||||
@$(ECHO) $(MSG_EXTRACTING) $$(call toprel, $(1))
|
||||
$(V1) $(MKDIR) -p $$(call toprel, $(dir $(1)))
|
||||
$(V1) chmod +x $(DL_DIR)/$(5)
|
||||
$(V1) $(DL_DIR)/$(5) --dump-binary-data -o $(1)
|
||||
# Extract packages under tool directory
|
||||
$(V1) $(MKDIR) -p $$(call toprel, $(dir $(2)))
|
||||
$(V1) $(SEVENZIP) -y -o$(2) x "$(1)/qt.readme/1.0.0qt-project-url.7z" | grep -v Extracting
|
||||
$(V1) $(SEVENZIP) -y -o$(2) x "$(1)/qt/1.0.0ThirdPartySoftware_Listing.7z" | grep -v Extracting
|
||||
$(V1) $(SEVENZIP) -y -o$(2) x "$(1)/qt.readme/1.0.0readme.7z" | grep -v Extracting
|
||||
$(V1) $(SEVENZIP) -y -o$(2) x "$(1)/qt.511.$(6).essentials/5.1.1$(6)_qt5_essentials.7z" | grep -v Extracting
|
||||
$(V1) if [ -f "$(1)/qt.511.$(6).essentials/5.1.1icu_51_1_ubuntu_11_10_64.7z" ]; then $(SEVENZIP) -y -o$(2) x "$(1)/qt.511.$(6).essentials/5.1.1icu_51_1_ubuntu_11_10_64.7z" | grep -v Extracting; fi
|
||||
$(V1) if [ -f "$(1)/qt.511.$(6).essentials/5.1.1icu_51_1_ubuntu_11_10_32.7z" ]; then $(SEVENZIP) -y -o$(2) x "$(1)/qt.511.$(6).essentials/5.1.1icu_51_1_ubuntu_11_10_32.7z" | grep -v Extracting; fi
|
||||
$(V1) $(SEVENZIP) -y -o$(2) x "$(1)/qt.511.$(6).essentials/5.1.1icu_path_patcher.sh.7z" | grep -v Extracting
|
||||
$(V1) $(SEVENZIP) -y -o$(2) x "$(1)/qt.511.$(6).addons/5.1.1$(6)_qt5_addons.7z" | grep -v Extracting
|
||||
# go to OpenPilot/tools/5.1.1/gcc_64 and call patcher.sh
|
||||
@$(ECHO)
|
||||
@$(ECHO) "Running patcher in" $$(call toprel, $(QT_SDK_PREFIX))
|
||||
$(V1) $(CD) $(QT_SDK_PREFIX)
|
||||
$(V1) "$(QT_SDK_PREFIX)/patcher.sh" $(QT_SDK_PREFIX)
|
||||
# call qmake patcher
|
||||
@$(ECHO) "Executing QtPatch in" $$(call toprel, $(QT_SDK_PREFIX))
|
||||
$(V1) $(DL_DIR)/$(5) --runoperation QtPatch linux $(QT_SDK_PREFIX) qt5
|
||||
|
||||
# Execute post build templates
|
||||
$(7)
|
||||
|
||||
# Clean up temporary files
|
||||
@$(ECHO) $(MSG_CLEANING) $$(call toprel, $(1))
|
||||
$(V1) [ ! -d "$(1)" ] || $(RM) -rf "$(1)"
|
||||
|
||||
qt_sdk_clean:
|
||||
@$(ECHO) $(MSG_CLEANING) $$(call toprel, $(1))
|
||||
$(V1) [ ! -d "$(1)" ] || $(RM) -rf "$(1)"
|
||||
@$(ECHO) $(MSG_CLEANING) $$(call toprel, "$(2)")
|
||||
$(V1) [ ! -d "$(2)" ] || $(RM) -rf "$(2)"
|
||||
|
||||
$(8)
|
||||
|
||||
qt_sdk_distclean:
|
||||
@$(ECHO) $(MSG_DISTCLEANING) $$(call toprel, $(DL_DIR)/$(5))
|
||||
$(V1) [ ! -f "$(DL_DIR)/$(5)" ] || $(RM) "$(DL_DIR)/$(5)"
|
||||
$(V1) [ ! -f "$(DL_DIR)/$(5).md5" ] || $(RM) "$(DL_DIR)/$(5).md5"
|
||||
|
||||
endef
|
||||
|
||||
##############################
|
||||
#
|
||||
# ARM SDK
|
||||
@ -322,15 +411,20 @@ endef
|
||||
|
||||
$(eval $(call TOOL_INSTALL_TEMPLATE,qt_sdk,$(QT_SDK_DIR),$(QT_SDK_URL),$(notdir $(QT_SDK_URL)),$(QT_SDK_CONFIGURE_TEMPLATE)))
|
||||
|
||||
else ifeq ($(UNAME), Linux)
|
||||
QT_SDK_PREFIX := "$(QT_SDK_DIR)/5.1.1/$(QT_SDK_ARCH)"
|
||||
QT_BUILD_DIR := $(BUILD_DIR)/QT_BUILD
|
||||
$(eval $(call LINUX_QT_INSTALL_TEMPLATE,$(QT_BUILD_DIR),$(QT_SDK_DIR),$(QT_SDK_URL),$(QT_SDK_MD5_URL),$(notdir $(QT_SDK_URL)),$(QT_SDK_ARCH)))
|
||||
|
||||
else
|
||||
|
||||
QT_SDK_PREFIX := $(QT_SDK_DIR)
|
||||
|
||||
|
||||
.PHONY: qt_sdk_install
|
||||
qt_sdk_install:
|
||||
@$(ECHO) $(MSG_NOTICE) --------------------------------------------------------
|
||||
@$(ECHO) $(MSG_NOTICE) Please install native Qt 5.1.x SDK using package manager
|
||||
@$(ECHO) $(MSG_NOTICE) --------------------------------------------------------
|
||||
@$(ECHO) $(MSG_NOTICE) --------------------------------------------------------
|
||||
@$(ECHO) $(MSG_NOTICE) Please install native Qt 5.1.x SDK using package manager
|
||||
@$(ECHO) $(MSG_NOTICE) --------------------------------------------------------
|
||||
|
||||
.PHONY: qt_sdk_clean
|
||||
qt_sdk_clean:
|
||||
|
Loading…
x
Reference in New Issue
Block a user