- Notifications
You must be signed in to change notification settings - Fork 174
/
Copy pathbuild.sh
executable file
·85 lines (80 loc) · 2.16 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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
#!/bin/sh
#
# Script to build the Open Watcom tools
# using the host platform's native C/C++ compiler or OW tools.
#
# Expects POSIX or OW tools.
if [ -z"$OWROOT" ];then
. ./setvars.sh
fi
if [ !-d build/$OWOBJDIR ];then mkdir build/$OWOBJDIR;fi
OWBUILDER_BOOTX_OUTPUT="$OWROOT/build/$OWOBJDIR/bootx.log"
output_redirect()
{
$@>>$OWBUILDER_BOOTX_OUTPUT2>&1
}
rm -f "$OWBUILDER_BOOTX_OUTPUT"
cd bld/wmake
if [ !-d$OWOBJDIR ];then mkdir $OWOBJDIR;fi
cd$OWOBJDIR
rm -f ../../../build/$OWOBJDIR/wmake
if [ "$OWTOOLS"="WATCOM" ];then
output_redirect wmake -m -f ../wmake clean
output_redirect wmake -m -f ../wmake
else
output_redirect make -f ../posmake clean
case`uname`in
FreeBSD)
output_redirect make -f ../posmake TARGETDEF=-D__FREEBSD__
;;
DragonFly)
output_redirect make -f ../posmake TARGETDEF=-D__DRAGONFLY__
;;
NetBSD)
output_redirect make -f ../posmake TARGETDEF=-D__NETBSD__
;;
OpenBSD)
output_redirect make -f ../posmake TARGETDEF=-D__OPENBSD__
;;
Darwin)
output_redirect make -f ../posmake TARGETDEF=-D__OSX__
;;
Haiku)
output_redirect make -f ../posmake TARGETDEF=-D__HAIKU__
;;
# Linux)
*)
output_redirect make -f ../posmake TARGETDEF=-D__LINUX__
;;
esac
fi
RC=$?
if [ $RC-ne 0 ];then
echo"wmake bootstrap build error"
else
cd"$OWROOT"
cd bld/builder
if [ !-d$OWOBJDIR ];then mkdir $OWOBJDIR;fi
cd$OWOBJDIR
rm -f ../../../build/$OWOBJDIR/builder
output_redirect ../../../build/$OWOBJDIR/wmake -f ../preboot clean
output_redirect ../../../build/$OWOBJDIR/wmake -f ../preboot
cd"$OWROOT"
if [ "$1"!="preboot" ];then
cd bld
builder boot
RC=$?
if [ $RC-ne 0 ];then
echo"builder bootstrap build error"
elif [ "$1"!="boot" ];then
if [ -z"$1" ];then
builder build
else
builder $1
fi
RC=$?
fi
fi
fi
cd"$OWROOT"
exit$RC