index d466d2773aa85ecb1d7c2f6331ab7cbb6c455f21..c0de9df21135b0fc5adf07c85f0eca39d5313daf 100755 (executable)
--- a/make.sh
+++ b/make.sh
echo " -x Do not link"
echo "Processors:"
echo " 486 Intel 486+"
echo " -x Do not link"
echo "Processors:"
echo " 486 Intel 486+"
+ echo " arm ARM 32-bit"
echo "Targets:"
echo " native Native"
echo " cpfront Generic C"
echo "Operation systems:"
echo " linux GNU/Linux"
echo "Targets:"
echo " native Native"
echo " cpfront Generic C"
echo "Operation systems:"
echo " linux GNU/Linux"
+ echo " cygwin Cygwin"
+ echo "Environment variables:"
+ echo " CC C compiler binary"
+ echo " CFLAGS C compiler options"
exit 2
}
exit 2
}
native_link() {
if $_dolink; then
native_link() {
if $_dolink; then
- "$_linker" -os "$_system" -kernel Kernel -main Kernel -legacycodedir . -o "$@"
- fi
+ local _outexe="$1";
+ local _outsystem="$_system"
+ if [ "$_system" = "cygwin" ]; then
+ _outexe="${_outexe}.exe"
+ _outsystem="win32"
+ fi
+ shift
+ "$_linker" -os "$_outsystem" -kernel Kernel -main Kernel -legacycodedir . -o "$_outexe" "$@"
+ fi
}
cpfront_import_list() {
}
cpfront_import_list() {
cpfront_main_module() {
local _name="$1"
shift
cpfront_main_module() {
local _name="$1"
shift
- echo "MODULE ${_name};\n\n IMPORT $(cpfront_import_list "$@");\n\nEND ${_name}."
+ echo "MODULE ${_name};"
+ echo
+ echo " IMPORT $(cpfront_import_list "$@");"
+ echo
+ echo "END ${_name}."
}
cpfront_compile() {
}
cpfront_compile() {
do
_list="$_list ${_out}/CodeC/${_module}.c"
done
do
_list="$_list ${_out}/CodeC/${_module}.c"
done
- ### !!! ADD $CC $CFLAGS $LDFLAGS ###
- gcc -m32 -g -O0 -lm -ldl -o "$_out/$_main" \
- -Wno-int-conversion \
- -Wno-int-to-pointer-cast \
- -Wno-incompatible-pointer-types \
- -Wno-implicit-function-declaration \
- -I "$_this/C" "$_this/C/SYSTEM.c" $_list
+ local _cc_cflags=
+ case "$CC" in
+ *gcc) _cc_cflags="-Wno-int-conversion -Wno-int-to-pointer-cast -Wno-incompatible-pointer-types -Wno-implicit-function-declaration" ;;
+ *) _cc_cflags="" ;;
+ esac
+ local _cpu_cflags=
+ case "$_cpu" in
+ 486) _cpu_cflags="-m32" ;;
+ arm) _cpu_cflags="" ;;
+ *) error "cpfront_link(): unsupported cpu $_cpu" ;;
+ esac
+ local _system_cflags=
+ case "$_system" in
+ cygwin) _system_cflags="-liconv" ;;
+ *) _system_cflags="" ;;
+ esac
+ "$CC" $_cc_cflags $_cpu_cflags $CFLAGS -o "${_main}" -I "$_this/C" "$_this/C/SYSTEM.c" $_list -lm -ldl $_system_cflags
fi
}
fi
}
System/Mod/Integers.odc
if [ "$_target" = "native" ]; then
System/Mod/Integers.odc
if [ "$_target" = "native" ]; then
+ compile System/Mod/Meta.odc
mv -t System Code Sym
fi
mv -t System Code Sym
fi
_target="$2"
_system="$3"
_target="$2"
_system="$3"
+if [ -z "$CC" ]; then
+ export CC=cc
+fi
+
###^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^###
### Check for supported cpu/target/os ###
###___________________________________###
case "$_cpu" in
386|486|586|686) _cpu=486 ;;
###^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^###
### Check for supported cpu/target/os ###
###___________________________________###
case "$_cpu" in
386|486|586|686) _cpu=486 ;;
+ arm|armv6|armv7) _cpu=arm ;;
"") error "cpu not specified" ;;
*) error "unsupported cpu $_cpu" ;;
esac
"") error "cpu not specified" ;;
*) error "unsupported cpu $_cpu" ;;
esac
case "$_system" in
linux) _useposix=true ;;
case "$_system" in
linux) _useposix=true ;;
+ cygwin) _useposix=true ;;
"") error "operation system not specified" ;;
*) error "unsuported operation system $_system" ;;
esac
"") error "operation system not specified" ;;
*) error "unsuported operation system $_system" ;;
esac
### Copy sources for changed system ###
###_________________________________###
### Copy sources for changed system ###
###_________________________________###
-$_docompile && rm -rf -- "$_out"
+if $_docompile; then
+ rm -rf -- "$_out"
+fi
mkdir -p -- "$_out"
_out="$(readlink -f "$_out")"
mkdir -p -- "$_out"
_out="$(readlink -f "$_out")"