Setting Up and Compiling the Newer Sources

Here is the 2 tutorials to make you compile the NewerSMBW's Source Code

WINDOWS 10 (not sure if it works)
THIS TUTORIAL WAS MADE BY 9211tr

 Requirements 

- Windows 10 Anniversary Update BUILD 14393.0, Version 1607 (or higher).

- The 64-bit (x64 or x86-64) version of Windows 10 + an x64-based processor on your computer, as the WSL subsystem requires this in order for it to enable, install, and work (as I stated before). It WILL NOT work on the 32-bit (x32 or x86) version of Windows 10 and/or an x86-based processor on your computer.

- An internet connection.

- At least 22 GB of free disk space.

- ESTIMATED time required: 2 or 3 hours. (The reason why I say "ESTIMATED" is because the time required may be different for you, depending on your computer specs, internet connection speed, etc.)

HINT: To tell if your Windows 10 PC is 64-bit (and is running Anniversary Update BUILD 14393.0 Version 1607 or higher, and on an x64-based processor), go to the Start Menu --> Settings --> System --> About:

If your PC is below build 14393.0 Version 1607, then I'd suggest you update your computer to the newest build. Since mine is build 17134.112 Version 1803 (as shown in the photo above; plus, I have the Fall Creators Update installed), it is higher than 14393.0 Version 1607, so I'm good to go.

Tutorial

'Installing/Enabling the WSL subsystem:'

STEP 1: Go to Start Menu --> Settings --> Update & Security --> For Developers. Set it to Developer Mode.

STEP 2: Go to the Cortana Menu (the circle icon near the Start Menu icon) and in the search box, type Turn Windows features on or off. Check the box that says Windows Subsystem for Linux and click OK.

STEP 3: Once you're done enabling the WSL subsystem, restart your computer.

STEP 4: After restarting, we'll need to install the WSL subsystem:

Go to the Cortana Menu and in the search box, type

bash

to install the WSL subsystem.

If you get an error after typing bash, saying "Windows Subsystem for Linux has no installed distributions":

You go to the Cortana Menu and in the search box, type instead

lxrun /install

and hopefully, you shouldn't have any errors.

Read the license agreement, and if you accept it, type

y

(for "Yes", to accept), and it will install.

Once it's done installing, it will ask you for what the username should be called, just type

root

in all lowercase, and for the password (IF PROMPTED), that's all up to you.

Now type

exit

to exit out of the WSL subsystem.

If you get an error saying that the "root" username already exists, then close the WSL subsystem by hitting Ctrl-C on the keyboard, don't enter in a username.

Go to the Cortana Menu and in the search box, type bash to launch the WSL subsystem.

Normally, if the "root" username already exists, it will instead use that username, but if it still prompts you to enter in the username, then you have no choice but to use a different username.

Type the commands

apt-get update -y

apt-get upgrade -y

exit

Go to the Cortana Menu and in the search box, type bash to launch the WSL subsystem, then type cd /

'Setting up and Compiling the NewerSMBW sources:'

STEP 1: Type in:

sh <(wget -O - https://www.dropbox.com/s/xflv6knhk953vmy/NewerSMBWSrcSetup_WindowsWSL.sh?dl=1 )

And it'll prompt you on what you want to do, type

install

or simply

i

and hit ENTER on your keyboard, and it should start installing, and just wait for it to complete. And as I said before, the estimated time for this to take is about 2 or 3 hours, so find something to do in the meantime, unless if you have the patience to watch the screen until the script is finished running.

The script installs everything automatically, so there's no need for you to install anything manually.

STEP 2: Once the installation is complete/finished, it'll do a TEST compile on the NewerSMBW sources (to see if everything was installed/done properly) and once that's finished and no syntax errors (or whatever errors) occurred, you're all done.

To simply compile NewerSMBW at any time, simply type in the commands:

cd /

./newersmbw_compile.sh --autorename

The --autorename option isn't required, but with the --autorename option, your compiled NewerSMBW .bin files will be automatically renamed to their NewerSMBW-readable names.

STEP 3: You'll need to go into the folder of where the WSL subsystem files are located.

the folder is:

C:\Users\%USERNAME%\AppData\Local\lxss\rootfs

Go to the \Kamek\NewerASM\renamed, or if you used the --autorename option: \Kamek\NewerASM\renamed folder (where  is the path or folder name to the NewerSMBW source code folder).

You should see all the DLCode/DLRelocs/System .bin files for US(NTSC)/EU(PAL)/JP(JPN) {v1 and v2} if no syntax errors (or whatever errors occurred) when compiling the NewerSMBW sources.

Then drag the .bin files to your /NewerRes folder in your NewerSMBW game patch folder and test your mods out! >> If you haven't used the --autorename option, you'll need to manually rename the .bin files to their NewerSMBW-readable names before you drag them to the /NewerRes folder.

LINUX [UBUNTU] (It works perfectly)
THIS TUTORIAL WAS MADE BY 9211tr AND A LITTLE BIT EDITED BY RedStoneMatt

First you need to have Ubuntu 16.04 LTS, it's really important. It works with a virtual machine and with a real computer too

Open the terminal (if you haven't) and type:

sudo -i

the password of your machine

cd /

apt-get update -y

apt-get upgrade -y

and restart your Debian/Ubuntu Linux machine.

If you get an error saying "Could not get lock /var/lib/dpkg/lock - open" when trying to run apt-get upgrade -y, just simply type this command:

rm /var/lib/dpkg/lock

and the error should be gone.

Open the terminal (if you haven't) and type:

sudo -i

the password of your machine

cd /

apt-get install -y gcc

apt-get install -y make

apt-get install -y cmake

apt-get install -y subversion

wget -O devkitPPC.tar.xz https://github.com/devkitPro/buildscripts/releases/download/devkitPPC_r32/devkitPPC_r32-linux.tar.xz

tar -xvf devkitPPC.tar.xz -C /

rm devkitPPC.tar.xz

apt-get install -y python-pip 

pip install pyelftools 

pip install pyyaml

svn co https://github.com/Treeki/NewerSMBW/branches/no-translations /NewerSMBW-no-translations svn co -r 184655 http://llvm.org/svn/llvm-project/llvm/trunk /llvm

svn co -r 184655 http://llvm.org/svn/llvm-project/cfe/trunk /llvm/tools/clang

svn co -r 184655 http://llvm.org/svn/llvm-project/compiler-rt/trunk /llvm/projects/compiler-rt cd /llvm/tools/clang patch -p0 -i /NewerSMBW-no-translations/ClangPatches/clang_cw_patches_r184655.diff

mkdir /NewerSMBW-LLVM

mkdir /llvm/build

cd /llvm/build

cmake -DLLVM_DEFAULT_TARGET_TRIPLE=powerpc-unknown-unknown-unknown -DPYTHON_EXECUTABLE=/usr/bin/python -DLLVM_TARGETS_TO_BUILD="PowerPC" -DLLVM_INCLUDE_EXAMPLES=OFF -DLLVM_INCLUDE_TESTS=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="/NewerSMBW-LLVM" /llvm

make

make install

cd /

rm -r /llvm

cd /NewerSMBW-no-translations/Kamek/

mv src/heapbar.S src/heapbar2.S

sed -e '129d' src/heapbar2.S > src/heapbar.S

rm src/heapbar2.S

mkdir processed

mkdir NewerASM

If you've done everything correctly, you can now compile the newer sources anytime by typing:

sudo -i

the password of your machine

cd /NewerSMBW-no-translations/Kamek

python tools/mapfile_tool.py

python tools/kamek.py NewerProjectKP.yaml --show-cmd --no-rels --use-clang --gcc-type=/devkitPPC/bin/powerpc-eabi --llvm-path=/NewerSMBW-LLVM/bin

Now that the code is compiled, you can rename it by typing:

sudo -i

the password of your machine

cd /NewerSMBW-no-translations/Kamek/NewerASM/

wget https://dl.dropbox.com/s/ytt9kludaetim4n/RenameNewerBinFiles.sh

chmod +x RenameNewerBinFiles.sh

cd /NewerSMBW-no-translations/Kamek/NewerASM/

./RenameNewerBinFiles.sh