update makefile

This commit is contained in:
Wolfywolfy
2021-11-22 21:39:18 -03:00
parent 0afd450c63
commit 12de377525
2 changed files with 76 additions and 36 deletions
+5
View File
@@ -70,6 +70,11 @@ dolphin:
floors: floors:
$(MAKE) -C src/samples/floors all clean $(MAKE) -C src/samples/floors all clean
rebuild-engine:
$(MAKE) -C src/engine && make && make EE_CXXFLAGS="-DNDEBUG $(EE_CXXFLAGS)"
rebuild-dbg-engine:
$(MAKE) -C src/engine && make && make
# %.vcl: %.vclpp # %.vcl: %.vclpp
# $(EE_VCLPP) $< $@ # $(EE_VCLPP) $< $@
+59 -24
View File
@@ -1,6 +1,7 @@
# Installation tutorial # Installation tutorial
This tutorial will show you, how to: This tutorial will show you, how to:
- Setup your WSL machine for PS2DEV - Setup your WSL machine for PS2DEV
- Install entire PS2DEV+Tyra environment - Install entire PS2DEV+Tyra environment
- Setup VSCode with Intelisense - Setup VSCode with Intelisense
@@ -9,11 +10,12 @@ This tutorial will show you, how to:
So let's get started! So let's get started!
--- ---
<br/> <br/>
## VSCode and WSL ## VSCode and WSL
- Install VSCode from
https://code.visualstudio.com/ - Install VSCode fromhttps://code.visualstudio.com/
- Install WSL - Install WSL
https://docs.microsoft.com/en-us/windows/wsl/install-win10 https://docs.microsoft.com/en-us/windows/wsl/install-win10
`Info: Please choose Ubuntu-20.04` `Info: Please choose Ubuntu-20.04`
@@ -22,22 +24,28 @@ Open `cmd.exe` and type:
`ubuntu2004 config --default-user root` `ubuntu2004 config --default-user root`
--- ---
<br/> <br/>
## Ubuntu configuration and PS2DEV+Tyra ## Ubuntu configuration and PS2DEV+Tyra
- Open WSL terminal (Windows search -> wsl)
`Info: Be sure that are you logged as a root!` - Open WSL terminal (Windows search -> wsl)`Info: Be sure that are you logged as a root!`
- Type these commands - Type these commands
``` ```
apt-get update && apt-get upgrade -y apt-get update && apt-get upgrade -y
apt-get install -y build-essential make texinfo cmake bison flex gettext libgmp3-dev libmpfr-dev libmpc-dev libz-dev wget patch apt-get install -y build-essential make texinfo cmake bison flex gettext libgmp3-dev libmpfr-dev libmpc-dev libz-dev wget patch
``` ```
- Configure git (replace your name and email) - Configure git (replace your name and email)
``` ```
git config --global user.email "your@email.com" git config --global user.email "your@email.com"
git config --global user.name "Your Name" git config --global user.name "Your Name"
``` ```
- Create directories - Create directories
``` ```
mkdir /ps2dev mkdir /ps2dev
mkdir /ps2dev/built mkdir /ps2dev/built
@@ -45,12 +53,16 @@ mkdir /ps2dev/source
mkdir /repos mkdir /repos
mkdir /repos/tyra mkdir /repos/tyra
``` ```
- Clone repos - Clone repos
``` ```
git clone https://github.com/ps2dev/ps2dev.git /ps2dev/source/ git clone https://github.com/ps2dev/ps2dev.git /ps2dev/source/
git clone https://github.com/h4570/tyra.git /repos/tyra/ git clone https://github.com/h4570/tyra.git /repos/tyra/
``` ```
- Open bashrc via `nano ~/.bashrc` and add these lines at the end of file. Be sure that they are 1:1, so don't add additional spaces! - Open bashrc via `nano ~/.bashrc` and add these lines at the end of file. Be sure that they are 1:1, so don't add additional spaces!
``` ```
export PS2DEV=/ps2dev/built export PS2DEV=/ps2dev/built
export PS2SDK=$PS2DEV/ps2sdk export PS2SDK=$PS2DEV/ps2sdk
@@ -61,27 +73,30 @@ export TYRA=/repos/tyra
export WSL_MAKE_WINDOWS=\\\\\\\\wsl\$\$\\\\Ubuntu-20.04 export WSL_MAKE_WINDOWS=\\\\\\\\wsl\$\$\\\\Ubuntu-20.04
export WSL_LINUX_PCSX2=/mnt/c/Program\\\ Files\\\ \\\(x86\\\)/PCSX2 export WSL_LINUX_PCSX2=/mnt/c/Program\\\ Files\\\ \\\(x86\\\)/PCSX2
``` ```
- Refresh env variables via -> `. ~/.bashrc` - Refresh env variables via -> `. ~/.bashrc`
- Close wsl terminal - Close wsl terminal
--- ---
<br/> <br/>
## Mapping WSL directories to your Windows machine ## Mapping WSL directories to your Windows machine
- Open cmd and type `wsl.exe --list`
`Info: Remember your distribution name from this list. My is "Ubuntu-20.04"` - Open cmd and type `wsl.exe --list``Info: Remember your distribution name from this list. My is "Ubuntu-20.04"`
- Click at the windows logo on your keyboard, type "This PC" and open - Click at the windows logo on your keyboard, type "This PC" and open
- At the upper menu click "Map disk drive" - At the upper menu click "Map disk drive"`Info: Replace my name with your WSL name!`
`Info: Replace my name with your WSL name!`
- Folder: \\\\wsl$\\Ubuntu-20.04 - Folder: \\\\wsl$\\Ubuntu-20.04
- Click OK - Click OK
`Info: You will have now new disk on your PC, this is the WSL filesystem.` `Info: You will have now new disk on your PC, this is the WSL filesystem.`
--- ---
<br/> <br/>
## Configuring VSCode ## Configuring VSCode
- Open VSCode - Open VSCode
- Install extension "Remote - WSL" - Install extension "Remote - WSL"
- Install extension "C/C++" - Install extension "C/C++"
@@ -93,10 +108,13 @@ export WSL_LINUX_PCSX2=/mnt/c/Program\\\ Files\\\ \\\(x86\\\)/PCSX2
`Info: New terminal should appear. This is the same WSL terminal :)` `Info: New terminal should appear. This is the same WSL terminal :)`
--- ---
<br/> <br/>
## PS2DEV installation ## PS2DEV installation
- In VSCode's WSL terminal type: - In VSCode's WSL terminal type:
``` ```
cd /ps2dev/source cd /ps2dev/source
unset ZLIB unset ZLIB
@@ -105,42 +123,49 @@ unset LIBJPEG
unset LIBPNG unset LIBPNG
./build-all.sh ./build-all.sh
``` ```
`Info: This can take some time...` `Info: This can take some time...`
- And open again .bashrc via `nano ~/.bashrc` and add these lines at the end of file. - And open again .bashrc via `nano ~/.bashrc` and add these lines at the end of file.
``` ```
export ZLIB=${PS2SDK}/ports export ZLIB=${PS2SDK}/ports
export LIBTIFF=${PS2SDK}/ports export LIBTIFF=${PS2SDK}/ports
export LIBJPEG=${PS2SDK}/ports export LIBJPEG=${PS2SDK}/ports
export LIBPNG=${PS2SDK}/ports export LIBPNG=${PS2SDK}/ports
``` ```
- Refresh env variables via `. ~/.bashrc` - Refresh env variables via `. ~/.bashrc`
### !!! Please don't forgot to remove/refresh these 4 exports when you will want to update PS2DEV (./build-all.sh), because there is circular dependency between these libs and gsKit which is included in PS2DEV !!! ### !!! Please don't forgot to remove/refresh these 4 exports when you will want to update PS2DEV (./build-all.sh), because there is circular dependency between these libs and gsKit which is included in PS2DEV !!!
--- ---
<br/> <br/>
## Build Tyra ## Build Tyra
- Just hit make all on the root of tyra folder or you can go via `cd /src/engine` and hit `make all` there.
- Go to one of the samples via `cd /repos/tyra/src/samples/floors` - Go to one of the samples via `cd /repos/tyra/src/samples/floors`
- Build debug version: `make rebuild-dbg-engine` - Build debug version: `make rebuild-dbg-engine Info: If you want to build final version in future, type make rebuild-engine `
`Info: If you want to build final version in future, type make rebuild-engine `
--- ---
<br/> <br/>
## Install & configure PCSX2 ## Install & configure PCSX2
- Download & install PCSX2 from (1.6+ version)
https://pcsx2.net/ - Download & install PCSX2 from (1.6+ version)https://pcsx2.net/
- Extract bios files from - Extract bios files fromhttps://romsmania.cc/bios/pcsx2-playstation-2-bios-3to `C:\Users%USERNAME%\Documents\PCSX2\bios`
https://romsmania.cc/bios/pcsx2-playstation-2-bios-3
to
`C:\Users%USERNAME%\Documents\PCSX2\bios`
- Close `PCSX2` if you have opened! - Close `PCSX2` if you have opened!
- Open `C:\Users\hasto\Documents\PCSX2\inis\PCSX2_vm.ini` in notepad - Open `C:\Users\hasto\Documents\PCSX2\inis\PCSX2_vm.ini` in notepad
``` ```
HostFs=enabled HostFs=enabled
``` ```
- Open PCSX2 and map pad to your keyboard, for example: - Open PCSX2 and map pad to your keyboard, for example:
``` ```
WASD = Left joy WASD = Left joy
Arrows = Right joy Arrows = Right joy
@@ -149,45 +174,49 @@ Circle = C
``` ```
--- ---
<br/> <br/>
## Run one of the samples ## Run one of the samples
- Add assets for "floors" sample - Add assets for "floors" sample
- Download assets from - Download assets fromhttps://github.com/h4570/tyra/tree/master/src/samples/floors
https://github.com/h4570/tyra/tree/master/src/samples/floors
- Windows: Open your WSL folder (This PC -> WSL folder) - Windows: Open your WSL folder (This PC -> WSL folder)
- Extract assets to /repos/tyra/src/samples/floors/bin/ (create bin folder if not exists) - Extract assets to /repos/tyra/src/samples/floors/bin/ (create bin folder if not exists)
- Compile sample via `make` - Compile sample via `make``Info: Elf file should be produced in /bin`
`Info: Elf file should be produced in /bin`
- Run sample in PSX2 via `make run-pcsx2` - Run sample in PSX2 via `make run-pcsx2`
--- ---
<br/> <br/>
## How to code? ## How to code?
Do some changes in your sample and just type `make clean all run-pcsx2` in your sample folder. Do some changes in your sample and just type `make clean all run-pcsx2` in your sample folder.
You can create your own sample, by just copying cube folder. You can create your own sample, by just copying cube folder.
--- ---
<br/> <br/>
## Setup Intelisense ## Setup Intelisense
- Download - Downloadhttp://apgcglz.cluster028.hosting.ovh.net/tyra/intellisense.zip
http://apgcglz.cluster028.hosting.ovh.net/tyra/intellisense.zip - Unpack `.vscode` folder to WSL's `/repos/tyra/Info: This configuration is set for cube sample, but you can change it in tasks.json file`
- Unpack `.vscode` folder to WSL's `/repos/tyra/`
`Info: This configuration is set for cube sample, but you can change it in tasks.json file`
--- ---
<br/> <br/>
## Advanced: Compiling VU1 programs ## Advanced: Compiling VU1 programs
`Info: Based on https://github.com/microsoft/wsl/issues/2468#issuecomment-374904520` `Info: Based on https://github.com/microsoft/wsl/issues/2468#issuecomment-374904520`
- Download VCL - Download VCL
http://lukasz.dk/files/vcl.1.4.beta7.x86.tgz http://lukasz.dk/files/vcl.1.4.beta7.x86.tgz
- Rename `vcl_14beta7_x86` binary to `vcl` - Rename `vcl_14beta7_x86` binary to `vcl`
- Put `vcl` to WSL's `/usr/bin` - Put `vcl` to WSL's `/usr/bin`
``` ```
apt-get install qemu qemu-user-static binfmt-support apt-get install qemu qemu-user-static binfmt-support
update-binfmts --install i386 /usr/bin/qemu-i386-static --magic '\x7fELF\x01\x01\x01\x03\x00\x00\x00\x00\x00\x00\x00\x00\x03\x00\x03\x00\x01\x00\x00\x00' --mask '\xff\xff\xff\xff\xff\xff\xff\xfc\xff\xff\xff\xff\xff\xff\xff\xff\xf8\xff\xff\xff\xff\xff\xff\xff' update-binfmts --install i386 /usr/bin/qemu-i386-static --magic '\x7fELF\x01\x01\x01\x03\x00\x00\x00\x00\x00\x00\x00\x00\x03\x00\x03\x00\x01\x00\x00\x00' --mask '\xff\xff\xff\xff\xff\xff\xff\xfc\xff\xff\xff\xff\xff\xff\xff\xff\xf8\xff\xff\xff\xff\xff\xff\xff'
@@ -196,13 +225,18 @@ apt-get update
apt-get install libstdc++5:i386 apt-get install libstdc++5:i386
chmod 755 /usr/bin/vcl chmod 755 /usr/bin/vcl
``` ```
`Info: In Ubuntu 18.04 I was obligated to install lib32ncurses5 also` `Info: In Ubuntu 18.04 I was obligated to install lib32ncurses5 also`
- Add this line to `~/.bashrc` - Add this line to `~/.bashrc`
``` ```
service binfmt-support start &>/dev/null service binfmt-support start &>/dev/null
``` ```
- Uncomment `.vsm`/`.vcl` recipe from Tyra's engine `Makefile` - Uncomment `.vsm`/`.vcl` recipe from Tyra's engine `Makefile`
- Download & install VCL preprocessor - Download & install VCL preprocessor
``` ```
mkdir temp && cd temp mkdir temp && cd temp
git clone https://github.com/glampert/vclpp . git clone https://github.com/glampert/vclpp .
@@ -211,4 +245,5 @@ cp vclpp /usr/bin/
chmod 755 /usr/bin/vclpp chmod 755 /usr/bin/vclpp
cd .. && rm -rf ./temp cd .. && rm -rf ./temp
``` ```
- Uncomment `.vclpp`/`.vcl` recipe from Tyra's engine `Makefile` - Uncomment `.vclpp`/`.vcl` recipe from Tyra's engine `Makefile`