diff --git a/make-all.sh b/make-all.sh
index eef57f20346373649e0464d36ec9ec1c69fe8f36..1b5bb20789a6342839cf6d052db3b029fa27c53d 100755 (executable)
--- a/make-all.sh
+++ b/make-all.sh
-#! /bin/sh
+#! /bin/bash
set -e
set -e
+abspath() {
+ [[ "$1" == /* ]] && echo "$1" || echo "$(pwd)/$1"
+}
+
###^^^^^^^^^^^^^^^^^^###
### Global variables ###
###__________________###
###^^^^^^^^^^^^^^^^^^###
### Global variables ###
###__________________###
-_this="$(dirname "$(readlink -f "$0")")"
+_this="$(dirname "$(abspath "$0")")"
_exec="make-all.sh"
_compiler=
_linker=
_exec="make-all.sh"
_compiler=
_linker=
_host_target=
_host_system=
_host_target=
_host_system=
+export CPCFLAGS="$CPCFLAGS"
+export CPLFLAGS="$CPLFLAGS"
+
###^^^^^^^^^^^###
### Functions ###
###___________###
###^^^^^^^^^^^###
### Functions ###
###___________###
# echo " -s os Host operaion system"
echo "Processors:"
echo " 486 Intel 486+"
# echo " -s os Host operaion system"
echo "Processors:"
echo " 486 Intel 486+"
+ echo " arm ARM 32-bit"
+ echo " powerpc PowerPC 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 " osx Mac OS X"
+ echo "Environment variables:"
+ echo " CC C compiler binary"
+ echo " CFLAGS C compiler options"
+ echo " CPCFLAGS CPC compiler options"
+ echo " CPLFLAGS CPL linker options"
exit 2
}
exit 2
}
local _this_system="$4"
shift 4
"$_this/make.sh" -o "$_dir" -c "$_compiler" -l "$_linker" "$@" "$_this_cpu" "$_this_target" "$_this_system"
local _this_system="$4"
shift 4
"$_this/make.sh" -o "$_dir" -c "$_compiler" -l "$_linker" "$@" "$_this_cpu" "$_this_target" "$_this_system"
+ local _ext=
+ if [ "$_host_system" = "cygwin" ]; then
+ _ext=".exe"
+ elif [ "$_host_system" = "osx" ]; then
+ _ext=".out"
+ fi
if [ "$_target" = "cpfront" ]; then
if [ "$_target" = "cpfront" ]; then
- _compiler="$_dir/cpfront"
+ _compiler="$_dir/cpfront${_ext}"
_linker=
else
if [ "$_cpu" = "486" ]; then
_linker=
else
if [ "$_cpu" = "486" ]; then
- _compiler="$_dir/cpc486"
- _linker="$_dir/cpl486"
+ _compiler="$_dir/cpc486${_ext}"
+ _linker="$_dir/cpl486${_ext}"
else
error "unsupported cpu $_cpu"
fi
else
error "unsupported cpu $_cpu"
fi
### Recompile itself ###
###__________________###
### Recompile itself ###
###__________________###
-for _N in $(seq 1 "$_stages")
-do
- echo "==> Stage $_N"
- make_verify_stage "$_N"
-done
-_N=
+if [ "1" -le "$_stages" ]; then
+ echo "==> Stage 1"
+ make_verify_stage 1
+fi
+
+if [ "2" -le "$_stages" ]; then
+ echo "==> Stage 2"
+ make_verify_stage 2
+fi
###^^^^^^^^^^^^^^^###
### Cross compile ###
###^^^^^^^^^^^^^^^###
### Cross compile ###