From ad565b18cf0d526cc90e017fa096422648d60a6e Mon Sep 17 00:00:00 2001 From: "H. Diedrich" Date: Sat, 12 Apr 2014 22:28:20 +0200 Subject: [PATCH] build for Mac 10.8; make clean; notes in README --- .gitignore | 1 + Makefile | 11 +++++++++++ README.md | 20 +++++++++++++++----- c_src/Makefile | 3 ++- 4 files changed, 29 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index dbe3e92..11f1186 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ c_src/env.mk ebin examples/*/*.beam priv +.DS_Store diff --git a/Makefile b/Makefile index ed7c196..94c2d41 100644 --- a/Makefile +++ b/Makefile @@ -19,3 +19,14 @@ all: cd c_src && make erlc -o examples/bullet_engine examples/bullet_engine/*.erl cd examples/bullet_engine && ./start.sh + +hello: + erlc -o examples/hello_sdl examples/hello_sdl/*.erl + cd examples/hello_sdl && ./start.sh + +clean: + @rm -f *.swp + @rm -f c_src/env.mk + @rm -rf ebin/ + @rm -f examples/*/*.beam + @echo clean diff --git a/README.md b/README.md index a5fb1da..44c06de 100644 --- a/README.md +++ b/README.md @@ -1,19 +1,29 @@ ESDL2 ===== -SDL2 Erlang NIF. +SDL2 Erlang NIFs + +SDL provides cross-platform low level access to graphics, audio, keyboard, mouseand joystick hardware via OpenGL and Direct3D. This is an Erlang binding. http://www.libsdl.org/ Status ------ Week-end project. Work in progress. - -The following limitations apply: - + + Building + -------- + * Erlang 17.0+ is required - * SDL 2.0.3+ is required + * SDL 2.0.3+ is required (`http://www.libsdl.org/download-2.0.php`) + * SDL\_image is required (`https://www.libsdl.org/projects/SDL_image/`) * No support for UTF-8 strings, only Latin-1 +Tip: configure SDL\_image with --disable-webp for not having to install libwebp. + +Build using `make`. + +Ideas +----- The following ideas need to be investigated: * We may benefit from the reference receive optimization when doing calls diff --git a/c_src/Makefile b/c_src/Makefile index 0887c86..7fa7c94 100644 --- a/c_src/Makefile +++ b/c_src/Makefile @@ -20,7 +20,8 @@ SDL2_LIBS = $(filter-out $(SDL2_LIBS_FILTER_OUT),$(shell sdl2-config --static-li all: env.mk mkdir -p $(PRIV_DIR) - gcc *.c -fPIC -shared -o $(PRIV_DIR)/esdl2.so -I $(ERTS_INCLUDE_DIR) \ + gcc -undefined dynamic_lookup *.c -fPIC -shared \ + -o $(PRIV_DIR)/esdl2.so -I $(ERTS_INCLUDE_DIR) \ `sdl2-config --cflags` $(SDL2_LIBS) -lSDL2_image env.mk: