wut/README.md

80 lines
2.5 KiB
Markdown
Raw Normal View History

2019-11-20 17:02:38 +00:00
[![Build status](https://github.com/devkitPro/wut/workflows/C%2FC%2B%2B%20CI/badge.svg)](https://github.com/devkitPro/wut/actions?workflow=C%2FC%2B%2B+CI)
2017-06-02 13:32:58 +01:00
2015-12-27 02:15:51 +00:00
# wut
Let's try make a Wii U Toolchain / SDK for creating rpx/rpl.
2015-12-27 02:18:13 +00:00
Licensed under the terms of the GNU General Public License, version 2 or later (GPLv2+).
2018-06-15 10:45:13 +01:00
## Install
2019-01-27 14:20:17 +00:00
It is recommended to install wut by using the [devkitPro package manager](https://devkitpro.org/wiki/devkitPro_pacman)
2018-06-15 10:45:13 +01:00
2019-01-27 14:20:17 +00:00
For example you might do:
2018-06-15 10:45:13 +01:00
```
2019-01-27 14:20:17 +00:00
sudo dkp-pacman -Syu devkitPPC wut-tools wut
2018-06-15 10:45:13 +01:00
```
2018-06-14 12:26:25 +01:00
## Usage
See [samples](samples) for examples of how to use wut.
The [share/wut.cmake](share/wut.cmake) file provides some helpers for your build:
- `wut_create_rpx(target)` - Will create an .rpx file from your CMake target generated by `add_executable`
- `wut_create_rpl(target)` - Will create an .rpl file from your CMake target generated by `add_executable`
- `wut_add_exports(target exports.def)` - Will add exports specified in exports.def for the given target
2018-06-14 12:26:25 +01:00
2019-11-20 12:23:22 +00:00
## Building from source
2018-06-14 12:26:25 +01:00
Requires:
- [devkitPPC](https://devkitpro.org/wiki/Getting_Started)
2019-11-20 12:23:22 +00:00
- [wut-tools](https://github.com/devkitPro/wut-tools)
2017-03-23 12:19:27 +00:00
### Building with devkitPPC
Ensure you have the devkitPPC and wut-tools packages provided by [devkitPro](https://devkitpro.org/wiki/Getting_Started):
2019-01-07 12:21:11 +00:00
```
2019-01-18 16:04:32 +00:00
sudo dkp-pacman -Syu devkitPPC wut-tools
export DEVKITPRO=/opt/devkitpro
2019-01-07 12:21:11 +00:00
export DEVKITPPC=/opt/devkitpro/devkitPPC
2018-06-14 09:33:23 +01:00
```
2019-11-20 12:23:22 +00:00
Then it's as simple as running make or make install:
```
2019-11-20 12:23:22 +00:00
make
2017-04-08 17:25:08 +09:30
make install
```
2019-11-20 12:23:22 +00:00
### Building with a locally built wut-tools
If you have locally built wut-tools then just add the directory containing the built binaries to PATH and they should be used instead:
```
2019-11-20 12:23:22 +00:00
export PATH=/path/to/wut-tools/bin:$PATH
make
```
2019-01-18 16:04:32 +00:00
2019-11-20 12:23:22 +00:00
## Building wut projects
### Building wut projects with make
Simply export the required variables and call make.
2019-01-18 16:04:32 +00:00
```
2019-11-20 12:23:22 +00:00
export DEVKITPRO=/opt/devkitpro
export DEVKITPPC=/opt/devkitpro/devkitPPC
make
```
### Building wut projects with CMake
For any wut project you want to build with CMake you must use the wut.toolchain.cmake toolchain file:
```
export DEVKITPRO=/opt/devkitpro
cd samples/cmake/helloworld
2019-01-18 16:04:32 +00:00
mkdir build && cd build
2019-11-20 12:23:22 +00:00
cmake -DCMAKE_TOOLCHAIN_FILE=$DEVKITPRO/wut/share/wut.toolchain.cmake ../
2019-01-18 16:04:32 +00:00
make
```
2019-11-20 12:23:22 +00:00
A minimal CMakeLists.txt file for a C++ project might look like:
```
cmake_minimum_required(VERSION 3.2)
project(helloworld_cpp CXX)
include("${DEVKITPRO}/wut/share/wut.cmake" REQUIRED)
add_executable(helloworld_cpp main.cpp)
wut_create_rpx(helloworld_cpp.rpx helloworld_cpp)
```