]> git.sur5r.net Git - bacula/bacula/blob - bacula/src/qt-console/make-win32
Restore win32 dir from Branch-5.2 and update it
[bacula/bacula] / bacula / src / qt-console / make-win32
1 #!/bin/sh
2 #
3 #  Used to build the Win32/Win64 version of bat
4 #
5 #
6 # Copyright (C) 2000-2018 Kern Sibbald
7 # License: BSD 2-Clause; see file LICENSE-FOSS
8 #
9
10 prepare_bat_build ()
11 {
12    local version=$1
13    local dpkgs_mingw
14    if test -d ../win32/release${version}; then
15
16
17       if [ ${version} -eq 32 ]
18       then
19         depkgs_mingw='depkgs-mingw32'
20
21       elif [ ${version} -eq 64 ]
22       then
23         depkgs_mingw='depkgs-mingw-w64'
24       else
25         echo "wrong version - '${version}'."
26         exit 1
27       fi
28
29       cp -f ${DEPKGS}/${depkgs_mingw}/lib/qt/QtGui4.dll ../win32/release${version}
30       cp -f ${DEPKGS}/${depkgs_mingw}/lib/qt/QtCore4.dll ../win32/release${version}
31
32       rm -rf ../win32/release${version}/help
33       mkdir ../win32/release${version}/help
34       cp -f help/*.html ../win32/release${version}/help/
35       cp -f images/status.png ../win32/release${version}/help/
36       cp -f images/mail-message-new.png ../win32/release${version}/help/
37       qmake -spec win32 -unix -o Makefile.mingw${version} bat.pro.mingw${version}
38       echo "Make Windows bat"
39       make -j3 -f Makefile.mingw${version} $2
40       if test -f release/bat.exe; then
41          cp -f release/bat.exe ../win32/release${version}
42       else
43          cp -f debug/bat.exe ../win32/release${version}
44       fi
45    fi
46 }
47
48 prepare_tray_monitor_build ()
49 {
50     local version=$1
51     cd tray-monitor
52     qmake -spec ../win32 -unix -o Makefile.mingw${version} tray-monitor.pro.mingw${version}
53     echo "Make Windows tray-monitor"
54     make -j3 -f Makefile.mingw${version} $2
55     if test -f release/bacula-tray-monitor.exe; then
56        cp -f release/bacula-tray-monitor.exe ../../win32/release${version}
57     else
58        cp -f debug/bacula-tray-monitor.exe ../../win32/release${version}
59     fi
60     rm -f release/bacula-tray-monitor.exe debug/bacula-tray-monitor.exe
61     cd ..
62 }
63
64 readonly BUILD_ARCH="$1"
65
66 rm -f debug/bat.exe
67 if test -f ../config.h ; then
68    mv -f ../config.h ../config.h.orig
69 fi
70
71 prepare_bat_build ${BUILD_ARCH:-64}
72
73 if test -e ../config.h.orig ; then
74    mv -f ../config.h.orig ../config.h
75 fi
76
77 #prepare_tray_monitor_build ${BUILD_ARCH:-64}