forked from open-watcom/open-watcom-v2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sh
executable file
·79 lines (73 loc) · 1.89 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
#!/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 [ -z "$1" ]; then
BUILDER_ARG=build
else
BUILDER_ARG=$1
fi
if [ ! -d $OWBINDIR ]; then mkdir $OWBINDIR; fi
OWBUILDER_BOOTX_OUTPUT=$OWBINDIR/bootx.log
output_redirect()
{
"$@" >>$OWBUILDER_BOOTX_OUTPUT 2>&1
}
rm -f $OWBUILDER_BOOTX_OUTPUT
cd $OWSRCDIR/wmake
if [ ! -d $OWOBJDIR ]; then mkdir $OWOBJDIR; fi
cd $OWOBJDIR
rm -f $OWBINDIR/wmake
if [ "$OWTOOLS" = "WATCOM" ]; then
output_redirect wmake -f ../wmake clean
output_redirect wmake -f ../wmake
else
case `uname` in
FreeBSD)
output_redirect make -f ../posmake clean
output_redirect make -f ../posmake TARGETDEF=-D__BSD__
;;
Darwin)
output_redirect make -f ../posmake clean
output_redirect make -f ../posmake TARGETDEF=-D__OSX__
;;
Haiku)
output_redirect make -f ../posmake clean
output_redirect make -f ../posmake TARGETDEF=-D__HAIKU__
;;
# Linux)
*)
output_redirect make -f ../posmake clean
output_redirect make -f ../posmake TARGETDEF=-D__LINUX__
;;
esac
fi
RC=$?
if [ $RC -ne 0 ]; then
echo "wmake bootstrap build error"
else
cd $OWSRCDIR/builder
if [ ! -d $OWOBJDIR ]; then mkdir $OWOBJDIR; fi
cd $OWOBJDIR
rm -f $OWBINDIR/builder
output_redirect $OWBINDIR/wmake -f ../binmake clean
output_redirect $OWBINDIR/wmake -f ../binmake bootstrap=1 builder.exe
if [ "$BUILDER_ARG" != "preboot" ]; then
cd $OWSRCDIR
builder boot
RC=$?
if [ $RC -ne 0 ]; then
echo "builder bootstrap build error"
else
builder $BUILDER_ARG
RC=$?
fi
fi
fi
cd $OWROOT
exit $RC