diff --git a/.github/workflows/ci_egcs.txt b/.github/workflows/ci_egcs.txt index b6d8fe72..c6357baf 100644 --- a/.github/workflows/ci_egcs.txt +++ b/.github/workflows/ci_egcs.txt @@ -4,10 +4,15 @@ name: Build EGCS libultra # Build on every branch push, tag push, and pull request change: -on: [push, pull_request_target] +on: + push: + pull_request: jobs: build_repo: + # This is a *private* build container. + container: ghcr.io/decompals/ultralib-build:main + name: Build repo runs-on: ubuntu-latest @@ -18,25 +23,17 @@ jobs: suffix: [_rom] # [~, _d, _rom] steps: - - name: Checkout repository - uses: actions/checkout@v3 - with: - ref: ${{ github.event.pull_request.head.sha }} - - - name: Install package requirements - run: sudo apt-get install -y build-essential python3 - - - name: Get extra dependencies - uses: actions/checkout@v3 - with: - repository: ${{ secrets.SECRETREPO }} - token: ${{ secrets.SECRETTOKEN }} - path: deps_repo - - name: Get the dependency - run: cp deps_repo/libultra/${{ matrix.version }}/* . - - - name: Setup - run: make setup -j $(nproc) TARGET=libultra${{ matrix.suffix }} VERSION=${{ matrix.version }} - - - name: Build libultra${{ matrix.suffix }} ${{ matrix.version }} - run: make -j $(nproc) TARGET=libultra${{ matrix.suffix }} VERSION=${{ matrix.version }} + - name: Checkout repository + uses: actions/checkout@v6 + + - name: Install package requirements + run: apt-get install -y build-essential python3 + + - name: Get the dependency + run: cp /orig/${{ matrix.version }}/* base/${{ matrix.version }} + + - name: Setup + run: make setup -j $(nproc) TARGET=libultra${{ matrix.suffix }} VERSION=${{ matrix.version }} + + - name: Build libultra${{ matrix.suffix }} ${{ matrix.version }} + run: make -j $(nproc) TARGET=libultra${{ matrix.suffix }} VERSION=${{ matrix.version }} diff --git a/.github/workflows/ci_gcc.yml b/.github/workflows/ci_gcc.yml index 8b27d568..dd1cc165 100644 --- a/.github/workflows/ci_gcc.yml +++ b/.github/workflows/ci_gcc.yml @@ -3,10 +3,15 @@ name: Build GCC libgultra # Build on every branch push, tag push, and pull request change: -on: [push, pull_request_target] +on: + push: + pull_request: jobs: build_repo: + # This is a *private* build container. + container: ghcr.io/decompals/ultralib-build:main + name: Build repo runs-on: ubuntu-latest @@ -17,25 +22,17 @@ jobs: suffix: [~, _d, _rom] steps: - - name: Checkout repository - uses: actions/checkout@v3 - with: - ref: ${{ github.event.pull_request.head.sha }} - - - name: Install package requirements - run: sudo apt-get install -y binutils-mips-linux-gnu build-essential python3 - - - name: Get extra dependencies - uses: actions/checkout@v3 - with: - repository: ${{ secrets.SECRETREPO }} - token: ${{ secrets.SECRETTOKEN }} - path: deps_repo - - name: Get the dependency - run: cp deps_repo/libultra/${{ matrix.version }}/* base/${{ matrix.version }} - - - name: Setup - run: make setup -j $(nproc) TARGET=libgultra${{ matrix.suffix }} VERSION=${{ matrix.version }} - - - name: Build libgultra${{ matrix.suffix }} ${{ matrix.version }} - run: make -j $(nproc) TARGET=libgultra${{ matrix.suffix }} VERSION=${{ matrix.version }} + - name: Checkout repository + uses: actions/checkout@v6 + + - name: Install package requirements + run: apt-get install -y binutils-mips-linux-gnu build-essential python3 + + - name: Get the dependency + run: cp /orig/${{ matrix.version }}/* base/${{ matrix.version }} + + - name: Setup + run: make setup -j $(nproc) TARGET=libgultra${{ matrix.suffix }} VERSION=${{ matrix.version }} + + - name: Build libgultra${{ matrix.suffix }} ${{ matrix.version }} + run: make -j $(nproc) TARGET=libgultra${{ matrix.suffix }} VERSION=${{ matrix.version }} diff --git a/.github/workflows/ci_ido.yml b/.github/workflows/ci_ido.yml index 14101081..9651143b 100644 --- a/.github/workflows/ci_ido.yml +++ b/.github/workflows/ci_ido.yml @@ -3,10 +3,15 @@ name: Build IDO libultra # Build on every branch push, tag push, and pull request change: -on: [push, pull_request_target] +on: + push: + pull_request: jobs: build_repo: + # This is a *private* build container. + container: ghcr.io/decompals/ultralib-build:main + name: Build repo runs-on: ubuntu-latest @@ -17,25 +22,17 @@ jobs: suffix: [~, _rom] # [~, _d, _rom] steps: - - name: Checkout repository - uses: actions/checkout@v3 - with: - ref: ${{ github.event.pull_request.head.sha }} - - - name: Install package requirements - run: sudo apt-get install -y build-essential python3 binutils-mips-linux-gnu - - - name: Get extra dependencies - uses: actions/checkout@v3 - with: - repository: ${{ secrets.SECRETREPO }} - token: ${{ secrets.SECRETTOKEN }} - path: deps_repo - - name: Get the dependency - run: cp deps_repo/libultra/${{ matrix.version }}/* base/${{ matrix.version }} - - - name: Setup - run: make setup -j $(nproc) TARGET=libultra${{ matrix.suffix }} VERSION=${{ matrix.version }} - - - name: Build libultra${{ matrix.suffix }} ${{ matrix.version }} - run: make -j $(nproc) TARGET=libultra${{ matrix.suffix }} VERSION=${{ matrix.version }} + - name: Checkout repository + uses: actions/checkout@v6 + + - name: Install package requirements + run: apt-get install -y build-essential python3 binutils-mips-linux-gnu + + - name: Get the dependency + run: cp /orig/${{ matrix.version }}/* base/${{ matrix.version }} + + - name: Setup + run: make setup -j $(nproc) TARGET=libultra${{ matrix.suffix }} VERSION=${{ matrix.version }} + + - name: Build libultra${{ matrix.suffix }} ${{ matrix.version }} + run: make -j $(nproc) TARGET=libultra${{ matrix.suffix }} VERSION=${{ matrix.version }} diff --git a/README.md b/README.md index 8128718a..02dcd645 100644 --- a/README.md +++ b/README.md @@ -32,12 +32,13 @@ The build process requires the following packages: - build-essential - python3 - binutils-mips-linux-gnu (libultra* only) +- wget -Under Debian / Ubunutu you can install them with the following commands: +Under Debian / Ubuntu you can install them with the following commands: ```bash sudo apt update -sudo apt install build-essential python3 +sudo apt install build-essential python3 wget ``` If building any libultra you can install binutils-mips-linux-gnu with: @@ -49,7 +50,7 @@ sudo apt install binutils-mips-linux-gnu ## Building Run make setup with the proper flags set followed by make with optional jobs. -For example, if building the 2.0L PC archive you'd do the following: +For example, if building the 2.0L PC archive you'd do the following: - `make VERSION=L TARGET=libgultra_rom setup` - `make VERSION=L TARGET=libgultra_rom` diff --git a/src/error/kmcprintf.c b/src/error/kmcprintf.c index 2f4f08e8..830ac724 100644 --- a/src/error/kmcprintf.c +++ b/src/error/kmcprintf.c @@ -6,6 +6,8 @@ #include "ultraerror.h" #include "../libc/xstdio.h" +#ifndef _FINALROM + extern u32 __kmc_pt_mode; static void* proutSyncPrintf(void* str, const char* buf, size_t n) { @@ -244,3 +246,5 @@ static void kmcErrorHandler(s16 code, s16 numArgs, ...) { va_end(ap); } + +#endif diff --git a/tools/Makefile b/tools/Makefile index cf0d35e6..d96bb277 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -1,6 +1,15 @@ .PHONY: all clean distclean +UNAME_S := $(shell uname -s) +ifeq ($(UNAME_S),Darwin) + GNU_SUFFIX := mac + IDO_SUFFIX := macos +else + GNU_SUFFIX := linux + IDO_SUFFIX := linux +endif + # GCC GCC_DIR := gcc AR := $(GCC_DIR)/ar @@ -14,14 +23,14 @@ IDO-5.3 := $(IDO_DIR)/cc all: $(AR) $(GCC-2.7.2) $(STRIP-2.7) $(IDO-5.3) $(AR): | $(GCC_DIR) - wget https://github.com/decompals/mips-binutils-2.6/releases/download/main/binutils-2.6-linux.tar.gz - tar xf binutils-2.6-linux.tar.gz -C $(GCC_DIR) - $(RM) binutils-2.6-linux.tar.gz + wget https://github.com/decompals/mips-binutils-2.6/releases/download/main/binutils-2.6-$(GNU_SUFFIX).tar.gz + tar xf binutils-2.6-$(GNU_SUFFIX).tar.gz -C $(GCC_DIR) + $(RM) binutils-2.6-$(GNU_SUFFIX).tar.gz $(GCC-2.7.2): | $(GCC_DIR) - wget https://github.com/decompals/mips-gcc-2.7.2/releases/download/main/gcc-2.7.2-linux.tar.gz - tar xf gcc-2.7.2-linux.tar.gz -C $(GCC_DIR) - $(RM) gcc-2.7.2-linux.tar.gz + wget https://github.com/decompals/mips-gcc-2.7.2/releases/download/main/gcc-2.7.2-$(GNU_SUFFIX).tar.gz + tar xf gcc-2.7.2-$(GNU_SUFFIX).tar.gz -C $(GCC_DIR) + $(RM) gcc-2.7.2-$(GNU_SUFFIX).tar.gz $(STRIP-2.7): | $(GCC_DIR) wget https://github.com/decompals/mips-binutils-2.7/releases/download/release/binutils-2.7.tar.gz @@ -32,9 +41,9 @@ $(GCC_DIR): mkdir -p $@ $(IDO-5.3): | $(IDO_DIR) - wget https://github.com/decompals/ido-static-recomp/releases/latest/download/ido-5.3-recomp-linux.tar.gz - tar xf ido-5.3-recomp-linux.tar.gz -C $(IDO_DIR) - $(RM) ido-5.3-recomp-linux.tar.gz + wget https://github.com/decompals/ido-static-recomp/releases/latest/download/ido-5.3-recomp-$(IDO_SUFFIX).tar.gz + tar xf ido-5.3-recomp-$(IDO_SUFFIX).tar.gz -C $(IDO_DIR) + $(RM) ido-5.3-recomp-$(IDO_SUFFIX).tar.gz $(IDO_DIR): mkdir -p $@