These instructions cover building 32blit on macOS.
You will need build tools and CMake. Assuming you have homebrew installed:
xcode-select --install
brew install cmakeBefore trying to install python3, it's worth checking if you already have it installed (and if so, which version), by jumping to 'Verifying install', below. If you do already have it installed, skip this section.
Installing python3 can be done with homebrew with a simple brew install python which installs both python3 and pip3.
before installing 32blit tools, some binary requirements are needed:
brew install libjpeg
brew install freetype
Then install 32blit tools itself.
pip3 install 32blit
TODO: Document install of construct and bitstring for Python 3 (probably need a requirements.txt for the tools directory)
python3 --version(expected output Python 3.7.x)
and
pip3 --version(expected output pip x.x.x from /usr/local/lib/python3.7/site-packages/pip (python 3.7) or similar)
Once this is done, you'll need to install gcc-arm-none-eabi. The easiest way to install this tool is via homebrew with the following source:
brew tap ArmMbed/homebrew-formulae
brew install arm-none-eabi-gccNote:
If you do not want to/ are unable to use homebrew to do this, you should be able to find the manual install instruction in the arm-none-eabi-gcc.rb file in this repository.
If you want to run code on 32Blit, you should now refer to Building & Running On 32Blit.
You'll need to install SDL2, SDL2 Image and SDL2 Net
brew install sdl2 sdl2_image sdl2_netYou also need something to build. The 32blit-examples repository includes a series of demos showcasing various 32blit SDK features. These instructions will assume you're building those and have cloned or extracted that repository alongside 32blit-sdk:
git clone https://github.com/32blit/32blit-examplesYour directory tree should look something like:
- root_dir
- 32blit-sdk
- 32blit-examples
Create a build directory and configure the examples. The 32blit-sdk should be automatically detected:
mkdir build
cd build
cmake ..Now to make any example, type:
make example-nameFor example:
make raycasterThis will produce examples/raycaster/raycaster which you should run with:
./examples/raycaster/raycasterAlternatively you can build everything by just typing:
makeWhen the build completes you should be able to run any example.
If you see cannot create target because another target with the same name already exists you've probably run cmake .. in the wrong directory (the project directory rather than the build directory), you should remove all but your project files and cmake .. again from the build directory.