From cfa60ab7e6313f85594f63d2830fdc2ce19e180e Mon Sep 17 00:00:00 2001 From: raysan5 Date: Mon, 15 Dec 2014 01:08:30 +0100 Subject: Added support for emscripten and more Added PLATFORM_WEB support (emscripten-webgl) [audio] Added LoadSoundFromWave() [textures] Added LoadTextureFromImage() to replace CreateTexture() Some TraceLogs edited... --- src/makefile | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'src/makefile') diff --git a/src/makefile b/src/makefile index 2a905052..88d2258c 100644 --- a/src/makefile +++ b/src/makefile @@ -25,7 +25,7 @@ # define raylib platform (by default, compile for RPI) # Other possible platforms: PLATFORM_DESKTOP_WIN PLATFORM_DESKTOP_LINUX PLATFORM_WEB -PLATFORM ?= PLATFORM_RPI +PLATFORM ?= PLATFORM_DESKTOP # define raylib graphics api depending on selected platform ifeq ($(PLATFORM),PLATFORM_RPI) @@ -37,6 +37,10 @@ else #GRAPHICS = GRAPHICS_API_OPENGL_33 # Uncomment to use OpenGL 3.3 endif +ifeq ($(PLATFORM),PLATFORM_WEB) + GRAPHICS = GRAPHICS_API_OPENGL_ES2 +endif + # NOTE: makefiles targets require tab indentation # define compiler: gcc for C program, define as g++ for C++ @@ -52,15 +56,12 @@ endif # -O2 defines optimization level # -Wall turns on most, but not all, compiler warnings # -std=c99 use standard C from 1999 revision -ifeq ($(PLATFORM),PLATFORM_WEB) - CFLAGS = -O3 -s USE_GLFW=3 -s LEGACY_GL_EMULATION=1 -else ifeq ($(PLATFORM),PLATFORM_RPI) - CFLAGS = -O2 -Wall -std=gnu99 -fgnu89-inline + CFLAGS = -O1 -Wall -std=gnu99 -fgnu89-inline else - CFLAGS = -O2 -Wall -std=c99 -endif + CFLAGS = -O1 -Wall -std=c99 endif + #CFLAGSEXTRA = -Wextra -Wmissing-prototypes -Wstrict-prototypes # define any directories containing required header files @@ -80,7 +81,7 @@ default: raylib # compile raylib library raylib: $(OBJS) ifeq ($(PLATFORM),PLATFORM_WEB) - emcc $(OBJS) -o raylib.bc + emcc -O1 $(OBJS) -o raylib.bc else ar rcs libraylib.a $(OBJS) endif @@ -92,7 +93,7 @@ core.o: core.c # compile rlgl module rlgl.o: rlgl.c - $(CC) -c rlgl.c $(CFLAGS) $(INCLUDES) -D$(GRAPHICS) + $(CC) -c rlgl.c $(CFLAGS) $(INCLUDES) -D$(PLATFORM) -D$(GRAPHICS) # compile raymath module raymath.o: raymath.c -- cgit v1.2.3