index 9aa6e5247ff581ff08502098c5b2a29e5603532a..070241473dfc406ad0a5442093ec611f9267ccd3 100755 (executable)
--- a/make.sh
+++ b/make.sh
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"
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_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() {
arm) _cpu_cflags="" ;;
*) error "cpfront_link(): unsupported cpu $_cpu" ;;
esac
- "$CC" $_cc_cflags $_cpu_cflags -lm -ldl $CFLAGS -o "${_main}" -I "$_this/C" "$_this/C/SYSTEM.c" $_list
+ 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
}
case "$_system" in
linux) _useposix=true ;;
+ cygwin) _useposix=true ;;
"") error "operation system not specified" ;;
*) error "unsuported operation system $_system" ;;
esac