First SDL2 has to be installed in the system. It can be done from the sources:
curl -O https://www.libsdl.org/release/SDL2-2.0.12.tar.gz
tar xzvf SDL2-2.0.12.tar.gz
cd SDL2-2.0.12
mkdir build
cd build
cmake .. -DCMAKE_INSTALL_PREFIX:PATH=/usr/local
make
sudo make install
Or via MacPorts (also via Homebrew but I don't use it):
sudo port install libsdl2
Now build the SDL tools. If SDL2 was compiled from source:
cd tools/sdl
cp Makefile.mac Makefile
make
If you installed it with MacPorts use CFLAGS to tell make where the library is installed:
cd tools/sdl
cp Makefile.mac Makefile
make CFLAGS=-I/opt/local/include/
Note: You can ommit copying the Makefile.mac to Makefile by telling make which file to use like this: make -f Makefile.mac.
Now compile the library source code with SDL emulation support:
cd ../../src
cp Makefile.mac Makefile
make SDL_EMULATION=y
And finaly build and run some demos!
cd ../tools
./build_and_run.sh -p mac -e -f demos/ssd1306_demo
./build_and_run.sh -p mac -e -f games/arkanoid8
First SDL2 has to be installed in the system. It can be done from the sources:
Or via MacPorts (also via Homebrew but I don't use it):
Now build the SDL tools. If SDL2 was compiled from source:
If you installed it with MacPorts use CFLAGS to tell make where the library is installed:
Note: You can ommit copying the
Makefile.mac
toMakefile
by tellingmake
which file to use like this:make -f Makefile.mac
.Now compile the library source code with SDL emulation support:
And finaly build and run some demos!