2008-03-26 16:54:39 +01:00
|
|
|
#!/bin/bash
|
|
|
|
# This script does for linux the same as build.bat for DOS,
|
|
|
|
# it compiles the KoOS kernel, hopefully ;-)
|
|
|
|
|
|
|
|
CLANG=$1;
|
|
|
|
|
2010-07-14 19:17:52 +02:00
|
|
|
# set debug=true to print executed bash commands
|
|
|
|
debug=true
|
|
|
|
|
|
|
|
outDir=bin
|
|
|
|
outFileName=kernel.mnt
|
|
|
|
outFile=$outDir/$outFileName
|
|
|
|
|
2008-03-26 16:54:39 +01:00
|
|
|
usage()
|
|
|
|
{
|
2010-07-14 19:17:52 +02:00
|
|
|
echo "Usage: make.sh [en|ru|ge|et]"
|
|
|
|
exit 1
|
2008-03-26 16:54:39 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
compile()
|
|
|
|
{
|
2010-07-14 19:17:52 +02:00
|
|
|
if [ -d "$outDir" ]; then
|
|
|
|
$debug && echo "rm -f $outFile"
|
|
|
|
rm -f $outFile
|
|
|
|
else
|
|
|
|
$debug && echo "mkdir $outDir"
|
|
|
|
mkdir $outDir
|
|
|
|
fi
|
2008-03-26 16:54:39 +01:00
|
|
|
|
2010-07-14 19:17:52 +02:00
|
|
|
$debug && echo "fasm -m 65536 kernel.asm $outFile"
|
|
|
|
fasm -m 65536 kernel.asm $outFile
|
|
|
|
|
|
|
|
$debug && echo "rm -f lang.inc"
|
|
|
|
rm -f lang.inc
|
|
|
|
|
|
|
|
$debug && echo "exit 0"
|
|
|
|
exit 0
|
|
|
|
}
|
2008-03-26 16:54:39 +01:00
|
|
|
|
|
|
|
if [ ! $CLANG ] ; then
|
2010-07-14 19:17:52 +02:00
|
|
|
usage
|
2008-03-26 16:54:39 +01:00
|
|
|
fi
|
|
|
|
|
|
|
|
for i in "en" "ru" "ge" "et"; do
|
2010-07-14 19:17:52 +02:00
|
|
|
if [ $i == $CLANG ] ; then
|
|
|
|
$debug && echo "echo \"lang fix \$i\" > lang.inc"
|
|
|
|
echo "lang fix $i" > lang.inc
|
|
|
|
compile
|
|
|
|
fi
|
2008-03-26 16:54:39 +01:00
|
|
|
done
|
|
|
|
usage
|