-
Notifications
You must be signed in to change notification settings - Fork 6
/
build.sh
executable file
·50 lines (42 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
#!/bin/sh
if [ x"${COMPILER}" = "xgcc" ] ; then
export CC="ia16-elf-gcc"
export CFLAGS="-mtsr -Wall -fpack-struct -mcmodel=tiny -c -Os -o"
export EXTRA_OBJS="amishelp.obj"
export LD="ia16-elf-gcc"
export LDFLAGS="-mtsr share.obj \${EXTRA_OBJS} -o share.com -li86 -Wl,-Map=share.map"
elif [ x"${COMPILER}" = "xtcc2-emu" ] ; then
if ! $(file "share.c" | grep -q CRLF) ; then
echo "Warning: Turbo C 2.01 doesn't process files with Unix line endings"
echo " Converting ..."
unix2dos src/share.c kitten/kitten.c kitten/kitten.h tnyprntf/tnyprntf.c tnyprntf/tnyprntf.h
UNDO=1
fi
dosemu -q -td -K . -E "build.bat tcc2"
[ "$UNDO" = "1" ] && dos2unix src/share.c kitten/kitten.c kitten/kitten.h tnyprntf/tnyprntf.c tnyprntf/tnyprntf.h
exit $?
elif [ x"${COMPILER}" = "xtcc3-emu" ] ; then
dosemu -q -td -K . -E "build.bat tcc3"
exit $?
else
echo "Please set the COMPILER env var to one of"
echo "Cross compile : 'gcc'"
echo "Native compile (Dosemu) : 'tcc2-emu' or 'tcc3-emu'"
exit 1
fi
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