X-Git-Url: https://deadsoftware.ru/gitweb?p=cpc.git;a=blobdiff_plain;f=make-all.sh;h=1b5bb20789a6342839cf6d052db3b029fa27c53d;hp=54294677e5deee81390cc17ba4a7e5dec5d049f5;hb=25c73fbcd04d973272e0f8939a9de956fa9afbeb;hpb=b123c8223aaafee51efd0ddbad900015a2628bed diff --git a/make-all.sh b/make-all.sh index 5429467..1b5bb20 100755 --- a/make-all.sh +++ b/make-all.sh @@ -1,12 +1,16 @@ -#! /bin/sh +#! /bin/bash set -e +abspath() { + [[ "$1" == /* ]] && echo "$1" || echo "$(pwd)/$1" +} + ###^^^^^^^^^^^^^^^^^^### ### Global variables ### ###__________________### -_this="$(dirname "$(readlink -f "$0")")" +_this="$(dirname "$(abspath "$0")")" _exec="make-all.sh" _compiler= _linker= @@ -22,6 +26,9 @@ _host_cpu= _host_target= _host_system= +export CPCFLAGS="$CPCFLAGS" +export CPLFLAGS="$CPLFLAGS" + ###^^^^^^^^^^^### ### Functions ### ###___________### @@ -40,15 +47,19 @@ usage() { 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 " 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 } @@ -67,6 +78,8 @@ make_stage() { local _ext= if [ "$_host_system" = "cygwin" ]; then _ext=".exe" + elif [ "$_host_system" = "osx" ]; then + _ext=".out" fi if [ "$_target" = "cpfront" ]; then _compiler="$_dir/cpfront${_ext}" @@ -157,12 +170,15 @@ fi ### 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 ###