-
Notifications
You must be signed in to change notification settings - Fork 209
/
build.sh
executable file
·70 lines (57 loc) · 1.62 KB
/
build.sh
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
#!/bin/sh
set -e
# You can execute this script with different parameters:
# components - compiling components needed for doublecmd
# doublecmd - compiling doublecmd only (release mode)
# plugins - compiling all doublecmd plugins
# debug - compiling components, plugins and doublecmd (debug mode)
# release - compile in release mode (using by default)
# path to lazbuild
export lazbuild=$(which lazbuild)
# Set up widgetset: gtk2 or qt or qt5 or cocoa
# Set up processor architecture: i386 or x86_64
if [ $2 ]
then export lcl=$2
fi
if [ $lcl ] && [ $CPU_TARGET ]
then export DC_ARCH=$(echo "--widgetset=$lcl")" "$(echo "--cpu=$CPU_TARGET")
elif [ $lcl ]
then export DC_ARCH=$(echo "--widgetset=$lcl")
elif [ $CPU_TARGET ]
then export DC_ARCH=$(echo "--cpu=$CPU_TARGET")
fi
build_doublecmd()
{
# Build Double Commander
$lazbuild src/doublecmd.lpi --bm=release $DC_ARCH
# Build Dwarf LineInfo Extractor
$lazbuild tools/extractdwrflnfo.lpi
# Extract debug line info
chmod a x tools/extractdwrflnfo
if [ -f doublecmd.dSYM/Contents/Resources/DWARF/doublecmd ]; then
mv -f doublecmd.dSYM/Contents/Resources/DWARF/doublecmd $(pwd)/doublecmd.dbg
fi
tools/extractdwrflnfo doublecmd.dbg
# Strip debug info
strip doublecmd
}
build_release()
{
components/build.sh
plugins/build.sh
build_doublecmd
}
build_debug()
{
components/build.sh
plugins/build.sh
# Build Double Commander
$lazbuild src/doublecmd.lpi --bm=debug $DC_ARCH
}
case $1 in
components) components/build.sh;;
doublecmd) build_doublecmd;;
plugins) plugins/build.sh;;
debug) build_debug;;
*) build_release;;
esac