TOP = $(shell readlink -f .) ARCH = x86-linux64 JOBS = 2 LOCAL_BUILD_PATH = $(TOP)/build.$(ARCH) LOCAL_INST_PATH = $(TOP)/install.$(ARCH) VERSION_SHORT=5.12 VERSION_RELEASE=3 VERSION=$(VERSION_SHORT).$(VERSION_RELEASE) SSL_VERSION=1.0.2r SSL_ARCHIVE=openssl-$(SSL_VERSION).tar.gz PACKAGE_NAME = qt-$(VERSION) GCC_PATH = /opt/dev-tools/gcc/8.2.0/x86-linux64/gcc-8.2.0 CC = gcc-7 # "-m64 -static-libgcc -nodefaultlibs" CXX = g++-7 #"-m64 -static-libgcc -static-libstdc++ -nodefaultlibs" CC_LDFLAGS = "-m64 -static-libgcc -nodefaultlibs" CXX_LDFLAGS_ = "-m64 -static-libgcc -static-libstdc++ -nodefaultlibs" QT_STATIC_FLAGS = -static -static-runtime -no-shared all: download qt qt: ssl.$(ARCH) qt.$(ARCH) download: $(MAKE) -C $(TOP)/SOURCE ssl.$(ARCH): # static rm -Rf $(LOCAL_BUILD_PATH)/openssl-$(SSL_VERSION) mkdir -p $(LOCAL_BUILD_PATH)/ cd $(LOCAL_BUILD_PATH) && \ tar -xzf $(TOP)/SOURCE/$(SSL_ARCHIVE) cd $(LOCAL_BUILD_PATH)/openssl-$(SSL_VERSION) && \ export CFLAGS= && \ export LDFLAGS=$(CC_LDFLAGS) && \ ./Configure --prefix=$(LOCAL_INST_PATH)/openssl linux-generic64 && \ pwd && \ make clean && \ make -j$(JOBS) && \ make install # shared rm -Rf $(LOCAL_BUILD_PATH)/openssl-$(SSL_VERSION) mkdir -p $(LOCAL_BUILD_PATH)/ cd $(LOCAL_BUILD_PATH) && \ tar -xzf $(TOP)/SOURCE/$(SSL_ARCHIVE) cd $(LOCAL_BUILD_PATH)/openssl-$(SSL_VERSION) && \ export CFLAGS=-fpic && \ export LDFLAGS=$(CC_LDFLAGS) && \ ./Configure shared --prefix=$(LOCAL_INST_PATH)/openssl linux-generic64 && \ pwd && \ make clean && \ make -j$(JOBS) && \ make install qt.x86-linux64: qt.x86-linux64.shared qt.x86-linux64.static merge qt.x86-linux64.shared: # shared mkdir -p $(LOCAL_BUILD_PATH) rm -Rf $(LOCAL_BUILD_PATH)/qt-everywhere-src-$(VERSION) cd $(LOCAL_BUILD_PATH) && \ tar -xJf $(TOP)/SOURCE/qt-everywhere-src-$(VERSION).tar.xz cd $(LOCAL_BUILD_PATH)/qt-everywhere-src-$(VERSION) && \ gcc --version && \ rm -f config.cache && \ export LDFLAGS=$(CXX_LDFLAGS) && \ bash ./configure \ -recheck-all \ -prefix $(LOCAL_INST_PATH)/qt-$(VERSION)-shared \ -release \ -opensource \ -strip \ -ssl \ -openssl \ -I$(LOCAL_INST_PATH)/openssl/include \ -L$(LOCAL_INST_PATH)/openssl/lib \ -nomake examples \ -nomake tests \ -skip qtwebengine \ -qt-zlib \ -qt-libjpeg \ -qt-libpng \ -qt-pcre \ -qt-xcb \ -silent \ -fontconfig \ -system-freetype \ -confirm-license && \ make -j$(JOBS) CC=$(CC) CXX=$(CXX) && \ make -j$(JOBS) install cd $(LOCAL_INST_PATH)/qt-$(VERSION)-shared && \ tar -zcf $(TOP)/qt-$(VERSION)-shared-$(ARCH).tgz ./ qt.x86-linux64.static: # static mkdir -p $(LOCAL_BUILD_PATH) rm -Rf $(LOCAL_BUILD_PATH)/qt-everywhere-src-$(VERSION) cd $(LOCAL_BUILD_PATH) && \ tar -xJf $(TOP)/SOURCE/qt-everywhere-src-$(VERSION).tar.xz cd $(LOCAL_BUILD_PATH)/qt-everywhere-src-$(VERSION) && \ gcc --version && \ rm -f config.cache && \ export LDFLAGS=$(CXX_LDFLAGS) && \ bash ./configure \ -recheck-all \ -prefix $(LOCAL_INST_PATH)/qt-$(VERSION)-static \ -static \ -release \ -opensource \ -strip \ -ssl \ -openssl \ -I$(LOCAL_INST_PATH)/openssl/include \ -L$(LOCAL_INST_PATH)/opensll/lib \ -nomake examples \ -nomake tests \ -skip qtwebengine \ -qt-xcb \ -qt-zlib \ -qt-libjpeg \ -qt-libpng \ -qt-pcre \ -silent \ -fontconfig \ -system-freetype \ -confirm-license && \ make -j$(JOBS) CC=$(CC) CXX=$(CXX) LFLAGS=$(CXX_LDFLAGS) && \ make -j$(JOBS) install cd $(LOCAL_INST_PATH)/qt-$(VERSION)-static && \ tar -zcf $(TOP)/qt-$(VERSION)-static-$(ARCH).tgz ./ merge: cp -nr $(LOCAL_INST_PATH)/qt-$(VERSION)-static/lib/* $(LOCAL_INST_PATH)/qt-$(VERSION)-shared/lib/ cp -nr $(LOCAL_INST_PATH)/qt-$(VERSION)-static/plugins/* $(LOCAL_INST_PATH)/qt-$(VERSION)-shared/plugins/ cp -nr $(LOCAL_INST_PATH)/qt-$(VERSION)-static/qml/* $(LOCAL_INST_PATH)/qt-$(VERSION)-shared/qml/ cd $(LOCAL_INST_PATH)/qt-$(VERSION)-shared && \ tar -zcf $(TOP)/qt-$(VERSION)-$(ARCH).tgz ./ clean: rm -Rf build.$(ARCH) rm -Rf install.$(ARCH)