-
Notifications
You must be signed in to change notification settings - Fork 3
/
build.sh
executable file
·56 lines (46 loc) · 1.56 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
#!/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 -Wl,-Map=choice.map"
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="-q -bt=DOS -bcl=DOS -D__MSDOS__ -zp1 -ms -lr -fe="
export LDFLAGS=""
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
export EXTRA_OBJS=
export EXTRA_OBJS="${EXTRA_OBJS} tnyprntf.obj"
# if you want to build without tnyprntf comment the above and uncomment
# the following
# export CFLAGS="-DNOPRNTF ${CFLAGS}"
export EXTRA_OBJS="${EXTRA_OBJS} kitten.obj"
# if you want to build without kitten comment the above and uncomment
# the following
# export CFLAGS="-DNOCATS ${CFLAGS}"
export UPXARGS="upx --8086 --best"
# if you don't want to use UPX set
# UPXARGS=true
# if you use UPX: then options are
# --8086 for 8086 compatibility
# or
# --best for smallest
make -C src