mirror of
https://git.planet-casio.com/Lephenixnoir/sh-elf-gcc.git
synced 2025-05-31 16:05:13 +02:00
avoid rebuilds during updates
This commit is contained in:
parent
959402208f
commit
4e3a4abc9b
4 changed files with 20 additions and 1 deletions
3
build.sh
3
build.sh
|
@ -1,5 +1,8 @@
|
||||||
#! /usr/bin/env bash
|
#! /usr/bin/env bash
|
||||||
|
|
||||||
|
# Avoid rebuilds of the same version
|
||||||
|
[[ ! -d build ]] && exit 0
|
||||||
|
|
||||||
source util.sh
|
source util.sh
|
||||||
cd build
|
cd build
|
||||||
|
|
||||||
|
|
13
configure.sh
13
configure.sh
|
@ -3,9 +3,22 @@
|
||||||
source util.sh
|
source util.sh
|
||||||
|
|
||||||
VERSION=$1
|
VERSION=$1
|
||||||
|
PREFIX="$2"
|
||||||
URL="https://ftp.gnu.org/gnu/gcc/gcc-$VERSION/gcc-$VERSION.tar.xz"
|
URL="https://ftp.gnu.org/gnu/gcc/gcc-$VERSION/gcc-$VERSION.tar.xz"
|
||||||
ARCHIVE=$(basename "$URL")
|
ARCHIVE=$(basename "$URL")
|
||||||
|
|
||||||
|
# Avoid rebuilds of the same version
|
||||||
|
|
||||||
|
existing_gcc="$PREFIX/bin/sh-elf-gcc"
|
||||||
|
|
||||||
|
if [[ -f "$existing_gcc" ]]; then
|
||||||
|
existing_version=$(sh-elf-gcc --version | head -n 1 | grep -Eo '[0-9.]+$')
|
||||||
|
if [[ $existing_version == $VERSION ]]; then
|
||||||
|
echo "$TAG Version $VERSION already installed, skipping rebuild"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
# Download archive
|
# Download archive
|
||||||
|
|
||||||
if [[ -f "$ARCHIVE" ]]; then
|
if [[ -f "$ARCHIVE" ]]; then
|
||||||
|
|
|
@ -9,7 +9,7 @@ include giteapc-config-$(GITEAPC_CONFIG).make
|
||||||
endif
|
endif
|
||||||
|
|
||||||
configure:
|
configure:
|
||||||
@ ./configure.sh $(VERSION)
|
@ ./configure.sh $(VERSION) "$(PREFIX)"
|
||||||
|
|
||||||
build:
|
build:
|
||||||
@ ./build.sh
|
@ ./build.sh
|
||||||
|
|
|
@ -1,5 +1,8 @@
|
||||||
#! /usr/bin/env bash
|
#! /usr/bin/env bash
|
||||||
|
|
||||||
|
# Avoid rebuilds of the same version
|
||||||
|
[[ ! -d build ]] && exit 0
|
||||||
|
|
||||||
source util.sh
|
source util.sh
|
||||||
PREFIX="$1"
|
PREFIX="$1"
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue