diff options
Diffstat (limited to 'Makefile.qtcreator')
-rw-r--r-- | Makefile.qtcreator | 107 |
1 files changed, 107 insertions, 0 deletions
diff --git a/Makefile.qtcreator b/Makefile.qtcreator new file mode 100644 index 0000000..9d5229b --- /dev/null +++ b/Makefile.qtcreator @@ -0,0 +1,107 @@ +# +# Makefile to compile QT-Creator +# +TOP = $(shell readlink -f .) + +VERSION = 4.11 +RELEASE = 2 +QT_VERSION = 5.14 +QT_RELEASE = 2 +TARURL = https://download.qt.io/official_releases/qtcreator/$(VERSION)/$(VERSION).$(RELEASE)/qt-creator-opensource-src-$(VERSION).$(RELEASE).tar.gz +ZIPURL = https://download.qt.io/official_releases/qtcreator/$(VERSION)/$(VERSION).$(RELEASE)/qt-creator-opensource-src-$(VERSION).$(RELEASE).zip +7ZIP = $(TOP)/wintools/7za.exe + +ifeq ($(ARCH),) + $(error ARCH is not set) +endif + +ifeq ($(GCC_PATH),) + $(error GCC_PATH is not set) +endif + +ifeq ($(BUILD_NUMBER),) + BUILD = unsupported +else + BUILD = $(BUILD_NUMBER) +endif + +BUILD_OS = $(shell uname -s) + +QTDIR = $(PWD)/install.$(ARCH)/qt-5.14.2-shared +BUILDDIR = $(PWD)/build-qtcreator.$(ARCH) +INSTDIR = $(PWD)/inst-qtcreator.$(ARCH) +MY_PATH = $(PATH) + +ifneq ($(BUILD_OS),Linux) + MY_PATH = $(shell cygpath -p -C ANSI "$(PATH)") +endif + +ifeq ($(ARCH),x86-linux64) + MKSPEC = linux-g++-64 + CROSS_COMPILE = +else + MKSPEC = win32-g++ +ifeq ($(BUILD_OS),Linux) + CROSS_COMPILE = x86_64-w64-mingw32- +endif +endif + + + +PKGNAME = qtcreator-$(VERSION)-$(RELEASE)-$(BUILD)-$(ARCH) + +# --------------------------------------------------------------------------- +# +all: download unpack patchit build install pack.$(ARCH) + +ifeq ($(BUILD_OS),Linux) +download: $(PWD)/SOURCE/qt-creator-opensource-src-$(VERSION).$(RELEASE).tar.gz +else +download: $(PWD)/SOURCE/qt-creator-opensource-src-$(VERSION).$(RELEASE).zip +endif + +unpack: + mkdir -p $(BUILDDIR) +ifeq ($(BUILD_OS),Linux) + tar -zxf $(PWD)/SOURCE/qt-creator-opensource-src-$(VERSION).$(RELEASE).tar.gz \ + -C $(BUILDDIR) +else + cd $(BUILDDIR) && \ + $(7ZIP) x $(PWD)/SOURCE/qt-creator-opensource-src-$(VERSION).$(RELEASE).zip +endif + +patchit: + cd $(BUILDDIR)/qt-creator-opensource-src-$(VERSION).$(RELEASE) && \ + patch -p1 < $(PWD)/SOURCE/qt-creator-dllexport.patch + +$(PWD)/SOURCE/qt-creator-opensource-src-$(VERSION).$(RELEASE).tar.gz: + cd $(PWD)/SOURCE && \ + wget -c "$(TARURL)" + +$(PWD)/SOURCE/qt-creator-opensource-src-$(VERSION).$(RELEASE).zip: + cd $(PWD)/SOURCE && \ + wget -c "$(ZIPURL)" + +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +# +build: + cd $(BUILDDIR)/qt-creator-opensource-src-$(VERSION).$(RELEASE) && \ + export PATH="$(GCC_PATH):$(QTDIR)/bin:$(MY_PATH)" && \ + CROSS_COMPILE=$(CROSS_COMPILE) \ + $(QTDIR)/bin/qmake -o Makefile -spec $(MKSPEC) && \ + make + +install: + cd $(BUILDDIR)/qt-creator-opensource-src-$(VERSION).$(RELEASE) && \ + make INSTALL_ROOT=$(INSTDIR) install + +pack.x86-linux64: + cd $(INSTDIR) && \ + tar -zcf $(PWD)/$(PKGNAME).tgz . + +pack.x86-mingw64: + cd $(INSTDIR) && \ + $(7ZIP) a -r $(PWD)/$(PKGNAME).zip . + +clean: + rm -Rf $(BUILDDIR) |