aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2014-06-10 15:04:50 +0200
committerLoïc Hoguin <[email protected]>2014-06-10 15:06:54 +0200
commitffd1173d7c70c57c3d184f4542e592f56030b259 (patch)
treeeb60d0364f6e2781145dc6964520ec2dabdd7310 /Makefile
parent6434c3b970e987b8a2f311d67b359506eaeed4eb (diff)
downloadesdl2-ffd1173d7c70c57c3d184f4542e592f56030b259.tar.gz
esdl2-ffd1173d7c70c57c3d184f4542e592f56030b259.tar.bz2
esdl2-ffd1173d7c70c57c3d184f4542e592f56030b259.zip
Use erlang.mk with newly added NIF support!
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile16
1 files changed, 11 insertions, 5 deletions
diff --git a/Makefile b/Makefile
index ed7c196..c3e58e2 100644
--- a/Makefile
+++ b/Makefile
@@ -12,10 +12,16 @@
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-all:
- rm -rf ebin/
- mkdir -p ebin/
- erlc -o ebin/ src/*.erl
- cd c_src && make
+PROJECT = esdl2
+
+# SDL 2.0.3 has this option enabled that causes problems with NIF functions.
+SDL2_LIBS_FILTER_OUT = -Wl,--no-undefined
+SDL2_LIBS = $(filter-out $(SDL2_LIBS_FILTER_OUT),$(shell sdl2-config --static-libs))
+
+C_SRC_OPTS = $(shell sdl2-config --cflags) $(SDL2_LIBS) -lSDL2_image
+
+include erlang.mk
+
+bullet_engine:: all
erlc -o examples/bullet_engine examples/bullet_engine/*.erl
cd examples/bullet_engine && ./start.sh