From cb4653ac7ab71f606f2537ec9d3380fd641373e5 Mon Sep 17 00:00:00 2001 From: Bensuperpc Date: Sat, 3 Jul 2021 19:48:41 +0200 Subject: [PATCH] Add scripts Add scripts Signed-off-by: Bensuperpc --- tools/build/cmake.sh | 6 ++++++ tools/build/cmake_all.sh | 11 +++++++++++ tools/build/functions/cmake_fn.sh | 18 ++++++++++++++++++ tools/build/functions/makefile_fn.sh | 15 +++++++++++++++ tools/build/makefile.sh | 6 ++++++ tools/build/makefile_all.sh | 11 +++++++++++ tools/{ => docker}/container-diff.sh | 0 7 files changed, 67 insertions(+) create mode 100755 tools/build/cmake.sh create mode 100755 tools/build/cmake_all.sh create mode 100755 tools/build/functions/cmake_fn.sh create mode 100755 tools/build/functions/makefile_fn.sh create mode 100755 tools/build/makefile.sh create mode 100755 tools/build/makefile_all.sh rename tools/{ => docker}/container-diff.sh (100%) diff --git a/tools/build/cmake.sh b/tools/build/cmake.sh new file mode 100755 index 0000000..fa55f9b --- /dev/null +++ b/tools/build/cmake.sh @@ -0,0 +1,6 @@ +#!/bin/bash +set -euo pipefail + +source $(dirname "$0")/functions/cmake_fn.sh + +cmake_build $@ diff --git a/tools/build/cmake_all.sh b/tools/build/cmake_all.sh new file mode 100755 index 0000000..f53e822 --- /dev/null +++ b/tools/build/cmake_all.sh @@ -0,0 +1,11 @@ +#!/bin/bash +set -euo pipefail + +curl https://raw.githubusercontent.com/dockcross/dockcross/master/Makefile -o dockcross-Makefile +make -f dockcross-Makefile display_images + +source $(dirname "$0")/functions/cmake_fn.sh + +for image in $(make -f dockcross-Makefile display_images); do + cmake_build $image $@ +done diff --git a/tools/build/functions/cmake_fn.sh b/tools/build/functions/cmake_fn.sh new file mode 100755 index 0000000..17a8fd9 --- /dev/null +++ b/tools/build/functions/cmake_fn.sh @@ -0,0 +1,18 @@ +#!/bin/bash +set -euo pipefail + +cmake_build () { + local image=$1 + shift 1 + local cmake_arg=$@ + echo "cmake arg: $cmake_arg" + + echo "Pulling dockcross/$image:latest" + docker pull dockcross/$image:latest + echo "Make script dockcross-$image" + docker run --rm dockcross/$image:latest > ./dockcross-$image + chmod +x ./dockcross-$image + echo "Build build-$image" + ./dockcross-$image cmake -Bbuild-$image -H. -GNinja $cmake_arg + ./dockcross-$image ninja -Cbuild-$image +} diff --git a/tools/build/functions/makefile_fn.sh b/tools/build/functions/makefile_fn.sh new file mode 100755 index 0000000..0353125 --- /dev/null +++ b/tools/build/functions/makefile_fn.sh @@ -0,0 +1,15 @@ +#!/bin/bash +set -euo pipefail + +makefile_build () { + local image=$1 + shift 1 + + echo "Pulling dockcross/$image:latest" + docker pull dockcross/$image:latest + echo "Make script dockcross-$image" + docker run --rm dockcross/$image:latest > ./dockcross-$image + chmod +x ./dockcross-$image + echo "Build build-$image" + ./dockcross-$image bash -c 'make CXX=$CXX CC=$CC AR=$AR AS=$AS CPP=$CPP FC=$FC' +} diff --git a/tools/build/makefile.sh b/tools/build/makefile.sh new file mode 100755 index 0000000..f61687c --- /dev/null +++ b/tools/build/makefile.sh @@ -0,0 +1,6 @@ +#!/bin/bash +set -euo pipefail + +source $(dirname "$0")/functions/makefile_fn.sh + +makefile_build $@ diff --git a/tools/build/makefile_all.sh b/tools/build/makefile_all.sh new file mode 100755 index 0000000..8b76d7a --- /dev/null +++ b/tools/build/makefile_all.sh @@ -0,0 +1,11 @@ +#!/bin/bash +set -euo pipefail + +curl https://raw.githubusercontent.com/dockcross/dockcross/master/Makefile -o dockcross-Makefile +make -f dockcross-Makefile display_images + +source $(dirname "$0")/functions/makefile_fn.sh + +for image in $(make -f dockcross-Makefile display_images); do + makefile_build $image $@ +done diff --git a/tools/container-diff.sh b/tools/docker/container-diff.sh similarity index 100% rename from tools/container-diff.sh rename to tools/docker/container-diff.sh