diff --git a/mkfile/Makefile b/mkfile/Makefile index cd1685f3..4aa1e396 100644 --- a/mkfile/Makefile +++ b/mkfile/Makefile @@ -10,7 +10,7 @@ PLATFORM ?= PSX #Build profile, possible values: release, debug, profile, coverage BUILD_DIR ?= bin/$(PSX_TV_FORMAT) BUILD_PROFILE ?= debug -PSX_TV_FORMAT ?= PAL +PSX_TV_FORMAT ?= PAL CONFIG_NAME ?= $(PLATFORM)-$(BUILD_PROFILE) OUTPUT_DIR = $(BUILD_DIR)/$(CONFIG_NAME) diff --git a/podman/Dockerfile b/podman/Dockerfile new file mode 100644 index 00000000..40a6fc8a --- /dev/null +++ b/podman/Dockerfile @@ -0,0 +1,16 @@ +FROM "ubuntu:24.04" +ADD ["scripts/install_pop-fe.sh", "scripts/install_rust.sh", "scripts/make_gcc.sh", "scripts/prerequisites.sh", "/usr/scripts"] +RUN apt update && cd /usr/scripts && ./prerequisites.sh && ./install_rust.sh && cd /usr && ./scripts/make_gcc.sh + + + +#RUN apt update && apt install -y nginx + +#RUN mkdir /app +#WORKDIR /app + +#VOLUME my_vol (Do not use) + +#ADD install_pop-fe.sh install_pop-fe.sh +#CMD ["cp", "install_pop-fe.sh", "/my_vol"] +# TODO: Make a script that builds the image and then registers alias like `jaby-make` for the docker command \ No newline at end of file diff --git a/podman/install.sh b/podman/install.sh new file mode 100644 index 00000000..2d0552c6 --- /dev/null +++ b/podman/install.sh @@ -0,0 +1 @@ +podman build -t jaby_engine . \ No newline at end of file diff --git a/wsl_scripts/install_pop-fe.sh b/podman/scripts/install_pop-fe.sh similarity index 100% rename from wsl_scripts/install_pop-fe.sh rename to podman/scripts/install_pop-fe.sh diff --git a/podman/scripts/install_rust.sh b/podman/scripts/install_rust.sh new file mode 100755 index 00000000..f01bbb2d --- /dev/null +++ b/podman/scripts/install_rust.sh @@ -0,0 +1,5 @@ +#!/bin/bash +echo "<<< Install Rust >>>" +curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y +. "$HOME/.cargo/env" +cargo install cargo-edit --locked \ No newline at end of file diff --git a/wsl_scripts/make_gcc.sh b/podman/scripts/make_gcc.sh similarity index 57% rename from wsl_scripts/make_gcc.sh rename to podman/scripts/make_gcc.sh index 4ece47cd..24b5ec72 100755 --- a/wsl_scripts/make_gcc.sh +++ b/podman/scripts/make_gcc.sh @@ -1,55 +1,64 @@ #!/bin/bash +GCC_VERSION=13.1.0 + +echo "<<< Build GCC >>>" mkdir -p psx-gcc cd psx-gcc -echo "clone binutils" +echo "<<< clone binutils >>>" git clone git://sourceware.org/git/binutils-gdb.git cd binutils-gdb mkdir -p build cd build -echo "Configure binutils" +echo "<<< Configure binutils >>>" ../configure --target=mipsel-linux-gnu --with-sysroot --disable-nls --disable-werror if [ $? -ne 0 ]; then exit 1 fi -echo "Make binutils" +echo "<<< Make binutils >>>" make if [ $? -ne 0 ]; then exit 1 fi -echo "Install binutils" -sudo make install +echo "<<< Install binutils >>>" +make install if [ $? -ne 0 ]; then exit 1 fi cd ../.. -echo "clone gcc" +echo "<<< clone gcc >>>" git clone --recurse-submodules git://gcc.gnu.org/git/gcc.git cd gcc -echo "checkout gcc 13.1.0" -git checkout releases/gcc-13.1.0 +echo "<<< checkout gcc $GCC_VERSION >>>" +git checkout releases/$GCC_VERSION mkdir -p build cd build -echo "configure gcc" +echo "<<< configure gcc >>>" ../configure --target=mipsel-linux-gnu --disable-nls --enable-languages=c,c++ --without-headers if [ $? -ne 0 ]; then exit 1 fi -echo "Make gcc" +echo "<<< Make gcc >>>" make all-gcc if [ $? -ne 0 ]; then exit 1 fi -echo "Install gcc" -sudo make install-gcc +echo "<<< Install gcc >>>" +make install-gcc if [ $? -ne 0 ]; then exit 1 fi + +echo "<<< Delete GCC folder >>>" +cd /usr +rm -fr psx-gcc + +# TODO: Remove gcc files after everything \ No newline at end of file diff --git a/podman/scripts/prerequisites.sh b/podman/scripts/prerequisites.sh new file mode 100755 index 00000000..5fdafe98 --- /dev/null +++ b/podman/scripts/prerequisites.sh @@ -0,0 +1,3 @@ +#!/bin/bash +echo "<<< Install prerequisites >>>" +apt install -y curl make texinfo g++ gcc git libgmp3-dev libmpfr-dev libmpc-dev flex install-info info bison \ No newline at end of file diff --git a/readme.md b/readme.md index 70c32237..58f364d9 100644 --- a/readme.md +++ b/readme.md @@ -1,5 +1,6 @@ - [JabyEngine](#jabyengine) - [About](#about) + - [Podman](#podman) - [How to build](#how-to-build) - [Building `JabyEngine` (without VSCode)](#building-jabyengine-without-vscode) - [Building support library (without VSCode)](#building-support-library-without-vscode) @@ -14,6 +15,15 @@ ## About JabyEngine is my personal attempt to eventually make my own PS1 game from "ground up". Originally I didn't indented to release this code publicly but recently I decided to give it a try. If you read this, thank you! +## Podman +* `sudo apt install podman` +* `podman build -t jaby_engine ` +* `podman images`: lists all images +* `podman image rm `: removes an image +* `podman run -it /bin/bash`: runs bash and interactive +* `podman run --rm <-v : <-e ENV_VAR=VALUE> jaby_engine`: clean up after run +* `podman image tree `: lists usefull information + ## How to build JabyEngine relies on linux to be build. For Windows users it uses `wsl` instead but support for it might get dropped during further development. diff --git a/src/Tools/Common.mk b/src/Tools/Common.mk index 772d68d5..25fca883 100644 --- a/src/Tools/Common.mk +++ b/src/Tools/Common.mk @@ -31,5 +31,4 @@ define cargo_unix_default ) endef -# Run `cargo install cargo-edit --locked`to support upgrade # Windows build requires "rustup target add x86_64-pc-windows-gnu" and "sudo apt-get install mingw-w64" \ No newline at end of file diff --git a/wsl_scripts/install_rust.sh b/wsl_scripts/install_rust.sh deleted file mode 100755 index 9bb29601..00000000 --- a/wsl_scripts/install_rust.sh +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/bash -sudo curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh \ No newline at end of file diff --git a/wsl_scripts/prerequisites.sh b/wsl_scripts/prerequisites.sh deleted file mode 100755 index ff0823e1..00000000 --- a/wsl_scripts/prerequisites.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash -sudo apt update -sudo apt install make texinfo g++ gcc libgmp3-dev libmpfr-dev libmpc-dev flex install-info info bison \ No newline at end of file