summaryrefslogtreecommitdiffstats
path: root/Makefile.mingw64
blob: 1b710b29f6284fbacfe058c79954ee2a556b3895 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
TOP 			= $(shell readlink -f .)

ARCH			= x86-mingw64

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)-$(ARCH)

ifeq ($(GCC_PATH),)
    $(error GCC_PATH variable not set)
endif

all: download ssl qt
 
ssl: ssl.$(ARCH)
qt: qt.$(ARCH) 

download:
	$(MAKE) -C ./SOURCE

ssl.$(ARCH):
	rm -Rf $(LOCAL_BUILD_PATH)/openssl-$(SSL_VERSION)
	mkdir -p $(LOCAL_BUILD_PATH)/
	cd $(LOCAL_BUILD_PATH) && \
		tar --force-local -xzf  $(TOP)/SOURCE/$(SSL_ARCHIVE)
	cd $(LOCAL_BUILD_PATH)/openssl-$(SSL_VERSION) && \
	    export PATH=$(GCC_PATH)/bin:/c/dev-tools/msys/x86/usr/bin:/bin:/usr/bin && \
	    export CFLAGS="-m64 -fpic" && \
	    ./Configure --prefix=$(LOCAL_INST_PATH)/qt-$(VERSION)/$(ARCH) shared mingw64 && \
	    make clean && \
	    make && \
	    make install

qt.$(ARCH):
	mkdir -p $(LOCAL_BUILD_PATH)
	rm -Rf $(LOCAL_BUILD_PATH)/qt-everywhere-src-$(VERSION)
	if ! [ -d $(LOCAL_BUILD_PATH)/qt-everywhere-src-$(VERSION) ]; then \
	    cd $(LOCAL_BUILD_PATH); \
	    tar --force-local -xJf $(TOP)/SOURCE/qt-everywhere-src-$(VERSION).tar.xz; \
	    cd $(LOCAL_BUILD_PATH)/qt-everywhere-src-$(VERSION) ; \
		patch -p1 < $(TOP)/SOURCE/qt-5.12.3.mingw64.patch ; \
		patch -p1 < $(TOP)/SOURCE/qt-5.12.3-cross-static-gcc-libs.patch ; \
	fi
	cd $(LOCAL_BUILD_PATH)/qt-everywhere-src-$(VERSION) && \
		rm -f config.cache && \
		export PATH=$(GCC_PATH)/bin:/c/dev-tools/msys/x86/usr/bin:/bin:/usr/bin && \
		./configure \
			-platform win32-g++ \
			-prefix $(LOCAL_INST_PATH)/qt-$(VERSION)/$(ARCH) \
			-recheck-all \
			-shared \
			-release \
			-strip \
			-ssl \
			-nomake examples \
			-nomake tests \
			-skip qtwebengine \
			-skip qtwebglplugin \
			-skip qtwayland \
			-skip qtlocation \
			-skip qtdoc \
			-skip qtgamepad \
			-skip qtsensors \
			-skip qtmultimedia \
			-skip qtactiveqt \
			-qt-zlib \
			-qt-libjpeg \
			-qt-libpng \
			-qt-pcre \
			-qt-freetype \
			-opengl desktop \
			-openssl \
			-I$(LOCAL_INST_PATH)/qt-$(VERSION)/$(ARCH)/include \
			-L$(LOCAL_INST_PATH)/qt-$(VERSION)/$(ARCH)/lib \
			-L$(GCC_PATH)/lib \
			-opensource \
			-confirm-license && \
		make && \
		make install
	mv -f $(LOCAL_INST_PATH)/qt-$(VERSION)/$(ARCH)/bin/openssl.exe \
	    $(LOCAL_INST_PATH)/qt-$(VERSION)/$(ARCH)/bin/qt-openssl.exe
	cp -f $(GCC_PATH)/bin/*.dll $(LOCAL_INST_PATH)/qt-$(VERSION)/$(ARCH)/bin/
	cd  $(LOCAL_INST_PATH)/qt-$(VERSION)/$(ARCH) && \
	    tar --force-local -zcf $(TOP)/$(PACKAGE_NAME).tgz ./

clean:
	rm -Rf build.$(ARCH)
	rm -Rf install.$(ARCH)