summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 12e708d)
raw | patch | inline | side by side (parent: 12e708d)
author | DeaDDooMER <deaddoomer@deadsoftware.ru> | |
Mon, 22 Jul 2019 20:19:48 +0000 (23:19 +0300) | ||
committer | DeaDDooMER <deaddoomer@deadsoftware.ru> | |
Mon, 22 Jul 2019 20:19:48 +0000 (23:19 +0300) |
make-bootstrap.sh | patch | blob | history |
diff --git a/make-bootstrap.sh b/make-bootstrap.sh
index e82d0a682d0d8edbb13eb361669e71c0f3c6aeb5..8eb3b66a0c0ede001442441700453f3366818651 100755 (executable)
--- a/make-bootstrap.sh
+++ b/make-bootstrap.sh
_exec="make-bootstrap.sh"
_this="$(dirname "$(readlink -f "$0")")"
_version="v0.2"
+_sign=false
###^^^^^^^^^^^###
### Functions ###
###___________###
+usage() {
+ echo "Usage: make-bootstrap.sh [options]"
+ echo "Options:"
+ echo " -v version Set build version"
+ echo " -S Sign build"
+ exit 2
+}
+
make_bootstrap() {
local _cpu="$1"
local _target="$2"
-type d -name 'CodeC' -prune -o -exec rm -rf {} +
}
+error() {
+ echo "$_exec:" "$@"
+ exit 1
+}
+
+###^^^^^^^^^^^^^^^###
+### Parse options ###
+###_______________###
+
+while getopts v:Sh _name
+do
+ case "$_name" in
+ v) _version="$OPTARG" ;;
+ S) _sign=true ;;
+ h|?) usage ;;
+ esac
+done
+
+if [ -z "$_version" ] || echo "$_version" | grep " " > /dev/null; then
+ error "version not specified or contain spaces"
+fi
+
###^^^^^^^^^^^^^^^^^^^^###
### Prebuild C sources ###
###____________________###
make_bootstrap 486 cpfront cygwin
make_bootstrap arm cpfront linux
+###^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^###
+### Hack: remove temp files from v0.1 ###
+###___________________________________###
+
+find "$_this/bootstrap" -type f -name '.new*' -delete
+
###^^^^^^^^^^^^^^^^^^^^^^###
### Package dist sources ###
###______________________###
"$_this/src" \
"$_this/C"
tar czf "cpc-$_version.src.tar.gz" "cpc-$_version"
+
+###^^^^^^^^^^^^^^^^###
+### Make signature ###
+###________________###
+
+if $_sign; then
+ gpg --armor --detach-sig "cpc-$_version.src.tar.gz"
+fi