Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add macOS support in emulation mode #19

Merged
merged 1 commit into from
Jun 9, 2020
Merged

Conversation

enekochan
Copy link
Contributor

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

@CLAassistant
Copy link

CLAassistant commented Jun 8, 2020

CLA assistant check
All committers have signed the CLA.

@lexus2k
Copy link
Owner

lexus2k commented Jun 9, 2020

Thank you for the great job.
I'm really inspired by your changes, they are very accurate.

@lexus2k lexus2k merged commit 77a4b4b into lexus2k:master Jun 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants