Skip to content

Commit

Permalink
show execution of commands that can fail
Browse files Browse the repository at this point in the history
  • Loading branch information
ppannuto committed Oct 25, 2024
1 parent 76986da commit ced4c9e
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 19 deletions.
20 changes: 10 additions & 10 deletions libc++/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,20 +28,20 @@ NEWLIB_INCLUDE_PATH ?= ../newlib-$(NEWLIB_VERSION)/newlib/libc/include

gcc-$(GCC_VERSION).tar.xz:
@echo "Downloading gcc source $(@F)"
@wget -q -O $@ 'https://mirrors.sarata.com/gnu/gcc/gcc-$(GCC_VERSION)/gcc-$(GCC_VERSION).tar.xz'
wget -q -O $@ 'https://mirrors.sarata.com/gnu/gcc/gcc-$(GCC_VERSION)/gcc-$(GCC_VERSION).tar.xz'

gcc-$(GCC_VERSION): gcc-$(GCC_VERSION).tar.xz | newlib-$(NEWLIB_VERSION)
@echo "Extracting $(<F)"
@tar -xf $<
tar -xf $<
@touch $@ # Touch so directory appears newer than tarball

newlib-$(NEWLIB_VERSION).tar.gz:
@echo "Downloading newlib source $(@F)"
@wget -q -O $@ https://sourceware.mirror.garr.it/newlib/newlib-$(NEWLIB_VERSION).tar.gz
wget -q -O $@ https://sourceware.mirror.garr.it/newlib/newlib-$(NEWLIB_VERSION).tar.gz

newlib-$(NEWLIB_VERSION): newlib-$(NEWLIB_VERSION).tar.gz
@echo "Extracting $(<F)"
@tar -xzf $<
tar -xzf $<
@touch $@ # Touch so directory appears newer than tarball

rebuild-gcc: gcc-$(GCC_VERSION)
Expand All @@ -63,13 +63,13 @@ rebuild-gcc: gcc-$(GCC_VERSION)
@echo "=== PACKAGING LIBC++ ARTIFACTS ==================="
@echo ""
@mkdir -p libtock-libc++-$(GCC_VERSION)/arm
@cp -r gcc-arm-$(GCC_VERSION)-install/lib libtock-libc++-$(GCC_VERSION)/arm
@cp -r gcc-arm-$(GCC_VERSION)-install/arm-none-eabi libtock-libc++-$(GCC_VERSION)/arm
cp -r gcc-arm-$(GCC_VERSION)-install/lib libtock-libc++-$(GCC_VERSION)/arm
cp -r gcc-arm-$(GCC_VERSION)-install/arm-none-eabi libtock-libc++-$(GCC_VERSION)/arm
@mkdir -p libtock-libc++-$(GCC_VERSION)/riscv
@cp -r gcc-riscv-$(GCC_VERSION)-install/lib libtock-libc++-$(GCC_VERSION)/riscv
@cp -r gcc-riscv-$(GCC_VERSION)-install/$(TOOLCHAIN_rv32i) libtock-libc++-$(GCC_VERSION)/riscv
@mv gcc-arm-$(GCC_VERSION)-out/build-arm.log gcc-riscv-$(GCC_VERSION)-out/build-riscv.log libtock-libc++-$(GCC_VERSION)
@zip -r libtock-libc++-$(GCC_VERSION).zip libtock-libc++-$(GCC_VERSION)
cp -r gcc-riscv-$(GCC_VERSION)-install/lib libtock-libc++-$(GCC_VERSION)/riscv
cp -r gcc-riscv-$(GCC_VERSION)-install/$(TOOLCHAIN_rv32i) libtock-libc++-$(GCC_VERSION)/riscv
mv gcc-arm-$(GCC_VERSION)-out/build-arm.log gcc-riscv-$(GCC_VERSION)-out/build-riscv.log libtock-libc++-$(GCC_VERSION)
zip -r libtock-libc++-$(GCC_VERSION).zip libtock-libc++-$(GCC_VERSION)


clean:
Expand Down
18 changes: 9 additions & 9 deletions newlib/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ endif

newlib-$(NEWLIB_VERSION).tar.gz:
@echo "Downloading newlib source $(@F)"
@wget -q -O $@ https://sourceware.mirror.garr.it/newlib/newlib-$(NEWLIB_VERSION).tar.gz
wget -q -O $@ https://sourceware.mirror.garr.it/newlib/newlib-$(NEWLIB_VERSION).tar.gz

newlib-$(NEWLIB_VERSION): newlib-$(NEWLIB_VERSION).tar.gz
@echo "Extracting $(<F)"
@tar -xzf $<
tar -xzf $<
@touch $@ # Touch so directory appears newer than tarball

rebuild-newlib: newlib-$(NEWLIB_VERSION)
Expand All @@ -48,13 +48,13 @@ rebuild-newlib: newlib-$(NEWLIB_VERSION)
@echo ""
@mkdir -p libtock-newlib-$(NEWLIB_VERSION)/arm
@mkdir -p libtock-newlib-$(NEWLIB_VERSION)/riscv
@cp -r newlib-arm-$(NEWLIB_VERSION)-install/arm-none-eabi libtock-newlib-$(NEWLIB_VERSION)/arm
@cp -r newlib-riscv-$(NEWLIB_VERSION)-install/$(TOOLCHAIN_rv32i) libtock-newlib-$(NEWLIB_VERSION)/riscv
@cd libtock-newlib-$(NEWLIB_VERSION)/arm/arm-none-eabi; [ -f ../../../newlib-$(NEWLIB_VERSION).patch ] && patch -p1 < ../../../newlib-$(NEWLIB_VERSION).patch
@cd libtock-newlib-$(NEWLIB_VERSION)/riscv/$(TOOLCHAIN_rv32i); [ -f ../../../newlib-$(NEWLIB_VERSION).patch ] && patch -p1 < ../../../newlib-$(NEWLIB_VERSION).patch
@mv newlib-arm-$(NEWLIB_VERSION)-out/build-arm.log newlib-riscv-$(NEWLIB_VERSION)-out/build-riscv.log libtock-newlib-$(NEWLIB_VERSION)
@zip -r libtock-newlib-$(NEWLIB_VERSION).zip libtock-newlib-$(NEWLIB_VERSION)
cp -r newlib-arm-$(NEWLIB_VERSION)-install/arm-none-eabi libtock-newlib-$(NEWLIB_VERSION)/arm
cp -r newlib-riscv-$(NEWLIB_VERSION)-install/$(TOOLCHAIN_rv32i) libtock-newlib-$(NEWLIB_VERSION)/riscv
cd libtock-newlib-$(NEWLIB_VERSION)/arm/arm-none-eabi; [ -f ../../../newlib-$(NEWLIB_VERSION).patch ] && patch -p1 < ../../../newlib-$(NEWLIB_VERSION).patch
cd libtock-newlib-$(NEWLIB_VERSION)/riscv/$(TOOLCHAIN_rv32i); [ -f ../../../newlib-$(NEWLIB_VERSION).patch ] && patch -p1 < ../../../newlib-$(NEWLIB_VERSION).patch
mv newlib-arm-$(NEWLIB_VERSION)-out/build-arm.log newlib-riscv-$(NEWLIB_VERSION)-out/build-riscv.log libtock-newlib-$(NEWLIB_VERSION)
zip -r libtock-newlib-$(NEWLIB_VERSION).zip libtock-newlib-$(NEWLIB_VERSION)
@echo ""
@echo "=== FINISHED NEWLIB ZIP =========================="
@echo ""
@sha256sum libtock-newlib-$(NEWLIB_VERSION).zip
sha256sum libtock-newlib-$(NEWLIB_VERSION).zip
2 changes: 2 additions & 0 deletions newlib/docker/docker-newlib-4.4.0.20231231/docker-create.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/usr/bin/env bash

set -ex

docker build -t libtock-c-newlib-4.4.0.20231231 .
id=$(docker create libtock-c-newlib-4.4.0.20231231)
docker cp $id:/libtock-c/newlib/libtock-newlib-4.4.0.20231231.zip libtock-newlib-4.4.0.20231231.zip

0 comments on commit ced4c9e

Please sign in to comment.