Last active
December 3, 2017 00:04
-
-
Save zhiyb/7b3e7c9707d4dfe54fd13339b84cda1e to your computer and use it in GitHub Desktop.
Building Qt and QtCreator from git using Makefile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff -crN a/src/build-data/arch/arm64.txt b/src/build-data/arch/arm64.txt | |
*** a/src/build-data/arch/arm64.txt 1970-01-01 01:00:00.000000000 +0100 | |
--- b/src/build-data/arch/arm64.txt 2017-08-08 06:40:10.745399354 +0100 | |
*************** | |
*** 0 **** | |
--- 1,13 ---- | |
+ endian little | |
+ family arm64 | |
+ | |
+ <aliases> | |
+ aarch64 | |
+ </aliases> | |
+ | |
+ <submodels> | |
+ armv8-a | |
+ </submodels> | |
+ | |
+ <isa_extn> | |
+ </isa_extn> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://wiki.qt.io/Building_Qt_5_from_Git | |
# https://wiki.qt.io/Building_Qt_Creator_from_Git | |
# https://www.raspberrypi.org/forums/viewtopic.php?f=33&t=106432 | |
#GIT_FLAGS ?= --depth 1 | |
INSTALL_SUDO ?= sudo | |
QT_GIT_URI ?= git://code.qt.io/qt/qt5.git | |
QT_GIT_TAG ?= -b 5.10 | |
QT_INSTALL ?= /opt/Qt/g$$(git rev-list -n1 --abbrev-commit HEAD) | |
QTC_GIT_URI ?= https://code.qt.io/qt-creator/qt-creator.git | |
#QTC_GIT_TAG ?= -b v4.3.1 | |
QTC_INSTALL ?= /opt/QtCreator/g$$(git rev-list -n1 --abbrev-commit HEAD) | |
BOTAN_URI ?= https://botan.randombit.net/releases/Botan-1.10.16.tgz | |
BOTAN_ARGS ?= #--cpu=aarch64 | |
.PHONY: all | |
all: qtcreator | |
status botan root: | |
mkdir -p $@ | |
.PHONY: update | |
update: update-qt update-qtcreator | |
.PHONY: update-qt | |
update-qt: status/qt-git | |
cd qt; git pull; ./init-repository -f | |
rm -rf qt/build | |
touch status/qt-git-submodule | |
update-qtcreator: status/qtcreator-git | |
cd qtcreator; git pull; git submodule update --recursive --init | |
rm -rf qtcreator/build | |
touch status/qtcreator-git | |
.PHONY: update-qtcreator | |
update-qtcreator: | |
.SECONDARY: | |
.DELETE_ON_ERROR: | |
# For Qt | |
.PHONY: qt | |
qt: status/qt-install | |
status/qt-git: | status | |
@echo "*** Retrieving Qt source from git ***" | |
git clone $(QT_GIT_URI) qt $(GIT_FLAGS) $(QT_GIT_TAG) | |
@touch $@ | |
status/qt-git-submodule: status/qt-git | |
@echo "*** Retrieving git submodules ***" | |
cd qt; perl init-repository -f | |
@touch $@ | |
status/qt-configure: status/qt-git-submodule | |
@echo "*** Configuring Qt ***" | |
mkdir -p qt/build | |
cd qt/build; ../configure -release -opensource -confirm-license -prefix "$(QT_INSTALL)" -nomake examples -nomake tests -make tools | |
@touch $@ | |
status/qt-make: status/qt-configure | |
@echo "*** Building Qt ***" | |
cd qt/build; $(MAKE) | |
@touch $@ | |
status/qt-install: status/qt-make | |
@echo "*** Installing Qt ***" | |
cd qt/build; $(INSTALL_SUDO) $(MAKE) install | |
@touch $@ | |
# For Qt Creator | |
.PHONY: qtcreator | |
qtcreator: status/qtcreator-install | |
status/qtcreator-git: | status | |
@echo "*** Retrieving Qt Creator source from git ***" | |
git clone --recursive $(QTC_GIT_URI) qtcreator $(GIT_FLAGS) | |
@touch $@ | |
status/qtcreator-qmake: status/qt-install status/qtcreator-patch | |
@echo "*** qmake Qt Creator ***" | |
mkdir -p qtcreator/build | |
cd qtcreator/build; "$(shell cd qt; echo "$(QT_INSTALL)")/bin/qmake" -r ../qtcreator.pro | |
@touch $@ | |
status/qtcreator-make: status/qtcreator-qmake | |
@echo "*** Building Qt Creator ***" | |
cd qtcreator/build; $(MAKE) | |
@touch $@ | |
status/qtcreator-install: status/qtcreator-make | |
@echo "*** Installing Qt Creator ***" | |
cd qtcreator/build; $(INSTALL_SUDO) $(MAKE) install INSTALL_ROOT="$(shell cd qtcreator; echo "$(QTC_INSTALL)")" | |
@touch $@ | |
status/qtcreator-patch: status/qtcreator-git status/botan-gen | |
@echo "*** Patching Qt Creator Botan library ***" | |
cat botan/Botan-*/botan_all.h > qtcreator/src/libs/3rdparty/botan/botan.h | |
cat botan/Botan-*/botan_all.cpp | sed -e 's/\<botan_all\.h\>/botan\.h/g' > qtcreator/src/libs/3rdparty/botan/botan.cpp | |
@touch $@ | |
# Botan patch for Qt Creator | |
status/botan-get: | botan status | |
@echo "*** Downloading Botan ***" | |
cd botan; wget "$(BOTAN_URI)" | |
@touch $@ | |
status/botan-extract: status/botan-get | |
@echo "*** Extracting Botan ***" | |
cd botan; tar zxf Botan-*.tgz | |
@touch $@ | |
status/botan-patch: status/botan-extract | |
@echo "*** Patching Botan for aarch64 ***" | |
cd botan/Botan-*/; patch -p1 < ../../botan.patch | |
@touch $@ | |
status/botan-gen: status/botan-patch | |
@echo "*** Generating Botan amalgamation ***" | |
cd botan/Botan-*/; ./configure.py --gen-amalgamation $(BOTAN_ARGS) | |
@touch $@ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment