aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/win32/compile.tcl
blob: 1736e9225a84402cdc568842638711a31d821bfd (plain) (blame)
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
set cpu_cores $env(NUMBER_OF_PROCESSORS)
if {$cpu_cores > 1} {
	incr cpu_cores -1 ;# if more than 1 available, leave 1 for OS to run smoothly
}
puts "Using $cpu_cores CPU cores."

if {![catch {exec where /q qmake}]} {
	set QMAKE [exec where qmake]
	puts "INFO: Qt's qmake found at $QMAKE"
} else {
	puts "ERROR: Cannot find Qt"
	exit 1
}
puts "Using qmake: $QMAKE"

if {![catch {exec where /q mingw32-make}]} {
	set MAKE [exec where mingw32-make]
	puts "INFO: MinGW32's make found in $MAKE"
} else {
	puts "ERROR: Cannot find MinGW32 \[mingw32-make.exe]"
	exit 1
}
puts "Using make: $MAKE"

set cdir [pwd]
cd ../..
set parent_dir [pwd]
cd $cdir
puts [pwd]

set output "$parent_dir/output"

file delete -force $output

cd $parent_dir
file mkdir output output/build output/build/Plugins

proc dt {} {
	return "\[[clock format [clock seconds] -format "%Y-%m-%d %H:%M:%S"]\]"
}

puts "[dt] Compiling core app."
cd output/build
exec $QMAKE ../../SQLiteStudio3
catch {exec $MAKE -j $cpu_cores} res
puts $res

puts "[dt] Compiling plugins."
cd Plugins
exec $QMAKE ../../../Plugins
catch {exec $MAKE -j $cpu_cores} res
puts $res

puts "[dt] Compilation finished."
cd $cdir