6 [[ "$1" == /* ]] && echo "$1" ||
echo "$(pwd)/$1"
9 ###^^^^^^^^^^^^^^^^^^###
10 ### Global variables ###
11 ###__________________###
13 _exec
="make-bootstrap.sh"
14 _this
="$(dirname "$
(abspath
"$0")")"
18 export CPCFLAGS
="-no-use-time $CPCFLAGS"
19 export CPLFLAGS
="$CPLFLAGS"
26 echo "Usage: make-bootstrap.sh [options]"
28 echo " -v version Set build version"
30 echo "Environment variables:"
31 echo " CC C compiler binary"
32 echo " CFLAGS C compiler options"
33 echo " CPCFLAGS CPC compiler options"
34 echo " CPLFLAGS CPL linker options"
42 "$_this/make.sh" -x -o "$_this/bootstrap/$_cpu-$_target-$_system" \
43 "$_cpu" "$_target" "$_system"
44 find "$_this/bootstrap/$_cpu-$_target-$_system" -mindepth 1 -maxdepth 1 \
45 -type d
-name 'CodeC' -prune -o -exec rm -rf {} +
57 while getopts v
:Sh _name
60 v
) _version
="$OPTARG" ;;
66 if [ -z "$_version" ] ||
echo "$_version" |
grep " " > /dev
/null
; then
67 error
"version not specified or contain spaces"
70 ###^^^^^^^^^^^^^^^^^^^^###
71 ### Prebuild C sources ###
72 ###____________________###
74 rm -rf "$_this/bootstrap"
75 mkdir
-p "$_this/bootstrap"
76 make_bootstrap
486 cpfront linux
77 #make_bootstrap 486 cpfront cygwin
78 #make_bootstrap arm cpfront linux
79 #make_bootstrap powerpc cpfront osx
81 ###^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^###
82 ### Hack: remove temp files from v0.1 ###
83 ###___________________________________###
85 find "$_this/bootstrap" -type f
-name '.new*' -delete
87 ###^^^^^^^^^^^^^^^^^^^^^^###
88 ### Package dist sources ###
89 ###______________________###
91 rm -rf "$_this/cpc-$_version"
92 mkdir
-p "$_this/cpc-$_version"
100 "$_this/make-all.sh" \
101 "$_this/make-bootstrap.sh" \
105 "$_this/cpc-$_version"
106 tar czf
"cpc-$_version.src.tar.gz" "cpc-$_version"
108 ###^^^^^^^^^^^^^^^^###
109 ### Make signature ###
110 ###________________###
113 gpg
--yes --armor --detach-sig "cpc-$_version.src.tar.gz"