summaryrefslogtreecommitdiffstats
path: root/plugins/examples/custom-qt-min/overrides.mk
blob: 9e47254607f607f86a0b4583946637cafe881358 (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
# This file is part of MXE.
# See index.html for further information.

# MXE provides a fully featured build of Qt. Some users want more control...
# http://lists.nongnu.org/archive/html/mingw-cross-env-list/2013-08/msg00010.html
# http://lists.nongnu.org/archive/html/mingw-cross-env-list/2012-05/msg00019.html
#
# build of qt and deps is (say):  25 mins with 12.5 MB test program
# custom with minimal deps is:     4 mins with  7.6 MB test program
# custom min deps and cflags is:   4 mins with  5.9 MB test program
#
# make qt MXE_PLUGIN_DIRS='plugins/custom-qt-min'

$(info == Custom Qt overrides: $(lastword $(MAKEFILE_LIST)))

qt_DEPS := gcc

define qt_BUILD
    $(SED) -i 's,\(^QMAKE_CFLAGS_RELEASE\).*,\1 = -pipe -Os -fomit-frame-pointer -momit-leaf-frame-pointer -fdata-sections -ffunction-sections,g' '$(1)/mkspecs/win32-g++/qmake.conf'
    cd '$(1)' && QTDIR='$(1)' ./bin/syncqt
    cd '$(1)' && \
        ./configure \
        -opensource \
        -confirm-license \
        -fast \
        -xplatform win32-g++-4.6 \
        -device-option CROSS_COMPILE=$(TARGET)- \
        -device-option PKG_CONFIG='$(TARGET)-pkg-config' \
        -force-pkg-config \
        -release \
        -static \
        -prefix '$(PREFIX)/$(TARGET)/qt' \
        -prefix-install \
        -make libs \
        -nomake demos \
        -nomake docs \
        -nomake examples \
        -nomake tools \
        -nomake translations \
        -no-accessibility \
        -no-audio-backend \
        -no-dbus \
        -no-declarative \
        -no-exceptions \
        -no-gif \
        -no-glib \
        -no-gstreamer \
        -no-iconv \
        -no-libjpeg \
        -no-libmng \
        -no-libpng \
        -no-libtiff \
        -no-multimedia \
        -no-opengl \
        -no-openssl \
        -no-phonon \
        -no-phonon-backend \
        -no-qt3support \
        -no-reduce-exports \
        -no-rpath \
        -no-script \
        -no-scripttools \
        -no-sql-mysql \
        -no-sql-odbc \
        -no-sql-psql \
        -no-sql-sqlite \
        -no-sql-tds \
        -no-stl \
        -no-svg \
        -no-webkit \
        -no-xmlpatterns \
        -qt-zlib \
        -v

    $(MAKE) -C '$(1)' -j '$(JOBS)'
    rm -rf '$(PREFIX)/$(TARGET)/qt'
    $(MAKE) -C '$(1)' -j 1 install
    ln -sf '$(PREFIX)/$(TARGET)/qt/bin/qmake' '$(PREFIX)/bin/$(TARGET)'-qmake-qt4

    mkdir            '$(1)/test-qt'
    cd               '$(1)/test-qt' && '$(PREFIX)/$(TARGET)/qt/bin/qmake' '$(PWD)/src/$(PKG)-test.pro'
    $(MAKE)       -C '$(1)/test-qt' -j '$(JOBS)'
    $(INSTALL) -m755 '$(1)/test-qt/release/test-qt.exe' '$(PREFIX)/$(TARGET)/bin/'

endef