From 5d2ff0129a6b825eaf72dc0efe1dd4ec3ca386b6 Mon Sep 17 00:00:00 2001 From: Clifford Wolf Date: Wed, 15 Mar 2017 16:35:02 +0100 Subject: [PATCH] Add GIT_ENV Makefile variable (for things like http proxy settings) --- Makefile | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 4c63532..42060bf 100644 --- a/Makefile +++ b/Makefile @@ -10,6 +10,9 @@ GCC_WARNS += -Wredundant-decls -Wstrict-prototypes -Wmissing-prototypes -pedanti TOOLCHAIN_PREFIX = $(RISCV_GNU_TOOLCHAIN_INSTALL_PREFIX)i/bin/riscv32-unknown-elf- COMPRESSED_ISA = C +# Add things like "export http_proxy=... https_proxy=..." here +GIT_ENV = + test: testbench.vvp firmware/firmware.hex vvp -N $< @@ -86,7 +89,7 @@ tests/%.o: tests/%.S tests/riscv_test.h tests/test_macros.h -DTEST_FUNC_TXT='"$(notdir $(basename $<))"' -DTEST_FUNC_RET=$(notdir $(basename $<))_ret $< download-tools: - sudo bash -c 'set -ex; mkdir -p /var/cache/distfiles; \ + sudo bash -c 'set -ex; mkdir -p /var/cache/distfiles; $(GIT_ENV); \ $(foreach REPO,riscv-gnu-toolchain riscv-binutils-gdb riscv-dejagnu riscv-gcc riscv-glibc riscv-newlib, \ if ! test -d /var/cache/distfiles/$(REPO).git; then rm -rf /var/cache/distfiles/$(REPO).git.part; \ git clone --bare https://github.com/riscv/$(REPO) /var/cache/distfiles/$(REPO).git.part; \ @@ -100,7 +103,7 @@ build-$(1)-tools: +$(MAKE) build-$(1)-tools-bh build-$(1)-tools-bh: - +set -ex; \ + +set -ex; $(GIT_ENV); \ if [ -d /var/cache/distfiles/riscv-gnu-toolchain.git ]; then reference_riscv_gnu_toolchain="--reference /var/cache/distfiles/riscv-gnu-toolchain.git"; else reference_riscv_gnu_toolchain=""; fi; \ if [ -d /var/cache/distfiles/riscv-binutils-gdb.git ]; then reference_riscv_binutils_gdb="--reference /var/cache/distfiles/riscv-binutils-gdb.git"; else reference_riscv_binutils_gdb=""; fi; \ if [ -d /var/cache/distfiles/riscv-dejagnu.git ]; then reference_riscv_dejagnu="--reference /var/cache/distfiles/riscv-dejagnu.git"; else reference_riscv_dejagnu=""; fi; \