From 29d8b48503f3064cdc1f3a87c01b4264e716a220 Mon Sep 17 00:00:00 2001 From: Palaui Date: Tue, 9 Dec 2014 13:10:05 +0100 Subject: Corrected some bugs... [core] Added SetMousePosition() [models] LoadHeightmap() - Corrected textures bug [raymath] Functions renaming [WEB] Prepare environment for emscripten! --- src/makefile | 31 +++++++++++++++++++++++-------- 1 file changed, 23 insertions(+), 8 deletions(-) (limited to 'src/makefile') diff --git a/src/makefile b/src/makefile index bb37748a..76984bbe 100644 --- a/src/makefile +++ b/src/makefile @@ -24,7 +24,7 @@ #************************************************************************************************** # define raylib platform (by default, compile for RPI) -# Other possible platforms: PLATFORM_DESKTOP PLATFORM_DESKTOP_LINUX +# Other possible platforms: PLATFORM_DESKTOP_WIN PLATFORM_DESKTOP_LINUX PLATFORM_DESKTOP_MAC PLATFORM_WEB PLATFORM ?= PLATFORM_RPI # define raylib graphics api depending on selected platform @@ -40,16 +40,26 @@ endif # NOTE: makefiles targets require tab indentation # define compiler: gcc for C program, define as g++ for C++ -CC = gcc +ifeq ($(PLATFORM),PLATFORM_WEB) + # define emscripten compiler + CC = emcc +else + # define default gcc compiler + CC = gcc +endif # define compiler flags: # -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 else - CFLAGS = -O2 -Wall -std=c99 -fgnu89-inline + CFLAGS = -O2 -Wall -std=c99 +endif endif #CFLAGSEXTRA = -Wextra -Wmissing-prototypes -Wstrict-prototypes @@ -69,11 +79,16 @@ default: raylib # compile raylib library raylib: $(OBJS) +ifeq ($(PLATFORM),PLATFORM_WEB) + emcc $(OBJS) -o raylib.bc +else ar rcs libraylib.a $(OBJS) +endif # compile core module +# emcc core.c -o core.bc -DPLATFORM_DESKTOP core.o: core.c - $(CC) -c core.c $(CFLAGS) $(INCLUDES) -D$(PLATFORM) + $(CC) -c core.c $(CFLAGS) $(INCLUDES) -D$(PLATFORM) -D$(GRAPHICS) # compile rlgl module rlgl.o: rlgl.c @@ -85,19 +100,19 @@ raymath.o: raymath.c # compile shapes module shapes.o: shapes.c - $(CC) -c shapes.c $(CFLAGS) $(INCLUDES) -D$(PLATFORM) + $(CC) -c shapes.c $(CFLAGS) $(INCLUDES) -D$(PLATFORM) -D$(GRAPHICS) # compile textures module textures.o: textures.c - $(CC) -c textures.c $(CFLAGS) $(INCLUDES) -D$(PLATFORM) + $(CC) -c textures.c $(CFLAGS) $(INCLUDES) -D$(PLATFORM) -D$(GRAPHICS) # compile text module text.o: text.c - $(CC) -c text.c $(CFLAGS) $(INCLUDES) -D$(PLATFORM) + $(CC) -c text.c $(CFLAGS) $(INCLUDES) -D$(PLATFORM) -D$(GRAPHICS) # compile models module models.o: models.c - $(CC) -c models.c $(CFLAGS) $(INCLUDES) -D$(PLATFORM) + $(CC) -c models.c $(CFLAGS) $(INCLUDES) -D$(PLATFORM) -D$(GRAPHICS) # compile audio module audio.o: audio.c -- cgit v1.2.3 From a2c8ddca1345722603637bddc3421f64025d7e5e Mon Sep 17 00:00:00 2001 From: Palaui Date: Tue, 9 Dec 2014 13:10:28 +0100 Subject: Revert "Corrected some bugs..." This reverts commit 29d8b48503f3064cdc1f3a87c01b4264e716a220. --- src/makefile | 31 ++++++++----------------------- 1 file changed, 8 insertions(+), 23 deletions(-) (limited to 'src/makefile') diff --git a/src/makefile b/src/makefile index 76984bbe..bb37748a 100644 --- a/src/makefile +++ b/src/makefile @@ -24,7 +24,7 @@ #************************************************************************************************** # define raylib platform (by default, compile for RPI) -# Other possible platforms: PLATFORM_DESKTOP_WIN PLATFORM_DESKTOP_LINUX PLATFORM_DESKTOP_MAC PLATFORM_WEB +# Other possible platforms: PLATFORM_DESKTOP PLATFORM_DESKTOP_LINUX PLATFORM ?= PLATFORM_RPI # define raylib graphics api depending on selected platform @@ -40,26 +40,16 @@ endif # NOTE: makefiles targets require tab indentation # define compiler: gcc for C program, define as g++ for C++ -ifeq ($(PLATFORM),PLATFORM_WEB) - # define emscripten compiler - CC = emcc -else - # define default gcc compiler - CC = gcc -endif +CC = gcc # define compiler flags: # -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 else - CFLAGS = -O2 -Wall -std=c99 -endif + CFLAGS = -O2 -Wall -std=c99 -fgnu89-inline endif #CFLAGSEXTRA = -Wextra -Wmissing-prototypes -Wstrict-prototypes @@ -79,16 +69,11 @@ default: raylib # compile raylib library raylib: $(OBJS) -ifeq ($(PLATFORM),PLATFORM_WEB) - emcc $(OBJS) -o raylib.bc -else ar rcs libraylib.a $(OBJS) -endif # compile core module -# emcc core.c -o core.bc -DPLATFORM_DESKTOP core.o: core.c - $(CC) -c core.c $(CFLAGS) $(INCLUDES) -D$(PLATFORM) -D$(GRAPHICS) + $(CC) -c core.c $(CFLAGS) $(INCLUDES) -D$(PLATFORM) # compile rlgl module rlgl.o: rlgl.c @@ -100,19 +85,19 @@ raymath.o: raymath.c # compile shapes module shapes.o: shapes.c - $(CC) -c shapes.c $(CFLAGS) $(INCLUDES) -D$(PLATFORM) -D$(GRAPHICS) + $(CC) -c shapes.c $(CFLAGS) $(INCLUDES) -D$(PLATFORM) # compile textures module textures.o: textures.c - $(CC) -c textures.c $(CFLAGS) $(INCLUDES) -D$(PLATFORM) -D$(GRAPHICS) + $(CC) -c textures.c $(CFLAGS) $(INCLUDES) -D$(PLATFORM) # compile text module text.o: text.c - $(CC) -c text.c $(CFLAGS) $(INCLUDES) -D$(PLATFORM) -D$(GRAPHICS) + $(CC) -c text.c $(CFLAGS) $(INCLUDES) -D$(PLATFORM) # compile models module models.o: models.c - $(CC) -c models.c $(CFLAGS) $(INCLUDES) -D$(PLATFORM) -D$(GRAPHICS) + $(CC) -c models.c $(CFLAGS) $(INCLUDES) -D$(PLATFORM) # compile audio module audio.o: audio.c -- cgit v1.2.3 From d3cf316e40b531542b6f55b965f3369d4aca28d6 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Tue, 9 Dec 2014 13:21:55 +0100 Subject: Added features and corrected bugs... [core] Added SetMousePosition() [models] LoadHeightmap() - Corrected textures bug [raymath] Functions renaming [WEB] Prepare environment for emscripten! --- src/makefile | 31 +++++++++++++++++++++++-------- 1 file changed, 23 insertions(+), 8 deletions(-) (limited to 'src/makefile') diff --git a/src/makefile b/src/makefile index bb37748a..2a905052 100644 --- a/src/makefile +++ b/src/makefile @@ -24,7 +24,7 @@ #************************************************************************************************** # define raylib platform (by default, compile for RPI) -# Other possible platforms: PLATFORM_DESKTOP PLATFORM_DESKTOP_LINUX +# Other possible platforms: PLATFORM_DESKTOP_WIN PLATFORM_DESKTOP_LINUX PLATFORM_WEB PLATFORM ?= PLATFORM_RPI # define raylib graphics api depending on selected platform @@ -40,16 +40,26 @@ endif # NOTE: makefiles targets require tab indentation # define compiler: gcc for C program, define as g++ for C++ -CC = gcc +ifeq ($(PLATFORM),PLATFORM_WEB) + # define emscripten compiler + CC = emcc +else + # define default gcc compiler + CC = gcc +endif # define compiler flags: # -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 else - CFLAGS = -O2 -Wall -std=c99 -fgnu89-inline + CFLAGS = -O2 -Wall -std=c99 +endif endif #CFLAGSEXTRA = -Wextra -Wmissing-prototypes -Wstrict-prototypes @@ -69,11 +79,16 @@ default: raylib # compile raylib library raylib: $(OBJS) +ifeq ($(PLATFORM),PLATFORM_WEB) + emcc $(OBJS) -o raylib.bc +else ar rcs libraylib.a $(OBJS) +endif # compile core module +# emcc core.c -o core.bc -DPLATFORM_DESKTOP core.o: core.c - $(CC) -c core.c $(CFLAGS) $(INCLUDES) -D$(PLATFORM) + $(CC) -c core.c $(CFLAGS) $(INCLUDES) -D$(PLATFORM) -D$(GRAPHICS) # compile rlgl module rlgl.o: rlgl.c @@ -85,19 +100,19 @@ raymath.o: raymath.c # compile shapes module shapes.o: shapes.c - $(CC) -c shapes.c $(CFLAGS) $(INCLUDES) -D$(PLATFORM) + $(CC) -c shapes.c $(CFLAGS) $(INCLUDES) -D$(PLATFORM) -D$(GRAPHICS) # compile textures module textures.o: textures.c - $(CC) -c textures.c $(CFLAGS) $(INCLUDES) -D$(PLATFORM) + $(CC) -c textures.c $(CFLAGS) $(INCLUDES) -D$(PLATFORM) -D$(GRAPHICS) # compile text module text.o: text.c - $(CC) -c text.c $(CFLAGS) $(INCLUDES) -D$(PLATFORM) + $(CC) -c text.c $(CFLAGS) $(INCLUDES) -D$(PLATFORM) -D$(GRAPHICS) # compile models module models.o: models.c - $(CC) -c models.c $(CFLAGS) $(INCLUDES) -D$(PLATFORM) + $(CC) -c models.c $(CFLAGS) $(INCLUDES) -D$(PLATFORM) -D$(GRAPHICS) # compile audio module audio.o: audio.c -- cgit v1.2.3 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 From 905b6ec53df01a4f660c12c08c32e2cc301f7ad6 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Wed, 31 Dec 2014 18:03:32 +0100 Subject: Added full support for HTML5 (emscripten) Corrected some bugs on the way... Automatically convert textures to POT on RPI and WEB --- src/makefile | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'src/makefile') diff --git a/src/makefile b/src/makefile index 88d2258c..501bd0c9 100644 --- a/src/makefile +++ b/src/makefile @@ -1,8 +1,6 @@ #************************************************************************************************** # -# raylib for Raspberry Pi and Windows desktop -# -# makefile for library compilation (raylib.a) +# raylib makefile for desktop platforms, Raspberry Pi and HTML5 (emscripten) # # Copyright (c) 2014 Ramon Santamaria (Ray San - raysan@raysanweb.com) # @@ -23,8 +21,8 @@ # #************************************************************************************************** -# define raylib platform (by default, compile for RPI) -# Other possible platforms: PLATFORM_DESKTOP_WIN PLATFORM_DESKTOP_LINUX PLATFORM_WEB +# define raylib platform to compile for +# possible platforms: PLATFORM_DESKTOP PLATFORM_RPI PLATFORM_WEB PLATFORM ?= PLATFORM_DESKTOP # define raylib graphics api depending on selected platform @@ -81,7 +79,7 @@ default: raylib # compile raylib library raylib: $(OBJS) ifeq ($(PLATFORM),PLATFORM_WEB) - emcc -O1 $(OBJS) -o raylib.bc + emcc -O1 $(OBJS) -o libraylib.bc else ar rcs libraylib.a $(OBJS) endif @@ -135,9 +133,13 @@ else ifeq ($(PLATFORM),PLATFORM_DESKTOP_LINUX) find . -type f -executable -delete rm -f *.o libraylib.a +else +ifeq ($(PLATFORM),PLATFORM_WEB) + del *.o libraylib.bc else del *.o libraylib.a endif +endif endif @echo Cleaning done -- cgit v1.2.3