Setting Up and Compiling the Newer Sources

Here are 3 tutorials to set up and compile the NewerSMBW source code, along with a few questions regarding the NewerSMBW source code.

If you keep getting "permission denied" errors, etc., you can simply type:  in the terminal and enter password when prompted to curcumivent all   commands, so you won't have to type   everytime. If you're on Ubuntu Linux or Mac OS X,  doesn't work, so you'll need to type   instead.

NOTE: If no text is shown when typing the password, it does not mean it's not working, the text is hidden so in case if anyone is watching the computer screen behind your back, they won't see your password.

The estimated time to set up and compile the NewerSMBW source code is about 2 or 3 hours (depending on your computer specs, internet connection speed, etc).

Mac OS X (by Tempus, and heavily edited by 9211tr, updated/working in 2018)
This has been tested on Mac OS X 10.14 Mojave. It should also work on Mac OS X 10.9 (Mavericks) up to 10.13 (High Sierra) or any version higher than 10.14 Mojave.

Installing GCC
Install Xcode via the Mac App Store (if you're on older Mac OS X version {below 10.14 Mojave}, you'll have to go online and download the latest version of Xcode for whichever older Mac OS X version you have). Open Xcode once it's finished installing, read all the license agreements that pops up and agree to it.

Installing CMake, GNU "SED", and GNU "WGET"
Open the terminal (if you haven't) and type: Install the package manager, "Homebrew", go to its website: https://brew.sh/, and copy the install command and paste and enter it in the terminal, then once it's finished installing, type:

Installing devkitPPC
Open the terminal (if you haven't) and type: Afterwards, in the terminal, type: Or you can manually download devkitPPC here: https://github.com/devkitPro/buildscripts/releases And manually extract the devkitPPC  file to the   directory.

Installing PyElfTools/PyYAML
Open the terminal (if you haven't) and type:

Downloading the Newer Sources
Open the terminal (if you haven't) and type: Or you can manually download the Newer Sources here: https://github.com/Treeki/NewerSMBW/tree/no-translations And download the  file and extract it to the   directory.

Downloading and Patching Clang/LLVM (rev. 184655)
Open the terminal (if you haven't) and type:

Compiling Clang/LLVM (rev. 184655)
Open the terminal (if you haven't) and type:

NOTE: If you get an error saying  and/or , you might want to type these commands: to fix the errors, more information about these errors here.

Additionally, if you get an  fatal error, you'll need to do modifications to some of the LLVM compiler-rt source files to fix this error. Open the terminal (if you haven't) and type:

Open  with the text editor and replace this text:   with

Open  with the text editor and: Remove the text, then replace this text   with

Replace this text  with

Open  with the text editor and: Replace this text  with

Replace this text  with

More information about this error here.</b>

Compiling Newer</b>
At any time, open the terminal (if you haven't) and type:

Finishing</b>
This will output a number of  files into the   folder. You'll need to rename them to their NewerSMBW readable names, so open the terminal (if you haven't) and type:  Once you're done with that, at any time, simply type in the terminal:   and then go into the   folder in the   folder, then plop the renamed   files into the   folder in the Newer pack, and you should be sailing! If you want to automate the process further, take a look at the  file in the Kamek folder in a text editor. Change the commands at the top to match the ones in the code block in the  section, and change the directory paths below to output directly to your test folder destination. You can integrate the script with wit and Dolphin, or with RiiFs to get ultra speedy testing runs.

Debian/Ubuntu Linux (by Grop, and heavily edited by 9211tr and slightly edited by RedStoneMatt, updated/working in 2018)
If you're using Ubuntu Linux, Ubuntu 17.04 (or earlier) is recommended, versions above that use GLIBC 2.25 (or higher), and that's incompatible with LLVM (as it results in compiliation errors when compiling LLVM). This method works on both a real computer and a virtual machine.

Keep in mind that you'll need to use the 64-bit (x86-64 or AMD64) version of Debian/Ubuntu Linux, since some of the necessary tools/programs needed for compiling NewerSMBW are no longer compatible with the 32-bit (i386 or i686) version.

Preparing apt-get</b>
If you're on Ubuntu 17.04 ONLY</b>, you'll need to do some changes to the apt-get sources to prevent errors (more information here: https://ubuntuforums.org/showthread.php?t=2382832#post13732693). Open the terminal (if you haven't) and type:

Go to line #2 of the file (using the arrow keys) and paste this code: Then exit and save your changes.

Open the terminal (if you haven't) and type:  and restart your Debian/Ubuntu Linux machine.

If you get an error saying  when trying to run , just simply type this command:   and the error should be gone.

Installing GCC</b>
Open the terminal (if you haven't) and type:

Installing CMake</b>
Open the terminal (if you haven't) and type:

Installing Subversion (SVN)</b>
Open the terminal (if you haven't) and type:

Installing devkitPPC</b>
Open the terminal (if you haven't) and type: Afterwards, in the terminal, type: Or you can manually download devkitPPC here: https://github.com/devkitPro/buildscripts/releases And manually extract the devkitPPC  file to the   directory.

Installing PyElfTools/PyYAML</b>
Open the terminal (if you haven't) and type:

Downloading the Newer Sources</b>
Open the terminal (if you haven't) and type: Or you can manually download the Newer Sources here: https://github.com/Treeki/NewerSMBW/tree/no-translations And download the  file and extract it to the   directory.

Downloading and Patching Clang/LLVM (rev. 184655)</b>
Open the terminal (if you haven't) and type:

Compiling Clang/LLVM (rev. 184655)</b>
Open the terminal (if you haven't) and type:

Compiling Newer</b>
At any time, open the terminal (if you haven't) and type: NOTE: If you're on Ubuntu, make sure to use  instead, as   doesn't work on Ubuntu.</b>

Finishing</b>
This will output a number of  files into the   folder. You'll need to rename them to their NewerSMBW readable names, so open the terminal (if you haven't) and type:  Once you're done with that, at any time, simply type in the terminal (<b style="color:#FF0000;">and again, if you're on Ubuntu, make sure to use   instead, as   doesn't work on Ubuntu</b>):   and then go into the   folder in the   folder, then plop the renamed   files into the   folder in the Newer pack, and you should be sailing! If you want to automate the process further, take a look at the  file in the Kamek folder in a text editor. Change the commands at the top to match the ones in the code block in the  section, and change the directory paths below to output directly to your test folder destination. You can integrate the script with wit and Dolphin, or with RiiFs to get ultra speedy testing runs.

<b style="font-size:140%;">Requirements</b>
- 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.

<b>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  -->   -->   --> https://dl.dropbox.com/s/sf1v3lfudcon2e5/Compiling%20NewerSMBW%20Sources%20on%20Windows%2010_img1.png

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.</b>

Step 1
Go to  -->   -->   -->   Set it to

Step 2
Go to the Cortana Menu (the circle icon near the Start Menu icon) and in the search box, type  Check the box that says   and click OK. Once you're done enabling the WSL subsystem, restart your computer.

Step 3
After restarting, we'll need to install the WSL subsystem (the WSL subsystem installation may take about 10 minutes to complete):

Method 1: Windows Store (installs a much improved version of the WSL subsystem, recommended)
<b style="color:#FF0000;">NOTE: You need the Windows 10 Fall Creators Update, build 16215.0 or higher, in order to use this method, or it won't work.</b>

Go to: https://aka.ms/wslstore, and the Microsoft Store should appear: https://dl.dropbox.com/s/teq36wgvrvvmzc8/Compiling%20NewerSMBW%20Sources%20on%20Windows%2010_img2.png

You'll get to choose 5 (or probably more, if you're reading this in future years) different Linux distros for the WSL subsystem. Choose only Ubuntu (not any other distro), in order for everything to work out properly.

Scroll down and click, look for and choose the Ubuntu 16.04 LTS distro (this is important and as I said before: Ubuntu 17.04 {or earlier} is recommended, versions above that use GLIBC 2.25 {or higher}, and that's incompatible with LLVM {as it results in compiliation errors when compiling LLVM}). Once you select the Ubuntu 16.04 LTS distro, hit  to download it. When it's finished downloading, hit  (you can also choose to pin it to the Start Menu if you like): https://dl.dropbox.com/s/ejro133p7p9z1d6/Compiling%20NewerSMBW%20Sources%20on%20Windows%2010_img3.png https://dl.dropbox.com/s/jm66w27o8cx9zyn/Compiling%20NewerSMBW%20Sources%20on%20Windows%2010_img4.png

After hitting, it'll say that it's installing.

Method 2: Command-line (installs a legacy version of the WSL subsystem)
<b style="color:#FF0000;">NOTE: This method is not recommended as it installs a legacy version of the WSL subsystem, but if you're not using the Windows 10 Fall Creators Update, build 16215.0 or higher, then this is the only method that will work.</b>

Go to the Cortana Menu and in the search box, type  to install the WSL subsystem. If you get an error after typing, saying   either: <ul style="list-style-type:square;"> <li>You go to the Cortana Menu and in the search box, type instead  and hopefully, you shouldn't have any errors.</li>

<li>You have the Windows 10 Fall Creators Update, build 16215.0 or higher installed, and should instead use the Windows Store method.</li> </ul>

Read the license agreement, and if you accept it, type  (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  in all lowercase, and for the password (IF PROMPTED), that's all up to you.

Now type  to exit out of the WSL subsystem. If you get an error saying that the  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  to launch the WSL subsystem. Normally, if the  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

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

Step 1
Type in: And it'll prompt you on what you want to do, type  or simply   and hit ENTER on your keyboard, and it should start installing, and just wait for it to complete, 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: The  option isn't required, but with the   option, your compiled NewerSMBW   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. If you installed the WSL subsystem via the Windows Store method, then the folder is: If you installed it via the Command-line method, then the folder is:

Go to the, or if you used the   option:   folder (where   is the path or folder name to the NewerSMBW source code folder). You should see all the DLCode/DLRelocs/System  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  files to your   folder in your NewerSMBW game patch folder and test your mods out! >> If you haven't used the  option, you'll need to manually rename the   files to their NewerSMBW-readable names before you drag them to the   folder.

1: (Windows 10 WSL Subsystem Only) Can I uninstall the NewerSMBW sources?
Yes, run the script via the command:  and type   or simply   and it'll remove it, among the other tools/compilers/etc.

<b style="color:#FF0000;">NOTE: This will remove everything in the NewerSMBW sources folder, so make sure you backup any source files/etc. from the NewerSMBW sources folder before uninstalling it.</b>

2: (Windows 10 WSL Subsystem Only) Can I reinstall the NewerSMBW sources?
Uninstall it, FIRST (see question #1), and then install it back again.

3: Can I have multiple folders for the NewerSMBW sources?
<b style="color:#FF0000;">NOTE: If you're on Ubuntu or Mac OS X, make sure to use  instead, as   doesn't work on Ubuntu or Mac OS X. Also if you're on Mac OS X, make sure to use , for the GNU "SED" (stream editor application) instead, not  , because   on Mac OS X is a script editor application, not the GNU "SED" (stream editor application).</b>

Yes, copy the existing folder by typing the commands:  Or if you need an unmodified and fresh copy, you can simply redownload it by typing these commands:   (where   is the folder name of the copy of the NewerSMBW sources folder). <b style="color:#FF0000;">NOTE: Do not have  as   or your current NewerSMBW sources will be OVERWRITTEN.</b>

Copying the file (for Debian/Ubuntu Linux and Mac OS X Only)
Type these commands in the terminal:

Copying the file (for Windows 10 WSL Subsystem Only)
Type these commands in the WSL subsystem:  (where   is the file name of the copy of the   file).

Then you'll need to modify the copy of the file with a text editor that supports the Unix (LF) line feed format (I would recommend PSPad if you don't have one), then replace the text  with   and save the changes.

Now in the WSL subsystem, type: If you want to compile the NewerSMBW sources easily, type:

<b style="font-size:140%;">Requirements</b>
- Windows 7 or 10.

- Python 2.7

- Pyyaml and Pyelftools installed on your Python 2.7 installation

Step 1
Download This ZIP file and extract it.

Step 2
Be SURE that you have Python 2.7 with Pyyaml and Pyelftools installed on it, otherwise it won't work! Edit the source code as you want, and then, open the makeNewerKP.bat file with the CMD Wait until you see the compiling sucessful message, when it's done you'll find your compiled files inside the Build folder

<b style="font-size:140%;">Requirements</b>
- A web browser

- A text editor

Step 1
go to http://51.38.230.7/newercompiler/ and follow the instructions to get the ZIP file.

Step 2
Edit the source code as you want, and when it's done, zip the folder again and upload it to the website Wait a few minutes until it compiles.

Step 3
If the compilation succeeds, you'll find a link to download your compiled files at the bottom of the page, download it and here it is!