diff --git a/.github/workflows/aarch64_toolchain.yml b/.github/workflows/aarch64_toolchain.yml index 72b41abc1d..30402ff6b1 100644 --- a/.github/workflows/aarch64_toolchain.yml +++ b/.github/workflows/aarch64_toolchain.yml @@ -2,22 +2,22 @@ name: aarch64 Toolchain on: [push, pull_request, workflow_dispatch] +# Building using the github runner environement directly. jobs: - # Building using the github runner environement directly. aarch64: - runs-on: ubuntu-latest strategy: matrix: - targets: [ - [aarch64], # bootlin - [aarch64be] # bootlin - ] + targets: [aarch64, aarch64be] fail-fast: false - env: - TARGET: ${{ matrix.targets[0] }} + name: Linux • Toolchain ${{ matrix.targets }} + runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - name: Build - run: make --directory=cmake ${TARGET}_build - - name: Test - run: make --directory=cmake ${TARGET}_test + - name: Build env stage + run: make --directory=cmake toolchain_${{ matrix.targets }}_env + - name: Build devel stage + run: make --directory=cmake toolchain_${{ matrix.targets }}_devel + - name: Build build stage + run: make --directory=cmake toolchain_${{ matrix.targets }}_build + - name: Build Test stage + run: make --directory=cmake toolchain_${{ matrix.targets }}_test diff --git a/.github/workflows/mips_toolchain.yml b/.github/workflows/mips_toolchain.yml index e1180e91fd..b3fbf09cc3 100644 --- a/.github/workflows/mips_toolchain.yml +++ b/.github/workflows/mips_toolchain.yml @@ -2,22 +2,22 @@ name: mips Toolchain on: [push, pull_request, workflow_dispatch] +# Building using the github runner environement directly. jobs: - # Building using the github runner environement directly. mips: - runs-on: ubuntu-latest strategy: matrix: - targets: [ - [mips64], - [mips64el] - ] + targets: [mips64, mips64el] fail-fast: false - env: - TARGET: ${{ matrix.targets[0] }} + name: Linux • Toolchain ${{ matrix.targets }} + runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - name: Build - run: make --directory=cmake ${TARGET}_build - - name: Test - run: make --directory=cmake ${TARGET}_test + - name: Build env stage + run: make --directory=cmake toolchain_${{ matrix.targets }}_env + - name: Build devel stage + run: make --directory=cmake toolchain_${{ matrix.targets }}_devel + - name: Build build stage + run: make --directory=cmake toolchain_${{ matrix.targets }}_build + - name: Build Test stage + run: make --directory=cmake toolchain_${{ matrix.targets }}_test diff --git a/.github/workflows/powerpc_toolchain.yml b/.github/workflows/powerpc_toolchain.yml index 33fe9c6c92..bd21052826 100644 --- a/.github/workflows/powerpc_toolchain.yml +++ b/.github/workflows/powerpc_toolchain.yml @@ -2,22 +2,22 @@ name: powerpc Toolchain on: [push, pull_request, workflow_dispatch] +# Building using the github runner environement directly. jobs: - # Building using the github runner environement directly. powerpc: - runs-on: ubuntu-latest strategy: matrix: - targets: [ - [ppc64], - [ppc64le], - ] + targets: [ppc64, ppc64le] fail-fast: false - env: - TARGET: ${{ matrix.targets[0] }} + name: Linux • Toolchain ${{ matrix.targets }} + runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - name: Build - run: make --directory=cmake ${TARGET}_build - - name: Test - run: make --directory=cmake ${TARGET}_test + - name: Build env stage + run: make --directory=cmake toolchain_${{ matrix.targets }}_env + - name: Build devel stage + run: make --directory=cmake toolchain_${{ matrix.targets }}_devel + - name: Build build stage + run: make --directory=cmake toolchain_${{ matrix.targets }}_build + - name: Build Test stage + run: make --directory=cmake toolchain_${{ matrix.targets }}_test diff --git a/cmake/Makefile b/cmake/Makefile index 4ca1ab004b..82476817f7 100644 --- a/cmake/Makefile +++ b/cmake/Makefile @@ -96,10 +96,10 @@ help: @echo -e "\tDocker image unavailable: arm64_archlinux" @echo @echo -e "\tBuild using a toolchain." - @echo -e "\t${BOLD}_${RESET}: build docker image for a specific toolchain target." - @echo -e "\t${BOLD}save__${RESET}: Save the docker image for a specific platform." - @echo -e "\t${BOLD}sh__${RESET}: run a container using the docker image specified (debug purpose)." - @echo -e "\t${BOLD}clean__${RESET}: Remove cache and docker image." + @echo -e "\t${BOLD}toolchain__${RESET}: build docker image for a specific toolchain target." + @echo -e "\t${BOLD}save_toolchain__${RESET}: Save the docker image for a specific platform." + @echo -e "\t${BOLD}sh_toolchain__${RESET}: run a container using the docker image specified (debug purpose)." + @echo -e "\t${BOLD}clean_toolchain__${RESET}: Remove cache and docker image." @echo -e "\t${BOLD}clean_toolchains${RESET}: Remove ALL cache and docker image." @echo @echo -e "\tWith ${BOLD}${RESET}:" @@ -115,8 +115,8 @@ help: @echo -e "\t\t${BOLD}devel${RESET}" @echo -e "\t\t${BOLD}build${RESET}" @echo -e "\t\t${BOLD}test${RESET}" - @echo -e "\te.g. 'make mips64_build'" - @echo -e "\te.g. 'make aarch64_test'" + @echo -e "\te.g. 'make toolchain_mips64_build'" + @echo -e "\te.g. 'make toolchain_aarch64_test'" @echo @echo -e "\tBuild for web using emscripten." @echo -e "\t${BOLD}web_${RESET}: build the emscripten ." @@ -607,41 +607,41 @@ TOOLCHAIN_STAGES := env devel build test define toolchain-stage-target = #$$(info STAGE: $1) -#$$(info Create targets: toolchain_$1 $(addsuffix _$1, $(TOOLCHAIN_TARGETS)).) -targets_toolchain_$1 = $(addsuffix _$1, $(TOOLCHAIN_TARGETS)) +#$$(info Create targets: toolchain_$1 $(addprefix toolchain_, $(addsuffix _$1, $(TOOLCHAIN_TARGETS))).) +targets_toolchain_$1 = $(addprefix toolchain_, $(addsuffix _$1, $(TOOLCHAIN_TARGETS))) .PHONY: toolchain_$1 $$(targets_toolchain_$1) toolchain_$1: $$(targets_toolchain_$1) -$$(targets_toolchain_$1): %_$1: docker/toolchain/Dockerfile - #@docker image rm -f ${IMAGE}:$$*_$1 2>/dev/null +$$(targets_toolchain_$1): toolchain_%_$1: docker/toolchain/Dockerfile + #@docker image rm -f ${IMAGE}:toolchain_$$*_$1 2>/dev/null ${DOCKER_BUILD_CMD} \ - --tag ${IMAGE}:$$*_$1 \ + --tag ${IMAGE}:toolchain_$$*_$1 \ --build-arg TARGET=$$* \ --target=$1 \ -f $$< \ .. -#$$(info Create targets: save_toolchain_$1 $(addprefix save_, $(addsuffix _$1, $(TOOLCHAIN_TARGETS))) (debug).) -save_targets_toolchain_$1 = $(addprefix save_, $(addsuffix _$1, $(TOOLCHAIN_TARGETS))) +#$$(info Create targets: save_toolchain_$1 $(addprefix save_toolchain_, $(addsuffix _$1, $(TOOLCHAIN_TARGETS))) (debug).) +save_targets_toolchain_$1 = $(addprefix save_toolchain_, $(addsuffix _$1, $(TOOLCHAIN_TARGETS))) .PHONY: save_toolchain_$1 $$(save_targets_toolchain_$1) save_toolchain_$1: $$(save_targets_toolchain_$1) -$$(save_targets_toolchain_$1): save_%_$1: cache/%/docker_$1.tar +$$(save_targets_toolchain_$1): save_toolchain_%_$1: cache/%/docker_$1.tar cache/%/docker_$1.tar: %_$1 @rm -f $$@ mkdir -p cache/$$* - docker save ${IMAGE}:$$*_$1 -o $$@ + docker save ${IMAGE}:toolchain_$$*_$1 -o $$@ -#$$(info Create targets: $(addprefix sh_, $(addsuffix _$1, $(TOOLCHAIN_TARGETS))) (debug).) -sh_targets_toolchain_$1 = $(addprefix sh_, $(addsuffix _$1, $(TOOLCHAIN_TARGETS))) +#$$(info Create targets: $(addprefix sh_toolchain_, $(addsuffix _$1, $(TOOLCHAIN_TARGETS))) (debug).) +sh_targets_toolchain_$1 = $(addprefix sh_toolchain_, $(addsuffix _$1, $(TOOLCHAIN_TARGETS))) .PHONY: $$(sh_targets_toolchain_$1) -$$(sh_targets_toolchain_$1): sh_%_$1: %_$1 - ${DOCKER_RUN_CMD} -it --name ${IMAGE}_$$*_$1 ${IMAGE}:$$*_$1 +$$(sh_targets_toolchain_$1): sh_toolchain_%_$1: %_$1 + ${DOCKER_RUN_CMD} -it --name ${IMAGE}_toolchain_$$*_$1 ${IMAGE}:toolchain_$$*_$1 -#$$(info Create targets: clean_toolchain_$1 $(addprefix clean_, $(addsuffix _$1, $(TOOLCHAIN_TARGETS))).) -clean_targets_toolchain_$1 = $(addprefix clean_, $(addsuffix _$1, $(TOOLCHAIN_TARGETS))) +#$$(info Create targets: clean_toolchain_$1 $(addprefix clean_toolchain_, $(addsuffix _$1, $(TOOLCHAIN_TARGETS))).) +clean_targets_toolchain_$1 = $(addprefix clean_toolchain_, $(addsuffix _$1, $(TOOLCHAIN_TARGETS))) .PHONY: clean_toolchain_$1 $$(clean_targets_toolchain_$1) clean_toolchain_$1: $$(clean_targets_toolchain_$1) -$$(clean_targets_toolchain_$1): clean_%_$1: - docker image rm -f ${IMAGE}:$$*_$1 2>/dev/null +$$(clean_targets_toolchain_$1): clean_toolchain_%_$1: + docker image rm -f ${IMAGE}:toolchain_$$*_$1 2>/dev/null rm -f cache/$$*/docker_$1.tar endef diff --git a/tools/cross_compile.sh b/tools/cross_compile.sh index 97971158f4..3f5c4e292e 100755 --- a/tools/cross_compile.sh +++ b/tools/cross_compile.sh @@ -190,7 +190,7 @@ function expand_codescape_config() { # mips-img: MIPS32R6 and MIPS64R6 # mips-mti: MIPS32R2 and MIPS64R2 case "${TARGET}" in - "mips" | "mipsle" | "mips64" | "mips64le" | \ + "mips" | "mipsel" | "mips64" | "mips64el" | \ "mips32-r6" | "mips32el-r6" | "mips64-r6" | "mips64el-r6" ) # IMG Toolchain MIPS32R6 and MIPS64R6 # ref: https://codescape.mips.com/components/toolchain/2021.09-01/downloads.html @@ -231,7 +231,7 @@ function expand_codescape_config() { local -r FLAVOUR="mips-r2-hard" local -r LIBC_DIR_SUFFIX="lib" ;; - "mipsle" | "mips32el-r6") + "mipsel" | "mips32el-r6") local -r MIPS_FLAGS="-EL -mips32r6 -mabi=32" local -r FLAVOUR="mipsel-r6-hard" local -r LIBC_DIR_SUFFIX="lib" @@ -251,7 +251,7 @@ function expand_codescape_config() { local -r FLAVOUR="mips-r2-hard" local -r LIBC_DIR_SUFFIX="lib64" ;; - "mips64le" | "mips64el-r6") + "mips64el" | "mips64el-r6") local -r MIPS_FLAGS="-EL -mips64r6 -mabi=64" local -r FLAVOUR="mipsel-r6-hard" local -r LIBC_DIR_SUFFIX="lib64"