-
Notifications
You must be signed in to change notification settings - Fork 3
/
build.sh
executable file
·42 lines (35 loc) · 1.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
#!/bin/sh
if [ x"${COMPILER}" = "xgcc" ] ; then
# Note requires installation of libi86-ia16-elf DOS compat library
export CC="ia16-elf-gcc"
export CFLAGS="-Wall -fpack-struct -mcmodel=small -Os -o "
export LDFLAGS="-li86"
TARGET="label.exe"
elif [ x"${COMPILER}" = "xwatcom" ] ; then
if [ -z "${WATCOM}" ] ; then
# Make sure this is set correctly for your system before running
# this script, or we default to this
export WATCOM="/opt/watcom"
fi
export PATH=${PATH}:${WATCOM}/binl64
export INCLUDE=${WATCOM}/h
export CC="wcl"
export CFLAGS="-bt=DOS -bcl=DOS -D__MSDOS__ -zp1 -ms -lr -fe="
export LDFLAGS=""
TARGET="label.exe"
elif [ x"${COMPILER}" = "xwatcom-emu" ] ; then
dosemu -q -td -K . -E "build.bat watcom"
exit $?
elif [ x"${COMPILER}" = "xtcc-emu" ] ; then
dosemu -q -td -K . -E "build.bat tcc"
exit $?
else
echo "Please set the COMPILER env var to one of"
echo "Cross compile : 'watcom' or 'gcc'"
echo "Native compile (Dosemu) : 'watcom-emu' or 'tcc-emu'"
exit 1
fi
# if you want to build without kitten uncomment the following
# export CFLAGS="-DNOCATS ${CFLAGS}"
# TARGET=_${TARGET}
make -C src ${TARGET}