Setting Up and Compiling the Newer Sources

Here are the tutorials to set up and compile the NewerSMBW sources, along with a few questions regarding the NewerSMBW sources. If you get "permission denied" or "read-only filesystem" errors, [https://horizon.miraheze.org/wiki/Setting_Up_and_Compiling_the_Newer_Sources#1:_How_do_I_resolve_the_%22permission_denied%22_and_%22read-only_filesystem%22_errors_whenever_I_type_a_command_in_the_terminal? see this here.]

The  and   tutorials will guide you through compiling NewerSMBW v1.2.0, which uses a patched version of Clang that therefore requires to be compiled manually. For this reason, the estimated time to set up and compile the NewerSMBW v1.2.0 sources may take between 30 minutes and 3 hours, depending on your computer specs, knowledge with the terminal, internet connection speed, etc.

The  tutorial will guide you through compiling NewerSMBW v1.3.0, which uses CodeWarrior instead of Clang.

The  tutorial will guide you through compiling mods of NewerSMBW that uses CodeWarrior too but have some differences in their setupping process.

Please note that trying to use code from a Clang-based Newer Sources folder in a CodeWarrior-based one may result in errors due to the fact that both compilers are different and some structures and files aren't the same between both versions, one of the most notable differences is that both mangled and demangled symbols are not the always same.

If you do not know which version to choose, NewerSMBW v1.3.0 is recommended

Credits and Release Information
Original tutorial by Tempus, and heavily edited by User:9211tr. Updated/working as of 2021. This has been tested on macOS 10.15 Catalina. It should also work on OS X 10.9 Mavericks up to macOS 10.14 Mojave, or (but untested) on any version later than 10.15 Catalina.

Installing GCC
Install Xcode via the Mac App Store (if you're on an earlier macOS version {below 10.15 Catalina}, you may have to go online and download the latest version of Xcode for whichever earlier macOS 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 already) and type: Install the package manager, "Homebrew". Go to its website: https://brew.sh, copy the install command, and paste/enter it into the terminal. Then once it's finished installing, type:

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

Installing PyElfTools/PyYAML
Open the terminal (if you haven't already) and type: NOTE: If you get an  fatal error (usually if you're on macOS 10.15 Catalina), you may have to install the libyaml package, remove the   PyYAML   reference file, and reinstall PyYAML. In the terminal, type: (where  is the name of the PyYAML   reference file, for example,  ). Also,  automatically installs PyYAML 6.0 and later if you don't specify. Python 2.7.x support is dropped in PyYAML 6.0 and later (more information here and here), and gives errors when using/installing it, especially with the NewerSMBW sources. PyYAML 5.4.1 is the final version with Python 2.7.x support.

Downloading the NewerSMBW sources
Open the terminal (if you haven't already) and type: Or you can manually download the NewerSMBW sources here: https://github.com/Newer-Team/NewerSMBW And download the  file and extract it to the   directory. NOTE: If you get an error saying  (usually if you're on macOS 10.15 Catalina), you may have to install the subversion (SVN) package with "Homebrew" instead. In the terminal, type: More information about this error here.

Downloading and Patching Clang/LLVM (SVN revision 184655 / GitHub revision 152001)
Open the terminal (if you haven't already) and type: Or you can manually download LLVM here: https://github.com/llvm/llvm-project/tree/58032cb029dcb366be868db48c89af128cce1dd4 Download the  file and extract it to the   directory, then move the:   folder to    folder to    folder to    Afterwards, in the terminal, type: NOTE: The LLVM SVN repository links (http://llvm.org/svn/llvm-project/llvm/trunk, http://llvm.org/svn/llvm-project/cfe/trunk, and http://llvm.org/svn/llvm-project/compiler-rt/trunk) were shut down in 2021 and they point to an HTTP 403 Forbidden error. Also, LLVM has moved to GitHub (more information here and here). So the revision number of the GitHub repository link and the LLVM SVN repository links is different because of that. Revision 152001 of the GitHub repository points to commit 58032cb029dcb366be868db48c89af128cce1dd4, which is equivalent to LLVM SVN revision 184655.

Compiling Clang/LLVM (SVN revision 184655 / GitHub revision 152001)
Open the terminal (if you haven't already) 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 3 of the LLVM compiler-rt source files to fix this error (more information about this error here). Open the terminal (if you haven't already) and type:

1:</b> Open  with the text editor and replace this text:   with

2:</b> Open  with the text editor and: Remove the text, then replace this text   with

Afterwards, replace this text  with

3:</b> Open  with the text editor and: Replace this text  with

Afterwards, replace this text  with

Save your changes after doing the modifications.

Compiling the NewerSMBW sources
At any time, open the terminal (if you haven't already) and type:

Finishing
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 already) 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 drag the renamed   files into your   folder in your NewerSMBW game patch folder and test your mods out! If you want to automate the process further, take a look at the  file in the   folder in the 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 (Wiimms ISO Tools), Dolphin Emulator, or with RiiFS to get ultra speedy testing runs.

Credits and Release Information
Original tutorial by Grop, and heavily edited by User:9211tr + slightly edited by User:RedStoneMatt. Updated/working as of 2021. Debian 9.13.0 (or earlier) / Ubuntu 17.04 (or earlier) is needed, versions above that use GLIBC 2.25 or later, and that's incompatible with LLVM (as it results in compilation errors when compiling LLVM). Also, 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 (Ubuntu 17.04 only)
First, you'll need to do some changes to the apt-get sources to prevent errors (more information here). Open the terminal (if you haven't already) and type:

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

Updating apt-get
Open the terminal (if you haven't already) and type: and restart your computer.

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

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

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

Installing Subversion (SVN)
Open the terminal (if you haven't already) and type:

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

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

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

Downloading and Patching Clang/LLVM (SVN revision 184655 / GitHub revision 152001)
Open the terminal (if you haven't already) and type: Or you can manually download LLVM here: https://github.com/llvm/llvm-project/tree/58032cb029dcb366be868db48c89af128cce1dd4 Download the  file and extract it to the   directory, then move the: <ul style="list-style-type:square;">  folder to  </li>  folder to  </li>  folder to  </li> </ul> Afterwards, in the terminal, type: NOTE:</b> The LLVM SVN repository links (http://llvm.org/svn/llvm-project/llvm/trunk, http://llvm.org/svn/llvm-project/cfe/trunk, and http://llvm.org/svn/llvm-project/compiler-rt/trunk) were shut down in 2021 and they point to an HTTP 403 Forbidden error. Also, LLVM has moved to GitHub (more information here and here). So the revision number of the GitHub repository link and the LLVM SVN repository links is different because of that. Revision 152001 of the GitHub repository points to commit 58032cb029dcb366be868db48c89af128cce1dd4, which is equivalent to LLVM SVN revision 184655.

Compiling Clang/LLVM (SVN revision 184655 / GitHub revision 152001)
Open the terminal (if you haven't already) and type:

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

Finishing
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 already) and type: Once you're done with that, at any time, simply type in the terminal (and again, if you're on Ubuntu,</b> make sure to use  instead, as   doesn't work on Ubuntu): and then go into the  folder in the   folder, then drag the renamed   files into your   folder in your NewerSMBW game patch folder and test your mods out! If you want to automate the process further, take a look at the  file in the   folder in the 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 (Wiimms ISO Tools), Dolphin Emulator, or with RiiFS to get ultra speedy testing runs.

Windows
This tutorial is confirmed to be working as of 2022. It will guide you through compiling Newer 1.30.

Requirements

 * Windows 7 or later
 * NewerSMBW Source Code (v1.30)
 * devkitPPC
 * Python 3.x (tested with 3.8 to 3.10)
 * Python libraries: PyYAML, pyelftools
 * NXP 'CodeWarrior Special Edition' for MPC55xx/MPC56xx v2.10

Step 1
Install Python 3. Ensure it is installed to PATH during installation (checkbox in the bottom-left corner of the installer window).

Step 2
Next, install the PyYAML and pyelftools modules. This can be done with the following command in the Command Prompt or Terminal: If you want to be completely sure it installed both of them, run the command again, and you should get two results, both saying the requirement is already satisfied. If you do, then you're ready to move on.

Step 3
Next, install devkitPPC, which can be found here: https://github.com/devkitPro/installer/releases/tag/v3.0.3

For instructions on installing, refer to the "Getting Started" page on the devkitPro wiki: https://devkitpro.org/wiki/Getting_Started

Step 4
The last dependency is NXP 'CodeWarrior Special Edition' for MPC55xx/MPC56xx v2.10. This can be downloaded here. Note that in Google Chrome clicking the link will cause it to close immediately without downloading the file; to get around this, right-click the link, copy the link address, and manually paste the URL into the search bar to visit the site and download the file.

Step 5
If you haven't already, download the NewerSMBW source code from here: https://github.com/Newer-Team/NewerSMBW/archive/refs/heads/cw.zip

Once downloaded, unzip the file, and move onto the next step.

Step 6
Once CodeWarrior is installed, go to the directory it is installed in. CodeWarrior installs by default in this folder: Copy all the files in that folder, and go back to the  folder from the NewerSMBW source code download. Go into the folder named, and create a folder named. Paste the copied files into there.

Now, go back to the previous folder with the CodeWarrior Command Line Tools in it, and go back two folders in the directory, till you're at the root folder: In this folder, copy the file, and go back to the   folder of the NewerSMBW sources. Paste the file there.

Step 7
Now, go back to the  folder. In the folder, scroll down till you see 5 batch (.bat) files. There is one for each Newer Team mod:


 * (Another Super Mario Bros. Wii)
 * (Newer Holiday Special)
 * (Newer Summer Sun)
 * (Newer Super Mario Bros. Wii)
 * (Newer Falling Leaf)

After running one, the built files are placed in a folder called  (where X is the name of the built project). These can be placed into the  (or it's equivalent) folder in the Riivolution patch.

As for Newer, you can run  at any time to compile the NewerSMBW source code. Please keep in mind these compiled files will only work with NewerSMBW version 1.30, and not any other version.

With that, you're done! You've setup the dependencies required to compile NewerSMBW's source code at any time you wish! If you want to start making minor code edits to the game, see this category full of pages with changes you can make to the game!

Credits and Release Information
Original tutorial by User:Nin0 2257, and heavily edited by User:9211tr. Updated/working as of 2021. Also, both Newer Super Mario All-Stars Revived (NSMASR) and NSMBWer have their own files for Riivolution and are incompatible with the files from NewerSMBW, including its object files, layout files, etc.

Requirements
- Windows 10 or later

- Python 3.4.x or later (download here, and click on "Latest Python 3 Release", if you need to use Python 3.4.x, scroll down on the "Stable Releases" section and go to "Python 3.4.4")

- PyLauncher (download here, needed for some programs requiring Python 2.7.x and some requiring Python 3.4.x when it comes to NewerSMBW modding)

- get-pip for Python 3.4.x (download here, only needed for updating to the latest supported version of "pip" for Python 3.4.x {which is "pip" version 19.1.1}</b>)

- devkitPPC r33 or earlier (download here)

- An internet connection

- The NSMASR sources by User:H1dd3nM1nd (CLF78), or the NSMBWer sources by User:Danster64 (download the  file of the NSMASR sources here, or the   file of the NSMBWer sources here)



Step 1
For Python, download the Windows x86  installer file (if you're on a 32-bit Windows OS {x32 or x86}), or the Windows x86-64   installer file (if you're on a 64-bit Windows OS {x64 or x86-64}).

For PyLauncher, download the  installer file (if you're on a 32-bit Windows OS {x32 or x86}), or the   installer file (if you're on a 64-bit Windows OS {x64 or x86-64}).

Once you're done downloading the  installer files, follow the install instructions. For devkitPPC, download the  file (if you're on a 32-bit Windows OS {x32 or x86}), or the   file (if you're on a 64-bit Windows OS {x64 or x86-64}).

Step 2
If you're on Python 3.4.x only,</b> you need to update "pip" (which is the Python package manager) to the latest supported version for Python 3.4.x (which is "pip" version 19.1.1). Place the  file into the   folder. Open the Windows Command Prompt (if you haven't already) and type: If you're on Python 3.5 or later,</b> you can simply update "pip" to the latest version by typing After upgrading, install PyElfTools/PyYAML. In the Windows Command Prompt, type:

Step 3
Extract the NSMASR or NSMBWer  file to. The folder for the NSMASR sources should be called, and the folder for the NSMBWer sources should be called. Then extract the devkitPPC  file to the   folder of the NSMASR or NSMBWer sources folder, as shown below:



Step 4
If it doesn't exist, create a folder called, in the   folder of the NSMASR or NSMBWer sources folder. For NSMASR only,</b> copy the  file (in the   folder, if the file exists) into the   folder, as shown below:



NOTE:</b> In earlier revisions of the NSMASR sources, it wasn't copied into the folder automatically, so it had to be done manually. User:H1dd3nM1nd (CLF78) said he copied the contents inside the  file into another one, so the problem may already be fixed in later revisions of the NSMASR sources.

Step 5
Right-click on and edit the  file in the   folder of the NSMASR or NSMBWer sources folder. You can either edit the path to your own Dolphin Emulator game path (marked in the first picture below), or in the  section of the file, change the   part to   to stop it from moving your compiled   files altogether (marked in the second picture below):



If you have multiple Python versions, make sure that the  file uses Python 3.4.x or later. If you have PyLauncher and your standard Python version is 2.7.x, you can simply replace all occurrences of  (in the   file) to. For NSMBWer only,</b> if  exists in the   file, then replace all occurrences of it to. For NSMASR only,</b> download the CodeWarrior files: <ul style="list-style-type:square;"> <li> (if it shows up as text, right-click and click   or similar, to download the file)</li> <li> </li> <li> </li> <li> </li> <li> </li> </ul> and place them into the  folder of the NSMASR sources folder. Then replace all occurrences of  (in the   file) to. When you're done editing the  file, save your changes. To compile NSMASR or NSMBWer at any time, simply click on the  file (in the   folder of the NSMASR or NSMBWer sources folder). Once the compilation is finished and no syntax errors (or whatever errors) occurred, you're all done. Your compiled  files will be automatically renamed to their readable names, and will be located at the   folder (in the NSMASR sources folder), or the   folder (in the NSMBWer sources folder). Just drag the  files into your   folder in your NSMASR or NSMBWer game patch folder and test your mods out!

How do I resolve the "permission denied" and "read-only filesystem" errors whenever I type a command in the terminal?
Type  for every command in the tutorial, and enter password when prompted. Even better, you can simply type  in the terminal to circumvent all   commands, so you won't have to type   everytime. If you're on Ubuntu Linux or macOS,  doesn't work, so you'll need to type   instead.

<b style="color:#FF0000;">NOTE:</b> 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.

If you're on macOS and still getting "permission denied" errors, even after typing, this is due to Apple's System Integrity Protection (SIP) in OS X 10.11 El Capitan and later. You'll need to enter into recovery mode to disable it. To enter recovery mode: <b style="font-style:italic;">1:</b> If you have multiple internal hard drive partitions/volumes alongside your macOS partition/volume, you'll need to go into System Preferences (the gear icon in the dock, which is at the bottom of the screen), and click Startup Disk. <b style="font-style:italic;">2:</b> Click the lock to make changes and select the disk where your macOS partition/volume is, then restart your Mac. <b style="font-style:italic;">3:</b> As soon as when your Mac starts up, hold down Command-R on the keyboard until the Apple logo shows up, to enter recovery mode. <b style="font-style:italic;">4:</b> In recovery mode, go to  -->. In the terminal, type, then restart your Mac to exit out of recovery mode.

If you're on macOS and also are getting a "read-only filesystem" error, this is due to macOS 10.15 Catalina having a separate read-only volume (for the  directory and critical system files) alongside the writable, user data volume. You'll need to disable Apple's System Integrity Protection (SIP), first, following the steps above. Afterwards, open the terminal (if you haven't already) and type, to make the   directory writable again.

This change will automatically be reverted when you restart your Mac. For it to be permanent (at least whenever you start the terminal), when the terminal is open (and you've clicked on the terminal window), go to  -->   -->   -->. Under the Startup section in the terminal preferences window, check the box that says  and. In the text box, type the command, and exit the terminal preferences window. Now everytime you start up the terminal, you'll always be able to modify the  directory.

Debian/Ubuntu Linux and macOS
<b style="color:#FF0000;">NOTE:</b> Make sure to use  instead, as   doesn't work on Ubuntu or macOS. Also if you're on macOS, make sure to use, for the GNU "SED" (stream editor application) instead, not  , because   on macOS is a script editor application, not the GNU "SED" (stream editor application). Copy the  folder by typing the commands: 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:</b> Do not have  as   or your current NewerSMBW sources will be OVERWRITTEN.

Copying the file
Type these commands in the terminal:

NSMASR and NSMBWer sources
Copy the  or   folder by right-clicking on the folder and clicking. After that, go to the new location that you want it to be in and right-click and click. If you need an unmodified and fresh copy, open the NSMASR or NSMBWer  file (that you previously downloaded) and extract it to the new location that you want it to be in. If you want to rename the folder in the new location after copying it or extracting the  file, right-click on it and click.

Additional steps required for an unmodified and fresh copy of NSMASR and NSMBWer
Extract the devkitPPC  file (that you previously downloaded) to the   folder of the NSMASR or NSMBWer sources folder. If it doesn't exist, create a folder called, in the   folder of the NSMASR or NSMBWer sources folder. Right-click on and edit the  file. If you have multiple Python versions, make sure that the  file uses Python 3.4.x or later. If you have PyLauncher and your standard Python version is 2.7.x, you can simply replace all occurrences of  (in the   file) to. <b style="font-style:italic;">For NSMBWer only,</b> if  exists in the   file, then replace all occurrences of it to. <b style="font-style:italic;">For NSMASR only,</b> copy the  file (in the   folder, if the file exists) into the   folder. After that, download the CodeWarrior files: <ul style="list-style-type:square;"> <li> (if it shows up as text, right-click and click   or similar, to download the file)</li> <li> </li> <li> </li> <li> </li> <li> </li> </ul> and place them into the  folder of the NSMASR sources folder. Then replace all occurrences of  (in the   file) to. When you're done editing the  file, save your changes.